From 12b62753744a4d91b16dc08746fa127e3b00929f Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sat, 5 Jun 2021 20:03:57 -0400 Subject: Added the typedefs for the config option types. --- config.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/config.c b/config.c index 8ce7ebc..15689a6 100644 --- a/config.c +++ b/config.c @@ -3,6 +3,25 @@ #include #include +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}, -- cgit v1.2.3-13-gbd6f