From 818209bd9bec258c23559d3a604173493fa559ac Mon Sep 17 00:00:00 2001 From: xchaos Date: Wed, 6 Feb 2008 17:11:35 +0000 Subject: [PATCH] some work git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@60 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- cll1.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cll1.h b/cll1.h index 711b951..14abb4e 100644 --- a/cll1.h +++ b/cll1.h @@ -97,10 +97,12 @@ extern unsigned RANDOM_SEED; #define init_mem(...) _init_##_ARG1(__VA_ARGS__,)( _ARG2(__VA_ARGS__,,) - 0 ) #define create_mem(ID,...) _ARG1(__VA_ARGS__,) ID=_GET_MEM(__VA_ARGS__,NULL) #define new_mem(ID,...) _ARG1(__VA_ARGS__,) ID=init_mem(__VA_ARGS__) +#define mem_len(TYPE) sizeof(struct _##TYPE##_t) +//#define mem_copy #define list(TYPE) TYPE __next #define tree(TYPE) TYPE __next; TYPE __seek -#define dictionary(TYPE) TYPE __next; TYPE __seek; str __key -#define array(TYPE) TYPE __next; TYPE __seek; int __key +#define dict(TYPE) tree(TYPE); str __key +#define array(TYPE) tree(TYPE); int __key #define interface(TYPE) TYPE __interface #define this_must_be(TYPE) TYPE this /* .----------------------------------------------------------------------. @@ -162,7 +164,7 @@ extern unsigned RANDOM_SEED; #define skip_next _I++ #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_for_args for_args switch_str(this_arg) #define switch_str(STR) _NEW(S,STR) #define if_case(VAL) if(eq(argv[_I],VAL)) #define for_fields(FIELD,STR) for_valid_split(FIELD,STR,*OFS) -- 2.30.2