bincimap

Log | Files | Refs | LICENSE

commit 85d4118b07c59ffde360f818295ed8dc55d0224a
parent 34686ef774c3b24632346a854707f31e9ce365ea
Author: andreaha <andreaha@b31fe1f4-c0d1-0310-8000-a34f4ae90293>
Date:   Tue,  6 Apr 2004 20:17:12 +0000

- No longer wastes time in configure step checking for features that
  we don't check defines for in the sources.
- No longer checks for sstream/ostream - we don't use them anyway.
- Updated man pages to be slightly more accurate.
- From now of, Binc IMAP's tarballs by default install under
  /usr/local, and setting --prefix will change this path. All Binc
  IMAP files will be contained inside this directory. The RPM packages
  are completely unchanged from before, and still use /opt/bincimap,
  and so on.
- Updated README to reflect this new packaging style.
- Binc now generates maildir message names that conform to DjB's
  suggestions for modern delivery agents.



git-svn-id: file:///home/cwright/convert/bincimap/trunk@64 b31fe1f4-c0d1-0310-8000-a34f4ae90293

Diffstat:
MChangeLog | 15+++++++++++++++
MREADME.in | 63+++++++++++++++++++++++++++++++++------------------------------
Maclocal.m4 | 33---------------------------------
Mbincimap.spec.in | 15++++++++++++++-
Mconf/Makefile.am | 18+++++++++---------
Mconfig.h.in | 232-------------------------------------------------------------------------------
Mconfigure.in | 152++++++++++++++++++++++++++++---------------------------------------------------
Mdoc/Makefile.am | 20++++++++++++++++++++
Mdoc/manual/Makefile.am | 11++++++-----
Mman/bincimap-up.1 | 15++++++++-------
Mman/bincimap.conf.5 | 16++++++++++++----
Mman/bincimapd.1 | 20++++++++++++--------
Mservice/Makefile.am | 15++++++---------
Mservice/log/Makefile.am | 16++++++----------
Mservice/run.in | 4++--
Msrc/Makefile.am | 7++-----
Dsrc/bincimapd-module.cc | 156-------------------------------------------------------------------------------
Dsrc/bincimapd-module.h | 78------------------------------------------------------------------------------
Msrc/io.cc | 5-----
Msrc/maildir-scan.cc | 14+++++++++++++-
Msrc/maildir.cc | 42++++++++++++++++++++++++------------------
Msrc/maildirmessage.h | 3++-
Msrc/session-initialize-bincimapd.cc | 22----------------------
Msrc/session.cc | 5+++++
Dsrc/storageparser.cc | 1355-------------------------------------------------------------------------------
25 files changed, 242 insertions(+), 2090 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,18 @@ +* Sun Apr 03 2004 Andreas Aardal Hanssen <andreas-binc at bincimap.org> +- No longer wastes time in configure step checking for features that + we don't check defines for in the sources. +- No longer checks for sstream/ostream - we don't use them anyway. +- Updated man pages to be slightly more accurate. +- From now of, Binc IMAP's tarballs by default install under + /usr/local, and setting --prefix will change this path. All Binc + IMAP files will be contained inside this directory. The RPM packages + are completely unchanged from before, and still use /opt/bincimap, + and so on. +- Updated README to reflect this new packaging style. +- Binc now generates maildir message names that conform to DjB's + suggestions for modern delivery agents. +- Released 1.2.7beta6-1 + * Sun Mar 07 2004 Andreas Aardal Hanssen <andreas-binc at bincimap.org> - Fixed a mistake with handling the new command line parser. The precedence of global config, command line arguments and local config diff --git a/README.in b/README.in @@ -15,7 +15,7 @@ Here is a quick guide on how to setup IMAP on your system. Note that this is not the full documentation for Binc IMAP. You will find more about the server by viewing the man pages and reading -through the bundled documentation under /opt/bincimap/doc. +through the bundled documentation under /usr/local/bincimap/doc. You can also check out the project home page's FAQ and the Life With Binc IMAP community documentation site: @@ -90,27 +90,30 @@ make install # Note: Mac OS X users need to use "sudo make install" "make install" will create the following files: - /opt/bincimap/bin/bincimap-up - /opt/bincimap/bin/bincimapd - /opt/bincimap/doc/bincimap-manual.dvi - /opt/bincimap/doc/bincimap-manual.ps - /etc/opt/bincimap/bincimap.conf - /etc/opt/bincimap/xinetd/imap - /etc/opt/bincimap/xinetd/imaps - /etc/opt/bincimap/scripts/checkpassword.pl - /etc/opt/bincimap/scripts/tomaildir++ - /etc/opt/bincimap/scripts/toimapdir - /var/opt/bincimap/service/imap/run - /var/opt/bincimap/service/imap/log/run - /var/opt/bincimap/service/imaps/run - /var/opt/bincimap/service/imaps/log/run + /usr/local/bin/bincimap-up + /usr/local/bin/bincimapd + /usr/local/bin/checkpassword.pl + /usr/local/bin/tomaildir++ + /usr/local/bin/toimapdir + + /usr/local/doc/bincimap-manual.dvi + /usr/local/doc/bincimap-manual.ps + + /usr/local/etc/bincimap.conf + /usr/local/etc/xinetd/imap + /usr/local/etc/xinetd/imaps + + /usr/local/service/imap/run + /usr/local/service/imap/log/run + /usr/local/service/imaps/run + /usr/local/service/imaps/log/run -------------------------------- 2) Apply necessary configuration -------------------------------- Edit the destination bincimap.conf file, which by default is - installed under /etc/opt/bincimap. Check each + installed under /usr/local/etc/bincimap.conf. Check each individual setting. * Note the location of your server's SSL PEM-encoded @@ -128,10 +131,10 @@ make install # Note: Mac OS X users need to use "sudo make install" doc/ directory. If using daemontools' supervise, tcpserver and multilog, - create the multilog directores. + create multilog directores. -mkdir -p /var/opt/log/bincimap{,-ssl} -chown nobody.nobody /var/opt/log/bincimap{,-ssl} +mkdir -p /var/log/bincimap{,-ssl} +chown nobody.nobody /var/log/bincimap{,-ssl} xinetd users will be more familiar with using syslog. @@ -141,8 +144,8 @@ chown nobody.nobody /var/opt/log/bincimap{,-ssl} With xinetd: - Edit /etc/opt/bincimap/xinetd/imap and - /etc/opt/bincimap/xinetd/imaps and check that the locations + Edit /usr/local/etc/xinetd/bincimap and + /usr/local/etc/xinetd/bincimaps and check that the locations of configuration files and binaries are correct. Note the location of your checkpassword authenticator in @@ -152,23 +155,23 @@ chown nobody.nobody /var/opt/log/bincimap{,-ssl} You may also want to symlink them to /etc/xinetd.d instead of copying the files. -ln -s /etc/opt/bincimap/xinetd/imap /etc/xinetd.d/imap -ln -s /etc/opt/bincimap/xinetd/imaps /etc/xinetd.d/imaps +ln -s /usr/local/etc/xinetd/bincimap /etc/xinetd.d/imap +ln -s /usr/local/etc/xinetd/bincimaps /etc/xinetd.d/imaps service xinetd restart With daemontools' supervise: - Edit /var/opt/bincimap/service/imap/run, - /var/opt/bincimap/service/imap/log/run, - /var/opt/bincimap/service/imaps/run and - /var/opt/bincimap/service/imaps/log/run and + Edit /usr/local/etc/service/bincimap/run, + /usr/local/etc/service/bincimap/log/run, + /usr/local/etc/service/bincimaps/run and + /usr/local/etc/service/bincimaps/log/run and check that the locations are correct. Note the location of your authenticator in particular. Then copy or symlink the service files in place. -ln -s /var/opt/bincimap/service/imap /service/imap -ln -s /var/opt/bincimap/service/imaps /service/imaps +ln -s /usr/local/etc/service/bincimap /service/imap +ln -s /usr/local/etc/service/bincimaps /service/imaps ---------------------------- 4) Securing your service @@ -197,7 +200,7 @@ ln -s /var/opt/bincimap/service/imaps /service/imaps user has no rights: Security { - jail path = "/opt/bincimap/bin", + jail path = "/usr/local/bin", jail user = "nobody", jail group = "nobody" } diff --git a/aclocal.m4 b/aclocal.m4 @@ -809,36 +809,3 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]) fi])]) - -# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - -# This program 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 2, or (at your option) -# any later version. - -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 - -AC_PREREQ(2.50) - -# AM_PROG_LEX -# ----------- -# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a -# "missing" invocation, for better error output. -AC_DEFUN([AM_PROG_LEX], -[AC_REQUIRE([AM_MISSING_HAS_RUN])dnl -AC_REQUIRE([AC_PROG_LEX])dnl -if test "$LEX" = :; then - LEX=${am_missing_run}flex -fi]) - diff --git a/bincimap.spec.in b/bincimap.spec.in @@ -1,4 +1,3 @@ -#test # This program 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 2 of the License, or @@ -188,6 +187,20 @@ install man/bincimap.conf.5 $MAN/man5 #----------------------------------------------------------------------- %changelog +* Sun Apr 03 2004 Andreas Aardal Hanssen <andreas-binc@bincimap.org> +- No longer wastes time in configure step checking for features that + we don't check defines for in the sources. +- No longer checks for sstream/ostream - we don't use them anyway. +- Updated man pages to be slightly more accurate. +- From now of, Binc IMAP's tarballs by default install under + /usr/local, and setting --prefix will change this path. All Binc + IMAP files will be contained inside this directory. The RPM packages + are completely unchanged from before, and still use /opt/bincimap, + and so on. +- Updated README to reflect this new packaging style. +- Binc now generates maildir message names that conform to DjB's + suggestions for modern delivery agents. +- Released 1.2.7beta6-1 * Sun Mar 07 2004 Andreas Aardal Hanssen <andreas-binc@bincimap.org> - Fixed a mistake with handling the new command line parser. The diff --git a/conf/Makefile.am b/conf/Makefile.am @@ -18,17 +18,17 @@ install-exec-hook: @if [ ! -e $(DESTDIR)$(sysconfdir)/bincimap.conf ]; then $(INSTALL_DATA) $(srcdir)/bincimap.conf $(DESTDIR)$(sysconfdir); else $(INSTALL_DATA) $(srcdir)/bincimap.conf $(DESTDIR)$(sysconfdir)/bincimap.conf.new; echo "- New conf file saved as $(DESTDIR)$(sysconfdir)/bincimap.conf.new" >> $(srcdir)/../install.log; fi; @$(mkinstalldirs) -m 755 $(DESTDIR)$(sysconfdir)/xinetd - @if [ ! -e $(DESTDIR)$(sysconfdir)/xinetd/imap ]; then $(INSTALL_DATA) $(srcdir)/xinetd-bincimap $(DESTDIR)$(sysconfdir)/xinetd/imap; else $(INSTALL_DATA) $(srcdir)/xinetd-bincimap $(DESTDIR)$(sysconfdir)/xinetd/imap.new; echo "- New xinetd/imap file saved as $(DESTDIR)$(sysconfdir)/xinetd/imap.new" >> $(srcdir)/../install.log; fi; - @if [ ! -e $(DESTDIR)$(sysconfdir)/xinetd/imaps ]; then $(INSTALL_DATA) $(srcdir)/xinetd-bincimaps $(DESTDIR)$(sysconfdir)/xinetd/imaps; else $(INSTALL_DATA) $(srcdir)/xinetd-bincimaps $(DESTDIR)$(sysconfdir)/xinetd/imaps.new; echo "- New xinetd/imaps file saved as $(DESTDIR)$(sysconfdir)/xinetd/imaps.new" >> $(srcdir)/../install.log; fi; + @if [ ! -e $(DESTDIR)$(sysconfdir)/xinetd/bincimap ]; then $(INSTALL_DATA) $(srcdir)/xinetd-bincimap $(DESTDIR)$(sysconfdir)/xinetd/bincimap; else $(INSTALL_DATA) $(srcdir)/xinetd-bincimap $(DESTDIR)$(sysconfdir)/xinetd/bincimap.new; echo "- New xinetd/bincimap file saved as $(DESTDIR)$(sysconfdir)/xinetd/bincimap.new" >> $(srcdir)/../install.log; fi; + @if [ ! -e $(DESTDIR)$(sysconfdir)/xinetd/bincimaps ]; then $(INSTALL_DATA) $(srcdir)/xinetd-bincimaps $(DESTDIR)$(sysconfdir)/xinetd/bincimaps; else $(INSTALL_DATA) $(srcdir)/xinetd-bincimaps $(DESTDIR)$(sysconfdir)/xinetd/bincimaps.new; echo "- New xinetd/bincimaps file saved as $(DESTDIR)$(sysconfdir)/xinetd/bincimaps.new" >> $(srcdir)/../install.log; fi; - @$(mkinstalldirs) -m 755 $(DESTDIR)$(sysconfdir)/scripts - @if [ ! -e $(DESTDIR)$(sysconfdir)/scripts/checkpassword.pl ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/checkpassword.pl $(DESTDIR)$(sysconfdir)/scripts; else $(INSTALL_DATA) -m 0755 $(srcdir)/checkpassword.pl $(DESTDIR)$(sysconfdir)/scripts/checkpassword.pl.new; echo "- New file saved as $(DESTDIR)$(sysconfdir)/scripts/checkpassword.pl.new" >> $(srcdir)/../install.log; fi; - @if [ ! -e $(DESTDIR)$(sysconfdir)/scripts/tomaildir++ ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/tomaildir++ $(DESTDIR)$(sysconfdir)/scripts; else $(INSTALL_DATA) -m 0755 $(srcdir)/tomaildir++ $(DESTDIR)$(sysconfdir)/scripts/tomaildir++.new; echo "- New file saved as $(DESTDIR)$(sysconfdir)/scripts/tomaildir++.new" >> $(srcdir)/../install.log; fi; - @if [ ! -e $(DESTDIR)$(sysconfdir)/scripts/toimapdir ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/toimapdir $(DESTDIR)$(sysconfdir)/scripts; else $(INSTALL_DATA) -m 0755 $(srcdir)/toimapdir $(DESTDIR)$(sysconfdir)/scripts/toimapdir.new; echo "- New file saved as $(DESTDIR)$(sysconfdir)/scripts/toimapdir.new" >> $(srcdir)/../install.log; fi; - @if [ ! -e $(DESTDIR)$(sysconfdir)/scripts/tomaildir++ ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/tomaildir++ $(DESTDIR)$(sysconfdir)/scripts; else $(INSTALL_DATA) -m 0755 $(srcdir)/tomaildir++ $(DESTDIR)$(sysconfdir)/scripts/tomaildir++.new; echo "- New file saved as $(DESTDIR)$(sysconfdir)/scripts/tomaildir++.new" >> $(srcdir)/../install.log; fi; + @$(mkinstalldirs) -m 755 $(DESTDIR)$(libexecdir)/ + @if [ ! -e $(DESTDIR)$(libexecdir)/checkpassword.pl ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/checkpassword.pl $(DESTDIR)$(libexecdir)/checkpassword.pl; else $(INSTALL_DATA) -m 0755 $(srcdir)/checkpassword.pl $(DESTDIR)$(libexecdir)/checkpassword.pl.new; echo "- New file saved as $(DESTDIR)$(libexecdir)/checkpassword.pl.new" >> $(srcdir)/../install.log; fi; + @if [ ! -e $(DESTDIR)$(libexecdir)/toimapdir ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/toimapdir $(DESTDIR)$(libexecdir)/toimapdir; else $(INSTALL_DATA) -m 0755 $(srcdir)/toimapdir $(DESTDIR)$(libexecdir)/toimapdir.new; echo "- New file saved as $(DESTDIR)$(libexecdir)/toimapdir.new" >> $(srcdir)/../install.log; fi; + @if [ ! -e $(DESTDIR)$(libexecdir)/tomaildir++ ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/tomaildir++ $(DESTDIR)$(libexecdir)/tomaildir++; else $(INSTALL_DATA) -m 0755 $(srcdir)/tomaildir++ $(DESTDIR)$(libexecdir)/tomaildir++.new; echo "- New file saved as $(DESTDIR)$(libexecdir)/tomaildir++.new" >> $(srcdir)/../install.log; fi; #-------------------------------------------------------------------------- uninstall-hook: rm $(DESTDIR)$(sysconfdir)/bincimap.conf - rm $(DESTDIR)$(sysconfdir)/xinetd/imap - rm $(DESTDIR)$(sysconfdir)/xinetd/imaps + rm $(DESTDIR)$(sysconfdir)/xinetd/bincimap + rm $(DESTDIR)$(sysconfdir)/xinetd/bincimaps + -rmdir $(DESTDIR)$(sysconfdir)/xinetd diff --git a/config.h.in b/config.h.in @@ -4,188 +4,12 @@ #define config_h_included -/* Define to 1 if the `closedir' function returns void instead of `int'. */ -#undef CLOSEDIR_VOID - -/* Define to 1 if you have the `alarm' function. */ -#undef HAVE_ALARM - -/* Define to 1 if your system has a working `chown' function. */ -#undef HAVE_CHOWN - -/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the `dup2' function. */ -#undef HAVE_DUP2 - -/* Define to 1 if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `fork' function. */ -#undef HAVE_FORK - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `gethostname' function. */ -#undef HAVE_GETHOSTNAME - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if `lstat' has the bug that it succeeds when given the - zero-length file name argument. */ -#undef HAVE_LSTAT_EMPTY_STRING_BUG - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the `mkdir' function. */ -#undef HAVE_MKDIR - -/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - /* support for O_LARGEFILE */ #undef HAVE_OLARGEFILE -/* support for ostream */ -#undef HAVE_OSTREAM - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define to 1 if you have the `regcomp' function. */ -#undef HAVE_REGCOMP - -/* Define to 1 if you have the `rmdir' function. */ -#undef HAVE_RMDIR - -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT - -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* support for sstream */ -#undef HAVE_SSTREAM - -/* Define to 1 if `stat' has the bug that it succeeds when given the - zero-length file name argument. */ -#undef HAVE_STAT_EMPTY_STRING_BUG - -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H - -/* Define to 1 if you have the <stddef.h> header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the `strftime' function. */ -#undef HAVE_STRFTIME - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the <syslog.h> header file. */ -#undef HAVE_SYSLOG_H - -/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the <sys/select.h> header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the <sys/socket.h> header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/time.h> header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - /* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `utime' function. */ -#undef HAVE_UTIME - -/* Define to 1 if you have the <utime.h> header file. */ -#undef HAVE_UTIME_H - -/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ -#undef HAVE_UTIME_NULL - -/* Define to 1 if you have the `vfork' function. */ -#undef HAVE_VFORK - -/* Define to 1 if you have the <vfork.h> header file. */ -#undef HAVE_VFORK_H - -/* Define to 1 if you have the <wait.h> header file. */ -#undef HAVE_WAIT_H - -/* Define to 1 if `fork' works. */ -#undef HAVE_WORKING_FORK - -/* Define to 1 if `vfork' works. */ -#undef HAVE_WORKING_VFORK - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Define to 1 if `lstat' dereferences a symlink specified with a trailing - slash. */ -#undef LSTAT_FOLLOWS_SLASHED_SYMLINK - /* Name of package */ #undef PACKAGE @@ -204,67 +28,11 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - -/* Define to the type of arg 1 for `select'. */ -#undef SELECT_TYPE_ARG1 - -/* Define to the type of args 2, 3 and 4 for `select'. */ -#undef SELECT_TYPE_ARG234 - -/* Define to the type of arg 5 for `select'. */ -#undef SELECT_TYPE_ARG5 - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if your <sys/time.h> declares `struct tm'. */ -#undef TM_IN_SYS_TIME - /* Version number of package */ #undef VERSION /* Define to 1 if SSL support is included. */ #undef WITH_SSL -/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a - `char[]'. */ -#undef YYTEXT_POINTER - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef gid_t - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#undef inline - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to `int' if <sys/types.h> does not define. */ -#undef mode_t - -/* Define to `int' if <sys/types.h> does not define. */ -#undef pid_t - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc - -/* Define to `unsigned' if <sys/types.h> does not define. */ -#undef size_t - -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef uid_t - -/* Define as `fork' if `vfork' does not work. */ -#undef vfork - #endif diff --git a/configure.in b/configure.in @@ -10,126 +10,92 @@ dnl USA. dnl Process this file with autoconf to produce a configure script. dnl AC_PREREQ(2.57) -AC_INIT(bincimap, 1.2.7beta5, andreas-binc@bincimap.org) +AC_INIT(bincimap, 1.2.7beta6, andreas-binc@bincimap.org) AC_CONFIG_SRCDIR([config.h.in]) AM_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE dnl Checks for programs. AC_PROG_CXX -AC_PROG_CC AC_PROG_INSTALL -AC_PROG_MAKE_SET -AC_PROG_AWK -AM_PROG_LEX -AC_PROG_LN_S -AC_PROG_RANLIB -AC_PROG_YACC dnl Checks for typedefs, structures, and compiler characteristics. -AC_HEADER_DIRENT -AC_HEADER_STDBOOL -AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h unistd.h sys/time.h syslog.h utime.h wait.h]) -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_UID_T -AC_C_INLINE -AC_TYPE_MODE_T -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_STRUCT_TM - -dnl Checks for library functions. -AC_FUNC_CHOWN -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_FORK -AC_FUNC_LSTAT -AC_FUNC_MALLOC -AC_FUNC_MKTIME -AC_FUNC_REALLOC -AC_FUNC_SELECT_ARGTYPES -AC_TYPE_SIGNAL -AC_FUNC_STAT -AC_FUNC_STRFTIME -AC_FUNC_STRTOD -AC_FUNC_UTIME_NULL -AC_FUNC_ERROR_AT_LINE -AC_CHECK_FUNCS([alarm dup2 getcwd gethostname gettimeofday memset mkdir putenv regcomp rmdir select setenv strchr strdup strerror strtol utime]) - -dnl --------------------------------------------------------------------------- - -AC_PREFIX_DEFAULT(/opt/bincimap) - -dnl --------------------------------------------------------------------------- - -dnl Add /usr/kerberos/include to include path if this path -dnl exists. -AC_MSG_CHECKING(wether to include /usr/kerberos/include) -if [[ -e /usr/kerberos/include ]]; then - AC_MSG_RESULT([yes]) - CXXFLAGS="-I/usr/kerberos/include $CXXFLAGS" -else - AC_MSG_RESULT([not necessary]) -fi - -CXXFLAGS="$CXXFLAGS -Wall -fno-exceptions" - -dnl --------------------------------------------------------------------------- +dnl C++ will be used for all compile tests +AC_LANG_CPLUSPLUS +dnl Silly autoconf prefix=$(eval echo $(eval echo ${prefix})) AC_MSG_CHECKING(--prefix) if [[ "x$prefix" = "xNONE" ]]; then - AC_MSG_RESULT([/opt/bincimap]) - prefix=/opt/bincimap - AC_SUBST(prefix) + AC_MSG_RESULT([/usr/local]) + prefix=/usr/local else AC_MSG_RESULT(using $prefix) fi +AC_SUBST(prefix) + +bindir=$(eval echo $(eval echo ${bindir})) +AC_MSG_CHECKING(--bindir) +if [[ "x$bindir" = "xNONE/bin" ]]; then + AC_MSG_RESULT([$prefix/bin]) + bindir=$prefix/bin +else + AC_MSG_RESULT(using $bindir) +fi +AC_SUBST(bindir) -dnl --------------------------------------------------------------------------- sysconfdir=$(eval echo $(eval echo ${sysconfdir})) AC_MSG_CHECKING(--sysconfdir) -if [[ "x$sysconfdir" = "x$prefix/etc" ]]; then - AC_MSG_RESULT([/etc/opt/bincimap]) - sysconfdir=/etc/opt/bincimap - AC_SUBST(sysconfdir) +if [[ "x$sysconfdir" = "xNONE/etc" ]]; then + AC_MSG_RESULT([$prefix/etc]) + sysconfdir=$prefix/etc else AC_MSG_RESULT(using $sysconfdir) fi - -dnl --------------------------------------------------------------------------- +AC_SUBST(sysconfdir) localstatedir=$(eval echo $(eval echo ${localstatedir})) AC_MSG_CHECKING(--localstatedir) -if [[ "x$localstatedir" = "x$prefix/var" ]]; then - AC_MSG_RESULT([/var/opt/bincimap]) - localstatedir=/var/opt/bincimap - AC_SUBST(localstatedir) +if [[ "x$localstatedir" = "xNONE/var" ]]; then + AC_MSG_RESULT([$prefix/var]) + localstatedir=$prefix/var else AC_MSG_RESULT(using $localstatedir) fi - -dnl --------------------------------------------------------------------------- +AC_SUBST(sysconfdir) datadir=$(eval echo $(eval echo ${datadir})) AC_MSG_CHECKING(--datadir) -if [[ "x$datadir" = "x$prefix/share" ]]; then - AC_MSG_RESULT([/var/opt/bincimap]) - datadir=/var/opt/bincimap - AC_SUBST(datadir) +if [[ "x$datadir" = "xNONE/share" ]]; then + AC_MSG_RESULT([$prefix/share]) + datadir=$prefix/share else AC_MSG_RESULT(using $datadir) fi +AC_SUBST(datadir) + +dnl --------------------------------------------------------------------------- + +dnl Add /usr/kerberos/include to include path if this path +dnl exists. +AC_MSG_CHECKING(wether to include /usr/kerberos/include) +if [[ -e /usr/kerberos/include ]]; then + AC_MSG_RESULT([yes]) + CXXFLAGS="-I/usr/kerberos/include $CXXFLAGS" +else + AC_MSG_RESULT([not necessary]) +fi + +CXXFLAGS="$CXXFLAGS -Wall -fno-exceptions" dnl --------------------------------------------------------------------------- AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [Enable static compile]), - [ if [[ "x$enableval" != "xno" ]]; then STATIC="-static --all-static"; fi ], []) + [ if [[ "x$enableval" != "xno" ]]; then STATIC=" -static --all-static"; fi ], []) AC_SUBST(STATIC) AC_MSG_CHECKING(wether to compile static or shared) @@ -157,6 +123,12 @@ else fi dnl --------------------------------------------------------------------------- +dnl Checks if we can compile and link against OpenSSL. Does a check +dnl against the headers, trying different standard paths for the installation +dnl of the include/openssl/... files. Then does the same with the libraries. +dnl +dnl After this is done, LIBSSL and INCLUDESSL are either empty, or they +dnl contain the paths of the headers and libs. AC_ARG_WITH(openssl-lib, AC_HELP_STRING([--with-openssl-lib], [Set path to OpenSSL libraries]), @@ -173,7 +145,6 @@ AC_HELP_STRING([--without-ssl], [Disable SSL support]), WITH_SSL=1) if [[ "$WITH_SSL" = "1" ]]; then - AC_LANG_CPLUSPLUS AC_MSG_CHECKING(whether -lsocket is available) export LDTMP=$LIBS export LIBS="$LIBS -lsocket" @@ -182,7 +153,7 @@ if [[ "$WITH_SSL" = "1" ]]; then AC_MSG_CHECKING(for OpenSSL includes) export CXXTMP=$CXXFLAGS - for k in found $SSLINCLUDEPATH /usr/include /usr/local/include /usr/local/ssl/include /usr/local/openssl/include /opt/ssl/include /opt/openssl/include; do + for k in . $SSLINCLUDEPATH /usr/include /usr/local/include /usr/local/ssl/include /usr/local/openssl/include /opt/ssl/include /opt/openssl/include; do export CXXFLAGS="$CXXTMP -I$k" AC_TRY_COMPILE([#include <openssl/ssl.h>], [SSL_write(0, 0, 0);], INCLUDESSL="-I$k"; AC_MSG_RESULT($k), []) if [[ "x$INCLUDESSL" != "x" ]]; then break; fi @@ -196,10 +167,10 @@ if [[ "$WITH_SSL" = "1" ]]; then AC_MSG_CHECKING(for OpenSSL libraries) export LIBTMP=$LIBS export LDTMP=$LDFLAGS - for k in found $SSLLIBPATH /usr/lib /usr/local/lib /usr/local/ssl/lib /usr/local/openssl/lib /opt/ssl/lib /opt/openssl/lib; do + for k in . $SSLLIBPATH /usr/lib /usr/local/lib /usr/local/ssl/lib /usr/local/openssl/lib /opt/ssl/lib /opt/openssl/lib; do export LDFLAGS="$LDTMP -L$k" export LIBS="$LIBTMP -lssl -lcrypto $LIBSOCKET" - AC_TRY_LINK([#include <openssl/ssl.h>], [SSL_write(0, 0, 0);], LIBSSL="-L$k -lssl -lcrypto $LIBSOCKET"; AC_MSG_RESULT($k), []) + AC_TRY_LINK([#include <openssl/ssl.h>], [SSL_write(0, 0, 0);], LIBSSL="-L$k -lssl -lcrypto $LIBSOCKET"; AC_MSG_RESULT($k), [])  if [[ "x$LIBSSL" != "x" ]]; then break; fi done export LIBS=$LIBTMP @@ -211,8 +182,6 @@ if [[ "$WITH_SSL" = "1" ]]; then else AC_DEFINE(WITH_SSL, 1, [Define to 1 if SSL support is included.]) fi - - AC_LANG_C else AC_MSG_RESULT(no) fi @@ -220,27 +189,12 @@ AC_SUBST(LIBSSL) dnl --------------------------------------------------------------------------- -AC_CHECK_LIB(dl, dlopen, LIBDL=-ldl, LIBDL=) -AC_SUBST(LIBDL) - -dnl --------------------------------------------------------------------------- - -dnl Checks -AC_LANG_CPLUSPLUS -AC_MSG_CHECKING(whether to include <sstream> or <strstream>) -AC_TRY_COMPILE([#include <sstream>], [], AC_MSG_RESULT([<sstream>]); AC_DEFINE(HAVE_SSTREAM,, [support for sstream]), AC_MSG_RESULT([<strstream>])) - -AC_MSG_CHECKING(whether to include <ostream> or <ostream.h>) -AC_TRY_COMPILE([#include <ostream>], [], AC_MSG_RESULT([<ostream>]); AC_DEFINE(HAVE_OSTREAM,, [support for ostream]), AC_MSG_RESULT([<ostream.h>])) - AC_MSG_CHECKING(whether O_LARGEFILE is defined) AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int i = O_LARGEFILE;], [], AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_OLARGEFILE,, [support for O_LARGEFILE]), AC_MSG_RESULT([no])) -AC_LANG_C - dnl --------------------------------------------------------------------------- AH_TOP(#ifndef config_h_included diff --git a/doc/Makefile.am b/doc/Makefile.am @@ -13,3 +13,23 @@ SUBDIRS = manual #-------------------------------------------------------------------------- EXTRA_DIST = README rfc1733.txt rfc2086.txt rfc2095.txt rfc2192.txt rfc2221.txt rfc2595.txt rfc3028.txt rfc1731.txt rfc2060.txt rfc2087.txt rfc2177.txt rfc2193.txt rfc2342.txt rfc2683.txt rfc3348.txt rfc1732.txt rfc2061.txt rfc2088.txt rfc2180.txt rfc2195.txt rfc2359.txt rfc2971.txt bincimap-faq.html bincimap.css bincimap-tech.html bincimap-imapdir.html bincimap-goals.html + +#-------------------------------------------------------------------------- +install-exec-hook: + $(mkinstalldirs) $(DESTDIR)$(datadir)/doc/bincimap + $(INSTALL_DATA) -m 0644 $(srcdir)/bincimap-faq.html $(DESTDIR)$(datadir)/doc/bincimap/bincimap-faq.html + $(INSTALL_DATA) -m 0644 $(srcdir)/bincimap.css $(DESTDIR)$(datadir)/doc/bincimap/bincimap.css + $(INSTALL_DATA) -m 0644 $(srcdir)/bincimap-tech.html $(DESTDIR)$(datadir)/doc/bincimap/bincimap-tech.html + $(INSTALL_DATA) -m 0644 $(srcdir)/bincimap-imapdir.html $(DESTDIR)$(datadir)/doc/bincimap/bincimap-imapdir.html + $(INSTALL_DATA) -m 0644 $(srcdir)/bincimap-goals.html $(DESTDIR)$(datadir)/doc/bincimap/bincimap-goals.html + $(INSTALL_DATA) -m 0644 $(srcdir)/../README $(DESTDIR)$(datadir)/doc/bincimap/README + +#-------------------------------------------------------------------------- +uninstall-hook: + rm -f $(DESTDIR)$(datadir)/doc/bincimap/bincimap-faq.html + rm -f $(DESTDIR)$(datadir)/doc/bincimap/bincimap.css.html + rm -f $(DESTDIR)$(datadir)/doc/bincimap/bincimap-tech.html + rm -f $(DESTDIR)$(datadir)/doc/bincimap/bincimap-imapdir.html + rm -f $(DESTDIR)$(datadir)/doc/bincimap/bincimap-goals.html + rm -f $(DESTDIR)$(datadir)/doc/bincimap/README + -rmdir $(DESTDIR)$(datadir)/doc/bincimap diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am @@ -25,12 +25,13 @@ bincimap-manual.dvi: bincimap-manual.tex #-------------------------------------------------------------------------- install-exec-hook: - $(mkinstalldirs) $(DESTDIR)$(prefix)/doc - $(INSTALL_DATA) $(srcdir)/bincimap-manual.ps $(DESTDIR)$(prefix)/doc - $(INSTALL_DATA) $(srcdir)/bincimap-manual.dvi $(DESTDIR)$(prefix)/doc + $(mkinstalldirs) $(DESTDIR)$(datadir)/doc/bincimap + $(INSTALL_DATA) $(srcdir)/bincimap-manual.ps $(DESTDIR)$(datadir)/doc/bincimap + $(INSTALL_DATA) $(srcdir)/bincimap-manual.dvi $(DESTDIR)$(datadir)/doc/bincimap #-------------------------------------------------------------------------- uninstall-hook: - rm -v $(DESTDIR)$(prefix)/doc/bincimap-manual.ps - rm -v $(DESTDIR)$(prefix)/doc/bincimap-manual.dvi + rm -v $(DESTDIR)$(datadir)/doc/bincimap/bincimap-manual.ps + rm -v $(DESTDIR)$(datadir)/doc/bincimap/bincimap-manual.dvi + -rmdir $(DESTDIR)$(datadir)/doc/bincimap diff --git a/man/bincimap-up.1 b/man/bincimap-up.1 @@ -21,9 +21,6 @@ Note that command line arguments always override config file options. .SH "OPTIONS" -Long options are not supported on all platforms, so if you experience -problems with them, please use the short options instead. - .TP \fB\-a, \-\-allow-plain\fR If set, allows plain text authentication in an unencrypted (SSL/TLS) @@ -253,7 +250,7 @@ Global configurations file. All entries in this file can be overrun with command line arguments. .SH "COPYRIGHT" -Copyright (C) 2002, 2003 Andreas Aardal Hanssen +Copyright (C) 2002-2004 Andreas Aardal Hanssen This is free software; see the source for copying conditions. There is NO warranty. @@ -268,17 +265,21 @@ to browse. .RS .nf -Mailing list: <lists-bincimap@infeline.org> +Mailing list: <binc@bincimap.org> +Developers' mailing list: <binc-dev@bincimap.org> +Announcements list: <binc-news@bincimap.org> + +Subscribing to a mailing list: <binc-subscribe@bincimap.org> Home page: http://www.bincimap.org/ .fi .RE .SH "AUTHOR" -Andreas Aardal Hanssen <bincimap@andreas.hanssen.name> +Andreas Aardal Hanssen <andreas-binc@bincimap.org> .RE .SH "SEE ALSO" -bincimapd(1) bincimap.conf(5) multilog(8) supervise(8) tcpserver(1) xinetd(8) xinetd.conf(5) +multilog(8) supervise(8) tcpserver(1) bincimapd(1) bincimap.conf(5) xinetd(8) xinetd.conf(5) .B Note: The first three man pages are available for download from diff --git a/man/bincimap.conf.5 b/man/bincimap.conf.5 @@ -262,7 +262,7 @@ m { .RE .SH "COPYRIGHT" -Copyright (C) 2002, 2003 Andreas Aardal Hanssen +Copyright (C) 2002-2004 Andreas Aardal Hanssen This is free software; see the source for copying conditions. There is NO warranty. @@ -277,14 +277,22 @@ to browse. .RS .nf -Mailing list: <lists-bincimap@infeline.org> +Mailing list: <binc@bincimap.org> +Developers' mailing list: <binc-dev@bincimap.org> +Announcements list: <binc-news@bincimap.org> + +Subscribing to a mailing list: <binc-subscribe@bincimap.org> Home page: http://www.bincimap.org/ .fi .RE .SH "AUTHOR" -Andreas Aardal Hanssen <bincimap@andreas.hanssen.name> +Andreas Aardal Hanssen <andreas-binc@bincimap.org> .RE .SH "SEE ALSO" -bincimapd(1) bincimap.conf(5) multilog(8) supervise(8) tcpserver(1) xinetd(8) xinetd.conf(5) +multilog(8) supervise(8) tcpserver(1) bincimapd(1) bincimap.conf(5) xinetd(8) xinetd.conf(5) + +.B Note: +The first three man pages are available for download from +.I http://www.qmail.org/. diff --git a/man/bincimapd.1 b/man/bincimapd.1 @@ -27,10 +27,10 @@ Note that command line arguments always override config file options. .SH "OPTIONS" -As of version 1.1.6, bincimapd only optionally takes command line -options. The default behavior is to inherits options from bincimap-up -through the environment. Passing arguments to bincimapd will override -settings inherited from bincimap-up. +Command line arguments are optional. The default behavior is to +inherit options from bincimap-up through the environment. Passing +arguments to bincimapd will override settings inherited from +bincimap-up. For a complete listing of options for bincimapd, see the bincimap-up man page. @@ -96,7 +96,7 @@ Note that it is essential that the authenticator invoked by bincimap-up does not clear the environment. .SH "COPYRIGHT" -Copyright (C) 2002, 2003 Andreas Aardal Hanssen +Copyright (C) 2002-2004 Andreas Aardal Hanssen This is free software; see the source for copying conditions. There is NO warranty. @@ -111,17 +111,21 @@ to browse. .RS .nf -Mailing list: <lists-bincimap@infeline.org> +Mailing list: <binc@bincimap.org> +Developers' mailing list: <binc-dev@bincimap.org> +Announcements list: <binc-news@bincimap.org> + +Subscribing to a mailing list: <binc-subscribe@bincimap.org> Home page: http://www.bincimap.org/ .fi .RE .SH "AUTHOR" -Andreas Aardal Hanssen <bincimap@andreas.hanssen.name> +Andreas Aardal Hanssen <andreas-binc@bincimap.org> .RE .SH "SEE ALSO" -bincimapd.conf(5) bincimap-up(1) multilog(8) supervise(8) tcpserver(1) xinetd(8) xinetd.conf(5) +multilog(8) supervise(8) tcpserver(1) bincimapd.conf(5) bincimap-up(1) xinetd(8) xinetd.conf(5) .B Note: The first three man pages are available for download from diff --git a/service/Makefile.am b/service/Makefile.am @@ -16,15 +16,12 @@ SUBDIRS=log #-------------------------------------------------------------------------- install-exec-hook: - $(mkinstalldirs) $(DESTDIR)$(localstatedir)/service/imap - - @if [ ! -e $(DESTDIR)$(localstatedir)/service/imap/run ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/run $(DESTDIR)$(localstatedir)/service/imap/run; else $(INSTALL_DATA) -m 0755 $(srcdir)/run $(DESTDIR)$(localstatedir)/service/imap/run.new; echo "- New service/imap/run file saved as $(DESTDIR)$(localstatedir)/service/imap/run.new" >> $(srcdir)/../install.log; fi; - $(mkinstalldirs) $(DESTDIR)$(localstatedir)/service/imaps - @if [ ! -e $(DESTDIR)$(localstatedir)/service/imaps/run ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/run-ssl $(DESTDIR)$(localstatedir)/service/imaps/run; else $(INSTALL_DATA) -m 0755 $(srcdir)/run-ssl $(DESTDIR)$(localstatedir)/service/imaps/run.new; echo "- New service/imaps/run file saved as $(DESTDIR)$(localstatedir)/service/imaps/run.new" >> $(srcdir)/../install.log; fi; + $(mkinstalldirs) $(DESTDIR)$(localstatedir)/service/bincimap + @if [ ! -e $(DESTDIR)$(localstatedir)/service/bincimap/run ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/run $(DESTDIR)$(localstatedir)/service/bincimap/run; else $(INSTALL_DATA) -m 0755 $(srcdir)/run $(DESTDIR)$(localstatedir)/service/bincimap/run.new; echo "- New service/bincimap/run file saved as $(DESTDIR)$(localstatedir)/service/bincimap/run.new" >> $(srcdir)/../install.log; fi; + $(mkinstalldirs) $(DESTDIR)$(localstatedir)/service/bincimaps + @if [ ! -e $(DESTDIR)$(localstatedir)/service/bincimaps/run ]; then $(INSTALL_DATA) -m 0755 $(srcdir)/run-ssl $(DESTDIR)$(localstatedir)/service/bincimaps/run; else $(INSTALL_DATA) -m 0755 $(srcdir)/run-ssl $(DESTDIR)$(localstatedir)/service/bincimaps/run.new; echo "- New service/bincimaps/run file saved as $(DESTDIR)$(localstatedir)/service/bincimaps/run.new" >> $(srcdir)/../install.log; fi; #-------------------------------------------------------------------------- uninstall-hook: - rm $(DESTDIR)$(localstatedir)/service/imap/run - rm $(DESTDIR)$(localstatedir)/service/imaps/run - rm $(DESTDIR)$(localstatedir)/service/imap/down - rm $(DESTDIR)$(localstatedir)/service/imaps/down + rm $(DESTDIR)$(localstatedir)/service/bincimap/run + rm $(DESTDIR)$(localstatedir)/service/bincimaps/run diff --git a/service/log/Makefile.am b/service/log/Makefile.am @@ -13,16 +13,12 @@ EXTRA_DIST=run run-ssl #-------------------------------------------------------------------------- install-exec-hook: - $(mkinstalldirs) $(DESTDIR)$(localstatedir)/service/imap/log - @if [ ! -e $(DESTDIR)$(localstatedir)/service/imap/log/run ]; then $(INSTALL_SCRIPT) -m 0755 $(srcdir)/run $(DESTDIR)$(localstatedir)/service/imap/log/run; else $(INSTALL_SCRIPT) -m 0755 $(srcdir)/run $(DESTDIR)$(localstatedir)/service/imap/log/run.new; echo "- New service/imap/run file saved as $(DESTDIR)$(localstatedir)/service/imap/log/run.new" >> $(srcdir)/../../install.log; fi - $(mkinstalldirs) $(DESTDIR)$(localstatedir)/service/imaps/log - @if [ ! -e $(DESTDIR)$(localstatedir)/service/imaps/log/run ]; then $(INSTALL_SCRIPT) -m 0755 $(srcdir)/run-ssl $(DESTDIR)$(localstatedir)/service/imaps/log/run; else $(INSTALL_SCRIPT) -m 0755 $(srcdir)/run-ssl $(DESTDIR)$(localstatedir)/service/imaps/log/run.new; echo "- New service/imaps/run file saved as $(DESTDIR)$(localstatedir)/service/imaps/log/run.new" >> $(srcdir)/../../install.log; fi; - $(mkinstalldirs) $(DESTDIR)$(localstatedir)/log/bincimap - $(mkinstalldirs) $(DESTDIR)$(localstatedir)/log/bincimap-ssl + $(mkinstalldirs) $(DESTDIR)$(localstatedir)/service/bincimap/log + @if [ ! -e $(DESTDIR)$(localstatedir)/service/bincimap/log/run ]; then $(INSTALL_SCRIPT) -m 0755 $(srcdir)/run $(DESTDIR)$(localstatedir)/service/bincimap/log/run; else $(INSTALL_SCRIPT) -m 0755 $(srcdir)/run $(DESTDIR)$(localstatedir)/service/bincimap/log/run.new; echo "- New service/bincimap/run file saved as $(DESTDIR)$(localstatedir)/service/bincimap/log/run.new" >> $(srcdir)/../../install.log; fi + $(mkinstalldirs) $(DESTDIR)$(localstatedir)/service/bincimaps/log + @if [ ! -e $(DESTDIR)$(localstatedir)/service/bincimaps/log/run ]; then $(INSTALL_SCRIPT) -m 0755 $(srcdir)/run-ssl $(DESTDIR)$(localstatedir)/service/bincimaps/log/run; else $(INSTALL_SCRIPT) -m 0755 $(srcdir)/run-ssl $(DESTDIR)$(localstatedir)/service/bincimaps/log/run.new; echo "- New service/bincimaps/run file saved as $(DESTDIR)$(localstatedir)/service/bincimaps/log/run.new" >> $(srcdir)/../../install.log; fi; #-------------------------------------------------------------------------- uninstall-hook: - rm $(DESTDIR)$(localstatedir)/service/imap/log/run - rm $(DESTDIR)$(localstatedir)/service/imaps/log/run - rm $(DESTDIR)$(localstatedir)/service/imap/log/down - rm $(DESTDIR)$(localstatedir)/service/imaps/log/down + rm $(DESTDIR)$(localstatedir)/service/bincimap/log/run + rm $(DESTDIR)$(localstatedir)/service/bincimaps/log/run diff --git a/service/run.in b/service/run.in @@ -7,10 +7,10 @@ exec 2>&1 exec tcpserver -c 100 -u 0 -g 0 \ -l $(hostname) -HDRP \ 0 143 \ - @prefix@/bin/bincimap-up \ + @bindir@/bincimap-up \ --logtype=multilog \ --conf=@sysconfdir@/bincimap.conf -- \ /bin/checkpassword \ - @prefix@/bin/bincimapd + @bindir@/bincimapd diff --git a/src/Makefile.am b/src/Makefile.am @@ -12,16 +12,13 @@ bin_PROGRAMS = bincimapd bincimap-up #-------------------------------------------------------------------------- -bincimapd_SOURCES = address.cc address.h argparser.cc argparser.h authenticate.cc base64.cc base64.h bincimapd.cc broker.cc broker.h convert.cc convert.h depot.h depot.cc imapparser.cc imapparser.h io.cc io.h mailbox.cc mailbox.h maildir.cc maildir-close.cc maildir-create.cc maildir-delete.cc maildir-expunge.cc maildir.h maildir-readcache.cc maildir-scan.cc maildir-scanfilesnames.cc maildir-select.cc maildir-updateflags.cc maildir-writecache.cc message.h maildirmessage.cc maildirmessage.h bincimapd-module.cc bincimapd-module.h mime.cc mime-getpart.cc mime.h mime-parsefull.cc mime-parseonlyheader.cc mime-printbody.cc mime-printdoc.cc mime-printheader.cc mime-utils.h operators.h operator-authenticate.cc operator-capability.cc operator-noop.cc operator-noop-pending.cc operator-login.cc operator-logout.cc operators.h operator-append.cc operator-examine.cc operator-select.cc operator-create.cc operator-delete.cc operator-list.cc operator-lsub.cc operator-rename.cc operator-status.cc operator-subscribe.cc operator-unsubscribe.cc operators.h operator-check.cc operator-close.cc operator-copy.cc operator-expunge.cc operator-fetch.cc operator-search.cc operator-store.cc pendingupdates.cc pendingupdates.h recursivedescent.cc recursivedescent.h regmatch.cc regmatch.h session.h session.cc session-initialize-bincimapd.cc status.cc status.h storage.cc storage.h tools.cc tools.h +bincimapd_SOURCES = address.cc address.h argparser.cc argparser.h authenticate.cc base64.cc base64.h bincimapd.cc broker.cc broker.h convert.cc convert.h depot.h depot.cc imapparser.cc imapparser.h io.cc io.h mailbox.cc mailbox.h maildir.cc maildir-close.cc maildir-create.cc maildir-delete.cc maildir-expunge.cc maildir.h maildir-readcache.cc maildir-scan.cc maildir-scanfilesnames.cc maildir-select.cc maildir-updateflags.cc maildir-writecache.cc message.h maildirmessage.cc maildirmessage.h mime.cc mime-getpart.cc mime.h mime-parsefull.cc mime-parseonlyheader.cc mime-printbody.cc mime-printdoc.cc mime-printheader.cc mime-utils.h operators.h operator-authenticate.cc operator-capability.cc operator-noop.cc operator-noop-pending.cc operator-login.cc operator-logout.cc operators.h operator-append.cc operator-examine.cc operator-select.cc operator-create.cc operator-delete.cc operator-list.cc operator-lsub.cc operator-rename.cc operator-status.cc operator-subscribe.cc operator-unsubscribe.cc operators.h operator-check.cc operator-close.cc operator-copy.cc operator-expunge.cc operator-fetch.cc operator-search.cc operator-store.cc pendingupdates.cc pendingupdates.h recursivedescent.cc recursivedescent.h regmatch.cc regmatch.h session.h session.cc session-initialize-bincimapd.cc status.cc status.h storage.cc storage.h tools.cc tools.h #-------------------------------------------------------------------------- bincimap_up_SOURCES = argparser.cc argparser.h authenticate.cc authenticate.h base64.cc base64.h bincimap-up.cc broker.cc broker.h convert.cc convert.h greeting.cc imapparser.cc imapparser.h io.cc io.h io-ssl.cc io-ssl.h operators.h operator-authenticate.cc operator-capability.cc operator-noop.cc operator-login.cc operator-logout.cc operator-starttls.cc recursivedescent.cc recursivedescent.h session.h session.cc session-initialize-bincimap-up.cc status.cc status.h storage.cc storage.h tools.cc tools.h #-------------------------------------------------------------------------- -bincimap_up_LDADD = @LIBSSL@ @LIBDL@ - -#-------------------------------------------------------------------------- -bincimapd_LDADD = @LIBDL@ +bincimap_up_LDADD = @LIBSSL@ #-------------------------------------------------------------------------- bincimapd_LDFLAGS = @STATIC@ -DBINCIMAPD diff --git a/src/bincimapd-module.cc b/src/bincimapd-module.cc @@ -1,156 +0,0 @@ -/* -*- Mode: c++; -*- */ -/* -------------------------------------------------------------------- - * Filename: - * bincimapd-module.cc - * - * Description: - * Implementation of loadable modules - * - * Authors: - * Eivind Kvedalen <eivind@kvedalen.name> - * - * Bugs: - * - * ChangeLog: - * - * -------------------------------------------------------------------- - * Copyright 2003 Eivind Kvedalen - * - * This program 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 2 of the License, or - * (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * -------------------------------------------------------------------- - */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#ifdef HAVE_DLSUPPORT -#include <dlfcn.h> -#endif - -#include "session.h" -#include "bincimapd-module.h" - -using namespace std; -using namespace Binc; - -//---------------------------------------------------------------------- -Module::Module(void) : handle(0), ref(0) -{ - ref = new int; - *ref = 1; -} - -//---------------------------------------------------------------------- -Module::Module(const Module & module) -{ - handle = module.handle; - ref = module.ref; - ++(*ref); -} - -//---------------------------------------------------------------------- -Module::Module &Module::operator=(const Module &module) -{ - if (&module != this) { - handle = module.handle; - ref = module.ref; - ++(*ref); - } - - return *this; -} - -//---------------------------------------------------------------------- -bool Module::open(const string &module) -{ -#ifdef HAVE_DLSUPPORT - handle = dlopen (module.size() == 0 ? 0 : module.c_str(), RTLD_NOW|RTLD_GLOBAL); -#endif - return (handle != 0); - -} - -//---------------------------------------------------------------------- -Module::~Module(void) -{ - --(*ref); - if (*ref == 0) { -#ifdef HAVE_DLSUPPORT - if (handle != 0) - dlclose(handle); -#endif - delete ref; - } -} - -//---------------------------------------------------------------------- -void *Module::getSymbol(const string &s) -{ - if (handle == 0) { - setLastError("Module not opened, dynamic loading unsupported."); - return 0; - } - - void *symbol = 0; -#ifdef HAVE_DLSUPPORT - symbol = dlsym(handle, s.c_str()); - if ((error = dlerror()) != 0) { - session.setLastError("Symbol " + s + " not found"); - return 0; - } -#endif - - return symbol; -} - -//---------------------------------------------------------------------- -void Module::setLastError(const string &err) -{ - error = err; -} - -//---------------------------------------------------------------------- -const string &Module::getLastError(void) const -{ - return error; -} - -//---------------------------------------------------------------------- -BincModule::BincModule(void) : Module(), loaded(false) -{ -} - -//---------------------------------------------------------------------- -BincModule::~BincModule(void) -{ - if (*ref == 1) - unload(); -} - -//---------------------------------------------------------------------- -void BincModule::load(BrokerFactory & bf) -{ - loadFunc load = (loadFunc)getSymbol("bincimap_module_load"); - load(bf); - loaded = true; -} - - -//---------------------------------------------------------------------- -void BincModule::unload(void) -{ - unloadFunc unload = (unloadFunc)getSymbol("bincimap_module_unload"); - unload(); -} diff --git a/src/bincimapd-module.h b/src/bincimapd-module.h @@ -1,78 +0,0 @@ -/* -*- Mode: c++; -*- */ -/* -------------------------------------------------------------------- - * Filename: - * bincimapd-module.cc - * - * Description: - * Implementation of loadable modules - * - * Authors: - * Eivind Kvedalen <eivind@kvedalen.name> - * - * Bugs: - * - * ChangeLog: - * - * -------------------------------------------------------------------- - * Copyright 2003 Eivind Kvedalen - * - * This program 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 2 of the License, or - * (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * -------------------------------------------------------------------- - */ -#ifndef _BINCIMAPD_MODULE_H_ -#define _BINCIMAPD_MODULE_H_ - -#include <string> -#include <vector> -#include "broker.h" - -namespace Binc { - - class Module { - private: - std::string error; - void * handle; - protected: - int * ref; - public: - Module(void); - Module(const Module &module); - Module &operator =(const Module &module); - ~Module(void); - - bool open(const std::string &module); - void * getSymbol(const std::string &s); - - const std::string &getLastError(void) const; - void setLastError(const std::string &err); - }; - - class BincModule : public Module { - bool loaded; - - typedef void (*loadFunc)(BrokerFactory &bf); - typedef void (*unloadFunc)(void); - - public: - BincModule(void); - ~BincModule(void); - - void load(BrokerFactory & bf); - void unload(void); - }; - -} - -#endif diff --git a/src/io.cc b/src/io.cc @@ -36,11 +36,6 @@ #endif #include <string> -#ifdef HAVE_OSTREAM -#include <ostream> -#else -#include <ostream.h> -#endif #include "session.h" #include "io.h" diff --git a/src/maildir-scan.cc b/src/maildir-scan.cc @@ -257,7 +257,18 @@ Maildir::ScanResult Maildir::scan(bool forceScan) // introduces a special case: we can not cache the old st_ctime // and st_mtime. the next time the mailbox is scanned, it must not // simply be skipped. :-) - if (filename.find("BincIMAP") == string::npos && ::time(0) <= mystat.st_mtime) { + + vector<MaildirMessage>::const_iterator newIt = newMessages.begin(); + bool ours = false; + for (; newIt != newMessages.end(); ++newIt) { + if ((filename == (*newIt).getUnique()) + && ((*newIt).getInternalFlags() & MaildirMessage::Committed)) { + ours = true; + break; + } + } + + if (!ours && ::time(0) <= mystat.st_mtime) { old_cur_st_mtime = (time_t) 0; old_cur_st_ctime = (time_t) 0; old_new_st_mtime = (time_t) 0; @@ -502,5 +513,6 @@ Maildir::ScanResult Maildir::scan(bool forceScan) } firstscan = false; + newMessages.clear(); return Success; } diff --git a/src/maildir.cc b/src/maildir.cc @@ -60,6 +60,9 @@ using namespace ::std; using namespace Binc; +// Used to generate the unique names for Maildir delivery +static int numDeliveries = 0; + //------------------------------------------------------------------------ Maildir::iterator::iterator(void) { @@ -506,16 +509,17 @@ bool Maildir::commitNewMessages(const string &mbox) vector<MaildirMessage>::iterator i = newMessages.begin(); map<MaildirMessage *, string> committedMessages; - char hostname[512]; - int hostnamelen = gethostname(hostname, sizeof(hostname)); - if (hostnamelen == -1 || hostnamelen == sizeof(hostname)) - strcpy(hostname, "localhost"); - struct timeval youngestFile = {0, 0}; bool abort = false; while (!abort && i != newMessages.end()) { MaildirMessage &m = *i; + + if (m.getInternalFlags() & MaildirMessage::Committed) + continue; + + m.setInternalFlag(MaildirMessage::Committed); + string safeName = m.getSafeName(); for (int attempt = 0; !abort && attempt < 1000; ++attempt) { @@ -523,12 +527,14 @@ bool Maildir::commitNewMessages(const string &mbox) gettimeofday(&tv, 0); youngestFile = tv; + // Generate Maildir conformant file name BincStream ssid; - ssid << (int) tv.tv_sec - << "." << (int) session.getPid() - << (attempt == 0 ? "" : ("_" + toString(attempt))) - << "_" << (int) tv.tv_usec - << (rand() % 0xffff) << "_BincIMAP." << session.getHostname(); + ssid << (int) tv.tv_sec << "." + << "R" << (int) rand() + << "M" << (int) tv.tv_usec + << "P" << session.getPid() + << "Q" << numDeliveries++ + << "." << session.getHostname(); BincStream ss; ss << mbox << "/new/" << ssid.str(); @@ -598,7 +604,7 @@ bool Maildir::commitNewMessages(const string &mbox) // cover the extremely unlikely event that another concurrent // Maildir accessor has just made a file with the same timestamp and - // random number by sleeping until the timestamp has changed before + // random number by spinning until the timestamp has changed before // moving the message into cur. struct timeval tv; gettimeofday(&tv, 0); @@ -630,7 +636,6 @@ bool Maildir::commitNewMessages(const string &mbox) } committedMessages.clear(); - newMessages.clear(); return true; } @@ -644,7 +649,6 @@ bool Maildir::rollBackNewMessages(void) unlink((*i).getSafeName().c_str()); newMessages.clear(); - return true; } @@ -678,12 +682,14 @@ bool Maildir::fastCopy(Message &m, Mailbox &desttype, struct timeval tv; gettimeofday(&tv, 0); + // Generate Maildir conformant file name BincStream ssid; - ssid << (int) tv.tv_sec - << "." << (int) session.getPid() - << (attempt == 0 ? "" : ("_" + toString(attempt))) - << "_" << (int) tv.tv_usec - << (rand() % 0xffff) << "_BincIMAP." << session.getHostname(); + ssid << (int) tv.tv_sec << "." + << "R" << (int) rand() + << "M" << (int) tv.tv_usec + << "P" << session.getPid() + << "Q" << numDeliveries++ + << "." << session.getHostname(); BincStream ss; ss << destname << "/tmp/" << ssid.str(); diff --git a/src/maildirmessage.h b/src/maildirmessage.h @@ -267,7 +267,8 @@ namespace Binc { Expunged = 0x01, FlagsChanged = 0x02, JustArrived = 0x04, - WasWrittenTo = 0x08 + WasWrittenTo = 0x08, + Committed = 0x10 }; protected: diff --git a/src/session-initialize-bincimapd.cc b/src/session-initialize-bincimapd.cc @@ -39,7 +39,6 @@ #include "broker.h" #include "maildir.h" -#include "bincimapd-module.h" #include "depot.h" #include "io-ssl.h" #include "io.h" @@ -56,8 +55,6 @@ using namespace Binc; extern char **environ; -vector<BincModule> modules; - namespace { //------------------------------------------------------------------------ void usage(char *name) @@ -248,25 +245,6 @@ bool Session::initialize(int argc, char *argv[]) session.setState(Session::AUTHENTICATED); - // Loadable modules - - // Not implemented yet -- use absolute paths for modules - // vector<string> tmp_mods; - // split(session.globalconfig["module path"], ":", tmp_mods); - -// string k, v; -// if (session.globalconfig.getFirstEntry(k, v)) { -// do { -// if (k.substr(0,14) == "define module ") { -// BincModule module; -// if (module.open(v)) -// modules.push_back(module); -// else -// logger << "Warning: " << module.getLastError() << endl; -// } -// } while (session.globalconfig.getNextEntry(k, v)); -// } - // Read timeout settings from global config idletimeout = atoi(session.globalconfig["Session"]["idle timeout"]); transfertimeout = atoi(session.globalconfig["Session"]["transfer timeout"]); diff --git a/src/session.cc b/src/session.cc @@ -433,6 +433,11 @@ const std::string &Session::getHostname(void) if (hostnamelen == -1 || hostnamelen == sizeof(hostnamec)) strcpy(hostnamec, "localhost"); hostnamec[511] = '\0'; + + char *c; + while ((c = strchr(hostnamec, '/')) != 0) *c = '\057'; + while ((c = strchr(hostnamec, ':')) != 0) *c = '\072'; + hostname = hostnamec; } diff --git a/src/storageparser.cc b/src/storageparser.cc @@ -1,1355 +0,0 @@ -/* A Bison parser, made from storageparser.y, by GNU bison 1.75. */ - -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. - - This program 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 2, or (at your option) - any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* If NAME_PREFIX is specified substitute the variables and functions - names. */ -#define yyparse storageparserparse -#define yylex storageparserlex -#define yyerror storageparsererror -#define yylval storageparserlval -#define yychar storageparserchar -#define yydebug storageparserdebug -#define yynerrs storageparsernerrs - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - LABELCHARS = 258, - QUOTED = 259, - HEX = 260 - }; -#endif -#define LABELCHARS 258 -#define QUOTED 259 -#define HEX 260 - - - - -/* Copy the first part of user declarations. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string> -#include <map> -#include <vector> - -#include "storage.h" -#include "base64.h" -#include "convert.h" - - namespace Binc { - - std::string label; - std::string label_char; - std::string section; - std::string astring; - std::string astring_sl; - std::string astrings; - std::string storage_erradd; - std::string storage_error; - std::string pair_first; - - std::map<std::string, std::string> aliastotext; - std::map<std::string, std::string> texttoalias; - - extern Storage *internal__storage; - - /* external declarations */ - extern char *storageparsertext; - extern std::string storage_quoted; - int yylex(); - int yyerror(char *); - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -#ifndef YYSTYPE -typedef int yystype; -# define YYSTYPE yystype -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -#ifndef YYLTYPE -typedef struct yyltype -{ - int first_line; - int first_column; - int last_line; - int last_column; -} yyltype; -# define YYLTYPE yyltype -# define YYLTYPE_IS_TRIVIAL 1 -#endif - -/* Copy the second part of user declarations. */ - - -/* Line 213 of /usr/share/bison/yacc.c. */ -#line 149 "storageparser.cc" - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAX) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - register YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 13 -#define YYLAST 38 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 13 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 21 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 29 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 41 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 260 - -#define YYTRANSLATE(X) \ - ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 7, 8, - 2, 12, 2, 6, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 9, 2, 10, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned char yyprhs[] = -{ - 0, 0, 3, 6, 8, 11, 13, 16, 18, 19, - 20, 28, 29, 30, 31, 39, 41, 42, 44, 45, - 46, 52, 54, 55, 56, 62, 65, 67, 69, 71 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = -{ - 14, 0, -1, 15, 16, -1, 16, -1, 15, 17, - -1, 17, -1, 16, 20, -1, 20, -1, -1, -1, - 6, 33, 18, 7, 33, 19, 8, -1, -1, -1, - -1, 25, 21, 9, 22, 24, 23, 10, -1, 26, - -1, -1, 3, -1, -1, -1, 26, 27, 11, 28, - 29, -1, 29, -1, -1, -1, 32, 30, 12, 31, - 32, -1, 32, 33, -1, 33, -1, 25, -1, 4, - -1, 5, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned char yyrline[] = -{ - 0, 77, 77, 78, 82, 83, 87, 88, 94, 105, - 92, 123, 133, 137, 122, 147, 148, 152, 160, 164, - 159, 168, 173, 183, 172, 196, 202, 210, 215, 220 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "LABELCHARS", "QUOTED", "HEX", "'?'", - "':'", "';'", "'{'", "'}'", "','", "'='", "$accept", "file", "aliases", - "sections", "alias", "@1", "@2", "section", "@3", "@4", "@5", - "o_pair_cl", "label", "pair_cl", "@6", "@7", "pair", "@8", "@9", - "astring_sl", "astring", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 63, 58, 59, 123, - 125, 44, 61 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 13, 14, 14, 15, 15, 16, 16, 18, 19, - 17, 21, 22, 23, 20, 24, 24, 25, 27, 28, - 26, 26, 30, 31, 29, 32, 32, 33, 33, 33 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 2, 1, 2, 1, 2, 1, 0, 0, - 7, 0, 0, 0, 7, 1, 0, 1, 0, 0, - 5, 1, 0, 0, 5, 2, 1, 1, 1, 1 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 0, 17, 0, 0, 0, 3, 5, 7, 11, 28, - 29, 27, 8, 1, 2, 4, 6, 0, 0, 12, - 0, 16, 9, 13, 15, 21, 22, 26, 0, 0, - 0, 0, 25, 10, 14, 19, 23, 0, 0, 20, - 24 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = -{ - -1, 3, 4, 5, 6, 18, 28, 7, 17, 21, - 29, 23, 11, 24, 30, 37, 25, 31, 38, 26, - 27 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -13 -static const yysigned_char yypact[] = -{ - 4, -13, 9, 3, 4, 5, -13, -13, -13, -13, - -13, -13, -13, -13, 5, -13, -13, -5, 2, -13, - 9, 9, -13, -13, 6, -13, 9, -13, 8, 10, - 11, 7, -13, -13, -13, -13, -13, 9, 9, -13, - 9 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = -{ - -13, -13, -13, 17, 19, -13, -13, -3, -13, -13, - -13, -13, 1, -13, -13, -13, -12, -13, -13, -11, - -2 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, parse error. */ -#define YYTABLE_NINF -19 -static const yysigned_char yytable[] = -{ - 12, 8, 16, 13, 19, 8, 8, 1, 1, 20, - 2, 16, 1, 9, 10, 8, 33, -18, 22, 36, - 34, 14, 35, 15, 32, 39, 0, 40, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 32 -}; - -static const yysigned_char yycheck[] = -{ - 2, 0, 5, 0, 9, 4, 5, 3, 3, 7, - 6, 14, 3, 4, 5, 14, 8, 11, 20, 12, - 10, 4, 11, 4, 26, 37, -1, 38, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 40 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 3, 6, 14, 15, 16, 17, 20, 25, 4, - 5, 25, 33, 0, 16, 17, 20, 21, 18, 9, - 7, 22, 33, 24, 26, 29, 32, 33, 19, 23, - 27, 30, 33, 8, 10, 11, 12, 28, 31, 29, - 32 -}; - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror ("syntax error: cannot back up"); \ - YYERROR; \ - } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.first_line = Rhs[1].first_line; \ - Current.first_column = Rhs[1].first_column; \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; -#endif - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#define YYLEX yylex () - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -#endif /* !YYDEBUG */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#if YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - register const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - register char *yyd = yydest; - register const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -#endif /* !YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*-----------------------------. -| Print this symbol on YYOUT. | -`-----------------------------*/ - -static void -#if defined (__STDC__) || defined (__cplusplus) -yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue) -#else -yysymprint (yyout, yytype, yyvalue) - FILE* yyout; - int yytype; - YYSTYPE yyvalue; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvalue; - - if (yytype < YYNTOKENS) - { - YYFPRINTF (yyout, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyout, yytoknum[yytype], yyvalue); -# endif - } - else - YYFPRINTF (yyout, "nterm %s (", yytname[yytype]); - - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyout, ")"); -} -#endif /* YYDEBUG. */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -#if defined (__STDC__) || defined (__cplusplus) -yydestruct (int yytype, YYSTYPE yyvalue) -#else -yydestruct (yytype, yyvalue) - int yytype; - YYSTYPE yyvalue; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvalue; - - switch (yytype) - { - default: - break; - } -} - - - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -# define YYPARSE_PARAM_DECL -# else -# define YYPARSE_PARAM_ARG YYPARSE_PARAM -# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -# endif -#else /* !YYPARSE_PARAM */ -# define YYPARSE_PARAM_ARG -# define YYPARSE_PARAM_DECL -#endif /* !YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -# ifdef YYPARSE_PARAM -int yyparse (void *); -# else -int yyparse (void); -# endif -#endif - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - -/* Number of parse errors so far. */ -int yynerrs; - - -int -yyparse (YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - - register int yystate; - register int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ - int yychar1 = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyoverflowlab; -# else - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - goto yyoverflowlab; - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; - - { - short *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with. */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more. */ - - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yychar1 = YYTRANSLATE (yychar); - - /* We have to keep this `#if YYDEBUG', since we use variables - which are defined only if `YYDEBUG' is set. */ - YYDPRINTF ((stderr, "Next token is ")); - YYDSYMPRINT ((stderr, yychar1, yylval)); - YYDPRINTF ((stderr, "\n")); - } - - /* If the proper action on seeing token YYCHAR1 is to reduce or to - detect an error, take that action. */ - yyn += yychar1; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %d (%s), ", - yychar, yytname[yychar1])); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables which - are defined only if `YYDEBUG' is set. */ - if (yydebug) - { - int yyi; - - YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", - yyn - 1, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - switch (yyn) - { - case 8: - { - if (aliastotext.find(pair_first) != aliastotext.end()) { - // FIXME: ignore for now - // throw StorageException("alias already defined for " + pair_first); - } - - pair_first = astring; - astring = ""; -} - break; - - case 9: - { - if (texttoalias.find(astring) != texttoalias.end() - && astring != pair_first) { - // FIXME: ignore for now - // throw StorageException("an alias already points to " + astring); - } - - aliastotext[pair_first] = astring; - texttoalias[astring] = pair_first; - - astring = ""; - pair_first = ""; -} - break; - - case 11: - { - if (aliastotext.find(label) != aliastotext.end()) - section = aliastotext[label]; - else - section = label; - - label = ""; - storage_erradd = "expected '{'"; -} - break; - - case 12: - { - storage_erradd = "expected comma seperated list of pairs"; -} - break; - - case 13: - { - storage_erradd = "expected '}'"; -} - break; - - case 14: - { - storage_erradd = ""; -} - break; - - case 17: - { - label = storageparsertext; -} - break; - - case 18: - { - storage_erradd = "expected ','"; -} - break; - - case 19: - { - storage_erradd = "expected pair"; -} - break; - - case 22: - { - storage_erradd = "expected '='"; - - if (aliastotext.find(astring_sl) != aliastotext.end()) - pair_first = aliastotext[astring_sl]; - else - pair_first = astring_sl; - astring_sl = ""; -} - break; - - case 23: - { - storage_erradd = "expected second string in a pair"; -} - break; - - case 24: - { - internal__storage->setSection(section); - internal__storage->insert(pair_first, astring_sl); - astring_sl = ""; - pair_first = ""; -} - break; - - case 25: - { - astring_sl += " "; - astring_sl += astring; - astring = ""; -} - break; - - case 26: - { - astring_sl = astring; - astring = ""; -} - break; - - case 27: - { - astring = label; - label = ""; -} - break; - - case 28: - { - astring = storage_quoted; - storage_quoted = ""; -} - break; - - case 29: - { - std::string tmp = storageparsertext; - if (tmp.size() > 2) - tmp = tmp.substr(1, tmp.size() - 2); - astring = Binc::fromHex(tmp); -} - break; - - - } - -/* Line 1016 of /usr/share/bison/yacc.c. */ -#line 1132 "storageparser.cc" - - yyvsp -= yylen; - yyssp -= yylen; - - -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - char *yymsg; - int yyx, yycount; - - yycount = 0; - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("parse error, unexpected ") + 1; - yysize += yystrlen (yytname[yytype]); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "parse error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - - if (yycount < 5) - { - yycount = 0; - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); - yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - const char *yyq = ! yycount ? ", expecting " : " or "; - yyp = yystpcpy (yyp, yyq); - yyp = yystpcpy (yyp, yytname[yyx]); - yycount++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("parse error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("parse error"); - } - goto yyerrlab1; - - -/*----------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action. | -`----------------------------------------------------*/ -yyerrlab1: - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - /* Return failure if at end of input. */ - if (yychar == YYEOF) - { - /* Pop the error token. */ - YYPOPSTACK; - /* Pop the rest of the stack. */ - while (yyssp > yyss) - { - YYDPRINTF ((stderr, "Error: popping ")); - YYDSYMPRINT ((stderr, - yystos[*yyssp], - *yyvsp)); - YYDPRINTF ((stderr, "\n")); - yydestruct (yystos[*yyssp], *yyvsp); - YYPOPSTACK; - } - YYABORT; - } - - YYDPRINTF ((stderr, "Discarding token %d (%s).\n", - yychar, yytname[yychar1])); - yydestruct (yychar1, yylval); - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - YYDPRINTF ((stderr, "Error: popping ")); - YYDSYMPRINT ((stderr, - yystos[*yyssp], *yyvsp)); - YYDPRINTF ((stderr, "\n")); - - yydestruct (yystos[yystate], *yyvsp); - yyvsp--; - yystate = *--yyssp; - - -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "Error: state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif - } - - if (yyn == YYFINAL) - YYACCEPT; - - YYDPRINTF ((stderr, "Shifting error token, ")); - - *++yyvsp = yylval; - - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - - - -#include "lex.storageparser.c" - -} -