summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-06 13:25:25 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-06 13:25:25 -0400
commit39a9e3942cef811f52993c702f1f69b1d28fc7cd (patch)
treefa5a0d21be7977e1026c92e2a4691d2ae2752551 /config.c
parent20d1b2259937dc8cd6e3729a9795809c176ef2a6 (diff)
Added a loop for finding a valid config option.
I also added a call to a function that parses the value of the config option.
Diffstat (limited to 'config.c')
-rw-r--r--config.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/config.c b/config.c
index f3eabf5..148ad7d 100644
--- a/config.c
+++ b/config.c
@@ -98,5 +98,14 @@ config *parse_config(const char *filename) {
char *line = get_line(&buf);
char *value;
char *name = strtok_r(line, "=", &value);
+ const config_opt *opt;
+
+ /* Check to see if the config option name we got is valid. */
+ for (opt = config_opts; opt->name != NULL && strcmp(name, opt->name); opt++);
+
+ /* Is the config option valid? */
+ if (opt->name != NULL) {
+ config_val val = parse_option_value(opt, value);
+ }
}
}