git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d185889
)
Prebuild the data structure for builtin macros
author
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 8 Jul 2017 16:54:44 +0000
(17:54 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 8 Jul 2017 16:54:44 +0000
(17:54 +0100)
src/src/macro_predef.c
patch
|
blob
|
history
src/src/macro_predef.h
patch
|
blob
|
history
src/src/readconf.c
patch
|
blob
|
history
src/src/route.c
patch
|
blob
|
history
src/src/transport.c
patch
|
blob
|
history
diff --git
a/src/src/macro_predef.c
b/src/src/macro_predef.c
index e133b8e1be9e4e048835ad79f30e206c0cc0a9b5..5ba237929e8d59d54ff6d7e006d7469a71f5ad9e 100644
(file)
--- a/
src/src/macro_predef.c
+++ b/
src/src/macro_predef.c
@@
-29,11
+29,11
@@
if (mp_index == 0)
else
printf("&p%d,", mp_index-1);
else
printf("&p%d,", mp_index-1);
-printf(" FALSE, %d, \"%s\", \"y\" };\n", Ustrlen(name), name);
+printf(" FALSE, %d, \"%s\", \"y\" };\n", Ustrlen(name),
CS
name);
mp_index++;
}
mp_index++;
}
-
static
void
+void
spf(uschar * buf, int len, const uschar * fmt, ...)
{
va_list ap;
spf(uschar * buf, int len, const uschar * fmt, ...)
{
va_list ap;
@@
-73,9
+73,9
@@
expansion. */
for (i = 0; i < nopt; i++) if (*(s = US opts[i].name) && *s != '*')
{
if (group)
for (i = 0; i < nopt; i++) if (*(s = US opts[i].name) && *s != '*')
{
if (group)
- spf(buf, sizeof(buf), "_OPT_%T_%T_%T", section, group, s);
+ spf(buf, sizeof(buf),
CUS
"_OPT_%T_%T_%T", section, group, s);
else
else
- spf(buf, sizeof(buf), "_OPT_%T_%T", section, s);
+ spf(buf, sizeof(buf),
CUS
"_OPT_%T_%T", section, s);
builtin_macro_create(buf);
}
}
builtin_macro_create(buf);
}
}
@@
-273,4
+273,5
@@
options();
printf("macro_item * macros = &p%d;\n", mp_index-1);
printf("macro_item * mlast = &p0;\n");
printf("macro_item * macros = &p%d;\n", mp_index-1);
printf("macro_item * mlast = &p0;\n");
+exit(0);
}
}
diff --git
a/src/src/macro_predef.h
b/src/src/macro_predef.h
index e77f4bec15a75e22352955e5d92a7fbfea3f6a65..1d3ba7f74844c307e08bd70b309282bd209c77b4 100644
(file)
--- a/
src/src/macro_predef.h
+++ b/
src/src/macro_predef.h
@@
-7,6
+7,7
@@
/* Global functions */
/* Global functions */
+extern void spf(uschar *, int, const uschar *, ...);
extern void builtin_macro_create(const uschar *);
extern void options_from_list(optionlist *, unsigned, const uschar *, uschar *);
extern void builtin_macro_create(const uschar *);
extern void options_from_list(optionlist *, unsigned, const uschar *, uschar *);
diff --git
a/src/src/readconf.c
b/src/src/readconf.c
index 045b992a4900019442483d56327fba96e8201124..53f815d53f5a80ed9a6126a259e3e4631449f2ee 100644
(file)
--- a/
src/src/readconf.c
+++ b/
src/src/readconf.c
@@
-395,7
+395,7
@@
options_from_list(optionlist_auths, optionlist_auths_size, US"AUTHENTICATORS", N
for (ai = auths_available; ai->driver_name[0]; ai++)
{
for (ai = auths_available; ai->driver_name[0]; ai++)
{
- s
nprint
f(buf, sizeof(buf), "_DRIVER_AUTHENTICATOR_%T", ai->driver_name);
+ s
p
f(buf, sizeof(buf), "_DRIVER_AUTHENTICATOR_%T", ai->driver_name);
builtin_macro_create(buf);
options_from_list(ai->options, (unsigned)*ai->options_count, US"AUTHENTICATOR", ai->driver_name);
}
builtin_macro_create(buf);
options_from_list(ai->options, (unsigned)*ai->options_count, US"AUTHENTICATOR", ai->driver_name);
}
diff --git
a/src/src/route.c
b/src/src/route.c
index e30ae0e68523c88d2b24574b41bb01f0e53e0c69..857fc65db40ef6f78e4bfbdd1025c9dbf2a4c76a 100644
(file)
--- a/
src/src/route.c
+++ b/
src/src/route.c
@@
-157,7
+157,7
@@
options_from_list(optionlist_routers, nelem(optionlist_routers), US"ROUTERS", NU
for (ri = routers_available; ri->driver_name[0]; ri++)
{
for (ri = routers_available; ri->driver_name[0]; ri++)
{
- s
nprint
f(buf, sizeof(buf), "_DRIVER_ROUTER_%T", ri->driver_name);
+ s
p
f(buf, sizeof(buf), "_DRIVER_ROUTER_%T", ri->driver_name);
builtin_macro_create(buf);
options_from_list(ri->options, (unsigned)*ri->options_count, US"ROUTER", ri->driver_name);
}
builtin_macro_create(buf);
options_from_list(ri->options, (unsigned)*ri->options_count, US"ROUTER", ri->driver_name);
}
diff --git
a/src/src/transport.c
b/src/src/transport.c
index 49ea29e0af787cbe636568c4b4823ef88dfa46c6..6590fa7fb796837ed90354d069826ce753c8e654 100644
(file)
--- a/
src/src/transport.c
+++ b/
src/src/transport.c
@@
-101,7
+101,7
@@
options_from_list(optionlist_transports, nelem(optionlist_transports), US"TRANSP
for (ti = transports_available; ti->driver_name[0]; ti++)
{
for (ti = transports_available; ti->driver_name[0]; ti++)
{
- s
nprint
f(buf, sizeof(buf), "_DRIVER_TRANSPORT_%T", ti->driver_name);
+ s
p
f(buf, sizeof(buf), "_DRIVER_TRANSPORT_%T", ti->driver_name);
builtin_macro_create(buf);
options_from_list(ti->options, (unsigned)*ti->options_count, US"TRANSPORT", ti->driver_name);
}
builtin_macro_create(buf);
options_from_list(ti->options, (unsigned)*ti->options_count, US"TRANSPORT", ti->driver_name);
}