summaryrefslogtreecommitdiffabout
path: root/mfd/lex.l
Side-by-side diff
Diffstat (limited to 'mfd/lex.l') (more/less context) (ignore whitespace changes)
-rw-r--r--mfd/lex.l14
1 files changed, 13 insertions, 1 deletions
diff --git a/mfd/lex.l b/mfd/lex.l
index 40821b9..3ceabfc 100644
--- a/mfd/lex.l
+++ b/mfd/lex.l
@@ -174,7 +174,9 @@ WS [ \t][ \t]*
IDENT [a-zA-Z_][a-zA-Z_0-9]*
LOCUS __file__|__line__|__function__
VCONST __package__|__version__|__major__|__minor__|__patch__
-ICONST {LOCUS}|{VCONST}|__statedir__|__preproc__
+STATEDIR __(def)?statedir__
+PREPROC __(def)?preproc__
+ICONST {LOCUS}|{VCONST}|{STATEDIR}|{PREPROC}
%%
/* C-style comments */
"/*" BEGIN_X(COMMENT);
@@ -826,6 +828,9 @@ builtin_const(const char *s)
yylval.number = MAILFROMD_VERSION_PATCH;
return NUMBER;
} else if (strcmp(s, "__statedir__") == 0) {
+ string(mailfromd_state_dir, strlen(mailfromd_state_dir));
+ return STRING;
+ } else if (strcmp(s, "__defstatedir__") == 0) {
string(DEFAULT_STATE_DIR, sizeof DEFAULT_STATE_DIR - 1);
return STRING;
} else if (strcmp(s, "__preproc__") == 0) {
@@ -834,6 +839,13 @@ builtin_const(const char *s)
else
string(ext_pp, strlen(ext_pp));
return STRING;
+ } else if (strcmp(s, "__defpreproc__") == 0) {
+ if (DEFAULT_PREPROCESSOR)
+ string(DEFAULT_PREPROCESSOR,
+ sizeof DEFAULT_PREPROCESSOR - 1);
+ else
+ string("", 0);
+ return STRING;
}
abort();
}

Return to:

Send suggestions and report system problems to the System administrator.