#ifndef OBJCONF_H
#define OBJCONF_H
#include "conf.h"
#include "serverconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
#define CFG_LEVEL_PREPEND(list, level) \
cx_linked_list_prepend((
void**)list,
NULL, -
1, offsetof(ConfigParserLevel, next), level)
typedef struct _conf_object {
ConfigLine *begin;
ConfigLine *end;
cxmutstr name;
cxmutstr ppath;
ConfigDirectiveList *directives[
7];
} ConfigObject;
typedef struct ConfigParserLevel ConfigParserLevel;
struct ConfigParserLevel {
ConfigTag *iftag;
ConfigTag *tag;
int levelnum;
ConfigParserLevel *next;
};
typedef struct _obj_conf {
ConfigParser parser;
char *file;
CxList *objects;
ConfigObject *obj;
ConfigParserLevel *levels;
} ObjectConfig;
typedef struct ObjectConfig2 {
CxMempool *mp;
ConfigNode *root;
} ObjectConfig2;
ObjectConfig2* objectconf_load(
const char *file);
void objectconf_free(ObjectConfig2 *objconf);
int objectconf_validate_directive(ConfigParser2 *parser, ConfigNode *node);
int objectconf_validate_objbegin(ConfigParser2 *parser, ConfigNode *node);
int objectconf_validate_objend(ConfigParser2 *parser, ConfigNode *node);
ObjectConfig *load_object_config(
char *file);
void free_object_config(ObjectConfig *conf);
int objconf_parse(
void *p, ConfigLine *begin, ConfigLine *end, cxmutstr line);
int objconf_on_begin_tag(ObjectConfig *conf, ConfigTag *tag);
int objconf_on_end_tag(ObjectConfig *conf, cxmutstr tagname);
int objconf_on_directive(ObjectConfig *conf, ConfigDirective *dir);
#ifdef __cplusplus
}
#endif
#endif