aboutsummaryrefslogtreecommitdiff
path: root/mfd/lex.l
diff options
context:
space:
mode:
Diffstat (limited to 'mfd/lex.l')
-rw-r--r--mfd/lex.l14
1 files changed, 13 insertions, 1 deletions
diff --git a/mfd/lex.l b/mfd/lex.l
index 40821b9a..3ceabfce 100644
--- a/mfd/lex.l
+++ b/mfd/lex.l
@@ -171,13 +171,15 @@ P [1-9][0-9]*
X [0-9a-fA-F]
O [0-7]
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);
<COMMENT>[^*\n]* /* eat anything that's not a '*' */
<COMMENT>"*"+[^*/\n]* /* eat up '*'s not followed by '/'s */
<COMMENT>\n advance_line();
@@ -823,19 +825,29 @@ builtin_const(const char *s)
yylval.number = MAILFROMD_VERSION_MINOR;
return NUMBER;
} else if (strcmp(s, "__patch__") == 0) {
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) {
if (!ext_pp)
string("", 0);
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();
}
/* End of lex.l */

Return to:

Send suggestions and report system problems to the System administrator.