src/server/config/serverconfig.c

branch
config
changeset 258
134279e804b6
parent 256
19259b6c5cf7
child 269
3dfbd0b91950
equal deleted inserted replaced
257:bfeb015c98a4 258:134279e804b6
132 token.type = type; 132 token.type = type;
133 token.content = scstrsubsl(content, token_begin, token_end - token_begin); 133 token.content = scstrsubsl(content, token_begin, token_end - token_begin);
134 return token; 134 return token;
135 } 135 }
136 136
137 137 /*
138 static void test_print_config(ConfigNode *parent) { 138 static void test_print_config(ConfigNode *parent) {
139 UCX_FOREACH(elm, parent->children) { 139 UCX_FOREACH(elm, parent->children) {
140 ConfigNode *node = elm->data; 140 ConfigNode *node = elm->data;
141 141
142 if(node->type == CONFIG_NODE_SPACE) { 142 if(node->type == CONFIG_NODE_SPACE) {
152 } else { 152 } else {
153 printf("fk: %s", node->text_begin.ptr); 153 printf("fk: %s", node->text_begin.ptr);
154 } 154 }
155 } 155 }
156 } 156 }
157 */
157 158
158 ServerConfig* serverconfig_parse(scstr_t content) { 159 ServerConfig* serverconfig_parse(scstr_t content) {
159 UcxMempool *mp = ucx_mempool_new(512); 160 UcxMempool *mp = ucx_mempool_new(512);
160 if(!mp) return NULL; 161 if(!mp) return NULL;
161 UcxAllocator *a = mp->allocator; 162 UcxAllocator *a = mp->allocator;

mercurial