This commit is contained in:
Graeme Walker 2003-11-06 12:00:00 +00:00
parent 6798a91d8b
commit def9081f44
105 changed files with 5265 additions and 2802 deletions

View File

@ -4,7 +4,7 @@ Graeme Walker <graeme_walker@users.sourceforge.net>
Credits Credits
------- -------
The source in "glib/gmd5.cpp" is "derived from the RSA Data The source in "glib/md5c.c" and "glib/md5.h" is "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" by incorporating Security, Inc. MD5 Message-Digest Algorithm" by incorporating
the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" which the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" which
is "Copyright (C) 1991, RSA Data Security, Inc. All rights reserved". is "Copyright (C) 1991, RSA Data Security, Inc. All rights reserved".

View File

@ -1,10 +1,14 @@
E-MailRelay Change Log E-MailRelay Change Log
====================== ======================
1.1.2 -> 1.1.3 1.1.2 -> 1.2
-------------- ------------
* Fix for dangling reference bug, seen after "quit" command on Windows. * The "--filter" and "--verifier" arguments interpreted as command-lines; spaces in executable paths now need escaping.
* The "--interface" switch applies to outgoing connections too.
* New "--client-filter" switch to do synchronous message processing before sending.
* Keeps authentication after a "rset" command. * Keeps authentication after a "rset" command.
* Fix for dangling reference bug, seen after "quit" command on Windows.
* JavaScript examples in the documentation.
1.1.1 -> 1.1.2 1.1.1 -> 1.1.2
-------------- --------------

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -13,74 +13,94 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = . top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -88,7 +108,22 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
# #
# #
@ -105,13 +140,15 @@ DIST_SOURCES =
DATA = $(e_doc_DATA) DATA = $(e_doc_DATA)
RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
uninstall-info-recursive all-recursive install-data-recursive \ ps-recursive install-info-recursive uninstall-info-recursive \
install-exec-recursive installdirs-recursive install-recursive \ all-recursive install-data-recursive install-exec-recursive \
uninstall-recursive check-recursive installcheck-recursive installdirs-recursive install-recursive uninstall-recursive \
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ check-recursive installcheck-recursive
Makefile.in NEWS acinclude.m4 aclocal.m4 config.h.in configure \ DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \
configure.ac depcomp install-sh missing mkinstalldirs COPYING ChangeLog INSTALL Makefile.am NEWS acinclude.m4 \
aclocal.m4 config.h.in configure configure.ac depcomp \
install-sh missing mkinstalldirs
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)
all: config.h all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive $(MAKE) $(AM_MAKEFLAGS) all-recursive
@ -224,10 +261,17 @@ tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \ list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ETAGS = etags ETAGS = etags
ETAGSFLAGS = ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@ -243,9 +287,15 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP) $(TAGS_FILES) $(LISP)
tags=; \ tags=; \
here=`pwd`; \ here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
else \
include_option=--include; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \ list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \ if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ test -f $$subdir/TAGS && \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \ fi; \
done; \ done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
@ -258,13 +308,28 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique $$tags $$unique
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS: GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = . top_distdir = .
@ -276,12 +341,19 @@ am__remove_distdir = \
&& rm -fr $(distdir); }; } && rm -fr $(distdir); }; }
GZIP_ENV = --best GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print
distdir: $(DISTFILES) distdir: $(DISTFILES)
$(am__remove_distdir) $(am__remove_distdir)
mkdir $(distdir) mkdir $(distdir)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -334,12 +406,13 @@ distcheck: dist
$(am__remove_distdir) $(am__remove_distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
chmod -R a-w $(distdir); chmod a+w $(distdir) chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/=build mkdir $(distdir)/_build
mkdir $(distdir)/=inst mkdir $(distdir)/_inst
chmod a-w $(distdir) chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& cd $(distdir)/=build \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \ && cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) dvi \
@ -347,23 +420,39 @@ distcheck: dist
&& $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|| { echo "ERROR: files left after uninstall:" ; \ distuninstallcheck \
find $$dc_install_base -type f -print ; \ && chmod -R a-w "$$dc_install_base" \
exit 1; } >&2 ) \ && ({ \
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
&& rm -f $(distdir).tar.gz \ && rm -f $(distdir).tar.gz \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir) $(am__remove_distdir)
@echo "$(distdir).tar.gz is ready for distribution" | \ @echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x' sed 'h;s/./=/g;p;x;p;x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean distcleancheck: distclean
if test '$(srcdir)' = . ; then \ @if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \ exit 1 ; \
fi fi
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after distclean:" ; \ || { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \ $(distcleancheck_listfiles) ; \
exit 1; } >&2 exit 1; } >&2
check-am: all-am check-am: all-am
@ -393,7 +482,7 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -404,6 +493,7 @@ clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive dvi: dvi-recursive
@ -426,22 +516,32 @@ installcheck-am:
maintainer-clean: maintainer-clean-recursive maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf autom4te.cache -rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-e_docDATA uninstall-info-am uninstall-local uninstall-am: uninstall-e_docDATA uninstall-info-am uninstall-local
uninstall-info: uninstall-info-recursive uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
clean-generic clean-recursive dist dist-all dist-gzip distcheck \ clean-generic clean-recursive ctags ctags-recursive dist \
distclean distclean-generic distclean-hdr distclean-recursive \ dist-all dist-gzip distcheck distclean distclean-generic \
distclean-tags distcleancheck distdir dvi dvi-am dvi-recursive \ distclean-hdr distclean-recursive distclean-tags distcleancheck \
info info-am info-recursive install install-am install-data \ distdir distuninstallcheck dvi dvi-am dvi-recursive info \
info-am info-recursive install install-am install-data \
install-data-am install-data-recursive install-e_docDATA \ install-data-am install-data-recursive install-e_docDATA \
install-exec install-exec-am install-exec-recursive \ install-exec install-exec-am install-exec-recursive \
install-info install-info-am install-info-recursive install-man \ install-info install-info-am install-info-recursive install-man \
@ -449,9 +549,10 @@ uninstall-info: uninstall-info-recursive
installdirs installdirs-am installdirs-recursive \ installdirs installdirs-am installdirs-recursive \
maintainer-clean maintainer-clean-generic \ maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-recursive tags tags-recursive uninstall \ mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \
uninstall-am uninstall-e_docDATA uninstall-info-am \ ps-recursive tags tags-recursive uninstall uninstall-am \
uninstall-info-recursive uninstall-local uninstall-recursive uninstall-e_docDATA uninstall-info-am uninstall-info-recursive \
uninstall-local uninstall-recursive
changelog.gz: ChangeLog changelog.gz: ChangeLog
if test -n "$(GZIP)" ; then $(GZIP) -c $(top_srcdir)/ChangeLog > changelog.tmp && mv changelog.tmp changelog.gz ; fi if test -n "$(GZIP)" ; then $(GZIP) -c $(top_srcdir)/ChangeLog > changelog.tmp && mv changelog.tmp changelog.gz ; fi

233
aclocal.m4 vendored
View File

@ -1,6 +1,6 @@
# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- # generated automatically by aclocal 1.7.8 -*- Autoconf -*-
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -214,7 +214,7 @@ AC_DEFUN([FHS_COMPLIANCE],
# This macro actually does too much some checks are only needed if # This macro actually does too much some checks are only needed if
# your package does certain things. But this isn't really a big deal. # your package does certain things. But this isn't really a big deal.
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@ -232,16 +232,9 @@ AC_DEFUN([FHS_COMPLIANCE],
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA. # 02111-1307, USA.
# serial 8 # serial 10
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be AC_PREREQ([2.54])
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
AC_PREREQ([2.52])
# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
# the ones we care about. # the ones we care about.
@ -267,6 +260,16 @@ if test "`cd $srcdir && pwd`" != "`pwd`" &&
AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package. # Define the identity of the package.
dnl Distinguish between old-style and new-style calls. dnl Distinguish between old-style and new-style calls.
m4_ifval([$2], m4_ifval([$2],
@ -274,8 +277,8 @@ m4_ifval([$2],
AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])], AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl [_AM_SET_OPTIONS([$1])dnl
AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],, _AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
@ -296,19 +299,41 @@ AM_PROG_INSTALL_STRIP
# some platforms. # some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([no-dependencies],, _AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_][CC], [AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)], [_AM_DEPENDENCIES(CC)],
[define([AC_PROG_][CC], [define([AC_PROG_CC],
defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_][CXX], AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)], [_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_][CXX], [define([AC_PROG_CXX],
defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
]) ])
]) ])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$1 | $1:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# Copyright 2002 Free Software Foundation, Inc. # Copyright 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@ -329,14 +354,14 @@ AC_PROVIDE_IFELSE([AC_PROG_][CXX],
# ---------------------------- # ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been # Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y. # generated from the m4 files accompanying Automake X.Y.
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
# AM_SET_CURRENT_AUTOMAKE_VERSION # AM_SET_CURRENT_AUTOMAKE_VERSION
# ------------------------------- # -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced. # Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.6.3])]) [AM_AUTOMAKE_VERSION([1.7.8])])
# Helper functions for option handling. -*- Autoconf -*- # Helper functions for option handling. -*- Autoconf -*-
@ -622,9 +647,42 @@ fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_SUBST([INSTALL_STRIP_PROGRAM])])
# serial 4 -*- Autoconf -*- # -*- Autoconf -*-
# Copyright (C) 2003 Free Software Foundation, Inc.
# Copyright 1999, 2000, 2001 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 1
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# serial 5 -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -685,18 +743,32 @@ AC_CACHE_CHECK([dependency style of $depcc],
# using a relative directory. # using a relative directory.
cp "$am_depcomp" conftest.dir cp "$am_depcomp" conftest.dir
cd conftest.dir cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi fi
for depmode in $am_compiler_list; do for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may # We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines. # overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler. # This happens at least with the AIX C compiler.
echo '#include "conftest.h"' > conftest.c : > sub/conftest.c
echo 'int i;' > conftest.h for i in 1 2 3 4 5 6; do
echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf echo '#include "conftst'$i'.h"' >> sub/conftest.c
: > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in case $depmode in
nosideeffect) nosideeffect)
@ -714,13 +786,20 @@ AC_CACHE_CHECK([dependency style of $depcc],
# mode. It turns out that the SunPro C++ compiler does not properly # mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this. # handle `-M -o', and we need to detect this.
if depmode=$depmode \ if depmode=$depmode \
source=conftest.c object=conftest.o \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=conftest.Po tmpdepfile=conftest.TPo \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
grep conftest.h conftest.Po > /dev/null 2>&1 && >/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
am_cv_$1_dependencies_compiler_type=$depmode # icc doesn't choke on unknown options, it will just issue warnings
break # (even with -Werror). So we grep stderr for any message
# that says an option was ignored.
if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi fi
done done
@ -731,6 +810,9 @@ else
fi fi
]) ])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
]) ])
@ -739,16 +821,8 @@ AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
# Choose a directory name for dependency files. # Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES # This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR], AC_DEFUN([AM_SET_DEPDIR],
[rm -f .deps 2>/dev/null [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
mkdir .deps 2>/dev/null AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
if test -d .deps; then
DEPDIR=.deps
else
# MS-DOS does not allow filenames that begin with a dot.
DEPDIR=_deps
fi
rmdir .deps 2>/dev/null
AC_SUBST([DEPDIR])
]) ])
@ -850,7 +924,9 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
]) ])
# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- # Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -875,8 +951,9 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
AC_DEFUN([AM_MAKE_INCLUDE], AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make} [am_make=${MAKE-make}
cat > confinc << 'END' cat > confinc << 'END'
doit: am__doit:
@echo done @echo done
.PHONY: am__doit
END END
# If we don't find an include directive, just comment out the code. # If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make]) AC_MSG_CHECKING([for style of include used by $am_make])
@ -890,7 +967,7 @@ echo "include confinc" > confmf
# In particular we don't look at `^make:' because GNU make might # In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which # be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'. # case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include am__include=include
am__quote= am__quote=
_am_result=GNU _am_result=GNU
@ -904,9 +981,9 @@ if test "$am__include" = "#"; then
_am_result=BSD _am_result=BSD
fi fi
fi fi
AC_SUBST(am__include) AC_SUBST([am__include])
AC_SUBST(am__quote) AC_SUBST([am__quote])
AC_MSG_RESULT($_am_result) AC_MSG_RESULT([$_am_result])
rm -f confinc confmf rm -f confinc confmf
]) ])
@ -950,7 +1027,7 @@ else
fi fi
AC_CONFIG_COMMANDS_PRE( AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([conditional \"$1\" was never defined. AC_MSG_ERROR([conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]) Usually this means the macro was only invoked conditionally.])
fi])]) fi])])
@ -977,58 +1054,6 @@ AC_PREREQ([2.52])
# serial 6 # serial 6
# When config.status generates a header, we must update the stamp-h file. # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
# This file resides in the same directory as the config header AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# that is generated. We must strip everything past the first ":",
# and everything past the last "/".
# _AM_DIRNAME(PATH)
# -----------------
# Like AS_DIRNAME, only do it during macro expansion
AC_DEFUN([_AM_DIRNAME],
[m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
m4_if(regexp([$1], [^/.*]), -1,
[.],
patsubst([$1], [^\(/\).*], [\1])),
patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
])# _AM_DIRNAME
# The stamp files are numbered to have different names.
# We could number them on a directory basis, but that's additional
# complications, let's have a unique counter.
m4_define([_AM_STAMP_Count], [0])
# _AM_STAMP(HEADER)
# -----------------
# The name of the stamp file for HEADER.
AC_DEFUN([_AM_STAMP],
[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
[:.*])))/stamp-h[]_AM_STAMP_Count])
# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
# ------------------------------------------------------------
# We used to try to get a real timestamp in stamp-h. But the fear is that
# that will cause unnecessary cvs conflicts.
AC_DEFUN([_AM_CONFIG_HEADER],
[# Add the stamp file to the list of files AC keeps track of,
# along with our hook.
AC_CONFIG_HEADERS([$1],
[# update the timestamp
echo 'timestamp for $1' >"_AM_STAMP([$1])"
$2],
[$3])
])# _AM_CONFIG_HEADER
# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
# --------------------------------------------------------------
AC_DEFUN([AM_CONFIG_HEADER],
[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
])# AM_CONFIG_HEADER

View File

@ -18,11 +18,11 @@
## ##
# #
EXTRA_DIST = emailrelay-doxygen-filter.sh_ emailrelay-test.sh_ emailrelay-soak.sh_ emailrelay.sh_ txt2html.sh_ txt2mu.sh_ mu2html.sh_ expand.sh_ emailrelay-notify.sh_ emailrelay-resubmit.sh_ emailrelay-deliver.sh_ emailrelay-process.sh_ EXTRA_DIST = emailrelay-doxygen-filter.sh_ emailrelay-test.sh_ emailrelay-soak.sh_ emailrelay.sh_ txt2html.sh_ txt2mu.sh_ mu2html.sh_ expand.sh_ emailrelay-notify.sh_ emailrelay-resubmit.sh_ emailrelay-deliver.sh_ emailrelay-process.sh_ emailrelay-runperl.js
noinst_SCRIPTS = emailrelay-doxygen-filter.sh emailrelay-test.sh emailrelay-soak.sh noinst_SCRIPTS = emailrelay-doxygen-filter.sh emailrelay-test.sh emailrelay-soak.sh
e_init_SCRIPTS = emailrelay e_init_SCRIPTS = emailrelay
e_examples_DATA = emailrelay-process.sh emailrelay-notify.sh emailrelay-deliver.sh emailrelay-resubmit.sh e_examples_DATA = emailrelay-process.sh emailrelay-notify.sh emailrelay-deliver.sh emailrelay-resubmit.sh emailrelay-runperl.js
work_scripts = txt2mu.sh mu2html.sh expand.sh txt2html.sh emailrelay.sh work_scripts = txt2mu.sh mu2html.sh expand.sh txt2html.sh emailrelay.sh
CLEANFILES = $(noinst_SCRIPTS) $(e_init_SCRIPTS) $(e_examples_DATA) $(work_scripts) CLEANFILES = $(noinst_SCRIPTS) $(e_init_SCRIPTS) $(e_examples_DATA) $(work_scripts)
@ -44,6 +44,7 @@ install-data-local: install-e_examplesDATA install-e_initSCRIPTS
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-resubmit.sh chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-resubmit.sh
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-deliver.sh chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-deliver.sh
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-process.sh chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-process.sh
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-runperl.js
uninstall-local: uninstall-local:
-rmdir $(DESTDIR)$(e_examplesdir) 2>/dev/null -rmdir $(DESTDIR)$(e_examplesdir) 2>/dev/null

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -16,74 +16,94 @@
# #
# #
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .. top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -91,13 +111,28 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
EXTRA_DIST = emailrelay-doxygen-filter.sh_ emailrelay-test.sh_ emailrelay-soak.sh_ emailrelay.sh_ txt2html.sh_ txt2mu.sh_ mu2html.sh_ expand.sh_ emailrelay-notify.sh_ emailrelay-resubmit.sh_ emailrelay-deliver.sh_ emailrelay-process.sh_ EXTRA_DIST = emailrelay-doxygen-filter.sh_ emailrelay-test.sh_ emailrelay-soak.sh_ emailrelay.sh_ txt2html.sh_ txt2mu.sh_ mu2html.sh_ expand.sh_ emailrelay-notify.sh_ emailrelay-resubmit.sh_ emailrelay-deliver.sh_ emailrelay-process.sh_ emailrelay-runperl.js
noinst_SCRIPTS = emailrelay-doxygen-filter.sh emailrelay-test.sh emailrelay-soak.sh noinst_SCRIPTS = emailrelay-doxygen-filter.sh emailrelay-test.sh emailrelay-soak.sh
e_init_SCRIPTS = emailrelay e_init_SCRIPTS = emailrelay
e_examples_DATA = emailrelay-process.sh emailrelay-notify.sh emailrelay-deliver.sh emailrelay-resubmit.sh e_examples_DATA = emailrelay-process.sh emailrelay-notify.sh emailrelay-deliver.sh emailrelay-resubmit.sh emailrelay-runperl.js
work_scripts = txt2mu.sh mu2html.sh expand.sh txt2html.sh emailrelay.sh work_scripts = txt2mu.sh mu2html.sh expand.sh txt2html.sh emailrelay.sh
CLEANFILES = $(noinst_SCRIPTS) $(e_init_SCRIPTS) $(e_examples_DATA) $(work_scripts) CLEANFILES = $(noinst_SCRIPTS) $(e_init_SCRIPTS) $(e_examples_DATA) $(work_scripts)
@ -106,6 +141,7 @@ TESTS = emailrelay-test.sh
SUFFIXES = .sh_ .sh SUFFIXES = .sh_ .sh
subdir = bin subdir = bin
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
@ -114,7 +150,7 @@ SCRIPTS = $(e_init_SCRIPTS) $(noinst_SCRIPTS)
DIST_SOURCES = DIST_SOURCES =
DATA = $(e_examples_DATA) DATA = $(e_examples_DATA)
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
all: all-am all: all-am
.SUFFIXES: .SUFFIXES:
@ -166,9 +202,12 @@ uninstall-e_examplesDATA:
tags: TAGS tags: TAGS
TAGS: TAGS:
ctags: CTAGS
CTAGS:
check-TESTS: $(TESTS) check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; \ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \ srcdir=$(srcdir); export srcdir; \
list='$(TESTS)'; \ list='$(TESTS)'; \
if test -n "$$list"; then \ if test -n "$$list"; then \
@ -200,6 +239,9 @@ check-TESTS: $(TESTS)
echo "FAIL: $$tst"; \ echo "FAIL: $$tst"; \
;; \ ;; \
esac; \ esac; \
else \
skip=`expr $$skip + 1`; \
echo "SKIP: $$tst"; \
fi; \ fi; \
done; \ done; \
if test "$$failed" -eq 0; then \ if test "$$failed" -eq 0; then \
@ -215,9 +257,24 @@ check-TESTS: $(TESTS)
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
fi; \ fi; \
fi; \ fi; \
dashes=`echo "$$banner" | sed s/./=/g`; \ dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
skipped="($$skip tests were not run)"; \
test `echo "$$skipped" | wc -c` -gt `echo "$$banner" | wc -c` && \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -gt `echo "$$banner" | wc -c` && \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
echo "$$dashes"; \ echo "$$dashes"; \
echo "$$banner"; \ echo "$$banner"; \
test -n "$$skipped" && echo "$$skipped"; \
test -n "$$report" && echo "$$report"; \
echo "$$dashes"; \ echo "$$dashes"; \
test "$$failed" -eq 0; \ test "$$failed" -eq 0; \
else :; fi else :; fi
@ -227,7 +284,13 @@ top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -254,7 +317,6 @@ all-am: Makefile $(SCRIPTS) $(DATA)
installdirs: installdirs:
$(mkinstalldirs) $(DESTDIR)$(e_initdir) $(DESTDIR)$(e_examplesdir) $(mkinstalldirs) $(DESTDIR)$(e_initdir) $(DESTDIR)$(e_examplesdir)
install: install-am install: install-am
install-exec: install-exec-am install-exec: install-exec-am
install-data: install-data-am install-data: install-data-am
@ -275,7 +337,7 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -285,7 +347,7 @@ clean: clean-am
clean-am: clean-generic mostlyclean-am clean-am: clean-generic mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-am: clean-am distclean-generic
dvi: dvi-am dvi: dvi-am
@ -308,13 +370,21 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-e_examplesDATA uninstall-e_initSCRIPTS \ uninstall-am: uninstall-e_examplesDATA uninstall-e_initSCRIPTS \
uninstall-info-am uninstall-local uninstall-info-am uninstall-local
@ -325,8 +395,8 @@ uninstall-am: uninstall-e_examplesDATA uninstall-e_initSCRIPTS \
install-exec install-exec-am install-info install-info-am \ install-exec install-exec-am install-info install-info-am \
install-man install-strip installcheck installcheck-am \ install-man install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \ installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic uninstall uninstall-am \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
uninstall-e_examplesDATA uninstall-e_initSCRIPTS \ uninstall-am uninstall-e_examplesDATA uninstall-e_initSCRIPTS \
uninstall-info-am uninstall-local uninstall-info-am uninstall-local
@ -343,6 +413,7 @@ install-data-local: install-e_examplesDATA install-e_initSCRIPTS
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-resubmit.sh chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-resubmit.sh
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-deliver.sh chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-deliver.sh
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-process.sh chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-process.sh
chmod ugo+x $(DESTDIR)$(e_examplesdir)/emailrelay-runperl.js
uninstall-local: uninstall-local:
-rmdir $(DESTDIR)$(e_examplesdir) 2>/dev/null -rmdir $(DESTDIR)$(e_examplesdir) 2>/dev/null

85
bin/emailrelay-runperl.js Normal file
View File

@ -0,0 +1,85 @@
//
// Copyright (C) 2001-2003 Graeme Walker <graeme_walker@users.sourceforge.net>
//
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ===
//
// emailrelay-runperl.js
//
// An example JavaScript wrapper that runs a perl script
// for E-MailRelay. The perl script's standard input
// will the be the e-mail's content file. The perl script
// should process this to its standard output, and
// terminate with a zero exit code.
//
// Eg:
// emailrelay --as-server --filter "cscript.exe //nologo emailrelay-runperl.js"
//
// Uses CMD.EXE which may be not be available on some
// versions of Windows.
//
// Edit the next two lines as necessary, but avoid spaces in paths.
//
var cfg_perl="perl -S -T -w"
var cfg_perl_script="spamassassin"
// parse our command line
var args = WScript.Arguments
var filename = args(0)
// prepare a command using CMD.EXE to do file redirection
var cmd_in = "\"" + filename + "\""
var cmd_out = "\"" + filename + ".tmp\""
var cmd_err = "\"" + filename + ".err\""
var cmd_perl = "cmd /c " + cfg_perl + " " + cfg_perl_script
var cmd = cmd_perl + " < " + cmd_in + " > " + cmd_out + " 2> " + cmd_err
// run the command
var sh = WScript.CreateObject("WScript.Shell")
var rc = sh.Run( cmd , 0 , true )
// check the file redirection
var fs = WScript.CreateObject("Scripting.FileSystemObject")
if( !fs.FileExists(filename+".tmp") || !fs.FileExists(filename+".err") )
{
WScript.Echo("<<file redirection error>>")
WScript.Quit( 2 )
}
// success or failure
if( rc == 0 )
{
fs.DeleteFile( filename )
fs.MoveFile( filename + ".tmp" , filename )
fs.DeleteFile( filename + ".err" )
WScript.Quit( 0 )
}
else
{
fs.DeleteFile( filename + ".tmp" )
var error = fs.OpenTextFile( filename + ".err" , 1 )
if( ! error.AtEndOfStream )
{
var reason = error.ReadLine()
WScript.Echo( "<<" + reason + ">>" )
}
error.Close()
fs.DeleteFile( filename + ".err" )
WScript.Quit( rc )
}

View File

@ -33,13 +33,17 @@
# #
# If this test takes more a minute then it has failed. # If this test takes more a minute then it has failed.
# #
# usage: emailrelay-test.sh [-v] [-d] [<exe-dir>] # usage: emailrelay-test.sh [-v] [-d] [-n] [<exe-dir>]
# -v use valgrind
# -d use --debug
# -n no cleanup
# #
# configuration # configuration
# #
use_valgrind="0" ; if test "${1}" = "-v" ; then use_valgrind="1" ; shift ; fi use_valgrind="0" ; if test "${1}" = "-v" ; then use_valgrind="1" ; shift ; fi
debug="" ; if test "${1}" = "-d" ; then debug="--debug" ; shift ; fi debug="" ; if test "${1}" = "-d" ; then debug="--debug" ; shift ; fi
no_cleanup="0" ; if test "${1}" = "-n" ; then no_cleanup="1" ; shift ; fi
exe_dir="../src/main" ; if test "${1}" != "" ; then exe_dir="${1}" ; fi exe_dir="../src/main" ; if test "${1}" != "" ; then exe_dir="${1}" ; fi
exe="${exe_dir}/emailrelay" exe="${exe_dir}/emailrelay"
poke="${exe_dir}/emailrelay-poke" poke="${exe_dir}/emailrelay-poke"
@ -84,8 +88,15 @@ Cleanup()
then then
grep "MailRelay-Reason" ${base_dir}/*/*envelope*bad > "${summary_log}" 2>/dev/null grep "MailRelay-Reason" ${base_dir}/*/*envelope*bad > "${summary_log}" 2>/dev/null
grep "." ${base_dir}/log-? >> "${summary_log}" 2>/dev/null grep "." ${base_dir}/log-? >> "${summary_log}" 2>/dev/null
if test "${use_valgrind}" -eq 1
then
grep "." ${base_dir}/valgrind.* >> "${summary_log}" 2>/dev/null
fi
ls -lR ${base_dir} >> "${summary_log}" 2>/dev/null ls -lR ${base_dir} >> "${summary_log}" 2>/dev/null
rm -rf ${base_dir} 2>/dev/null if test "${no_cleanup}" -eq 0
then
rm -rf ${base_dir} 2>/dev/null
fi
fi fi
} }
@ -117,7 +128,7 @@ RunClient()
log_="${3}" log_="${3}"
pidfile_="${4}" pidfile_="${4}"
${exe} --forward --no-daemon --dont-serve --log --no-syslog \ ${exe} ${debug} --forward --no-daemon --dont-serve --log --verbose --no-syslog \
--pid-file ${base_dir}/${pidfile_} \ --pid-file ${base_dir}/${pidfile_} \
--forward-to ${to_} --spool-dir ${base_dir}/${spool_} 2> ${base_dir}/${log_} --forward-to ${to_} --spool-dir ${base_dir}/${spool_} 2> ${base_dir}/${log_}
} }
@ -234,12 +245,13 @@ RunServer ${pp}05 ${pp}15 store-4 log-5 pid-5 "--poll 1 --forward-to localhost:$
RunServer ${pp}06 ${pp}16 store-6 log-6 pid-6 "--filter ${base_dir}/filter.sh" RunServer ${pp}06 ${pp}16 store-6 log-6 pid-6 "--filter ${base_dir}/filter.sh"
CreateMessages CreateMessages
RunClient localhost:${pp}01 store-1 log-c pid-5 RunClient localhost:${pp}01 store-1 log-c pid-7
RunPoke ${pp}12 log-p RunPoke ${pp}12 log-p
for i in 0 1 2 3 4 5 6 7 8 9 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do do
sleep 2 if test "${use_valgrind}" -eq 1 ; then sleep 50 ; fi
sleep 10
CheckResults store-6 CheckResults store-6
if test $? -eq 0 ; then break ; fi if test $? -eq 0 ; then break ; fi
done done

View File

@ -98,7 +98,7 @@ start_switches="--as-server --pid-file ${pid_file} `cat \"${cfg_file}\" 2>/dev/n
# #
# <style>_reset() -- initialise # <style>_reset() -- initialise
# <style>_cmd_stop() -- stop command # <style>_cmd_stop() -- stop command
# <style>_cmd_start() -- stop command # <style>_cmd_start() -- start command
# <style>_cmd_restarted() -- called after stop/start # <style>_cmd_restarted() -- called after stop/start
# <style>_cmd_status() -- status command # <style>_cmd_status() -- status command
# <style>_exit() -- exit with saved errno # <style>_exit() -- exit with saved errno

1553
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure script.
dnl dnl
AC_INIT(src/gsmtp/gsmtp.h) AC_INIT(src/gsmtp/gsmtp.h)
AM_INIT_AUTOMAKE(emailrelay,1.1.3) AM_INIT_AUTOMAKE(emailrelay,1.2)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
dnl === dnl ===

90
depcomp
View File

@ -1,7 +1,7 @@
#! /bin/sh #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects # depcomp - compile a program generating dependencies as side-effects
# Copyright 1999, 2000 Free Software Foundation, Inc. # Copyright 1999, 2000, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -172,19 +172,25 @@ sgi)
aix) aix)
# The C for AIX Compiler uses -M and outputs the dependencies # The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. This file always lives in the current directory. # in a .u file. In older versions, this file always lives in the
# Also, the AIX compiler puts `$object:' at the start of each line; # current directory. Also, the AIX compiler puts `$object:' at the
# $object doesn't have directory information. # start of each line; $object doesn't have directory information.
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` # Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u" tmpdepfile="$stripped.u"
outname="$stripped.o"
if test "$libtool" = yes; then if test "$libtool" = yes; then
"$@" -Wc,-M "$@" -Wc,-M
else else
"$@" -M "$@" -M
fi fi
stat=$? stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then : if test $stat -eq 0; then :
else else
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
@ -192,6 +198,7 @@ aix)
fi fi
if test -f "$tmpdepfile"; then if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'. # Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to # Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'. # `$object: dependent.h' and one to simply `dependent.h:'.
@ -206,6 +213,44 @@ aix)
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64) tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side # The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@ -240,8 +285,8 @@ tru64)
fi fi
if test -f "$tmpdepfile"; then if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a space and a tab in the []. # That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else else
echo "#dummy" > "$depfile" echo "#dummy" > "$depfile"
fi fi
@ -254,7 +299,7 @@ tru64)
dashmstdout) dashmstdout)
# Important note: in order to support this mode, a compiler *must* # Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o. # always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $? "$@" || exit $?
# Remove the call to Libtool. # Remove the call to Libtool.
@ -265,9 +310,7 @@ dashmstdout)
shift shift
fi fi
# Remove `-o $object'. We will use -o /dev/null later, # Remove `-o $object'.
# however we can't do the remplacement now because
# `-o $object' might simply not be used
IFS=" " IFS=" "
for arg for arg
do do
@ -287,7 +330,11 @@ dashmstdout)
done done
test -z "$dashmflag" && dashmflag=-M test -z "$dashmflag" && dashmflag=-M
"$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" # Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile" rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile" cat < "$tmpdepfile" > "$depfile"
tr ' ' ' tr ' ' '
@ -306,6 +353,13 @@ dashXmstdout)
makedepend) makedepend)
"$@" || exit $? "$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend # X makedepend
shift shift
cleared=no cleared=no
@ -318,7 +372,9 @@ makedepend)
case "$arg" in case "$arg" in
-D*|-I*) -D*|-I*)
set fnord "$@" "$arg"; shift ;; set fnord "$@" "$arg"; shift ;;
-*) # Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;; ;;
*) *)
set fnord "$@" "$arg"; shift ;; set fnord "$@" "$arg"; shift ;;
@ -339,7 +395,7 @@ makedepend)
cpp) cpp)
# Important note: in order to support this mode, a compiler *must* # Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout. # always write the preprocessed file to stdout.
"$@" || exit $? "$@" || exit $?
# Remove the call to Libtool. # Remove the call to Libtool.
@ -381,7 +437,7 @@ cpp)
msvisualcpp) msvisualcpp)
# Important note: in order to support this mode, a compiler *must* # Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o, # always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool. # because we must use -o when running libtool.
"$@" || exit $? "$@" || exit $?
IFS=" " IFS=" "

View File

