X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fconf.h;h=d661f48e9146685ba2537de2ca298dacc886668d;hb=f6d9af10d04cc9b1d72a32ff2bb6e7102ffc5659;hp=2e8a5ca8889e77066556234f584feaf5d2bb8afe;hpb=a4f8b029b86d2ca1612a9c2e2795ccea27b15276;p=libucw.git diff --git a/ucw/conf.h b/ucw/conf.h index 2e8a5ca8..d661f48e 100644 --- a/ucw/conf.h +++ b/ucw/conf.h @@ -2,7 +2,7 @@ * UCW Library -- Configuration files * * (c) 2001--2006 Robert Spalek - * (c) 2003--2012 Martin Mares + * (c) 2003--2014 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -12,6 +12,7 @@ #define _UCW_CONF_H #include +#include #ifdef CONFIG_UCW_CLEAN_ABI #define cf_close_group ucw_cf_close_group @@ -71,7 +72,7 @@ struct cf_context *cf_new_context(void); * All configuration settings made within the context are rolled back * (except when journalling is turned off). All memory allocated on behalf * of the context is freed, which includes memory obtained by calls to - * cf_malloc(). + * @cf_malloc(). **/ void cf_delete_context(struct cf_context *cc); @@ -99,7 +100,7 @@ int cf_load(const char *file); /** * Reload configuration from @file, replace the old one. * If @file is NULL, reload all loaded configuration files and re-apply - * bits of configuration passed to cf_set(). + * bits of configuration passed to @cf_set(). * Returns a non-zero value upon error. In that case, all configuration * settings are rolled back to the state before calling this function. **/ @@ -126,7 +127,7 @@ int cf_set(const char *string); void cf_open_group(void); /** - * Close a group opened by cf_open_group(). Returns a non-zero value upon error, + * Close a group opened by @cf_open_group(). Returns a non-zero value upon error, * which usually means that a commit hook has failed. **/ int cf_close_group(void); @@ -423,9 +424,7 @@ struct cf_section { /** A section. **/ **/ #define CF_ANY_NUM -0x7fffffff -#define DARY_LEN(a) ((uns*)a)[-1] /** Length of an dynamic array. **/ -#define DARY_ALLOC(type,len,val...) ((struct { byte pad[ALIGN_TO(sizeof(uns), CPU_STRUCT_ALIGN) - sizeof(uns)]; uns l; type a[len]; }) { .l = len, .a = { val } }).a - // creates a static instance of a dynamic array +#define DARY_LEN(a) GARY_SIZE(a) /** Length of an dynamic array. An alias for `GARY_SIZE`. **/ /*** * [[alloc]]