src/server/config/objconf.c

changeset 629
1e1da9adc532
parent 628
c95f04c14112
child 631
867b1026b0de
equal deleted inserted replaced
628:c95f04c14112 629:1e1da9adc532
39 * mempool 39 * mempool
40 * object 40 * object
41 */ 41 */
42 42
43 43
44 ObjectConfig2* objectconf_load(const char *file) { 44 ObjectConfig* objectconf_load(const char *file) {
45 CxMempool *mp = cxMempoolCreateSimple(512); 45 CxMempool *mp = cxMempoolCreateSimple(512);
46 if(!mp) { 46 if(!mp) {
47 return NULL; 47 return NULL;
48 } 48 }
49 49
62 if(!obj_config) { 62 if(!obj_config) {
63 cxMempoolFree(mp); 63 cxMempoolFree(mp);
64 return NULL; 64 return NULL;
65 } 65 }
66 66
67 ObjectConfig2 *conf = cxMalloc(mp->allocator, sizeof(ObjectConfig2)); 67 ObjectConfig *conf = cxMalloc(mp->allocator, sizeof(ObjectConfig));
68 if(!conf) { 68 if(!conf) {
69 cxMempoolFree(mp); 69 cxMempoolFree(mp);
70 return NULL; 70 return NULL;
71 } 71 }
72 72
74 conf->root = obj_config; 74 conf->root = obj_config;
75 75
76 return conf; 76 return conf;
77 } 77 }
78 78
79 void objectconf_free(ObjectConfig2 *objconf) { 79 void objectconf_free(ObjectConfig *objconf) {
80 cxMempoolFree(objconf->mp); 80 cxMempoolFree(objconf->mp);
81 } 81 }
82 82
83 int objectconf_validate_directive(ConfigParser2 *parser, ConfigNode *node) { 83 int objectconf_validate_directive(ConfigParser2 *parser, ConfigNode *node) {
84 // It is possible that this function is called for Objects 84 // It is possible that this function is called for Objects
187 int objectconf_validate_objend(ConfigParser2 *parser, ConfigNode *node) { 187 int objectconf_validate_objend(ConfigParser2 *parser, ConfigNode *node) {
188 return 0; 188 return 0;
189 } 189 }
190 190
191 191
192 void free_object_config(ObjectConfig *conf) {
193 // free other lists
194 if(conf->levels) {
195 //ucx_list_free(conf->levels);
196 }
197
198 // free mempool
199 //ucx_mempool_destroy(conf->parser.mp->pool);
200 free(conf);
201 }
202

mercurial