core-legacy/include/config.h

58 lines
948 B
C

#ifndef CORE_CONFIG_H
#define CORE_CONFIG_H
#include <stdint.h>
#include <mongoose.h>
#include <toml.h>
typedef struct
{
char *include;
char *database;
char *user;
char *group;
char *content_dir;
char *not_found_file;
char *not_found_file_type;
char *not_found_content;
char *not_found_content_type;
struct
{
int level;
FILE *file;
} logging;
struct
{
uint16_t server;
uint16_t discovery;
uint16_t mqtt;
} ports;
struct mg_serve_http_opts http_server_opts;
} config_t;
extern config_t *global_config;
void
config_init();
void
config_free();
void
config_load_string(char **holder, const char *value);
void
config_load(config_t *config, const char *cli_config_file);
void
config_load_file(config_t *config, const char *file_name);
void
config_load_directory(config_t *config, const char *directory_name);
#endif /* CORE_CONFIG_H */