aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-02-21 08:04:49 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-02-21 08:04:49 +0000
commit0239c8432dd7634b3e777535b7374a1d32012e18 (patch)
tree0045b4bdc00d5a1dd6aba8c598a27349f311988f /src
parentdc8d254a9bb7b101f6c68fa173e2c5c81ea06b06 (diff)
downloadmailfromd-0239c8432dd7634b3e777535b7374a1d32012e18.tar.gz
mailfromd-0239c8432dd7634b3e777535b7374a1d32012e18.tar.bz2
* src/lex.l: New built-in macro __statedir__
* NEWS: Update * src/mailfrom.h: Finally renamed to * src/mailfromd.h: this Affected files: * src/symtab.c, src/mu_dbm.c, src/engine.c, src/snarf.m4, src/dnscache.c, src/gram.y, src/dnsbase.c, src/dns.c, src/db.c, src/spf.c, src/spf.h, src/cache.c, src/optab.opc, src/prog.c, src/mf-status.mfi, src/main.c, src/Makefile.am, src/rate.c git-svn-id: file:///svnroot/mailfromd/trunk@1263 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am6
-rw-r--r--src/cache.c2
-rw-r--r--src/db.c2
-rw-r--r--src/dns.c2
-rw-r--r--src/dnsbase.c2
-rw-r--r--src/dnscache.c2
-rw-r--r--src/engine.c2
-rw-r--r--src/gram.y2
-rw-r--r--src/lex.l15
-rw-r--r--src/mailfromd.h (renamed from src/mailfrom.h)0
-rw-r--r--src/main.c2
-rw-r--r--src/mf-status.mfi2
-rw-r--r--src/mu_dbm.c5
-rw-r--r--src/optab.opc2
-rw-r--r--src/prog.c2
-rw-r--r--src/rate.c2
-rw-r--r--src/snarf.m44
-rw-r--r--src/spf.c2
-rw-r--r--src/spf.h2
-rw-r--r--src/symtab.c2
20 files changed, 32 insertions, 28 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 7bd5c5c6..88f9a463 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,7 +54,7 @@ mailfromd_SOURCES = \
rate.c\
$(M4_FILES:.m4=.c)
-noinst_HEADERS = mailfrom.h mu_dbm.h builtin.h dns.h
+noinst_HEADERS = mailfromd.h mu_dbm.h builtin.h dns.h
EXTRA_DIST = gram.h snarf.m4 init.m4 $(M4_FILES) builtin.h builtin.def mf-status.mfi status.mfi mfstat.awk status.mfh optab.opc optab.oph opcode.awk opcodes
BUILT_SOURCES=$(M4_FILES:.m4=.c) builtin.h mf-status.c optab.c optab.h
@@ -74,11 +74,11 @@ SUFFIXES = .m4 .c .def .h .mfi .mfh .opc .oph
.mfi.c:
$(AWK) -f $(top_srcdir)/src/mfstat.awk \
- $(top_srcdir)/src/mailfrom.h $< > $@
+ $(top_srcdir)/src/mailfromd.h $< > $@
.mfi.mfh:
$(AWK) -f $(top_srcdir)/src/mfstat.awk \
- $(top_srcdir)/src/mailfrom.h $< > $@
+ $(top_srcdir)/src/mailfromd.h $< > $@
.m4.c:
diff --git a/src/cache.c b/src/cache.c
index 0e26070d..ff6aa2b2 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -21,7 +21,7 @@
#endif
#include <mailutils/mailutils.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
struct cache_result {
time_t timestamp;
diff --git a/src/db.c b/src/db.c
index cc62eb17..efa52a16 100644
--- a/src/db.c
+++ b/src/db.c
@@ -21,7 +21,7 @@
#endif
#include <mailutils/mailutils.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
#define obstack_chunk_alloc malloc
#define obstack_chunk_free free
#include <obstack.h>
diff --git a/src/dns.c b/src/dns.c
index 7f820e91..39af6a81 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -28,7 +28,7 @@
#include <netdb.h>
#include <resolv.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
mf_status
dns_to_mf_status(dns_status stat)
diff --git a/src/dnsbase.c b/src/dnsbase.c
index bf049c78..cabc49f1 100644
--- a/src/dnsbase.c
+++ b/src/dnsbase.c
@@ -27,7 +27,7 @@
#include <arpa/nameser.h>
#include <netdb.h>
#include <resolv.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
struct mx_buffer {
unsigned pref;
diff --git a/src/dnscache.c b/src/dnscache.c
index 45575521..1395fe00 100644
--- a/src/dnscache.c
+++ b/src/dnscache.c
@@ -28,7 +28,7 @@
#include <netdb.h>
#include <resolv.h>
#include <mailutils/mailutils.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
static mf_status
parse_value(int qtype, const char *keystr,
diff --git a/src/engine.c b/src/engine.c
index 49d85080..49b9baf8 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -41,7 +41,7 @@
#include <mailutils/mailutils.h>
#include <mailutils/daemon.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
static char *ctx_getsym(void *data, char *str);
diff --git a/src/gram.y b/src/gram.y
index a1bba4f1..52f548f4 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -23,7 +23,7 @@
#include <fnmatch.h>
#include <netdb.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
#include "prog.h"
#include "optab.h"
#define obstack_chunk_alloc malloc
diff --git a/src/lex.l b/src/lex.l
index 97170501..b62b493e 100644
--- a/src/lex.l
+++ b/src/lex.l
@@ -25,7 +25,7 @@
#define obstack_chunk_alloc malloc
#define obstack_chunk_free free
#include <obstack.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
#include "gram.h"
#include "prog.h"
@@ -63,7 +63,7 @@ is_space(char c)
static void line_finish(void);
static void string(const char *str, size_t len);
static int isemptystr(char *text);
-static int locus_var(const char *s);
+static int builtin_macro(const char *s);
/* External interface to locus */
const struct locus *
@@ -378,7 +378,7 @@ WS [ \t][ \t]*
IDENT [a-zA-Z_][a-zA-Z_0-9]*
LOCUS __file__|__line__|__function__
VMACRO __package__|__version__|__major__|__minor__|__patch__
-MACRO {LOCUS}|{VMACRO}
+MACRO {LOCUS}|{VMACRO}|__statedir__
%%
/* C-style comments */
"/*" BEGIN(COMMENT);
@@ -431,14 +431,14 @@ default return keyword(DEFAULT);
string { yylval.type = dtype_string; return TYPE; }
number { yylval.type = dtype_number; return TYPE; }
const return keyword(CONST);
-{MACRO} { return locus_var(yytext); }
+{MACRO} { return builtin_macro(yytext); }
<ONBLOCK>poll return keyword(POLL);
<ONBLOCK>host return keyword(HOST);
<ONBLOCK>for return keyword(FOR);
<ONBLOCK>as return keyword(AS);
<ONBLOCK>from return keyword(FROM);
/* Variables */
-<INITIAL,ONBLOCK,ML,CML,STR>\%({MACRO}) { return locus_var(yytext+1); }
+<INITIAL,ONBLOCK,ML,CML,STR>\%({MACRO}) { return builtin_macro(yytext+1); }
<INITIAL,ONBLOCK,ML,CML,STR>\%{IDENT} {
int rc;
string(yytext + 1, yyleng - 1);
@@ -950,7 +950,7 @@ onblock(int enable)
}
static int
-locus_var(const char *s)
+builtin_macro(const char *s)
{
if (strcmp(s, "__file__") == 0) {
yylval.literal = literal_lookup(locus.file);
@@ -977,6 +977,9 @@ locus_var(const char *s)
} else if (strcmp(s, "__patch__") == 0) {
yylval.number = MAILFROMD_VERSION_PATCH;
return NUMBER;
+ } else if (strcmp(s, "__statedir__") == 0) {
+ string(DEFAULT_STATE_DIR, sizeof DEFAULT_STATE_DIR - 1);
+ return STRING;
}
abort();
}
diff --git a/src/mailfrom.h b/src/mailfromd.h
index 0f4883b2..0f4883b2 100644
--- a/src/mailfrom.h
+++ b/src/mailfromd.h
diff --git a/src/main.c b/src/main.c
index 44b488aa..ed566d9d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -37,7 +37,7 @@
#include <mailutils/mailutils.h>
#include <mailutils/argp.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
/* Configurable options */
diff --git a/src/mf-status.mfi b/src/mf-status.mfi
index e39e8d6a..6a957d35 100644
--- a/src/mf-status.mfi
+++ b/src/mf-status.mfi
@@ -21,7 +21,7 @@ TEMPLATE /* */ -*- c -*-
# include <config.h>
#endif
-#include "mailfrom.h"
+#include "mailfromd.h"
static struct status_tab {
mf_status status;
diff --git a/src/mu_dbm.c b/src/mu_dbm.c
index 3f248971..33929474 100644
--- a/src/mu_dbm.c
+++ b/src/mu_dbm.c
@@ -1,5 +1,6 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001, 2002, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2005, 2006, 2007
+ Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,7 +33,7 @@
#include <errno.h>
#include <mailutils/error.h>
#include <mailutils/errno.h>
-#include <mailfrom.h>
+#include <mailfromd.h>
int
mu_fcheck_perm (int fd, int mode)
diff --git a/src/optab.opc b/src/optab.opc
index 6a6cdb15..cbbd9d2e 100644
--- a/src/optab.opc
+++ b/src/optab.opc
@@ -20,7 +20,7 @@ TEMPLATE /* */ -*- c -*-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "mailfrom.h"
+#include "mailfromd.h"
#include "prog.h"
#include "optab.h"
diff --git a/src/prog.c b/src/prog.c
index 4ffc0cd7..749316c9 100644
--- a/src/prog.c
+++ b/src/prog.c
@@ -28,7 +28,7 @@
#include <assert.h>
#include <fnmatch.h>
#include <syslog.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
#include "prog.h"
#define DEFINE_BUILTIN_MODULE
#include "builtin.h"
diff --git a/src/rate.c b/src/rate.c
index 77e358c2..a53b765f 100644
--- a/src/rate.c
+++ b/src/rate.c
@@ -21,7 +21,7 @@
#endif
#include <mailutils/mailutils.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
struct rate_result {
time_t timestamp;
diff --git a/src/snarf.m4 b/src/snarf.m4
index 803301a0..d7a1f145 100644
--- a/src/snarf.m4
+++ b/src/snarf.m4
@@ -144,7 +144,7 @@ define([<__mf_error_code>],1)>])>])
dnl MF_STATE(state) - Declare next MF_DEFUN as valid only in the given state.
dnl The state argument is any valid milter state, as declared in
-dnl enum smtp_state (see mailfrom.h around line 74--87), but withouth the
+dnl enum smtp_state (see mailfromd.h around line 74--87), but withouth the
dnl `smtp_state_' prefix.
dnl
dnl Multiple occurrences of MF_STATE accumulate.
@@ -384,7 +384,7 @@ divert(0)dnl
# include <config.h>
#endif
#include <sys/types.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
#include "prog.h"
#include "builtin.h"
diff --git a/src/spf.c b/src/spf.c
index c102a33f..d8513b2d 100644
--- a/src/spf.c
+++ b/src/spf.c
@@ -24,7 +24,7 @@
#define obstack_chunk_alloc malloc
#define obstack_chunk_free free
#include <obstack.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
#include "spf.h"
typedef struct spf_term spf_term;
diff --git a/src/spf.h b/src/spf.h
index e4725410..ccd512fa 100644
--- a/src/spf.h
+++ b/src/spf.h
@@ -16,7 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA */
-typedef enum {
+typedef enum spf_result {
spf_none,
spf_neutral,
spf_pass,
diff --git a/src/symtab.c b/src/symtab.c
index 4d6794d1..50e7ddf9 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -20,7 +20,7 @@
# include <config.h>
#endif
#include <stdlib.h>
-#include "mailfrom.h"
+#include "mailfromd.h"
/* |hash_size| defines a sequence of symbol table sizes. These are prime
numbers, the distance between each pair of them grows exponentially,

Return to:

Send suggestions and report system problems to the System administrator.