]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/conf.h
Table: Shuffle functions to form thematic blocks
[libucw.git] / ucw / conf.h
index 2e8a5ca8889e77066556234f584feaf5d2bb8afe..d661f48e9146685ba2537de2ca298dacc886668d 100644 (file)
@@ -2,7 +2,7 @@
  *     UCW Library -- Configuration files
  *
  *     (c) 2001--2006 Robert Spalek <robert@ucw.cz>
- *     (c) 2003--2012 Martin Mares <mj@ucw.cz>
+ *     (c) 2003--2014 Martin Mares <mj@ucw.cz>
  *
  *     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 <ucw/clists.h>
+#include <ucw/gary.h>
 
 #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]]