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-24 23:10:37 +00:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
RUN_TYPE_START,
|
|
|
|
RUN_TYPE_INVALID,
|
|
|
|
} run_type_t;
|
|
|
|
|
2020-05-05 09:42:02 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char *file;
|
2020-06-13 17:21:32 +00:00
|
|
|
char database[256];
|
2020-06-18 22:26:49 +00:00
|
|
|
char user[256];
|
|
|
|
char group[256];
|
2020-07-26 19:00:05 +00:00
|
|
|
int log_level;
|
|
|
|
FILE *log_file;
|
2020-05-05 09:42:02 +00:00
|
|
|
run_type_t run_type;
|
2020-06-25 23:01:46 +00:00
|
|
|
uint16_t server_port;
|
2020-05-05 09:42:02 +00:00
|
|
|
uint16_t discovery_port;
|
2020-06-25 23:01:46 +00:00
|
|
|
uint16_t mqtt_port;
|
2020-07-01 22:16:07 +00:00
|
|
|
char content_dir[1024];
|
2020-06-13 17:21:32 +00:00
|
|
|
char not_found_file[256];
|
|
|
|
char not_found_file_type[256];
|
|
|
|
char not_found_content[256];
|
|
|
|
char not_found_content_type[256];
|
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;
|
|
|
|
|
|
|
|
extern config_t global_config;
|
|
|
|
|
|
|
|
int
|
|
|
|
config_load(IniDispatch *disp, void *config_void);
|
|
|
|
|
|
|
|
#endif /* CORE_CONFIG_H */
|