summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-05 20:03:57 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-05 20:03:57 -0400
commit12b62753744a4d91b16dc08746fa127e3b00929f (patch)
treeaefddd65211f8a0202b82e1202919d4456866747 /config.c
parentf47ec6a1b8379e1430a219fa053f6926f3b33a57 (diff)
Added the typedefs for the config option types.
Diffstat (limited to 'config.c')
-rw-r--r--config.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/config.c b/config.c
index 8ce7ebc..15689a6 100644
--- a/config.c
+++ b/config.c
@@ -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},