From de575ac58efa65180c3c22e427de612dbdc26706 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 17 Jul 2019 10:12:14 +0200 Subject: conf: improve configuration file parsing * Strip whitespaces from keys and values * Detect (and ignore) comments * Detect syntax errors (no value specified etc) * Error out on syntax errors and invalid keys --- config.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config.h') diff --git a/config.h b/config.h index dffa2998..aa96a49b 100644 --- a/config.h +++ b/config.h @@ -1,9 +1,11 @@ #pragma once +#include + struct config { char *shell; char *font; }; -struct config config_load(void); +bool config_load(struct config *conf); void config_free(struct config conf); -- cgit v1.3