src/server/config/conf.h

changeset 91
fac51f87def0
parent 83
28433f06d5ee
child 95
74a81d9e19d0
--- a/src/server/config/conf.h	Wed Jul 31 13:02:06 2013 +0200
+++ b/src/server/config/conf.h	Sun Sep 08 23:27:07 2013 +0200
@@ -32,19 +32,18 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "../ucx/list.h"
-#include "../ucx/dlist.h"
-#include "../ucx/map.h"
-#include "../ucx/mempool.h"
-#include "../ucx/string.h"
+#include <ucx/list.h>
+#include <ucx/map.h>
+#include <ucx/mempool.h>
+#include <ucx/string.h>
 
 #ifdef	__cplusplus
 extern "C" {
 #endif
    
 // mempool malloc macro
-#define OBJ_NEW(pool, type) (type*)ucx_mempool_malloc(pool, sizeof(type))
-#define OBJ_NEW_N(pool, type) (type*)ucx_mempool_calloc(pool, 1, sizeof(type))
+#define OBJ_NEW(p, type) (type*)(p)->malloc((p)->pool, sizeof(type))
+#define OBJ_NEW_N(p, type) (type*)(p)->calloc((p)->pool, 1, sizeof(type))
 
 // line types
 #define LINE_OTHER      0
@@ -76,8 +75,8 @@
 } ConfigParam;
 
 typedef struct _cfg_parser {
-    UcxMempool    *mp;
-    UcxDlist      *lines;
+    UcxAllocator  *mp;
+    UcxList       *lines;
     cfg_parse_f   parse;
 } ConfigParser;
 
@@ -117,9 +116,9 @@
 
 sstr_t cfg_param_get(UcxList *list, sstr_t name);
 
-ConfigDirective* cfg_parse_directive(sstr_t line, UcxMempool *mp);
+ConfigDirective* cfg_parse_directive(sstr_t line, UcxAllocator *mp);
 
-UcxList* cfg_param_list(sstr_t param_str, UcxMempool *mp);
+UcxList* cfg_param_list(sstr_t param_str, UcxAllocator *mp);
 
 int cfg_get_directive_type_num(sstr_t type);
 
@@ -131,19 +130,15 @@
 
 sstr_t cfg_get_end_tag_name(sstr_t line);
 
-ConfigTag* cfg_parse_begin_tag(sstr_t line, UcxMempool *mp);
+ConfigTag* cfg_parse_begin_tag(sstr_t line, UcxAllocator *mp);
 
-ConfigDirective* cfg_directivelist_get(UcxDlist *dirs, sstr_t name);
+ConfigDirective* cfg_directivelist_get(UcxList *dirs, sstr_t name);
 
-sstr_t cfg_directivelist_get_str(UcxDlist *dirs, sstr_t name);
+sstr_t cfg_directivelist_get_str(UcxList *dirs, sstr_t name);
 
 sstr_t cfg_directive_pstr1(ConfigDirective *dir);
 
-void cfg_list_destr(UcxMempool *mp, UcxList *list);
-void cfg_dlist_destr(UcxMempool *mp, UcxDlist *list);
 void cfg_map_destr(UcxMempool *mp, UcxMap *map);
-UcxList* cfg_list_append(UcxMempool *mp, UcxList *list, void *data);
-UcxDlist* cfg_dlist_append(UcxMempool *mp, UcxDlist *list, void *data);
 
 #ifdef	__cplusplus
 }

mercurial