summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org>2018-11-02 10:47:51 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2018-11-03 16:27:57 (GMT)
commitd8b9854a76d69e99bbbddd285a0e0d7727a62e4f (patch) (side-by-side diff)
tree07530d46481f2c70a0b5e6186e1cb6480ad1f8e0 /src
parent62ac2fa1db13e2c688c6112cd6cb7682a232f16a (diff)
downloadmailfromd-d8b9854a76d69e99bbbddd285a0e0d7727a62e4f.tar.gz
mailfromd-d8b9854a76d69e99bbbddd285a0e0d7727a62e4f.tar.bz2
Revise preprocessor macros for builtin functions.
* doc/mailfromd.texi: Minor change. * src/builtin/Makefile.am (builtin.h): Depend pn init.m4 (.bi.c): Don't eliminate first #line * src/builtin/snarf.m4 (MF_BUILTIN_MODULE): New macro. (MF_INIT): Rewrite. Revise comments. * src/builtin/init.m4 (MF_BUILTIN_MODULE): New macro. (MF_INIT): Remove. * src/builtin/body.bi: Use MF_BUILTIN_MODULE statement. * src/builtin/burst.bi: Likewise. * src/builtin/callout.bi: Likewise. * src/builtin/ctype.bi: Likewise. * src/builtin/curhdr.bi: Likewise. * src/builtin/db.bi: Likewise. * src/builtin/debug.bi: Likewise. * src/builtin/dns.bi: Likewise. * src/builtin/dspam.bi: Likewise. * src/builtin/email.bi: Likewise. * src/builtin/from.bi: Likewise. * src/builtin/geoip.bi: Likewise. * src/builtin/gethostname.bi: Likewise. * src/builtin/getopt.bi: Likewise. * src/builtin/getpw.bi: Likewise. * src/builtin/gettext.bi: Likewise. * src/builtin/header.bi: Likewise. * src/builtin/io.bi: Likewise. * src/builtin/ipaddr.bi: Likewise. * src/builtin/macro.bi: Likewise. * src/builtin/mail.bi: Likewise. * src/builtin/mbox.bi: Likewise. * src/builtin/mmq.bi: Likewise. * src/builtin/msg.bi: Likewise. * src/builtin/other.bi: Likewise. * src/builtin/prereq.bi: Likewise. * src/builtin/progress.bi: Likewise. * src/builtin/qrnt.bi: Likewise. * src/builtin/rate.bi: Likewise. * src/builtin/rcpt.bi: Likewise. * src/builtin/sa.bi: Likewise. * src/builtin/sieve.bi: Likewise. * src/builtin/spf.bi: Likewise. * src/builtin/sprintf.bi: Likewise. * src/builtin/string.bi: Likewise. * src/builtin/syslog.bi: Likewise. * src/builtin/system.bi: Likewise. * src/builtin/vars.bi: Likewise.
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/builtin/Makefile.am6
-rw-r--r--src/builtin/body.bi3
-rw-r--r--src/builtin/builtin.def2
-rw-r--r--src/builtin/burst.bi2
-rw-r--r--src/builtin/callout.bi1
-rw-r--r--src/builtin/ctype.bi2
-rw-r--r--src/builtin/curhdr.bi2
-rw-r--r--src/builtin/db.bi3
-rw-r--r--src/builtin/debug.bi3
-rw-r--r--src/builtin/dns.bi3
-rw-r--r--src/builtin/dspam.bi2
-rw-r--r--src/builtin/email.bi2
-rw-r--r--src/builtin/from.bi3
-rw-r--r--src/builtin/geoip.bi3
-rw-r--r--src/builtin/gethostname.bi5
-rw-r--r--src/builtin/getopt.bi2
-rw-r--r--src/builtin/getpw.bi4
-rw-r--r--src/builtin/gettext.bi5
-rw-r--r--src/builtin/header.bi3
-rw-r--r--src/builtin/init.m419
-rw-r--r--src/builtin/io.bi2
-rw-r--r--src/builtin/ipaddr.bi5
-rw-r--r--src/builtin/macro.bi3
-rw-r--r--src/builtin/mail.bi3
-rw-r--r--src/builtin/mbox.bi2
-rw-r--r--src/builtin/mmq.bi3
-rw-r--r--src/builtin/msg.bi2
-rw-r--r--src/builtin/other.bi3
-rw-r--r--src/builtin/prereq.bi3
-rw-r--r--src/builtin/progress.bi3
-rw-r--r--src/builtin/qrnt.bi3
-rw-r--r--src/builtin/rate.bi3
-rw-r--r--src/builtin/rcpt.bi3
-rw-r--r--src/builtin/sa.bi4
-rw-r--r--src/builtin/sieve.bi3
-rw-r--r--src/builtin/snarf.m4550
-rw-r--r--src/builtin/spf.bi3
-rw-r--r--src/builtin/sprintf.bi3
-rw-r--r--src/builtin/string.bi3
-rw-r--r--src/builtin/syslog.bi3
-rw-r--r--src/builtin/system.bi3
-rw-r--r--src/builtin/vars.bi3
42 files changed, 465 insertions, 223 deletions
diff --git a/src/builtin/Makefile.am b/src/builtin/Makefile.am
index 2e397f1..7d5db66 100644
--- a/src/builtin/Makefile.am
+++ b/src/builtin/Makefile.am
@@ -79,7 +79,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)\
$(DSPAM_CFLAGS)
-builtin.h: Makefile.am builtin.def
+builtin.h: Makefile.am builtin.def init.m4
$(BI_FILES:.bi=.c): snarf.m4 init.m4
@@ -88,9 +88,7 @@ SUFFIXES = .bi .c .def .h .mfi .mf
M4=m4
.bi.c:
- $(AM_V_GEN)$(M4) --prefix -s -DSOURCE="$<" $(top_srcdir)/src/builtin/snarf.m4 $< > $@-t && \
- sed '1{/#line/d;}' $@-t > $@ && \
- rm $@-t
+ $(AM_V_GEN)$(M4) --prefix -s -DSOURCE="$<" $(top_srcdir)/src/builtin/snarf.m4 $< > $@
.def.h:
$(AM_V_GEN) $(M4) --prefix $(top_srcdir)/src/builtin/init.m4 $(BI_FILES) $< > $@
diff --git a/src/builtin/body.bi b/src/builtin/body.bi
index ab6611f..8626f12 100644
--- a/src/builtin/body.bi
+++ b/src/builtin/body.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include "msg.h"
MF_STATE(body)
@@ -66,4 +68,3 @@ MF_DEFUN(replbody_fd, VOID, NUMBER fd)
}
END
-MF_INIT
diff --git a/src/builtin/builtin.def b/src/builtin/builtin.def
index ea1b39a..3595df7 100644
--- a/src/builtin/builtin.def
+++ b/src/builtin/builtin.def
@@ -1,4 +1,4 @@
-/* This file is part of Mailfromd.
+/* This file is part of Mailfromd. -*- C -*-
Copyright (C) 2010-2018 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
diff --git a/src/builtin/burst.bi b/src/builtin/burst.bi
index 34971f3..ae0bb83 100644
--- a/src/builtin/burst.bi
+++ b/src/builtin/burst.bi
@@ -16,6 +16,8 @@
/* Functions for converting RFC-934 digests into MIME messages.
Largely inspired by MU's mh/burst.c */
+
+MF_BUILTIN_MODULE
#include <mflib/status.h>
#include "msg.h"
#include "global.h"
diff --git a/src/builtin/callout.bi b/src/builtin/callout.bi
index 3c3f158..24f9400 100644
--- a/src/builtin/callout.bi
+++ b/src/builtin/callout.bi
@@ -15,6 +15,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Run-time support for callout functions */
+MF_BUILTIN_MODULE
#include "filenames.h"
#include "callout.h"
diff --git a/src/builtin/ctype.bi b/src/builtin/ctype.bi
index e452e25..faa3e70 100644
--- a/src/builtin/ctype.bi
+++ b/src/builtin/ctype.bi
@@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
MF_VAR(ctype_mismatch, NUMBER);
m4_define([<MF_DEFUN_CTYPE>],[<
@@ -44,4 +45,3 @@ MF_DEFUN_CTYPE(isspace)
MF_DEFUN_CTYPE(isupper)
MF_DEFUN_CTYPE(isxdigit)
-MF_INIT
diff --git a/src/builtin/curhdr.bi b/src/builtin/curhdr.bi
index e7dc460..14430d6 100644
--- a/src/builtin/curhdr.bi
+++ b/src/builtin/curhdr.bi
@@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
#include "msg.h"
/* number current_header_count([string name]) */
@@ -148,4 +149,3 @@ MF_DEFUN(current_header, STRING, STRING name, OPTIONAL, NUMBER index)
}
END
-MF_INIT
diff --git a/src/builtin/db.bi b/src/builtin/db.bi
index 7186e3c..8dea160 100644
--- a/src/builtin/db.bi
+++ b/src/builtin/db.bi
@@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
#define DEFAULT_DB_MODE 0640
#include <fnmatch.h>
@@ -967,5 +968,3 @@ MF_DEFUN(db_expire_interval, NUMBER, STRING fmtid)
}
END
-MF_INIT
-
diff --git a/src/builtin/debug.bi b/src/builtin/debug.bi
index e230794..f9a49c6 100644
--- a/src/builtin/debug.bi
+++ b/src/builtin/debug.bi
@@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
#include "mflib/_register.h"
#include "srvcfg.h"
@@ -132,4 +133,4 @@ MF_INIT([<
bi_debug, 0, dtype_unspecified, 1, 0, 0,
dtype_string);
>])
-
+
diff --git a/src/builtin/dns.bi b/src/builtin/dns.bi
index 6a98dfd..b417a8c 100644
--- a/src/builtin/dns.bi
+++ b/src/builtin/dns.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
@@ -277,4 +279,3 @@ MF_DEFUN(ptr_validate, NUMBER, STRING s)
}
END
-MF_INIT
diff --git a/src/builtin/dspam.bi b/src/builtin/dspam.bi
index cc4b7d2..d1ab7e7 100644
--- a/src/builtin/dspam.bi
+++ b/src/builtin/dspam.bi
@@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
MF_COND(WITH_DSPAM)
#include "srvcfg.h"
@@ -529,4 +530,3 @@ MF_DEFUN(dspam, NUMBER, NUMBER nmsg, NUMBER mode_flags, OPTIONAL, NUMBER class_s
}
END
-MF_INIT
diff --git a/src/builtin/email.bi b/src/builtin/email.bi
index 2d90abc..a396f24 100644
--- a/src/builtin/email.bi
+++ b/src/builtin/email.bi
@@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
#include "mflib/email.h"
MF_DEFUN(domainpart, STRING, STRING str)
@@ -77,4 +78,3 @@ MF_DEFUN(email_map, NUMBER, STRING str)
}
END
-MF_INIT
diff --git a/src/builtin/from.bi b/src/builtin/from.bi
index 5720152..73a84cd 100644
--- a/src/builtin/from.bi
+++ b/src/builtin/from.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
MF_DEFUN(set_from, VOID, STRING addr, OPTIONAL, STRING args)
{
struct mu_locus_range locus;
@@ -29,4 +31,3 @@ MF_DEFUN(set_from, VOID, STRING addr, OPTIONAL, STRING args)
}
END
-MF_INIT
diff --git a/src/builtin/geoip.bi b/src/builtin/geoip.bi
index b2dcad9..c40a184 100644
--- a/src/builtin/geoip.bi
+++ b/src/builtin/geoip.bi
@@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
MF_COND(WITH_GEOIP)
#include <GeoIP.h>
@@ -55,5 +56,3 @@ MF_DEFUN(geoip_country_code_by_name, STRING, STRING name,
}
END
-MF_INIT
-
diff --git a/src/builtin/gethostname.bi b/src/builtin/gethostname.bi
index 3d61668..9914a57 100644
--- a/src/builtin/gethostname.bi
+++ b/src/builtin/gethostname.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#ifndef ENAMETOOLONG
# define ENAMETOOLONG 0
#endif
@@ -134,5 +136,4 @@ MF_DEFUN(getdomainname, STRING)
MF_RETURN_OBSTACK();
}
END
-
-MF_INIT
+
diff --git a/src/builtin/getopt.bi b/src/builtin/getopt.bi
index 3303052..e50f3eb 100644
--- a/src/builtin/getopt.bi
+++ b/src/builtin/getopt.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include <unistd.h>
#include <stdlib.h>
#include <getopt.h>
diff --git a/src/builtin/getpw.bi b/src/builtin/getpw.bi
index a148a71..7e12719 100644
--- a/src/builtin/getpw.bi
+++ b/src/builtin/getpw.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
static void
return_passwd(eval_environ_t env, struct passwd *pw)
{
@@ -75,5 +77,3 @@ MF_DEFUN(getpwuid, STRING, NUMBER uid)
}
END
-
-MF_INIT
diff --git a/src/builtin/gettext.bi b/src/builtin/gettext.bi
index 070c294..329feae 100644
--- a/src/builtin/gettext.bi
+++ b/src/builtin/gettext.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
MF_DEFUN(bindtextdomain, STRING, STRING domain, STRING dirname)
{
const char *s = bindtextdomain(domain[0] ? domain : NULL, dirname);
@@ -37,6 +39,3 @@ MF_DEFUN(dngettext, STRING, STRING domain,
}
END
-MF_INIT
-
-
diff --git a/src/builtin/header.bi b/src/builtin/header.bi
index 2922157..e46183d 100644
--- a/src/builtin/header.bi
+++ b/src/builtin/header.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
MF_DEFUN(header_add, VOID, STRING name, STRING value, OPTIONAL, NUMBER idx)
{
struct mu_locus_range locus;
@@ -117,4 +119,3 @@ MF_DEFUN(header_replace_nth, VOID, NUMBER idx, STRING name, STRING value)
}
END
-MF_INIT
diff --git a/src/builtin/init.m4 b/src/builtin/init.m4
index 64cdd9d..73168b5 100644
--- a/src/builtin/init.m4
+++ b/src/builtin/init.m4
@@ -18,12 +18,6 @@ m4_divert(-1)
m4_changequote([<,>])
m4_changecom(/*,*/)
-m4_define([<MF_MODULE_NAME>],[<m4_dnl
-m4_patsubst(m4___file__,\(.*/\)?\(.*\)\.bi,\2)>])
-
-m4_define([<MF_MODULE_IDX>],[<m4_dnl
-[<BUILTIN_IDX_>]MF_MODULE_NAME()>])
-
m4_define([<__MODNO__>],0)
m4_define([<MF_BEGIN_OUTPUT>],[<m4_dnl
@@ -51,13 +45,16 @@ m4_undivert(3)
#define BUILTIN_IDX_MAX (sizeof(builtin_module)/sizeof(builtin_module[0])-1)
>])
-m4_define([<MF_INIT>],[<m4_dnl
-m4_pushdef([<MODNAME>],MF_MODULE_NAME())
+m4_define([<MF_BUILTIN_MODULE>],
+[<m4_pushdef([<MF_MODULE_NAME>],
+m4_ifelse([<$1>],,[<m4_dnl
+m4_patsubst(m4___file__,\(.*/\)?\(.*\)\.bi,\2)>],[<$1>]))
+m4_pushdef([<MF_MODULE_IDX>],[<[<BUILTIN_IDX_>]MF_MODULE_NAME()>])
m4_define([<__MODNO__>],m4_incr(__MODNO__))
m4_divert(1)m4_dnl
#define MF_MODULE_IDX (__MODNO__)
m4_divert(2)m4_dnl
-extern void MODNAME[<>]_init_builtin(void);
+extern void MF_MODULE_NAME[<>]_init_builtin(void);
m4_divert(3)m4_dnl
- { "MODNAME", MODNAME[<>]_init_builtin, 0 },
-m4_divert(-1)m4_dnl>])
+ { "MF_MODULE_NAME", MF_MODULE_NAME[<>]_init_builtin, 0 },
+m4_divert(-1)>])
diff --git a/src/builtin/io.bi b/src/builtin/io.bi
index 2ca80e2..d1512ad 100644
--- a/src/builtin/io.bi
+++ b/src/builtin/io.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include <mflib/status.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/src/builtin/ipaddr.bi b/src/builtin/ipaddr.bi
index 9ede3b4..a586342 100644
--- a/src/builtin/ipaddr.bi
+++ b/src/builtin/ipaddr.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -97,6 +99,3 @@ MF_DEFUN(netmask_to_len, NUMBER, NUMBER x)
}
END
-MF_INIT
-
-
diff --git a/src/builtin/macro.bi b/src/builtin/macro.bi
index 757bbf8..2d41ff7 100644
--- a/src/builtin/macro.bi
+++ b/src/builtin/macro.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
/* #pragma miltermacros <handler> <name> [name...] */
MF_PRAGMA(miltermacros, 3, 0)
{
@@ -46,4 +48,3 @@ MF_DEFUN(macro_defined, NUMBER, STRING name)
}
END
-MF_INIT
diff --git a/src/builtin/mail.bi b/src/builtin/mail.bi
index dc7ea34..edf21b3 100644
--- a/src/builtin/mail.bi
+++ b/src/builtin/mail.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include "msg.h"
static int
@@ -335,4 +337,3 @@ MF_DEFUN(send_dsn, VOID, STRING to,
}
END
-MF_INIT
diff --git a/src/builtin/mbox.bi b/src/builtin/mbox.bi
index a0226ce..df4f3ec 100644
--- a/src/builtin/mbox.bi
+++ b/src/builtin/mbox.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include "msg.h"
#include "global.h"
diff --git a/src/builtin/mmq.bi b/src/builtin/mmq.bi
index c9c24bc..5ad0e32 100644
--- a/src/builtin/mmq.bi
+++ b/src/builtin/mmq.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
/* Clear the list of message modification requests. This function undoes
the effect of the following functions, if they had been called
previously: rcpt_add, rcpt_delete, header_add, header_insert,
@@ -25,4 +27,3 @@ MF_DEFUN(mmq_purge, VOID)
}
END
-MF_INIT
diff --git a/src/builtin/msg.bi b/src/builtin/msg.bi
index faaa7bf..46e63cd 100644
--- a/src/builtin/msg.bi
+++ b/src/builtin/msg.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include "msg.h"
#include "global.h"
diff --git a/src/builtin/other.bi b/src/builtin/other.bi
index 673f451..5063885 100644
--- a/src/builtin/other.bi
+++ b/src/builtin/other.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include "mflib/_register.h"
static int
@@ -69,4 +71,3 @@ MF_DEFUN(interval, NUMBER, STRING str)
}
END
-MF_INIT
diff --git a/src/builtin/prereq.bi b/src/builtin/prereq.bi
index d51c0e3..9d92b0a 100644
--- a/src/builtin/prereq.bi
+++ b/src/builtin/prereq.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
/* #pragma prereq <version> */
MF_PRAGMA(prereq, 1, 0)
{
@@ -42,4 +44,3 @@ MF_DEFUN(vercmp, NUMBER, STRING a, STRING b)
}
END
-MF_INIT
diff --git a/src/builtin/progress.bi b/src/builtin/progress.bi
index 00bb1a5..484b8bb 100644
--- a/src/builtin/progress.bi
+++ b/src/builtin/progress.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
MF_STATE(eom)
MF_DEFUN(progress, VOID)
{
@@ -29,4 +31,3 @@ MF_DEFUN(progress, VOID)
}
END
-MF_INIT
diff --git a/src/builtin/qrnt.bi b/src/builtin/qrnt.bi
index 85a961b..74fc833 100644
--- a/src/builtin/qrnt.bi
+++ b/src/builtin/qrnt.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
MF_DEFUN(quarantine, VOID, STRING reason)
{
struct mu_locus_range locus;
@@ -29,4 +31,3 @@ MF_DEFUN(quarantine, VOID, STRING reason)
}
END
-MF_INIT
diff --git a/src/builtin/rate.bi b/src/builtin/rate.bi
index bfbc826..adf7a49 100644
--- a/src/builtin/rate.bi
+++ b/src/builtin/rate.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
MF_DEFUN(rate, NUMBER, STRING key, NUMBER interval, OPTIONAL, NUMBER mincnt,
NUMBER threshold)
{
@@ -43,4 +45,3 @@ MF_DEFUN(tbf_rate, NUMBER, STRING key, NUMBER cost,
}
END
-MF_INIT
diff --git a/src/builtin/rcpt.bi b/src/builtin/rcpt.bi
index bbd63fc..9f053f7 100644
--- a/src/builtin/rcpt.bi
+++ b/src/builtin/rcpt.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
MF_DEFUN(rcpt_add, VOID, STRING addr)
{
struct mu_locus_range locus;
@@ -44,4 +46,3 @@ MF_DEFUN(rcpt_delete, VOID, STRING addr)
}
END
-MF_INIT
diff --git a/src/builtin/sa.bi b/src/builtin/sa.bi
index ca4c616..fd3fa0b 100644
--- a/src/builtin/sa.bi
+++ b/src/builtin/sa.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
@@ -588,5 +590,3 @@ MF_DEFUN(clamav, NUMBER, NUMBER nmsg, STRING urlstr)
}
END
-MF_INIT
-
diff --git a/src/builtin/sieve.bi b/src/builtin/sieve.bi
index ba23f4d..0e594a3 100644
--- a/src/builtin/sieve.bi
+++ b/src/builtin/sieve.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include <mailutils/mailutils.h>
#include <mflib/sieve.h>
#include "msg.h"
@@ -147,4 +149,3 @@ MF_DEFUN(sieve, NUMBER, NUMBER nmsg, STRING script, OPTIONAL, NUMBER flags,
}
END
-MF_INIT
diff --git a/src/builtin/snarf.m4 b/src/builtin/snarf.m4
index bafd12c..2a32b02 100644
--- a/src/builtin/snarf.m4
+++ b/src/builtin/snarf.m4
@@ -27,7 +27,7 @@ m4_changecom(/*,*/)
m4_define([<__mf_dataseg>])
/* The MF_DSEXP attribute indicates that the MF_DEFUN that follows it
- * can cause dataseg expansion
+ * can cause dataseg expansion.
*/
m4_define([<MF_DSEXP>],[<m4_define([<__mf_dataseg>],[<MFL_DATASEG>])>])
@@ -37,7 +37,7 @@ m4_define([<MF_DSEXP>],[<m4_define([<__mf_dataseg>],[<MFL_DATASEG>])>])
* The intent is to warn the programmer that the function in question can
* result in dataseg being expanded. The warning is suppressed by MF_DSEXP
* attribute (for MF_DEFUNs) or by the use of MF_DSEXP_SUPPRESS macro (for
- * C functions).
+ * C functions).
*/
m4_define([<__MF_DSEXP_REQ>],[<m4_dnl
m4_ifelse(__mf_dataseg,[<>],[<m4_ifdef([<__MF_FUNCTION__>],[<m4_dnl
@@ -56,32 +56,51 @@ m4_define([<___mf_define_fun>],[<
m4_define([<$1>],[<__MF_DSEXP_REQ()
[<$1>]([<$2>])>])>])
-/* MF_DSEXP_SUPPRESS(NAME, DEFN) - Suppresses dataseg expansion warnings
- * within DEFN and redeclares NAME to produce a warning if used in a
- * context which is not safe for dataseg expansion.
+/* MF_DSEXP_SUPPRESS(NAME, DEFN)
+ * -----------------------------
+ * Suppresses dataseg expansion warnings within DEFN and redeclares NAME to
+ * produce a warning if used in a context which is not safe for dataseg
+ * expansion.
*/
m4_define([<MF_DSEXP_SUPPRESS>],[<m4_pushdef([<__mf_dataseg>],[</**/>])
$2
m4_popdef([<__mf_dataseg>])
__mf_define_fun([<$1>])>])
-/* MF_MODULE_NAME() - Returns the name of the current module.
+/* MF_MODULE_NAME()
+ * ----------------
+ * Expand to the name of this module.
*/
-m4_define([<MF_MODULE_NAME>],[<m4_dnl
-m4_patsubst(m4___file__,\(.*/\)?\(.*\)\.bi,\2)>])
+m4_pushdef([<MF_MODULE_NAME>])
-/* MF_SOURCE_DEBUG_NAME(MODULE) - Return the "debug" name for the MODULE.
+/* MF_BUILTIN_MODULE([NAME])
+ * -------------------------
+ * Start MFL built-in module text. Optional NAME is the name of the module.
+ * If not supplied, the name is defined as the base name of the module file.
+ */
+m4_define([<MF_BUILTIN_MODULE>],m4_dnl
+[<m4_pushdef([<MF_MODULE_NAME>],m4_dnl
+m4_ifelse([<$1>],,[<m4_dnl
+m4_patsubst(m4___file__,\(.*/\)?\(.*\)\.bi,\2)>],[<$1>]))>])m4_dnl
+
+/* MF_SOURCE_DEBUG_NAME(MODULE)
+ * ----------------------------
+ * Expand to the "debug" name for the MODULE.
*/
m4_define([<MF_SOURCE_DEBUG_NAME>],[<m4_dnl
m4_translit(m4_patsubst($1,\(.*/\)?\(.*\)\.bi,bi_\2),[<A-Z->],[<a-z_>])>])
-/* MF_MODULE_IDX() - Returns BUILTIN_IDX_ constant for the current module.
+/* MF_MODULE_IDX()
+ * ---------------
+ * Expand to the BUILTIN_IDX_ constant for the current module.
*/
m4_define([<MF_MODULE_IDX>],[<m4_dnl
[<BUILTIN_IDX_>]MF_MODULE_NAME()>])
-/* __mf_argtype(arg) -- return Mailfromd value type code corresponding to
- * ARG:
+/* __mf_argtype(arg)
+ * -----------------
+ * Expand to Mailfromd value type code corresponding to ARG:
+ *
* __mf_argtype(STRING) => dtype_string
* __mf_argtype(NUMBER) => dtype_number
* __mf_argtype(POINTER) => dtype_pointer
@@ -92,15 +111,19 @@ m4_define([<__mf_argtype>],m4_dnl
$1,POINTER,dtype_pointer,m4_dnl
dtype_unspecified)>])
-/* mf_argtype(TYPE NAME) -- return Mailfromd value type code corresponding to
+/* mf_argtype(TYPE NAME)
+ * ---------------------
+ * Expand to the Mailfromd value type code corresponding to
* TYPE. See __mf_argtype above.
*/
m4_define([<mf_argtype>],m4_dnl
[<__mf_argtype(m4_patsubst([<$1>],[<[ \t].*>],))>])
-/* mf_typelist(arglist) -- convert ARGLIST into a list of corresponding
- * Mailfromd value type codes. e.g.:
- * mf_typelist(STRING a, NUMBER b) => dtype_string, dtype_number
+/* mf_typelist(ARGLIST)
+ * --------------------
+ * Convert ARGLIST into a list of corresponding Mailfromd value type codes.
+ * E.g.:
+ * mf_typelist(STRING a, NUMBER b) => dtype_string, dtype_number
*/
m4_define([<mf_typelist>],m4_dnl
[<m4_ifelse($#, 1, [<mf_argtype($1)>], m4_dnl,
@@ -108,43 +131,51 @@ $1, [<OPTIONAL>], [<mf_typelist(m4_shift($@))>],
[<mf_argtype($1), >]m4_dnl
[<mf_typelist(m4_shift($@))>])>])
-/* __mf_has_optarg(ARGS..) -- return 1 if ARGS contain OPTIONAL keyword, and
- * 0 otherwise
+/* __mf_has_optarg(ARGS...)
+ * ------------------------
+ * Expand to 1 if ARGS contain OPTIONAL keyword, and to 0 otherwise
*/
m4_define([<__mf_has_optarg>],m4_dnl
[<m4_ifelse($1, , 0,$1,[<OPTIONAL>], 1,[<m4_dnl
__mf_has_optarg(m4_shift($@))>])>])
-/* __mf_c_type(TYPE) -- return a C type corresponding to the Mailfromd one
+/* __mf_c_type(TYPE)
+ * -----------------
+ * Expand to a C type corresponding to the Mailfromd TYPE
*/
m4_define([<__mf_c_type>],m4_dnl
[<m4_ifelse($1,STRING,char * __mf_dataseg,$1,NUMBER,long ,$1,POINTER,void * __mf_dataseg, ERROR )>])
-/* __mf_c_getarg(TYPE) -- return a get_(.*)_arg function for the given MFL
- * TYPE
+/* __mf_c_getarg(TYPE)
+ * -------------------
+ * Expand to the get_(.*)_arg function call for the given MFL TYPE
*/
m4_define([<__mf_c_getarg>],m4_dnl
[<m4_ifelse($1,STRING,get_string_arg,$1,NUMBER,get_numeric_arg,m4_dnl
$1,POINTER,get_pointer_arg, ERROR )>])
-/* mf_c_argdcl(TYPE NAME) -- translate Mailfromd declaration "TYPE NAME"
- * into the corresponding C one:
+/* mf_c_argdcl(TYPE NAME)
+ * ----------------------
+ * Translate MFL declaration "TYPE NAME" to the corresponding C one:
*
* mf_c_argdcl(STRING str) => char *str
*/
m4_define([<mf_c_argdcl>],m4_dnl
[<m4_regexp([<$1>],[<\(\w+\)\W+\(\w+\)>],[<__mf_c_type(\1)>] \2)>])
-/* mf_c_arginit(TYPE NAME, NUM) -- translate Mailfromd declaration "TYPE NAME"
- * into the corresponding C initialization:
+/* mf_c_arginit(TYPE NAME, NUM)
+ * ----------------------------
+ * Translate MFL declaration "TYPE NAME" to the corresponding C initialization:
*
- * mf_c_argdcl(STRING str) => get_string_arg(env, NUM, &str)
+ * mf_c_arginit(STRING str, NUM) => get_string_arg(env, NUM, &str)
*/
m4_define([<mf_c_arginit>],m4_dnl
[<m4_regexp([<$1>],[<\(\w+\)\W+\(\w+\)>],[<__mf_c_getarg(\1)(env, $2, &\2)>])>])
-/* __mf_c_argdcl_list(NARG, LIST) -- translate Mailfromd declaration list
- * into a set of corresponding C variable declarations.
+/* __mf_c_argdcl_list(NARG, LIST)
+ * ------------------------------
+ * Translate MFL declaration list to a set of corresponding C variable
+ * declarations.
* For more details, see mf_c_arglist below.
*/
m4_define([<__mf_c_argdcl_list>],m4_dnl
@@ -153,8 +184,10 @@ __mf_c_argdcl_list($1, m4_shift(m4_shift($@)))>],
[<mf_c_argdcl($2);
__mf_c_argdcl_list(m4_incr($1), m4_shift(m4_shift($@)))>])>])
-/* __mf_c_arginit_list(NARG, LIST) -- translate Mailfromd declaration list
- * into a set of corresponding C variable initializations.
+/* __mf_c_arginit_list(NARG, LIST)
+ * -------------------------------
+ * Translate MFL declaration list to a set of corresponding C variable
+ * initializations.
* For more details, see mf_c_arglist below.
*/
m4_define([<__mf_c_arginit_list>],m4_dnl
@@ -163,8 +196,10 @@ __mf_c_arginit_list($1, m4_shift(m4_shift($@)))>],
[<mf_c_arginit($2, m4_eval($1));
__mf_c_arginit_list(m4_incr($1), m4_shift(m4_shift($@)))>])>])
-/* __mf_c_arglist(NARG, LIST) -- translate Mailfromd declaration list
- * into a set of corresponding C variable declarations and initializations.
+/* __mf_c_arglist(NARG, LIST)
+ * --------------------------
+ * Translate MFL declaration list to a set of corresponding C variable
+ * declarations and initializations.
* Arguments:
* NARG -- ordinal number of the first variable in LIST
* LIST -- comma-separated list of Mailfromd declarations
@@ -172,8 +207,10 @@ __mf_c_arginit_list($1, m4_shift(m4_shift($@)))>],
m4_define([<__mf_c_arglist>],[<__mf_c_argdcl_list($@)
__mf_c_arginit_list($@)>])
-/* mf_c_arglist(LIST) -- translate Mailfromd declaration list
- * into a set of corresponding C variable declarations with initializations.
+/* mf_c_arglist(LIST)
+ * ------------------
+ * Translate MFL declaration list to a set of corresponding C variable
+ * declarations with initializations.
* Insert an instruction to adjust the stack parameters after obtaining the
* variables.
* E.g.:
@@ -205,96 +242,118 @@ m4_ifelse(__ARG1__,0,,[<get_numeric_arg(env, 0, &__bi_argcnt);>])
m4_popdef([<__ARG1__>])m4_dnl
>])
-/* __mf_printf_type(TYPE) -- translate the Mailfromd data type TYPE into the
- * printf metacharacter useful to output it.
+/* __mf_printf_type(TYPE)
+ * ----------------------
+ * Translate the MFL data type TYPE to the printf conversion specification
+ * suitable for outputting it.
*/
m4_define([<__mf_printf_type>],m4_dnl
[<m4_ifelse($1,STRING,s,$1,NUMBER,lu,$1,POINTER,p,%?)>])
-/* mf_printf_macro(TYPE NAME) -- translate TYPE to the printf metacharacter
- * for use in *printf functions.
+/* mf_printf_macro(TYPE NAME)
+ * --------------------------
+ * Translate TYPE to the printf conversion
*/
m4_define([<mf_printf_macro>],m4_dnl
[<%[<>]m4_regexp([<$1>],[<\(\w+\)\W+.*>],[<__mf_printf_type(\1)>])>])
-/* mf_printf_list(LIST) -- convert the list of Mailfromd variable declarations
- * to a space-separated list of printf macros to print them:
- * mf_printf_list(STRING a, NUMBER b) => %s %lu
- */
+/* mf_printf_list(LIST)
+ * --------------------
+ * Convert the list of MFL variable declarations to a space-delimited
+ * list of printf conversion specifications:
+ * mf_printf_list(STRING a, NUMBER b) => %s %lu
+ * Notice, that the expansion begins with the space character.
+ */
m4_define([<mf_printf_list>],m4_dnl
[<m4_ifelse($1,,,$1,[<OPTIONAL>],m4_dnl
[<mf_printf_list(m4_shift($@))>],m4_dnl
[< mf_printf_macro($1)[<>]mf_printf_list(m4_shift($@))>])>])
-/* __mf_argname(TYPE NAME) -- return NAME
- */
+/* __mf_argname(TYPE NAME)
+ * -----------------------
+ * Expand to NAME
+ */
m4_define([<__mf_argname>],m4_dnl
[<m4_regexp($1,[<\w+\W+\(\w+\)>],\1)>])
-/* mf_argnames(LIST) -- extract names from the Mailfromd declaration list:
+/* mf_argnames(LIST)
+ * -----------------
+ * Extract names from the Mailfromd declaration list:
* mf_argnames(STRING a, NUMBER b) => a, b
- */
+ */
m4_define([<mf_argnames>],m4_dnl
[<m4_ifelse($#,1, [<__mf_argname($1)>],m4_dnl
$1,[<OPTIONAL>],[<mf_argnames(m4_shift($@))>],m4_dnl
[<__mf_argname($1), mf_argnames(m4_shift($@))>])>])
-/* __mf_defined_argname(TYPE NAME) -- Same as __mf_argname, but wrap the
- * argument into MF_OPTVAL if necessary
- */
+/* __mf_defined_argname(OPT, TYPE NAME)
+ * ------------------------------------
+ * Same as __mf_argname, but wrap the argument into MF_OPTVAL if OPT is 1.
+ */
m4_define([<__mf_defined_argname>],m4_dnl
[<m4_ifelse($1,1,[<m4_dnl
MF_OPTVAL(__mf_argname($2),m4_ifelse(mf_argtype($2),[<dtype_string>],"",0))>],m4_dnl
[<__mf_argname($2)>])>])
-/* __mf_defined_argnames(LIST) -- Same as __mf_argnames, but arguments after
- * the OPTIONAL keywords are protected by MF_OPTVAL
- */
+/* __mf_defined_argnames(OPT, LIST)
+ * --------------------------------
+ * Same as mf_argnames, if OPT is 0.
+ * Otherwise, if OPT is 1, expands to list of MF_OPTVAL constructs with
+ * consecutive parameter names as arguments.
+ * After encountering the OPTIONAL keyword, changes OPT to 1.
+ */
m4_define([<__mf_defined_argnames>],m4_dnl
[<m4_ifelse($#,2, [<__mf_defined_argname($1,$2)>],m4_dnl
$2,[<OPTIONAL>],[<__mf_defined_argnames(1,m4_shift(m4_shift($@)))>],m4_dnl
[<__mf_defined_argname($1,$2), m4_dnl
__mf_defined_argnames($1,m4_shift(m4_shift($@)))>])>])
-/* mf_defined_argnames(LIST) -- Same as mf_argnames, but arguments after
- * the OPTIONAL keywords are protected by MF_OPTVAL
- */
+/* mf_defined_argnames(LIST)
+ * -------------------------
+ * Same as mf_argnames, but arguments after the OPTIONAL keywords are
+ * protected by MF_OPTVAL
+ */
m4_define([<mf_defined_argnames>],m4_dnl
[<__mf_defined_argnames(0,$@)>])
-/* __mf_argpos(POS,NEEDLE,STACK...) - Return position at which NEEDLE occurs in
- * STACK
+/* __mf_argpos(POS,NEEDLE,STACK...)
+ * --------------------------------
+ * Expands to position at which NEEDLE occurs in STACK
* Arguments:
* POS - Current position
* NEEDLE - String to find
* STACK - Argument list
* Example:
* __mf_argpos(0, x, a, b, x) => 2
- */
+ */
m4_define([<__mf_argpos>],m4_dnl
[<m4_ifelse($2,$3,$1,$3,,[<m4_errprint(m4___file__:m4___line__: No such variable >]$2[<
)>],[<__mf_argpos(m4_incr($1), $2, m4_shift(m4_shift(m4_shift($@))))>])>])
-/* mf_argpos(ARG, TYPE1 ARG1, TYPE2 ARG2 ...) - Return (zero-based) position
- * of ARG in the argument list:
+/* mf_argpos(ARG, TYPE1 ARG1, TYPE2 ARG2 ...)
+ * ------------------------------------------
+ * Expand to the (zero-based) position of ARG in the argument list:
*
* mf_argpos(x, STRING a, NUMBER b, OPTIONAL, STRING x) => 3
*/
m4_define([<mf_argpos>],m4_dnl
[<__mf_argpos(0, $1, mf_argnames(m4_shift($@)))>])
-/* __mf_defined(NAME, ARGS...) -- Scan ARGS... for the definition
- * of the built-in function parameter NAME, and return a C conditional
- * expression that yields true if it is defined.
+/* __mf_defined(NAME, ARGS...)
+ * ---------------------------
+ * Scan ARGS... for the definition of the built-in function parameter NAME,
+ * and expand to a C conditional expression that yields true if it is defined.
* ARGS are parameter declarations in the form:
* TYPE NAME
- */
+ */
m4_define([<__mf_defined>],
[<m4_ifelse(__mf_has_optarg($@),0,1,m4_dnl
[<__bi_argcnt > mf_argpos($1,__MF_ARGLIST__)>])>])
-/* MF_DEFINED(NAME) -- Return a C conditional expression
- * that yields true if the parameter NAME is defined.
+/* MF_DEFINED(NAME)
+ * ----------------
+ * Expand to a C conditional expression that yields true if the parameter
+ * NAME is defined.
*
* __MF_ARGLIST__ => STRING a, NUMBER b, OPTIONAL, STRING x
* MF_DEFINED(x) => (__bi_argcnt > 2)
@@ -307,18 +366,22 @@ m4_define([<MF_DEFINED>],
[<m4_errprint(m4___file__:m4___line__: [<MF_DEFINED used out of functional context
>])>])>])
-/* MF_OPTVAL(NAME[, DEFVAL]) -- If the parameter NAME is defined, return
- * its value, otherwise return DEFVAL or 0
- */
+/* MF_OPTVAL(NAME[, DEFVAL])
+ * -------------------------
+ * If the parameter NAME is defined, expand to its value, otherwise expand
+ * to DEFVAL or 0
+ */
m4_define([<MF_OPTVAL>],
[<m4_ifdef([<__MF_ARGLIST__>],m4_dnl
[<(MF_DEFINED($1) ? $1 : m4_ifelse([<$2>],,0,$2))>],m4_dnl
[<m4_errprint(m4___file__:m4___line__: [<MF_OPTVAL used out of functional context
>])>])>])
-/* __mf_check_end() -- signal error if the previous MF_DEFUN statement was
- * not properly closed with END
- */
+/* __mf_check_end()
+ * ----------------
+ * Signal error if the previous MF_DEFUN statement was not properly closed
+ * with END
+ */
m4_define([<__mf_check_end>],m4_dnl
[<m4_ifdef([<__MF_FUNCTION__>],m4_dnl
[<m4_errprint(m4___file__:m4___line__: Function '>]__MF_FUNCTION__[<' was not closed
@@ -326,9 +389,11 @@ m4_define([<__mf_check_end>],m4_dnl
m4_popdef([<__MF_FUNCTION__>])
m4_define([<__mf_error_code>],1)>])>])
-/* MF_STATE(state) - Declare next MF_DEFUN as valid only in the given state.
+/* MF_STATE(state)
+ * ---------------
+ * Declare next MF_DEFUN as valid only in the given state.
* The state argument is any valid milter state, as declared in
- * enum smtp_state (see mailfromd.h around line 74--87), but withouth the
+ * enum smtp_state (see mailfromd.h around line 74--87), but without the
* `smtp_state_' prefix.
*
* Multiple occurrences of MF_STATE accumulate.
@@ -338,17 +403,21 @@ m4_define([<MF_STATE>],
[<m4_define([<__MF_STATE__>],__MF_STATE__[< | STATMASK(smtp_state_$1)>])>],m4_dnl
[<m4_define([<__MF_STATE__>],[<STATMASK(smtp_state_$1)>])>])>])
-/* MF_CAPTURE([str]) - Declare next MF_DEFUN as requiring message capturing.
- The form with the STR argument can be used only in MF_STATE(eom)
- functions (FIXME: this should be enforced at compile time). In that
- case a reference to the capture stream is stored in STR.
+/* MF_CAPTURE([str])
+ * -----------------
+ * Declare next MF_DEFUN as requiring message capturing.
+ * The form with the STR argument can be used only in MF_STATE(eom)
+ * functions (FIXME: this should be enforced at compile time). In that
+ * case a reference to the capture stream is stored in STR.
*/
m4_define([<MF_CAPTURE>],m4_dnl
[<m4_define([<__MF_NEEDS_CAPTURE__>],1)m4_dnl
m4_ifelse([<$1>],,,[<m4_define([<__MF_CAPTURE__>],[<$1>])>])>])
-/* env_get_stream - prohibit the use of the library function of the same name.
- */
+/* env_get_stream()
+ * ----------------
+ * Prohibit the use of the library function of the same name.
+ */
m4_define([<env_get_stream>],m4_dnl
[<m4_ifdef([<__MF_FUNCTION__>],m4_dnl
[<m4_ifdef([<__MF_ENV_GET_STREAM_PROHIBIT>],m4_dnl
@@ -357,12 +426,16 @@ m4_define([<env_get_stream>],m4_dnl
m4_define([<__mf_error_code>],1)>],[<[<env_get_stream>]($@)>])>],m4_dnl
[<env_get_stream>])>])
-/* mf_optcount(ARGS...) -- Return the number of optional arguments in ARGS
- */
+/* mf_optcount(ARGS...)
+ * --------------------
+ * Return the number of optional arguments in ARGS
+ */
m4_define([<mf_optcount>],[<m4_dnl
m4_ifelse($#,1,0,$1,[<OPTIONAL>],m4_eval($# - 1),[<mf_optcount(m4_shift($@))>])>])
-/* __mf_argcount(COUNT, ARGS...) -- Auxiliary function for mf_argcount
+/* __mf_argcount(COUNT, ARGS...)
+ * -----------------------------
+ * Auxiliary function for mf_argcount
* COUNT is number of arguments counted so far
* ARGS are the rest of the arguments
*/
@@ -370,21 +443,38 @@ m4_define([<__mf_argcount>],[<m4_dnl
m4_ifelse($#,2,$1,$2,[<OPTIONAL>],[<__mf_argcount($1, m4_shift(m4_shift($@)))>],m4_dnl
[<__mf_argcount(m4_incr($1), m4_shift(m4_shift($@)))>])>])
-/* mf_argcount(ARGS...) -- Return the number of arguments in ARGS, not
- * counting eventual OPTIONAL modifier.
- */
+/* mf_argcount(ARGS...)
+ * --------------------
+ * Return the number of arguments in ARGS, not counting eventual OPTIONAL
+ * modifier.
+ * FIXME: same as m4_eval($# - __mf_has_optarg($@))
+ */
m4_define([<mf_argcount>],[<m4_dnl
m4_ifelse($1,,0,__mf_argcount(1,$@))>])
-/* mf_prog_trace(fname[, args...])
- */
+/* mf_prog_trace(FNAME[, ARGS...])
+ * -------------------------------
+ * Expand to the prog_trace call for function FNAME with arguments ARGS.
+ */
m4_define([<mf_prog_trace>],[<m4_dnl
prog_trace(env, "$1[<>]mf_printf_list(m4_shift($@))"m4_dnl
m4_ifelse($2,,,[<,mf_defined_argnames(m4_shift($@))>]));>])
-/* __mf_defun(VARARG, NAME, RETTYPE, ARGS...) -- Begin a built-in function
- declaration
- */
+/* __mf_defun(VARARG, NAME, RETTYPE, ARGS...)
+ * ------------------------------------------
+ * Begin a built-in function declaration.
+ * Arguments:
+ * VARARG
+ * Initial value for the FLAGS argument to the va_builtin_install_ex
+ * function. Actually, MFD_BUILTIN_VARIADIC if NAME is a variadic
+ * function, and 0 otherwise.
+ * NAME
+ * Name of the function.
+ * RETTYPE
+ * Return type (STRING or NUMBER).
+ * ARGS
+ * List of arguments with types.
+ */
m4_define([<__mf_defun>],m4_dnl
[<__mf_check_end[<>]m4_dnl
void
@@ -417,6 +507,17 @@ m4_define([<__MF_ENV_GET_STREAM_PROHIBIT>])m4_dnl
mf_prog_trace($2,m4_shift(m4_shift(m4_shift($@))));
>])
+/* MF_DEFUN(NAME, RETTYPE, ARGS...)
+ * --------------------------------
+ * Start a declaration of the built-in function NAME. The declaration
+ * must be terminated with END.
+ * Arguments:
+ * NAME - function name
+ * RETTYPE - return type
+ * ARGS - list of argument declarations, each one of the form
+ * TYPE ARGNAME; special argument OPTIONAL begins the list of
+ * optional parameters.
+ */
m4_define([<MF_DEFUN>],[<m4_pushdef([<__MF_VARARGS__>], 0)m4_dnl
__mf_defun(0, $@)>])
@@ -428,21 +529,40 @@ m4_ifelse(__mf_has_optarg(m4_shift(m4_shift(m4_shift(m4_shift($@))))),0,m4_dnl
)
m4_define([<__mf_error_code>],1)>])>])
+/* MF_DEFUN_VARARGS(NAME, RETTYPE. [TYPE PARAM...])
+ * ------------------------------------------------
+ * Start the declaration of the built-in variadic function NAME.
+ * The declarationl must be terminated with END.
+ * Arguments:
+ * NAME - function name
+ * RETTYPE - return type
+ * TYPE PARAM - declarations of mandatory parameters.
+ * Actual parameters can be retrieved using MF_VA_ARG(), which see,
+ * See also MF_VA_START and MF_VA_END
+ */
m4_define([<MF_DEFUN_VARARGS>],[<__mf_defun_varargs(MFD_BUILTIN_VARIADIC,$@)>])
+/* MF_DEFUN_VARARGS_NO_PROM(NAME, RETTYPE, [TYPE PARAM...])
+ * --------------------------------------------------------
+ * Same as MF_DEFUN_VARARGS, but actual parameters are not promoted to
+ * STRING.
+ */
m4_define([<MF_DEFUN_VARARGS_NO_PROM>],[<m4_dnl
__mf_defun_varargs(MFD_BUILTIN_VARIADIC|MFD_BUILTIN_NO_PROMOTE,$@)>])
-/* Prevent the use of the return statement in defuns.
- */
+/* Prevent the use of the `return' statement in defuns.
+ */
m4_define([<return>],[<m4_dnl
m4_ifdef([<__MF_FUNCTION__>],[<m4_dnl
m4_errprint(m4___file__:m4___line__: [<return used in MF_DEFUN>]
)
m4_define([<__mf_error_code>],1)>],[<[<return>]>])>])
-/* MF_RETURN(value[,type]) - Return a value
- */
+/* MF_RETURN(VALUE[,TYPE])
+ * -----------------------
+ * Expand to C code for returning VALUE from the current function. If TYPE
+ * is supplied, cast value to this type.
+ */
m4_define([<MF_RETURN>],[<
m4_ifdef([<__MF_VA_START_USED__>],[<m4_dnl
m4_errprint(m4___file__:m4___line__: [<MF_RETURN>] used before [<MF_VA_END>]
@@ -462,28 +582,36 @@ m4_popdef([<__type>])m4_dnl
m4_define([<__MF_ENDLAB__>])m4_dnl
} while (0)>])>])
-/* MF_ALLOC_HEAP(off, len) - Allocate LEN bytes from the heap
- */
+/* MF_ALLOC_HEAP(OFF, LEN)
+ * -----------------------
+ * Allocate LEN bytes from the heap. Return the offset of the allocated
+ * space in OFF.
+ */
m4_define([<MF_ALLOC_HEAP>],[<m4_dnl
__MF_DSEXP_REQ()m4_dnl
(char*) env_data_ref(env, ([<$1>] = heap_reserve(env, $2)))>])
-/* MF_ALLOC_HEAP_TEMP(len) - Temporarly allocate LEN bytes from the heap.
- */
+/* MF_ALLOC_HEAP_TEMP(LEN)
+ * -----------------------
+ * Temporarly allocate LEN bytes from the heap.
+ */
m4_define([<MF_ALLOC_HEAP_TEMP>],[<__MF_DSEXP_REQ()m4_dnl
mf_c_val(heap_tempspace(env, $1), ptr)>])
-/* MF_COPY_STRING(off, string) - Copy STRING to the heap. Return the
- * pointer to the copy.
- */
+/* MF_COPY_STRING(off, string)
+ * ---------------------------
+ * Copy STRING to the heap. Return the pointer to the copy.
+ */
m4_define([<MF_COPY_STRING>],[<m4_dnl
__MF_DSEXP_REQ()m4_dnl
strcpy((char*)env_data_ref(env, $1 = heap_reserve(env, strlen($2) + 1)), $2)>])
-/* MF_OBSTACK_BEGIN() - Begin temporary space manipulations
+/* MF_OBSTACK_BEGIN()
+ * ------------------
+ * Begin temporary space manipulations.
* NOTE: No other heap manipulation function can be used between
* MF_OBSTACK_BEGIN and MF_OBSTACK_CANCEL/MF_RETURN_OBSTACK/MF_OBSTACK_FINISH
- */
+ */
m4_define([<MF_OBSTACK_BEGIN>],[<heap_obstack_begin(env)>])
m4_define([<MF_OBSTACK_GROW>],[<m4_dnl
@@ -496,27 +624,35 @@ do {
m4_define([<MF_OBSTACK_1GROW>],[<m4_dnl
do { char __c = $1; heap_obstack_grow(env, &__c, 1); } while(0)>])
-/* MF_OBSTACK_CANCEL - Cancel temporary heap allocation initiated by
- * MF_OBSTACK_BEGIN
- */
+/* MF_OBSTACK_CANCEL()
+ * -------------------
+ * Cancel temporary heap allocation initiated by MF_OBSTACK_BEGIN
+ */
m4_define([<MF_OBSTACK_CANCEL>],[<heap_obstack_cancel(env)>])
-/* MF_OBSTACK_BASE - Return a C pointer to the beginning of the currently
+/* MF_OBSTACK_BASE()
+ * -----------------
+ * Return a C pointer to the beginning of the currently
* allocated obstack space.
- */
+ */
m4_define([<MF_OBSTACK_BASE>],[<heap_obstack_base(env)>])
-/* MF_RETURN_OBSTACK() - Relocate and return temporary space
- */
+/* MF_RETURN_OBSTACK()
+ * -------------------
+ * Relocate and return temporary space
+ */
m4_define([<MF_RETURN_OBSTACK>],[<MF_RETURN(heap_obstack_finish(env),[<STKVAL>])>])
-/* MF_OBSTACK_FINISH() - Relocate temporary space and return its starting
- offset.
-*/
+/* MF_OBSTACK_FINISH()
+ * -------------------
+ * Relocate temporary space and return its starting offset.
+ */
m4_define([<MF_OBSTACK_FINISH>],[<heap_obstack_finish(env)>])
-/* MF_VA_START() -- Begin a code section for handing varying number
- of arguments. */
+/* MF_VA_START()
+ * -------------
+ * Begin a code section for handling variable number of arguments.
+ */
m4_define([<MF_VA_START>],[<
m4_ifelse(__MF_VARARGS__,1,[<m4_dnl
m4_define([<__MF_VA_START_USED__>],m4___file__:m4___line__)m4_dnl
@@ -525,7 +661,10 @@ unroll_stack(env, __bi_argcnt + 1)>],
)m4_dnl
m4_define([<__mf_error_code>],1)>])>])
-/* MF_VA_END() -- End a section, started with MF_VA_START */
+/* MF_VA_END()
+ * -----------
+ * End the section started with MF_VA_START
+ */
m4_define([<MF_VA_END>],[<m4_dnl
m4_ifdef([<__MF_VA_START_USED__>],[<m4_dnl
m4_undefine([<__MF_VA_START_USED__>])m4_dnl
@@ -534,21 +673,29 @@ adjust_stack(env, __bi_argcnt + 1)>],m4_dnl
)
m4_define([<__mf_error_code>],1)>])>])
-/* __mf_va_count() -- return number of variable arguments passed to the current
- vararg function */
+/* __mf_va_count()
+ * ---------------
+ * Return number of variable arguments passed to the current vararg function
+ */
m4_define([<__mf_va_count>],[<m4_dnl
(__bi_argcnt - mf_argcount(__MF_ARGLIST__))>])
-/* MF_VA_COUNT() -- return actual number of variable arguments passed to the
- function. Bail out if the function is not a vararg one. */
+/* MF_VA_COUNT()
+ * -------------
+ * Return actual number of variable arguments passed to the
+ * function. Bail out if the function is not a vararg one.
+ */
m4_define([<MF_VA_COUNT>],[<m4_dnl
m4_ifelse(__MF_VARARGS__,1,[<__mf_va_count>],
[<m4_errprint(m4___file__:m4___line__: [<MF_VA_COUNT>] used but `__MF_FUNCTION__' does not take variable number of arguments
)m4_dnl
m4_define([<__mf_error_code>],1)>])>])
-/* MF_VA_ARG(N, TYPE, VAR) -- Produce a code for assigning to VAR the Nth
- argument of the given TYPE in a vararg section. */
+/* MF_VA_ARG(N, TYPE, VAR)
+ * -----------------------
+ * Produce a code for assigning to VAR the Nth
+ * argument of the given TYPE in a vararg section.
+ */
m4_define([<MF_VA_ARG>],[<m4_dnl
m4_ifdef([<__MF_VA_START_USED__>],m4_dnl
[<m4_pushdef([<__ARGN__>],[<($1+mf_argcount(__MF_ARGLIST__))>])
@@ -561,8 +708,11 @@ m4_popdef([<__ARGN__>])>],
)
m4_define([<__mf_error_code>],1)>])>])
-/* MF_VAR(name,type[,flag]) - Declare a global variable NAME of type TYPE.
- */
+/* MF_VAR(NAME,TYPE[,FLAG])
+ * ------------------------
+ * Declare a global variable NAME of type TYPE. FLAGS are additional flags
+ * (SYM_VOLATILE is always used).
+ */
m4_define([<MF_VAR>],[<m4_dnl
static size_t $1_loc
m4_divert(1)m4_dnl
@@ -571,17 +721,22 @@ m4_divert(1)m4_dnl
m4_divert(2)m4_dnl
>])
-/* MF_VAR_REF(name, type[, value]) - Reference global variable NAME
- * In two-argument form, return its value. In three-arguments form, assign
+/* MF_VAR_REF(NAME, TYPE[, VALUE])
+ * -------------------------------
+ * Reference the global variable NAME.
+ * In two-argument form, expand to its value. In three-arguments form, assign
* the VALUE to it.
- */
+ */
m4_define([<MF_VAR_REF>],[<m4_dnl
mf_c_val(*env_data_ref(env, $1_loc),$2) m4_ifelse($3,,,= ($3))>])
m4_define([<MF_VAR_STRING>],[<m4_dnl
(char*)env_data_ref(env, MF_VAR_REF($1, size))>])
-/* MF_VAR_SET_STRING(name, value) - Set variable NAME to the string VALUE */
+/* MF_VAR_SET_STRING(NAME, VALUE)
+ * ------------------------------
+ * Set variable NAME to the string VALUE
+ */
m4_define([<MF_VAR_SET_STRING>],[<
{ size_t __off;
const char *__s = $2;
@@ -592,18 +747,23 @@ m4_define([<MF_VAR_SET_STRING>],[<
MF_VAR_REF($1, size, __off); }
>])
-/* MF_VAR_INC(name) - Increment the value of the global variable NAME
- */
+/* MF_VAR_INC(NAME)
+ * ----------------
+ * Increment the value of the global variable NAME
+ */
m4_define([<MF_VAR_INC>],[<m4_dnl
env_var_inc(env, $1_loc)>])
-/* MF_DECLARE_DATA(name, init [, destr, freecap]) - Declare private data for
- * the current module.
+/* MF_DECLARE_DATA(NAME, INIT [, DESTR, FREECAP])
+ * ----------------------------------------------
+ * Declare private data for the current module.
+ * The data can be accessed using MF_GET_DATA (see below).
+ * Arguments:
* NAME - data identifier.
* INIT - initialization function (void init(void))
* DESTR - destructor function (void destr(void*))
* FREECAP - free capture function (void freecap(void*))
- */
+ */
m4_define([<MF_DECLARE_DATA>],[<
m4_define([<__MF_PRIV_ID__>],$1_id)
static int __MF_PRIV_ID__;
@@ -614,9 +774,10 @@ m4_ifelse($4,,NULL,$4));
m4_divert(2)m4_dnl
>])
-/* MF_GET_DATA - Return pointer to the private data, declared with
- * MF_DECLARE_DATA
- */
+/* MF_GET_DATA
+ * -----------
+ * Return pointer to the private data, declared with MF_DECLARE_DATA
+ */
m4_define([<MF_GET_DATA>],[<m4_dnl
m4_ifdef([<__MF_PRIV_ID__>],[<m4_dnl
env_get_builtin_priv(m4_ifelse($1,,env,$1),__MF_PRIV_ID__)>],m4_dnl
@@ -625,12 +786,18 @@ env_get_builtin_priv(m4_ifelse($1,,env,$1),__MF_PRIV_ID__)>],m4_dnl
m4_define([<__mf_error_code>],1)
>])>])
-/* MF_VASTRING(off)
- */
+/* MF_VASTRING(OFF)
+ * ----------------
+ * Extract string from VAPTR array at offset OFF.
+ */
m4_define([<MF_VASTRING>],[<env_vaptr(env, $1)>])
-/* MF_THROW(exception, ...)
- */
+/* MF_THROW(EXCODE, ...)
+ * ------------------------
+ * Throw exception. First argument (EXCODE) is the exception code.
+ * Rest of arguments supply additional parameters for the env_throw_bi
+ * call.
+ */
m4_define([<MF_THROW>],[<m4_dnl
(
m4_ifdef([<__MF_CAPTURE__>],[<
@@ -640,19 +807,26 @@ m4_ifdef([<__MF_CAPTURE__>],[<
"__MF_FUNCTION__", NULL), m4_shift($@))
)>])
+/* MF_STREAM_TO_MESSAGE(STR)
+ * -------------------------
+ * Convert mailutils stream STR to a message.
+ */
m4_define([<MF_STREAM_TO_MESSAGE>],[<m4_dnl
_builtin_mu_stream_to_message($1, env, m4_ifdef([<__MF_FUNCTION__>],m4_dnl
"__MF_FUNCTION__", NULL))>])
-/* MF_ASSERT(cond, exception, ...)
- */
+/* MF_ASSERT(COND, EXCEPTION, ...)
+ * -------------------------------
+ * Throw EXCEPTION unless condition COND is true. Additional arguments
+ * are passed to MF_THROW.
+ */
m4_define([<MF_ASSERT>],[<m4_dnl
if (!($1))
MF_THROW(m4_shift($@))
>])
/* END -- Finish the built-in function declaration, created with MF_DEFUN
- */
+ */
m4_define([<END>],m4_dnl
[<m4_ifdef([<__MF_ENDLAB__>],[<endlab:>])
m4_ifdef([<__MF_CAPTURE__>],[<
@@ -679,23 +853,52 @@ m4_define([<__mf_dataseg>])m4_dnl
return;
}>])
-/* MF_DCL_CLEANUP(ptr[, func]) */
+/* MF_DCL_CLEANUP(PTR[, FUNC])
+ * ---------------------------
+ * Register clean-up function FUNC for data pointer PTR. FUNC(PTR) will
+ * be called if an exception is thrown or MF_CLEANUP(PTR) is explicitly
+ * used. If neither of these occurs, it will be called upon destroying
+ * the evaluation environment.
+ * Registration can be undone using MF_CLR_CLEANUP.
+ */
m4_define([<MF_DCL_CLEANUP>],[<env_function_cleanup_add(env, $1, m4_dnl
m4_ifelse($2,,NULL,$2))>])
-/* MF_CLR_CLEANUP(ptr) */
+/* MF_CLR_CLEANUP(PTR)
+ * -------------------
+ * Undo registration of the clean-up routine for PTR.
+ */
m4_define([<MF_CLR_CLEANUP>],[<env_function_cleanup_del(env, $1)>])
-/* MF_CLEANUP(ptr) */
+/* MF_CLEANUP(PTR)
+ * ---------------
+ * Invoke a previously registered clean-up routine for pointer PTR.
+ */
m4_define([<MF_CLEANUP>],[<env_function_cleanup_flush(env, $1)>])
m4_define([<MF_TRANS_PREFIX>],[<_MFL_>])
-/* MF_TRANS(NAME) - expands to a struct builtin_const_trans for
- translating constant NAME between MFL and C */
+/* MF_TRANS(NAME)
+ * --------------
+ * Expands to a struct builtin_const_trans for translating constant NAME
+ * between MFL and C.
+ * See syslog.bi for an example of its use.
+ */
m4_define([<MF_TRANS>],[<{ MF_TRANS_PREFIX[<>]$1, $1 }>])
-/* MF_PRAGMA(name,min,max)
- */
+/* MF_PRAGMA(NAME, MIN, MAX)
+ * -------------------------
+ * Register a pragma NAME.
+ * Arguments:
+ * NAME - name of the new pragma
+ * MIN - minimum number of arguments (including pragma name)
+ * MAX - maximum number of arguments (or 0, if unlimited).
+ *
+ * The macro must be followed by a C block with the code for handling
+ * the pragma. The code can access the following three parameters:
+ * int argc - number of actual arguments in argv array;
+ * char **argv - NULL terminated array of actual arguments;
+ * text - actual pragma text, with built-in constants expanded;
+ */
m4_define([<MF_PRAGMA>],m4_dnl
[<m4_divert(1)m4_dnl
m4_pushdef([<pragma_handler>],[<_pragma_>]m4_translit($1,-,_))
@@ -705,11 +908,20 @@ m4_divert(2)
m4_popdef([<pragma_handler>])m4_dnl
>])
+/* MF_COND(SYM)
+ * ------------
+ * Protect the code below by the `#ifdef SYM' / `#endif'
+ */
m4_define([<MF_COND>],[<m4_dnl
m4_pushdef([<__MF_COND_SYMBOL>],$1)m4_dnl
#ifdef __MF_COND_SYMBOL
>])
+/* MF_DEBUG(LEV, (ARGS...))
+ * ------------------------
+ * Expand to a mu_debug call with the debug handle for this built-in
+ * module and LEV, (ARGS...) as arguments.
+ */
m4_define([<MF_DEBUG>],[<
m4_ifdef([<__MF_DEBUG>],,[<m4_dnl
m4_define([<__MF_DEBUG>],1)m4_dnl
@@ -718,14 +930,24 @@ static mu_debug_handle_t debug_handle;
m4_divert(2)>])
[<mu_debug>](debug_handle, $@)>])>])
-/* MF_INIT(CODE) -- create the initialization function for the curent module.
- * The function will be named MODNAME_init_builtin.
- */
+m4_pushdef([<__MF_INIT_SEQUENCE>])
+
+/* MF_INIT(CODE)
+ * -------------
+ * Insert CODE into the initialization function for the
+ * curent module (MODNAME_init_builtin).
+ */
m4_define([<MF_INIT>],m4_dnl
-[<__mf_check_end[<>]m4_dnl
+ [<m4_pushdef([<__MF_INIT_SEQUENCE>],[<$1>])>])
+
+/* Expand to the generated text upon the end of input.
+ */
+m4_m4wrap([<
+m4_ifelse(MF_MODULE_NAME,,[<m4_errprint([<MF_BUILTIN_MODULE is missing
+>])
+m4_m4exit(1)>])
m4_undefine([<__MF_PRIV_ID__>])m4_dnl
-m4_define([<__MF_INIT__>],1)m4_dnl
-m4_ifdef([<__MF_COND_SYMBOL>],[<#endif /* __MF_COND_SYMBOL */
+m4_ifdef([<__MF_COND_SYMBOL>],[<#endif /[<>]* __MF_COND_SYMBOL */
>])
void
MF_MODULE_NAME()_init_builtin()
@@ -737,8 +959,9 @@ m4_ifdef([<__MF_COND_SYMBOL>],[<#ifdef __MF_COND_SYMBOL
pp_define("__MF_COND_SYMBOL");
>])m4_dnl
m4_undivert(1)
- $1
-m4_ifdef([<__MF_COND_SYMBOL>],[<#endif /* __MF_COND_SYMBOL */
+ __MF_INIT_SEQUENCE
+m4_popdef([<__MF_INIT_SEQUENCE>])m4_dnl
+m4_ifdef([<__MF_COND_SYMBOL>],[<#endif /[<>]* __MF_COND_SYMBOL */
m4_popdef([<__MF_COND_SYMBOL>])>])m4_dnl
}
m4_divert(0)m4_dnl
@@ -756,13 +979,8 @@ m4_divert(0)m4_dnl
m4_undivert(3)
m4_undivert(2)
+m4_popdef([<MF_MODULE_NAME>])m4_dnl
>])
-m4_m4wrap([<__mf_check_end
-m4_ifdef([<__MF_INIT__>],,[<m4_errprint([<MF_INIT>] not defined
-)
-m4_define([<__mf_error_code>],1)>])
-m4_ifdef([<__mf_error_code>],[<m4_m4exit(__mf_error_code)>])>])
-
m4_divert(2)
-m4_dnl End of snarf.m4
+/* End of snarf.m4 */
diff --git a/src/builtin/spf.bi b/src/builtin/spf.bi
index ea57f2f..698469c 100644
--- a/src/builtin/spf.bi
+++ b/src/builtin/spf.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include "spf.h"
MF_VAR(spf_explanation, STRING);
@@ -83,4 +85,3 @@ MF_DEFUN(spf_test_record, NUMBER, STRING record,
}
END
-MF_INIT
diff --git a/src/builtin/sprintf.bi b/src/builtin/sprintf.bi
index f08cf4d..6e2cdd8 100644
--- a/src/builtin/sprintf.bi
+++ b/src/builtin/sprintf.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#define FMT_ALTPOS 0x01
#define FMT_ALTERNATE 0x02
#define FMT_PADZERO 0x04
@@ -417,4 +419,3 @@ MF_DEFUN_VARARGS_NO_PROM(sprintf, STRING, STRING format)
}
END
-MF_INIT
diff --git a/src/builtin/string.bi b/src/builtin/string.bi
index ffb4a1c..4422b3a 100644
--- a/src/builtin/string.bi
+++ b/src/builtin/string.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
MF_DEFUN(toupper, STRING, STRING string)
{
size_t off;
@@ -283,4 +285,3 @@ MF_DEFUN(rtrim, STRING, STRING input, OPTIONAL, STRING cset)
}
END
-MF_INIT
diff --git a/src/builtin/syslog.bi b/src/builtin/syslog.bi
index 3abfcb0..65c7888 100644
--- a/src/builtin/syslog.bi
+++ b/src/builtin/syslog.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include "syslog.h"
#include "mflib/syslog.h"
@@ -67,4 +69,3 @@ MF_DEFUN(syslog, VOID, NUMBER priority, STRING text)
}
END
-MF_INIT
diff --git a/src/builtin/system.bi b/src/builtin/system.bi
index 796e124..64abca4 100644
--- a/src/builtin/system.bi
+++ b/src/builtin/system.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include <sys/utsname.h>
#include <mflib/status.h>
@@ -158,4 +160,3 @@ MF_DEFUN(unlink, VOID, STRING name)
}
END
-MF_INIT
diff --git a/src/builtin/vars.bi b/src/builtin/vars.bi
index 7e58391..975bed7 100644
--- a/src/builtin/vars.bi
+++ b/src/builtin/vars.bi
@@ -14,6 +14,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+MF_BUILTIN_MODULE
+
#include "filenames.h" /* For DEFAULT_FROM_ADDRESS */
MF_VAR(rcpt_count, NUMBER);
MF_VAR(milter_client_family, NUMBER, SYM_PRECIOUS);
@@ -113,4 +115,3 @@ set_milter_server_id(eval_environ_t env, const char *id)
}
>])
-MF_INIT

Return to:

Send suggestions and report system problems to the System administrator.