@ -25,7 +25,7 @@ man_files_out=emailrelay.1.gz emailrelay-passwd.1.gz emailrelay-poke.1.gz emailr
html_files_in=doxygen_header.html html_files_in=doxygen_header.html
html_files_thru=index.html emailrelay-man.html $(stylesheet) html_files_thru=index.html emailrelay-man.html $(stylesheet)
html_files_out=readme.html developer.html reference.html userguide.html windows.html changelog.html html_files_out=readme.html developer.html reference.html userguide.html windows.html changelog.html
png_files=gsmtp-classes.png gnet-classes.png sequence-1.png sequence-2.png sequence-3.png sequence-4.png gnet-client.png gsmtp-serverprotocol.png gsmtp-scannerclient.png png_files=gsmtp-classes.png gnet-classes.png sequence-1.png sequence-2.png sequence-3.png sequence-4.png gnet-client.png gsmtp-serverprotocol.png gsmtp-scannerclient.png auth.png
EXTRA_DIST = $(man_files_in) $(txt_files) $(html_files_in) $(html_files_thru) $(png_files) EXTRA_DIST = $(man_files_in) $(txt_files) $(html_files_in) $(html_files_thru) $(png_files)
noinst_SCRIPTS = .dox noinst_SCRIPTS = .dox

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -16,74 +16,94 @@
# #
# #
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .. top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -91,7 +111,22 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
stylesheet = emailrelay.css stylesheet = emailrelay.css
txt_files = developer.txt reference.txt userguide.txt windows.txt txt_files = developer.txt reference.txt userguide.txt windows.txt
@ -100,7 +135,7 @@ man_files_out = emailrelay.1.gz emailrelay-passwd.1.gz emailrelay-poke.1.gz emai
html_files_in = doxygen_header.html html_files_in = doxygen_header.html
html_files_thru = index.html emailrelay-man.html $(stylesheet) html_files_thru = index.html emailrelay-man.html $(stylesheet)
html_files_out = readme.html developer.html reference.html userguide.html windows.html changelog.html html_files_out = readme.html developer.html reference.html userguide.html windows.html changelog.html
png_files = gsmtp-classes.png gnet-classes.png sequence-1.png sequence-2.png sequence-3.png sequence-4.png gnet-client.png gsmtp-serverprotocol.png gsmtp-scannerclient.png png_files = gsmtp-classes.png gnet-classes.png sequence-1.png sequence-2.png sequence-3.png sequence-4.png gnet-client.png gsmtp-serverprotocol.png gsmtp-scannerclient.png auth.png
EXTRA_DIST = $(man_files_in) $(txt_files) $(html_files_in) $(html_files_thru) $(png_files) EXTRA_DIST = $(man_files_in) $(txt_files) $(html_files_in) $(html_files_thru) $(png_files)
noinst_SCRIPTS = .dox noinst_SCRIPTS = .dox
@ -121,6 +156,7 @@ converter_helper2_src = $(top_srcdir)/bin/mu2html.sh_
converter_helper3 = $(top_builddir)/bin/expand.sh converter_helper3 = $(top_builddir)/bin/expand.sh
converter_helper3_src = $(top_srcdir)/bin/expand.sh_ converter_helper3_src = $(top_srcdir)/bin/expand.sh_
subdir = doc subdir = doc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
@ -129,7 +165,7 @@ SCRIPTS = $(noinst_SCRIPTS)
DIST_SOURCES = DIST_SOURCES =
DATA = $(e_doc_DATA) $(e_man1_DATA) DATA = $(e_doc_DATA) $(e_man1_DATA)
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
all: all-am all: all-am
.SUFFIXES: .SUFFIXES:
@ -179,13 +215,22 @@ uninstall-e_man1DATA:
tags: TAGS tags: TAGS
TAGS: TAGS:
ctags: CTAGS
CTAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .. top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -211,7 +256,6 @@ all-am: Makefile $(SCRIPTS) $(DATA)
installdirs: installdirs:
$(mkinstalldirs) $(DESTDIR)$(e_docdir) $(DESTDIR)$(e_man1dir) $(mkinstalldirs) $(DESTDIR)$(e_docdir) $(DESTDIR)$(e_man1dir)
install: install-am install: install-am
install-exec: install-exec-am install-exec: install-exec-am
install-data: install-data-am install-data: install-data-am
@ -232,7 +276,7 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -242,7 +286,7 @@ clean: clean-am
clean-am: clean-generic mostlyclean-am clean-am: clean-generic mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-am: clean-am distclean-generic
dvi: dvi-am dvi: dvi-am
@ -264,13 +308,21 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-e_docDATA uninstall-e_man1DATA uninstall-info-am \ uninstall-am: uninstall-e_docDATA uninstall-e_man1DATA uninstall-info-am \
uninstall-local uninstall-local
@ -281,8 +333,9 @@ uninstall-am: uninstall-e_docDATA uninstall-e_man1DATA uninstall-info-am \
install-exec-am install-info install-info-am install-man \ install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \ install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \ maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic uninstall uninstall-am uninstall-e_docDATA \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-e_man1DATA uninstall-info-am uninstall-local uninstall-e_docDATA uninstall-e_man1DATA uninstall-info-am \
uninstall-local
.txt.html: .txt.html:

BIN
doc/auth.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -70,6 +70,10 @@ server.
<DD> <DD>
Enables the administration interface and specifies its listening port number. Enables the administration interface and specifies its listening port number.
<DT><B>-Q,--admin-terminate </B>
<DD>
Enables the terminate command on the admin interface.
<DT><B>-q,--as-client </B><I>host:port</I> <DT><B>-q,--as-client </B><I>host:port</I>
<DD> <DD>
@ -86,6 +90,10 @@ Runs as a server: equivalent to <I>--log</I> <I>--close-stderr</I> <I>--postmast
<DD> <DD>
Enables authentication with remote server, using the given secrets file. Enables authentication with remote server, using the given secrets file.
<DT><B>-Y,--client-filter </B><I>program</I>
<DD>
Defines a mail processor program for when forwarding.
<DT><B>-e,--close-stderr </B> <DT><B>-e,--close-stderr </B>
<DD> <DD>
@ -113,7 +121,7 @@ Dont act as a server (usually used with <I>--forward</I>).
<DT><B>-z,--filter </B><I>program</I> <DT><B>-z,--filter </B><I>program</I>
<DD> <DD>
Defines a mail processor program. Defines a mail processor program for when storing.
<DT><B>-f,--forward </B> <DT><B>-f,--forward </B>
<DD> <DD>
@ -428,7 +436,7 @@ Graeme Walker, mailto:<A HREF="mailto:graeme_walker@users.sourceforge.net">graem
This document was created by This document was created by
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>, <A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR> using the manual pages.<BR>
Time: 14:14:01 GMT, September 07, 2003 Time: 21:06:55 GMT, November 06, 2003
</BODY> </BODY>
</HTML> </HTML>
<!-- Copyright (C) 2001-2003 Graeme Walker <graeme_walker@users.sourceforge.net>. All rights reserved. --> <!-- Copyright (C) 2001-2003 Graeme Walker <graeme_walker@users.sourceforge.net>. All rights reserved. -->

View File

@ -56,6 +56,9 @@ server.
.B \-a,--admin \fIadmin-port\fR .B \-a,--admin \fIadmin-port\fR
Enables the administration interface and specifies its listening port number. Enables the administration interface and specifies its listening port number.
.TP .TP
.B \-Q,--admin-terminate
Enables the terminate command on the admin interface.
.TP
.B \-q,--as-client \fIhost:port\fR .B \-q,--as-client \fIhost:port\fR
Runs as a client, forwarding spooled mail to <host>: equivalent to \fI--log\fR \fI--no-syslog\fR \fI--no-daemon\fR \fI--dont-serve\fR \fI--forward\fR \fI--forward-to\fR. Runs as a client, forwarding spooled mail to <host>: equivalent to \fI--log\fR \fI--no-syslog\fR \fI--no-daemon\fR \fI--dont-serve\fR \fI--forward\fR \fI--forward-to\fR.
.TP .TP
@ -68,6 +71,9 @@ Runs as a server: equivalent to \fI--log\fR \fI--close-stderr\fR \fI--postmaster
.B \-C,--client-auth \fIfile\fR .B \-C,--client-auth \fIfile\fR
Enables authentication with remote server, using the given secrets file. Enables authentication with remote server, using the given secrets file.
.TP .TP
.B \-Y,--client-filter \fIprogram\fR
Defines a mail processor program for when forwarding.
.TP
.B \-e,--close-stderr .B \-e,--close-stderr
Closes the standard error stream after start-up. Closes the standard error stream after start-up.
.TP .TP
@ -87,7 +93,7 @@ Dont listen for smtp connections (usually used with \fI--admin\fR).
Dont act as a server (usually used with \fI--forward\fR). Dont act as a server (usually used with \fI--forward\fR).
.TP .TP
.B \-z,--filter \fIprogram\fR .B \-z,--filter \fIprogram\fR
Defines a mail processor program. Defines a mail processor program for when storing.
.TP .TP
.B \-f,--forward .B \-f,--forward
Forwards stored mail on startup (requires \fI--forward-to\fR). Forwards stored mail on startup (requires \fI--forward-to\fR).

View File

@ -16,6 +16,9 @@ where <switch> is:
# --admin (-a) # --admin (-a)
Enables the administration interface and specifies its listening port number. Enables the administration interface and specifies its listening port number.
# --admin-terminate (-Q)
Enables the terminate command on the admin interface.
# --as-client (-q) # --as-client (-q)
Runs as a client, forwarding spooled mail to <host>: equivalent to "--log --no-syslog --no-daemon --dont-serve --forward --forward-to". Runs as a client, forwarding spooled mail to <host>: equivalent to "--log --no-syslog --no-daemon --dont-serve --forward --forward-to".
@ -28,6 +31,9 @@ where <switch> is:
# --client-auth (-C) # --client-auth (-C)
Enables authentication with remote server, using the given secrets file. Enables authentication with remote server, using the given secrets file.
# --client-filter (-Y)
Defines a mail processor program for when forwarding.
# --close-stderr (-e) # --close-stderr (-e)
Closes the standard error stream after start-up. Closes the standard error stream after start-up.
@ -47,7 +53,7 @@ where <switch> is:
Dont act as a server (usually used with --forward). Dont act as a server (usually used with --forward).
# --filter (-z) # --filter (-z)
Defines a mail processor program. Defines a mail processor program for when storing.
# --forward (-f) # --forward (-f)
Forwards stored mail on startup (requires --forward-to). Forwards stored mail on startup (requires --forward-to).
@ -233,17 +239,17 @@ Mail processing
--------------- ---------------
The "--filter" command-line switch allows you to specify a mail pre-processor The "--filter" command-line switch allows you to specify a mail pre-processor
program which operates on mail messages as they pass through the E-MailRelay program which operates on mail messages as they pass through the E-MailRelay
system. The mail pre-processor program is run as soon as the mail message has been system. The mail pre-processor program is run as soon as the mail message has
stored in the spool directory, with the full path of the content file specified been stored in the spool directory, with the full path of the content file added
on the command line. onto the end of the given command line.
For example, the following command will start a proxy server on port 10025 which For example, the following command will start a proxy server on port 10025 which
processes mail using the specified filter program, and then forwards the mail on processes mail using the specified filter program, and then forwards the mail on
to the system's default MTA (on port 25): to the system's default MTA (on port 25):
emailrelay --as-proxy localhost:smtp --port 10025 --no-syslog \ emailrelay --as-proxy localhost:smtp --port 10025 --no-syslog \
--filter ${HOME}/.emailrelay/filter \ --filter $HOME/.emailrelay/filter \
--spool-dir ${HOME}/.emailrelay/spool --spool-dir $HOME/.emailrelay/spool
The pre-processor program should terminate with an exit code of zero to indicate The pre-processor program should terminate with an exit code of zero to indicate
success, or a value between 1 and 99 to indicate failure. Exit codes between success, or a value between 1 and 99 to indicate failure. Exit codes between
@ -262,17 +268,18 @@ pre-processor is running, except the filename. But if the message is deleted
by the pre-processor then E-MailRelay will be upset, so to avoid the by the pre-processor then E-MailRelay will be upset, so to avoid the
error message use an exit code of 100. error message use an exit code of 100.
If the pre-processor program creates new messages in the spool directory then If the pre-processor program creates completely new messages in the spool
they may not be processed immediately, or they may be completely ignored. To get directory then they may not be processed immediately, or they may be completely
E-MailRelay to pick up new messages in the spool directory use the "--poll" ignored. To get E-MailRelay to pick up new messages in the spool directory use
switch, or run "emailrelay --as-client" from within the pre-processor program. the "--poll" switch, or run "emailrelay --as-client" from within the
pre-processor program.
As an example, the following shell script examines the client's IP address and As an example of a simple pre-processor this shell script examines the sending
conditionally dumps the message into "sendmail" (using the sendmail command-line client's IP address and conditionally passes the message into "sendmail" (using
interface rather than SMTP): the sendmail command-line interface rather than SMTP):
#!/bin/sh #!/bin/sh
# # filter.sh
content="${1}" content="${1}"
envelope="`echo \"${content}\" | sed 's/content/envelope.new/'`" envelope="`echo \"${content}\" | sed 's/content/envelope.new/'`"
ip="`awk '/MailRelay-Client:/ {print $2;exit}' \"${envelope}\"`" ip="`awk '/MailRelay-Client:/ {print $2;exit}' \"${envelope}\"`"
@ -286,20 +293,53 @@ interface rather than SMTP):
The first thing this script does is convert the path of the content file which The first thing this script does is convert the path of the content file which
it is given, into the corresponding envelope file. It then extracts the client's it is given, into the corresponding envelope file. It then extracts the client's
IP address out of the envelope file using "awk". If this matches then it pipes the IP address out of the envelope file using "awk". If this matches the fixed
message content into sendmail, deletes the message and exits with a value of 100. address then it pipes the message content into sendmail, deletes the message and
The exit value of 100 tells E-MailRelay to forget the message, and not to exits with a value of 100. The exit value of 100 tells E-MailRelay to forget the
complain about the files disappearing. message, and not to complain about the files disappearing.
For Windows this example can be rewritten in JavaScript:
// filter.js
var content = WScript.Arguments(0) ;
var envelope = content.substr(0,content.length-7) + "envelope.new" ;
var fs = WScript.CreateObject( "Scripting.FileSystemObject" ) ;
var ts = fs.OpenTextFile( envelope , 1 , false ) ;
var e = ts.ReadAll() ;
ts.Close() ;
var re = new RegExp( "MailRelay-Client: \(.*\)" ) ;
var ip = e.match(re)[1] ;
if( ip == "192.168.0.2" )
{
var sh = WScript.CreateObject( "Wscript.Shell" ) ;
sh.Run( "sendmail " + content ) ; // bogus
fs.DeleteFile( content ) ;
fs.DeleteFile( envelope ) ;
WScript.Quit( 100 )
}
WScript.Quit( 0 ) ;
Pre-processor programs written in JavaScript can be run with "cscript", using an
E-MailRelay command line with a "--filter" switch something like this (V1.1.3
or later):
--filter "c:/winnt/system32/cscript.exe \\nologo c:/program\ files/emailrelay/filter.js"
A more complex example script which does rot-13 masking is also provided in the A more complex example script which does rot-13 masking is also provided in the
distribution ("emailrelay-process.sh"). This does some simple MIME encoding, and distribution ("emailrelay-process.sh"). This does some simple MIME encoding, and
could be used as a template for more sophisticated message encryption. could be used as a template for more sophisticated message encryption.
There also a "--client-filter" switch that enables pre-processing of messages
just before they are forwarded, rather then when stored. But note that by then
it is too late to notify the SMTP client of any processing failures.
Some points to note when writing "--filter" programs: Some points to note when writing "--filter" programs:
* The standard input and output are not used; the content filename is passed on the command line. * The standard input and output are not used; the content filename is passed on the command line.
* Programs run with a reduced set of environment variables. * Programs run with a reduced set of environment variables.
* The E-MailRelay process is completely blocked while the "--filter" program runs. * The E-MailRelay process is completely blocked while the "--filter" program runs.
* E-MailRelay files use CR-LF line terminators, as required by the RFCs. * E-MailRelay files use CR-LF line terminators, as required by the RFCs.
* Windows JScript and VBScript programs must be run using "cscript".
* Windows Perl programs must be run from a batch file, or from a JScript/VBScript wrapper.
Address verification Address verification
-------------------- --------------------
@ -318,9 +358,7 @@ local host's fully qualified domain name, (5) the current "MAIL" command's "FROM
address or the empty string for the "VRFY" command, (6) the IP address of the address or the empty string for the "VRFY" command, (6) the IP address of the
client connection, (7) the authentication mechanism used by the client ("NONE" client connection, (7) the authentication mechanism used by the client ("NONE"
if trusted), and (8) either the authentication name or the fourth field from if trusted), and (8) either the authentication name or the fourth field from
authentication secrets file if a trusted IP address. Under Windows there is an authentication secrets file if a trusted IP address.
additional command line argument: (1) is the file descriptor which must be
used instead of stdout, (2) is the full address, etc.
For valid local mailbox addresses the verifier is expected to write two lines to For valid local mailbox addresses the verifier is expected to write two lines to
the standard output -- the full name associated with the mailbox, and the the standard output -- the full name associated with the mailbox, and the
@ -352,6 +390,7 @@ by connecting on a trusted IP address:
#!/bin/sh #!/bin/sh
# verifier.sh # verifier.sh
address="${1}"
host="$3" host="$3"
local_domain="$4" local_domain="$4"
auth_mechanism="$7" auth_mechanism="$7"
@ -364,6 +403,22 @@ by connecting on a trusted IP address:
echo "${address}" # again echo "${address}" # again
exit 1 # accept the recipient address exit 1 # accept the recipient address
or in JavaScript:
// verifier.js
var address = WScript.Arguments(0) ;
var host = WScript.Arguments(2) ;
var local_domain = WScript.Arguments(3) ;
var auth_mechanism = WScript.Arguments(6) ;
if( auth_mechanism == "NONE" && host != local_domain )
{
WScript.Echo( "cannot relay without authentication" ) ;
WScript.Quit( 2 ) ;
}
WScript.Echo( address ) ;
WScript.Echo( address ) ;
WScript.Quit( 1 ) ;
If this verifier script is used with a suitable "--server-auth" file then it can If this verifier script is used with a suitable "--server-auth" file then it can
be used to prevent open relay without restricting authenticated clients. be used to prevent open relay without restricting authenticated clients.
@ -508,44 +563,6 @@ from a particular IP address is allowed. This type of POP-before-SMTP
authentication can be done outside the E-MailRelay system by POP/IMAP utilities authentication can be done outside the E-MailRelay system by POP/IMAP utilities
such as "fetchmail". such as "fetchmail".
Application notes
-----------------
# *Mutt* [http://www.mutt.org]
Mutt can be configured to use the E-MailRelay 'submit' program rather than
"sendmail" with an entry in the ".muttrc" file like this:
set sendmail="/usr/local/libexec/emailrelay-submit"
or
set sendmail="/usr/sbin/emailrelay-submit"
This puts the messages in the E-MailRelay spool-directory, but note that in
proxy mode they will be ignored unless you use "--poll". Or you could use
"--admin" plus "flush"/"emailrelay-poke".
# *Spam Assassin* [http://spamassassin.taint.org]
The E-MailRelay server can use Spam Assassin to mark potential spam by having
a small shell script which calls spamassassin's "spamc" program installed
as the E-MailRelay mail pre-processor (using the "--filter" command-line switch).
Your "--filter" shell script would look something like this:
#!/bin/sh
tmp="/tmp/`basename $0`.$$.tmp"
pre="dos2unix"
post="unix2dos"
${pre} < ${1} | spamc > ${tmp}
if test $? -eq 0 ; then ${post} < ${tmp} > ${1} ; fi
rm -f ${tmp} 2>/dev/null
exit 0
This just pipes the content file into "spamc", using "dos2unix" to remove
carriage-returns. The output is saved in a temporary file, and then put back
into the content file using "unix2dos" to restore the carriage-returns.
Files and directories Files and directories
--------------------- ---------------------
Following a normal build from source, a "make install" puts files in the Following a normal build from source, a "make install" puts files in the

View File

