aboutsummaryrefslogtreecommitdiffstats
path: root/src/source-parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-04-19 14:36:19 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-04-19 14:36:19 -0300
commitb81e0c2b1c70badf4131cf8a587a06e1c31df1f5 (patch)
tree1b6099808b8d762120fb5742c4edff6e5adfc198 /src/source-parser.c
parentd301477f1aba66d5f0996da7a610e703d34837c1 (diff)
downloadblogc-b81e0c2b1c70badf4131cf8a587a06e1c31df1f5.tar.gz
blogc-b81e0c2b1c70badf4131cf8a587a06e1c31df1f5.tar.bz2
blogc-b81e0c2b1c70badf4131cf8a587a06e1c31df1f5.zip
loader: added compiler-defined variables
Diffstat (limited to 'src/source-parser.c')
-rw-r--r--src/source-parser.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/source-parser.c b/src/source-parser.c
index b6b7fd0..322906f 100644
--- a/src/source-parser.c
+++ b/src/source-parser.c
@@ -11,6 +11,7 @@
#endif /* HAVE_CONFIG_H */
#include <stdbool.h>
+#include <string.h>
#include "utils/utils.h"
#include "source-parser.h"
@@ -70,6 +71,14 @@ blogc_source_parse(const char *src, size_t src_len, blogc_error_t **err)
break;
if (c == ':') {
key = b_strndup(src + start, current - start);
+ if ((0 == strncmp("FILENAME", src + start, current - start)) ||
+ (0 == strncmp("CONTENT", src + start, current - start)))
+ {
+ *err = blogc_error_new_printf(BLOGC_ERROR_SOURCE_PARSER,
+ "'%s' variable is forbidden in source files. It will "
+ "be set for you by the compiler.", key);
+ break;
+ }
state = SOURCE_CONFIG_VALUE_START;
break;
}