59 parser.validateObjEnd = objectconf_validate_objend; |
59 parser.validateObjEnd = objectconf_validate_objend; |
60 parser.allow_hierarchy = 1; |
60 parser.allow_hierarchy = 1; |
61 |
61 |
62 ConfigNode *obj_config = serverconfig_load_file(&parser, file); |
62 ConfigNode *obj_config = serverconfig_load_file(&parser, file); |
63 if(!obj_config) { |
63 if(!obj_config) { |
64 cxMempoolDestroy(mp); |
64 cxMempoolFree(mp); |
65 return NULL; |
65 return NULL; |
66 } |
66 } |
67 |
67 |
68 ObjectConfig2 *conf = cxMalloc(mp->allocator, sizeof(ObjectConfig2)); |
68 ObjectConfig2 *conf = cxMalloc(mp->allocator, sizeof(ObjectConfig2)); |
69 if(!conf) { |
69 if(!conf) { |
70 cxMempoolDestroy(mp); |
70 cxMempoolFree(mp); |
71 return NULL; |
71 return NULL; |
72 } |
72 } |
73 |
73 |
74 conf->mp = mp; |
74 conf->mp = mp; |
75 conf->root = obj_config; |
75 conf->root = obj_config; |
76 |
76 |
77 return conf; |
77 return conf; |
78 } |
78 } |
79 |
79 |
80 void objectconf_free(ObjectConfig2 *objconf) { |
80 void objectconf_free(ObjectConfig2 *objconf) { |
81 cxMempoolDestroy(objconf->mp); |
81 cxMempoolFree(objconf->mp); |
82 } |
82 } |
83 |
83 |
84 int objectconf_validate_directive(ConfigParser2 *parser, ConfigNode *node) { |
84 int objectconf_validate_directive(ConfigParser2 *parser, ConfigNode *node) { |
85 // It is possible that this function is called for Objects |
85 // It is possible that this function is called for Objects |
86 // if { is on the next line |
86 // if { is on the next line |