2005-02-20 14:27:00 +00:00
|
|
|
#ifndef _CONFIG_PARSER_H_
|
|
|
|
#define _CONFIG_PARSER_H_
|
|
|
|
|
|
|
|
#include "array.h"
|
|
|
|
#include "buffer.h"
|
2005-08-08 14:40:47 +00:00
|
|
|
#include "server.h"
|
2005-02-20 14:27:00 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2005-08-08 14:40:47 +00:00
|
|
|
server *srv;
|
2005-02-20 14:27:00 +00:00
|
|
|
int ok;
|
2005-08-08 13:48:33 +00:00
|
|
|
array *all_configs;
|
|
|
|
array *configs_stack; /* to parse nested block */
|
|
|
|
data_config *current; /* current started with { */
|
2005-08-08 14:40:47 +00:00
|
|
|
buffer *basedir;
|
2005-02-20 14:27:00 +00:00
|
|
|
} config_t;
|
|
|
|
|
|
|
|
void *configparserAlloc(void *(*mallocProc)(size_t));
|
|
|
|
void configparserFree(void *p, void (*freeProc)(void*));
|
|
|
|
void configparser(void *yyp, int yymajor, buffer *yyminor, config_t *ctx);
|
2005-08-08 14:40:47 +00:00
|
|
|
int config_parse_file(server *srv, config_t *context, const char *fn);
|
2005-02-20 14:27:00 +00:00
|
|
|
|
|
|
|
#endif
|