-/* ------------------------------------------------------------------- */
-/* C<<1 header file v0.7.1 - style sheet for ANSI C */
-/* CERL - Cumbersome Extraction and Report Language */
-/* ------------------------------------------------------------------- */
-/* Copyright (c) 2004-2008 Michael xChaos Polak, x(at)n.cz
+/* ,-----------------------------------------------------------------------
+ / C<<1 header file - C language style sheet - GNU C/ANSI C99 compliant
+ / Cumbersome Extraction and Report Language - http://cll1h.arachne.cz/ /
+'---------------------------------------------------------------------- */
+/*
+ Copyright (c) 2004-2008 Michael xChaos Polak - x(at)n.cz
The C<<1 header file is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
#ifndef _CLL1_H
#define _CLL1_H
-
+#define CLL1H_VERSION "0.7.1"
+/* ,-----------------------------------------------------------------------
+ / 0. Library definitions not parsed by @CC, updated 2008-01-26 xCh.
+ '---------------------------------------------------------------------- */
+/*
+@define USE_LIBRARY_MYSQL -lmysqlclient
+@define USE_LIBRARY_FASTCGI -lfcgi
+@define USE_PREPROCESSOR cake *.html *.xml > _include.c
+@define USE_POSTPROCESSOR strip @
+*/
+/* ,-----------------------------------------------------------------------
+ / 1. C<<1 header auto include, updated 2008-01-26 xCh.
+ '---------------------------------------------------------------------- */
#include <string.h>
#include <malloc.h>
#include <time.h>
#else
#include <stdio.h>
#endif
-/* ------------------------------------------------------------------- */
-/* 1. C<<1 constants and optional keywords, updated 2008-01-07 by xCh. */
-/* ------------------------------------------------------------------- */
+/* ,-----------------------------------------------------------------------
+ / 2. C<<1 then buddhist section, updated 2008-01-26 xCh.
+ '----------------------------------------------------------------------- */
+#ifndef DISABLE_MODULE_THEN_BUDDHISM
#define then
+#define MAYBE (int)((RANDOM_SEED?random():(RANDOM_SEED=time(NULL),srandom(RANDOM_SEED),random()))%2)
+#define WHOKNOWS (int)(srandom(time(NULL)),random()%2)
+#define Create_var(ID,TYPE,INIT) TYPE ID=INIT
+#define Define_var(ID,TYPE) TYPE ID
+#endif
+/* ,-----------------------------------------------------------------------
+ / 3. C<<1 constants and optional keywords, updated 2008-01-26 xCh.
+ '----------------------------------------------------------------------- */
#define not !
#define and &&
#define or ||
#define boolean int
-#define bool_str(VALUE) (VALUE?"TRUE":"FALSE")
+#define bool_str(VALUE) ((VALUE)?"TRUE":"FALSE")
#define TRUE 1
#define FALSE 0
-#define MAYBE (int)((RANDOM_SEED?random():(RANDOM_SEED=time(NULL),srandom(RANDOM_SEED),random()))%2)
-#define WHOKNOWS (int)(srandom(time(NULL)),random()%2)
-#define _GLOBALS time_t RANDOM_SEED=0; char *EOL="\n", *OFS=" ", *IFS=" \t\n", *NIL="NULL";
-#define coalesce(VALUE,NOTNULL) ((VALUE)?(VALUE):(NOTNULL))
+#define coalesce(VAR,NOTNULL) (VAR?VAR:(NOTNULL))
#define mem struct
#define construct struct
-/* ------------------------------------------------------------------- */
-/* 2. C<<1 basic data types - updated 2008-01-07 by xCh. */
-/* ------------------------------------------------------------------- */
+#define _GLOBALS time_t RANDOM_SEED=0; char *EOL="\n", *OFS=" ", *IFS=" \t\n", *NIL="NULL";
+/* ,-----------------------------------------------------------------------
+ / 4. C<<1 data declaration and allocation, updated 2008-01-07 xCh.
+ '----------------------------------------------------------------------- */
#define Create_str(ID,INIT) char *ID=INIT
#define Define_str(ID) char *ID=NULL
-#define Create_mem(ID,TYPE) struct TYPE *ID=get_mem(TYPE)
-#define Create_mem_in_context(ID,TYPE,CONTEXT) struct TYPE *ID=get_mem_in_context(TYPE,CONTEXT)
+#define Create_mem(ID,...) struct _ARG1(__VA_ARGS__,) *ID=get_mem(__VA_ARGS__)
#define Define_mem(ID,TYPE) struct TYPE *ID=NULL
-#define Define_mems(ID1,I2,TYPE) Define_mem(ID1,TYPE);Define_mem(ID2,TYPE)
-
-/* .... well....ehm...not very useful... :-) */
-#define Create_var(ID,TYPE,INIT) TYPE ID=INIT
+#define Define_mems(ID1,ID2,TYPE) Define_mem(ID1,TYPE); Define_mem(ID2,TYPE)
+#define Create_list(ID1,I2,TYPE) Create_mem(ID1,TYPE); struct TYPE *ID2=((ID1->__next=NULL),ID1)
#define Define_var(ID,TYPE) TYPE ID
-/* ------------------------------------------------------------------- */
-#define list(T) struct T *_next
-#define tree(T) struct T *_next;struct T *_seek
-#define create(A,T) (A=(struct T *)malloc(sizeof(struct T)),A->_next=NULL,A)
-#define push(A,B) ((A && A!=B)?A->_next=B:0,B=A)
-#define pop(A,B) (B?((A?free(A):0),A=B=B->_next):(A=NULL))
-#define append(A,B) if(B) { void *N=A; A->_next=NULL; for_search(A,B,!A->_next) {A->_next=N; break;}} else push(A,B);
-#define remove(A,B,C) { void **_D=NULL; for_search(A,B,C) { if(_D)*_D=A->_next; else B=A->_next; free(A); } else _D=(void *)&(A->_next); }
-#define drop(A,B) for( A=B; A || (B=NULL); B=A, A=A->_next, free(B) )
-/* ------------------------------------------------------------------- */
-/* 3. C<<1 general iterators - updated 2008-01-07 by xCh. */
-/* ------------------------------------------------------------------- */
+#define list(TYPE) struct TYPE *__next
+#define tree(TYPE) struct TYPE *__next;struct TYPE *__seek
+#define dictionary(TYPE) tree(TYPE);char *__key
+#define array(TYPE) tree(TYPE);char *__key
+#define interface(TYPE) struct TYPE *__interface
+#define get_mem(...) (struct _ARG1(__VA_ARGS__,)*)_cll1_malloc(sizeof(struct _ARG1(__VA_ARGS__,)),NULL)
+#define get_str(...) (char *)_cll1_get_str(__VA_ARGS__,(void *)&_cll1_get_str)
+/* ,-----------------------------------------------------------------------
+ / 5. C<<1 string manipulation, updated 2008-01-26 xCh.
+ '----------------------------------------------------------------------- */
+#define eq(A,B) !strcmp(A,B)
+#define eqi(A,B) !strcasecmp(A,B)
+#define print(...) _cll1_print(__VA_ARGS__,(void *)&_cll1_print)
+#define fprint(...) _cll1_fprint(__VA_ARGS__,(void *)&_cll1_fprint)
+#define file_print(...) _cll1_fprint(_F,__VA_ARGS__,(void *)&_cll1_fprint)
+#define echo(...) _cll1_echo(__VA_ARGS__,(void *)&_cll1_echo)
+#define fecho(...) _cll1_fecho(__VA_ARGS__,(void *)&_cll1_fecho)
+#define file_echo(...) _cll1_fecho(_F,__VA_ARGS__,(void *)&_cll1_fecho)
+/* ,-----------------------------------------------------------------------
+ / 6. C<<1 data container manipulation, updated 2008-01-26 xCh.
+ '----------------------------------------------------------------------- */
+#define push(NODE,HEAD) ((NODE && NODE!=HEAD)?((NODE->__next=HEAD),(HEAD=NODE)):(HEAD=NODE))
+#define pop(NODE,HEAD) (HEAD?((NODE=HEAD->__next),free(HEAD),(HEAD=NODE)):(NODE=NULL))
+#define append(NODE,HEAD) if(HEAD) { void *N=NODE; /**/ NODE->__next=NULL; for_search(NODE,HEAD,!NODE->__next) {NODE->__next=N; break;} else push(NODE,HEAD); }
+#define remove(NODE,HEAD,EXPR) { void **_D=NULL; /**/ for_search(NODE,HEAD,EXPR) { if(_D)*_D=NODE->__next; else HEAD=NODE->__next; free(NODE); } else _D=(void *)&(NODE->__next); }
+#define drop(NODE,HEAD) for( NODE=HEAD; NODE || (HEAD=NULL); HEAD=NODE, NODE=NODE->__next, free(HEAD) )
+//to do seek
+//to do store
+#define order_by(K1,K2) (K1>K2)
+#define desc_order_by(K1,K2) (K1<K2)
+#define sort_by(K1,K2) (strcasecmp(K1, K2)>0)
+#define desc_sort_by(K1,K2) (strcasecmp(K1, K2)<0)
+#define ascii_by(K1,K2) (strcmp(K1, K2)>0)
+#define desc_ascii_by(K1,K2) (strcmp(K1, K2)<0)
+#define insert(NODE,HEAD,EXP,K) { if(HEAD) { void **_L=NULL, *H=HEAD; /**/ for_search(HEAD,H,EXP(HEAD->K,NODE->K)) { if(_L) {*_L=NODE; NODE->__next=HEAD; } else push(NODE,H); break; } else _L=(void *)&(HEAD->__next); if(!HEAD)*_L=NODE; HEAD=H; } else if (NODE) push(NODE,HEAD)->__next=NULL; }
+#define sort(NODE,HEAD,EXP,K) { void *_NEXT; /**/ NODE=HEAD; HEAD=NULL; do { _NEXT=NODE->__next; NODE->__next=NULL; insert(NODE,HEAD,EXP,K); NODE=_NEXT; } while(_NEXT); }
+/* ,-----------------------------------------------------------------------
+ / 7. C<<1 builtin iterators and conditionals, updated 2008-01-26 xCh.
+ '----------------------------------------------------------------------- */
#define loop while(TRUE)
#define repeat(N) if(N>0) _NEW_I for_range(_I,1,N)
#define for_range(VAR,FROM,TO) for( VAR=FROM ; FROM<=TO?VAR<=TO:VAR>=TO ; FROM<=TO?VAR++:VAR--)
-#define for_each(A,B) for(A=B; A; A=A->_next)
-#define for_search(A,B,C) for_each(A,B) if(C)
+#define for_each(NODE,HEAD) for(NODE=HEAD; NODE; NODE=NODE->__next)
+#define for_search(NODE,HEAD,EXPR) for_each(NODE,HEAD) if(EXPR)
#define for_file_lines(STR,F) /* _NEW_F for() */
-#define for_ints(VAR,...) _NEW_I while(_iterate_ints(&VAR,_I,__VA_LIST) )
-#define for_strs(VAR,...) _NEW_S
-/* obsolete #define every(A,B) for( A=B; A; A=A->_next) */
-/* obsolete #define search(A,B,C) every(A,B) if(C) */
-/* obsolete #define find(A,B,C) search(A,B,C) break; if(A) */
-/* ------------------------------------------------------------------- */
-/* 4.C<<1 conditionals - updated 2008-01-07 by xCh. */
-/* ------------------------------------------------------------------- */
+#define for_ints(VAR,...) _NEW_I for( _I=0 ; (VAR=_cll1_it_ints(_I,__VA_ARGS__,-1))>=0 ; _I++)
+#define for_strs(VAR,...) _NEW_I for( _I=0 ; (VAR=_cll1_it_strs(_I,__VA_ARGS__,(void *)&_cll1_it_strs))!=(void *)&_cll1_it_strs ; _I++)
#define if_exists(A,B,C) for_search(A,B,C) break; if(A)
-/* ------------------------------------------------------------------- */
-/* 5. C<<1 argument handling, updated 2008-01-16 by xCh. */
-/* ------------------------------------------------------------------- */
#define for_args _NEW_I for(_I=1;_I<argc;_I++)
#define if_args if(argc>1)
#define if_arg(VAL) if(eq(argv[_I],VAL))
#define this_arg argv[_I]
#define next_arg ((_I+1<argc)?argv[_I]:NULL)
-/* ------------------------------------------------------------------- */
-/* 6. C<<1 va_list based library functions, updated 2008-01-22 by xCh. */
-/* ------------------------------------------------------------------- */
-#define _ECHO void _cll1_print(int p,char *s, ... ) { int p2=0; va_list ap; for(va_start(ap,s);s!=(void *)&_cll1_print;s=va_arg(ap,char *)) { if(p) {if(p2) putchar(*OFS); else p2=1;} fputs(coalesce(s,NIL),stdout); } va_end(ap); if(p) putchar(*EOL);}
-#define print(...) _cll1_print(1,__VA_ARGS__,(void *)&_cll1_print)
-#define echo(...) _cll1_print(0,__VA_ARGS__,(void *)&_cll1_print)
-/* ------------------------------------------------------------------- */
-/* 8. C<<1 CGI and FASTCGI handling, updated 2008-01-16 by xCh. */
-/* ------------------------------------------------------------------- */
+#define skip_next _I++
+/* ,-----------------------------------------------------------------------
+ / 8. C<<1 va_list based library functions, updated 2008-01-26 xCh.
+ '----------------------------------------------------------------------- */
+#define _ARG1(ARG1,...) ARG1
+#define _MALLOC void *_cll1_malloc(size_t size,...) { /*temporary solution*/ return malloc(size); }
+#define _CLL1_FPRINT(IOSTREAM,LASTARG) { int p2=0;char *ofs=coalesce(OFS,"\0");va_list ap; /**/ for(va_start(ap,s);s!=LASTARG;s=va_arg(ap,char *)) { if(p2 && *ofs) fputs(ofs,IOSTREAM); else p2=1; fputs(coalesce(s,NIL),IOSTREAM); } va_end(ap); if(EOL && *EOL) fputs(EOL,IOSTREAM); }
+#define _PRINT void _cll1_print(char *s,...) _CLL1_FPRINT(stdout,(void *)&_cll1_print)
+#define _FPRINT void _cll1_fprint(FILE *f,char *s,...) _CLL1_FPRINT(f,(void *)&_cll1_fprint)
+#define _CLL1_FECHO(IOSTREAM,LASTARG) { va_list ap; /**/ for(va_start(ap,s);s!=LASTARG;s=va_arg(ap,char *)) fputs(coalesce(s,NIL),IOSTREAM); va_end(ap); }
+#define _ECHO void _cll1_echo(char *s,...) _CLL1_FECHO(stdout,(void *)&_cll1_echo)
+#define _FECHO void _cll1_fecho(FILE *f,char *s,...) _CLL1_FECHO(f,(void *)&_cll1_fecho)
+#define _IT_INTS int _cll1_it_ints(int i, int n, ...) { int j=0;va_list ap; /**/ va_start(ap,n); while(n>=0 && j++<i) n=va_arg(ap,int); return n; }
+#define _IT_STRS char *_cll1_it_strs(int i, char *s, ...) { int j=0;va_list ap; /**/ va_start(ap,s); while(s!=(void *)&_cll1_it_strs && j++<i) s=va_arg(ap,char *); return s; }
+/* ,-----------------------------------------------------------------------
+ / 9. C<<1 hidden stack infrastructure, updated 2008-01-26 by xCh.
+ '----------------------------------------------------------------------- */
+#define _ISTACK struct _IStack { int I; int _23; list(_IStack); } *_Iatom,*_Istack=NULL;
+#define _SSTACK struct _SStack { char *S; int _23; list(_SSTACK); } *_Satom,*_Sstack=NULL;
+#define _FSTACK struct _FStack { FILE *F; int _23; list(_FSTACK); } *_Fatom,*_Fstack=NULL;
+#define _NEW_(ATOM,STACK,TYPE) (ATOM=get_mem(TYPE),ATOM->_23=1,push(ATOM,STACK);ATOM->_23||pop(ATOM,STACK)&&0;ATOM->_23--)
+#define _NEW_I for _NEW_(_Iatom,_Istack,_IStack)
+#define _NEW_S for _NEW_(_Satom,_Sstack,_SStack)
+#define _NEW_F for _NEW_(_Fatom,_Fstack,_FStack)
+#define _I (_Iatom->I)
+#define _S (_Satom->I)
+#define _F (_Satom->F)
+/* ,-----------------------------------------------------------------------
+ / 10. C<<1 CGI and FASTCGI handling, updated 2008-01-16 by xCh.
+ '----------------------------------------------------------------------- */
#ifdef USE_LIBRARY_FASTCGI
#define while_fastcgi_accept while(FCGI_Accept()>=0)
#define USE_MODULE_CGI
//todo define_init_cgi
//todo #define _QSTACK struct _QStack { char *Q; int _23; list(_QStack); } *_Qatom,*_Qstack=NULL;
#endif
-/* ------------------------------------------------------------------- */
-/* 9. MySQL infrastructure and wrappers - updated 2007-12-19 by xCh. */
-/* ------------------------------------------------------------------- */
+/* ,-----------------------------------------------------------------------
+ / 11. MySQL infrastructure and wrappers - updated 2007-12-19 by xCh.
+ '----------------------------------------------------------------------- */
#ifdef USE_LIBRARY_MYSQL
-#define mysql_connect(S,U,P,D) (create(_Matom,_MStack) && push(_Matom,_Mstack) && (_Matom->M=mysql_init(NULL)),(_Matom->M && mysql_real_connect(_Matom->M,S,U,P,D,0,NULL,0)?_Matom->M:NULL))
+#define mysql_connect(S,U,P,D) ((_Matom=get_mem(_MStack)) && push(_Matom,_Mstack) && (_Matom->M=mysql_init(NULL)),(_Matom->M && mysql_real_connect(_Matom->M,S,U,P,D,0,NULL,0)?_Matom->M:NULL))
#define for_mysql_query_results(ROW,QUERY) _NEW_(_Ratom,_Rstack,_RStack)for(_Ratom->R=(mysql_query(_Matom->M,QUERY)?NULL:mysql_use_result(_Matom->M)),ROW=(_Ratom->R?mysql_fetch_row(_Ratom->R):NULL);ROW;ROW=mysql_fetch_row(_Ratom->R))
#define _MSTACK struct _MStack { MYSQL *M; int _23; list(_MStack); } *_Matom,*_Mstack=NULL;
#define _RSTACK struct _RStack { MYSQL_RES *R; int _23; list(_RStack); } *_Ratom,*_Rstack=NULL;
#define _MSTACK
#define _RSTACK
#endif
+
/* ------------------------------------------------------------------- */
/* old - from version 0.6 */
-/* ------------------------------------------------------------------- */
+/* =================================================================== */
-/* ------------------------------------------------------------------- */
-/* EXP macros for dummysort sequences, updated 2003-05-29 by xCh. */
-/* ------------------------------------------------------------------- */
-#define order_by(K1,K2) (K1>K2)
-#define desc_order_by(K1,K2) (K1<K2)
-#define sort_by(K1,K2) (strcasecmp(K1, K2)>0)
-#define desc_sort_by(K1,K2) (strcasecmp(K1, K2)<0)
-#define ascii_by(K1,K2) (strcmp(K1, K2)>0)
-#define desc_ascii_by(K1,K2) (strcmp(K1, K2)<0)
-/* ------------------------------------------------------------------- */
-/* Dummysort sequences, updated 2003-05-29 by xCh. */
-/* ------------------------------------------------------------------- */
-#define insert(A,B,EXP,K) { if(B) { void **_L=NULL, *H=B; for_search(B,H,EXP(B->K,A->K)) { if(_L) {*_L=A; A->_next=B; } else push(A,H); break; } else _L=(void *)&(B->_next); if(!B)*_L=A; B=H; } else push(A,B); }
-#define sort(A,B,EXP,K) { void *_C; A=B; B=NULL; do { _C=A->_next; A->_next=NULL; insert(A,B,EXP,K); A=_C; } while(_C); }
-/* ------------------------------------------------------------------- */
-/* String macros & sequences, updated 2008-01-22 by xCh. */
-/* ------------------------------------------------------------------- */
-#define eq(A,B) (A && B && !strcmp(A,B))
-#define eqi(A,B) (A && B && !strcasecmp(A,B))
-/* Borland C legacy */
-#define strcmpi(A,B) strcasecmp(A,B)
-/* ------------------------------------------------------------------- */
/*
obsolete
#define strlwr(A) {char *_S=A; while(_&&*_S){*_S=tolower(*_S);_S++;}}
#define match(KEY,VAL) {char *_K=KEY, *_V=VAL; FILE *_F=NULL; {{
#define assign(STR,SETVAR) stroption(STR) SETVAR=_V
*/
-/* ------------------------------------------------------------------- */
-/* Infrastructure, updated 2008-01-08 by xCh. */
-/* ------------------------------------------------------------------- */
-/* old #define program int _I; int main(int argc, char **argv) */
-#define _ISTACK struct _IStack { int I; int _23; list(_IStack); } *_Iatom,*_Istack=NULL;
-#define _SSTACK struct _SStack { char *S; int _23; list(_SSTACK); } *_Satom,*_Sstack=NULL;
-#define _FSTACK struct _FStack { FILE *F; int _23; list(_FSTACK); } *_Fatom,*_Fstack=NULL;
-
-
-#define _NEW_(ATOM,STACK,TYPE) (create(ATOM,TYPE),ATOM->_23=1,push(ATOM,STACK);ATOM->_23||pop(ATOM,STACK)&&0;ATOM->_23--)
-#define _NEW_I for _NEW_(_Iatom,_Istack,_IStack)
-//#define _NEW_I for(create(_Iatom,_IStack),_Iatom->_23=1,push(_Iatom,_Istack);_Iatom->_23||pop(_Iatom,_Istack)&&0;_Iatom->_23--)
-#define _NEW_S for(create(_Satom,_SStack),_Satom->_23=1,push(_Satom,_Sstack);_Satom->_23||pop(_Satom,_Sstack)&&0;_Satom->_23--)
-#define _I (_Iatom->I)
-#define _S (_Satom->I)
-#define _F (_Satom->F)
-#define skip_one _I++
-
/* I/O iterations, updated 2004-04-19 by xCh. */
#define fparse(S,L,F) for(fgets(S,L,F);*S && !feof(F);fgets(S,L,F))
#define input(S,L) fparse(S,L,stdin)
#define fstring(S,F) { int _C=0,_L=0; fpos_t _P; fgetpos(F,&_P); while(_C!='\n' && !feof(F)){ _C=fgetc(F); _L++; } string(S,_L); fsetpos(F,&_P);fgets(S,_L,F);fgetc(F);}
#define parses(S,F) {FILE *_F=fopen(F,"r"); if(_F) { while(!feof(_F)) { fstring(S,_F);
-#define parse(F) {char *_; FILE *_F=fopen(F,"r"); if(_F) { while(!feof(_F)) { fstring(_,_F);
-#define fail }} else {{
-#define done }} if(_F)fclose(_F);}
+//obsolete
+//#define parse(F) {char *_; FILE *_F=fopen(F,"r"); if(_F) { while(!feof(_F)) { fstring(_,_F);
+//#define fail }} else {{
+//#define done }} if(_F)fclose(_F);}
#define option(STR,SETVAR) if(_){char *_K,*_V,*_O,*_Q; duplicate(_,_Q); _O=_Q; tr(_O,'\t',' '); prefix(_K,_O,' '); if(eq(STR,_K)) {skipspaces(_O); prefix(_V,_O,'#'); cutspaces(_V); SETVAR=_V; _=NULL;} else free(_Q);}
#define ioption(STR,SETVAR) if(_){char *_K,*_V,*_O,*_Q; duplicate(_,_Q); _O=_Q; tr(_O,'\t',' '); prefix(_K,_O,' '); if(eq(STR,_K)) {skipspaces(_O); prefix(_V,_O,'#'); cutspaces(_V); SETVAR=atoi(_V); _=NULL;} free(_Q);}
#define loption(STR,SETVAR) if(_){char *_K,*_V,*_O,*_Q; duplicate(_,_Q); _O=_Q; tr(_O,'\t',' '); prefix(_K,_O,' '); if(eq(STR,_K)) {skipspaces(_O); prefix(_V,_O,'#'); cutspaces(_V); SETVAR=atol(_V); _=NULL;} free(_Q);}
/* Useful structures, updated 2003-05-29 by xCh. */
-#define hashtable(TYPE,NAME,VALUE) struct TYPE { char *NAME; char *VALUE; list(TYPE); }
-#define textfile(TYPE,LINE) struct TYPE { char *LINE; char _eoln; list(TYPE); }
-#define date(S) { time_t _T; _T=time(NULL); duplicate(ctime(&_T),S); }
+//#define hashtable(TYPE,NAME,VALUE) struct TYPE { char *NAME; char *VALUE; list(TYPE); }
+//#define textfile(TYPE,LINE) struct TYPE { char *LINE; char _eoln; list(TYPE); }
+//#define date(S) { time_t _T; _T=time(NULL); duplicate(ctime(&_T),S); }
/* ------------------------------------------------------------------- */
/* Object infrastructure and basic macros - updated 2008-01-13 by xCh. */
/* unfinished */
-#define bind_interface(TYPE) struct TYPE *__class
+
#define method(NAME)
-#define define_interface(IFACE,TYPE) struct TYPE *__get_##_##IFACE(void) { struct TYPE *_FACE=get_mem(TYPE); __bind_##_##IFACE(_FACE); return _IFC; } void __bind_##_##IFACE(struct TYPE *_FACE)
+#define define_interface(IFACE,TYPE) struct TYPE *__get_##_##IFACE(void) { Create_mem(_FACE,TYPE); __bind_##_##IFACE(_FACE); return _IFC; } void __bind_##_##IFACE(struct TYPE *_FACE)
#define bind_method(METHOD,FUNCTION) _IFACE->METHOD=FUNCTION
#define get_interface(IFACE) __get_##_##IFACE(void)
-// must be function #define get_object(TYPE) (_CLL1_MALLOC(TYPE),CLL1_ASSERT(),)
-//#define _(OBJECT,FUNCTION) OBJECT==NULL?NULL::(*(OBJECT->__class->METHOD))(OBJECT
+//get_dynamic_interface
+//#define get_object(TYPE)
+//#define _(OBJECT,...) (assert(OBJECT),/**/(*(OBJECT->interface->_ARG1(__VA_ARGS__,)))/**/(OBJECT,OBJECT->interface->__VA_ARGS__)/**/)
/* ------------------------------------------------------------------- */
/* some general ideas, unfinished */
+//bind_exception, unbind_exception
//#define _CLL1_THROW(ERR)
-//#define _CLL1_TRY _NEW_E for(;;) if () {.... if(_Eatom->SYS) { if(_Eatom->RET) return; else break;} else { }
+//#define _CLL1_TRY _NEW_E for(bind_exception(0,NULL);;) if () {.... if(_Eatom->SYS) { if(_Eatom->RET) return; else break;} else { }
//#define _ASSERT(EXPR) assert(EXPR)
-//#define _CLL1_MALLOC(TYPE) malloc(sizeof(TYPE))
+/* =================================================================== */
-/* ------------------------------------------------------------------- */
-/* Voila - here we go ! */
-/* ------------------------------------------------------------------- */
-#define define_cll1_globals _GLOBALS _ISTACK _SSTACK _FSTACK _MSTACK _RSTACK //_QSTACK
-#define implement_cll1_functions _ECHO // _GET_STR _GET_MEM
-#define define_cll1_interfaces //_CAKE
-#define implement_cll1_library define_cll1_globals implement_cll1_functions define_cll1_interfaces
+
+
+/* ,-----------------------------------------------------------------------
+ / 99. We have have done our homework - now let's have some fun:
+ '----------------------------------------------------------------------- */
+#define _DEF_VARIABLES _GLOBALS _ISTACK _SSTACK _FSTACK _MSTACK _RSTACK //_QSTACK
+#define _DEF_FUNCTIONS _MALLOC _ECHO _PRINT _FECHO _FPRINT _IT_INTS _IT_STRS // _GET_STR _GET_MEM
+#define _DEF_INTERFACE //_CAKE _STD _X
+#define implement_cll1_library _DEF_VARIABLES _DEF_FUNCTIONS _DEF_INTERFACE
+#ifdef USE_PREPROCESSOR
+#include "_include.c"
+#endif
#define program implement_cll1_library int main(int argc, char **argv)
-/* ------------------------------------------------------------------- */
+/* #ifndef _CLL1_H */
#endif