mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-30 11:10:23 -04:00
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
This commit is contained in:
parent
c11cc2be57
commit
de575ac58e
3 changed files with 66 additions and 16 deletions
4
config.h
4
config.h
|
|
@ -1,9 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
struct config {
|
||||
char *shell;
|
||||
char *font;
|
||||
};
|
||||
|
||||
struct config config_load(void);
|
||||
bool config_load(struct config *conf);
|
||||
void config_free(struct config conf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue