2020-05-05 09:42:02 +00:00
|
|
|
#ifndef CORE_CONFIG_H
|
|
|
|
#define CORE_CONFIG_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include <confini.h>
|
2020-05-24 23:10:37 +00:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
RUN_TYPE_START,
|
|
|
|
RUN_TYPE_INVALID,
|
|
|
|
} run_type_t;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
LOG_LEVEL_TRACE = 5,
|
|
|
|
LOG_LEVEL_DEBUG = 4,
|
|
|
|
LOG_LEVEL_INFO = 3,
|
|
|
|
LOG_LEVEL_WARN = 2,
|
|
|
|
LOG_LEVEL_ERROR = 1,
|
|
|
|
LOG_LEVEL_FATAL = 0,
|
|
|
|
} log_level_t;
|
2020-05-05 09:42:02 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char *file;
|
|
|
|
char *database;
|
|
|
|
log_level_t log_level;
|
|
|
|
run_type_t run_type;
|
|
|
|
char server_port[6];
|
|
|
|
uint16_t discovery_port;
|
|
|
|
} config_t;
|
|
|
|
|
|
|
|
extern config_t global_config;
|
|
|
|
|
|
|
|
int
|
|
|
|
config_load(IniDispatch *disp, void *config_void);
|
|
|
|
|
|
|
|
#endif /* CORE_CONFIG_H */
|