@ -311,7 +311,7 @@ variable "GLOGOUTPUT_FILE" can be defined as the name of a log file.
Preventing open mail relay Preventing open mail relay
-------------------------- --------------------------
If you are running E-MailRelay as a server with a permanent connection to the If you are running E-MailRelay as a server with a permanent connection to the
Internet it is important to prevent open mail relay. By default public mail Internet it is important to prevent open mail relay. By default open mail
relaying is not possible because E-MailRelay does not accept IP connections from relaying is not possible because E-MailRelay does not accept IP connections from
remote clients. However, if the "--remote-clients" switch is used then you need remote clients. However, if the "--remote-clients" switch is used then you need
to be more careful. One option is to require all clients to authenticate, by to be more careful. One option is to require all clients to authenticate, by
@ -328,6 +328,53 @@ line in the secrets file. To complete the solution you must have an address
verifier script ("--verifier") which rejects remote addresses if the client has verifier script ("--verifier") which rejects remote addresses if the client has
not authenticated. Again, refer to the reference guide for further details. not authenticated. Again, refer to the reference guide for further details.
SpamAssassin
------------
The E-MailRelay server can use *Spam Assassin* [http://spamassassin.org] to mark
potential spam by having a small shell script which calls "spamassassin"
installed as the E-MailRelay mail pre-processor using the "--filter" command-line
switch.
Your "--filter" shell script could look something like this:
#!/bin/sh
tmp="/tmp/`basename $0`.$$.tmp"
awk '{sub("\r$","");print}' "${1}" | spamassassin --local | awk '{print $0 "\r"}' > $tmp && mv $tmp "${1}"
rm -f $tmp 2>/dev/null
exit 0
This just pipes the message content file into "spamassassin", using "awk" to
remove carriage-returns. The output is saved in a temporary file, and then put
back into the content file, using "awk" again to restore carriage-returns.
To delete spam altogether, rather than just marking it, you could add
"--exit-code" to the spamassassin command line and deal with messages according
to the exit code:
#!/bin/sh
awk '{sub("\r$","");print}' "${1}" | spamassassin --local --exit-code > /dev/null
if test $? -ne 0
then
# spam...
content="${1}"
envelope="`echo \"${content}\" | sed 's/content/envelope.new/'`"
rm -f "${envelope}" "${content}"
exit 100 # <= tell E-MailRelay that the files are gone
fi
exit 0
On Windows there is less of a problem with carriage returns, but because
"spamassassin" is a perl script it takes a bit of work to call it correctly.
An example JavaScript wrapper called "emailrelay-runperl.js" is included in
the distribution that by default calls "spamassassin".
Try an E-MailRelay command line like this:
emailrelay --as-server --filter "cscript //nologo c:/program\ files/emailrelay/emailrelay-runperl.js"
But note that you may have to add explicit paths if perl or spamassassin are not
on your path.

View File

@ -1,10 +1,10 @@
Summary: Simple e-mail message transfer agent using SMTP Summary: Simple e-mail message transfer agent using SMTP
Name: emailrelay Name: emailrelay
Version: 1.1.3 Version: 1.2
Release: 1 Release: 1
Copyright: GPL Copyright: GPL
Group: System Environment/Daemons Group: System Environment/Daemons
Source: http://emailrelay.sourceforge.net/.../emailrelay-src-1.1.3.tar.gz Source: http://emailrelay.sourceforge.net/.../emailrelay-src-1.2.tar.gz
BuildRoot: /tmp/emailrelay-install BuildRoot: /tmp/emailrelay-install
%define prefix /usr %define prefix /usr

View File

@ -1,19 +1,37 @@
#!/bin/sh #!/bin/sh
# #
# install - install a program, script, or datafile # install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
# #
# Copyright 1991 by the Massachusetts Institute of Technology # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
# #
# Permission to use, copy, modify, distribute, and sell this software and its # Copyright (C) 1994 X Consortium
# documentation for any purpose is hereby granted without fee, provided that #
# the above copyright notice appear in all copies and that both that # Permission is hereby granted, free of charge, to any person obtaining a copy
# copyright notice and this permission notice appear in supporting # of this software and associated documentation files (the "Software"), to
# documentation, and that the name of M.I.T. not be used in advertising or # deal in the Software without restriction, including without limitation the
# publicity pertaining to distribution of the software without specific, # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# written prior permission. M.I.T. makes no representations about the # sell copies of the Software, and to permit persons to whom the Software is
# suitability of this software for any purpose. It is provided "as is" # furnished to do so, subject to the following conditions:
# without express or implied warranty. #
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
# #
# Calling this script install-sh is preferred over install.sh, to prevent # Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it # `make' implicit rules from creating a file called install from it
@ -56,7 +74,7 @@ dir_arg=""
while [ x"$1" != x ]; do while [ x"$1" != x ]; do
case $1 in case $1 in
-c) instcmd="$cpprog" -c) instcmd=$cpprog
shift shift
continue;; continue;;
@ -79,7 +97,7 @@ while [ x"$1" != x ]; do
shift shift
continue;; continue;;
-s) stripcmd="$stripprog" -s) stripcmd=$stripprog
shift shift
continue;; continue;;
@ -106,7 +124,7 @@ done
if [ x"$src" = x ] if [ x"$src" = x ]
then then
echo "install: no input file specified" echo "$0: no input file specified" >&2
exit 1 exit 1
else else
: :
@ -115,8 +133,8 @@ fi
if [ x"$dir_arg" != x ]; then if [ x"$dir_arg" != x ]; then
dst=$src dst=$src
src="" src=""
if [ -d $dst ]; then if [ -d "$dst" ]; then
instcmd=: instcmd=:
chmodcmd="" chmodcmd=""
else else
@ -125,20 +143,20 @@ if [ x"$dir_arg" != x ]; then
else else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad # might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'. # if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ] if [ -f "$src" ] || [ -d "$src" ]
then then
: :
else else
echo "install: $src does not exist" echo "$0: $src does not exist" >&2
exit 1 exit 1
fi fi
if [ x"$dst" = x ] if [ x"$dst" = x ]
then then
echo "install: no destination specified" echo "$0: no destination specified" >&2
exit 1 exit 1
else else
: :
@ -147,16 +165,16 @@ else
# If destination is a directory, append the input filename; if your system # If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic # does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ] if [ -d "$dst" ]
then then
dst="$dst"/`basename $src` dst=$dst/`basename "$src"`
else else
: :
fi fi
fi fi
## this sed command emulates the dirname command ## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists. # Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script # this part is taken from Noah Friedman's mkinstalldirs script
@ -165,69 +183,73 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
if [ ! -d "$dstdir" ]; then if [ ! -d "$dstdir" ]; then
defaultIFS=' defaultIFS='
' '
IFS="${IFS-${defaultIFS}}" IFS="${IFS-$defaultIFS}"
oIFS="${IFS}" oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason. # Some sh's can't handle IFS=/ for some reason.
IFS='%' IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}" IFS=$oIFS
pathcomp='' pathcomp=''
while [ $# -ne 0 ] ; do while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}" pathcomp=$pathcomp$1
shift shift
if [ ! -d "${pathcomp}" ] ; if [ ! -d "$pathcomp" ] ;
then then
$mkdirprog "${pathcomp}" $mkdirprog "$pathcomp"
else else
: :
fi fi
pathcomp="${pathcomp}/" pathcomp=$pathcomp/
done done
fi fi
if [ x"$dir_arg" != x ] if [ x"$dir_arg" != x ]
then then
$doit $instcmd $dst && $doit $instcmd "$dst" &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else else
# If we're going to rename the final executable, determine the name now. # If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ] if [ x"$transformarg" = x ]
then then
dstfile=`basename $dst` dstfile=`basename "$dst"`
else else
dstfile=`basename $dst $transformbasename | dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename sed $transformarg`$transformbasename
fi fi
# don't allow the sed command to completely eliminate the filename # don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ] if [ x"$dstfile" = x ]
then then
dstfile=`basename $dst` dstfile=`basename "$dst"`
else else
: :
fi fi
# Make a temp file name in the proper directory. # Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/#inst.$$# dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up temp files at exit.
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
# Move or copy the file name to the temp name # Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp && $doit $instcmd "$src" "$dsttmp" &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits # and set any options; do chmod last to preserve setuid bits
@ -235,17 +257,38 @@ else
# ignore errors from any of these, just make sure not to ignore # ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command. # errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
# Now remove or move aside any old file at destination location. We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons. In this case, the final cleanup
# might fail but the new file should still install successfully.
{
if [ -f "$dstdir/$dstfile" ]
then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
{
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit
}
else
:
fi
} &&
# Now rename the file to the real destination. # Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi && fi &&
# The final little trick to "correctly" pass the exit status to the exit trap.
exit 0 {
(exit 0); exit
}

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -13,74 +13,94 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .. top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -88,22 +108,39 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
# #
# #
SUBDIRS = gcc2.95 msvc6.0 sunpro5 SUBDIRS = gcc2.95 msvc6.0 sunpro5
subdir = lib subdir = lib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
DIST_SOURCES = DIST_SOURCES =
RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
uninstall-info-recursive all-recursive install-data-recursive \ ps-recursive install-info-recursive uninstall-info-recursive \
install-exec-recursive installdirs-recursive install-recursive \ all-recursive install-data-recursive install-exec-recursive \
uninstall-recursive check-recursive installcheck-recursive installdirs-recursive install-recursive uninstall-recursive \
DIST_COMMON = Makefile.am Makefile.in check-recursive installcheck-recursive
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive all: all-recursive
@ -169,10 +206,17 @@ tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \ list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ETAGS = etags ETAGS = etags
ETAGSFLAGS = ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@ -188,9 +232,15 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP) $(TAGS_FILES) $(LISP)
tags=; \ tags=; \
here=`pwd`; \ here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
else \
include_option=--include; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \ list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \ if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ test -f $$subdir/TAGS && \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \ fi; \
done; \ done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@ -203,20 +253,41 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique $$tags $$unique
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS: GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .. top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -274,7 +345,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -284,7 +355,7 @@ clean: clean-recursive
clean-am: clean-generic mostlyclean-am clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive dvi: dvi-recursive
@ -306,31 +377,39 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-recursive maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
clean-generic clean-recursive distclean distclean-generic \ clean-generic clean-recursive ctags ctags-recursive distclean \
distclean-recursive distclean-tags distdir dvi dvi-am \ distclean-generic distclean-recursive distclean-tags distdir \
dvi-recursive info info-am info-recursive install install-am \ dvi dvi-am dvi-recursive info info-am info-recursive install \
install-data install-data-am install-data-recursive \ install-am install-data install-data-am install-data-recursive \
install-exec install-exec-am install-exec-recursive \ install-exec install-exec-am install-exec-recursive \
install-info install-info-am install-info-recursive install-man \ install-info install-info-am install-info-recursive install-man \
install-recursive install-strip installcheck installcheck-am \ install-recursive install-strip installcheck installcheck-am \
installdirs installdirs-am installdirs-recursive \ installdirs installdirs-am installdirs-recursive \
maintainer-clean maintainer-clean-generic \ maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-recursive tags tags-recursive uninstall \ mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \
uninstall-am uninstall-info-am uninstall-info-recursive \ ps-recursive tags tags-recursive uninstall uninstall-am \
uninstall-recursive uninstall-info-am uninstall-info-recursive uninstall-recursive
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -16,74 +16,94 @@
# #
# #
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../.. top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -91,15 +111,31 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
EXTRA_DIST = iostream limits sstream xlocale EXTRA_DIST = iostream limits sstream xlocale
subdir = lib/gcc2.95 subdir = lib/gcc2.95
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
DIST_SOURCES = DIST_SOURCES =
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
all: all-am all: all-am
.SUFFIXES: .SUFFIXES:
@ -112,13 +148,22 @@ uninstall-info-am:
tags: TAGS tags: TAGS
TAGS: TAGS:
ctags: CTAGS
CTAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../.. top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -143,7 +188,6 @@ check: check-am
all-am: Makefile all-am: Makefile
installdirs: installdirs:
install: install-am install: install-am
install-exec: install-exec-am install-exec: install-exec-am
install-data: install-data-am install-data: install-data-am
@ -163,7 +207,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -173,7 +217,7 @@ clean: clean-am
clean-am: clean-generic mostlyclean-am clean-am: clean-generic mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-am: clean-am distclean-generic
dvi: dvi-am dvi: dvi-am
@ -195,13 +239,21 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic distclean \ .PHONY: all all-am check check-am clean clean-generic distclean \
@ -210,7 +262,8 @@ uninstall-am: uninstall-info-am
install-exec-am install-info install-info-am install-man \ install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \ install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \ maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic uninstall uninstall-am uninstall-info-am mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -16,74 +16,94 @@
# #
# #
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../.. top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -91,15 +111,31 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
EXTRA_DIST = cstdio cstdlib cstring ctime cmath EXTRA_DIST = cstdio cstdlib cstring ctime cmath
subdir = lib/msvc6.0 subdir = lib/msvc6.0
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
DIST_SOURCES = DIST_SOURCES =
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
all: all-am all: all-am
.SUFFIXES: .SUFFIXES:
@ -112,13 +148,22 @@ uninstall-info-am:
tags: TAGS tags: TAGS
TAGS: TAGS:
ctags: CTAGS
CTAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../.. top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -143,7 +188,6 @@ check: check-am
all-am: Makefile all-am: Makefile
installdirs: installdirs:
install: install-am install: install-am
install-exec: install-exec-am install-exec: install-exec-am
install-data: install-data-am install-data: install-data-am
@ -163,7 +207,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -173,7 +217,7 @@ clean: clean-am
clean-am: clean-generic mostlyclean-am clean-am: clean-generic mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-am: clean-am distclean-generic
dvi: dvi-am dvi: dvi-am
@ -195,13 +239,21 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic distclean \ .PHONY: all all-am check check-am clean clean-generic distclean \
@ -210,7 +262,8 @@ uninstall-am: uninstall-info-am
install-exec-am install-info install-info-am install-man \ install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \ install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \ maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic uninstall uninstall-am uninstall-info-am mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -13,74 +13,94 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../.. top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -88,17 +108,33 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
# #
# #
EXTRA_DIST = xar EXTRA_DIST = xar
subdir = lib/sunpro5 subdir = lib/sunpro5
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
DIST_SOURCES = DIST_SOURCES =
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
all: all-am all: all-am
.SUFFIXES: .SUFFIXES:
@ -111,13 +147,22 @@ uninstall-info-am:
tags: TAGS tags: TAGS
TAGS: TAGS:
ctags: CTAGS
CTAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../.. top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -142,7 +187,6 @@ check: check-am
all-am: Makefile all-am: Makefile
installdirs: installdirs:
install: install-am install: install-am
install-exec: install-exec-am install-exec: install-exec-am
install-data: install-data-am install-data: install-data-am
@ -162,7 +206,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -172,7 +216,7 @@ clean: clean-am
clean-am: clean-generic mostlyclean-am clean-am: clean-generic mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-am: clean-am distclean-generic
dvi: dvi-am dvi: dvi-am
@ -194,13 +238,21 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic distclean \ .PHONY: all all-am check check-am clean clean-generic distclean \
@ -209,7 +261,8 @@ uninstall-am: uninstall-info-am
install-exec-am install-info install-info-am install-man \ install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \ install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \ maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic uninstall uninstall-am uninstall-info-am mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Common stub for a few missing GNU programs while installing. # Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@ -165,7 +165,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
WARNING: \`$1' is needed, and you do not seem to have it handy on your WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the system. You might have modified some files without having the
proper tools for further handling them. proper tools for further handling them.
You can get \`$1Help2man' as part of \`Autoconf' from any GNU You can get \`$1' as part of \`Autoconf' from any GNU
archive site." archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
@ -326,7 +326,7 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments.
WARNING: \`$1' is needed, and you do not seem to have it handy on your WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file, proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program." some other package would contain this missing \`$1' program."
exit 1 exit 1

View File

@ -12,18 +12,29 @@ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments # process command line arguments
while test $# -gt 0 ; do while test $# -gt 0 ; do
case "${1}" in case $1 in
-h | --help | --h* ) # -h for help -h | --help | --h*) # -h for help
echo "${usage}" 1>&2; exit 0 ;; echo "$usage" 1>&2
-m ) # -m PERM arg exit 0
shift ;;
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } -m) # -m PERM arg
dirmode="${1}" shift
shift ;; test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
-- ) shift; break ;; # stop option processing dirmode=$1
-* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option shift
* ) break ;; # first non-opt arg ;;
esac --) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done done
for file for file
@ -36,64 +47,65 @@ do
done done
case $# in case $# in
0) exit 0 ;; 0) exit 0 ;;
esac esac
case $dirmode in case $dirmode in
'') '')
if mkdir -p -- . 2>/dev/null; then if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*" echo "mkdir -p -- $*"
exec mkdir -p -- "$@" exec mkdir -p -- "$@"
fi ;; fi
*) ;;
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then *)
echo "mkdir -m $dirmode -p -- $*" if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
exec mkdir -m "$dirmode" -p -- "$@" echo "mkdir -m $dirmode -p -- $*"
fi ;; exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac esac
for file for file
do do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift shift
pathcomp= pathcomp=
for d for d
do do
pathcomp="$pathcomp$d" pathcomp="$pathcomp$d"
case "$pathcomp" in case $pathcomp in
-* ) pathcomp=./$pathcomp ;; -*) pathcomp=./$pathcomp ;;
esac esac
if test ! -d "$pathcomp"; then if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$? mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then if test ! -d "$pathcomp"; then
errstatus=$lasterr errstatus=$lasterr
else else
if test ! -z "$dirmode"; then if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp" echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
lasterr="" if test ! -z "$lasterr"; then
chmod "$dirmode" "$pathcomp" || lasterr=$? errstatus=$lasterr
fi
fi
fi
fi
if test ! -z "$lasterr"; then pathcomp="$pathcomp/"
errstatus=$lasterr done
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done done
exit $errstatus exit $errstatus
# Local Variables: # Local Variables:
# mode: shell-script # mode: shell-script
# sh-indentation: 3 # sh-indentation: 2
# End: # End:
# mkinstalldirs ends here # mkinstalldirs ends here

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -13,74 +13,94 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .. top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -88,23 +108,40 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
# #
# #
SUBDIRS = glib gnet gsmtp main win32 SUBDIRS = glib gnet gsmtp main win32
EXTRA_DIST = mingw.mak mingw-common.mak EXTRA_DIST = mingw.mak mingw-common.mak
subdir = src subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
DIST_SOURCES = DIST_SOURCES =
RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
uninstall-info-recursive all-recursive install-data-recursive \ ps-recursive install-info-recursive uninstall-info-recursive \
install-exec-recursive installdirs-recursive install-recursive \ all-recursive install-data-recursive install-exec-recursive \
uninstall-recursive check-recursive installcheck-recursive installdirs-recursive install-recursive uninstall-recursive \
DIST_COMMON = Makefile.am Makefile.in check-recursive installcheck-recursive
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive all: all-recursive
@ -170,10 +207,17 @@ tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \ list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ETAGS = etags ETAGS = etags
ETAGSFLAGS = ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@ -189,9 +233,15 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP) $(TAGS_FILES) $(LISP)
tags=; \ tags=; \
here=`pwd`; \ here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
else \
include_option=--include; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \ list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \ if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ test -f $$subdir/TAGS && \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \ fi; \
done; \ done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@ -204,20 +254,41 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique $$tags $$unique
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS: GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .. top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -275,7 +346,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -285,7 +356,7 @@ clean: clean-recursive
clean-am: clean-generic mostlyclean-am clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive dvi: dvi-recursive
@ -307,31 +378,39 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-recursive maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
clean-generic clean-recursive distclean distclean-generic \ clean-generic clean-recursive ctags ctags-recursive distclean \
distclean-recursive distclean-tags distdir dvi dvi-am \ distclean-generic distclean-recursive distclean-tags distdir \
dvi-recursive info info-am info-recursive install install-am \ dvi dvi-am dvi-recursive info info-am info-recursive install \
install-data install-data-am install-data-recursive \ install-am install-data install-data-am install-data-recursive \
install-exec install-exec-am install-exec-recursive \ install-exec install-exec-am install-exec-recursive \
install-info install-info-am install-info-recursive install-man \ install-info install-info-am install-info-recursive install-man \
install-recursive install-strip installcheck installcheck-am \ install-recursive install-strip installcheck installcheck-am \
installdirs installdirs-am installdirs-recursive \ installdirs installdirs-am installdirs-recursive \
maintainer-clean maintainer-clean-generic \ maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-recursive tags tags-recursive uninstall \ mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \
uninstall-am uninstall-info-am uninstall-info-recursive \ ps-recursive tags tags-recursive uninstall uninstall-am \
uninstall-recursive uninstall-info-am uninstall-info-recursive uninstall-recursive
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -58,6 +58,8 @@ libglib_a_SOURCES = \
gdirectory_unix.cpp \ gdirectory_unix.cpp \
gexception.cpp \ gexception.cpp \
gexception.h \ gexception.h \
gexe.cpp \
gexe.h \
gfile.cpp \ gfile.cpp \
gfile.h \ gfile.h \
gfile_unix.cpp \ gfile_unix.cpp \

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -13,74 +13,94 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../.. top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -88,7 +108,22 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
# #
# #
@ -134,6 +169,8 @@ libglib_a_SOURCES = \
gdirectory_unix.cpp \ gdirectory_unix.cpp \
gexception.cpp \ gexception.cpp \
gexception.h \ gexception.h \
gexe.cpp \
gexe.h \
gfile.cpp \ gfile.cpp \
gfile.h \ gfile.h \
gfile_unix.cpp \ gfile_unix.cpp \
@ -171,6 +208,7 @@ libglib_a_SOURCES = \
gtime.h gtime.h
subdir = src/glib subdir = src/glib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
@ -182,19 +220,15 @@ am_libglib_a_OBJECTS = garg.$(OBJEXT) garg_unix.$(OBJEXT) \
gcleanup_unix.$(OBJEXT) gdaemon_unix.$(OBJEXT) gdate.$(OBJEXT) \ gcleanup_unix.$(OBJEXT) gdaemon_unix.$(OBJEXT) gdate.$(OBJEXT) \
gdatetime.$(OBJEXT) gdatetime_unix.$(OBJEXT) \ gdatetime.$(OBJEXT) gdatetime_unix.$(OBJEXT) \
gdirectory.$(OBJEXT) gdirectory_unix.$(OBJEXT) \ gdirectory.$(OBJEXT) gdirectory_unix.$(OBJEXT) \
gexception.$(OBJEXT) gfile.$(OBJEXT) gfile_unix.$(OBJEXT) \ gexception.$(OBJEXT) gexe.$(OBJEXT) gfile.$(OBJEXT) \
gfs_unix.$(OBJEXT) ggetopt.$(OBJEXT) gidentity_unix.$(OBJEXT) \ gfile_unix.$(OBJEXT) gfs_unix.$(OBJEXT) ggetopt.$(OBJEXT) \
glog.$(OBJEXT) glogoutput.$(OBJEXT) glogoutput_unix.$(OBJEXT) \ gidentity_unix.$(OBJEXT) glog.$(OBJEXT) glogoutput.$(OBJEXT) \
gmd5_rsa.$(OBJEXT) gpath.$(OBJEXT) gpidfile.$(OBJEXT) \ glogoutput_unix.$(OBJEXT) gmd5_rsa.$(OBJEXT) gpath.$(OBJEXT) \
gprocess_unix.$(OBJEXT) groot.$(OBJEXT) gslot.$(OBJEXT) \ gpidfile.$(OBJEXT) gprocess_unix.$(OBJEXT) groot.$(OBJEXT) \
gstr.$(OBJEXT) gtime.$(OBJEXT) gslot.$(OBJEXT) gstr.$(OBJEXT) gtime.$(OBJEXT)
libglib_a_OBJECTS = $(am_libglib_a_OBJECTS) libglib_a_OBJECTS = $(am_libglib_a_OBJECTS)
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/garg.Po ./$(DEPDIR)/garg_unix.Po \ @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/garg.Po ./$(DEPDIR)/garg_unix.Po \
@ -204,9 +238,9 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ ./$(DEPDIR)/gdatetime_unix.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gdatetime_unix.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gdirectory.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gdirectory.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gdirectory_unix.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gdirectory_unix.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gexception.Po ./$(DEPDIR)/gfile.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gexception.Po ./$(DEPDIR)/gexe.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gfile_unix.Po ./$(DEPDIR)/gfs_unix.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gfile.Po ./$(DEPDIR)/gfile_unix.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/ggetopt.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gfs_unix.Po ./$(DEPDIR)/ggetopt.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gidentity_unix.Po ./$(DEPDIR)/glog.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gidentity_unix.Po ./$(DEPDIR)/glog.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/glogoutput.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/glogoutput.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/glogoutput_unix.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/glogoutput_unix.Po \
@ -220,14 +254,12 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
CXXLD = $(CXX) CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@ -o $@
CXXFLAGS = @CXXFLAGS@
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC) CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libglib_a_SOURCES) DIST_SOURCES = $(libglib_a_SOURCES)
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
SOURCES = $(libglib_a_SOURCES) SOURCES = $(libglib_a_SOURCES)
all: all-am all: all-am
@ -263,6 +295,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdirectory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdirectory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdirectory_unix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdirectory_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexception.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexception.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexe.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile_unix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfs_unix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfs_unix.Po@am__quote@
@ -280,26 +313,35 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gstr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gstr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtime.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.cpp.o: .cpp.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
$(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCXX_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
.cpp.obj: .cpp.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
$(CXXCOMPILE) -c -o $@ `cygpath -w $<` @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
CXXDEPMODE = @CXXDEPMODE@ @am__fastdepCXX_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
uninstall-info-am: uninstall-info-am:
ETAGS = etags ETAGS = etags
ETAGSFLAGS = ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@ -325,20 +367,41 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique $$tags $$unique
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS: GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../.. top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -363,7 +426,6 @@ check: check-am
all-am: Makefile $(LIBRARIES) all-am: Makefile $(LIBRARIES)
installdirs: installdirs:
install: install-am install: install-am
install-exec: install-exec-am install-exec: install-exec-am
install-data: install-data-am install-data: install-data-am
@ -383,7 +445,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -393,9 +455,10 @@ clean: clean-am
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -rf ./$(DEPDIR)
distclean-am: clean-am distclean-compile distclean-depend \ -rm -f Makefile
distclean-generic distclean-tags distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am dvi: dvi-am
@ -416,25 +479,33 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \ .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES distclean distclean-compile \ clean-noinstLIBRARIES ctags distclean distclean-compile \
distclean-depend distclean-generic distclean-tags distdir dvi \ distclean-generic distclean-tags distdir dvi dvi-am info \
dvi-am info info-am install install-am install-data \ info-am install install-am install-data install-data-am \
install-data-am install-exec install-exec-am install-info \ install-exec install-exec-am install-info install-info-am \
install-info-am install-man install-strip installcheck \ install-man install-strip installcheck installcheck-am \
installcheck-am installdirs maintainer-clean \ installdirs maintainer-clean maintainer-clean-generic \
maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
mostlyclean-generic tags uninstall uninstall-am \ ps ps-am tags uninstall uninstall-am uninstall-info-am
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -89,6 +89,7 @@ void G::Arg::parseCore( const std::string & command_line )
protect( s ) ; protect( s ) ;
G::Str::splitIntoTokens( s , m_array , " " ) ; G::Str::splitIntoTokens( s , m_array , " " ) ;
unprotect( m_array ) ; unprotect( m_array ) ;
dequote( m_array ) ;
} }
void G::Arg::protect( std::string & s ) void G::Arg::protect( std::string & s )
@ -120,6 +121,20 @@ void G::Arg::unprotect( StringArray & array )
} }
} }
void G::Arg::dequote( StringArray & array )
{
// remove quotes if first and last characters
char qq = '\"' ;
for( StringArray::iterator p = array.begin() ; p != array.end() ; ++p )
{
std::string & s = *p ;
if( s.length() > 1U && s.at(0U) == qq && s.at(s.length()-1U) == qq )
{
s = s.substr(1U,s.length()-2U) ;
}
}
}
bool G::Arg::contains( const std::string & sw , size_t sw_args , bool cs ) const bool G::Arg::contains( const std::string & sw , size_t sw_args , bool cs ) const
{ {
return find( cs , sw , sw_args , NULL ) ; return find( cs , sw , sw_args , NULL ) ;

View File

@ -121,8 +121,9 @@ private:
void setPrefix() ; void setPrefix() ;
static bool match( bool , const std::string & , const std::string & ) ; static bool match( bool , const std::string & , const std::string & ) ;
void parseCore( const std::string & ) ; void parseCore( const std::string & ) ;
void protect( std::string & ) ; static void protect( std::string & ) ;
void unprotect( StringArray & ) ; static void unprotect( StringArray & ) ;
static void dequote( StringArray & ) ;
private: private:
StringArray m_array ; StringArray m_array ;

View File

@ -74,7 +74,8 @@ G::CleanupImp::Link * G::CleanupImp::m_tail = NULL ;
void G::Cleanup::add( void (*fn)(const char*) , const char * arg ) void G::Cleanup::add( void (*fn)(const char*) , const char * arg )
{ {
CleanupImp::add( fn , arg ) ; if( arg != NULL )
CleanupImp::add( fn , arg ) ;
} }
// === // ===

66
src/glib/gexe.cpp Normal file
View File

@ -0,0 +1,66 @@
//
// Copyright (C) 2001-2003 Graeme Walker <graeme_walker@users.sourceforge.net>
//
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ===
//
// gexe.cpp
//
#include "gdef.h"
#include "gexe.h"
#include "gstr.h"
G::Executable::Executable( const G::Path & exe ) :
m_exe(exe)
{
}
G::Executable::Executable( const std::string & s )
{
if( s.find(' ') == std::string::npos ) // optimisation
{
m_exe = G::Path(s) ;
}
else
{
const std::string null( 1U , '\0' ) ;
std::string line( s ) ;
G::Str::replaceAll( line , "\\ " , null ) ;
G::Str::splitIntoTokens( line , m_args , " " ) ;
for( G::Strings::iterator p = m_args.begin() ; p != m_args.end() ; ++p )
{
G::Str::replaceAll( *p , null , " " ) ;
}
if( m_args.size() )
{
m_exe = G::Path( m_args.front() ) ;
m_args.pop_front() ;
}
}
}
G::Path G::Executable::exe() const
{
return m_exe ;
}
G::Strings G::Executable::args() const
{
return m_args ;
}

65
src/glib/gexe.h Normal file
View File

@ -0,0 +1,65 @@
//
// Copyright (C) 2001-2003 Graeme Walker <graeme_walker@users.sourceforge.net>
//
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ===
//
// gexe.h
//
#ifndef G_EXE_H
#define G_EXE_H
#include "gdef.h"
#include "gpath.h"
#include "gstrings.h"
#include <string>
namespace G
{
class Executable ;
}
// Class: G::Executable
// Description: A structure representing an external program,
// holding a path and a set of arguments.
// See also: G::Path, G::Args
//
class G::Executable
{
public:
explicit Executable( const std::string & command_line = std::string() ) ;
// Constructor taking a complete command-line.
// The command-line is split up on unescaped
// space characters.
explicit Executable( const G::Path & exe ) ;
// Constructor for an executable with no extra arguments.
Path exe() const ;
// Returns the executable.
Strings args() const ;
// Returns the command-line arguments.
private:
G::Path m_exe ;
G::Strings m_args ;
} ;
#endif

View File

@ -473,6 +473,7 @@ std::string G::GetOpt::value( char c ) const
std::string G::GetOpt::value( const std::string & name ) const std::string G::GetOpt::value( const std::string & name ) const
{ {
G_ASSERT( contains(name) ) ;
return value( key(name) ) ; return value( key(name) ) ;
} }

View File

@ -140,10 +140,14 @@ public:
std::string value( const std::string & switch_name ) const ; std::string value( const std::string & switch_name ) const ;
// Returns the value related to the given // Returns the value related to the given
// value-based switch. // value-based switch.
//
// Precondition: contains(switch_name)
std::string value( char switch_letter ) const ; std::string value( char switch_letter ) const ;
// Returns the value related to the given // Returns the value related to the given
// value-based switch. // value-based switch.
//
// Precondition: contains(switch_letter)
private: private:
struct SwitchSpec // A private implementation structure used by G::GetOpt. struct SwitchSpec // A private implementation structure used by G::GetOpt.

View File

@ -169,8 +169,8 @@ void G::LogOutput::addFileAndLine( char *buffer , size_t size , const char *file
add( buffer , size , basename ) ; add( buffer , size , basename ) ;
add( buffer , size , "(" ) ; add( buffer , size , "(" ) ;
char b[15U] ; char b[15U] ;
add( buffer , sizeof(buffer) , itoa(b,sizeof(b),line) ) ; add( buffer , size , itoa(b,sizeof(b),line) ) ;
add( buffer , sizeof(buffer) , "): " ) ; add( buffer , size , "): " ) ;
} }
} }

View File

@ -38,8 +38,13 @@ namespace
char * strdup_( const char * p ) char * strdup_( const char * p )
{ {
p = p ? p : "" ; p = p ? p : "" ;
char * buffer = static_cast<char*>( std::malloc( std::strlen(p) + 1U ) ) ; const size_t n = std::strlen(p) ;
std::strcpy( buffer , p ) ; char * buffer = static_cast<char*>( std::malloc(n+1U) ) ;
if( buffer != NULL )
{
std::strncpy( buffer , p , n ) ;
buffer[n] = '\0' ;
}
return buffer ; return buffer ;
} }
} }

View File

@ -54,6 +54,7 @@ public:
G_EXCEPTION( Insecure , "refusing to exec() while the user-id is zero" ) ; G_EXCEPTION( Insecure , "refusing to exec() while the user-id is zero" ) ;
G_EXCEPTION( InvalidId , "invalid process-id string" ) ; G_EXCEPTION( InvalidId , "invalid process-id string" ) ;
G_EXCEPTION( PipeError , "pipe error" ) ; G_EXCEPTION( PipeError , "pipe error" ) ;
G_EXCEPTION( NoExtension , "refusing to CreateProcess() without a file extension such as .exe" ) ; // windows
enum Who { Parent , Child } ; enum Who { Parent , Child } ;
class IdImp ; class IdImp ;

View File

@ -32,13 +32,18 @@
#include <io.h> #include <io.h>
#include <fcntl.h> #include <fcntl.h>
namespace G namespace
{ {
const int g_stderr_fileno = 2 ; const int g_stderr_fileno = 2 ;
const int g_sc_open_max = 256 ; // 32 in limits.h !? const int g_sc_open_max = 256 ; // 32 in limits.h !?
const HANDLE HNULL = INVALID_HANDLE_VALUE ; const HANDLE HNULL = INVALID_HANDLE_VALUE ;
}
namespace G
{
class Pipe ; class Pipe ;
} ; class ProcessImp ;
}
class G::Pipe class G::Pipe
{ {
@ -63,6 +68,154 @@ public:
unsigned int m_pid ; unsigned int m_pid ;
} ; } ;
class G::ProcessImp
{
public:
static std::string commandLine( std::string exe , Strings args ) ;
static HANDLE createProcess( const std::string & exe , const std::string & command_line , HANDLE hstdout ) ;
static DWORD waitFor( HANDLE hprocess , DWORD default_exit_code ) ;
} ;
// ===
G::Process::Id::Id()
{
m_pid = static_cast<unsigned int>(::_getpid()) ; // or ::GetCurrentProcessId()
}
G::Process::Id::Id( const char * path ) :
m_pid(0)
{
std::ifstream file( path ? path : "" ) ;
file >> m_pid ;
if( !file.good() )
m_pid = 0 ;
}
G::Process::Id::Id( std::istream & stream )
{
stream >> m_pid ;
if( !stream.good() )
throw Process::InvalidId() ;
}
std::string G::Process::Id::str() const
{
std::ostringstream ss ;
ss << m_pid ;
return ss.str() ;
}
bool G::Process::Id::operator==( const Id & rhs ) const
{
return m_pid == rhs.m_pid ;
}
// not implemented...
//G::Process::Id::Id( const char * pid_file_path ) {}
// ===
void G::Process::closeFiles( bool keep_stderr )
{
const int n = g_sc_open_max ;
for( int fd = 0 ; fd < n ; fd++ )
{
if( !keep_stderr || fd != g_stderr_fileno )
::_close( fd ) ;
}
}
void G::Process::closeStderr()
{
int fd = g_stderr_fileno ;
::_close( fd ) ;
}
void G::Process::cd( const Path & dir )
{
if( !cd(dir,NoThrow()) )
throw CannotChangeDirectory( dir.str() ) ;
}
bool G::Process::cd( const Path & dir , NoThrow )
{
return 0 == ::_chdir( dir.str().c_str() ) ;
}
int G::Process::errno_()
{
return errno ;
}
int G::Process::spawn( Identity , const Path & exe_path , const Strings & args ,
std::string * pipe_result_p , int error_return )
{
G_DEBUG( "G::Process::spawn: [" << exe_path << "]: [" << Str::join(args,"],[") << "]" ) ;
// create a pipe
Pipe pipe( pipe_result_p != NULL ) ;
// create the process
std::string command_line = ProcessImp::commandLine( exe_path.str() , args ) ;
HANDLE hprocess = ProcessImp::createProcess( exe_path.str() , command_line , pipe.h() ) ;
if( hprocess == HNULL )
{
DWORD e = ::GetLastError() ;
G_ERROR( "G::Process::spawn: create-process error " << e << ": " << command_line ) ;
return error_return ;
}
// wait for the child process to exit
DWORD exit_code = ProcessImp::waitFor( hprocess , error_return ) ;
G_LOG( "G::Process::spawn: exit " << exit_code << " from \"" << exe_path << "\": " << exit_code ) ;
// return the contents of the pipe
if( pipe_result_p != NULL )
*pipe_result_p = pipe.read(false) ;
return exit_code ;
}
G::Identity G::Process::beOrdinary( Identity identity , bool )
{
// not implemented
return identity ;
}
void G::Process::beSpecial( Identity , bool )
{
// not implemented
}
void G::Process::revokeExtraGroups()
{
// not implemented
}
// not implemented...
// Who G::Process::fork() {}
// Who G::Process::fork( Id & child ) {}
// void G::Process::exec( const Path & exe , const std::string & arg ) {}
// int G::Process::wait( const Id & child ) {}
// int G::Process::wait( const Id & child , int error_return ) {}
// ===
G::Process::Umask::Umask( G::Process::Umask::Mode ) :
m_imp(0)
{
}
G::Process::Umask::~Umask()
{
}
void G::Process::Umask::set( G::Process::Umask::Mode )
{
// not implemented
}
// === // ===
G::Pipe::Pipe( bool active , bool do_throw ) : G::Pipe::Pipe( bool active , bool do_throw ) :
@ -160,172 +313,66 @@ std::string G::Pipe::read( bool do_throw )
// === // ===
G::Process::Id::Id() HANDLE G::ProcessImp::createProcess( const std::string & exe , const std::string & command_line , HANDLE hstdout )
{ {
m_pid = static_cast<unsigned int>(::_getpid()) ; // or ::GetCurrentProcessId()
}
G::Process::Id::Id( const char * path ) :
m_pid(0)
{
std::ifstream file( path ? path : "" ) ;
file >> m_pid ;
if( !file.good() )
m_pid = 0 ;
}
G::Process::Id::Id( std::istream & stream )
{
stream >> m_pid ;
if( !stream.good() )
throw Process::InvalidId() ;
}
std::string G::Process::Id::str() const
{
std::ostringstream ss ;
ss << m_pid ;
return ss.str() ;
}
bool G::Process::Id::operator==( const Id & rhs ) const
{
return m_pid == rhs.m_pid ;
}
// not implemented...
//G::Process::Id::Id( const char * pid_file_path ) {}
// ===
void G::Process::closeFiles( bool keep_stderr )
{
const int n = g_sc_open_max ;
for( int fd = 0 ; fd < n ; fd++ )
{
if( !keep_stderr || fd != g_stderr_fileno )
::_close( fd ) ;
}
}
void G::Process::closeStderr()
{
int fd = g_stderr_fileno ;
::_close( fd ) ;
}
void G::Process::cd( const Path & dir )
{
if( !cd(dir,NoThrow()) )
throw CannotChangeDirectory( dir.str() ) ;
}
bool G::Process::cd( const Path & dir , NoThrow )
{
return 0 == ::_chdir( dir.str().c_str() ) ;
}
int G::Process::errno_()
{
return errno ;
}
int G::Process::spawn( Identity , const Path & exe , const Strings & args ,
std::string * pipe_result_p , int error_return )
{
G_DEBUG( "G::Process::spawn: \"" << exe << "\": \"" << Str::join(args,"\",\"") << "\"" ) ;
std::string command_line = std::string("\"") + exe.str() + "\"" ;
for( Strings::const_iterator arg_p = args.begin() ; arg_p != args.end() ; ++arg_p )
{
std::string arg = *arg_p ;
if( arg.find(" ") != std::string::npos && arg.find("\"") != 0U )
arg = std::string("\"") + arg + "\"" ;
command_line += ( std::string(" ") + arg ) ;
}
Pipe pipe( pipe_result_p != NULL ) ;
SECURITY_ATTRIBUTES * process_attributes = NULL ;
SECURITY_ATTRIBUTES * thread_attributes = NULL ;
BOOL inherit = TRUE ;
DWORD flags = CREATE_NO_WINDOW ;
LPVOID env = NULL ;
LPCTSTR cwd = NULL ;
static STARTUPINFO zero_start ; static STARTUPINFO zero_start ;
STARTUPINFO start(zero_start) ; STARTUPINFO start(zero_start) ;
start.cb = sizeof(start) ; start.cb = sizeof(start) ;
start.dwFlags = STARTF_USESTDHANDLES ; start.dwFlags = STARTF_USESTDHANDLES ;
start.hStdInput = HNULL ; start.hStdInput = HNULL ;
start.hStdOutput = pipe.h() ; start.hStdOutput = hstdout ;
start.hStdError = HNULL ; start.hStdError = HNULL ;
BOOL inherit = TRUE ;
DWORD flags = CREATE_NO_WINDOW ;
LPVOID env = NULL ;
LPCTSTR cwd = NULL ;
PROCESS_INFORMATION info ; PROCESS_INFORMATION info ;
SECURITY_ATTRIBUTES * process_attributes = NULL ;
SECURITY_ATTRIBUTES * thread_attributes = NULL ;
char * command_line_p = const_cast<char*>(command_line.c_str()) ; char * command_line_p = const_cast<char*>(command_line.c_str()) ;
BOOL rc = ::CreateProcess( exe.str().c_str() , command_line_p ,
BOOL rc = ::CreateProcess( exe.c_str() , command_line_p ,
process_attributes , thread_attributes , inherit , process_attributes , thread_attributes , inherit ,
flags , env , cwd , &start , &info ) ; flags , env , cwd , &start , &info ) ;
bool ok = !!rc ; return rc ? info.hProcess : HNULL ;
DWORD exit_code = error_return ; }
if( !ok )
{
DWORD e = ::GetLastError() ;
G_ERROR( "G::Process::spawn: create-process error " << e << ": " << command_line ) ;
}
else
{
DWORD timeout_ms = 30000UL ;
if( WAIT_TIMEOUT == ::WaitForSingleObject( info.hProcess , timeout_ms ) )
{
G_ERROR( "G::Process::spawn: child process has not terminated: still waiting" ) ;
::WaitForSingleObject( info.hProcess , INFINITE ) ;
}
::GetExitCodeProcess( info.hProcess , &exit_code ) ;
G_LOG( "G::Process::spawn: exit " << exit_code << " from \"" << exe << "\": " << exit_code ) ;
if( pipe_result_p != NULL ) std::string G::ProcessImp::commandLine( std::string exe , Strings args )
*pipe_result_p = pipe.read(false) ; {
// returns quoted exe followed by args -- args are quoted iff they have a
// space and no quotes
char q = '\"' ;
const std::string quote = std::string(1U,q) ;
const std::string space = std::string(" ") ;
bool exe_is_quoted = exe.length() > 1U && exe.at(0U) == q && exe.at(exe.length()-1U) == q ;
std::string command_line = exe_is_quoted ? exe : ( quote + exe + quote ) ;
for( Strings::const_iterator arg_p = args.begin() ; arg_p != args.end() ; ++arg_p )
{
std::string arg = *arg_p ;
if( arg.find(" ") != std::string::npos && arg.find("\"") != 0U )
arg = quote + arg + quote ;
command_line += ( space + arg ) ;
} }
return command_line ;
}
DWORD G::ProcessImp::waitFor( HANDLE hprocess , DWORD default_exit_code )
{
DWORD timeout_ms = 30000UL ;
if( WAIT_TIMEOUT == ::WaitForSingleObject( hprocess , timeout_ms ) )
{
G_ERROR( "G::Process::spawn: child process has not terminated: still waiting" ) ;
::WaitForSingleObject( hprocess , INFINITE ) ;
}
DWORD exit_code = default_exit_code ;
BOOL rc = ::GetExitCodeProcess( hprocess , &exit_code ) ;
if( rc == 0 ) exit_code = default_exit_code ;
return exit_code ; return exit_code ;
} }
G::Identity G::Process::beOrdinary( Identity identity , bool )
{
// not implemented
return identity ;
}
void G::Process::beSpecial( Identity , bool )
{
// not implemented
}
void G::Process::revokeExtraGroups()
{
// not implemented
}
// not implemented...
// Who G::Process::fork() {}
// Who G::Process::fork( Id & child ) {}
// void G::Process::exec( const Path & exe , const std::string & arg ) {}
// int G::Process::wait( const Id & child ) {}
// int G::Process::wait( const Id & child , int error_return ) {}
// ===
G::Process::Umask::Umask( G::Process::Umask::Mode ) :
m_imp(0)
{
}
G::Process::Umask::~Umask()
{
}
void G::Process::Umask::set( G::Process::Umask::Mode )
{
// not implemented
}

View File

@ -26,6 +26,10 @@
// * not supporting global function callbacks // * not supporting global function callbacks
// * using only void returns // * using only void returns
// //
// Event-generating classes expose a "signal" object which
// client objects can connect() to in order to receive events.
// The client receives events through a "slot" member function.
//
// The key to the implementation is that SlotImp<> is // The key to the implementation is that SlotImp<> is
// templated on the callback parameter P and the callback // templated on the callback parameter P and the callback
// sink class T, but Slot<> is templated only on P, so // sink class T, but Slot<> is templated only on P, so

View File

@ -309,16 +309,9 @@ std::string G::Str::toPrintableAscii( const std::string & in , char escape )
std::string G::Str::readLineFrom( std::istream & stream , char ignore ) std::string G::Str::readLineFrom( std::istream & stream , char ignore )
{ {
std::string line ; std::string line ;
char c ; G_IGNORE std::getline( stream , line ) ;
while( stream.get(c) ) // ie. while(stream.good()) if( ignore != '\0' )
{ replaceAll( line , std::string(1U,ignore) , std::string() ) ;
if( c == '\n' )
break ;
if( ignore != '\0' && c == ignore )
;
else
line.append(1U,c) ;
}
return line ; return line ;
} }
@ -509,7 +502,7 @@ void G::Str::splitIntoFields( const std::string & in_in , void * out ,
} }
} }
std::string G::Str::join( const G::Strings & strings , const std::string & sep ) std::string G::Str::join( const Strings & strings , const std::string & sep )
{ {
std::string result ; std::string result ;
bool first = true ; bool first = true ;
@ -533,3 +526,13 @@ std::string G::Str::join( const StringArray & strings , const std::string & sep
return result ; return result ;
} }
G::Strings G::Str::keys( const StringMap & map )
{
Strings result ;
for( StringMap::const_iterator p = map.begin() ; p != map.end() ; ++p )
{
result.push_back( (*p).first ) ;
}
return result ;
}

View File

@ -212,6 +212,8 @@ public:
static std::string join( const StringArray & strings , const std::string & sep ) ; static std::string join( const StringArray & strings , const std::string & sep ) ;
// Concatenates a set of strings. // Concatenates a set of strings.
static Strings keys( const StringMap & string_map ) ;
// Extracts the keys from a map of strings.
private: private:
static void listPushBack( void * , const std::string & ) ; static void listPushBack( void * , const std::string & ) ;

View File

@ -28,6 +28,7 @@
#include <string> #include <string>
#include <list> #include <list>
#include <vector> #include <vector>
#include <map>
namespace G namespace G
{ {
@ -43,6 +44,11 @@ typedef std::list<std::string> Strings ;
// //
typedef std::vector<std::string> StringArray ; typedef std::vector<std::string> StringArray ;
// Typedef: StringMap
// Description: A std::map of std::strings.
//
typedef std::map<std::string,std::string> StringMap ;
} }
#endif #endif

View File

@ -25,6 +25,7 @@ mk_sources=\
garg.cpp \ garg.cpp \
garg_win32.cpp \ garg_win32.cpp \
gcleanup_win32.cpp \ gcleanup_win32.cpp \
gexe.cpp \
gdaemon_win32.cpp \ gdaemon_win32.cpp \
gdate.cpp \ gdate.cpp \
gdatetime.cpp \ gdatetime.cpp \

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -16,74 +16,94 @@
# #
# #
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../.. top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -91,7 +111,22 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
EXTRA_DIST = \ EXTRA_DIST = \
gclient_win32.cpp \ gclient_win32.cpp \
@ -146,6 +181,7 @@ libgnet_a_SOURCES = gaddress_ipv4.cpp \
gtimer.h gtimer.h
subdir = src/gnet subdir = src/gnet
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
@ -164,11 +200,7 @@ am_libgnet_a_OBJECTS = gaddress_ipv4.$(OBJEXT) gclient.$(OBJEXT) \
gsocket_unix.$(OBJEXT) gtimer.$(OBJEXT) gsocket_unix.$(OBJEXT) gtimer.$(OBJEXT)
libgnet_a_OBJECTS = $(am_libgnet_a_OBJECTS) libgnet_a_OBJECTS = $(am_libgnet_a_OBJECTS)
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gaddress_ipv4.Po \ @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gaddress_ipv4.Po \
@ -191,14 +223,12 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
CXXLD = $(CXX) CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@ -o $@
CXXFLAGS = @CXXFLAGS@
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC) CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libgnet_a_SOURCES) DIST_SOURCES = $(libgnet_a_SOURCES)
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
SOURCES = $(libgnet_a_SOURCES) SOURCES = $(libgnet_a_SOURCES)
all: all-am all: all-am
@ -245,26 +275,35 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocket_unix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocket_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtimer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtimer.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.cpp.o: .cpp.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
$(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCXX_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
.cpp.obj: .cpp.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
$(CXXCOMPILE) -c -o $@ `cygpath -w $<` @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
CXXDEPMODE = @CXXDEPMODE@ @am__fastdepCXX_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
uninstall-info-am: uninstall-info-am:
ETAGS = etags ETAGS = etags
ETAGSFLAGS = ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@ -290,20 +329,41 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique $$tags $$unique
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS: GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../.. top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -328,7 +388,6 @@ check: check-am
all-am: Makefile $(LIBRARIES) all-am: Makefile $(LIBRARIES)
installdirs: installdirs:
install: install-am install: install-am
install-exec: install-exec-am install-exec: install-exec-am
install-data: install-data-am install-data: install-data-am
@ -348,7 +407,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -358,9 +417,10 @@ clean: clean-am
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -rf ./$(DEPDIR)
distclean-am: clean-am distclean-compile distclean-depend \ -rm -f Makefile
distclean-generic distclean-tags distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am dvi: dvi-am
@ -381,25 +441,33 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \ .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES distclean distclean-compile \ clean-noinstLIBRARIES ctags distclean distclean-compile \
distclean-depend distclean-generic distclean-tags distdir dvi \ distclean-generic distclean-tags distdir dvi dvi-am info \
dvi-am info info-am install install-am install-data \ info-am install install-am install-data install-data-am \
install-data-am install-exec install-exec-am install-info \ install-exec install-exec-am install-info install-info-am \
install-info-am install-man install-strip installcheck \ install-man install-strip installcheck installcheck-am \
installcheck-am installdirs maintainer-clean \ installdirs maintainer-clean maintainer-clean-generic \
maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
mostlyclean-generic tags uninstall uninstall-am \ ps ps-am tags uninstall uninstall-am uninstall-info-am
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -55,10 +55,10 @@ public:
class Broadcast // An overload discriminator class for GNet::Address. class Broadcast // An overload discriminator class for GNet::Address.
{} ; {} ;
Address( const Address &addr ) ; Address( const Address & addr ) ;
// Copy constructor. // Copy constructor.
Address( const sockaddr *addr , int len ) ; Address( const sockaddr * addr , int len ) ;
// Constructor using a given sockaddr. // Constructor using a given sockaddr.
// //
// The given sockaddr address must be an Internet // The given sockaddr address must be an Internet
@ -183,7 +183,7 @@ private:
private: private:
AddressImp * m_imp ; AddressImp * m_imp ;
}; } ;
#endif #endif

View File

@ -78,29 +78,20 @@ GNet::ClientResolver::ClientResolver( ClientImp & imp ) :
// //
class GNet::ClientImp : public GNet::EventHandler class GNet::ClientImp : public GNet::EventHandler
{ {
private: public:
ClientResolver m_resolver ;
StreamSocket * m_s ;
Address m_address ;
std::string m_peer_name ;
Client & m_interface ;
bool m_priviledged ;
enum Status { Success , Failure , Retry , ImmediateSuccess } ; enum Status { Success , Failure , Retry , ImmediateSuccess } ;
static bool m_first ;
enum State { Idle , Resolving , Connecting , Connected , Failed , Disconnected } ; enum State { Idle , Resolving , Connecting , Connected , Failed , Disconnected } ;
State m_state ;
bool m_quit_on_disconnect ;
public: public:
ClientImp( Client &intaface , bool priviledged , bool quit_on_disconnect ) ; ClientImp( Client & intaface , const Address & local_address , bool priviledged , bool quit_on_disconnect ) ;
virtual ~ClientImp() ; virtual ~ClientImp() ;
void resolveCon( bool ok , const Address & address , std::string reason ) ; void resolveCon( bool ok , const Address & address , std::string reason ) ;
void readEvent() ; void readEvent() ;
void writeEvent() ; void writeEvent() ;
void exceptionEvent() ; void exceptionEvent() ;
bool connect( std::string host , std::string service , std::string *error , bool sync_dns ) ; bool connect( std::string host , std::string service , std::string * error , bool sync_dns ) ;
std::string startConnecting( const Address & , const std::string & , bool & ) ; std::string startConnecting( const Address & , const std::string & , bool & ) ;
Status connectCore( Address , std::string * , bool , unsigned int ) ; Status connectCore( Address , Address , std::string * ) ;
void disconnect() ; void disconnect() ;
StreamSocket & s() ; StreamSocket & s() ;
const StreamSocket & s() const ; const StreamSocket & s() const ;
@ -117,15 +108,35 @@ private:
ClientImp( const ClientImp & ) ; ClientImp( const ClientImp & ) ;
void operator=( const ClientImp & ) ; void operator=( const ClientImp & ) ;
static int getRandomPort() ; static int getRandomPort() ;
private:
ClientResolver m_resolver ;
StreamSocket * m_s ;
Address m_local_address ;
Address m_remote_address ;
std::string m_peer_name ;
Client & m_interface ;
bool m_priviledged ;
static bool m_first ;
State m_state ;
bool m_quit_on_disconnect ;
} ; } ;
// === // ===
GNet::Client::Client( const Address & local_address , bool priviledged , bool quit_on_disconnect ) :
m_imp(NULL)
{
G_DEBUG( "Client::ctor" ) ;
m_imp = new ClientImp( *this , local_address , priviledged , quit_on_disconnect ) ;
if( Monitor::instance() ) Monitor::instance()->add( *this ) ;
}
GNet::Client::Client( bool priviledged , bool quit_on_disconnect ) : GNet::Client::Client( bool priviledged , bool quit_on_disconnect ) :
m_imp(NULL) m_imp(NULL)
{ {
G_DEBUG( "Client::ctor" ) ; G_DEBUG( "Client::ctor" ) ;
m_imp = new ClientImp( *this , priviledged , quit_on_disconnect ) ; m_imp = new ClientImp( *this , Address(0U) , priviledged , quit_on_disconnect ) ;
if( Monitor::instance() ) Monitor::instance()->add( *this ) ; if( Monitor::instance() ) Monitor::instance()->add( *this ) ;
} }
@ -185,14 +196,16 @@ bool GNet::Client::canRetry( const std::string & error )
bool GNet::ClientImp::m_first = true ; bool GNet::ClientImp::m_first = true ;
GNet::ClientImp::ClientImp( Client &intaface , bool priviledged , bool quit_on_disconnect ) : GNet::ClientImp::ClientImp( Client & intaface , const Address & local_address ,
m_resolver(*this) , bool priviledged , bool quit_on_disconnect ) :
m_s(NULL) , m_resolver(*this) ,
m_address(Address::invalidAddress()) , m_s(NULL) ,
m_interface(intaface) , m_local_address(local_address) ,
m_priviledged(priviledged) , m_remote_address(Address::invalidAddress()) ,
m_state(Idle) , m_interface(intaface) ,
m_quit_on_disconnect(quit_on_disconnect) m_priviledged(priviledged) ,
m_state(Idle) ,
m_quit_on_disconnect(quit_on_disconnect)
{ {
G_DEBUG( "ClientImp::ctor" ) ; G_DEBUG( "ClientImp::ctor" ) ;
} }
@ -330,11 +343,12 @@ void GNet::ClientImp::resolveCon( bool success , const Address &address ,
} }
} }
std::string GNet::ClientImp::startConnecting( const Address & address , const std::string & peer_name , bool & immediate ) std::string GNet::ClientImp::startConnecting( const Address & remote_address ,
const std::string & peer_name , bool & immediate )
{ {
// save the target address // save the target address
G_DEBUG( "GNet::ClientImp::startConnecting: " << address.displayString() ) ; G_DEBUG( "GNet::ClientImp::startConnecting: " << remote_address.displayString() ) ;
m_address = address ; m_remote_address = remote_address ;
m_peer_name = peer_name ; m_peer_name = peer_name ;
// create and open a socket // create and open a socket
@ -350,6 +364,8 @@ std::string GNet::ClientImp::startConnecting( const Address & address , const st
// //
s().addWriteHandler( *this ) ; s().addWriteHandler( *this ) ;
// bind a local address to the socket and connect
//
Status status = Failure ; Status status = Failure ;
std::string error ; std::string error ;
if( m_priviledged ) if( m_priviledged )
@ -357,41 +373,44 @@ std::string GNet::ClientImp::startConnecting( const Address & address , const st
for( int i = 0 ; i < c_retries ; i++ ) for( int i = 0 ; i < c_retries ; i++ )
{ {
int port = getRandomPort() ; int port = getRandomPort() ;
G_DEBUG( "GNet::ClientImp::resolveCon: trying to bind port " << port ) ; m_local_address.setPort( port ) ;
status = connectCore( address, &error, true, port ) ; G_DEBUG( "GNet::ClientImp::resolveCon: trying to bind " << m_local_address.displayString() ) ;
status = connectCore( m_local_address , remote_address , &error ) ;
if( status != Retry ) if( status != Retry )
break ; break ;
} }
} }
else else
{ {
status = connectCore( address , &error , false , 0 ) ; status = connectCore( m_local_address , remote_address , &error ) ;
} }
// deal with immediate connection (typically if connecting locally)
//
immediate = status == ImmediateSuccess ; immediate = status == ImmediateSuccess ;
if( status != Success ) if( status != Success )
s().dropWriteHandler() ; s().dropWriteHandler() ;
if( status == Success ) error = std::string() ; if( status == Success )
error = std::string() ;
return error ; return error ;
} }
GNet::ClientImp::Status GNet::ClientImp::connectCore( Address remote_address , GNet::ClientImp::Status GNet::ClientImp::connectCore( Address local_address , Address remote_address ,
std::string *error_p , bool set_port , unsigned int port ) std::string *error_p )
{ {
G_ASSERT( error_p != NULL ) ; G_ASSERT( error_p != NULL ) ;
std::string &error = *error_p ; std::string &error = *error_p ;
G::Root claim_root ; G::Root claim_root ;
Address local_address( set_port ? port : 0 ) ;
bool bound = s().bind(local_address) ; bool bound = s().bind(local_address) ;
if( !bound ) if( !bound )
{ {
error = "cannot bind socket" ; error = "cannot bind socket" ;
return Retry ; return Retry ;
} }
G_DEBUG( "GNet::ClientImp::connectCore: bound local address " G_DEBUG( "GNet::ClientImp::connectCore: bound local address " << local_address.displayString() ) ;
<< local_address.displayString() ) ;
// initiate the connection // initiate the connection
// //
@ -441,7 +460,7 @@ void GNet::ClientImp::writeEvent()
else if( m_state == Connecting ) else if( m_state == Connecting )
{ {
std::string message( c_cannot_connect_to ) ; std::string message( c_cannot_connect_to ) ;
message.append( m_address.displayString().c_str() ) ; message.append( m_remote_address.displayString().c_str() ) ;
setState( Failed ) ; setState( Failed ) ;
close() ; close() ;
m_interface.onError( message ) ; m_interface.onError( message ) ;

View File

@ -47,11 +47,15 @@ namespace GNet
class GNet::Client : public GNet::Connection class GNet::Client : public GNet::Connection
{ {
public: public:
explicit Client( bool priviledged = false , bool quit_on_disconnect = false ) ; Client( const Address & local_interface , bool priviledged , bool quit_on_disconnect ) ;
// Constructor. If the 'priviledged' parameter // Constructor.
// is true the the local endpoint of the //
// outgoing connection is bound to a // The socket is bound with the given local address,
// priviledged port number (ie. < 1024), // but with an arbitrary port number. The local address
// may be the INADDR_ANY address.
//
// If the 'priviledged' parameter is true then socket
// is bound with priviledged port number (ie. < 1024),
// selected at random. // selected at random.
// //
// If the 'quit' parameter is true then the client will // If the 'quit' parameter is true then the client will
@ -60,6 +64,10 @@ public:
// should only be true if this client is the only thing // should only be true if this client is the only thing
// using the event loop. // using the event loop.
explicit Client( bool priviledged = false , bool quit_on_disconnect = false ) ;
// Constructor overload for a INADDR_ANY local
// interface.
bool connect( std::string host, std::string service, bool connect( std::string host, std::string service,
std::string *error_string = NULL , std::string *error_string = NULL ,
bool sync_dns = synchronousDnsDefault() ); bool sync_dns = synchronousDnsDefault() );

View File

@ -27,7 +27,44 @@
#include "geventloop.h" #include "geventloop.h"
#include "gdebug.h" #include "gdebug.h"
#include "gassert.h" #include "gassert.h"
#include "gdescriptor.h"
#include "glog.h" #include "glog.h"
#include <algorithm> // std::find
namespace
{
struct Eq
{
GNet::Descriptor m_fd ;
explicit Eq( GNet::Descriptor fd ) : m_fd(fd) {}
bool operator()( const GNet::EventHandlerListItem & item ) const
{
return item.m_fd == m_fd ;
}
} ;
struct NotNull
{
GNet::Descriptor m_fd ;
explicit NotNull( GNet::Descriptor fd ) : m_fd(fd) {}
bool operator()( const GNet::EventHandlerListItem & item ) const
{
return item.m_fd == m_fd && item.m_handler != NULL ;
}
} ;
}
GNet::EventHandlerListItem::EventHandlerListItem( Descriptor fd , EventHandler * handler ) :
m_fd(fd) ,
m_handler(handler)
{
}
bool operator!=( const GNet::EventHandlerListItem & a , const GNet::EventHandlerListItem & b )
{
return a.m_fd != b.m_fd ;
}
// ===
GNet::EventHandler::~EventHandler() GNet::EventHandler::~EventHandler()
{ {
@ -50,95 +87,66 @@ void GNet::EventHandler::exceptionEvent()
// === // ===
GNet::EventHandlerList::EventHandlerList( std::string type ) : GNet::EventHandlerList::EventHandlerList( const std::string & type ) :
m_type(type) , m_type(type) ,
m_lock(0U) , m_lock(0U)
m_copied(false)
{ {
} }
//static GNet::EventHandlerList::Iterator GNet::EventHandlerList::begin() const
bool GNet::EventHandlerList::contains( const EventHandlerListImp & list , Descriptor fd )
{ {
const List::const_iterator end = list.end() ; return m_list.begin() ;
for( List::const_iterator p = list.begin() ; p != end ; ++p ) }
{
if( (*p).m_fd == fd ) GNet::EventHandlerList::Iterator GNet::EventHandlerList::end() const
return true ; {
} return m_list.end() ;
return false ;
} }
bool GNet::EventHandlerList::contains( Descriptor fd ) const bool GNet::EventHandlerList::contains( Descriptor fd ) const
{ {
return contains( m_list , fd ) ; const List::const_iterator end = m_list.end() ;
} return std::find_if( m_list.begin() , end , NotNull(fd) ) != end ;
std::string GNet::EventHandlerList::asString() const
{
return asString( m_list ) ;
}
std::string GNet::EventHandlerList::asString( const EventHandlerListImp & list ) const
{
std::ostringstream ss ;
const char * sep = "" ;
for( List::const_iterator p = list.begin() ; p != list.end() ; ++p )
{
ss << sep << fd( p ) ;
sep = "," ;
}
return ss.str() ;
}
GNet::EventHandlerListImp & GNet::EventHandlerList::list()
{
// lazy copy
if( m_lock != 0U && !m_copied )
{
m_copy = m_list ;
m_copied = true ;
}
return m_lock == 0U ? m_list : m_copy ;
}
void GNet::EventHandlerList::add( Descriptor fd , EventHandler * handler )
{
G_ASSERT( handler != NULL ) ;
if( ! contains(list(),fd) )
{
G_DEBUG( "GNet::EventHandlerList::add: " << m_type << "-list: adding " << fd << (m_lock?" (deferred)":"") ) ;
list().push_back( EventHandlerListItem(fd,handler) ) ;
}
}
void GNet::EventHandlerList::remove( Descriptor fd )
{
G_DEBUG( "GNet::EventHandlerList::remove: " << m_type << "-list: removing " << fd << (m_lock?" (deferred)":"") ) ;
bool found = false ;
for( List::iterator p = list().begin() ; p != list().end() ; ++p )
{
if( (*p).m_fd == fd )
{
list().erase( p ) ;
found = true ;
break ;
}
}
//if( !found ) G_DEBUG( "GNet::EventHandlerList::remove: cannot find " << fd ) ;
} }
GNet::EventHandler * GNet::EventHandlerList::find( Descriptor fd ) GNet::EventHandler * GNet::EventHandlerList::find( Descriptor fd )
{ {
const List::iterator end = m_list.end() ; const List::iterator end = m_list.end() ;
for( List::iterator p = m_list.begin() ; p != end ; ++p ) List::iterator p = std::find_if( m_list.begin() , end , NotNull(fd) ) ;
return p != end ? (*p).m_handler : NULL ;
}
void GNet::EventHandlerList::add( Descriptor fd , EventHandler * handler )
{
G_ASSERT( handler != NULL ) ;
G_DEBUG( "GNet::EventHandlerList::add: " << m_type << "-list: " << "adding " << fd ) ;
const List::iterator end = m_list.end() ;
List::iterator p = std::find_if( m_list.begin() , end , Eq(fd) ) ;
if( p != end )
{ {
if( (*p).m_fd == fd ) G_ASSERT( (*p).m_handler == NULL ) ;
return (*p).m_handler ; (*p).m_handler = handler ;
}
else
{
m_list.push_back( EventHandlerListItem(fd,handler) ) ;
}
}
void GNet::EventHandlerList::remove( Descriptor fd )
{
G_DEBUG( "GNet::EventHandlerList::remove: " << m_type << "-list: " << "removing " << fd ) ;
const List::iterator end = m_list.end() ;
List::iterator p = std::find_if( m_list.begin() , end , Eq(fd) ) ;
if( p != end )
{
if( m_lock )
(*p).m_handler = NULL ;
else
m_list.erase( p ) ;
} }
//G_DEBUG( "GNet::EventHandlerList::find: cannot find entry for " << fd ) ;
return NULL ;
} }
void GNet::EventHandlerList::lock() void GNet::EventHandlerList::lock()
@ -149,11 +157,17 @@ void GNet::EventHandlerList::lock()
void GNet::EventHandlerList::unlock() void GNet::EventHandlerList::unlock()
{ {
m_lock-- ; m_lock-- ;
if( m_lock == 0U && m_copied ) if( m_lock == 0U )
{ {
//G_DEBUG( "GNet::EventHandlerList::unlock: " << m_type << "-list: commiting: " << asString(m_copy) ) ; // collect garbage
m_list = m_copy ; const List::iterator end = m_list.end() ;
m_copied = false ; for( List::iterator p = m_list.begin() ; p != end ; )
{
if( (*p).m_handler == NULL )
p = m_list.erase( p ) ;
else
++p ;
}
} }
} }

View File

@ -87,17 +87,9 @@ public:
EventHandler * handler = NULL ) ; EventHandler * handler = NULL ) ;
} ; } ;
inline
GNet::EventHandlerListItem::EventHandlerListItem( Descriptor fd , EventHandler * handler ) :
m_fd(fd) ,
m_handler(handler)
{
}
namespace GNet namespace GNet
{ {
typedef std::list<EventHandlerListItem> typedef std::list<EventHandlerListItem> EventHandlerListImp ;
EventHandlerListImp ;
} }
// Class: GNet::EventHandlerList // Class: GNet::EventHandlerList
@ -111,11 +103,11 @@ public:
typedef List::const_iterator Iterator ; typedef List::const_iterator Iterator ;
public: public:
explicit EventHandlerList( std::string type ) ; explicit EventHandlerList( const std::string & type ) ;
// Constructor. The type parameter (eg. "read") // Constructor. The type parameter (eg. "read")
// is used only in debugging messages. // is used only in debugging messages.
void add( Descriptor fd , EventHandler *handler ) ; void add( Descriptor fd , EventHandler * handler ) ;
// Adds a file-descriptor/handler pair to // Adds a file-descriptor/handler pair to
// the list. // the list.
@ -131,56 +123,36 @@ public:
// given file descriptor. // given file descriptor.
void lock() ; void lock() ;
// Locks the list so that add() and remove() are // Called at the start of an iteration which
// deferred until the matching unlock(). This // might change the list.
// is needed during iteration -- see begin()/end().
void unlock() ; void unlock() ;
// Applies any deferred changes. See lock(). // Called at the end of an iteration.
Iterator begin() const ; Iterator begin() const ;
// Returns an iterator (using the STL model). // Returns a forward iterator.
Iterator end() const ; Iterator end() const ;
// Returns an end iterator (using the STL model). // Returns an end iterator.
static Descriptor fd( Iterator i ) ; static Descriptor fd( Iterator i ) ;
// Returns the iterator's file descriptor. // Returns the iterator's file descriptor.
static EventHandler & handler( Iterator i ) ; static EventHandler * handler( Iterator i ) ;
// Returns the iterator's handler. // Returns the iterator's handler. Returns null
// if the fd has been remove()d but the
std::string asString() const ; // list is still lock()ed.
// Returns a descriptive string for the list. Used
// for debugging.
private: private:
EventHandlerList( const EventHandlerList & ) ; EventHandlerList( const EventHandlerList & ) ;
void operator=( const EventHandlerList & ) ; void operator=( const EventHandlerList & ) ;
static bool contains( const EventHandlerListImp & , Descriptor fd ) ;
EventHandlerListImp & list() ;
std::string asString( const EventHandlerListImp & ) const ;
private: private:
std::string m_type ; // for debugging std::string m_type ;
List m_list ; List m_list ;
List m_copy ;
unsigned int m_lock ; unsigned int m_lock ;
bool m_copied ;
} ; } ;
inline
GNet::EventHandlerList::Iterator GNet::EventHandlerList::begin() const
{
return m_list.begin() ;
}
inline
GNet::EventHandlerList::Iterator GNet::EventHandlerList::end() const
{
return m_list.end() ;
}
//static //static
inline inline
GNet::Descriptor GNet::EventHandlerList::fd( Iterator i ) GNet::Descriptor GNet::EventHandlerList::fd( Iterator i )
@ -190,9 +162,9 @@ GNet::Descriptor GNet::EventHandlerList::fd( Iterator i )
//static //static
inline inline
GNet::EventHandler & GNet::EventHandlerList::handler( Iterator i ) GNet::EventHandler * GNet::EventHandlerList::handler( Iterator i )
{ {
return *((*i).m_handler) ; return (*i).m_handler ;
} }
#endif #endif

View File

@ -123,13 +123,17 @@ public:
// from the list of exception sources. // from the list of exception sources.
// See also Socket::dropExceptionHandler(). // See also Socket::dropExceptionHandler().
virtual void setTimeout( G::DateTime::EpochTime t ) = 0 ; virtual void setTimeout( G::DateTime::EpochTime t , bool & empty_implementation_hint ) = 0 ;
// Used by GNet::TimerList. Sets the time at which // Used by GNet::TimerList. Sets the time at which
// TimerList::doTimeouts() is to be called. // TimerList::doTimeouts() is to be called.
// A parameter of zero is used to cancel the // A parameter of zero is used to cancel the
// timer. Some concrete implementations of this // timer.
//
// Some concrete implementations of this
// interface may use TimerList::interval() // interface may use TimerList::interval()
// rather than setTimeout()/doTimeouts(). // rather than setTimeout()/doTimeouts().
// Empty implementations should set the
// hint value to true as an optimisation.
private: private:
static EventLoop * m_this ; static EventLoop * m_this ;

View File

@ -65,7 +65,7 @@ public:
private: private:
void runOnce() ; void runOnce() ;
virtual void setTimeout( G::DateTime::EpochTime t ) ; virtual void setTimeout( G::DateTime::EpochTime t , bool & ) ;
private: private:
bool m_quit ; bool m_quit ;
@ -100,7 +100,7 @@ class GNet::FdSet
public: public:
static int init( int n , fd_set * set , const EventHandlerList & list ) ; static int init( int n , fd_set * set , const EventHandlerList & list ) ;
static void raiseEvents( fd_set * set , EventHandlerList & list , static void raiseEvents( fd_set * set , EventHandlerList & list ,
void (EventHandler::*method)() , const char * type ) ; void (EventHandler::*method)() ) ;
private: private:
FdSet() ; // not implemented FdSet() ; // not implemented
} ; } ;
@ -140,8 +140,7 @@ int GNet::FdSet::init( int n , fd_set * set , const EventHandlerList & list )
} }
//static //static
void GNet::FdSet::raiseEvents( fd_set * set , EventHandlerList & list , void GNet::FdSet::raiseEvents( fd_set * set , EventHandlerList & list , void (EventHandler::*method)() )
void (EventHandler::*method)() , const char * /*type*/ )
{ {
// call the event-handler for fds in fd-set which are ISSET() // call the event-handler for fds in fd-set which are ISSET()
@ -153,8 +152,9 @@ void GNet::FdSet::raiseEvents( fd_set * set , EventHandlerList & list ,
if( FD_ISSET( fd , set ) ) if( FD_ISSET( fd , set ) )
{ {
//G_DEBUG( "raiseEvents: " << type << " event on fd " << fd ) ; //G_DEBUG( "raiseEvents: " << type << " event on fd " << fd ) ;
EventHandler & h = EventHandlerList::handler( p ) ; EventHandler * h = EventHandlerList::handler( p ) ;
(h.*method)() ; if( h != NULL )
(h->*method)() ;
} }
} }
} }
@ -228,18 +228,6 @@ void GNet::Select::runOnce()
timeout_p = infinite ? NULL : &timeout ; timeout_p = infinite ? NULL : &timeout ;
} }
// debug
//
const bool debug = false ;
if( debug )
{
G_DEBUG( "GNet::Select::runOnce: selecting: fd(max) = " << (n-1) << ": "
<< "read-list=\"" << m_read_list.asString() << "\": "
<< "write-list=\"" << m_write_list.asString() << "\": "
<< "exception-list=\"" << m_exception_list.asString() << "\": "
<< "timeout=" << (timeout_p?G::Str::fromUInt(timeout_p->tv_sec):std::string("infinite")) ) ;
}
// do the select() // do the select()
// //
int rc = ::select( n , &r , &w , &e , timeout_p ) ; int rc = ::select( n , &r , &w , &e , timeout_p ) ;
@ -256,9 +244,9 @@ void GNet::Select::runOnce()
else // rc > 0 else // rc > 0
{ {
G_DEBUG( "GNet::Select::runOnce: detected event(s) on " << rc << " fd(s)" ) ; G_DEBUG( "GNet::Select::runOnce: detected event(s) on " << rc << " fd(s)" ) ;
FdSet::raiseEvents( &r , m_read_list , & EventHandler::readEvent , "read" ) ; FdSet::raiseEvents( &r , m_read_list , & EventHandler::readEvent ) ;
FdSet::raiseEvents( &w , m_write_list , & EventHandler::writeEvent , "write" ) ; FdSet::raiseEvents( &w , m_write_list , & EventHandler::writeEvent ) ;
FdSet::raiseEvents( &e , m_exception_list , & EventHandler::exceptionEvent , "exception" ) ; FdSet::raiseEvents( &e , m_exception_list , & EventHandler::exceptionEvent ) ;
} }
} }
@ -292,8 +280,9 @@ void GNet::Select::dropException( Descriptor fd )
m_exception_list.remove( fd ) ; m_exception_list.remove( fd ) ;
} }
void GNet::Select::setTimeout( G::DateTime::EpochTime ) void GNet::Select::setTimeout( G::DateTime::EpochTime , bool & empty_hint )
{ {
// not used -- interval() in runOnce() suffices // does nothing -- interval() in runOnce() suffices
empty_hint = true ;
} }

View File

@ -121,7 +121,7 @@ protected:
virtual void dropRead( Descriptor fd ) ; virtual void dropRead( Descriptor fd ) ;
virtual void dropWrite( Descriptor fd ) ; virtual void dropWrite( Descriptor fd ) ;
virtual void dropException( Descriptor fd ) ; virtual void dropException( Descriptor fd ) ;
virtual void setTimeout( G::DateTime::EpochTime ) ; virtual void setTimeout( G::DateTime::EpochTime , bool & ) ;
private: private:
Winsock( const Winsock & other ) ; Winsock( const Winsock & other ) ;
@ -380,7 +380,7 @@ void GNet::Winsock::onTimer()
TimerList::instance().doTimeouts() ; TimerList::instance().doTimeouts() ;
} }
void GNet::Winsock::setTimeout( G::DateTime::EpochTime t ) void GNet::Winsock::setTimeout( G::DateTime::EpochTime t , bool & )
{ {
G_DEBUG( "GNet::Winsock::setTimeout: " << t ) ; G_DEBUG( "GNet::Winsock::setTimeout: " << t ) ;
if( t != 0U ) if( t != 0U )

View File

@ -30,7 +30,8 @@ bool GNet::Resolver::resolveHost( const std::string & host_name , HostInfo & hos
hostent * host = ::gethostbyname( host_name.c_str() ) ; hostent * host = ::gethostbyname( host_name.c_str() ) ;
if( host != NULL ) if( host != NULL )
{ {
host_info.canonical_name = std::string(host->h_name) ; const char * h_name = host->h_name ;
host_info.canonical_name = std::string(h_name?h_name:"") ;
host_info.address = Address( *host , 0U ) ; host_info.address = Address( *host , 0U ) ;
} }
return host != NULL ; return host != NULL ;

View File

@ -39,7 +39,8 @@ bool GNet::Resolver::resolveHost( const std::string & host_name , HostInfo & hos
host = ::getipnodebyname( host_name.c_str() , AF_INET6 , AI_DEFAULT , &error ) ; host = ::getipnodebyname( host_name.c_str() , AF_INET6 , AI_DEFAULT , &error ) ;
if( host != NULL ) if( host != NULL )
{ {
host_info.canonical_name = std::string(host->h_name) ; const char * h_name = host->h_name ;
host_info.canonical_name = std::string(h_name?h_name:"") ;
host_info.address = Address( *host , 0U ) ; host_info.address = Address( *host , 0U ) ;
::freehostent( host ) ; ::freehostent( host ) ;
} }

View File

@ -66,7 +66,7 @@ void GNet::ServerPeer::readEvent()
{ {
//G_DEBUG( "GNet::ServerPeer::readEvent: peer=" << this ) ; //G_DEBUG( "GNet::ServerPeer::readEvent: peer=" << this ) ;
char buffer[500] ; char buffer[c_buffer_size] ;
buffer[0] = '\0' ; buffer[0] = '\0' ;
size_t buffer_size = sizeof(buffer) ; size_t buffer_size = sizeof(buffer) ;
ssize_t rc = m_socket->read( buffer , buffer_size ) ; ssize_t rc = m_socket->read( buffer , buffer_size ) ;

View File

@ -224,6 +224,7 @@ private:
void operator=( const ServerPeer & ) ; // not implemented void operator=( const ServerPeer & ) ; // not implemented
private: private:
enum { c_buffer_size = 1500 } ;
Address m_address ; Address m_address ;
std::auto_ptr<StreamSocket> m_socket ; std::auto_ptr<StreamSocket> m_socket ;
ServerPeerHandle * m_handle ; ServerPeerHandle * m_handle ;

View File

@ -38,15 +38,13 @@ namespace GNet
class GNet::TimerUpdate class GNet::TimerUpdate
{ {
public: public:
TimerUpdate( Timer & , const std::string & ) ; TimerUpdate() ;
~TimerUpdate() ; ~TimerUpdate() ;
private: private:
TimerUpdate( const TimerUpdate & ) ; // not implemented TimerUpdate( const TimerUpdate & ) ; // not implemented
void operator=( const TimerUpdate & ) ; // not implemented void operator=( const TimerUpdate & ) ; // not implemented
private: private:
Timer & m_timer ; G::DateTime::EpochTime m_old_soonest ;
std::string m_type ;
G::DateTime::EpochTime m_soonest ;
} ; } ;
// === // ===
@ -63,8 +61,8 @@ GNet::Timer::Timer( TimeoutHandler & handler ) :
{ {
G_ASSERT( TimerList::instance(TimerList::NoThrow()) != NULL ) ; G_ASSERT( TimerList::instance(TimerList::NoThrow()) != NULL ) ;
G_ASSERT( EventLoop::exists() ) ; G_ASSERT( EventLoop::exists() ) ;
TimerUpdate update( *this , "ctor" ) ;
TimerList::instance().add( *this ) ; TimerList::instance().add( *this ) ;
// no List::update() here since this timer has not started
} }
GNet::Timer::Timer() : GNet::Timer::Timer() :
@ -73,8 +71,8 @@ GNet::Timer::Timer() :
{ {
G_ASSERT( TimerList::instance(TimerList::NoThrow()) != NULL ) ; G_ASSERT( TimerList::instance(TimerList::NoThrow()) != NULL ) ;
G_ASSERT( EventLoop::exists() ) ; G_ASSERT( EventLoop::exists() ) ;
TimerUpdate update( *this , "ctor" ) ;
TimerList::instance().add( *this ) ; TimerList::instance().add( *this ) ;
// no List::update() here since this timer has not started
} }
GNet::Timer::~Timer() GNet::Timer::~Timer()
@ -83,8 +81,9 @@ GNet::Timer::~Timer()
{ {
if( TimerList::instance(TimerList::NoThrow()) != NULL ) if( TimerList::instance(TimerList::NoThrow()) != NULL )
{ {
TimerUpdate update( *this , "dtor" ) ; TimerUpdate update ;
TimerList::instance().remove( *this ) ; TimerList::instance().remove( *this ) ;
// List::update() here
} }
} }
catch(...) catch(...)
@ -94,26 +93,26 @@ GNet::Timer::~Timer()
void GNet::Timer::startTimer( unsigned int time ) void GNet::Timer::startTimer( unsigned int time )
{ {
TimerUpdate update( *this , "start" ) ; TimerUpdate update ;
m_time = G::DateTime::now() + time ; m_time = G::DateTime::now() + time ;
// List::update() here
} }
void GNet::Timer::cancelTimer() void GNet::Timer::cancelTimer()
{ {
TimerUpdate update( *this , "cancel" ) ; TimerUpdate update ;
m_time = 0U ; m_time = 0U ;
// List::update() here
} }
void GNet::Timer::doTimeout() void GNet::Timer::doTimeout()
{ {
if( m_time != 0U ) G_ASSERT( m_time != 0U ) ;
{
m_time = 0U ; m_time = 0U ;
G_DEBUG( "GNet::Timer::doTimeout" ) ; onTimeout() ;
onTimeout() ; if( m_handler != NULL )
if( m_handler != NULL ) m_handler->onTimeout(*this) ;
m_handler->onTimeout(*this) ;
}
} }
void GNet::Timer::onTimeout() void GNet::Timer::onTimeout()
@ -131,7 +130,10 @@ G::DateTime::EpochTime GNet::Timer::t() const
GNet::TimerList * GNet::TimerList::m_this = NULL ; GNet::TimerList * GNet::TimerList::m_this = NULL ;
GNet::TimerList::TimerList() : GNet::TimerList::TimerList() :
m_changed(false) m_list_changed(false) ,
m_empty_set_timeout_hint(false) ,
m_soonest_changed(true) ,
m_soonest(99U)
{ {
if( m_this == NULL ) if( m_this == NULL )
m_this = this ; m_this = this ;
@ -145,7 +147,7 @@ GNet::TimerList::~TimerList()
void GNet::TimerList::add( Timer & t ) void GNet::TimerList::add( Timer & t )
{ {
m_changed = true ; m_list_changed = true ;
m_list.push_back( &t ) ; m_list.push_back( &t ) ;
} }
@ -156,21 +158,38 @@ void GNet::TimerList::remove( Timer & t )
if( *p == &t ) if( *p == &t )
{ {
m_list.erase( p ) ; m_list.erase( p ) ;
m_changed = true ; m_list_changed = true ;
break ; break ;
} }
} }
} }
void GNet::TimerList::update( G::DateTime::EpochTime t_old , void GNet::TimerList::update( G::DateTime::EpochTime t_old )
const std::string & op )
{ {
// after any change in the soonest() time notify the event loop
G::DateTime::EpochTime t_new = soonest() ; G::DateTime::EpochTime t_new = soonest() ;
//G_DEBUG( "GNet::TimerList::update: " << op << ": " << t_old << " -> " << t_new ) ; if( t_old != t_new )
G_IGNORE op.length() ; // pacify the compiler
if( t_old != t_new && EventLoop::exists() )
{ {
EventLoop::instance().setTimeout( t_new ) ; m_soonest_changed = true ;
if( EventLoop::exists() )
{
G_DEBUG( "GNet::TimerList::update: " << t_old << " -> " << t_new ) ;
EventLoop::instance().setTimeout( t_new , m_empty_set_timeout_hint ) ;
}
}
}
void GNet::TimerList::update()
{
// this overload just assumes that the soonest() time has probably changed
m_soonest_changed = true ;
if( EventLoop::exists() )
{
G::DateTime::EpochTime t_new = soonest() ;
G_DEBUG( "GNet::TimerList::update: ? -> " << t_new ) ;
EventLoop::instance().setTimeout( t_new , m_empty_set_timeout_hint ) ;
} }
} }
@ -186,9 +205,34 @@ G::DateTime::EpochTime GNet::TimerList::soonest() const
return result ; return result ;
} }
G::DateTime::EpochTime GNet::TimerList::soonest( int ) const
{
// this optimised overload is for interval() which
// gets called on _every_ fd event
if( m_soonest_changed )
{
TimerList * This = const_cast<TimerList*>(this) ;
This->m_soonest = soonest() ;
This->m_soonest_changed = false ;
}
//G_ASSERT( valid() ) ; // optimisation lost if this is active
return m_soonest ;
}
bool GNet::TimerList::valid() const
{
if( soonest() != m_soonest )
{
G_ERROR( "GNet::TimerList::valid: soonest()=" << soonest() << ", m_soonest=" << m_soonest ) ;
return false ;
}
return true ;
}
unsigned int GNet::TimerList::interval( bool & infinite ) const unsigned int GNet::TimerList::interval( bool & infinite ) const
{ {
G::DateTime::EpochTime then = soonest() ; G::DateTime::EpochTime then = soonest(0) ; // fast
infinite = then == 0U ; infinite = then == 0U ;
if( infinite ) if( infinite )
{ {
@ -219,30 +263,30 @@ void GNet::TimerList::doTimeouts()
G_DEBUG( "GNet::TimerList::doTimeouts" ) ; G_DEBUG( "GNet::TimerList::doTimeouts" ) ;
G::DateTime::EpochTime now = G::DateTime::now() ; G::DateTime::EpochTime now = G::DateTime::now() ;
// if the list changes break the loop and start again
do do
{ {
m_changed = false ; m_list_changed = false ;
for( List::iterator p = m_list.begin() ; p != m_list.end() ; ++p ) for( List::iterator p = m_list.begin() ; p != m_list.end() ; ++p )
{ {
if( now >= (*p)->t() ) G::DateTime::EpochTime t = (*p)->t() ;
if( t != 0U && now >= t )
{ {
(*p)->doTimeout() ; (*p)->doTimeout() ;
if( m_changed ) break ; if( m_list_changed ) break ;
} }
} }
} while( m_changed ) ; } while( m_list_changed ) ;
if( EventLoop::exists() ) // deal with any change in the soonest() time
EventLoop::instance().setTimeout( soonest() ) ; update() ;
} }
// === // ===
GNet::TimerUpdate::TimerUpdate( Timer & timer , const std::string & type ) : GNet::TimerUpdate::TimerUpdate()
m_timer(timer) ,
m_type(type)
{ {
m_soonest = TimerList::instance().soonest() ; m_old_soonest = TimerList::instance().soonest() ;
} }
GNet::TimerUpdate::~TimerUpdate() GNet::TimerUpdate::~TimerUpdate()
@ -250,7 +294,7 @@ GNet::TimerUpdate::~TimerUpdate()
try try
{ {
if( TimerList::instance(TimerList::NoThrow()) != NULL ) if( TimerList::instance(TimerList::NoThrow()) != NULL )
TimerList::instance().update( m_soonest , m_type ) ; TimerList::instance().update( m_old_soonest ) ;
} }
catch(...) catch(...)
{ {

View File

@ -117,10 +117,9 @@ public:
// Removes a timer from the list. // Removes a timer from the list.
// Used by Timer::~Timer(). // Used by Timer::~Timer().
void update( G::DateTime::EpochTime previous_soonest , void update( G::DateTime::EpochTime previous_soonest ) ;
const std::string & why ) ; // Called when one of the list's timers
// Called when one of the list's timers // has changed.
// has changed.
G::DateTime::EpochTime soonest() const ; G::DateTime::EpochTime soonest() const ;
// Returns the time of the first timer to expire, // Returns the time of the first timer to expire,
@ -145,12 +144,18 @@ public:
private: private:
TimerList( const TimerList & ) ; // not implemented TimerList( const TimerList & ) ; // not implemented
void operator=( const TimerList & ) ; // not implemented void operator=( const TimerList & ) ; // not implemented
G::DateTime::EpochTime soonest( int ) const ; // fast overload
void update() ;
bool valid() const ;
private: private:
static TimerList * m_this ; static TimerList * m_this ;
typedef std::list<Timer*> List ; typedef std::list<Timer*> List ;
List m_list ; List m_list ;
bool m_changed ; bool m_list_changed ;
bool m_empty_set_timeout_hint ;
bool m_soonest_changed ; // mutable
G::DateTime::EpochTime m_soonest ;
} ; } ;

View File

@ -43,6 +43,8 @@ libgsmtp_a_SOURCES = \
gnewfile.h \ gnewfile.h \
gnewmessage.cpp \ gnewmessage.cpp \
gnewmessage.h \ gnewmessage.h \
gprocessor.cpp \
gprocessor.h \
gprotocolmessage.cpp \ gprotocolmessage.cpp \
gprotocolmessage.h \ gprotocolmessage.h \
gprotocolmessageforward.cpp \ gprotocolmessageforward.cpp \

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -16,74 +16,94 @@
# #
# #
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../.. top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -91,7 +111,22 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
EXTRA_DIST = \ EXTRA_DIST = \
gmessagestore_win32.cpp \ gmessagestore_win32.cpp \
@ -119,6 +154,8 @@ libgsmtp_a_SOURCES = \
gnewfile.h \ gnewfile.h \
gnewmessage.cpp \ gnewmessage.cpp \
gnewmessage.h \ gnewmessage.h \
gprocessor.cpp \
gprocessor.h \
gprotocolmessage.cpp \ gprotocolmessage.cpp \
gprotocolmessage.h \ gprotocolmessage.h \
gprotocolmessageforward.cpp \ gprotocolmessageforward.cpp \
@ -150,6 +187,7 @@ libgsmtp_a_SOURCES = \
gxtext.h gxtext.h
subdir = src/gsmtp subdir = src/gsmtp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
@ -160,7 +198,7 @@ libgsmtp_a_LIBADD =
am_libgsmtp_a_OBJECTS = gadminserver.$(OBJEXT) gbase64.$(OBJEXT) \ am_libgsmtp_a_OBJECTS = gadminserver.$(OBJEXT) gbase64.$(OBJEXT) \
gclientprotocol.$(OBJEXT) gfilestore.$(OBJEXT) \ gclientprotocol.$(OBJEXT) gfilestore.$(OBJEXT) \
gmessagestore.$(OBJEXT) gmessagestore_unix.$(OBJEXT) \ gmessagestore.$(OBJEXT) gmessagestore_unix.$(OBJEXT) \
gnewfile.$(OBJEXT) gnewmessage.$(OBJEXT) \ gnewfile.$(OBJEXT) gnewmessage.$(OBJEXT) gprocessor.$(OBJEXT) \
gprotocolmessage.$(OBJEXT) gprotocolmessageforward.$(OBJEXT) \ gprotocolmessage.$(OBJEXT) gprotocolmessageforward.$(OBJEXT) \
gprotocolmessagescanner.$(OBJEXT) \ gprotocolmessagescanner.$(OBJEXT) \
gprotocolmessagestore.$(OBJEXT) gsasl_native.$(OBJEXT) \ gprotocolmessagestore.$(OBJEXT) gsasl_native.$(OBJEXT) \
@ -170,11 +208,7 @@ am_libgsmtp_a_OBJECTS = gadminserver.$(OBJEXT) gbase64.$(OBJEXT) \
gstoredmessage.$(OBJEXT) gverifier.$(OBJEXT) gxtext.$(OBJEXT) gstoredmessage.$(OBJEXT) gverifier.$(OBJEXT) gxtext.$(OBJEXT)
libgsmtp_a_OBJECTS = $(am_libgsmtp_a_OBJECTS) libgsmtp_a_OBJECTS = $(am_libgsmtp_a_OBJECTS)
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gadminserver.Po \ @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gadminserver.Po \
@ -184,6 +218,7 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ ./$(DEPDIR)/gmessagestore.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gmessagestore.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gmessagestore_unix.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gmessagestore_unix.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gnewfile.Po ./$(DEPDIR)/gnewmessage.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gnewfile.Po ./$(DEPDIR)/gnewmessage.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gprocessor.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gprotocolmessage.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gprotocolmessage.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gprotocolmessageforward.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gprotocolmessageforward.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gprotocolmessagescanner.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gprotocolmessagescanner.Po \
@ -202,14 +237,12 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
CXXLD = $(CXX) CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@ -o $@
CXXFLAGS = @CXXFLAGS@
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC) CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libgsmtp_a_SOURCES) DIST_SOURCES = $(libgsmtp_a_SOURCES)
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
SOURCES = $(libgsmtp_a_SOURCES) SOURCES = $(libgsmtp_a_SOURCES)
all: all-am all: all-am
@ -243,6 +276,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmessagestore_unix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmessagestore_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnewfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnewfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnewmessage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnewmessage.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprocessor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprotocolmessage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprotocolmessage.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprotocolmessageforward.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprotocolmessageforward.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprotocolmessagescanner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprotocolmessagescanner.Po@am__quote@
@ -258,26 +292,35 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gverifier.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gverifier.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gxtext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gxtext.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.cpp.o: .cpp.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
$(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCXX_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
.cpp.obj: .cpp.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
$(CXXCOMPILE) -c -o $@ `cygpath -w $<` @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
CXXDEPMODE = @CXXDEPMODE@ @am__fastdepCXX_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
uninstall-info-am: uninstall-info-am:
ETAGS = etags ETAGS = etags
ETAGSFLAGS = ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@ -303,20 +346,41 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique $$tags $$unique
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS: GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../.. top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -341,7 +405,6 @@ check: check-am
all-am: Makefile $(LIBRARIES) all-am: Makefile $(LIBRARIES)
installdirs: installdirs:
install: install-am install: install-am
install-exec: install-exec-am install-exec: install-exec-am
install-data: install-data-am install-data: install-data-am
@ -361,7 +424,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -371,9 +434,10 @@ clean: clean-am
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -rf ./$(DEPDIR)
distclean-am: clean-am distclean-compile distclean-depend \ -rm -f Makefile
distclean-generic distclean-tags distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am dvi: dvi-am
@ -394,25 +458,33 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-am: uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-generic \ .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES distclean distclean-compile \ clean-noinstLIBRARIES ctags distclean distclean-compile \
distclean-depend distclean-generic distclean-tags distdir dvi \ distclean-generic distclean-tags distdir dvi dvi-am info \
dvi-am info info-am install install-am install-data \ info-am install install-am install-data install-data-am \
install-data-am install-exec install-exec-am install-info \ install-exec install-exec-am install-info install-info-am \
install-info-am install-man install-strip installcheck \ install-man install-strip installcheck installcheck-am \
installcheck-am installdirs maintainer-clean \ installdirs maintainer-clean maintainer-clean-generic \
maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
mostlyclean-generic tags uninstall uninstall-am \ ps ps-am tags uninstall uninstall-am uninstall-info-am
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -35,12 +35,15 @@
#include <algorithm> // std::find() #include <algorithm> // std::find()
GSmtp::AdminPeer::AdminPeer( GNet::Server::PeerInfo peer_info , AdminServer & server , GSmtp::AdminPeer::AdminPeer( GNet::Server::PeerInfo peer_info , AdminServer & server ,
const std::string & server_address , bool with_terminate ) : const GNet::Address & local_address , const std::string & remote_address ,
const G::StringMap & extra_commands , bool with_terminate ) :
GNet::ServerPeer(peer_info) , GNet::ServerPeer(peer_info) ,
m_buffer(crlf()) , m_buffer(std::string(1U,'\n')) ,
m_server(server) , m_server(server) ,
m_server_address(server_address) , m_local_address(local_address) ,
m_remote_address(remote_address) ,
m_notifying(false) , m_notifying(false) ,
m_extra_commands(extra_commands) ,
m_with_terminate(with_terminate) m_with_terminate(with_terminate)
{ {
G_LOG_S( "GSmtp::AdminPeer: admin connection from " << peer_info.m_address.displayString() ) ; G_LOG_S( "GSmtp::AdminPeer: admin connection from " << peer_info.m_address.displayString() ) ;
@ -49,10 +52,12 @@ GSmtp::AdminPeer::AdminPeer( GNet::Server::PeerInfo peer_info , AdminServer & se
GSmtp::AdminPeer::~AdminPeer() GSmtp::AdminPeer::~AdminPeer()
{ {
// only safe because AdminServer::dtor calls serverCleanup() -- otherwise // AdminPeer objects are destroyed from within the AdminServer::dtor body
// the derived part of the server may already be destroyed // via the GNet::Server::serverCleanup() mechanism -- this allows this
// AdminPeer dtor to call the AdminServer safely
m_server.unregister( this ) ; m_server.unregister( this ) ;
if( m_client.get() ) m_client->doneSignal().disconnect() ; if( m_client.get() ) m_client->doneSignal().disconnect() ;
} }
void GSmtp::AdminPeer::clientDone( std::string s ) void GSmtp::AdminPeer::clientDone( std::string s )
@ -82,40 +87,45 @@ void GSmtp::AdminPeer::onData( const char * data , size_t n )
bool GSmtp::AdminPeer::processLine( const std::string & line ) bool GSmtp::AdminPeer::processLine( const std::string & line )
{ {
if( is(line,"FLUSH") ) if( is(line,"flush") )
{ {
flush( m_server_address ) ; flush() ;
} }
else if( is(line,"HELP") ) else if( is(line,"help") )
{ {
help() ; help() ;
prompt() ; prompt() ;
} }
else if( is(line,"INFO") ) else if( is(line,"info") )
{ {
info() ; info() ;
prompt() ; prompt() ;
} }
else if( is(line,"NOTIFY") ) else if( is(line,"notify") )
{ {
m_notifying = true ; m_notifying = true ;
prompt() ; prompt() ;
} }
else if( is(line,"LIST") ) else if( is(line,"list") )
{ {
list() ; list() ;
prompt() ; prompt() ;
} }
else if( is(line,"QUIT") ) else if( is(line,"quit") )
{ {
doDelete() ; doDelete() ;
return false ; return false ;
} }
else if( is(line,"TERMINATE") && m_with_terminate ) else if( is(line,"terminate") && m_with_terminate )
{ {
if( GNet::EventLoop::exists() ) if( GNet::EventLoop::exists() )
GNet::EventLoop::instance().quit() ; GNet::EventLoop::instance().quit() ;
} }
else if( find(line,m_extra_commands).first )
{
send( find(line,m_extra_commands).second ) ;
prompt() ;
}
else if( line.find_first_not_of(" \r\n\t") != std::string::npos ) else if( line.find_first_not_of(" \r\n\t") != std::string::npos )
{ {
send( "error: unrecognised command" ) ; send( "error: unrecognised command" ) ;
@ -135,38 +145,60 @@ std::string GSmtp::AdminPeer::crlf()
} }
//static //static
bool GSmtp::AdminPeer::is( const std::string & line_in , const char * key ) bool GSmtp::AdminPeer::is( const std::string & line_in , const std::string & key )
{ {
std::string line( line_in ) ; std::string line( line_in ) ;
G::Str::trim( line , " \t" ) ; G::Str::trim( line , " \t" ) ;
G::Str::toUpper( line ) ; G::Str::toLower( line ) ;
return line.find(key) == 0U ; return line.find(key) == 0U ;
} }
//static
std::pair<bool,std::string> GSmtp::AdminPeer::find( const std::string & line , const G::StringMap & map )
{
for( G::StringMap::const_iterator p = map.begin() ; p != map.end() ; ++p )
{
if( is(line,(*p).first) )
return std::make_pair(true,(*p).second) ;
}
return std::make_pair(false,std::string()) ;
}
void GSmtp::AdminPeer::help() void GSmtp::AdminPeer::help()
{ {
send( "commands: flush, help, info, list, notify, quit" ) ; G::Strings commands ;
commands.push_back( "flush" ) ;
commands.push_back( "help" ) ;
commands.push_back( "info" ) ;
commands.push_back( "list" ) ;
commands.push_back( "notify" ) ;
commands.push_back( "quit" ) ;
if( m_with_terminate ) commands.push_back( "terminate" ) ;
G::Strings extras = G::Str::keys( m_extra_commands ) ;
commands.splice( commands.end() , extras ) ;
commands.sort() ;
send( std::string("commands: ") + G::Str::join(commands,", ") ) ;
} }
void GSmtp::AdminPeer::flush( const std::string & address ) void GSmtp::AdminPeer::flush()
{ {
G_DEBUG( "GSmtp::AdminPeer: flush: \"" << address << "\"" ) ; G_DEBUG( "GSmtp::AdminPeer: flush: \"" << m_remote_address << "\"" ) ;
if( m_client.get() != NULL && m_client->busy() ) if( m_client.get() != NULL && m_client->busy() )
{ {
send( "error: still working" ) ; send( "error: still working" ) ;
} }
else if( address.empty() ) else if( m_remote_address.empty() )
{ {
send( "error: no remote server configured: use --forward-to" ) ; send( "error: no remote server configured: use --forward-to" ) ;
} }
else else
{ {
const bool quit_on_disconnect = false ; const bool quit_on_disconnect = false ;
m_client <<= new Client( m_server.store() , m_server.secrets() , m_client <<= new Client( m_server.store() , m_server.secrets() , m_local_address ,
quit_on_disconnect , m_server.responseTimeout() ) ; quit_on_disconnect , m_server.responseTimeout() ) ;
m_client->doneSignal().connect( G::slot(*this,&AdminPeer::clientDone) ) ; m_client->doneSignal().connect( G::slot(*this,&AdminPeer::clientDone) ) ;
std::string rc = m_client->startSending( address , m_server.connectionTimeout() ) ; std::string rc = m_client->startSending( m_remote_address , m_server.connectionTimeout() ) ;
if( rc.length() != 0U ) if( rc.length() != 0U )
{ {
send( std::string("error: ") + rc ) ; send( std::string("error: ") + rc ) ;
@ -184,7 +216,8 @@ void GSmtp::AdminPeer::prompt()
void GSmtp::AdminPeer::send( std::string line ) void GSmtp::AdminPeer::send( std::string line )
{ {
line.append( crlf() ) ; line.append( "\n" ) ;
G::Str::replaceAll( line , "\n" , crlf() ) ;
ssize_t rc = socket().write( line.data() , line.length() ) ; ssize_t rc = socket().write( line.data() , line.length() ) ;
if( rc < 0 || static_cast<size_t>(rc) < line.length() ) if( rc < 0 || static_cast<size_t>(rc) < line.length() )
doDelete() ; // onDelete() and "delete this" doDelete() ; // onDelete() and "delete this"
@ -193,7 +226,7 @@ void GSmtp::AdminPeer::send( std::string line )
void GSmtp::AdminPeer::notify( const std::string & s0 , const std::string & s1 , const std::string & s2 ) void GSmtp::AdminPeer::notify( const std::string & s0 , const std::string & s1 , const std::string & s2 )
{ {
if( m_notifying ) if( m_notifying )
send( crlf() + "EVENT: " + s0 + ": " + s1 + ": " + s2 ) ; send( std::string(1U,'\n') + "EVENT: " + s0 + ": " + s1 + ": " + s2 ) ;
} }
void GSmtp::AdminPeer::info() void GSmtp::AdminPeer::info()
@ -201,7 +234,7 @@ void GSmtp::AdminPeer::info()
std::ostringstream ss ; std::ostringstream ss ;
if( GNet::Monitor::instance() ) if( GNet::Monitor::instance() )
{ {
GNet::Monitor::instance()->report( ss , "" , crlf() ) ; GNet::Monitor::instance()->report( ss , "" , std::string(1U,'\n') ) ;
send( ss.str() ) ; send( ss.str() ) ;
} }
else else
@ -218,7 +251,7 @@ void GSmtp::AdminPeer::list()
{ {
std::auto_ptr<StoredMessage> message( iter.next() ) ; std::auto_ptr<StoredMessage> message( iter.next() ) ;
if( message.get() == NULL ) break ; if( message.get() == NULL ) break ;
ss << message->name() << crlf() ; ss << message->name() << "\n" ;
} }
std::string result = ss.str() ; std::string result = ss.str() ;
@ -232,16 +265,19 @@ void GSmtp::AdminPeer::list()
GSmtp::AdminServer::AdminServer( MessageStore & store , const Secrets & secrets , GSmtp::AdminServer::AdminServer( MessageStore & store , const Secrets & secrets ,
const GNet::Address & listening_address , bool allow_remote , const GNet::Address & listening_address , bool allow_remote ,
const std::string & address , unsigned int response_timeout , const GNet::Address & local_address , const std::string & remote_address ,
unsigned int connection_timeout , bool with_terminate ) : unsigned int response_timeout , unsigned int connection_timeout ,
GNet::Server( listening_address ) , const G::StringMap & extra_commands , bool with_terminate ) :
m_store( store ) , GNet::Server(listening_address) ,
m_secrets( secrets ) , m_store(store) ,
m_allow_remote( allow_remote ) , m_secrets(secrets) ,
m_server_address( address ) , m_local_address(local_address) ,
m_response_timeout( response_timeout ) , m_allow_remote(allow_remote) ,
m_connection_timeout( connection_timeout ) , m_remote_address(remote_address) ,
m_with_terminate( with_terminate ) m_response_timeout(response_timeout) ,
m_connection_timeout(connection_timeout) ,
m_extra_commands(extra_commands) ,
m_with_terminate(with_terminate)
{ {
G_DEBUG( "GSmtp::AdminServer: administrative interface listening on " << listening_address.displayString() ) ; G_DEBUG( "GSmtp::AdminServer: administrative interface listening on " << listening_address.displayString() ) ;
} }
@ -254,7 +290,8 @@ GSmtp::AdminServer::~AdminServer()
GNet::ServerPeer * GSmtp::AdminServer::newPeer( GNet::Server::PeerInfo peer_info ) GNet::ServerPeer * GSmtp::AdminServer::newPeer( GNet::Server::PeerInfo peer_info )
{ {
AdminPeer * peer = new AdminPeer( peer_info , *this , m_server_address , m_with_terminate ) ; AdminPeer * peer = new AdminPeer( peer_info , *this , m_local_address , m_remote_address ,
m_extra_commands , m_with_terminate ) ;
m_peers.push_back( peer ) ; m_peers.push_back( peer ) ;
return peer ; return peer ;
} }

View File

@ -27,12 +27,14 @@
#include "gdef.h" #include "gdef.h"
#include "gsmtp.h" #include "gsmtp.h"
#include "gserver.h" #include "gserver.h"
#include "gstr.h"
#include "glinebuffer.h" #include "glinebuffer.h"
#include "gserverprotocol.h" #include "gserverprotocol.h"
#include "gsmtpclient.h" #include "gsmtpclient.h"
#include <string> #include <string>
#include <list> #include <list>
#include <sstream> #include <sstream>
#include <utility>
namespace GSmtp namespace GSmtp
{ {
@ -47,8 +49,9 @@ namespace GSmtp
class GSmtp::AdminPeer : public GNet::ServerPeer class GSmtp::AdminPeer : public GNet::ServerPeer
{ {
public: public:
AdminPeer( GNet::Server::PeerInfo , AdminServer & server , const std::string & , bool ) ; AdminPeer( GNet::Server::PeerInfo , AdminServer & , const GNet::Address & local ,
// Constructor. const std::string & remote , const G::StringMap & extra_commands , bool with_terminate ) ;
// Constructor.
virtual ~AdminPeer() ; virtual ~AdminPeer() ;
// Destructor. // Destructor.
@ -63,21 +66,27 @@ private:
virtual void onData( const char * , size_t ) ; // from GNet::ServerPeer virtual void onData( const char * , size_t ) ; // from GNet::ServerPeer
virtual void clientDone( std::string ) ; // Client::doneSignal() virtual void clientDone( std::string ) ; // Client::doneSignal()
bool processLine( const std::string & line ) ; bool processLine( const std::string & line ) ;
static bool is( const std::string & , const char * ) ; static bool is( const std::string & , const std::string & ) ;
void flush( const std::string & ) ; static std::pair<bool,std::string> find( const std::string & line , const G::StringMap & map ) ;
void flush() ;
void help() ; void help() ;
void info() ; void info() ;
void list() ; void list() ;
void send( std::string ) ; void send( std::string ) ;
void warranty() ;
void version() ;
void copyright() ;
static std::string crlf() ; static std::string crlf() ;
void prompt() ; void prompt() ;
private: private:
GNet::LineBuffer m_buffer ; GNet::LineBuffer m_buffer ;
AdminServer & m_server ; AdminServer & m_server ;
GNet::Address m_local_address ;
std::string m_remote_address ;
std::auto_ptr<GSmtp::Client> m_client ; std::auto_ptr<GSmtp::Client> m_client ;
std::string m_server_address ;
bool m_notifying ; bool m_notifying ;
G::StringMap m_extra_commands ;
bool m_with_terminate ; bool m_with_terminate ;
} ; } ;
@ -89,9 +98,9 @@ class GSmtp::AdminServer : public GNet::Server
public: public:
AdminServer( MessageStore & store , const Secrets & client_secrets , AdminServer( MessageStore & store , const Secrets & client_secrets ,
const GNet::Address & listening_address , bool allow_remote , const GNet::Address & listening_address , bool allow_remote ,
const std::string & server_address , const GNet::Address & local_address , const std::string & remote_address ,
unsigned int response_timeout , unsigned int connection_timeout , unsigned int response_timeout , unsigned int connection_timeout ,
bool with_terminate ) ; const G::StringMap & extra_commands , bool with_terminate ) ;
// Constructor. The 'store' and 'client-secrets' references // Constructor. The 'store' and 'client-secrets' references
// are kept. // are kept.
@ -136,10 +145,12 @@ private:
PeerList m_peers ; PeerList m_peers ;
MessageStore & m_store ; MessageStore & m_store ;
const Secrets & m_secrets ; const Secrets & m_secrets ;
GNet::Address m_local_address ;
bool m_allow_remote ; bool m_allow_remote ;
std::string m_server_address ; std::string m_remote_address ;
unsigned int m_response_timeout ; unsigned int m_response_timeout ;
unsigned int m_connection_timeout ; unsigned int m_connection_timeout ;
G::StringMap m_extra_commands ;
bool m_with_terminate ; bool m_with_terminate ;
} ; } ;

View File

@ -52,20 +52,23 @@ namespace GSmtp
class GSmtp::FileIterator : public GSmtp::MessageStore::IteratorImp , public G::noncopyable class GSmtp::FileIterator : public GSmtp::MessageStore::IteratorImp , public G::noncopyable
{ {
public: public:
FileIterator( FileStore & store , const G::Directory & dir , bool lock ) ; FileIterator( FileStore & store , Processor & store_preprocessor , const G::Directory & dir , bool lock ) ;
virtual std::auto_ptr<GSmtp::StoredMessage> next() ; virtual std::auto_ptr<GSmtp::StoredMessage> next() ;
private: private:
FileStore & m_store ; FileStore & m_store ;
Processor & m_store_preprocessor ;
G::DirectoryIterator m_iter ; G::DirectoryIterator m_iter ;
bool m_lock ; bool m_lock ;
} ; } ;
// === // ===
GSmtp::FileIterator::FileIterator( FileStore & store , const G::Directory & dir , bool lock ) : GSmtp::FileIterator::FileIterator( FileStore & store , Processor & store_preprocessor ,
m_store(store) , const G::Directory & dir , bool lock ) :
m_iter(dir,"*.envelope") , m_store(store) ,
m_lock(lock) m_store_preprocessor(store_preprocessor) ,
m_iter(dir,"*.envelope") ,
m_lock(lock)
{ {
} }
@ -73,7 +76,7 @@ std::auto_ptr<GSmtp::StoredMessage> GSmtp::FileIterator::next()
{ {
while( !m_iter.error() && m_iter.more() ) while( !m_iter.error() && m_iter.more() )
{ {
std::auto_ptr<StoredFile> m( new StoredFile(m_store,m_iter.filePath()) ) ; std::auto_ptr<StoredFile> m( new StoredFile(m_store,m_store_preprocessor,m_iter.filePath()) ) ;
if( m_lock && !m->lock() ) if( m_lock && !m->lock() )
{ {
G_WARNING( "GSmtp::MessageStore: cannot lock file: \"" << m_iter.filePath() << "\"" ) ; G_WARNING( "GSmtp::MessageStore: cannot lock file: \"" << m_iter.filePath() << "\"" ) ;
@ -96,11 +99,14 @@ std::auto_ptr<GSmtp::StoredMessage> GSmtp::FileIterator::next()
// === // ===
GSmtp::FileStore::FileStore( const G::Path & dir , bool optimise ) : GSmtp::FileStore::FileStore( const G::Path & dir , const G::Executable & newfile_preprocessor_exe ,
m_seq(1UL) , const G::Executable & storedfile_preprocessor_exe , bool optimise ) :
m_dir(dir) , m_seq(1UL) ,
m_optimise(optimise) , m_dir(dir) ,
m_empty(false) m_optimise(optimise) ,
m_empty(false) ,
m_newfile_preprocessor(newfile_preprocessor_exe) ,
m_storedfile_preprocessor(storedfile_preprocessor_exe)
{ {
m_pid_modifier = static_cast<unsigned long>(G::DateTime::now()) % 1000000UL ; m_pid_modifier = static_cast<unsigned long>(G::DateTime::now()) % 1000000UL ;
checkPath( dir ) ; checkPath( dir ) ;
@ -215,14 +221,14 @@ bool GSmtp::FileStore::emptyCore() const
GSmtp::MessageStore::Iterator GSmtp::FileStore::iterator( bool lock ) GSmtp::MessageStore::Iterator GSmtp::FileStore::iterator( bool lock )
{ {
FileReader claim_reader ; FileReader claim_reader ;
return MessageStore::Iterator( new FileIterator(*this,G::Directory(m_dir),lock) ) ; return MessageStore::Iterator( new FileIterator(*this,m_storedfile_preprocessor,G::Directory(m_dir),lock) ) ;
} }
std::auto_ptr<GSmtp::StoredMessage> GSmtp::FileStore::get( unsigned long id ) std::auto_ptr<GSmtp::StoredMessage> GSmtp::FileStore::get( unsigned long id )
{ {
G::Path path = envelopePath( id ) ; G::Path path = envelopePath( id ) ;
std::auto_ptr<StoredFile> message( new StoredFile(*this,path) ) ; std::auto_ptr<StoredFile> message( new StoredFile(*this,m_storedfile_preprocessor,path) ) ;
if( ! message->lock() ) if( ! message->lock() )
throw GetError( path.str() + ": cannot lock the file" ) ; throw GetError( path.str() + ": cannot lock the file" ) ;
@ -242,11 +248,12 @@ std::auto_ptr<GSmtp::StoredMessage> GSmtp::FileStore::get( unsigned long id )
std::auto_ptr<GSmtp::NewMessage> GSmtp::FileStore::newMessage( const std::string & from ) std::auto_ptr<GSmtp::NewMessage> GSmtp::FileStore::newMessage( const std::string & from )
{ {
m_empty = false ; m_empty = false ;
return std::auto_ptr<NewMessage>( new NewFile(from,*this) ) ; return std::auto_ptr<NewMessage>( new NewFile(from,*this,m_newfile_preprocessor) ) ;
} }
void GSmtp::FileStore::updated( bool action ) void GSmtp::FileStore::updated( bool action )
{ {
G_DEBUG( "GSmtp::FileStore::updated" ) ;
m_signal.emit( action ) ; m_signal.emit( action ) ;
} }
@ -277,3 +284,4 @@ GSmtp::FileWriter::~FileWriter()
{ {
} }

View File

@ -30,10 +30,12 @@
#include "gdatetime.h" #include "gdatetime.h"
#include "gexception.h" #include "gexception.h"
#include "gprocess.h" #include "gprocess.h"
#include "gprocessor.h"
#include "gnoncopyable.h" #include "gnoncopyable.h"
#include "gslot.h" #include "gslot.h"
#include "groot.h" #include "groot.h"
#include "gpath.h" #include "gpath.h"
#include "gexe.h"
#include <memory> #include <memory>
#include <string> #include <string>
@ -46,7 +48,9 @@ namespace GSmtp
// Class: GSmtp::FileStore // Class: GSmtp::FileStore
// Description: A concrete implementation of the MessageStore // Description: A concrete implementation of the MessageStore
// interface, dealing in paired flat files. // interface dealing in paired flat files and with an optional
// external preprocessor program which is used to process files
// once they have been stored.
// //
// The implementation puts separate envelope and content files // The implementation puts separate envelope and content files
// in the spool directory. The content file is written first. // in the spool directory. The content file is written first.
@ -63,18 +67,25 @@ public:
G_EXCEPTION( InvalidDirectory , "invalid spool directory" ) ; G_EXCEPTION( InvalidDirectory , "invalid spool directory" ) ;
G_EXCEPTION( GetError , "error reading specific message" ) ; G_EXCEPTION( GetError , "error reading specific message" ) ;
explicit FileStore( const G::Path & dir , bool optimise = false ) ; explicit FileStore( const G::Path & dir , const G::Executable & newfile_preprocessor ,
// Constructor. Throws an exception if the const G::Executable & storedfile_preprocessor , bool optimise = false ) ;
// storage directory is invalid. // Constructor. Throws an exception if the storage directory
// // is invalid.
// If the optimise flag is set then the implementation //
// of empty() will be efficient for an empty file // Files are pre-processed after they have been stored
// store (ignoring failed and local-delivery messages). // if the newfile_preprocessor exe() path is not empty.
// This might be useful for applications in which the //
// main event loop is used to check for pending jobs. // Files are pre-processed after they have been extracted
// The disadvantage is that this process will not be // if the storedfile_preprocessor exe() path is not empty.
// sensititive to messages deposited into its spool //
// directory by other processes. // If the optimise flag is set then the implementation of
// empty() will be efficient for an empty filestore
// (ignoring failed and local-delivery messages). This
// might be useful for applications in which the main
// event loop is used to check for pending jobs. The
// disadvantage is that this process will not be
// sensititive to messages deposited into its spool
// directory by other processes.
unsigned long newSeq() ; unsigned long newSeq() ;
// Hands out a new non-zero sequence number. // Hands out a new non-zero sequence number.
@ -138,6 +149,8 @@ private:
bool m_empty ; // mutable bool m_empty ; // mutable
unsigned long m_pid_modifier ; unsigned long m_pid_modifier ;
G::Signal1<bool> m_signal ; G::Signal1<bool> m_signal ;
Processor m_newfile_preprocessor ;
Processor m_storedfile_preprocessor ;
} ; } ;
// Class: GSmtp::FileReader // Class: GSmtp::FileReader

View File

@ -27,7 +27,7 @@
#include "gnewfile.h" #include "gnewfile.h"
#include "gmemory.h" #include "gmemory.h"
#include "gprocess.h" #include "gprocess.h"
#include "gstr.h" #include "gstrings.h"
#include "groot.h" #include "groot.h"
#include "gfile.h" #include "gfile.h"
#include "gxtext.h" #include "gxtext.h"
@ -36,11 +36,9 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
bool GSmtp::NewFile::m_preprocess = false ; GSmtp::NewFile::NewFile( const std::string & from , FileStore & store , Processor & store_preprocessor ) :
G::Path GSmtp::NewFile::m_preprocessor ;
GSmtp::NewFile::NewFile( const std::string & from , FileStore & store ) :
m_store(store), m_store(store),
m_store_preprocessor(store_preprocessor) ,
m_from(from) , m_from(from) ,
m_eight_bit(false), m_eight_bit(false),
m_saved(false) , m_saved(false) ,
@ -59,6 +57,7 @@ GSmtp::NewFile::~NewFile()
{ {
try try
{ {
G_DEBUG( "GSmtp::NewFile::dtor: " << m_content_path ) ;
cleanup() ; cleanup() ;
m_store.updated( m_repoll ) ; m_store.updated( m_repoll ) ;
} }
@ -120,10 +119,11 @@ bool GSmtp::NewFile::store( const std::string & auth_id , const std::string & cl
bool cancelled = false ; bool cancelled = false ;
if( ok ) if( ok )
{ {
std::string output ; ok = m_store_preprocessor.process( m_content_path ) ;
ok = preprocess( m_content_path , cancelled , output ) ; cancelled = m_store_preprocessor.cancelled() ;
m_repoll = m_store_preprocessor.repoll() ;
if( !ok ) if( !ok )
reason = output.empty() ? std::string("pre-processing failed") : output ; reason = m_store_preprocessor.text("pre-processing failed") ;
} }
G_ASSERT( !(ok&&cancelled) ) ; G_ASSERT( !(ok&&cancelled) ) ;
@ -167,77 +167,6 @@ void GSmtp::NewFile::cleanup()
} }
} }
bool GSmtp::NewFile::preprocess( const G::Path & path , bool & cancelled , std::string & output )
{
if( ! m_preprocess ) return true ;
int exit_code = preprocessCore( path , output ) ;
bool is_ok = exit_code == 0 ;
bool is_special = exit_code >= 100 && exit_code <= 107 ;
bool is_failure = !is_ok && !is_special ;
if( is_special && ((exit_code-100)&2) != 0 )
{
m_repoll = true ;
}
// ok, fail or cancel
//
if( is_special && ((exit_code-100)&1) == 0 )
{
cancelled = true ;
G_LOG( "GSmtp::NewFile: message processing cancelled by preprocessor" ) ;
return false ;
}
else if( is_failure )
{
G_WARNING( "GSmtp::NewFile::preprocess: pre-processing failed: exit code " << exit_code ) ;
return false ;
}
else
{
return true ;
}
}
int GSmtp::NewFile::preprocessCore( const G::Path & path , std::string & output )
{
G_LOG( "GSmtp::NewFile::preprocess: " << m_preprocessor << " " << path ) ;
G::Strings args ;
args.push_back( path.str() ) ;
std::string raw_output ;
int exit_code = G::Process::spawn( G::Root::nobody() , m_preprocessor , args , &raw_output ) ;
output = parseOutput( raw_output ) ;
G_LOG( "GSmtp::NewFile::preprocess: exit status " << exit_code << " (\"" << output << "\")" ) ;
return exit_code ;
}
std::string GSmtp::NewFile::parseOutput( std::string s ) const
{
G_DEBUG( "GSmtp::NewFile::parseOutput: in: \"" << G::Str::toPrintableAscii(s) << "\"" ) ;
const std::string start("<<") ;
const std::string end(">>") ;
std::string result ;
G::Str::replaceAll( s , "\r\n" , "\n" ) ;
G::Str::replaceAll( s , "\r" , "\n" ) ;
G::Strings lines ;
G::Str::splitIntoFields( s , lines , "\n" ) ;
for( G::Strings::iterator p = lines.begin() ; p != lines.end() ; ++p )
{
std::string line = *p ;
size_t pos_start = line.find(start) ;
size_t pos_end = line.find(end) ;
if( pos_start == 0U && pos_end != std::string::npos )
{
result = G::Str::toPrintableAscii(line.substr(start.length(),pos_end-start.length())) ;
}
}
G_DEBUG( "GSmtp::NewFile::parseOutput: in: \"" << G::Str::toPrintableAscii(result) << "\"" ) ;
return result ;
}
void GSmtp::NewFile::deliver( const G::Strings & /*to*/ , void GSmtp::NewFile::deliver( const G::Strings & /*to*/ ,
const G::Path & content_path , const G::Path & envelope_path_now , const G::Path & content_path , const G::Path & envelope_path_now ,
const G::Path & envelope_path_later ) const G::Path & envelope_path_later )
@ -297,12 +226,3 @@ G::Path GSmtp::NewFile::contentPath() const
return m_content_path ; return m_content_path ;
} }
void GSmtp::NewFile::setPreprocessor( const G::Path & exe )
{
if( exe.isRelative() )
throw InvalidPath( exe.str() ) ;
m_preprocess = true ;
m_preprocessor = exe ;
}

View File

@ -27,7 +27,9 @@
#include "gdef.h" #include "gdef.h"
#include "gsmtp.h" #include "gsmtp.h"
#include "gfilestore.h" #include "gfilestore.h"
#include "gstrings.h"
#include "gnewmessage.h" #include "gnewmessage.h"
#include "gprocessor.h"
#include "gexception.h" #include "gexception.h"
#include <iostream> #include <iostream>
@ -46,8 +48,9 @@ class GSmtp::NewFile : public GSmtp::NewMessage
public: public:
G_EXCEPTION( InvalidPath , "invalid path -- must be absolute" ) ; G_EXCEPTION( InvalidPath , "invalid path -- must be absolute" ) ;
NewFile( const std::string & from , FileStore & store ) ; NewFile( const std::string & from , FileStore & store , Processor & store_preprocessor ) ;
// Constructor. // Constructor. The preprocessor is ignored if
// its exe() path is empty.
virtual ~NewFile() ; virtual ~NewFile() ;
// Destructor. // Destructor.
@ -66,7 +69,7 @@ public:
virtual unsigned long id() const ; virtual unsigned long id() const ;
// Returns the message's unique non-zero identifier. // Returns the message's unique non-zero identifier.
static void setPreprocessor( const G::Path & exe ) ; static void setPreprocessor( const G::Path & exe , const G::Strings & exe_args ) ;
// Defines a program which is used for pre-processing // Defines a program which is used for pre-processing
// messages before they are stored. // messages before they are stored.
@ -75,6 +78,7 @@ public:
private: private:
FileStore & m_store ; FileStore & m_store ;
Processor & m_store_preprocessor ;
unsigned long m_seq ; unsigned long m_seq ;
std::string m_from ; std::string m_from ;
G::Strings m_to_local ; G::Strings m_to_local ;
@ -84,8 +88,6 @@ private:
bool m_eight_bit ; bool m_eight_bit ;
bool m_saved ; bool m_saved ;
bool m_repoll ; bool m_repoll ;
static bool m_preprocess ;
static G::Path m_preprocessor ;
private: private:
bool saveEnvelope( std::ostream & , const std::string & where , bool saveEnvelope( std::ostream & , const std::string & where ,

124
src/gsmtp/gprocessor.cpp Normal file
View File

@ -0,0 +1,124 @@
//
// Copyright (C) 2001-2003 Graeme Walker <graeme_walker@users.sourceforge.net>
//
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ===
//
// gprocessor.cpp
//
#include "gdef.h"
#include "gsmtp.h"
#include "gprocess.h"
#include "gprocessor.h"
#include "gstr.h"
#include "groot.h"
#include "glog.h"
GSmtp::Processor::Processor( const G::Executable & exe ) :
m_exe(exe) ,
m_cancelled(false) ,
m_repoll(false)
{
}
bool GSmtp::Processor::cancelled() const
{
return m_cancelled ;
}
bool GSmtp::Processor::repoll() const
{
return m_repoll ;
}
std::string GSmtp::Processor::text( const std::string & default_ ) const
{
return m_text.empty() ? default_ : m_text ;
}
bool GSmtp::Processor::process( const G::Path & path )
{
if( m_exe.exe() == G::Path() )
return true ;
int exit_code = preprocessCore( path ) ;
bool is_ok = exit_code == 0 ;
bool is_special = exit_code >= 100 && exit_code <= 107 ;
bool is_failure = !is_ok && !is_special ;
if( is_special && ((exit_code-100)&2) != 0 )
{
m_repoll = true ;
}
// ok, fail or cancel
//
if( is_special && ((exit_code-100)&1) == 0 )
{
m_cancelled = true ;
G_LOG( "GSmtp::Processor: message processing cancelled by preprocessor" ) ;
return false ;
}
else if( is_failure )
{
G_WARNING( "GSmtp::Processor::preprocess: pre-processing failed: exit code " << exit_code ) ;
return false ;
}
else
{
return true ;
}
}
int GSmtp::Processor::preprocessCore( const G::Path & path )
{
G_LOG( "GSmtp::Processor::preprocess: " << m_exe.exe() << " " << path ) ;
G::Strings args( m_exe.args() ) ;
args.push_back( path.str() ) ;
std::string raw_output ;
int exit_code = G::Process::spawn( G::Root::nobody() , m_exe.exe() , args , &raw_output ) ;
m_text = parseOutput( raw_output ) ;
G_LOG( "GSmtp::Processor::preprocess: exit status " << exit_code << " (\"" << m_text << "\")" ) ;
return exit_code ;
}
std::string GSmtp::Processor::parseOutput( std::string s ) const
{
G_DEBUG( "GSmtp::Processor::parseOutput: in: \"" << G::Str::toPrintableAscii(s) << "\"" ) ;
const std::string start("<<") ;
const std::string end(">>") ;
std::string result ;
G::Str::replaceAll( s , "\r\n" , "\n" ) ;
G::Str::replaceAll( s , "\r" , "\n" ) ;
G::Strings lines ;
G::Str::splitIntoFields( s , lines , "\n" ) ;
for( G::Strings::iterator p = lines.begin() ; p != lines.end() ; ++p )
{
std::string line = *p ;
size_t pos_start = line.find(start) ;
size_t pos_end = line.find(end) ;
if( pos_start == 0U && pos_end != std::string::npos )
{
result = G::Str::toPrintableAscii(line.substr(start.length(),pos_end-start.length())) ;
}
}
G_DEBUG( "GSmtp::Processor::parseOutput: in: \"" << G::Str::toPrintableAscii(result) << "\"" ) ;
return result ;
}

81
src/gsmtp/gprocessor.h Normal file
View File

@ -0,0 +1,81 @@
//
// Copyright (C) 2001-2003 Graeme Walker <graeme_walker@users.sourceforge.net>
//
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ===
//
// gprocessor.h
//
#ifndef G_SMTP_PROCESSOR_H
#define G_SMTP_PROCESSOR_H
#include "gdef.h"
#include "gsmtp.h"
#include "gexe.h"
namespace GSmtp
{
class Processor ;
}
// Class: GSmtp::Processor
// Description: Processes message files using an external preprocessor
// program.
//
class GSmtp::Processor
{
public:
explicit Processor( const G::Executable & preprocessor ) ;
// Constructor.
bool process( const G::Path & message_file ) ;
// Runs the processor. Returns false on error.
// Does nothing, returning true if the exe
// path is empty.
//
// If the program's standard output contains
// a line like "<<text>>" then the text string
// is returned by text().
std::string text( const std::string & default_ = std::string() ) const ;
// Returns text output by the processor program,
// or the default text if no diagnostic output was
// received.
bool cancelled() const ;
// Returns true if further message processesing
// is to be cancelled.
bool repoll() const ;
// Returns true if the message store should be
// repolled immediately.
private:
Processor( const Processor & ) ; // not implemented
void operator=( const Processor & ) ; // not implemented
int preprocessCore( const G::Path & ) ;
std::string parseOutput( std::string ) const ;
private:
G::Executable m_exe ;
std::string m_text ;
bool m_cancelled ;
bool m_repoll ;
} ;
#endif

View File

@ -147,7 +147,8 @@ bool GSmtp::ProtocolMessageForward::forward( unsigned long id , bool & nothing_t
} }
else else
{ {
m_client <<= new GSmtp::Client( message , m_client_secrets , m_response_timeout ) ; GNet::Address local_address( 0U ) ;
m_client <<= new GSmtp::Client( message, m_client_secrets, local_address, m_response_timeout ) ;
m_client->doneSignal().connect( G::slot(*this,&ProtocolMessageForward::clientDone) ) ; m_client->doneSignal().connect( G::slot(*this,&ProtocolMessageForward::clientDone) ) ;
std::string reason = m_client->startSending( m_server , m_connection_timeout ) ; std::string reason = m_client->startSending( m_server , m_connection_timeout ) ;

View File

@ -46,13 +46,15 @@ GSmtp::ProtocolMessageScanner::ProtocolMessageScanner( MessageStore & store ,
{ {
G_DEBUG( "GSmtp::ProtocolMessageScanner::ctor" ) ; G_DEBUG( "GSmtp::ProtocolMessageScanner::ctor" ) ;
scannerInit() ; scannerInit() ;
ProtocolMessageForward::storageDoneSignal().disconnect() ;
ProtocolMessageForward::storageDoneSignal().connect( G::slot(*this,&ProtocolMessageScanner::storageDone) ) ; // rewire the base class slot/signal
storageDoneSignal().disconnect() ;
storageDoneSignal().connect( G::slot(*this,&ProtocolMessageScanner::storageDone) ) ;
} }
void GSmtp::ProtocolMessageScanner::scannerInit() void GSmtp::ProtocolMessageScanner::scannerInit()
{ {
storageDoneSignal().disconnect() ; // base-class signal storageDoneSignal().disconnect() ; // base-class signal
m_scanner_client <<= m_scanner_client <<=
new ScannerClient(m_scanner_server,m_scanner_connection_timeout,m_scanner_response_timeout) ; new ScannerClient(m_scanner_server,m_scanner_connection_timeout,m_scanner_response_timeout) ;
m_scanner_client->connectedSignal().connect( G::slot(*this,&ProtocolMessageScanner::connectDone) ) ; m_scanner_client->connectedSignal().connect( G::slot(*this,&ProtocolMessageScanner::connectDone) ) ;

View File

@ -234,8 +234,7 @@ std::string GSmtp::ScannerClient::servicePart( const std::string & s )
std::string GSmtp::ScannerClient::request( const G::Path & path ) const std::string GSmtp::ScannerClient::request( const G::Path & path ) const
{ {
std::string prefix = "AREA: " ; return path.str() + "\n" ;
return prefix + path.str() + "\n" ;
} }
bool GSmtp::ScannerClient::isDone() const bool GSmtp::ScannerClient::isDone() const

View File

@ -29,7 +29,66 @@
#include "gstr.h" #include "gstr.h"
#include <fstream> #include <fstream>
GSmtp::Secrets::Secrets( const G::Path & path , const std::string & debug_name ) : // Class: GSmtp::SecretsImp
// Description: A private pimple-pattern implemtation class used by GSmtp::Secrets.
//
class GSmtp::SecretsImp
{
public:
SecretsImp( const G::Path & path , const std::string & name ) ;
~SecretsImp() ;
bool valid() const ;
std::string id( const std::string & mechanism ) const ;
std::string secret( const std::string & mechanism ) const ;
std::string secret( const std::string & mechanism , const std::string & id ) const ;
private:
void process( std::string mechanism , std::string side , std::string id , std::string secret ) ;
void read( std::istream & ) ;
private:
typedef std::map<std::string,std::string> Map ;
G::Path m_path ;
std::string m_debug_name ;
bool m_valid ;
Map m_map ;
} ;
// ===
GSmtp::Secrets::Secrets( const std::string & path , const std::string & name ) :
m_imp( new SecretsImp(G::Path(path),name) )
{
}
GSmtp::Secrets::~Secrets()
{
delete m_imp ;
}
bool GSmtp::Secrets::valid() const
{
return m_imp->valid() ;
}
std::string GSmtp::Secrets::id( const std::string & mechanism ) const
{
return m_imp->id( mechanism ) ;
}
std::string GSmtp::Secrets::secret( const std::string & mechanism ) const
{
return m_imp->secret( mechanism ) ;
}
std::string GSmtp::Secrets::secret( const std::string & mechanism , const std::string & id ) const
{
return m_imp->secret( mechanism , id ) ;
}
// ===
GSmtp::SecretsImp::SecretsImp( const G::Path & path , const std::string & debug_name ) :
m_path(path) , m_path(path) ,
m_debug_name(debug_name) m_debug_name(debug_name)
{ {
@ -44,7 +103,7 @@ GSmtp::Secrets::Secrets( const G::Path & path , const std::string & debug_name )
G::Root claim_root ; G::Root claim_root ;
std::ifstream file( path.str().c_str() ) ; std::ifstream file( path.str().c_str() ) ;
if( !file.good() ) if( !file.good() )
throw OpenError( path.str() ) ; throw Secrets::OpenError( path.str() ) ;
read( file ) ; read( file ) ;
m_valid = m_map.size() != 0U ; m_valid = m_map.size() != 0U ;
@ -58,7 +117,7 @@ GSmtp::Secrets::Secrets( const G::Path & path , const std::string & debug_name )
} }
} }
void GSmtp::Secrets::read( std::istream & file ) void GSmtp::SecretsImp::read( std::istream & file )
{ {
while( file.good() ) while( file.good() )
{ {
@ -75,7 +134,7 @@ void GSmtp::Secrets::read( std::istream & file )
} }
} }
void GSmtp::Secrets::process( std::string mechanism , std::string side , std::string id , std::string secret ) void GSmtp::SecretsImp::process( std::string mechanism , std::string side , std::string id , std::string secret )
{ {
G::Str::toUpper( mechanism ) ; G::Str::toUpper( mechanism ) ;
const bool client = side.at(0U) == 'c' || side.at(0U) == 'C' ; const bool client = side.at(0U) == 'c' || side.at(0U) == 'C' ;
@ -94,16 +153,16 @@ void GSmtp::Secrets::process( std::string mechanism , std::string side , std::st
m_map.insert( std::make_pair(key,value) ) ; m_map.insert( std::make_pair(key,value) ) ;
} }
GSmtp::Secrets::~Secrets() GSmtp::SecretsImp::~SecretsImp()
{ {
} }
bool GSmtp::Secrets::valid() const bool GSmtp::SecretsImp::valid() const
{ {
return m_valid ; return m_valid ;
} }
std::string GSmtp::Secrets::id( const std::string & mechanism ) const std::string GSmtp::SecretsImp::id( const std::string & mechanism ) const
{ {
Map::const_iterator p = m_map.find( mechanism+" client" ) ; Map::const_iterator p = m_map.find( mechanism+" client" ) ;
std::string result ; std::string result ;
@ -113,7 +172,7 @@ std::string GSmtp::Secrets::id( const std::string & mechanism ) const
return result ; return result ;
} }
std::string GSmtp::Secrets::secret( const std::string & mechanism ) const std::string GSmtp::SecretsImp::secret( const std::string & mechanism ) const
{ {
Map::const_iterator p = m_map.find( mechanism+" client" ) ; Map::const_iterator p = m_map.find( mechanism+" client" ) ;
if( p == m_map.end() || (*p).second.find(" ") == std::string::npos ) if( p == m_map.end() || (*p).second.find(" ") == std::string::npos )
@ -122,7 +181,7 @@ std::string GSmtp::Secrets::secret( const std::string & mechanism ) const
return Xtext::decode( (*p).second.substr((*p).second.find(" ")+1U) ) ; return Xtext::decode( (*p).second.substr((*p).second.find(" ")+1U) ) ;
} }
std::string GSmtp::Secrets::secret( const std::string & mechanism , const std::string & id ) const std::string GSmtp::SecretsImp::secret( const std::string & mechanism , const std::string & id ) const
{ {
Map::const_iterator p = m_map.find( mechanism+" server "+Xtext::encode(id) ) ; Map::const_iterator p = m_map.find( mechanism+" server "+Xtext::encode(id) ) ;
if( p == m_map.end() ) if( p == m_map.end() )

View File

@ -34,11 +34,13 @@
namespace GSmtp namespace GSmtp
{ {
class Secrets ; class Secrets ;
class SecretsImp ;
} }
// Class: GSmtp::Secrets // Class: GSmtp::Secrets
// Description: A simple interface to a store of secrets as used in // Description: A simple interface to a store of secrets as used in
// authentication. // authentication. The default implementation uses a flat file.
//
// See also: GSmtp::SaslClient, GSmtp::SaslServer // See also: GSmtp::SaslClient, GSmtp::SaslServer
// //
class GSmtp::Secrets class GSmtp::Secrets
@ -46,8 +48,10 @@ class GSmtp::Secrets
public: public:
G_EXCEPTION( OpenError , "cannot read secrets file" ) ; G_EXCEPTION( OpenError , "cannot read secrets file" ) ;
explicit Secrets( const G::Path & path , const std::string & debug_name = std::string() ) ; explicit Secrets( const std::string & storage_path , const std::string & debug_name = std::string() ) ;
// Constructor. // Constructor. In principle the storage_path can
// be a path to a file, a database connection
// string, etc.
~Secrets() ; ~Secrets() ;
// Destructor. // Destructor.
@ -68,17 +72,11 @@ public:
// empty string if not a valid id. // empty string if not a valid id.
private: private:
void read( std::istream & ) ;
void process( std::string , std::string , std::string , std::string ) ;
Secrets( const Secrets & ) ; // not implemented Secrets( const Secrets & ) ; // not implemented
void operator=( const Secrets & ) ; // not implemented void operator=( const Secrets & ) ; // not implemented
private: private:
typedef std::map<std::string,std::string> Map ; SecretsImp * m_imp ;
G::Path m_path ;
std::string m_debug_name ;
bool m_valid ;
Map m_map ;
} ; } ;
#endif #endif

View File

@ -20,6 +20,9 @@
// //
// gserverprotocol.cpp // gserverprotocol.cpp
// //
// The "now deleted" comments indicate that the Sender::protocolSend()
// may have done a "delete this" if it could not stuff the string
// down the wire. Sender::protocolDone() can also do "delete this".
#include "gdef.h" #include "gdef.h"
#include "gsmtp.h" #include "gsmtp.h"
@ -75,6 +78,13 @@ GSmtp::ServerProtocol::ServerProtocol( Sender & sender , Verifier & verifier , P
void GSmtp::ServerProtocol::init( const std::string & ident ) void GSmtp::ServerProtocol::init( const std::string & ident )
{ {
sendGreeting( m_thishost , ident ) ; sendGreeting( m_thishost , ident ) ;
// now deleted
}
GSmtp::ServerProtocol::~ServerProtocol()
{
m_pmessage.doneSignal().disconnect() ;
m_pmessage.preparedSignal().disconnect() ;
} }
void GSmtp::ServerProtocol::sendGreeting( const std::string & thishost , const std::string & ident ) void GSmtp::ServerProtocol::sendGreeting( const std::string & thishost , const std::string & ident )
@ -124,6 +134,7 @@ bool GSmtp::ServerProtocol::apply( const std::string & line )
const bool protocol_error = new_state == s_Any ; const bool protocol_error = new_state == s_Any ;
if( protocol_error ) if( protocol_error )
sendOutOfSequence( line ) ; sendOutOfSequence( line ) ;
// now deleted
return new_state == sEnd ; return new_state == sEnd ;
} }
} }
@ -136,19 +147,21 @@ void GSmtp::ServerProtocol::processDone( bool success , unsigned long , std::str
{ {
m_fsm.reset( sIdle ) ; m_fsm.reset( sIdle ) ;
sendCompletionReply( success , reason ) ; sendCompletionReply( success , reason ) ;
// now deleted
} }
} }
void GSmtp::ServerProtocol::doQuit( const std::string & , bool & ) void GSmtp::ServerProtocol::doQuit( const std::string & , bool & )
{ {
// (could call sendClosing() here, but if it fails it does "delete this". sendClosing() ;
m_sender.protocolDone() ; m_sender.protocolDone() ;
// do nothing more -- this object may have been deleted in protocolDone() // now deleted
} }
void GSmtp::ServerProtocol::doNoop( const std::string & , bool & ) void GSmtp::ServerProtocol::doNoop( const std::string & , bool & )
{ {
sendOk() ; sendOk() ;
// now deleted
} }
void GSmtp::ServerProtocol::doVrfy( const std::string & line , bool & ) void GSmtp::ServerProtocol::doVrfy( const std::string & line , bool & )
@ -158,10 +171,13 @@ void GSmtp::ServerProtocol::doVrfy( const std::string & line , bool & )
bool local = rc.is_local ; bool local = rc.is_local ;
if( local && rc.full_name.length() ) if( local && rc.full_name.length() )
sendVerified( rc.full_name ) ; sendVerified( rc.full_name ) ;
// now deleted
else if( local ) else if( local )
sendNotVerified( mbox ) ; sendNotVerified( mbox ) ;
// now deleted
else else
sendWillAccept( mbox ) ; sendWillAccept( mbox ) ;
// now deleted
} }
GSmtp::Verifier::Status GSmtp::ServerProtocol::verify( const std::string & to , const std::string & from ) const GSmtp::Verifier::Status GSmtp::ServerProtocol::verify( const std::string & to , const std::string & from ) const
@ -191,12 +207,14 @@ void GSmtp::ServerProtocol::doEhlo( const std::string & line , bool & predicate
{ {
predicate = false ; predicate = false ;
sendMissingParameter() ; sendMissingParameter() ;
// now deleted
} }
else else
{ {
m_peer_name = peer_name ; m_peer_name = peer_name ;
m_pmessage.clear() ; m_pmessage.clear() ;
sendEhloReply( m_thishost ) ; sendEhloReply( m_thishost ) ;
// now deleted
} }
} }
@ -207,12 +225,14 @@ void GSmtp::ServerProtocol::doHelo( const std::string & line , bool & predicate
{ {
predicate = false ; predicate = false ;
sendMissingParameter() ; sendMissingParameter() ;
// now deleted
} }
else else
{ {
m_peer_name = peer_name ; m_peer_name = peer_name ;
m_pmessage.clear() ; m_pmessage.clear() ;
sendHeloReply( m_thishost ) ; sendHeloReply( m_thishost ) ;
// now deleted
} }
} }
@ -233,23 +253,27 @@ void GSmtp::ServerProtocol::doAuth( const std::string & line , bool & predicate
G_WARNING( "GSmtp::ServerProtocol: too many AUTHs" ) ; G_WARNING( "GSmtp::ServerProtocol: too many AUTHs" ) ;
predicate = false ; // => idle predicate = false ; // => idle
sendOutOfSequence(line) ; // see RFC2554 "Restrictions" sendOutOfSequence(line) ; // see RFC2554 "Restrictions"
// now deleted
} }
else if( ! m_sasl.init(mechanism) ) else if( ! m_sasl.init(mechanism) )
{ {
G_WARNING( "GSmtp::ServerProtocol: request for unsupported AUTH mechanism: " << mechanism ) ; G_WARNING( "GSmtp::ServerProtocol: request for unsupported AUTH mechanism: " << mechanism ) ;
predicate = false ; // => idle predicate = false ; // => idle
send( "504 Unsupported authentication mechanism" ) ; send( "504 Unsupported authentication mechanism" ) ;
// now deleted
} }
else if( got_initial_response && ! Base64::valid(initial_response) ) else if( got_initial_response && ! Base64::valid(initial_response) )
{ {
G_WARNING( "GSmtp::ServerProtocol: invalid base64 encoding of AUTH parameter" ) ; G_WARNING( "GSmtp::ServerProtocol: invalid base64 encoding of AUTH parameter" ) ;
predicate = false ; // => idle predicate = false ; // => idle
send( "501 Invalid argument" ) ; send( "501 Invalid argument" ) ;
// now deleted
} }
else if( got_initial_response && m_sasl.mustChallenge() ) else if( got_initial_response && m_sasl.mustChallenge() )
{ {
predicate = false ; // => idle predicate = false ; // => idle
sendAuthDone( false ) ; sendAuthDone( false ) ;
// now deleted
} }
else if( got_initial_response ) else if( got_initial_response )
{ {
@ -261,15 +285,18 @@ void GSmtp::ServerProtocol::doAuth( const std::string & line , bool & predicate
predicate = false ; // => idle predicate = false ; // => idle
m_authenticated = m_sasl.authenticated() ; m_authenticated = m_sasl.authenticated() ;
sendAuthDone( m_sasl.authenticated() ) ; sendAuthDone( m_sasl.authenticated() ) ;
// now deleted
} }
else else
{ {
sendChallenge( next_challenge ) ; sendChallenge( next_challenge ) ;
// now deleted
} }
} }
else else
{ {
sendChallenge( m_sasl.initialChallenge() ) ; sendChallenge( m_sasl.initialChallenge() ) ;
// now deleted
} }
} }
@ -279,6 +306,7 @@ void GSmtp::ServerProtocol::sendAuthDone( bool ok )
send( "235 Authentication sucessful" ) ; send( "235 Authentication sucessful" ) ;
else else
send( "535 Authentication failed" ) ; send( "535 Authentication failed" ) ;
// now deleted
} }
void GSmtp::ServerProtocol::doAuthData( const std::string & line , bool & predicate ) void GSmtp::ServerProtocol::doAuthData( const std::string & line , bool & predicate )
@ -287,12 +315,14 @@ void GSmtp::ServerProtocol::doAuthData( const std::string & line , bool & predic
{ {
predicate = false ; // => idle predicate = false ; // => idle
send( "501 authentication cancelled" ) ; send( "501 authentication cancelled" ) ;
// now deleted
} }
else if( ! Base64::valid(line) ) else if( ! Base64::valid(line) )
{ {
G_WARNING( "GSmtp::ServerProtocol: invalid base64 encoding of authentication response" ) ; G_WARNING( "GSmtp::ServerProtocol: invalid base64 encoding of authentication response" ) ;
predicate = false ; // => idle predicate = false ; // => idle
sendAuthDone( false ) ; sendAuthDone( false ) ;
// now deleted
} }
else else
{ {
@ -303,10 +333,12 @@ void GSmtp::ServerProtocol::doAuthData( const std::string & line , bool & predic
predicate = false ; // => idle predicate = false ; // => idle
m_authenticated = m_sasl.authenticated() ; m_authenticated = m_sasl.authenticated() ;
sendAuthDone( m_sasl.authenticated() ) ; sendAuthDone( m_sasl.authenticated() ) ;
// now deleted
} }
else else
{ {
sendChallenge( next_challenge ) ; sendChallenge( next_challenge ) ;
// now deleted
} }
} }
} }
@ -322,6 +354,7 @@ void GSmtp::ServerProtocol::doMailPrepare( const std::string & line , bool & pre
{ {
predicate = false ; predicate = false ;
sendAuthRequired() ; sendAuthRequired() ;
// now deleted
} }
else else
{ {
@ -338,6 +371,7 @@ void GSmtp::ServerProtocol::doMailPrepare( const std::string & line , bool & pre
else else
{ {
sendBadFrom( from ) ; sendBadFrom( from ) ;
// now deleted
} }
} }
} }
@ -361,12 +395,14 @@ void GSmtp::ServerProtocol::doMail( const std::string & line , bool & predicate
if( line.empty() ) if( line.empty() )
{ {
sendMailReply() ; sendMailReply() ;
// now deleted
} }
else else
{ {
predicate = false ; predicate = false ;
bool temporary = line.at(0U) == ' ' ; bool temporary = line.at(0U) == ' ' ;
sendMailError( line.substr(temporary?1U:0U) , temporary ) ; sendMailError( line.substr(temporary?1U:0U) , temporary ) ;
// now deleted
} }
} }
@ -378,41 +414,48 @@ void GSmtp::ServerProtocol::doRcpt( const std::string & line , bool & predicate
predicate = ok ; predicate = ok ;
if( ok ) if( ok )
sendRcptReply() ; sendRcptReply() ;
// now deleted
else else
sendBadTo( G::Str::toPrintableAscii(status.reason) ) ; sendBadTo( G::Str::toPrintableAscii(status.reason) ) ;
// now deleted
} }
void GSmtp::ServerProtocol::doUnknown( const std::string & line , bool & ) void GSmtp::ServerProtocol::doUnknown( const std::string & line , bool & )
{ {
sendUnrecognised( line ) ; sendUnrecognised( line ) ;
// now deleted
} }
void GSmtp::ServerProtocol::doRset( const std::string & , bool & ) void GSmtp::ServerProtocol::doRset( const std::string & , bool & )
{ {
m_pmessage.clear() ; m_pmessage.clear() ;
// (could also reset authentication here)
sendRsetReply() ; sendRsetReply() ;
// now deleted
} }
void GSmtp::ServerProtocol::doNoRecipients( const std::string & , bool & ) void GSmtp::ServerProtocol::doNoRecipients( const std::string & , bool & )
{ {
sendNoRecipients() ; sendNoRecipients() ;
// now deleted
} }
void GSmtp::ServerProtocol::doData( const std::string & , bool & ) void GSmtp::ServerProtocol::doData( const std::string & , bool & )
{ {
m_pmessage.addReceived( receivedLine() ) ; m_pmessage.addReceived( receivedLine() ) ;
sendDataReply() ; sendDataReply() ;
// now deleted
} }
void GSmtp::ServerProtocol::sendOutOfSequence( const std::string & ) void GSmtp::ServerProtocol::sendOutOfSequence( const std::string & )
{ {
send( "503 command out of sequence -- use RSET to resynchronise" ) ; send( "503 command out of sequence -- use RSET to resynchronise" ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendMissingParameter() void GSmtp::ServerProtocol::sendMissingParameter()
{ {
send( "501 parameter required" ) ; send( "501 parameter required" ) ;
// now deleted
} }
bool GSmtp::ServerProtocol::isEndOfText( const std::string & line ) const bool GSmtp::ServerProtocol::isEndOfText( const std::string & line ) const
@ -462,81 +505,98 @@ GSmtp::ServerProtocol::Event GSmtp::ServerProtocol::commandEvent( const std::str
void GSmtp::ServerProtocol::sendClosing() void GSmtp::ServerProtocol::sendClosing()
{ {
send( "221 closing connection" ) ; bool allow_delete_this = false ;
send( "221 closing connection" , allow_delete_this ) ;
// now deleted -- NOT
} }
void GSmtp::ServerProtocol::sendVerified( const std::string & user ) void GSmtp::ServerProtocol::sendVerified( const std::string & user )
{ {
send( std::string("250 ") + user ) ; send( std::string("250 ") + user ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendNotVerified( const std::string & user ) void GSmtp::ServerProtocol::sendNotVerified( const std::string & user )
{ {
send( std::string("550 no such mailbox: ") + user ) ; send( std::string("550 no such mailbox: ") + user ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendWillAccept( const std::string & user ) void GSmtp::ServerProtocol::sendWillAccept( const std::string & user )
{ {
send( std::string("252 cannot verify but will accept: ") + user ) ; send( std::string("252 cannot verify but will accept: ") + user ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendUnrecognised( const std::string & line ) void GSmtp::ServerProtocol::sendUnrecognised( const std::string & line )
{ {
send( "500 command unrecognized: \"" + line + std::string("\"") ) ; send( "500 command unrecognized: \"" + line + std::string("\"") ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendAuthRequired() void GSmtp::ServerProtocol::sendAuthRequired()
{ {
send( "530 authentication required" ) ; send( "530 authentication required" ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendNoRecipients() void GSmtp::ServerProtocol::sendNoRecipients()
{ {
send( "554 no valid recipients" ) ; send( "554 no valid recipients" ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendDataReply() void GSmtp::ServerProtocol::sendDataReply()
{ {
send( "354 start mail input -- end with <CRLF>.<CRLF>" ) ; send( "354 start mail input -- end with <CRLF>.<CRLF>" ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendRsetReply() void GSmtp::ServerProtocol::sendRsetReply()
{ {
send( "250 state reset" ) ; send( "250 state reset" ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendMailReply() void GSmtp::ServerProtocol::sendMailReply()
{ {
sendOk() ; sendOk() ;
// now deleted
} }
void GSmtp::ServerProtocol::sendMailError( const std::string & reason , bool temporary ) void GSmtp::ServerProtocol::sendMailError( const std::string & reason , bool temporary )
{ {
std::string number( temporary ? "452" : "550" ) ; std::string number( temporary ? "452" : "550" ) ;
send( number + " " + reason ) ; send( number + " " + reason ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendCompletionReply( bool ok , const std::string & reason ) void GSmtp::ServerProtocol::sendCompletionReply( bool ok , const std::string & reason )
{ {
if( ok ) if( ok )
sendOk() ; sendOk() ;
// now deleted
else else
send( std::string("452 message processing failed: ") + reason ) ; send( std::string("452 message processing failed: ") + reason ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendRcptReply() void GSmtp::ServerProtocol::sendRcptReply()
{ {
sendOk() ; sendOk() ;
// now deleted
} }
void GSmtp::ServerProtocol::sendBadFrom( const std::string & /*from*/ ) void GSmtp::ServerProtocol::sendBadFrom( const std::string & /*from*/ )
{ {
send( "553 mailbox name not allowed" ) ; send( "553 mailbox name not allowed" ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendBadTo( const std::string & text ) void GSmtp::ServerProtocol::sendBadTo( const std::string & text )
{ {
send( std::string("550 mailbox unavailable: ") + text ) ; send( std::string("550 mailbox unavailable: ") + text ) ;
// now deleted
} }
void GSmtp::ServerProtocol::sendEhloReply( const std::string & domain ) void GSmtp::ServerProtocol::sendEhloReply( const std::string & domain )
@ -552,11 +612,13 @@ void GSmtp::ServerProtocol::sendEhloReply( const std::string & domain )
void GSmtp::ServerProtocol::sendHeloReply( const std::string & /*domain*/ ) void GSmtp::ServerProtocol::sendHeloReply( const std::string & /*domain*/ )
{ {
sendOk() ; sendOk() ;
// now deleted
} }
void GSmtp::ServerProtocol::sendOk() void GSmtp::ServerProtocol::sendOk()
{ {
send( "250 OK" ) ; send( "250 OK" ) ;
// now deleted
} }
//static //static
@ -565,17 +627,12 @@ std::string GSmtp::ServerProtocol::crlf()
return std::string( "\015\012" ) ; return std::string( "\015\012" ) ;
} }
void GSmtp::ServerProtocol::send( std::string line ) void GSmtp::ServerProtocol::send( std::string line , bool allow_delete_this )
{ {
G_LOG( "GSmtp::ServerProtocol: tx>>: \"" << line << "\"" ) ; G_LOG( "GSmtp::ServerProtocol: tx>>: \"" << line << "\"" ) ;
line.append( crlf() ) ; line.append( crlf() ) ;
m_sender.protocolSend( line ) ; m_sender.protocolSend( line , allow_delete_this ) ;
} // now deleted
GSmtp::ServerProtocol::~ServerProtocol()
{
m_pmessage.doneSignal().disconnect() ;
m_pmessage.preparedSignal().disconnect() ;
} }
std::string GSmtp::ServerProtocol::parseFrom( const std::string & line ) const std::string GSmtp::ServerProtocol::parseFrom( const std::string & line ) const

View File

@ -65,7 +65,7 @@ class GSmtp::ServerProtocol
public: public:
class Sender // An interface used by ServerProtocol to send protocol replies. class Sender // An interface used by ServerProtocol to send protocol replies.
{ {
public: virtual void protocolSend( const std::string & s ) = 0 ; public: virtual void protocolSend( const std::string & s , bool allow_delete_this ) = 0 ;
public: virtual void protocolDone() = 0 ; public: virtual void protocolDone() = 0 ;
public: virtual ~Sender() ; public: virtual ~Sender() ;
private: void operator=( const Sender & ) ; // not implemented private: void operator=( const Sender & ) ; // not implemented
@ -139,7 +139,7 @@ private:
private: private:
ServerProtocol( const ServerProtocol & ) ; // not implemented ServerProtocol( const ServerProtocol & ) ; // not implemented
void operator=( const ServerProtocol & ) ; // not implemented void operator=( const ServerProtocol & ) ; // not implemented
void send( std::string ) ; void send( std::string , bool = true ) ;
Event commandEvent( const std::string & ) const ; Event commandEvent( const std::string & ) const ;
std::string commandWord( const std::string & line ) const ; std::string commandWord( const std::string & line ) const ;
std::string commandLine( const std::string & line ) const ; std::string commandLine( const std::string & line ) const ;

View File

@ -45,14 +45,15 @@ std::string GSmtp::Client::crlf()
return std::string("\015\012") ; return std::string("\015\012") ;
} }
GSmtp::Client::Client( MessageStore & store , const Secrets & secrets , GSmtp::Client::Client( MessageStore & store , const Secrets & secrets , const GNet::Address & local_address ,
bool quit_on_disconnect , unsigned int response_timeout ) : bool quit_on_disconnect , unsigned int response_timeout ) :
GNet::Client(false,quit_on_disconnect) , GNet::Client(local_address,false,quit_on_disconnect) ,
m_store(&store) , m_store(&store) ,
m_buffer(crlf()) , m_buffer(crlf()) ,
m_protocol(*this,secrets,GNet::Local::fqdn(),response_timeout,must_authenticate) , m_protocol(*this,secrets,GNet::Local::fqdn(),response_timeout,must_authenticate) ,
m_socket(NULL) , m_socket(NULL) ,
m_connect_timer(*this) , m_connect_timer(*this) ,
m_preprocess_timer(*this) ,
m_message_index(0U) , m_message_index(0U) ,
m_busy(true) , m_busy(true) ,
m_force_message_fail(false) m_force_message_fail(false)
@ -61,14 +62,15 @@ GSmtp::Client::Client( MessageStore & store , const Secrets & secrets ,
} }
GSmtp::Client::Client( std::auto_ptr<StoredMessage> message , const Secrets & secrets , GSmtp::Client::Client( std::auto_ptr<StoredMessage> message , const Secrets & secrets ,
unsigned int response_timeout ) : const GNet::Address & local_address , unsigned int response_timeout ) :
GNet::Client(false,false) , GNet::Client(local_address,false,false) ,
m_store(NULL) , m_store(NULL) ,
m_message(message) , m_message(message) ,
m_buffer(crlf()) , m_buffer(crlf()) ,
m_protocol(*this,secrets,GNet::Local::fqdn(),response_timeout,must_authenticate) , m_protocol(*this,secrets,GNet::Local::fqdn(),response_timeout,must_authenticate) ,
m_socket(NULL) , m_socket(NULL) ,
m_connect_timer(*this) , m_connect_timer(*this) ,
m_preprocess_timer(*this) ,
m_message_index(0U) , m_message_index(0U) ,
m_busy(true) , m_busy(true) ,
m_force_message_fail(false) m_force_message_fail(false)
@ -215,6 +217,16 @@ void GSmtp::Client::start( StoredMessage & message )
if( server_name.empty() ) if( server_name.empty() )
server_name = m_host ; server_name = m_host ;
// synchronous, client-side preprocessing -- treat errors
// asynchronously with a zero-length timer
//
if( ! message.preprocess() )
{
G_DEBUG( "GSmtp::Client::start: client-side pre-processing failed" ) ;
m_preprocess_timer.startTimer( 0U ) ;
return ;
}
std::auto_ptr<std::istream> content_stream( message.extractContentStream() ) ; std::auto_ptr<std::istream> content_stream( message.extractContentStream() ) ;
m_protocol.start( message.from() , message.to() , message.eightBit() , m_protocol.start( message.from() , message.to() , message.eightBit() ,
message.authentication() , server_name , content_stream ) ; message.authentication() , server_name , content_stream ) ;
@ -264,14 +276,24 @@ void GSmtp::Client::onDisconnect()
finish( reason , false ) ; finish( reason , false ) ;
} }
void GSmtp::Client::onTimeout( GNet::Timer & ) void GSmtp::Client::onTimeout( GNet::Timer & timer )
{ {
G_DEBUG( "GSmtp::Client::onTimeout" ) ; if( &timer == &m_connect_timer )
std::string reason = "connection timeout" ; {
if( m_force_message_fail ) G_DEBUG( "GSmtp::Client::onTimeout: connection timeout" ) ;
messageFail( reason ) ; std::string reason = "connection timeout" ;
if( m_force_message_fail )
finish( reason ) ; messageFail( reason ) ;
finish( reason ) ;
}
else
{
G_DEBUG( "GSmtp::Client::onTimeout: preprocessing failure timeout" ) ;
G_ASSERT( &timer == &m_preprocess_timer ) ;
messageFail( "pre-processing failed" ) ; // could do better
if( m_store == NULL || !sendNext() )
finish() ;
}
} }
GNet::Socket & GSmtp::Client::socket() GNet::Socket & GSmtp::Client::socket()

View File

@ -57,7 +57,8 @@ class GSmtp::Client : private GNet::Client , private GNet::TimeoutHandler , priv
public: public:
G_EXCEPTION( NotConnected , "not connected" ) ; G_EXCEPTION( NotConnected , "not connected" ) ;
Client( MessageStore & store , const Secrets & secrets , Client( MessageStore & store ,
const Secrets & secrets , const GNet::Address & local_address ,
bool quit_on_disconnect , unsigned int response_timeout ) ; bool quit_on_disconnect , unsigned int response_timeout ) ;
// Constructor. The 'store' and 'secrets' // Constructor. The 'store' and 'secrets'
// references are kept. // references are kept.
@ -67,7 +68,8 @@ public:
// or that the server connection has // or that the server connection has
// been lost. // been lost.
Client( std::auto_ptr<StoredMessage> message , const Secrets & secrets , Client( std::auto_ptr<StoredMessage> message ,
const Secrets & secrets , const GNet::Address & local_address ,
unsigned int response_timeout ) ; unsigned int response_timeout ) ;
// Constructor for sending a single message. // Constructor for sending a single message.
// The 'secrets' reference is kept. // The 'secrets' reference is kept.
@ -153,6 +155,7 @@ private:
G::Signal2<std::string,std::string> m_event_signal ; G::Signal2<std::string,std::string> m_event_signal ;
std::string m_host ; std::string m_host ;
GNet::Timer m_connect_timer ; GNet::Timer m_connect_timer ;
GNet::Timer m_preprocess_timer ;
unsigned int m_message_index ; unsigned int m_message_index ;
bool m_busy ; bool m_busy ;
bool m_force_message_fail ; bool m_force_message_fail ;

View File

@ -81,7 +81,7 @@ bool GSmtp::ServerPeer::processLine( const std::string & line )
return m_protocol.apply( line ) ; return m_protocol.apply( line ) ;
} }
void GSmtp::ServerPeer::protocolSend( const std::string & line ) void GSmtp::ServerPeer::protocolSend( const std::string & line , bool allow_delete_this )
{ {
if( line.length() == 0U ) if( line.length() == 0U )
return ; return ;
@ -89,7 +89,8 @@ void GSmtp::ServerPeer::protocolSend( const std::string & line )
ssize_t rc = socket().write( line.data() , line.length() ) ; ssize_t rc = socket().write( line.data() , line.length() ) ;
if( rc < 0 && ! socket().eWouldBlock() ) if( rc < 0 && ! socket().eWouldBlock() )
{ {
doDelete() ; // onDelete() and "delete this" if( allow_delete_this )
doDelete() ; // onDelete() and "delete this"
} }
else if( rc < 0 || static_cast<size_t>(rc) < line.length() ) else if( rc < 0 || static_cast<size_t>(rc) < line.length() )
{ {

View File

@ -62,7 +62,7 @@ public:
private: private:
ServerPeer( const ServerPeer & ) ; ServerPeer( const ServerPeer & ) ;
void operator=( const ServerPeer & ) ; void operator=( const ServerPeer & ) ;
virtual void protocolSend( const std::string & line ) ; // from ServerProtocol::Sender virtual void protocolSend( const std::string & line , bool ) ; // from ServerProtocol::Sender
virtual void protocolDone() ; // from ServerProtocol::Sender virtual void protocolDone() ; // from ServerProtocol::Sender
virtual void onDelete() ; // from GNet::ServerPeer virtual void onDelete() ; // from GNet::ServerPeer
virtual void onData( const char * , size_t ) ; // from GNet::ServerPeer virtual void onData( const char * , size_t ) ; // from GNet::ServerPeer

View File

@ -33,8 +33,9 @@
#include "gassert.h" #include "gassert.h"
#include <fstream> #include <fstream>
GSmtp::StoredFile::StoredFile( FileStore & store , const G::Path & path ) : GSmtp::StoredFile::StoredFile( FileStore & store , Processor & store_preprocessor , const G::Path & path ) :
m_store(store) , m_store(store) ,
m_store_preprocessor(store_preprocessor) ,
m_envelope_path(path) , m_envelope_path(path) ,
m_eight_bit(false) , m_eight_bit(false) ,
m_errors(0U) , m_errors(0U) ,
@ -321,6 +322,11 @@ const G::Strings & GSmtp::StoredFile::to() const
return m_to_remote ; return m_to_remote ;
} }
bool GSmtp::StoredFile::preprocess()
{
return m_store_preprocessor.process( contentPath().str() ) ;
}
std::auto_ptr<std::istream> GSmtp::StoredFile::extractContentStream() std::auto_ptr<std::istream> GSmtp::StoredFile::extractContentStream()
{ {
G_ASSERT( m_content.get() != NULL ) ; G_ASSERT( m_content.get() != NULL ) ;

View File

@ -27,6 +27,8 @@
#include "gdef.h" #include "gdef.h"
#include "gsmtp.h" #include "gsmtp.h"
#include "gmessagestore.h" #include "gmessagestore.h"
#include "gexe.h"
#include "gprocessor.h"
#include "gstoredmessage.h" #include "gstoredmessage.h"
#include "gexception.h" #include "gexception.h"
#include "gpath.h" #include "gpath.h"
@ -54,7 +56,7 @@ public:
G_EXCEPTION( StreamError , "envelope reading/parsing error" ) ; G_EXCEPTION( StreamError , "envelope reading/parsing error" ) ;
G_EXCEPTION( InvalidFilename , "invalid filename" ) ; G_EXCEPTION( InvalidFilename , "invalid filename" ) ;
StoredFile( FileStore & store , const G::Path & envelope_path ) ; StoredFile( FileStore & store , Processor & store_preprocessor , const G::Path & envelope_path ) ;
// Constructor. // Constructor.
virtual ~StoredFile() ; virtual ~StoredFile() ;
@ -88,6 +90,9 @@ public:
virtual std::string authentication() const ; virtual std::string authentication() const ;
// From StoredMessage. // From StoredMessage.
virtual bool preprocess() ;
// From StoredMessage.
virtual void destroy() ; virtual void destroy() ;
// From StoredMessage. // From StoredMessage.
@ -123,6 +128,7 @@ private:
private: private:
FileStore & m_store ; FileStore & m_store ;
Processor & m_store_preprocessor ;
G::Strings m_to_local ; G::Strings m_to_local ;
G::Strings m_to_remote ; G::Strings m_to_remote ;
std::string m_from ; std::string m_from ;

View File

@ -51,6 +51,10 @@ public:
virtual const G::Strings & to() const = 0 ; virtual const G::Strings & to() const = 0 ;
// Returns the envelope 'to' fields. // Returns the envelope 'to' fields.
virtual bool preprocess() = 0 ;
// Does synchronous pre-processing. Returns false
// on error.
virtual std::auto_ptr<std::istream> extractContentStream() = 0 ; virtual std::auto_ptr<std::istream> extractContentStream() = 0 ;
// Extracts the content stream. // Extracts the content stream.
// Can only be called once. // Can only be called once.

View File

@ -33,8 +33,8 @@
#include "gassert.h" #include "gassert.h"
#include "glog.h" #include "glog.h"
GSmtp::Verifier::Verifier( const G::Path & path , bool deliver_to_postmaster , bool reject_local ) : GSmtp::Verifier::Verifier( const G::Executable & external , bool deliver_to_postmaster , bool reject_local ) :
m_path(path) , m_external(external) ,
m_deliver_to_postmaster(deliver_to_postmaster) , m_deliver_to_postmaster(deliver_to_postmaster) ,
m_reject_local(reject_local) m_reject_local(reject_local)
{ {
@ -62,7 +62,7 @@ GSmtp::Verifier::Status GSmtp::Verifier::verify( const std::string & address ,
G::Str::toUpper( user ) ; G::Str::toUpper( user ) ;
Status status = Status status =
m_path == G::Path() ? m_external.exe() == G::Path() ?
verifyInternal( address , user , host , fqdn ) : verifyInternal( address , user , host , fqdn ) :
verifyExternal( address , user , host , fqdn , from , ip , mechanism , extra ) ; verifyExternal( address , user , host , fqdn , from , ip , mechanism , extra ) ;
@ -104,7 +104,7 @@ GSmtp::Verifier::Status GSmtp::Verifier::verifyExternal( const std::string & add
const std::string & host , const std::string & fqdn , const std::string & from , const std::string & host , const std::string & fqdn , const std::string & from ,
const GNet::Address & ip , const std::string & mechanism , const std::string & extra ) const const GNet::Address & ip , const std::string & mechanism , const std::string & extra ) const
{ {
G::Strings args ; G::Strings args( m_external.args() ) ;
args.push_back( address ) ; args.push_back( address ) ;
args.push_back( user ) ; args.push_back( user ) ;
args.push_back( host ) ; args.push_back( host ) ;
@ -113,12 +113,12 @@ GSmtp::Verifier::Status GSmtp::Verifier::verifyExternal( const std::string & add
args.push_back( ip.displayString(false) ) ; args.push_back( ip.displayString(false) ) ;
args.push_back( mechanism ) ; args.push_back( mechanism ) ;
args.push_back( extra ) ; args.push_back( extra ) ;
G_LOG( "GSmtp::Verifier: executing " << m_path << " " << address << " " << user << " " G_LOG( "GSmtp::Verifier: executing " << m_external.exe() << " " << address << " " << user << " "
<< host << " " << fqdn << " " << from << " " << ip.displayString(false) << " " << host << " " << fqdn << " " << from << " " << ip.displayString(false) << " "
<< "\"" << mechanism << "\" \"" << extra << "\"" ) ; << "\"" << mechanism << "\" \"" << extra << "\"" ) ;
std::string response ; std::string response ;
int rc = G::Process::spawn( G::Root::nobody() , m_path , args , &response ) ; int rc = G::Process::spawn( G::Root::nobody() , m_external.exe() , args , &response ) ;
G_LOG( "GSmtp::Verifier: " << rc << ": \"" << G::Str::toPrintableAscii(response) << "\"" ) ; G_LOG( "GSmtp::Verifier: " << rc << ": \"" << G::Str::toPrintableAscii(response) << "\"" ) ;
G::Str::trimRight( response , " \n\t" ) ; G::Str::trimRight( response , " \n\t" ) ;

View File

@ -28,6 +28,7 @@
#include "gsmtp.h" #include "gsmtp.h"
#include "gaddress.h" #include "gaddress.h"
#include "gpath.h" #include "gpath.h"
#include "gexe.h"
#include <string> #include <string>
namespace GSmtp namespace GSmtp
@ -53,7 +54,7 @@ public:
std::string reason ; std::string reason ;
} ; } ;
Verifier( const G::Path & exe , bool deliver_to_postmaster , bool reject_local ) ; Verifier( const G::Executable & exe , bool deliver_to_postmaster , bool reject_local ) ;
// Constructor. If an executable path is given (ie. not // Constructor. If an executable path is given (ie. not
// G::Path()) then it is used for external verification. // G::Path()) then it is used for external verification.
// Otherwise the internal verifier is used, controlled // Otherwise the internal verifier is used, controlled
@ -99,7 +100,7 @@ private:
const std::string & , const std::string & ) const ; const std::string & , const std::string & ) const ;
private: private:
G::Path m_path ; G::Executable m_external ;
bool m_deliver_to_postmaster ; bool m_deliver_to_postmaster ;
bool m_reject_local ; bool m_reject_local ;
} ; } ;

View File

@ -30,6 +30,7 @@ mk_sources=\
gmessagestore_win32.cpp \ gmessagestore_win32.cpp \
gnewfile.cpp \ gnewfile.cpp \
gnewmessage.cpp \ gnewmessage.cpp \
gprocessor.cpp \
gprotocolmessage.cpp \ gprotocolmessage.cpp \
gprotocolmessageforward.cpp \ gprotocolmessageforward.cpp \
gprotocolmessagestore.cpp \ gprotocolmessagestore.cpp \

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.6.3 from Makefile.am. # Makefile.in generated by automake 1.7.8 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -16,74 +16,94 @@
# #
# #
SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../.. top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA) INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@ transform = $(program_transform_name)
NORMAL_INSTALL = : NORMAL_INSTALL = :
PRE_INSTALL = : PRE_INSTALL = :
POST_INSTALL = : POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
ACLOCAL = @ACLOCAL@
EXEEXT = @EXEEXT@ AMDEP_FALSE = @AMDEP_FALSE@
OBJEXT = @OBJEXT@ AMDEP_TRUE = @AMDEP_TRUE@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AR = @AR@ AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILER_VERSION = @COMPILER_VERSION@ COMPILER_VERSION = @COMPILER_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GZIP = @GZIP@ GZIP = @GZIP@
HAVE_DOXYGEN = @HAVE_DOXYGEN@ HAVE_DOXYGEN = @HAVE_DOXYGEN@
HAVE_MAN2HTML = @HAVE_MAN2HTML@ HAVE_MAN2HTML = @HAVE_MAN2HTML@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKE = @MAKE@ MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
e_docdir = @e_docdir@ e_docdir = @e_docdir@
e_examplesdir = @e_examplesdir@ e_examplesdir = @e_examplesdir@
e_initdir = @e_initdir@ e_initdir = @e_initdir@
@ -91,7 +111,22 @@ e_libexecdir = @e_libexecdir@
e_man1dir = @e_man1dir@ e_man1dir = @e_man1dir@
e_sbindir = @e_sbindir@ e_sbindir = @e_sbindir@
e_spooldir = @e_spooldir@ e_spooldir = @e_spooldir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
# force symbol stripping on 'make install' -- see also make 'install-strip' # force symbol stripping on 'make install' -- see also make 'install-strip'
AM_INSTALL_PROGRAM_FLAGS = -s AM_INSTALL_PROGRAM_FLAGS = -s
@ -161,6 +196,7 @@ emailrelay_submit_LDADD = \
$(top_builddir)/src/gnet/libgnet.a $(top_builddir)/src/gnet/libgnet.a
subdir = src/main subdir = src/main
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
@ -191,11 +227,7 @@ emailrelay_submit_DEPENDENCIES = $(top_builddir)/src/gsmtp/libgsmtp.a \
$(top_builddir)/src/gnet/libgnet.a $(top_builddir)/src/gnet/libgnet.a
emailrelay_submit_LDFLAGS = emailrelay_submit_LDFLAGS =
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/commandline.Po \ @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/commandline.Po \
@ -207,18 +239,16 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC) CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
CFLAGS = @CFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX) CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@ -o $@
CXXFLAGS = @CXXFLAGS@
DIST_SOURCES = $(emailrelay_SOURCES) $(emailrelay_passwd_SOURCES) \ DIST_SOURCES = $(emailrelay_SOURCES) $(emailrelay_passwd_SOURCES) \
$(emailrelay_poke_SOURCES) $(emailrelay_submit_SOURCES) $(emailrelay_poke_SOURCES) $(emailrelay_submit_SOURCES)
DATA = $(e_spool_DATA) DATA = $(e_spool_DATA)
DIST_COMMON = Makefile.am Makefile.in DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
SOURCES = $(emailrelay_SOURCES) $(emailrelay_passwd_SOURCES) $(emailrelay_poke_SOURCES) $(emailrelay_submit_SOURCES) SOURCES = $(emailrelay_SOURCES) $(emailrelay_passwd_SOURCES) $(emailrelay_poke_SOURCES) $(emailrelay_submit_SOURCES)
all: all-am all: all-am
@ -240,7 +270,7 @@ install-e_libexecPROGRAMS: $(e_libexec_PROGRAMS)
; then \ ; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(e_libexecPROGRAMS_INSTALL) $$p $(DESTDIR)$(e_libexecdir)/$$f"; \ echo " $(INSTALL_PROGRAM_ENV) $(e_libexecPROGRAMS_INSTALL) $$p $(DESTDIR)$(e_libexecdir)/$$f"; \
$(INSTALL_PROGRAM_ENV) $(e_libexecPROGRAMS_INSTALL) $$p $(DESTDIR)$(e_libexecdir)/$$f; \ $(INSTALL_PROGRAM_ENV) $(e_libexecPROGRAMS_INSTALL) $$p $(DESTDIR)$(e_libexecdir)/$$f || exit 1; \
else :; fi; \ else :; fi; \
done done
@ -264,7 +294,7 @@ install-e_sbinPROGRAMS: $(e_sbin_PROGRAMS)
; then \ ; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(e_sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(e_sbindir)/$$f"; \ echo " $(INSTALL_PROGRAM_ENV) $(e_sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(e_sbindir)/$$f"; \
$(INSTALL_PROGRAM_ENV) $(e_sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(e_sbindir)/$$f; \ $(INSTALL_PROGRAM_ENV) $(e_sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(e_sbindir)/$$f || exit 1; \
else :; fi; \ else :; fi; \
done done
@ -307,34 +337,49 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/submit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/submit.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
.c.o: .c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj: .c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
$(COMPILE) -c `cygpath -w $<` @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
CCDEPMODE = @CCDEPMODE@ @am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
.cpp.o: .cpp.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
$(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCXX_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
.cpp.obj: .cpp.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
$(CXXCOMPILE) -c -o $@ `cygpath -w $<` @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
CXXDEPMODE = @CXXDEPMODE@ @am__fastdepCXX_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
uninstall-info-am: uninstall-info-am:
e_spoolDATA_INSTALL = $(INSTALL_DATA) e_spoolDATA_INSTALL = $(INSTALL_DATA)
install-e_spoolDATA: $(e_spool_DATA) install-e_spoolDATA: $(e_spool_DATA)
@ -358,6 +403,9 @@ uninstall-e_spoolDATA:
ETAGS = etags ETAGS = etags
ETAGSFLAGS = ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@ -383,20 +431,41 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique $$tags $$unique
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS: GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../.. top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(DISTFILES)'; for file in $$list; do \ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
@ -422,7 +491,6 @@ all-am: Makefile $(PROGRAMS) $(DATA)
installdirs: installdirs:
$(mkinstalldirs) $(DESTDIR)$(e_libexecdir) $(DESTDIR)$(e_sbindir) $(DESTDIR)$(e_spooldir) $(mkinstalldirs) $(DESTDIR)$(e_libexecdir) $(DESTDIR)$(e_sbindir) $(DESTDIR)$(e_spooldir)
install: install-am install: install-am
install-exec: install-exec-am install-exec: install-exec-am
install-data: install-data-am install-data: install-data-am
@ -442,7 +510,7 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -453,9 +521,10 @@ clean-am: clean-e_libexecPROGRAMS clean-e_sbinPROGRAMS clean-generic \
mostlyclean-am mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -rf ./$(DEPDIR)
distclean-am: clean-am distclean-compile distclean-depend \ -rm -f Makefile
distclean-generic distclean-tags distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am dvi: dvi-am
@ -477,27 +546,37 @@ install-man:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-e_libexecPROGRAMS uninstall-e_sbinPROGRAMS \ uninstall-am: uninstall-e_libexecPROGRAMS uninstall-e_sbinPROGRAMS \
uninstall-e_spoolDATA uninstall-info-am uninstall-local uninstall-e_spoolDATA uninstall-info-am uninstall-local
.PHONY: GTAGS all all-am check check-am clean clean-e_libexecPROGRAMS \ .PHONY: CTAGS GTAGS all all-am check check-am clean \
clean-e_sbinPROGRAMS clean-generic distclean distclean-compile \ clean-e_libexecPROGRAMS clean-e_sbinPROGRAMS clean-generic \
distclean-depend distclean-generic distclean-tags distdir dvi \ ctags distclean distclean-compile distclean-generic \
dvi-am info info-am install install-am install-data \ distclean-tags distdir dvi dvi-am info info-am install \
install-data-am install-data-local install-e_libexecPROGRAMS \ install-am install-data install-data-am install-data-local \
install-e_sbinPROGRAMS install-e_spoolDATA install-exec \ install-e_libexecPROGRAMS install-e_sbinPROGRAMS \
install-exec-am install-exec-local install-info install-info-am \ install-e_spoolDATA install-exec install-exec-am \
install-man install-strip installcheck installcheck-am \ install-exec-local install-info install-info-am install-man \
installdirs maintainer-clean maintainer-clean-generic \ install-strip installcheck installcheck-am installdirs \
mostlyclean mostlyclean-compile mostlyclean-generic tags \ maintainer-clean maintainer-clean-generic mostlyclean \
uninstall uninstall-am uninstall-e_libexecPROGRAMS \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-e_libexecPROGRAMS \
uninstall-e_sbinPROGRAMS uninstall-e_spoolDATA \ uninstall-e_sbinPROGRAMS uninstall-e_spoolDATA \
uninstall-info-am uninstall-local uninstall-info-am uninstall-local

View File

@ -61,7 +61,7 @@ std::string Main::CommandLine::switchSpec( bool is_windows )
<< "1!admin-port!3|" << "1!admin-port!3|"
<< "x!dont-serve!dont act as a server (usually used with --forward)!0!!3|" << "x!dont-serve!dont act as a server (usually used with --forward)!0!!3|"
<< "X!dont-listen!dont listen for smtp connections (usually used with --admin)!0!!3|" << "X!dont-listen!dont listen for smtp connections (usually used with --admin)!0!!3|"
<< "z!filter!defines a mail processor program!1!program!3|" << "z!filter!defines a mail processor program for when storing!1!program!3|"
<< "D!domain!sets an override for the host's fully qualified domain name!1!fqdn!3|" << "D!domain!sets an override for the host's fully qualified domain name!1!fqdn!3|"
<< "f!forward!forwards stored mail on startup (requires --forward-to)!0!!3|" << "f!forward!forwards stored mail on startup (requires --forward-to)!0!!3|"
<< "o!forward-to!specifies the remote smtp server (required by --forward and --admin)!1!host:port!3|" << "o!forward-to!specifies the remote smtp server (required by --forward and --admin)!1!host:port!3|"
@ -75,7 +75,8 @@ std::string Main::CommandLine::switchSpec( bool is_windows )
<< "O!poll!enables polling with the specified period (requires --forward-to)!1!period!3|" << "O!poll!enables polling with the specified period (requires --forward-to)!1!period!3|"
<< "P!postmaster!deliver to postmaster and reject all other local mailbox addresses!0!!3|" << "P!postmaster!deliver to postmaster and reject all other local mailbox addresses!0!!3|"
<< "Z!verifier!defines an external address verifier program!1!program!3|" << "Z!verifier!defines an external address verifier program!1!program!3|"
<< "Q!admin-terminate!!0!!0|" << "Y!client-filter!defines a mail processor program for when forwarding!1!program!3|"
<< "Q!admin-terminate!enables the terminate command on the admin interface!0!!3|"
<< "R!scanner!!1!host:port!0|" << "R!scanner!!1!host:port!0|"
; ;
return ss.str() ; return ss.str() ;
@ -167,6 +168,11 @@ std::string Main::CommandLine::semanticError() const
"admin listening port must be different" ; "admin listening port must be different" ;
} }
if( cfg().withTerminate() && !cfg().doAdmin() )
{
return "the --admin-terminate switch requires --admin" ;
}
if( cfg().daemon() && cfg().spoolDir().isRelative() ) if( cfg().daemon() && cfg().spoolDir().isRelative() )
{ {
return "in daemon mode the spool-dir must " return "in daemon mode the spool-dir must "
@ -182,8 +188,8 @@ std::string Main::CommandLine::semanticError() const
} }
const bool forward_to = const bool forward_to =
m_getopt.contains("as-proxy") || m_getopt.contains("as-proxy") || // => forward-to
m_getopt.contains("as-client") || m_getopt.contains("as-client") || // => forward-to
m_getopt.contains("forward-to") ; m_getopt.contains("forward-to") ;
if( ! forward_to && ( if( ! forward_to && (
@ -194,28 +200,50 @@ std::string Main::CommandLine::semanticError() const
return "the --forward, --immediate and --poll switches require --forward-to" ; return "the --forward, --immediate and --poll switches require --forward-to" ;
} }
if( m_getopt.contains("scanner") && ! ( m_getopt.contains("as-proxy") || m_getopt.contains("immediate") ) ) const bool forwarding =
m_getopt.contains("as-proxy") || // => immediate
m_getopt.contains("as-client") || // => forward
m_getopt.contains("forward") ||
m_getopt.contains("immediate") ||
m_getopt.contains("poll") ;
if( m_getopt.contains("client-filter") && ! forwarding )
{
return "the --client-filter switch requires --as-proxy, --as-client, --poll, --immediate or --forward" ;
}
const bool not_serving = m_getopt.contains("dont-serve") || m_getopt.contains("as-client") ;
if( m_getopt.contains("filter") && not_serving )
{
return "the --filter switch cannot be used with --as-client or --dont-serve" ;
}
const bool immediate =
m_getopt.contains("as-proxy") || // => immediate
m_getopt.contains("immediate") ;
if( m_getopt.contains("scanner") && ! immediate )
{ {
return "the --scanner switch requires --as-proxy or --immediate" ; return "the --scanner switch requires --as-proxy or --immediate" ;
} }
const bool log = const bool log =
m_getopt.contains("log") || m_getopt.contains("log") ||
m_getopt.contains("as-server") || m_getopt.contains("as-server") || // => log
m_getopt.contains("as-client") || m_getopt.contains("as-client") || // => log
m_getopt.contains("as-proxy") ; m_getopt.contains("as-proxy") ; // => log
if( m_getopt.contains("verbose") && ! ( m_getopt.contains("help") || log ) ) if( m_getopt.contains("verbose") && ! ( m_getopt.contains("help") || log ) )
{ {
return "the --verbose switch must be used with --log, --help, --as-client, --as-server or --as-proxy" ; return "the --verbose switch must be used with --log, --help, --as-client, --as-server or --as-proxy" ;
} }
if( m_getopt.contains("interface") && ( m_getopt.contains("dont-serve") || m_getopt.contains("as-client") ) ) const bool no_daemon =
{ m_getopt.contains("as-client") || // => no-daemon
return "the --interface switch cannot be used with --as-client or --dont-serve" ; m_getopt.contains("no-daemon") ;
}
if( cfg().daemon() && m_getopt.contains("hidden") ) // (win32) if( m_getopt.contains("hidden") && ! no_daemon ) // (win32)
{ {
return "the --hidden switch requires --no-daemon or --as-client" ; return "the --hidden switch requires --no-daemon or --as-client" ;
} }

View File

@ -193,6 +193,10 @@ SOURCE=..\gnet\geventserver.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\glib\gexe.cpp
# End Source File
# Begin Source File
SOURCE=..\glib\gexception.cpp SOURCE=..\glib\gexception.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -281,6 +285,10 @@ SOURCE=..\glib\gprocess_win32.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\gsmtp\gprocessor.cpp
# End Source File
# Begin Source File
SOURCE=..\gsmtp\gprotocolmessage.cpp SOURCE=..\gsmtp\gprotocolmessage.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@ -62,8 +62,8 @@ std::string Main::Configuration::str( const std::string & p , const std::string
std::ostringstream ss ; std::ostringstream ss ;
ss ss
<< p << "listening port: " << (doServing()?G::Str::fromUInt(port()):na()) << eol << p << "listening port: " << (doServing()?G::Str::fromUInt(port()):na()) << eol
<< p << "listening interface: " << (doServing()?any(interface_()):na()) << eol << p << "listening interface: " << (doServing()?any(listeningInterface()):na()) << eol
<< p << "next server address: " << ((doForwarding()||doPolling())?serverAddress():na()) << eol << p << "next server address: " << (serverAddress().length()?serverAddress():na()) << eol
<< p << "spool directory: " << spoolDir() << eol << p << "spool directory: " << spoolDir() << eol
<< p << "immediate forwarding? " << yn(immediate()) << eol << p << "immediate forwarding? " << yn(immediate()) << eol
<< p << "mail processor: " << (useFilter()?filter():na()) << eol << p << "mail processor: " << (useFilter()?filter():na()) << eol
@ -122,15 +122,48 @@ unsigned int Main::Configuration::port() const
G::Str::toUInt(m_cl.value("port")) : 25U ; G::Str::toUInt(m_cl.value("port")) : 25U ;
} }
std::string Main::Configuration::interface_() const std::string Main::Configuration::listeningInterface() const
{ {
return m_cl.contains("interface") ? m_cl.value("interface") : std::string() ; return m_cl.contains("interface") ? m_cl.value("interface") : std::string() ;
} }
std::string Main::Configuration::clientInterface() const
{
return listeningInterface() ; // or a separate switch?
}
G::Path Main::Configuration::adminAddressFile() const
{
if( ! m_cl.contains("admin") )
return G::Path() ;
const std::string s = m_cl.value("admin") ;
if( s.find("tcp://") == 0U && s.length() > 6U && s.find("/",6U) != std::string::npos )
{
return G::Path(s.substr(s.find("/",6U))) ;
}
else
{
return G::Path() ;
}
}
unsigned int Main::Configuration::adminPort() const unsigned int Main::Configuration::adminPort() const
{ {
return m_cl.contains("admin") ? std::string s = m_cl.contains("admin") ? m_cl.value("admin") : std::string() ;
G::Str::toUInt(m_cl.value("admin")) : 10025U ; if( s.find("tcp://") == 0U )
{
s = 6U >= s.length() ? std::string() : s.substr(6U) ;
size_t p = s.find("/") ;
if( p != std::string::npos )
s = s.substr(0U,p) ;
p = s.find_last_of( ':' ) ;
if( p != std::string::npos )
s = (p+1U) >= s.length() ? std::string() : s.substr(p+1U) ;
}
return s.empty() ? 0U : G::Str::toUInt(s) ;
} }
bool Main::Configuration::closeStderr() const bool Main::Configuration::closeStderr() const
@ -222,7 +255,12 @@ bool Main::Configuration::useFilter() const
std::string Main::Configuration::filter() const std::string Main::Configuration::filter() const
{ {
return m_cl.value("filter") ; return m_cl.contains("filter") ? m_cl.value("filter") : std::string() ;
}
std::string Main::Configuration::clientFilter() const
{
return m_cl.contains("client-filter") ? m_cl.value("client-filter") : std::string() ;
} }
unsigned int Main::Configuration::icon() const unsigned int Main::Configuration::icon() const

View File

@ -56,11 +56,11 @@ public:
unsigned int port() const ; unsigned int port() const ;
// Returns the main listening port number. // Returns the main listening port number.
std::string interface_() const ; std::string listeningInterface() const ;
// Returns the listening interface. // Returns the listening interface.
unsigned int adminPort() const ; std::string clientInterface() const ;
// Returns the admin port number. // Returns the sending interface.
bool closeStderr() const ; bool closeStderr() const ;
// Returns true if stderr should be closed. // Returns true if stderr should be closed.
@ -98,6 +98,12 @@ public:
bool doAdmin() const ; bool doAdmin() const ;
// Returns true if listening for admin connections. // Returns true if listening for admin connections.
G::Path adminAddressFile() const ;
// Returns the admin address file path.
unsigned int adminPort() const ;
// Returns the admin port number.
bool allowRemoteClients() const ; bool allowRemoteClients() const ;
// Returns true if allowing remote clients to connect. // Returns true if allowing remote clients to connect.
@ -117,7 +123,10 @@ public:
// Returns true if pre-processing. // Returns true if pre-processing.
std::string filter() const ; std::string filter() const ;
// Returns the pre-processor's path. // Returns the path to a server-side pre-processor.
std::string clientFilter() const ;
// Returns the path to a client-side pre-processor.
unsigned int icon() const ; unsigned int icon() const ;
// Returns the icon selector (win32). // Returns the icon selector (win32).

View File

@ -3,7 +3,7 @@
# General configuration options # General configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
PROJECT_NAME = E-MailRelay PROJECT_NAME = E-MailRelay
PROJECT_NUMBER = 1.1.3 PROJECT_NUMBER = 1.2
OUTPUT_DIRECTORY = OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES EXTRACT_ALL = YES

View File

@ -39,6 +39,7 @@ of the code structure, and there are a number of supporting diagrams:
<li><a href="../gnet-client.png">GNet::Client state transition diagram</a></li> <li><a href="../gnet-client.png">GNet::Client state transition diagram</a></li>
<li><a href="../gsmtp-scannerclient.png">GNet::ScannerClient state transition diagram</a></li> <li><a href="../gsmtp-scannerclient.png">GNet::ScannerClient state transition diagram</a></li>
<li><a href="../gsmtp-serverprotocol.png">GSmtp::ServerProtocol state transition diagram</a></li> <li><a href="../gsmtp-serverprotocol.png">GSmtp::ServerProtocol state transition diagram</a></li>
<li><a href="../auth.png">Authentication usage</a></li>
</ul> </ul>
*/ */

View File

@ -1,86 +1,86 @@
Microsoft Developer Studio Workspace File, Format Version 6.00 Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
############################################################################### ###############################################################################
Project: "common"=".\common.dsp" - Package Owner=<4> Project: "common"=".\common.dsp" - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{
}}} }}}
Package=<4> Package=<4>
{{{ {{{
}}} }}}
############################################################################### ###############################################################################
Project: "emailrelay"=".\emailrelay.dsp" - Package Owner=<4> Project: "emailrelay"=".\emailrelay.dsp" - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{
}}} }}}
Package=<4> Package=<4>
{{{ {{{
Begin Project Dependency Begin Project Dependency
Project_Dep_Name common Project_Dep_Name common
End Project Dependency End Project Dependency
}}} }}}
############################################################################### ###############################################################################
Project: "passwd"=".\passwd.dsp" - Package Owner=<4> Project: "passwd"=".\passwd.dsp" - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{
}}} }}}
Package=<4> Package=<4>
{{{ {{{
Begin Project Dependency Begin Project Dependency
Project_Dep_Name common Project_Dep_Name common
End Project Dependency End Project Dependency
}}} }}}
############################################################################### ###############################################################################
Project: "poke"=".\poke.dsp" - Package Owner=<4> Project: "poke"=".\poke.dsp" - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{
}}} }}}
Package=<4> Package=<4>
{{{ {{{
}}} }}}
############################################################################### ###############################################################################
Project: "submit"=".\submit.dsp" - Package Owner=<4> Project: "submit"=".\submit.dsp" - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{
}}} }}}
Package=<4> Package=<4>
{{{ {{{
Begin Project Dependency Begin Project Dependency
Project_Dep_Name common Project_Dep_Name common
End Project Dependency End Project Dependency
}}} }}}
############################################################################### ###############################################################################
Global: Global:
Package=<5> Package=<5>
{{{ {{{
}}} }}}
Package=<3> Package=<3>
{{{ {{{
}}} }}}
############################################################################### ###############################################################################

View File

@ -1,195 +1,195 @@
//Microsoft Developer Studio generated resource script. //Microsoft Developer Studio generated resource script.
// //
#include "resource.h" #include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Generated from the TEXTINCLUDE 2 resource. // Generated from the TEXTINCLUDE 2 resource.
// //
#include <windows.h> #include <windows.h>
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// English (U.K.) resources // English (U.K.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
#ifdef _WIN32 #ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
#pragma code_page(1252) #pragma code_page(1252)
#endif //_WIN32 #endif //_WIN32
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Icon // Icon
// //
// Icon with lowest ID value placed first to ensure application icon // Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems. // remains consistent on all systems.
IDI_ICON1 ICON DISCARDABLE "icon-32.ico" IDI_ICON1 ICON DISCARDABLE "icon-32.ico"
IDI_ICON2 ICON DISCARDABLE "icon2.ico" IDI_ICON2 ICON DISCARDABLE "icon2.ico"
IDI_ICON3 ICON DISCARDABLE "icon3.ico" IDI_ICON3 ICON DISCARDABLE "icon3.ico"
IDI_ICON4 ICON DISCARDABLE "icon4.ico" IDI_ICON4 ICON DISCARDABLE "icon4.ico"
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// TEXTINCLUDE // TEXTINCLUDE
// //
1 TEXTINCLUDE DISCARDABLE 1 TEXTINCLUDE DISCARDABLE
BEGIN BEGIN
"resource.h\0" "resource.h\0"
END END
2 TEXTINCLUDE DISCARDABLE 2 TEXTINCLUDE DISCARDABLE
BEGIN BEGIN
"#include <windows.h>\0" "#include <windows.h>\0"
END END
3 TEXTINCLUDE DISCARDABLE 3 TEXTINCLUDE DISCARDABLE
BEGIN BEGIN
"#include <messages.rc>\r\n" "#include <messages.rc>\r\n"
"/// 1 TYPELIB ""emailrelay_idl.tlb""\r\n" "/// 1 TYPELIB ""emailrelay_idl.tlb""\r\n"
"\r\n" "\r\n"
"\r\n" "\r\n"
"\r\n" "\r\n"
"\0" "\0"
END END
#endif // APSTUDIO_INVOKED #endif // APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Menu // Menu
// //
IDR_MENU1 MENU DISCARDABLE IDR_MENU1 MENU DISCARDABLE
BEGIN BEGIN
POPUP "popup" POPUP "popup"
BEGIN BEGIN
MENUITEM "&Open", IDM_OPEN MENUITEM "&Open", IDM_OPEN
MENUITEM "&Close", IDM_CLOSE MENUITEM "&Close", IDM_CLOSE
MENUITEM "&Quit", IDM_QUIT MENUITEM "&Quit", IDM_QUIT
END END
END END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Dialog // Dialog
// //
IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 259, 190 IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 259, 190
STYLE WS_CHILD STYLE WS_CHILD
FONT 8, "MS Sans Serif" FONT 8, "MS Sans Serif"
BEGIN BEGIN
DEFPUSHBUTTON "OK",IDOK,105,169,50,14 DEFPUSHBUTTON "OK",IDOK,105,169,50,14
EDITTEXT IDC_EDIT1,7,7,245,153,ES_MULTILINE | ES_READONLY | EDITTEXT IDC_EDIT1,7,7,245,153,ES_MULTILINE | ES_READONLY |
WS_VSCROLL WS_VSCROLL
END END
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 423, 193 IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 423, 193
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog" CAPTION "Dialog"
FONT 8, "MS Sans Serif" FONT 8, "MS Sans Serif"
BEGIN BEGIN
DEFPUSHBUTTON "OK",IDOK,191,172,50,14 DEFPUSHBUTTON "OK",IDOK,191,172,50,14
EDITTEXT IDC_EDIT1,7,7,409,163,ES_MULTILINE | ES_AUTOVSCROLL | EDITTEXT IDC_EDIT1,7,7,409,163,ES_MULTILINE | ES_AUTOVSCROLL |
ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL
END END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// DESIGNINFO // DESIGNINFO
// //
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE GUIDELINES DESIGNINFO DISCARDABLE
BEGIN BEGIN
IDD_DIALOG1, DIALOG IDD_DIALOG1, DIALOG
BEGIN BEGIN
LEFTMARGIN, 7 LEFTMARGIN, 7
RIGHTMARGIN, 252 RIGHTMARGIN, 252
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 183 BOTTOMMARGIN, 183
END END
IDD_DIALOG2, DIALOG IDD_DIALOG2, DIALOG
BEGIN BEGIN
LEFTMARGIN, 7 LEFTMARGIN, 7
RIGHTMARGIN, 416 RIGHTMARGIN, 416
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 186 BOTTOMMARGIN, 186
END END
END END
#endif // APSTUDIO_INVOKED #endif // APSTUDIO_INVOKED
#ifndef _MAC #ifndef _MAC
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Version // Version
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0 FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0 PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
#else #else
FILEFLAGS 0x0L FILEFLAGS 0x0L
#endif #endif
FILEOS 0x10004L FILEOS 0x10004L
FILETYPE 0x1L FILETYPE 0x1L
FILESUBTYPE 0x0L FILESUBTYPE 0x0L
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "080904b0" BLOCK "080904b0"
BEGIN BEGIN
VALUE "Comments", "\0" VALUE "Comments", "\0"
VALUE "CompanyName", " \0" VALUE "CompanyName", " \0"
VALUE "FileDescription", "E-MailRelay Application\0" VALUE "FileDescription", "E-MailRelay Application\0"
VALUE "FileVersion", "1, 0, 0, 0\0" VALUE "FileVersion", "1, 0, 0, 0\0"
VALUE "InternalName", "emailrelay\0" VALUE "InternalName", "emailrelay\0"
VALUE "LegalCopyright", "Copyright © Graeme Walker, 2002\0" VALUE "LegalCopyright", "Copyright © Graeme Walker, 2002\0"
VALUE "LegalTrademarks", "\0" VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "emailrelay.rc\0" VALUE "OriginalFilename", "emailrelay.rc\0"
VALUE "PrivateBuild", "\0" VALUE "PrivateBuild", "\0"
VALUE "ProductName", "E-MailRelay\0" VALUE "ProductName", "E-MailRelay\0"
VALUE "ProductVersion", "1, 0, 0, 0\0" VALUE "ProductVersion", "1, 0, 0, 0\0"
VALUE "SpecialBuild", "\0" VALUE "SpecialBuild", "\0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
BEGIN BEGIN
VALUE "Translation", 0x809, 1200 VALUE "Translation", 0x809, 1200
END END
END END
#endif // !_MAC #endif // !_MAC
#endif // English (U.K.) resources #endif // English (U.K.) resources
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED #ifndef APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Generated from the TEXTINCLUDE 3 resource. // Generated from the TEXTINCLUDE 3 resource.
// //
#include <messages.rc> #include <messages.rc>
/// 1 TYPELIB "emailrelay_idl.tlb" /// 1 TYPELIB "emailrelay_idl.tlb"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED #endif // not APSTUDIO_INVOKED

View File

@ -1,102 +1,102 @@
# Microsoft Developer Studio Project File - Name="passwd" - Package Owner=<4> # Microsoft Developer Studio Project File - Name="passwd" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00 # Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT ** # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103 # TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=passwd - Win32 Debug CFG=passwd - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run !MESSAGE use the Export Makefile command and run
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "passwd.mak". !MESSAGE NMAKE /f "passwd.mak".
!MESSAGE !MESSAGE
!MESSAGE You can specify a configuration when running NMAKE !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "passwd.mak" CFG="passwd - Win32 Debug" !MESSAGE NMAKE /f "passwd.mak" CFG="passwd - Win32 Debug"
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "passwd - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "passwd - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "passwd - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "passwd - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
# PROP AllowPerConfigDependencies 0 # PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "" # PROP Scc_ProjName ""
# PROP Scc_LocalPath "" # PROP Scc_LocalPath ""
CPP=cl.exe CPP=cl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "passwd - Win32 Release" !IF "$(CFG)" == "passwd - Win32 Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release" # PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release" # PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir "PasswdRelease" # PROP Output_Dir "PasswdRelease"
# PROP Intermediate_Dir "PasswdRelease" # PROP Intermediate_Dir "PasswdRelease"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GR /GX /O2 /I "../../lib/msvc6.0" /I "../gsmtp" /I "../gnet" /I "../glib" /I "../win32" /D "NDEBUG" /D "_CONSOLE" /D "G_WIN32" /D "WIN32" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GR /GX /O2 /I "../../lib/msvc6.0" /I "../gsmtp" /I "../gnet" /I "../glib" /I "../win32" /D "NDEBUG" /D "_CONSOLE" /D "G_WIN32" /D "WIN32" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "passwd - Win32 Debug" !ELSEIF "$(CFG)" == "passwd - Win32 Debug"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug" # PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug" # PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 1 # PROP Use_Debug_Libraries 1
# PROP Output_Dir "PasswdDebug" # PROP Output_Dir "PasswdDebug"
# PROP Intermediate_Dir "PasswdDebug" # PROP Intermediate_Dir "PasswdDebug"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "..\glib" /I "../../lib/msvc6.0" /I "../gsmtp" /I "../gnet" /I "../glib" /I "../win32" /D "_DEBUG" /D "G_WIN32" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "..\glib" /I "../../lib/msvc6.0" /I "../gsmtp" /I "../gnet" /I "../glib" /I "../win32" /D "_DEBUG" /D "G_WIN32" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF !ENDIF
# Begin Target # Begin Target
# Name "passwd - Win32 Release" # Name "passwd - Win32 Release"
# Name "passwd - Win32 Debug" # Name "passwd - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File # Begin Source File
SOURCE=.\passwd.cpp SOURCE=.\passwd.cpp
# End Source File # End Source File
# End Group # End Group
# Begin Group "Header Files" # Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl" # PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group # End Group
# Begin Group "Resource Files" # Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group # End Group
# End Target # End Target
# End Project # End Project

View File

@ -76,6 +76,17 @@
#define BOOL int #define BOOL int
#endif #endif
#include <stdio.h>
static void init( void )
{
#ifdef G_WIN32
static WSADATA info ;
if( 0 != WSAStartup( MAKEWORD(1,1) , &info ) )
; /* error */
#endif
}
static void detach( void ) static void detach( void )
{ {
#ifndef G_WIN32 #ifndef G_WIN32
@ -132,7 +143,9 @@ static BOOL poke( int argc , char * argv [] )
/* open the socket */ /* open the socket */
fd = socket( AF_INET , SOCK_STREAM , 0 ) ; fd = socket( AF_INET , SOCK_STREAM , 0 ) ;
if( fd < 0 ) if( fd < 0 )
{
return FALSE ; return FALSE ;
}
/* prepare the address */ /* prepare the address */
memset( &address , 0 , sizeof(address) ) ; memset( &address , 0 , sizeof(address) ) ;
@ -186,6 +199,7 @@ int main( int argc , char * argv [] )
} }
/* run once, or in a loop */ /* run once, or in a loop */
init() ;
if( daemon ) if( daemon )
{ {
detach() ; detach() ;

View File

@ -1,102 +1,102 @@
# Microsoft Developer Studio Project File - Name="poke" - Package Owner=<4> # Microsoft Developer Studio Project File - Name="poke" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00 # Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT ** # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103 # TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=poke - Win32 Debug CFG=poke - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run !MESSAGE use the Export Makefile command and run
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "poke.mak". !MESSAGE NMAKE /f "poke.mak".
!MESSAGE !MESSAGE
!MESSAGE You can specify a configuration when running NMAKE !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "poke.mak" CFG="poke - Win32 Debug" !MESSAGE NMAKE /f "poke.mak" CFG="poke - Win32 Debug"
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "poke - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "poke - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "poke - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "poke - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
# PROP AllowPerConfigDependencies 0 # PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "" # PROP Scc_ProjName ""
# PROP Scc_LocalPath "" # PROP Scc_LocalPath ""
CPP=cl.exe CPP=cl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "poke - Win32 Release" !IF "$(CFG)" == "poke - Win32 Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "poke___Win32_Release" # PROP BASE Output_Dir "poke___Win32_Release"
# PROP BASE Intermediate_Dir "poke___Win32_Release" # PROP BASE Intermediate_Dir "poke___Win32_Release"
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir "PokeRelease" # PROP Output_Dir "PokeRelease"
# PROP Intermediate_Dir "PokeRelease" # PROP Intermediate_Dir "PokeRelease"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "G_WIN32" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "G_WIN32" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "poke - Win32 Debug" !ELSEIF "$(CFG)" == "poke - Win32 Debug"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug" # PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug" # PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 1 # PROP Use_Debug_Libraries 1
# PROP Output_Dir "PokeDebug" # PROP Output_Dir "PokeDebug"
# PROP Intermediate_Dir "PokeDebug" # PROP Intermediate_Dir "PokeDebug"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "G_WIN32" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "G_WIN32" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF !ENDIF
# Begin Target # Begin Target
# Name "poke - Win32 Release" # Name "poke - Win32 Release"
# Name "poke - Win32 Debug" # Name "poke - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File # Begin Source File
SOURCE=.\poke.c SOURCE=.\poke.c
# End Source File # End Source File
# End Group # End Group
# Begin Group "Header Files" # Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl" # PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group # End Group
# Begin Group "Resource Files" # Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group # End Group
# End Target # End Target
# End Project # End Project

Some files were not shown because too many files have changed in this diff Show More