231 begin->type = cfg_get_line_type(line); |
232 begin->type = cfg_get_line_type(line); |
232 switch(begin->type) { |
233 switch(begin->type) { |
233 case LINE_BEGIN_TAG: { |
234 case LINE_BEGIN_TAG: { |
234 ConfigTag *tag = cfg_parse_begin_tag(line, conf->parser.mp); |
235 ConfigTag *tag = cfg_parse_begin_tag(line, conf->parser.mp); |
235 if(tag == NULL) { |
236 if(tag == NULL) { |
236 log_ereport(LOG_FAILURE, "Parse error in %s", conf->file); |
237 ws_cfg_log(LOG_FAILURE, "Parse error in %s", conf->file); |
237 exit(-1); // TODO: better error handling |
238 exit(-1); // TODO: better error handling |
238 } |
239 } |
239 tag->begin = begin; |
240 tag->begin = begin; |
240 tag->end = end; |
241 tag->end = end; |
241 tag->type_num = cfg_get_tag_type(cx_strcast(tag->name)); |
242 tag->type_num = cfg_get_tag_type(cx_strcast(tag->name)); |
344 // TODO |
345 // TODO |
345 |
346 |
346 break; |
347 break; |
347 } |
348 } |
348 default: { |
349 default: { |
349 log_ereport(LOG_FAILURE, "objconf: unknown tag"); |
350 ws_cfg_log(LOG_FAILURE, "objconf: unknown tag"); |
350 return 1; |
351 return 1; |
351 } |
352 } |
352 } |
353 } |
353 |
354 |
354 return 0; |
355 return 0; |
355 } |
356 } |
356 |
357 |
357 int objconf_on_end_tag(ObjectConfig *conf, cxmutstr tagname) { |
358 int objconf_on_end_tag(ObjectConfig *conf, cxmutstr tagname) { |
358 int type = cfg_get_tag_type(cx_strcast(tagname)); |
359 int type = cfg_get_tag_type(cx_strcast(tagname)); |
359 if(type == -1) { |
360 if(type == -1) { |
360 log_ereport(LOG_FAILURE, "objconf: unknown tag"); |
361 ws_cfg_log(LOG_FAILURE, "objconf: unknown tag"); |
361 return 1; |
362 return 1; |
362 } else { |
363 } else { |
363 if(type == TAG_OBJECT) { |
364 if(type == TAG_OBJECT) { |
364 conf->obj = NULL; |
365 conf->obj = NULL; |
365 } |
366 } |