diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-05 20:03:57 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-05 20:03:57 -0400 |
commit | 12b62753744a4d91b16dc08746fa127e3b00929f (patch) | |
tree | aefddd65211f8a0202b82e1202919d4456866747 /config.c | |
parent | f47ec6a1b8379e1430a219fa053f6926f3b33a57 (diff) |
Added the typedefs for the config option types.
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}, |