diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-09-25 16:34:09 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-09-25 16:34:09 +0300 |
commit | 2b826ef4031f050db54594ab05a2af55f5cbc425 (patch) | |
tree | ff0fdf3df23ea35313d151f70f67ae1c21cb0cb1 /lib | |
parent | f59aa22f237d6fb0eb928908f8874c8468afa077 (diff) | |
download | anubis-2b826ef4031f050db54594ab05a2af55f5cbc425.tar.gz anubis-2b826ef4031f050db54594ab05a2af55f5cbc425.tar.bz2 |
Redirect Scheme error and output to syslog.
* configure.ac: Remove checks for syslog. Raise version number to 4.1.90.
* src/headers.h: Remove checks for syslog.
Include keyword.h
* src/log.c: Remove checks for syslog.
* src/quit.c: Likewise.
* src/rcfile.c: Handle new keywords log-facility and log-tag.
* src/daemon.c (log_tag, log_facility): New variables.
(daemonize): Remove HAVE_SYSLOG conditional.
Pass log_tag and log_facility to openlog.
* src/errs.c (anubis_verror_log): New function.
(anubis_verror, anubis_error): Rewrite using anubis_verror_log.
* src/extern.h (log_tag, log_facility): New externs.
* src/guile.c (eval_catch_body): Remove.
(init_guile): Initialize error and info output ports.
(guile_ports_open): Use error and info output ports unless
output file is given.
* lib/keyword.c: New file.
* lib/keyword.h: New file.
* lib/Makefile.am: Add new files.
* src/logport.c: New file.
* src/Makefile.am (anubis_SOURCES): Add new files.
* src/authmode.c (asmtp_kw): Use anubis_keyword functions.
* NEWS: Update.
* doc/anubis.texi: Document new features.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.am | 4 | ||||
-rw-r--r-- | lib/keyword.c | 45 | ||||
-rw-r--r-- | lib/keyword.h | 29 |
3 files changed, 76 insertions, 2 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 8b31ba5..214e9a4 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -19,7 +19,7 @@ ## include gnulib.mk -EXTRA_DIST += argcv.c argcv.h lbuf.c lbuf.h +EXTRA_DIST += argcv.c argcv.h lbuf.c lbuf.h keyword.c keyword.h -libanubis_a_SOURCES += argcv.c argcv.h lbuf.c lbuf.h +libanubis_a_SOURCES += argcv.c argcv.h lbuf.c lbuf.h keyword.c keyword.h diff --git a/lib/keyword.c b/lib/keyword.c new file mode 100644 index 0000000..da1808c --- /dev/null +++ b/lib/keyword.c @@ -0,0 +1,45 @@ +/* + Simple keyword translation. + + This file is part of GNU Anubis. + Copyright (C) 2009 The Anubis Team. + + GNU Anubis is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3 of the License, or (at your + option) any later version. + + GNU Anubis is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with GNU Anubis. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif +#include <stdlib.h> +#include <string.h> +#include "keyword.h" + +struct anubis_keyword * +anubis_keyword_lookup (struct anubis_keyword *tab, const char *name) +{ + for (; tab->name; tab++) + if (strcmp (tab->name, name) == 0) + return tab; + return NULL; +} + +struct anubis_keyword * +anubis_keyword_lookup_ci (struct anubis_keyword *tab, const char *name) +{ + for (; tab->name; tab++) + if (strcasecmp (tab->name, name) == 0) + return tab; + return NULL; +} + diff --git a/lib/keyword.h b/lib/keyword.h new file mode 100644 index 0000000..2231749 --- /dev/null +++ b/lib/keyword.h @@ -0,0 +1,29 @@ +/* + This file is part of GNU Anubis. + Copyright (C) 2009 The Anubis Team. + + GNU Anubis is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3 of the License, or (at your + option) any later version. + + GNU Anubis is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with GNU Anubis. If not, see <http://www.gnu.org/licenses/>. +*/ + +struct anubis_keyword +{ + char *name; + int tok; +}; + +struct anubis_keyword *anubis_keyword_lookup (struct anubis_keyword *tab, + const char *name); +struct anubis_keyword *anubis_keyword_lookup_ci (struct anubis_keyword *tab, + const char *name); + |