diff options
Diffstat (limited to 'src/config.h')
| -rw-r--r-- | src/config.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/config.h b/src/config.h index 699fa83..427ad40 100644 --- a/src/config.h +++ b/src/config.h @@ -5,6 +5,7 @@ #include <stdint.h> #include "util.h" +#include "any_log.h" typedef struct block block_t; @@ -23,10 +24,26 @@ typedef enum { CONFIG_LIST, } config_type_t; +typedef enum { + CHECK_NONE, + CHECK_POSITIVE, + CHECK_IN_RANGE, +} config_check_type_t; + +typedef struct { + config_check_type_t type; + union { + struct { + int min, max; + } range; + }; +} config_check_t; + typedef struct { const char *key; config_type_t type; const void *data; + const config_check_t *checks; size_t offset; } config_entry_t; @@ -62,6 +79,8 @@ typedef struct { int value; } config_enum_t; +extern const any_log_formatter_t config_formatters[]; + const char *config_type_to_string(config_type_t type); void config_init(config_t *config); |
