ok, let's start making sense now: typdef char * str;
[svn/Cll1h/.git] / cll1.h
diff --git a/cll1.h b/cll1.h
index b3c65a41e204708ea4cb2a37554a66fb7d903bd1..1d95db282f7c933a3218ddc412e6e444475b143b 100644 (file)
--- a/cll1.h
+++ b/cll1.h
@@ -53,7 +53,7 @@
 #include <mysql/mysql.h>
 #endif
 /* .----------------------------------------------------------------------.
-  /  2. C<<1 then buddhist section, updated 2008-01-26 xCh.
+  /  1. C<<1 then buddhist section, updated 2008-02-01 xCh.
  '----------------------------------------------------------------------- */
 #ifndef DISABLE_MODULE_THEN_BUDDHISM 
 #define then
 #define WHOKNOWS (int)(srandom((unsigned)time(NULL)),random()%2)
 #define create_var(ID,TYPE,EXPR) TYPE ID=(EXPR)
 #define def_var(ID,TYPE) TYPE ID
-//#define _CLL1_YES char *YES="TRUE\nYES\nJA\nOUI\nDA\nANO\nY\n1";
+//#define _CLL1_YES str YES="TRUE\nYES\nJA\nOUI\nDA\nANO\nY\n1";
 //#define atob(EXPR) (word_in_stri(YES,(EXPR))?1:0)
 //#else
-#define _CLL1_YES char *YES="TRUE";
+#define _CLL1_YES str YES="TRUE";
 #define atob(EXPR) (eqi((EXPR),YES)?1:0)
 #endif
 /* .----------------------------------------------------------------------.
-  /  1. C<<1 almost then buddhist section, updated 2008-01-26 xCh.
+  /  2. C<<1 almost then buddhist section, updated 2008-02-02 xCh.
  '----------------------------------------------------------------------- */
+typedef char * str;
+typedef FILE * file;
+typedef int bool;
 #define not !
 #define and &&
 #define or ||
-#define bool int
 #define TRUE 1
 #define FALSE 0
 #define WEIRDINT (1<<(sizeof(int)*8-1))
 #define btoa(EXPR) ((EXPR)?"TRUE":"FALSE")
 #define coalesce(VAR,EXPR) (VAR?VAR:(EXPR))
-#define _CLL1_GLOBALS char *NIL="NULL", *EOL="\n", *OFS=" ", *IFS=" \t\n"; unsigned RANDOM_SEED=0;
+#define _CLL1_GLOBALS str NIL="NULL", EOL="\n", OFS=" ", IFS=" \t\n"; unsigned RANDOM_SEED=0;
 /* .----------------------------------------------------------------------.
   /  4. C<<1 data declaration and allocation, updated 2008-01-31 xCh.
  '----------------------------------------------------------------------- */
 #define init_mem(...)  _mem_##TYPE##_( _ARG2(__VA_ARGS__,,) - 0 )
 #define construct_mem(TYPE) (struct TYPE *)_mem_##TYPE##_(void) { create_mem(this,TYPE);/* <-' */ _init_mem_##TYPE##_(this); return this; } _init_mem_##TYPE##_(this_is(TYPE))
 #define create_list(ID1,I2,TYPE) create_mem(ID1,TYPE); struct TYPE *ID2=((ID1->__next=NULL),ID1)
-#define create_str(ID,EXPR) char *ID=(EXPR)
-#define new_str(ID,...) char *ID=_cll1_get_str(__VA_ARGS__,NIL)
-#define def_str(ID) char *ID=NULL
-#define get_str(...) _cll1_get_str(__VA_ARGS__,NIL)
 #define create_context(ID) create_mem(ID,_CTXAtom)
 #define def_context(ID) def_mem(ID,_CTXAtom)
 #define list(TYPE) struct TYPE *__next
 /* .----------------------------------------------------------------------.
   /  5. C<<1 string manipulation, updated 2008-01-26 xCh.
  '----------------------------------------------------------------------- */
+#define get_str(...) _cll1_get_str(__VA_ARGS__,NIL)
 #define eq(A,B) !_cll1_strcmp(A,B)
 #define eqi(A,B) !_cll1_strcmpi(A,B)
 #define in_str(A,B) _cll1_strstr(A,B)
 #define this_arg argv[_I]
 #define next_arg ((_I+1<argc)?argv[_I]:NULL)
 #define skip_next _I++
-#define if_exists(A,B,C) for_search(A,B,C) break; if(A)
+#define if_exists(NODE,HEAD,EXPR) for_search(NODE,HEAD,EXPR) break; if(NODE)
 #define if_args if(argc>1)
 #define switch_for_args  for_args switch_str(this_arg)
 #define switch_str(STR) _NEW(S,STR)
This page took 0.116455 seconds and 4 git commands to generate.