diff options
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -3,6 +3,25 @@ #include <stdlib.h> #include <string.h> +typedef struct config_opt config_opt; +typedef enum config_type config_type; +typedef void (*config_func)(config_opt *, void *); + +enum config_type { + TYPE_INT, + TYPE_STRING, + TYPE_FLOAT, + TYPE_BOOL, +}; + + +struct config_opt { + const char *name; /* Name of the config option. */ + const char *desc; /* Description of the config option. */ + config_type type; /* Datatype of the config option. */ + config_func func; /* Function of the config option. */ +}; + static const config_opt config_opts[] = { /* {"name", "desc", type, &func} */ {"git-root", "Root of git server (can also be a url).", TYPE_STRING, &get_git_root}, |