e37422f7fd015be33ea7cdf48b4044f51bd13cf5Timo Sirainen#ifndef CONFIG_PARSER_H
e37422f7fd015be33ea7cdf48b4044f51bd13cf5Timo Sirainen#define CONFIG_PARSER_H
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
fc4b301e2dd86c096b9c41ad1b011b752fffd570Timo Sirainen#define CONFIG_MODULE_DIR MODULEDIR"/settings"
fc4b301e2dd86c096b9c41ad1b011b752fffd570Timo Sirainen
d32d7ecc76c7ed93fbdd92ec3a7157a29c5f246eTimo Sirainen#define IS_WHITE(c) ((c) == ' ' || (c) == '\t')
d32d7ecc76c7ed93fbdd92ec3a7157a29c5f246eTimo Sirainen
94163c620a8880024d0e8bbb503c788159fa222bTimo Sirainenstruct config_module_parser {
1cfdcb36985904eff281fc6d7ea2d13b3c375980Timo Sirainen const struct setting_parser_info *root;
ec1a4f4306496380e9d96ee08a3718a669d0875aTimo Sirainen struct setting_parser_context *parser;
ec1a4f4306496380e9d96ee08a3718a669d0875aTimo Sirainen void *settings;
ec1a4f4306496380e9d96ee08a3718a669d0875aTimo Sirainen};
94163c620a8880024d0e8bbb503c788159fa222bTimo SirainenARRAY_DEFINE_TYPE(config_module_parsers, struct config_module_parser *);
ec1a4f4306496380e9d96ee08a3718a669d0875aTimo Sirainen
94163c620a8880024d0e8bbb503c788159fa222bTimo Sirainenextern struct config_module_parser *config_module_parsers;
1358e2c58ce29231485a5cfa454756d429ad3d2cTimo Sirainenextern struct config_filter_context *config_filter;
73b8333f9a979efefe1db70f22c63edec5ad4466Timo Sirainenextern struct module *modules;
1358e2c58ce29231485a5cfa454756d429ad3d2cTimo Sirainen
de44e83f4b5e366e57e973b26f2eb0ad26984945Timo Sirainenint config_parse_net(const char *value, struct ip_addr *ip_r,
de44e83f4b5e366e57e973b26f2eb0ad26984945Timo Sirainen unsigned int *bits_r, const char **error_r);
633a3da9d3e9a5befd3405f6651043a6bdd327cbTimo Sirainenint config_parse_file(const char *path, bool expand_values,
633a3da9d3e9a5befd3405f6651043a6bdd327cbTimo Sirainen const char *const *modules, const char **error_r)
633a3da9d3e9a5befd3405f6651043a6bdd327cbTimo Sirainen ATTR_NULL(3);
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
fc4b301e2dd86c096b9c41ad1b011b752fffd570Timo Sirainenvoid config_parse_load_modules(void);
fc4b301e2dd86c096b9c41ad1b011b752fffd570Timo Sirainen
a402b3c01073c1b11fe3c83aae4e3bc5c7d40360Timo Sirainenbool config_module_want_parser(struct config_module_parser *parsers,
633a3da9d3e9a5befd3405f6651043a6bdd327cbTimo Sirainen const char *const *modules,
633a3da9d3e9a5befd3405f6651043a6bdd327cbTimo Sirainen const struct setting_parser_info *root)
633a3da9d3e9a5befd3405f6651043a6bdd327cbTimo Sirainen ATTR_NULL(2);
6347bb65e93c27f1bf4330786447c9ab0cab4dbfTimo Sirainenvoid config_parser_deinit(void);
194755bdfb97c07ca8b9df071099f68947b971e3Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#endif