diff options
author | Drew DeVault <[email protected]> | 2015-08-04 21:30:40 -0400 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2015-08-04 21:30:40 -0400 |
commit | 542ef0c77700e67a95fcd08b5f305d1ab42046e1 (patch) | |
tree | 17333ebc1a65a28b9538de2da9264a45fc0cf9a9 /sway/config.c | |
parent | 6a33e1e3cddac31b762e4376e29c03ccf8f92107 (diff) |
Pull in some scas code and read i3 config file
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c new file mode 100644 index 00000000..3ad1bcf9 --- /dev/null +++ b/sway/config.c @@ -0,0 +1,27 @@ +#include <stdio.h> +#include <stdlib.h> +#include "readline.h" +#include "stringop.h" +#include "list.h" +#include "config.h" + +struct sway_config *read_config(FILE *file) { + struct sway_config *config = malloc(sizeof(struct sway_config)); + config->symbols = create_list(); + config->modes = create_list(); + + while (!feof(file)) { + int _; + char *line = read_line(file); + line = strip_whitespace(line, &_); + line = strip_comments(line); + if (!line[0]) { + goto _continue; + } + printf("Parsing config line %s\n", line); +_continue: + free(line); + } + + return config; +} |