core-legacy/include/config.h

44 lines
755 B
C
Raw Normal View History

2020-05-05 09:42:02 +00:00
#ifndef CORE_CONFIG_H
#define CORE_CONFIG_H
#include <stdint.h>
2020-05-31 00:07:25 +00:00
#include <mongoose.h>
2020-05-05 09:42:02 +00:00
#include <confini.h>
2020-05-05 09:42:02 +00:00
typedef struct
{
char *file;
2020-11-04 22:03:33 +00:00
char *include;
char *database;
char *user;
char *group;
2020-07-26 19:00:05 +00:00
int log_level;
FILE *log_file;
uint16_t server_port;
2020-05-05 09:42:02 +00:00
uint16_t discovery_port;
uint16_t mqtt_port;
2020-11-04 22:03:33 +00:00
char *content_dir;
char *not_found_file;
char *not_found_file_type;
char *not_found_content;
char *not_found_content_type;
2020-05-31 00:07:25 +00:00
struct mg_serve_http_opts http_server_opts;
2020-05-05 09:42:02 +00:00
} config_t;
2020-11-12 20:58:01 +00:00
extern config_t *global_config;
2020-05-05 09:42:02 +00:00
2020-11-04 22:03:33 +00:00
void
config_init();
void
config_free();
void
2020-11-12 20:58:01 +00:00
config_load_string(char **holder, const char *value);
2020-11-04 22:03:33 +00:00
2020-05-05 09:42:02 +00:00
int
config_load(IniDispatch *disp, void *config_void);
#endif /* CORE_CONFIG_H */