]> mj.ucw.cz Git - libucw.git/commitdiff
Added CF_ARY_NUM and CF_JOURNAL_VAR.
authorMartin Mares <mj@ucw.cz>
Tue, 25 Apr 2006 10:53:35 +0000 (12:53 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 25 Apr 2006 10:53:35 +0000 (12:53 +0200)
lib/conf2.h

index 01a3fee7a358a47c942932a7e816a5b99781989d..c341e0d2812d9c548a7ed18d2bc5c43b2d1a7e9a 100644 (file)
@@ -96,6 +96,9 @@ struct clist;
 #define CF_STRING_ARY(n,p,c)   CF_STATIC(n,p,STRING,byte*,c)
 #define CF_STRING_DYN(n,p,c)   CF_DYNAMIC(n,p,STRING,byte*,c)
 
+/* If you aren't picky about the number of parameters */
+#define CF_ANY_NUM             -0x7fffffff
+
 #define DARY_LEN(a) *(uns*)(a-1)
   // length of a dynamic array
 #define DARY_ALLOC(type,len,val...) (type[]) { (type)len, ##val } + 1
@@ -113,6 +116,7 @@ byte *cf_printf(char *fmt, ...) FORMAT_CHECK(printf,1,2);
 /* Undo journal for error recovery */
 extern uns cf_need_journal;
 void cf_journal_block(void *ptr, uns len);
+#define CF_JOURNAL_VAR(var) cf_journal_block(&(var), sizeof(var))
 
 /* Declaration */
 void cf_declare_section(byte *name, struct cf_section *sec, uns allow_unknown);