]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/conf.h
Table: Shuffle functions to form thematic blocks
[libucw.git] / ucw / conf.h
index d08aa12098db6079d269b37213f7dc4994418ce4..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.
 #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
+#define cf_declare_rel_section ucw_cf_declare_rel_section
+#define cf_declare_section ucw_cf_declare_section
+#define cf_delete_context ucw_cf_delete_context
+#define cf_dump_sections ucw_cf_dump_sections
+#define cf_find_item ucw_cf_find_item
+#define cf_get_pool ucw_cf_get_pool
+#define cf_init_section ucw_cf_init_section
+#define cf_journal_block ucw_cf_journal_block
+#define cf_journal_commit_transaction ucw_cf_journal_commit_transaction
+#define cf_journal_new_transaction ucw_cf_journal_new_transaction
+#define cf_journal_rollback_transaction ucw_cf_journal_rollback_transaction
+#define cf_load ucw_cf_load
+#define cf_malloc ucw_cf_malloc
+#define cf_malloc_zero ucw_cf_malloc_zero
+#define cf_modify_item ucw_cf_modify_item
+#define cf_new_context ucw_cf_new_context
+#define cf_open_group ucw_cf_open_group
+#define cf_parse_double ucw_cf_parse_double
+#define cf_parse_int ucw_cf_parse_int
+#define cf_parse_ip ucw_cf_parse_ip
+#define cf_parse_u64 ucw_cf_parse_u64
+#define cf_printf ucw_cf_printf
+#define cf_reload ucw_cf_reload
+#define cf_revert ucw_cf_revert
+#define cf_set ucw_cf_set
+#define cf_set_journalling ucw_cf_set_journalling
+#define cf_strdup ucw_cf_strdup
+#define cf_switch_context ucw_cf_switch_context
+#endif
 
 struct mempool;
 
@@ -39,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);
 
@@ -67,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.
  **/
@@ -94,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);
@@ -391,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]]