diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-12-27 02:29:54 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-12-27 02:43:59 +0100 |
commit | 8cac2c3e3a61b64b9a9855dec413239bcec7f9d2 (patch) | |
tree | 6240cdabaa0352f08d62bbfa6de7c53f5a3f1063 /src/blogc-make/settings.h | |
parent | 7bf68b0b617fb3ffa86f38fe06a49786883037f4 (diff) | |
download | blogc-8cac2c3e3a61b64b9a9855dec413239bcec7f9d2.tar.gz blogc-8cac2c3e3a61b64b9a9855dec413239bcec7f9d2.tar.bz2 blogc-8cac2c3e3a61b64b9a9855dec413239bcec7f9d2.zip |
make: implemented a build tool for blogc
so, this is basically what happens when you don't have anything better
to do in the christmas weekend. most of this code was written in the
last 2 or 3 days.
i'd like to thank the chivas brothers, the weather and my psychological
problems for this achievement.
on a serious note, this tool still needs a man page, more tests, and the
aws lambda function should be adapted to use it instead of (or together
with) make/busybox.
also, while talking about aws lambda, this tool can be nicely embedded
into the blogc binary, to produce a single "small" static binary for
usage in lambda ;)
Diffstat (limited to 'src/blogc-make/settings.h')
-rw-r--r-- | src/blogc-make/settings.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/blogc-make/settings.h b/src/blogc-make/settings.h new file mode 100644 index 0000000..0ba9545 --- /dev/null +++ b/src/blogc-make/settings.h @@ -0,0 +1,30 @@ +/* + * blogc: A blog compiler. + * Copyright (C) 2016 Rafael G. Martins <rafael@rafaelmartins.eng.br> + * + * This program can be distributed under the terms of the BSD License. + * See the file LICENSE. + */ + +#ifndef _MAKE_SETTINGS_H +#define _MAKE_SETTINGS_H + +#include "../common/error.h" +#include "../common/utils.h" + +typedef struct { + char *root_dir; + bc_trie_t *env; + bc_trie_t *settings; + char **posts; + char **pages; + char **copy_files; + char **tags; +} bm_settings_t; + +bm_settings_t* bm_settings_parse(const char *content, size_t content_len, + bc_error_t **err); +bm_settings_t* bm_settings_parse_file(const char *filename, bc_error_t **err); +void bm_settings_free(bm_settings_t *settings); + +#endif /* _MAKE_SETTINGS_H */ |