Imported Upstream version 3.2.0 upstream/3.2.0
authorBdale Garbee <bdale@gag.com>
Tue, 2 Nov 2010 02:40:44 +0000 (20:40 -0600)
committerBdale Garbee <bdale@gag.com>
Tue, 2 Nov 2010 02:40:44 +0000 (20:40 -0600)
717 files changed:
AUTHORS
ChangeLog
FULL_VERSION
Makefile.am
Makefile.in
NEWS
ReleaseNotes
VERSION
aclocal.m4
amandad-src/Makefile.am
amandad-src/Makefile.in
amandad-src/amandad.c
amandad-src/amandad_util.c
amar-src/Makefile.am
amar-src/Makefile.in
amplot/Makefile.am
amplot/Makefile.in
application-src/Makefile.am
application-src/Makefile.in
application-src/amgtar.c
application-src/amlog-script.pl
application-src/ampgsql.pl
application-src/amraw.pl
application-src/amsamba.pl
application-src/amstar.c
application-src/amsuntar.pl
application-src/amzfs-sendrecv.pl
application-src/amzfs-snapshot.pl
application-src/script-email.pl
changer-src/Makefile.am
changer-src/Makefile.in
changer-src/chg-chio.pl [deleted file]
changer-src/chg-chs.sh [deleted file]
changer-src/chg-iomega.pl [deleted file]
changer-src/chg-juke.sh [deleted file]
changer-src/chg-mcutil.sh [deleted file]
changer-src/chg-mtx.sh [deleted file]
changer-src/chg-null.sh [deleted file]
changer-src/chg-rait.sh [deleted file]
changer-src/chg-rth.pl [deleted file]
changer-src/chg-scsi-chio.c [deleted file]
changer-src/chg-scsi.c [deleted file]
changer-src/libscsi.h [deleted file]
changer-src/scsi-aix.c [deleted file]
changer-src/scsi-bsd.c [deleted file]
changer-src/scsi-cam.c [deleted file]
changer-src/scsi-changer-driver.c [deleted file]
changer-src/scsi-chio.c [deleted file]
changer-src/scsi-defs.h [deleted file]
changer-src/scsi-hpux.c [deleted file]
changer-src/scsi-hpux_new.c [deleted file]
changer-src/scsi-irix.c [deleted file]
changer-src/scsi-linux.c [deleted file]
changer-src/scsi-proto.c [deleted file]
changer-src/scsi-solaris.c [deleted file]
changer-src/sense.c [deleted file]
client-src/Makefile.am
client-src/Makefile.in
client-src/client_util.c
client-src/client_util.h
client-src/rundump.c
client-src/selfcheck.c
client-src/sendbackup.c
client-src/sendsize.c
common-src/Makefile.am
common-src/Makefile.in
common-src/alloc.c
common-src/amaespipe.sh
common-src/amanda.h
common-src/amfeatures.c
common-src/amfeatures.h
common-src/amgetconf.pl
common-src/amxml.c
common-src/amxml.h
common-src/bsd-security.c
common-src/bsdtcp-security.c
common-src/bsdudp-security.c
common-src/conffile.c
common-src/conffile.h
common-src/event.c
common-src/fileheader-test.c
common-src/fileheader.c
common-src/glib-util.c
common-src/glib-util.h
common-src/krb5-security.c
common-src/local-security.c
common-src/match-test.c
common-src/match.c
common-src/match.h
common-src/queueing-test.c [deleted file]
common-src/queueing.c [deleted file]
common-src/queueing.h [deleted file]
common-src/rsh-security.c
common-src/security-util.c
common-src/security-util.h
common-src/security.h
common-src/semaphore-test.c
common-src/semaphore.c
common-src/simpleprng.c
common-src/sockaddr-util.c
common-src/sockaddr-util.h
common-src/ssh-security.c
common-src/stream.c
common-src/svn-info.h
common-src/timestamp.c
common-src/util.c
common-src/util.h
config/Makefile.in
config/amanda/changer.m4 [deleted file]
config/amanda/debugging.m4
config/amanda/file-list
config/amanda/ipv6.m4
config/amanda/libs.m4
config/amanda/net.m4
config/amanda/progs.m4
config/amanda/shmem.m4 [deleted file]
config/amanda/swig.m4
config/amanda/syshacks.m4
config/amanda/tape.m4
config/amanda/userid.m4
config/arg-nonnull.h [new file with mode: 0644]
config/automake/installperms.am
config/automake/scripts.am
config/c++defs.h [new file with mode: 0644]
config/config.h.in
config/config.rpath
config/gnulib/00gnulib.m4
config/gnulib/alloca.m4
config/gnulib/arpa_inet_h.m4
config/gnulib/asm-underscore.m4 [new file with mode: 0644]
config/gnulib/base64.m4
config/gnulib/btowc.m4
config/gnulib/codeset.m4
config/gnulib/dos.m4 [new file with mode: 0644]
config/gnulib/environ.m4 [new file with mode: 0644]
config/gnulib/errno_h.m4
config/gnulib/extensions.m4
config/gnulib/fcntl-o.m4 [new file with mode: 0644]
config/gnulib/file-list
config/gnulib/float_h.m4
config/gnulib/fseeko.m4
config/gnulib/fsusage.m4
config/gnulib/ftello.m4
config/gnulib/ftruncate.m4
config/gnulib/getaddrinfo.m4
config/gnulib/getopt.m4
config/gnulib/gettimeofday.m4
config/gnulib/glibc21.m4
config/gnulib/gnulib-cache.m4
config/gnulib/gnulib-common.m4
config/gnulib/gnulib-comp.m4
config/gnulib/gnulib-tool.m4
config/gnulib/hostent.m4
config/gnulib/include_next.m4
config/gnulib/inet_ntop.m4
config/gnulib/inet_pton.m4 [new file with mode: 0644]
config/gnulib/intmax_t.m4
config/gnulib/inttypes_h.m4
config/gnulib/langinfo_h.m4 [new file with mode: 0644]
config/gnulib/lib-ld.m4
config/gnulib/lib-link.m4
config/gnulib/lib-prefix.m4
config/gnulib/localcharset.m4
config/gnulib/locale-fr.m4
config/gnulib/locale-ja.m4
config/gnulib/locale-zh.m4
config/gnulib/lock.m4
config/gnulib/longlong.m4
config/gnulib/lseek.m4
config/gnulib/lstat.m4
config/gnulib/malloc.m4
config/gnulib/mbrtowc.m4
config/gnulib/mbsinit.m4
config/gnulib/mbstate_t.m4
config/gnulib/memchr.m4 [new file with mode: 0644]
config/gnulib/mkdtemp.m4
config/gnulib/mmap-anon.m4 [new file with mode: 0644]
config/gnulib/multiarch.m4
config/gnulib/netdb_h.m4
config/gnulib/netinet_in_h.m4
config/gnulib/nl_langinfo.m4 [new file with mode: 0644]
config/gnulib/onceonly.m4
config/gnulib/physmem.m4
config/gnulib/printf.m4
config/gnulib/regex.m4
config/gnulib/safe-read.m4
config/gnulib/safe-write.m4
config/gnulib/servent.m4
config/gnulib/size_max.m4
config/gnulib/snprintf.m4
config/gnulib/socklen.m4
config/gnulib/sockpfaf.m4
config/gnulib/ssize_t.m4
config/gnulib/stat.m4 [new file with mode: 0644]
config/gnulib/stdbool.m4
config/gnulib/stddef_h.m4 [new file with mode: 0644]
config/gnulib/stdint.m4
config/gnulib/stdint_h.m4
config/gnulib/stdio_h.m4
config/gnulib/stdlib_h.m4
config/gnulib/string_h.m4 [new file with mode: 0644]
config/gnulib/sys_socket_h.m4
config/gnulib/sys_stat_h.m4
config/gnulib/sys_time_h.m4
config/gnulib/tempname.m4
config/gnulib/threadlib.m4
config/gnulib/time_h.m4 [new file with mode: 0644]
config/gnulib/unistd_h.m4
config/gnulib/vasnprintf.m4
config/gnulib/visibility.m4 [deleted file]
config/gnulib/warn-on-use.m4 [new file with mode: 0644]
config/gnulib/wchar.m4 [deleted file]
config/gnulib/wchar_h.m4 [new file with mode: 0644]
config/gnulib/wchar_t.m4
config/gnulib/wcrtomb.m4
config/gnulib/wctype.m4 [deleted file]
config/gnulib/wctype_h.m4 [new file with mode: 0644]
config/gnulib/wint_t.m4
config/gnulib/write.m4
config/gnulib/xsize.m4
config/link-warning.h [deleted file]
config/macro-archive/ac_prog_swig.m4
config/set_full_version
config/warn-on-use.h [new file with mode: 0644]
configure
configure.in
device-src/Makefile.am
device-src/Makefile.in
device-src/activate-devpay.c
device-src/amdevcheck.pl
device-src/amtapetype.pl
device-src/device-queueing.c [deleted file]
device-src/device-queueing.h [deleted file]
device-src/device.c
device-src/device.h
device-src/dvdrw-device.c
device-src/ndmp-device.c
device-src/null-device.c
device-src/property.c
device-src/property.h
device-src/rait-device.c
device-src/s3-device.c
device-src/s3.c
device-src/s3.h
device-src/tape-aix.c [deleted file]
device-src/tape-device.c
device-src/tape-device.h [deleted file]
device-src/tape-ops.h [deleted file]
device-src/tape-posix.c [deleted file]
device-src/tape-uware.c [deleted file]
device-src/tape-xenix.c [deleted file]
device-src/vfs-device.c
device-src/vfs-device.h
device-src/vfs-test.c [deleted file]
device-src/xfer-dest-device.c
device-src/xfer-dest-taper-cacher.c [new file with mode: 0644]
device-src/xfer-dest-taper-directtcp.c
device-src/xfer-dest-taper-splitter.c
device-src/xfer-dest-taper.c
device-src/xfer-dest-taper.h [new file with mode: 0644]
device-src/xfer-device.h
device-src/xfer-source-device.c
device-src/xfer-source-recovery.c
example/Makefile.am
example/Makefile.in
example/amanda.conf.in
example/template.d/advanced.conf.in
example/template.d/amanda-S3.conf.in
example/template.d/amanda-harddisk.conf.in
example/template.d/dumptypes
gnulib/Makefile.am
gnulib/Makefile.in
gnulib/alignof.h [new file with mode: 0644]
gnulib/alloca.c [deleted file]
gnulib/alloca.in.h
gnulib/arpa_inet.in.h
gnulib/asnprintf.c
gnulib/base64.c
gnulib/base64.h
gnulib/btowc.c
gnulib/c-ctype.c [new file with mode: 0644]
gnulib/c-ctype.h [new file with mode: 0644]
gnulib/config.charset [changed mode: 0755->0644]
gnulib/errno.in.h
gnulib/float+.h
gnulib/float.in.h
gnulib/fseeko.c
gnulib/fsusage.c
gnulib/fsusage.h
gnulib/ftello.c
gnulib/ftruncate.c
gnulib/full-read.c
gnulib/full-read.h
gnulib/full-write.c
gnulib/full-write.h
gnulib/gai_strerror.c
gnulib/getaddrinfo.c
gnulib/getopt.c
gnulib/getopt.in.h
gnulib/getopt1.c
gnulib/getopt_int.h
gnulib/gettext.h
gnulib/gettimeofday.c
gnulib/glthread/lock.c
gnulib/glthread/lock.h
gnulib/glthread/threadlib.c
gnulib/inet_ntop.c
gnulib/inet_pton.c [new file with mode: 0644]
gnulib/langinfo.in.h [new file with mode: 0644]
gnulib/localcharset.c
gnulib/localcharset.h
gnulib/lseek.c
gnulib/lstat.c
gnulib/malloc.c
gnulib/mbrtowc.c
gnulib/mbsinit.c
gnulib/memchr.c [new file with mode: 0644]
gnulib/memchr.valgrind [new file with mode: 0644]
gnulib/mkdtemp.c
gnulib/netdb.in.h
gnulib/netinet_in.in.h
gnulib/nl_langinfo.c [new file with mode: 0644]
gnulib/physmem.c
gnulib/physmem.h
gnulib/printf-args.c
gnulib/printf-args.h
gnulib/printf-parse.c
gnulib/printf-parse.h
gnulib/ref-add.sin
gnulib/ref-del.sin
gnulib/regcomp.c
gnulib/regenerate/no-error.patch
gnulib/regenerate/regenerate
gnulib/regex.c
gnulib/regex.h
gnulib/regex_internal.c
gnulib/regex_internal.h
gnulib/regexec.c
gnulib/safe-read.c
gnulib/safe-read.h
gnulib/safe-write.c
gnulib/safe-write.h
gnulib/size_max.h
gnulib/snprintf.c
gnulib/stat.c [new file with mode: 0644]
gnulib/stdbool.in.h
gnulib/stddef.in.h [new file with mode: 0644]
gnulib/stdint.in.h
gnulib/stdio-impl.h
gnulib/stdio-write.c
gnulib/stdio.in.h
gnulib/stdlib.in.h
gnulib/streq.h
gnulib/string.in.h [new file with mode: 0644]
gnulib/sys_socket.in.h
gnulib/sys_stat.in.h
gnulib/sys_time.in.h
gnulib/tempname.c
gnulib/tempname.h
gnulib/time.in.h [new file with mode: 0644]
gnulib/unistd.in.h
gnulib/vasnprintf.c
gnulib/vasnprintf.h
gnulib/verify.h
gnulib/wchar.in.h
gnulib/wcrtomb.c
gnulib/wctype.in.h
gnulib/write.c
gnulib/xsize.h
installcheck/Amanda_Changer.pl
installcheck/Amanda_Changer_compat.pl
installcheck/Amanda_Changer_multi.pl
installcheck/Amanda_Changer_ndmp.pl
installcheck/Amanda_Changer_null.pl
installcheck/Amanda_Changer_rait.pl
installcheck/Amanda_Changer_robot.pl
installcheck/Amanda_Changer_single.pl
installcheck/Amanda_Cmdline.pl
installcheck/Amanda_Config.pl
installcheck/Amanda_Config_FoldingHash.pl [new file with mode: 0644]
installcheck/Amanda_Curinfo.pl
installcheck/Amanda_DB_Catalog.pl
installcheck/Amanda_Debug.pl
installcheck/Amanda_Device.pl
installcheck/Amanda_Disklist.pl
installcheck/Amanda_Feature.pl
installcheck/Amanda_Header.pl
installcheck/Amanda_Logfile.pl
installcheck/Amanda_NDMP.pl
installcheck/Amanda_Process.pl
installcheck/Amanda_Recovery_Clerk.pl
installcheck/Amanda_Recovery_Planner.pl
installcheck/Amanda_Recovery_Scan.pl
installcheck/Amanda_Report.pl
installcheck/Amanda_Tapelist.pl
installcheck/Amanda_Taper_Scribe.pl
installcheck/Amanda_Util.pl
installcheck/Amanda_Xfer.pl
installcheck/Installcheck.pm
installcheck/Installcheck/Catalogs.pm [new file with mode: 0644]
installcheck/Installcheck/ClientService.pm
installcheck/Installcheck/Dumpcache.pm
installcheck/Installcheck/Run.pm
installcheck/Makefile.am
installcheck/Makefile.in
installcheck/amadmin.pl
installcheck/amarchiver.pl
installcheck/amcheck-device.pl
installcheck/amcheck.pl
installcheck/amcheckdump.pl
installcheck/amdevcheck.pl
installcheck/amdump.pl
installcheck/amflush.pl [new file with mode: 0644]
installcheck/amgetconf.pl
installcheck/amidxtaped.pl
installcheck/amlabel.pl
installcheck/amoverview.pl [new file with mode: 0644]
installcheck/amrecover.pl
installcheck/amreport.pl
installcheck/amrestore.pl
installcheck/amrmtape.pl
installcheck/amserverconfig.pl [new file with mode: 0644]
installcheck/amservice.pl
installcheck/amstatus.pl
installcheck/amtape.pl
installcheck/amtapetype.pl
installcheck/amvault.pl
installcheck/bigint.pl
installcheck/catalogs/amflush.cat [new file with mode: 0644]
installcheck/catalogs/bigdb.cat [new file with mode: 0644]
installcheck/catalogs/bigestimate.cat [new file with mode: 0644]
installcheck/catalogs/chunker-partial.cat [new file with mode: 0644]
installcheck/catalogs/doublefailure.cat [new file with mode: 0644]
installcheck/catalogs/fatal.cat [new file with mode: 0644]
installcheck/catalogs/filesystemstaped.cat [new file with mode: 0644]
installcheck/catalogs/flush-noorigsize.cat [new file with mode: 0644]
installcheck/catalogs/flush-origsize.cat [new file with mode: 0644]
installcheck/catalogs/longstrange.cat [new file with mode: 0644]
installcheck/catalogs/multi-taper.cat [new file with mode: 0644]
installcheck/catalogs/normal.cat [new file with mode: 0644]
installcheck/catalogs/plannerfail.cat [new file with mode: 0644]
installcheck/catalogs/quoted.cat [new file with mode: 0644]
installcheck/catalogs/resultsmissing.cat [new file with mode: 0644]
installcheck/catalogs/retried-nofinish.cat [new file with mode: 0644]
installcheck/catalogs/retried-strange.cat [new file with mode: 0644]
installcheck/catalogs/retried.cat [new file with mode: 0644]
installcheck/catalogs/shortstrange.cat [new file with mode: 0644]
installcheck/catalogs/skipped.cat [new file with mode: 0644]
installcheck/catalogs/spanned.cat [new file with mode: 0644]
installcheck/catalogs/strontium.cat [new file with mode: 0644]
installcheck/catalogs/taperr.cat [new file with mode: 0644]
installcheck/chunker.pl [new file with mode: 0644]
installcheck/example.pl [new file with mode: 0644]
installcheck/gnutar.pl [new file with mode: 0644]
installcheck/mock_mtx.pl
installcheck/taper.pl
man/Makefile.am
man/Makefile.in
man/amaddclient.8
man/amadmin.8
man/amaespipe.8
man/amanda-applications.7
man/amanda-archive-format.5
man/amanda-auth.7
man/amanda-changers.7
man/amanda-client.conf.5
man/amanda-compatibility.7
man/amanda-devices.7
man/amanda-match.7 [new file with mode: 0644]
man/amanda-scripts.7
man/amanda-taperscan.7
man/amanda.8
man/amanda.conf.5
man/amarchiver.8
man/amcheck.8
man/amcheckdb.8
man/amcheckdump.8
man/amcleanup.8
man/amcrypt-ossl-asym.8
man/amcrypt-ossl.8
man/amcrypt.8
man/amcryptsimple.8
man/amdevcheck.8
man/amdump.8
man/amfetchdump.8
man/amflush.8
man/amgetconf.8
man/amgpgcrypt.8
man/amgtar.8
man/amlabel.8
man/amoverview.8
man/ampgsql.8
man/amplot.8
man/amraw.8
man/amrecover.8
man/amreport.8
man/amrestore.8
man/amrmtape.8
man/amsamba.8
man/amserverconfig.8
man/amservice.8
man/amstar.8
man/amstatus.8
man/amsuntar.8
man/amtape.8
man/amtapetype.8
man/amtoc.8
man/amvault.8
man/amzfs-sendrecv.8
man/amzfs-snapshot.8
man/disklist.5
man/entities/global.entities.in
man/script-email.8
man/tapelist.5
man/xml-source/amadmin.8.xml
man/xml-source/amanda-auth.7.xml
man/xml-source/amanda-changers.7.xml
man/xml-source/amanda-client.conf.5.xml
man/xml-source/amanda-compatibility.7.xml
man/xml-source/amanda-devices.7.xml
man/xml-source/amanda-match.7.xml [new file with mode: 0644]
man/xml-source/amanda-taperscan.7.xml
man/xml-source/amanda.8.xml
man/xml-source/amanda.conf.5.xml
man/xml-source/amcheck.8.xml
man/xml-source/amcheckdump.8.xml
man/xml-source/amdump.8.xml
man/xml-source/amfetchdump.8.xml
man/xml-source/amflush.8.xml
man/xml-source/amgtar.8.xml
man/xml-source/amoverview.8.xml
man/xml-source/ampgsql.8.xml
man/xml-source/amrecover.8.xml
man/xml-source/amreport.8.xml
man/xml-source/amrestore.8.xml
man/xml-source/amvault.8.xml
man/xslt/html.xsl.in
ndmp-src/Makefile.am
ndmp-src/Makefile.in
ndmp-src/amndmjob_main.c
ndmp-src/ndma_comm_dispatch.c
ndmp-src/ndma_comm_session.c
ndmp-src/ndma_cops_query.c
ndmp-src/ndmjob_main.c
ndmp-src/ndml_agent.c
ndmp-src/ndmos_glib.h
ndmp-src/ndmp0_xdr.c
ndmp-src/ndmp2_xdr.c
ndmp-src/ndmp3_xdr.c
ndmp-src/ndmp4_enum_strs.c
ndmp-src/ndmp4_xdr.c
ndmp-src/ndmp9_xdr.c
ndmp-src/ndmpconnobj.c
ndmp-src/ndmpconnobj.h
oldrecover-src/Makefile.am
oldrecover-src/Makefile.in
packaging/Makefile.in
packaging/common/substitute.pl
packaging/deb/buildpkg
packaging/deb/control
packaging/deb/rules
packaging/rpm/amanda.spec [deleted file]
packaging/rpm/amanda.spec.src [new file with mode: 0644]
packaging/rpm/buildpkg
perl/Amanda/Application.c
perl/Amanda/Application.pm
perl/Amanda/Application.swg
perl/Amanda/Application/Zfs.pm
perl/Amanda/Archive.c
perl/Amanda/Changer.pm
perl/Amanda/Changer/disk.pm
perl/Amanda/Changer/ndmp.pm
perl/Amanda/Changer/rait.pm
perl/Amanda/Changer/robot.pm
perl/Amanda/Cmdline.c
perl/Amanda/Cmdline.pm
perl/Amanda/Cmdline.pod
perl/Amanda/Cmdline.swg
perl/Amanda/Config.c
perl/Amanda/Config.pm
perl/Amanda/Config.pod
perl/Amanda/Config.swg
perl/Amanda/Config/FoldingHash.pm [new file with mode: 0644]
perl/Amanda/DB/Catalog.pm
perl/Amanda/Debug.c
perl/Amanda/Device.c
perl/Amanda/Device.pm
perl/Amanda/Device.pod
perl/Amanda/Device.swg
perl/Amanda/Disklist.c
perl/Amanda/Feature.c
perl/Amanda/Feature.pm
perl/Amanda/Feature.pod
perl/Amanda/Header.c
perl/Amanda/Header.pm
perl/Amanda/Header.swg
perl/Amanda/IPC/Binary.c
perl/Amanda/IPC/LineProtocol.pm
perl/Amanda/Logfile.c
perl/Amanda/Logfile.pm
perl/Amanda/Logfile.pod
perl/Amanda/Logfile.swg
perl/Amanda/MainLoop.c
perl/Amanda/MainLoop.pm
perl/Amanda/MainLoop.pod
perl/Amanda/NDMP.c
perl/Amanda/Recovery/Clerk.pm
perl/Amanda/Recovery/Planner.pm
perl/Amanda/Recovery/Scan.pm
perl/Amanda/Report.pm
perl/Amanda/Report/human.pm
perl/Amanda/Report/postscript.pm
perl/Amanda/Report/xml.pm
perl/Amanda/Script.pm
perl/Amanda/Script_App.pm
perl/Amanda/Tapelist.c
perl/Amanda/Tapelist.pm
perl/Amanda/Tapelist.pod
perl/Amanda/Tapelist.swg
perl/Amanda/Taper/Controller.pm [new file with mode: 0644]
perl/Amanda/Taper/Protocol.pm [new file with mode: 0644]
perl/Amanda/Taper/Scan.pm
perl/Amanda/Taper/Scan/traditional.pm
perl/Amanda/Taper/Scribe.pm
perl/Amanda/Taper/Worker.pm [new file with mode: 0644]
perl/Amanda/Tests.c
perl/Amanda/Util.c
perl/Amanda/Util.pm
perl/Amanda/Util.pod
perl/Amanda/Util.swg
perl/Amanda/Xfer.c
perl/Amanda/Xfer.pm
perl/Amanda/Xfer.pod
perl/Amanda/Xfer.swg
perl/Amanda/XferServer.c
perl/Amanda/XferServer.pm
perl/Amanda/XferServer.swg
perl/Makefile.am
perl/Makefile.in
perl/amglue/Makefile.am [new file with mode: 0644]
perl/amglue/Makefile.in [new file with mode: 0644]
perl/amglue/amglue.swg
perl/amglue/constants.swg
perl/amglue/directtcp.swg
perl/amglue/ghashtable.c
perl/amglue/glib.swg
po/Makefile.in
recover-src/Makefile.am
recover-src/Makefile.in
recover-src/amrecover.c
recover-src/display_commands.c
recover-src/extract_list.c
server-src/Makefile.am
server-src/Makefile.in
server-src/amadmin.c
server-src/amcheck.c
server-src/amcheckdump.pl
server-src/amcleanup.pl
server-src/amcleanupdisk.c
server-src/amdump.pl [new file with mode: 0644]
server-src/amdump.sh [deleted file]
server-src/amfetchdump.pl
server-src/amflush.c
server-src/amidxtaped.pl
server-src/amindexd.c
server-src/amlabel.pl
server-src/amlogroll.c [deleted file]
server-src/amlogroll.pl [new file with mode: 0644]
server-src/amoverview.pl
server-src/amreport.pl
server-src/amrestore.pl
server-src/amrmtape.pl
server-src/amserverconfig.pl
server-src/amstatus.pl
server-src/amtape.pl
server-src/amtrmidx.c
server-src/amvault.pl
server-src/chunker.c
server-src/cmdline.c
server-src/cmdline.h
server-src/diskfile.c
server-src/diskfile.h
server-src/driver.c
server-src/driverio.c
server-src/driverio.h
server-src/dumper.c
server-src/find.c
server-src/find.h
server-src/holding.c
server-src/holding.h
server-src/logfile.c
server-src/logfile.h
server-src/planner.c
server-src/server_util.c
server-src/server_util.h
server-src/taper.pl
server-src/xfer-source-holding.c
xfer-src/Makefile.in
xfer-src/dest-buffer.c
xfer-src/dest-directtcp-connect.c
xfer-src/dest-directtcp-listen.c
xfer-src/dest-fd.c
xfer-src/dest-null.c
xfer-src/element-glue.c
xfer-src/filter-process.c
xfer-src/filter-xor.c
xfer-src/source-directtcp-connect.c
xfer-src/source-directtcp-listen.c
xfer-src/source-fd.c
xfer-src/source-pattern.c
xfer-src/source-random.c
xfer-src/xfer-element.c
xfer-src/xfer-element.h
xfer-src/xfer-test.c
xfer-src/xfer.c
xfer-src/xfer.h
xfer-src/xmsg.c

diff --git a/AUTHORS b/AUTHORS
index 976334b7dbf7e4988464a6bbe1bf6ce5b1156a11..e8d4ec688ef4dc611c66585d21785cad691fbd2a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -103,3 +103,14 @@ Ben Slusky <sluskyb@paranoiacs.org>
 Sam Couter <sam@couter.id.au>
     DVD-RW device
     Contributions made under the UMD license
+
+Orion Poplawski <orion@cora.nwra.com>
+    amoverview, perl report fixes
+    Contributions made under GPLv2
+
+Stephen Gelman <ssgelm@gmail.com>
+    Nexenta support and patches
+    Contributions made under GPLv2
+
+Nikhil Bhupale <nikhilb@zmanda.com>
+    Contributions made under GPLv2
index 23858a0cc04c808fdc0c80118c054d309649cf03..bc8ed6698dccc565a528b40a37142ad171d023f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
-2010-05-28 Dan Locks <dwlocks@zmanda.com>
-       *  VERSION: Update for release
+2010-10-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * VERSION: 3.2.0
+
+2010-10-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/ampgsql.pl: Give an error if client property
+         pg-datadir is different than diskdevice. Use diskdevice if client
+         property pg-datadir is not set.
+
+2010-10-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c: Quote error message for invalid size.
+
+2010-10-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c (read_size_byte/get_size_byte):
+         CNF_DEVICE_OUTPUT_BUFFER_SIZE is in bytes.
+
+2010-10-14 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/deb/rules, packaging/deb/buildpkg,
+          packaging/rpm/amanda.spec.src: remove port range limits for
+          rpm and deb packages
+
+2010-10-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/amglue/ghashtable.c: Define PERL_MAGIC_tied.
+
+2010-10-12  Jean-Louis Martineau <martineau@zmanda.com>
+        * device-src/s3-device.c: Don't check 'self->use_ssl && !self->ca_info'.
+
+2010-10-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * ndmp-src/ndma_comm_session.c: add a g_debug message
+       * ndmp-src/ndmjob_main.c: remove redundant exit-on-stdin-eof
+
+2010-10-12 Dan Locks <dwlocks@zmanda.com>
+       *  config/amanda/progs.m4: add comment about sysloc- and locsys- path,
+          make MTX a precious variable.
+
+2010-10-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * ndmp-src/amndmjob_main.c: remove exit on eof thread
+       * ndmp-src/ndmjob_main.c: add it here, in the right place
+
+2010-10-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/ssh-security.c: don't munge $SSH_CONNETION
+
+2010-10-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/swig.m4: add '.' to freebsd versions
+       * perl/Makefile.am: spell it -pthread
+
+2010-10-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amvault.pl: add fake driver finish first
+
+2010-10-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amflush.c: write a "pid done" line when cancelling
+       * server-src/amcleanup.pl: run amlogroll internally
+
+2010-10-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Taper/Worker.pm: remove cont_filename from header before
+         writing to a real volume
+       * perl/Amanda/Recovery/Clerk.pm: remove it when restoring, too
+
+2010-10-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amvault.pl: --autolabel any, not --autolabel all
+       * installcheck/amvault.pl: update the tests to use --autolabel=any
+
+2010-10-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/s3-device.c: Don't give an error is ssl_ca_info is set
+         and ssl is not used.
+
+2010-10-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/client_util.c: Use property_add_to_argv.
+       * client-src/client_util.h (application_property_argv_size):
+         Remove prototype.
+       * common-src/conffile.c: Use g_str_amanda_hash and g_str_amanda_equal
+         for property hash.
+       * common-src/conffile.c (property_add_to_argv): Remove function
+       * common-src/conffile.h (property_add_to_argv): Remove prototype.
+       * common-src/glib-util.c (g_str_amanda_hash, g_str_amanda_equal):
+         Add function
+       * common-src/glib-util.h (g_str_amanda_hash, g_str_amanda_equal):
+         Add prototype.
+       * common-src/util.c (proplist_add_to_argv, property_add_to_argv):
+         Add function.
+       * common-src/util.h (proplist_add_to_argv, property_add_to_argv):
+         Add prototype.
+       * perl/Amanda/Config.pod: Document amandaify_property_name.
+       * perl/Amanda/Config.swg: Add amandaify_property_name.
+       * perl/Amanda/Config/FoldingHash.pm: New class.
+       * perl/Makefile.am: Add perl/Amanda/Config/FoldingHash.pm
+       * perl/amglue/ghashtable.c: Use A::C::FoldingHash.pm for property hash.
+       * recover-src/extract_list.c: Use property_add_to_argv
+       * installcheck/Amanda_Config.pl: Check property case matching.
+       * installcheck/Amanda_Config_FoldingHash.pl:
+         Check Amanda::Config::FoldingHash.
+       * installcheck/Makefile.am:
+         Add installcheck/Amanda_Config_FoldingHash.pl
+
+2010-10-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/planner.c: Log packet sent and received.
+
+2010-10-06  Dustin J. Mitchell <dustin@zmanda.com>
+       * VERSION: 3.2.0beta3
+
+2010-10-06  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Makefile.am: only run the threading test after install
+
+2010-10-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * VERSION: 3.2.0beta2
+
+2010-10-06  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Makefile.am: fix the FreeBSD threading test to actually fail
+
+2010-10-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/dvdrw-device.c: Always call parent_class->finish(dself).
+       * device-src/ndmp-device.c: Always call close_tape_agent and
+                                   close_connection.
+       * device-src/null-device.c: Always set pself->access_mode to
+                                   ACCESS_NULL.
+       * device-src/rait-device.c: Always call child finish.
+       * device-src/s3-device.c: Always set pself->access_mode to ACCESS_NULL.
+       * device-src/tape-device.c: Always close self->fd.
+       * device-src/vfs-device.c: Always set pself->access_mode to ACCESS_NULL.
+
+2010-10-06  Nandan Athawale <nandan.athawale@gmail.com>
+       * device-src/s3.c: replaced deprecated functions g_strncasecmp
+         and g_strcasecmp with g_ascii_strncasecmp and g_ascii_strcasecmp.
+
+2010-10-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/entities/global.entities.in: better formatting for config
+         overrides
+       * man/xml-source/amvault.8.xml: better synopsis formatting
+       * server-src/amvault.pl: better synopsis formatting
+
+2010-10-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Logfile.swg: don't produce negative durations
+       * perl/Amanda/DB/Catalog.pm: but handle them when they occur
+
+2010-10-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Report/human.pm: Correctly print "Level:#".
+
+2010-10-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/planner.c: Use last_level to compute the bump level.
+
+2010-10-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/dumper.c: Fix memory allocation.
+
+2010-10-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amidxtaped.pl: exact match for same-host, allow dumps
+         that are not in the disklist
+       * server-src/amindexd.c: fix trivially permissive same-host
+
+2010-10-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amxml.c: set the correct fields (encryption or
+         compression)
+       * server-src/dumper.c: strdup strings so they are not gone after
+         free_dle
+
+2010-10-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Report.pm: fix autovivification bug
+       * perl/Amanda/Report/human.pm: detect re-flushing; fix a lot of 
+         undefined's
+
+2010-10-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amtape.pl: Add a 'return' for every usage() call.
+         Add step in main.
+
+2010-10-01  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amvault.8.xml: mention that DLE splitting parameters
+         are ignored by amvault
+       * server-src/amvault.pl: use tapetype parameters for splitting
+       * perl/Amanda/Taper/Scribe.pm: support splitting parameters straight
+         from Amanda::Config
+
+2010-10-01  Dustin J. Mitchell <dustin@zmanda.com>
+       * packaging/deb/rules: remove misleading comment about automake-1.2
+
+2010-10-01  Dustin J. Mitchell <dustin@zmanda.com>
+       * contrib/convert-zd-mtx-to-robot.sh: set default for driveslot, ask
+         user to clear out 'tapedev' too
+
+2010-09-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/event.c: Set the priority of EV_TIME to 10.
+
+2010-09-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Report/postscript.pm: print all dles that have a part
+         on the volume.
+       * installcheck/catalogs/spanned.cat: Check it.
+
+2010-09-30  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Taper/Scan/traditional.pm: use set_current in stage 1,
+         too
+
+2010-09-29  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/dumper.c: fix prints; use the correct disk_t fields
+
+2010-09-29  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/alloc.c: Remove a print to stderr.
+
+2010-09-29  Jean-Louis Martineau <martineau@zmanda.com>
+       * NEWS, ReleaseNotes: Update.
+
+2010-09-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/amvault.pl: fix tests for total size
+
+2010-09-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/util.c: remove debugging call
+       * installcheck/Amanda_Util.pl: fix tests on perl-5.6
+
+2010-09-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amvault.pl: print total size on --dry-run
+
+2010-09-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Config.pl: fix test
+
+2010-09-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * NEWS: update NEWS about it
+       * common-src/conffile.c common-src/conffile.h: add recovery-list
+         parameters
+       * man/xml-source/amanda.conf.5.xml: document them
+       * perl/Amanda/Config.pod perl/Amanda/Config.swg: SWIG them
+       * installcheck/Amanda_Config.pl: test them
+       * server-src/amidxtaped.pl: check recovery limits
+       * installcheck/amidxtaped.pl
+         installcheck/Installcheck/ClientService.pm: test it
+       * server-src/amindexd.c: check recovery limits
+
+2010-09-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * recover-src/extract_list.c: Print number of bytes read.
+
+2010-09-28 Dan Locks <dwlocks@zmanda.com>
+       *  config/amanda/progs.m4: remove first instance of
+          AMANDA_PROG_GNUPLOT
+
+2010-09-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amanda.h common-src/alloc.c: add save_env_full
+       * amandad-src/amandad.c: set $AMANDA_AUTHENTICATED_PEER for services
+
+2010-09-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/amxml.c: Fix unallocating NULL g_hash.
+       * server-src/chunker.c: Don't free cmdargs.
+
+2010-09-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c: Fix pointer arithmetic.
+
+2010-09-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/Makefile.am man/xml-source/amanda-match.7.xml: new manpage with
+         descriptions of match expressions
+       * man/xml-source/amadmin.8.xml man/xml-source/amanda.8.xml
+         man/xml-source/amdump.8.xml man/xml-source/amfetchdump.8.xml
+         man/xml-source/amflush.8.xml man/xml-source/amrestore.8.xml
+         man/xml-source/amvault.8.xml: reference it
+
+2010-09-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/util.c common-src/util.h: support ##.## in braced
+         alternates
+       * installcheck/Amanda_Util.pl: test it
+       * perl/Amanda/Util.pod man/xml-source/amanda-changers.7.xml
+         man/xml-source/amanda-devices.7.xml: document it
+
+2010-09-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c, client-src/client_util.c,
+         client-src/selfcheck.c, client-src/sendsize.c, common-src/amxml.c,
+         common-src/amxml.h, common-src/glib-util.c, common-src/glib-util.h,
+         common-src/security-util.c, common-src/util.c,
+         perl/Amanda/Tapelist.swg, server-src/amcheck.c, server-src/amtrmidx.c,
+         server-src/chunker.c, server-src/diskfile.c, server-src/driver.c,
+         server-src/driverio.c, server-src/dumper.c, server-src/find.c,
+         server-src/holding.c, server-src/planner.c, server-src/server_util.c,
+         server-src/xfer-source-holding.c: Fix memory leak.
+
+2010-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/alloc.c: remove amtable functions
+       * common-src/amanda.h: remove prototypes
+
+2010-09-24  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/amstar.c: Check root can cd to the directory.
+
+2010-09-24  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Report/human.pm: Correctly print new tapes to use.
+       * installcheck/catalogs/filesystemstaped.cat: write the tapelist file
+       * installcheck/amreport.pl: Test it.
+
+2010-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * NEWS: amvault and other new news
+       * server-src/amvault.pl: support --dry-run
+       * man/xml-source/amvault.8.xml: docs
+       * installcheck/amvault.pl: tests
+
+2010-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/security.h: add get_authenticated_peer_name method
+       * common-src/security-util.c common-src/security-util.h: add two
+         implementations
+       * common-src/sockaddr-util.c common-src/sockaddr-util.h: add
+         str_to_sockaddr
+       * amandad-src/amandad.c: log authenticated peer name
+       * common-src/bsd-security.c common-src/bsdtcp-security.c
+         common-src/bsdudp-security.c common-src/krb5-security.c
+         common-src/local-security.c common-src/rsh-security.c
+         common-src/ssh-security.c: implement get_authenticated_peer_name
+       * common-src/util.h: fix comments
+       * config/gnulib/gnulib-cache.m4 config/gnulib/gnulib-comp.m4
+         config/gnulib/inet_pton.m4 gnulib/Makefile.am gnulib/c-ctype.c
+         gnulib/c-ctype.h gnulib/inet_pton.c gnulib/regenerate/regenerate: add
+         inet_pton module
+       * man/xml-source/amanda-auth.7.xml: update manual to describe
+         authenticated peer names
+
+2010-09-24  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c: Check size before allocating.
+
+2010-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda-devices.7.xml: LEOM property is not read-only
+
+2010-09-24  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/xfer-dest-taper-splitter.c (device_thread_write_part):
+         Don't write more than the block size.
+
+2010-09-23  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/amreport.pl: update checks to match amreport change
+
+2010-09-23  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Cmdline.pod perl/Amanda/Cmdline.swg: update POD, add
+         exports
+       * server-src/amreport.pl: don't print anything in script mode when
+         there is nothing to do
+       * perl/Amanda/Report.pm: handle ERROR and FATAL from amvault
+       * server-src/amvault.pl: make dst-changer and src-timestamp into
+         --options and add support for dumpspecs
+       * man/xml-source/amvault.8.xml: document
+       * installcheck/amvault.pl: test changes
+       * installcheck/Amanda_Cmdline.pl: remove TODO
+
+2010-09-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c (startaflush_tape): Use tape_length if the
+         tape is not started.
+
+2010-09-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xslt/html.xsl.in: include Amanda version in HTML footers
+
+2010-09-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amvault.pl: add an INFO line for every source volume read
+
+2010-09-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amvault.pl: add extra logging for amreport, and invoke
+         amreport at the end of a run
+       * perl/Amanda/Logfile.swg server-src/logfile.c server-src/logfile.h:
+         add P_AMVAULT
+       * perl/Amanda/Report.pm perl/Amanda/Report/human.pm
+         server-src/amreport.pl: handle amvault logs, too
+
+2010-09-21  Orion Poplawski <orion@cora.nwra.com>
+       * server-src/amoverview.pl: fix remaining uninitialized value warnings
+
+2010-09-21  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/DB/Catalog.pm: add a status even for dumps with no
+         successful parts on tape; comments and POD
+
+2010-09-21  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/catalogs/amflush.cat
+         installcheck/catalogs/bigestimate.cat
+         installcheck/catalogs/doublefailure.cat
+         installcheck/catalogs/fatal.cat
+         installcheck/catalogs/filesystemstaped.cat
+         installcheck/catalogs/flush-noorigsize.cat
+         installcheck/catalogs/flush-origsize.cat
+         installcheck/catalogs/longstrange.cat
+         installcheck/catalogs/multi-taper.cat installcheck/catalogs/normal.cat
+         installcheck/catalogs/plannerfail.cat
+         installcheck/catalogs/resultsmissing.cat
+         installcheck/catalogs/retried-nofinish.cat
+         installcheck/catalogs/retried-strange.cat
+         installcheck/catalogs/retried.cat
+         installcheck/catalogs/shortstrange.cat
+         installcheck/catalogs/skipped.cat installcheck/catalogs/spanned.cat
+         installcheck/catalogs/strontium.cat installcheck/catalogs/taperr.cat:
+         update expected reports to match updated amreport output
+
+2010-09-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheck.c, server-src/driver.c, server-src/planner.c:
+         Don't print warning for 'holdingdisk auto' and directtcp data path.
+
+2010-09-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/amgtar.c: Add VERBOSE property,
+         unlink include/exclude file if VERBOSE if NO.
+       * man/xml-source/amgtar.8.xml: Document VERBOSE property.
+
+2010-09-21  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Makefile.am: make the thread check mandatory on FreeBSD
+       * config/amanda/swig.m4: detect FreeBSD
+
+2010-09-21  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Report/human.pm: change some strings, and make
+         the statistics section more succinct; suggested by Jon LaBadie
+
+2010-09-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amadmin.c: add 'dles' and 'hosts' subcommands
+       * man/xml-source/amadmin.8.xml: document them
+
+2010-09-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Script_App.pm: Call _set_mesgout.
+       * perl/Amanda/Application.swg, perl/Amanda/Script.pm (_set_mesgout):
+         Set $self->{mesgout}.
+       * application-src/amraw.pl, application-src/amsamba.pl
+         application-src/amsuntar.pl, application-src/amzfs-sendrecv.pl,
+         Don't set $self->{mesgout}.
+
+2010-09-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/DB/Catalog.pm: docs changes + defensive programming
+
+2010-09-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/find.c: only expect partnum/totalparts in taper log lines
+       * installcheck/catalogs/bigdb.cat: tests
+
+2010-09-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/xfer-source-recovery.c: add XFER_MECH_DIRECTTCP_LISTEN to
+         XferSourceRecovery
+
+2010-09-19  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Changer/disk.pm: but still return stringy slot names
+
+2010-09-19  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Changer/disk.pm: sort slots numerically; patch by
+         'ghosts' on forums.zmanda.com
+
+2010-09-18  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda-devices.7.xml: more detail on LEOM handling in
+         tape device
+
+2010-09-18  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Xfer.swg: conditionalize loading XferServer on server
+         component
+
+2010-09-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/dumper.c: Send filter STDERR to log file, backup is
+         marked as failed.
+
+2010-09-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/ndmp-device.c, device-src/tape-device.c,
+       * device-src/vfs-device.c: Don't set the header if nothing is read.
+       * device-src/vfs-device.c: Set header to F_EMTPY if file 0 doesn't
+         exists
+       * perl/Amanda/Taper/Scan/traditional.pm: Correctly check device
+         status and header.
+       * installcheck/Amanda_Changer_multi.pl: Updated.
+       * installcheck/amcheck-device.pl: Updated.
+       * installcheck/amdevcheck.pl: Updated.
+
+2010-09-17  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/driver.c: start up correctly with --no-taper
+       * server-src/driverio.c server-src/driverio.h: take no_taper as
+         argument to startup_tape_process
+
+2010-09-17  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/DB/Catalog.pm: new methods to determine the type of
+         a run
+       * installcheck/Amanda_DB_Catalog.pl: test them
+       * server-src/amvault.pl: 'latest' excludes amvault runs; add START
+         amvault to identify such runs
+       * installcheck/catalogs/bigdb.cat: add 'START planner' where missing
+       * installcheck/amvault.pl: cleanup after tests
+
+2010-09-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * NEWS: mention improvements to amvault
+       * server-src/amvault.pl: Add --autolabel=.. and --label-template=..
+       * installcheck/amvault.pl: update tests
+       * man/xml-source/amvault.8.xml: update manpage
+
+2010-09-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amreport.pl: support more than one email address
+       * installcheck/amreport.pl: change error message
+
+2010-09-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Scribe.pm: Generate new label and reserved them
+         in the tapelist file.
+         Remove the "Will write new label `$LABEL' to new tape" message.
+       * perl/Amanda/Taper/Scan.pm (make_new_tape_label): Canget the tapelist
+          in the argument.
+       * perl/Amanda/Taper/Worker.pm: Don't update the tapelist file.
+       * server-src/amvault.pl: Don't update the tapelist file.
+       * installcheck/Amanda_Report.pl: Remove 'Will write ...' message.
+         installcheck/Amanda_Taper_Scribe.pl: Remove 'Will write ...' message.
+         installcheck/taper.pl: Remove 'Will write ...' message.
+
+2010-09-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Tapelist.swg: New Amanda::Tapelist API with lock.
+       * perl/Amanda/Tapelist.pod: Document new API.
+         perl/Amanda/DB/Catalog.pm, perl/Amanda/Recovery/Planner.pm,
+         perl/Amanda/Taper/Scan.pm, perl/Amanda/Taper/Scan/traditional.pm,
+         perl/Amanda/Taper/Worker.pm, server-src/amcheckdump.pl,
+         server-src/amlabel.pl, server-src/amreport.pl,
+         server-src/amrmtape.pl, server-src/amvault.pl: Use new API
+       * installcheck/Amanda_Logfile.pl,
+         installcheck/Amanda_Tapelist.pl, installcheck/amlabel.pl,
+         installcheck/amrmtape.pl, installcheck/amtape.pl,
+         installcheck/Amanda_Recovery_Clerk.pl: Fix for new API.
+
+2010-09-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * xfer-src/xfer.c xfer-src/xfer.h: add xfer_atomic_swap_fd
+       * xfer-src/xfer-element.c xfer-src/xfer-element.h: add
+         xfer_element_swap_input_fd and xfer_element_swap_output_fd and
+         use them to access input_fd and output_fd atomically
+       * xfer-src/element-glue.c: add get_read_fd and get_write_fd to handle
+         taking ownership of fd's even in pull_and_write and read_and_push
+       * xfer-src/filter-process.c xfer-src/source-fd.c xfer-src/xfer-test.c
+         xfer-src/dest-fd.c: use xfer_element_swap_*_fd
+
+2010-09-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Worker.pm: Use 'our $tape_num'.
+       * installcheck/taper.pl: Fix for correct tape_num.
+
+2010-09-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Use many worker.
+       * server-src/driverio.c: Init many worker.
+       * server-src/driverio.h (TaperState): New taper state.
+       * server-src/server_util.c: Add "TAKE-SCRIBE-FROM".
+       * server-src/server_util.h: Add TAKE_SCRIBE_FROM.
+
+2010-09-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Protocol.pm (TAKE_SCRIBE_FROM): New in protocol.
+       * perl/Amanda/Taper/Controller.pm (msg_TAKE_SCRIBE_FROM): New function.
+       * perl/Amanda/Taper/Scribe.pm: Add scribe parameter in perm_cb.
+         transfert the xfer to a new scribe.
+       * perl/Amanda/Taper/Worker.pm (TAKE_SCRIBE_FROM): New method.
+       * perl/Amanda/Xfer.swg (xfer_set_callback): New method.
+       * installcheck/taper.pl: Test TAKE-SCRIBE-FROM command.
+
+2010-09-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * installcheck/Amanda_Changer_compat.pl: Fix Installcheck::Run::setup.
+       * installcheck/Installcheck/Run.pm (setup): Take an argument to set
+                                                   new vtapes.
+       * installcheck/Amanda_Taper_Scribe.pl: Fix for start_scan and perm_cb.
+       * installcheck/taper.pl: Fix and test for START_SCAN cmd.
+       * perl/Amanda/Taper/Controller.pm (msg_START_SCAN): New function.
+       * perl/Amanda/Taper/Protocol.pm (START_SCAN): New in protocol.
+       * perl/Amanda/Taper/Scribe.pm: Doesn't automaticaly start a scan,
+         new perm_cb argument, new start_scan method.
+       * perl/Amanda/Taper/Worker.pm (START_SCAN): New method,
+         call perm_cb with new argument.
+       * server-src/amvault.pl: Call start_scan and perm_cb with new argument.
+       * server-src/driver.c: Send START_SCAN command to taper.
+       * server-src/driverio.c (taper_cmd): Add START_SCAN.
+       * server-src/server_util.c (cmdstr): add "START-SCAN".
+       * server-src/server_util.h: Add START_SCAN.
+
+2010-09-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Protocol.pm: Add worker_name in protocol.
+       * perl/Amanda/Taper/Controller.pm,
+       * perl/Amanda/Taper/Worker.pm: Use worker_name.
+       * server-src/driverio.c (taper_cmd): Send worker_name to taper.
+       * server-src/driver.c: New argument to taper_cmd.
+       * server-src/amstatus.pl: Parse worker_name.
+       * installcheck/catalogs/chunker-partial.cat,
+         installcheck/catalogs/normal.cat,
+         installcheck/catalogs/quoted.cat: Add worker_name.
+       * installcheck/taper.pl: Add worker_name.
+
+2010-09-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taper.pl: Split in many files, add the worker.
+       * perl/Amanda/Taper/Controller.pm: Splitted from taper.pl
+       * perl/Amanda/Taper/Protocol.pm: Splitted from taper.pl
+       * perl/Amanda/Taper/Worker.pm: New class
+       * perl/Makefile.am: Add Controller.pm, Protocol.pm and Worker.pm.
+
+2010-09-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml: update 'tapecycle' description
+
+2010-09-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amflush.c: Don't include driverio.h
+       * server-src/driver.c, server-src/driverio.c, server-src/driverio.h:
+         Put all taper variables in a taper_t structure.
+
+2010-09-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * installcheck/amreport.pl: Load the config instead of using amgetconf.
+
+2010-09-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * installcheck/amreport.pl: Use full path to amgetconf.
+
+2010-09-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c: Parse log with taper lines mixed.
+       * perl/Amanda/Report.pm: Parse log with taper lines mixed.
+       * installcheck/Amanda_DB_Catalog.pl: Check it.
+       * installcheck/Makefile.am (catalogs) : Add catalogs/multi-taper.cat.
+       * installcheck/amreport.pl: Check it;
+       * installcheck/catalogs/multi-taper.cat: Catalog with taper lines mixed.
+
+2010-09-13  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amoverview.8.xml: document long options
+       * server-src/amoverview.pl: fix bugs, stop using perl formats, and
+         give long options in the usage message
+       * installcheck/catalogs/bigdb.cat: add disklist
+       * installcheck/amoverview.pl: more thorough tests based on bigdb
+
+2010-09-13  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amdump.8.xml: document --no-taper
+       * server-src/Makefile.am: rename amdump.sh -> .pl
+       * server-src/amdump.sh server-src/amdump.pl: rewrite in perl, add
+         --no-taper
+       * server-src/driver.c: support --no-taper by not starting taper
+       * server-src/planner.c: support --no-taper by not sending flushes
+
+2010-09-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c (find_dump): Don't print the
+                                        'log files found for tape' warning.
+       * server-src/amadmin.c: Call find_log to print the warning.
+
+2010-09-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amserverconfig.pl: Use $pw[0].
+
+2010-09-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Add taper-parallel-write.
+       * common-src/conffile.h: Add taper-parallel-write.
+       * man/xml-source/amanda.conf.5.xml:: Add taper-parallel-write.
+
+2010-09-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am installcheck/amflush.pl: new installcheck
+
+       * server-src/amflush.c: flush DLEs that aren't in the disklist anymore
+       * server-src/diskfile.c server-src/diskfile.h: add match_dumpfile,
+         based on match_disklist
+       * server-src/driver.c: load holding-disk pseudo-DLEs at startup
+       * server-src/driverio.c: survive configuration-free DLEs
+       * server-src/holding.c server-src/holding.h: search_holding_file no
+         longer checks against disklist
+       * server-src/planner.c: use match_dumpfile for holding-disk DLEs
+
+2010-09-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Device.pl: use srcdir
+       * installcheck/Installcheck.pm: set srcdir from env
+       * installcheck/Installcheck/Catalogs.pm: use srcdir
+       * installcheck/Makefile.am: set $srcdir for tests
+
+2010-09-09  Lyndon Nerenberg <lyndon@orthanc.ca>
+       * Makefile.am: fix to enable builds outside srcdir
+
+2010-09-09  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amvault.pl: add --export
+       * man/xml-source/amvault.8.xml: doc it
+       * installcheck/amvault.pl: test it
+
+2010-09-09  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/find.c: fix segfault and bug in failed-dumps-in-catalog
+         hack
+
+2010-09-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am: include
+         installcheck/catalog/retried-strange.cat in distribution
+
+2010-09-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/catalogs/retried-strange.cat: add a retried dump
+         where the retry is strange
+       * installcheck/amreport.pl: test it
+       * perl/Amanda/Report/human.pm: fix the bug it reveals
+
+2010-09-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * gnulib/regenerate/regenerate: add 'environ' module
+       * config/gnulib/gnulib-cache.m4 config/gnulib/gnulib-comp.m4
+         gnulib/Makefile.am config/gnulib/environ.m4: new module
+
+2010-09-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/gnulib/* gnulib/*: upgrade to get a fix to getopt.m4
+       * gnulib/regenerate/regenerate: change gnulib sha1
+
+2010-09-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amreport.8.xml: describe the format of the dump, with
+         notes and details
+
+2010-09-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Taper/Scribe.pm: add scribe_notif_tape_done
+       * installcheck/Amanda_Taper_Scribe.pl: test it
+
+2010-09-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/ampgsql.pl: Send tar stderr to the server.
+
+2010-09-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amserverconfig.pl: use RUNNING_AS_ANY and
+                                       set dumpuser in amanda.conf.
+
+2010-09-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/alloc.c: remove unnecessary declaration of 'environ'
+
+2010-09-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Changer/robot.pm: allow move to move loaded volumes
+       * installcheck/Amanda_Changer_robot.pl: test it
+
+2010-09-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * ndmp-src/ndmpconnobj.c: When listening for a notify, do not hog the
+         ndmlib_mutex
+
+2010-09-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/gnulib/* gnulib/*: Gnulib fix reflected into Amanda; see
+         http://www.mail-archive.com/bug-gnulib@gnu.org/msg19345.html
+
+2010-09-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Recovery_Clerk.pl: re-use already-full changer
+         slots, to save space
+
+2010-09-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Changer.pm: fix make_combined_error
+       * perl/Amanda/Changer/robot.pm: correctly set up polling for device
+         ready; use 'unknown', not 'device', as a reason; always return a
+         changer error, not a string
+
+2010-09-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/tape-aix.c device-src/tape-uware.c
+         device-src/tape-xenix.c: remove unmaintained, and apparently unused,
+         implementations
+       * device-src/tape-posix.c device-src/tape-device.c: merge tape-posix.c
+       * device-src/tape-device.h: remove
+       * device-src/tape-ops.h: remove
+
+       * config/amanda/tape.m4: don't look for AIX, Uware, or Xenix anymore
+       * device-src/Makefile.am: remove tape ops conditionals
+
+2010-09-01  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in: add check for unsetenv
+
+2010-09-01  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am: add Installcheck::Catalog and the
+         catalogs to the distribution
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/amserverconfig.pl: skip the correct number of tests
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/amserverconfig.pl: don't try running tape-changer if
+         MTX is not installed
+       * server-src/amserverconfig.pl: create $CONFIG_DIR if required.  This
+         passes on my system and should pass on the Mac systems.
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/.gitignore: don't ignore these files
+       * config/arg-nonnull.h config/c++defs.h config/warn-on-use.h: add
+         ignored, but required, gnulib files
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * NEWS: note removal of changers
+       * changer-src/Makefile.am changer-src/chg-chio.pl
+         changer-src/chg-chs.sh changer-src/chg-iomega.pl
+         changer-src/chg-juke.sh changer-src/chg-mcutil.sh
+         changer-src/chg-mtx.sh changer-src/chg-null.sh changer-src/chg-rait.sh
+         changer-src/chg-rth.pl changer-src/chg-scsi-chio.c
+         changer-src/chg-scsi.c changer-src/libscsi.h changer-src/scsi-aix.c
+         changer-src/scsi-bsd.c changer-src/scsi-cam.c
+         changer-src/scsi-changer-driver.c changer-src/scsi-chio.c
+         changer-src/scsi-defs.h changer-src/scsi-hpux.c
+         changer-src/scsi-hpux_new.c changer-src/scsi-irix.c
+         changer-src/scsi-linux.c changer-src/scsi-proto.c
+         changer-src/scsi-solaris.c changer-src/sense.c: remove changers and
+         system-specific SCSI code
+       * config/amanda/changer.m4: remove unnecessary checks
+       * config/amanda/progs.m4: remove checks for chio, chs, and mcutil
+       * configure.in: remove changer invocations
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/driverio.c: Don't write negative origsizes to the taper
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amcheck.c: drop root privs during the server check, so
+         that access() will test the dumpuser's perms, not root's perms
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Taper_Scribe.pl: spell it part-cache-dir
+       * installcheck/amtapetype.pl: spell it device-property
+       * server-src/amcheckdump.pl: tar requires -tf, not tf, after a long
+         option
+       * server-src/amserverconfig.pl: use Amanda::Util and mkpath instead of
+         mkdir
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am: new tests
+       * installcheck/amserverconfig.pl: run amserverconfig
+       * installcheck/example.pl: test that templates parse properly
+       * server-src/amserverconfig.pl: minor cleanup of old perl
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/dumper.c changer-src/chg-scsi.c: use fseeko
+       * config/.gitignore config/config.rpath config/gnulib/* gnulib/*:
+         upgrade gnulib
+       * gnulib/regenerate/no-error.patch: updated patch
+       * gnulib/regenerate/regenerate: drop visibility module; specify new
+         git hash
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/catalogs/normal.cat: add orig-size -1 and orig-size 0
+         to logfiles to check handling of those cases
+       * perl/Amanda/Report.pm: fix (egregious) typo
+       * perl/Amanda/Report/human.pm: handle compression better, handle
+         printing non-contiguous levels
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * application-src/ampgsql.pl: remove check for a directory that
+         should not be readable to the amanda user
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * application-src/amgtar.c application-src/ampgsql.pl
+         recover-src/extract_list.c server-src/amcheckdump.pl: Use
+         --ignore-zeros in all -t or -x invocations of gtar
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda-auth.7.xml
+         man/xml-source/amanda-changers.7.xml
+         man/xml-source/amanda-client.conf.5.xml
+         man/xml-source/amanda-compatibility.7.xml
+         man/xml-source/amanda-devices.7.xml
+         man/xml-source/amanda-taperscan.7.xml man/xml-source/amanda.conf.5.xml
+         man/xml-source/amcheck.8.xml man/xml-source/amrecover.8.xml: remove
+         references to krb4 and to the pre-spanning days, and canonicalize
+         all configuration parameters to use -, not _
+       * common-src/conffile.c device-src/activate-devpay.c
+         device-src/amtapetype.pl perl/Amanda/Application/Zfs.pm
+         perl/Amanda/Taper/Scribe.pm server-src/amadmin.c server-src/amcheck.c
+         server-src/amreport.pl server-src/driver.c server-src/planner.c:
+         canonicalize configuration parameter names in error messages to use -,
+         not _
+
+2010-08-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Installcheck/Catalogs.pm: tool to install catalogs
+         dynamically, rather than including them in __DATA__
+       * installcheck/catalogs/*: new catalog files
+       * installcheck/Amanda_DB_Catalog.pl
+         installcheck/Amanda_Recovery_Planner.pl installcheck/amreport.pl
+         installcheck/amstatus.pl: use Installcheck::Catalog
+       * perl/Amanda/Recovery/Planner.pm: check that parameters exist
+
+2010-08-25 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/deb/control: Fix missing line break so dpkg can parse the
+          control file
+
+2010-08-23  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amvault.pl: add --fulls-only option
+       * man/xml-source/amvault.8.xml: document
+
+2010-08-23 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/deb/control: add ca-certificates and procps
+
+2010-08-21  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/fileheader.c: remove incorrect validations for
+         CONT_FILENAME and APPLICATION
+
+2010-08-20 Dan Locks <dwlocks@zmanda.com>
+       *  The error fixed here was reported by ssgelm.
+       *  packaging/common/substitute.pl: Use FULL_VERSION instead of
+          VERSION.
+       *  packaging/rpm/amanda.spec.src: renamed from amanda.spec, added
+          %%VERSION%% macro for substitute.pl, fixed glib2 requires typo
+       *  packaging/rpm/buildpkg: refactored into "do_thing" functions, added
+          substitute.pl machinery.
+
+2010-08-20 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/rpm/amanda.spec: add openSuSE 11 detection and
+          buildrequires glib2-devel, as written by ssgelm
+
+2010-08-13  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/debugging.m4: make the default for syntax-checks
+         "disabled", add a warning when enabling
+       * perl/Makefile.am config/automake/scripts.am: don't do any checks
+         that require linking perl extension modules unless SYNTAX_CHECKS is
+         set
+       * installcheck/Makefile.am: always skip syntax checks
+       * application-src/amlog-script.pl application-src/amraw.pl
+         application-src/amsamba.pl application-src/amsuntar.pl
+         application-src/amzfs-sendrecv.pl application-src/amzfs-snapshot.pl
+         application-src/script-email.pl common-src/amgetconf.pl
+         device-src/amdevcheck.pl device-src/amtapetype.pl
+         installcheck/Amanda_Changer.pl installcheck/Amanda_Changer_ndmp.pl
+         installcheck/Amanda_Changer_null.pl
+         installcheck/Amanda_Changer_rait.pl
+         installcheck/Amanda_Changer_robot.pl
+         installcheck/Amanda_Changer_single.pl installcheck/Amanda_Cmdline.pl
+         installcheck/Amanda_Config.pl installcheck/Amanda_Curinfo.pl
+         installcheck/Amanda_Debug.pl installcheck/Amanda_Device.pl
+         installcheck/Amanda_Disklist.pl installcheck/Amanda_Feature.pl
+         installcheck/Amanda_Header.pl installcheck/Amanda_Logfile.pl
+         installcheck/Amanda_NDMP.pl installcheck/Amanda_Process.pl
+         installcheck/Amanda_Recovery_Scan.pl installcheck/Amanda_Tapelist.pl
+         installcheck/Amanda_Taper_Scribe.pl installcheck/Amanda_Xfer.pl
+         installcheck/amadmin.pl installcheck/amarchiver.pl
+         installcheck/amcheck-device.pl installcheck/amcheck.pl
+         installcheck/amcheckdump.pl installcheck/amdevcheck.pl
+         installcheck/amdump.pl installcheck/amgetconf.pl
+         installcheck/amlabel.pl installcheck/amoverview.pl
+         installcheck/amrmtape.pl installcheck/amservice.pl
+         installcheck/amstatus.pl installcheck/amtape.pl
+         installcheck/amtapetype.pl installcheck/amvault.pl
+         installcheck/bigint.pl installcheck/mock_mtx.pl installcheck/taper.pl
+         server-src/amcheckdump.pl server-src/amcleanup.pl
+         server-src/amlabel.pl server-src/amtape.pl server-src/amvault.pl: add
+         strict and/or warnings, and fix (trivial) resulting warnings
+
+2010-08-13  Nikhil Bhupale <nikhilb@zmanda.com>
+       * AUTHORS: add Nikhil
+       * device-src/ndmp-device.c: add READ_BLOCK_SIZE support
+       * installcheck/Amanda_Device.pl: test it
+       * man/xml-source/amanda-devices.7.xml: document it
+
+2010-08-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Util.pod perl/Amanda/Util.swg: add split_quoted_strings_friendly
+       * installcheck/Amanda_Util.pl: test it
+       * application-src/amsamba.pl: use it to parse amandapass
+
+2010-08-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/find.c: parse old SUCCESS lines properly
+       * perl/Amanda/DB/Catalog.pm: same
+       * installcheck/Amanda_DB_Catalog.pl: test old SUCCESS lines
+
+2010-08-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * amandad-src/amandad.c: unset SUN_PERSONALITY on startup
+       * client-src/rundump.c client-src/runtar.c: remove unsetenvs for SUN_PERSONALITY
+
+2010-08-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amlogroll.pl: ignore arguments after the first
+
+2010-08-06  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/amvault.pl: correct test count
+       * perl/Amanda/Taper/Scribe.pm: fix nparts calculation
+
+2010-08-06  Stephen Gelman <ssgelm@gmail.com>
+       * AUTHORS: add Stephen
+       * client-src/rundump.c client-src/runtar.c: unset
+         SUN_PERSONALITY in runtar and rundump, to shut off
+         Nexenta's tendency to magically run Sun binaries
+
+2010-08-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amvault.pl: rewrite to use scribe, clerk
+       * installcheck/amvault.pl: check results better
+       * server-src/logfile.c server-src/logfile.h: add log_add_full
+       * perl/Amanda/Logfile.pod perl/Amanda/Logfile.swg: add log_add_full
+         and make_stats methods
+       * perl/Amanda/MainLoop.pod: POD typos
+       * perl/Amanda/Recovery/Planner.pm: add shift_dump method
+       * perl/Amanda/Taper/Scan.pm: add POD, fix typos
+       * perl/Amanda/Taper/Scribe.pm: fix POD, add nparts argument to dump_cb
+       * server-src/taper.pl: use nparts, move make_stats to Amanda::Logfile
+
+2010-08-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda-changers.7.xml: add chg-ndmp VERBOSE
+         property
+
+2010-08-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Recovery/Clerk.pm: rename notif_* to clerk_notif_*
+       * perl/Amanda/Taper/Scribe.pm: rename notif_* to scribe_notif_*
+       * installcheck/Amanda_Recovery_Clerk.pl
+         installcheck/Amanda_Taper_Scribe.pl server-src/amcheckdump.pl
+         server-src/amfetchdump.pl server-src/amidxtaped.pl
+         server-src/taper.pl: use renamed methods
+
+2010-08-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Logfile.pod perl/Amanda/Logfile.swg: add log_rename
+         and a method to find the proper timestamp for the current log
+       * installcheck/Amanda_Logfile.pl: test it
+       * server-src/Makefile.am server-src/amlogroll.c
+         server-src/amlogroll.pl: rewrite in perl
+
+2010-08-03  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/ipv6.m4: fix config messages to not use the
+         autoconf-specific word "target"
+
+2010-08-03  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml: add more info about appropriate
+         settings for autolabel
+
+2010-08-03  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/security.h: move comments from wiki, reorder functions
+
+2010-08-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amdump.sh: Check it own the log file.
+
+2010-08-02  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c (interruptible_accept): Set the read set and
+         timeout before each select call.
+
+2010-07-29  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amvault.pl: only run as dumpuser
+
+2010-07-29  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda-auth.7.xml: consistently use the same
+         username in examples (thanks to Amar Takhar)
+
+2010-07-29  Dustin J. Mitchell <dustin@zmanda.com>
+       * xfer-src/filter-process.c: handle fd's <= 2 correctly
+
+2010-07-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c (krb5_tcpm_recv_token): New function, a
+         copy of tcpm_recv_token.
+       * common-src/security-util.c: New tcpm_recv_token without a timeout.
+       * common-src/security-util.h: Add field to keep a buffer in tcp_conn.
+
+2010-07-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Script_App.pm: Print restore message to STDERR.
+
+2010-07-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/progs.m4: require SWIG-1.3.39
+       * (all .c files): #include amanda.h first
+       * perl/amglue/amglue.swg: use %begin to include config.h first
+
+2010-07-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/amtapetype.pl: detect LEOM and add appropriate
+         comments
+       * device-src/xfer-dest-device.c device-src/xfer-device.h: add
+         cancel_at_leom constructor arg
+       * installcheck/Amanda_Device.pl installcheck/Amanda_Recovery_Clerk.pl
+         installcheck/Amanda_Xfer.pl installcheck/amrestore.pl
+         perl/Amanda/Xfer.pod perl/Amanda/XferServer.swg
+         server-src/amvault.pl: pass new argument
+
+2010-07-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/tape-device.c device-src/tape-device.h: autodetect
+         the LEOM property, and handle various operating systems' LEOM
+         indications
+       * device-src/tape-aix.c device-src/tape-posix.c
+         device-src/tape-uware.c device-src/tape-xenix.c: set LEOM property to
+         FALSE by default
+
+2010-07-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c (find_result_t): Add a write_timestamp.
+       * server-src/find.h: Set the write_timestamp.
+       * server-src/amcheckdump.pl: Use the write_timestamp.
+       * server-src/amidxtaped.pl: write_timestamp is undef.
+       * server-src/cmdline.h (dumpspec_t): Add a write_timestamp.
+       * server-src/cmdline.c (dumpspec_new): New write_timestamp argument.
+       * perl/Amanda/Logfile.swg (find_result_t): Add a write_timestamp.
+       * perl/Amanda/Cmdline.swg (dumpspec_t): Add a write_timestamp.
+       * perl/Amanda/Cmdline.pod: Document write_timestamp.
+       * perl/Amanda/DB/Catalog.pm (get_parts_and_dumps): Filter with dumpspec
+         write_timestamp.
+       * installcheck/Amanda_Cmdline.pl: Fix and check new api.
+       * installcheck/Amanda_DB_Catalog.pl: Fix and check new api.
+       * installcheck/Amanda_Logfile.pl: Fix and check new api.
+       * installcheck/Amanda_Recovery_Planner.pl: Fix and check new api.
+
+2010-07-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in perl/amglue/Makefile.am: new Makefile for
+         libamglue
+       * perl/Makefile.am: use SUBDIRS to build libamglue before
+         any SWIG modules, as automake does not get inter-library
+         dependencies right at install time if the libraries are
+         all built in the same directory
+
+2010-07-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * application-src/ampgsql.pl: also check PG-DATADIR
+
+2010-07-26  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_DB_Catalog.pl
+         installcheck/Amanda_Recovery_Planner.pl installcheck/amidxtaped.pl
+         installcheck/taper.pl server-src/amrestore.pl: skip perl's stdio
+         buffering when writing holding-file headers
+
+2010-07-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/planner.c: Ignore the FORCE command if strategy is
+         INCRONLY.
+
+2010-07-26  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Xfer.pl: *real* correct number of tests for
+         --without-server
+
+2010-07-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Xfer.pl: correct number of tests for
+         --without-server
+
+2010-07-25  Orion Poplawski <orion@cora.nwra.com>
+       * server-src/amoverview.pl: fix host iteration and handle case of only
+         one write_timestamp
+
+2010-07-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/vfs-device.c: announce LEOM one byte later
+       * installcheck/Amanda_Xfer.pl: set device properties before starting
+
+2010-07-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Changer/robot.pm: use correct device field volume_header
+
+2010-07-23  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Changer/ndmp.pm: increase the REQUEST ELEMENT STATUS
+         timeout to 60s and set CURDATA=1 to use cached state
+
+2010-07-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Changer/disk.pm: unlink drive if pid not in state file.
+       * perl/Amanda/Taper/Scribe.pm: Release scribe reservation and
+                                      devhandling reservation.
+       * server-src/taper.pl: Write quit error meesage to debug file.
+
+2010-07-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/vfs-device.c device-src/vfs-device.h: add support for
+         monitoring free space to generate LEOM before ENOSPC hits; set LEOM
+         property to TRUE by default
+       * installcheck/Amanda_Device.pl: test monitor_free_space prop
+       * man/xml-source/amanda-devices.7.xml: document VFS device LEOM
+         support and the MONITOR_FREE_SPACE property
+
+2010-07-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/vfs-test.c device-src/Makefile.am: remove vfs-test
+       * device-src/property.c device-src/property.h: remove FREE_SPACE
+         property, QualifiedSize, and SizeAccuracy
+       * device-src/vfs-device.c device-src/rait-device.c: remove FREE_SPACE
+         support
+       * man/xml-source/amanda-devices.7.xml: remove docs
+       * perl/Amanda/Device.swg: remove SWIG interface for QualifiedSize
+
+2010-07-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/Makefile.am: add reference to new header file
+
+2010-07-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/xfer-dest-taper-cacher.c: remove support for
+         cache_inform, simplify disk cache
+       * device-src/xfer-dest-taper-splitter.c: add support for cache_inform,
+         use it even when LEOM is available
+       * device-src/xfer-dest-taper.c device-src/xfer-dest-taper.h
+         device-src/xfer-device.h: move common methods to new header file; add
+         instance_init
+       * installcheck/Amanda_Xfer.pl perl/Amanda/Taper/Scribe.pm: always use
+         splitter for cache_inform
+       * perl/Amanda/Xfer.pod perl/Amanda/XferServer.swg: change function
+         signatures
+       * perl/amglue/glib.swg: take any perl true or flase value to make
+         a gboolean
+
+2010-07-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/diskfile.h (disk_t) Add allow_split and splitsize.
+       * server-src/diskfile.c: Set allow_split and splitsize.
+       * server-src/driver.c: Use allow_split and splitsize.
+       * server-src/planner.c: Use allow_split and splitsize.
+       * server-src/amadmin.c (disklist_one): Print allow_split.
+
+2010-07-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taper.pl: Use ' to quote label in 'wrote label' line.
+       * server-src/amstatus.pl: Parse it.
+       * installcheck/amstatus.pl: Check it.
+
+2010-07-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * ndmp-src/Makefile.am: use += with BUILT_SOURCES
+
+2010-07-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amrecover.8.xml recover-src/amrecover.c: add a -h
+         parameter that sets the initial host
+       * installcheck/amrecover.pl: use it, so tests run even at 30,000 feet
+         with no net connection
+
+2010-07-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/syshacks.m4: Mac OS X 10.6 (Snow Leopard) supported
+       * config/amanda/tape.m4: fix bugs causing tape support to always be
+         built (symbols aren't defined in Snow Leopard)
+       * device-src/device.c: fix bug
+       * perl/Amanda/Device.swg: return undef for undefined properties,
+         rather than crashing
+       * installcheck/Amanda_Changer_single.pl installcheck/amdevcheck.pl: do
+         not assume tape device is defined
+
+2010-07-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/macro-archive/ac_prog_swig.m4: fix swig version detection
+         - swig-2.0.0 works fine
+
+2010-07-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Tapelist.swg: better fix for temp filename
+
+2010-07-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Report/human.pm: Correcly compute 'Filesystem taped' for
+                                      incremental.
+       * installcheck/amreport.pl: Test it.
+
+2010-07-15  Satya Ganga  <gast@zmanda.com>
+       * config/amanda/progs.m4: Use correct search path for mt binary.
+
+2010-07-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Tapelist.swg: append a slash to dirname() and make error
+         messages better
+
+2010-07-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in config/amanda/shmem.m4: remove unnecessary config
+         checks
+
+2010-07-13  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Report.pm: parse the planner's skipping a dump
+       * perl/Amanda/Report/human.pm: present it correctly
+       * installcheck/amreport.pl: adjust tests accordingly
+
+2010-07-12  Nandan Athawale <nandan.athawale@gmail.com>
+       * perl/Amanda/Taper/Scribe.pm: enable debugging whenever debug_taper
+         is set
+
+2010-07-12  Orion Poplawski <orion@cora.nwra.com>
+       * server-src/amoverview.pl: fix variable references in evals
+
+2010-07-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am installcheck/amoverview.pl: basic installcheck
+         for amoverview
+
+2010-07-12  Orion Poplawski <orion@cora.nwra.com>
+       * server-src/amoverview.pl: update to use Amanda::DB::Catalog
+       * perl/Amanda/DB/Catalog.pm: add dump_timestamp to the unique dump keys
+       * installcheck/Amanda_DB_Catalog.pl: update tests to check uniqueness
+       * AUTHORS: add Orion
+
+2010-07-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/conffile.c: fix error message
+
+2010-07-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * example/amanda.conf.in example/template.d/advanced.conf.in
+         example/template.d/amanda-S3.conf.in: replace label_new_tapes with
+         autolabel
+
+2010-07-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Xfer.pl: fix test counts under -without-server
+
+2010-07-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/userid.m4: apply the default value for --with-group
+         to the correct variable
+
+2010-07-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amcheck.c: small bugfixes
+       * perl/Amanda/Taper/Scribe.pm: change get_xfer_dest args to support
+         LEOM configurations
+       * server-src/taper.pl: use new args; log warnings with L_WARNING, not
+         L_FAIL
+       * installcheck/Amanda_Taper_Scribe.pl installcheck/taper.pl: test
+         changes
+
+2010-07-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/xfer-dest-taper-splitter.c: new, non-caching taper dest
+       * device-src/xfer-dest-taper-cacher.c: new name for old .._splitter
+       * perl/Amanda/Xfer.pod perl/Amanda/XferServer.swg: SWIG new class
+         and renamed class
+       * device-src/xfer-dest-taper-directtcp.c 
+         device-src/xfer-dest-taper.c: move null cach_inform to parent class
+       * device-src/xfer-device.h: prototypes
+       * device-src/Makefile.am: new file
+       * installcheck/Amanda_Device.pl: LEOM tests
+       * installcheck/Amanda_Xfer.pl: tests for new taper dest
+       * perl/Amanda/Taper/Scribe.pm: use new name (..::Cacher)
+
+2010-07-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/property.c device-src/property.h device-src/device.c: add
+         LEOM property
+       * perl/Amanda/Device.pod man/xml-source/amanda-devices.7.xml
+         man/xml-source/amanda.conf.5.xml: document it
+       * installcheck/Amanda_Device.pl: test it
+       * device-src/dvdrw-device.c device-src/ndmp-device.c
+         device-src/null-device.c device-src/rait-device.c
+         device-src/s3-device.c device-src/tape-device.c: set LEOM property
+         appropriately
+       * device-src/vfs-device.c device-src/vfs-device.h: set LEOM support
+         property, and allow it to be changed for testing
+       * server-src/taper.pl: small bugfix
+
+2010-07-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Taper/Scribe.pm: add docs, comments for cancel_dump
+
+2010-07-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/amglue/constants.swg: new SWIG precompiler magic to allow
+         flexible handling of lists of constants
+       * perl/Amanda/Config.pod: add section header
+       * perl/Amanda/Config.swg: include all config param constants in the
+         POD
+
+2010-07-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Device.pl: erase each S3 volume after the tests
+         are finished with it
+
+2010-07-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Taper_Scribe.pl: stringify changer errors
+
+2010-07-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Taper/Scribe.pm: more consistent handling of denial
+         of use of a second tape due to user configuration; dump_cb adds
+         the config_denial_message parameter
+       * server-src/taper.pl: use new parameter
+       * installcheck/Amanda_Taper_Scribe.pl: updated tests
+
+2010-07-06  Orion Poplawski <orion@cora.nwra.com>
+       * server-src/amoverview.pl: fix parsing for newer amadmin find output
+
+2010-07-06  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/s3.c: fix typo (that I added, not Nandan)
+
+2010-07-06  Nandan Athawale <nandan.athawale@gmail.com>
+       * device-src/s3.c: use Amazon's HTTP response headers to calculate a
+         time offset for the local clock, to automatically work around time
+         skew
+
+2010-06-29  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am installcheck/chunker.pl: new check
+       * perl/Amanda/Header.swg: bug fix
+       * server-src/chunker.c: bug fixes, add support for a fake ENOSPC for
+         testing
+
+2010-06-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/driverio.c: fix format specifies
+
+2010-06-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Config.swg common-src/conffile.c common-src/conffile.h:
+         add new tapetype params: PART_SIZE, PART_CACHE_TYPE, PART_CACHE_DIR,
+         and PART_CACHE_MAX_SIZE and dumptype param ALLOW_SPLIT; only print
+         deprecation warnings once per process; deprecate TAPE_SPLITSIZE,
+         FALLBACK_SPLITSIZE, and SPLIT_DISKBUFFER
+       * example/amanda.conf.in example/template.d/amanda-S3.conf.in
+         example/template.d/amanda-harddisk.conf.in
+         example/template.d/dumptypes: remove old params
+       * installcheck/Amanda_Config.pl
+         installcheck/Amanda_Taper_Scribe.pl
+         installcheck/Installcheck/Dumpcache.pm
+         installcheck/taper.pl: update tests
+       * man/xml-source/amanda-compatibility.7.xml: document deprecations
+         and what to do about them
+       * man/xml-source/amanda.conf.5.xml: document deprecations and new
+         params
+       * perl/Amanda/Device.pod: add doc about size=0 for
+         write_from_connection, fix typo
+       * perl/Amanda/Taper/Scribe.pm: add get_splitting_args_from_config
+       * server-src/diskfile.c server-src/diskfile.h: add dumptype->config
+       * server-src/amcheck.c: checks for the new params
+       * server-src/driverio.c server-src/taper.pl: add all config params to
+         the driver/taper protocol
+
+2010-06-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/xfer-dest-taper-directtcp.c: round part size to a
+         multiple of the block size
+       * installcheck/Amanda_Xfer.pl: test it
+
+2010-06-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * application-src/ampgsql.pl: use conditionals to skip useless
+         selfcheck checks
+
+2010-06-23  Dustin J. Mitchell <dustin@zmanda.com>
+       * application-src/ampgsql.pl: conditionalize some checks on property
+         being set
+
+2010-06-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amfetchdump.pl: fix parsing levels and -p
+
+2010-06-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amaespipe.sh: change head to dd; thanks to Angelo Höngens
+        and Marco Poli
+
+2010-06-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/tape-device.c: Handle write returning 0 for LEOM.
+
+2010-06-21  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Makefile.am: list libamglue in _SOURCES variables, too,
+         so that dependencies are correct and parallel makes do not
+         fail
+
+2010-06-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/IPC/LineProtocol.pm: Fix for multiline.
+
+2010-06-17  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/Makefile.am changer-src/Makefile.am: remove READLINE_LIBS
+
+2010-06-17  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml: update tapedev and tpchanger docs
+         to match new changer API
+
+2010-06-17  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/bsd-security.c common-src/bsdtcp-security.c
+         common-src/bsdudp-security.c common-src/local-security.c
+         common-src/security-util.c common-src/ssh-security.c: zero out new
+         structures, and protect logtime messages from NULL dereferences
+
+2010-06-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am: use chmod a-x instead of chmod -x
+
+2010-06-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am: remove comment from Makefile rule
+
+2010-06-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taper.pl: Don't call check_data_path for a FILE-WRITE.
+
+2010-06-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am: add chmod -x for more recent Test::Harness
+         implementations that are confused by executable tests
+
+2010-06-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Report.pm, perl/Amanda/Report/human.pm: 'FAIL planner'
+         line should result in FAILED dump (not MISSING dump).
+       * installcheck/amreport.pl: Test it.
+
+2010-06-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/automake/installperms.am: add new special cases
+
+       * application-src/Makefile.am client-src/Makefile.am
+         oldrecover-src/Makefile.am recover-src/Makefile.am
+         server-src/Makefile.am: only use installperms for setuid executables
+
+2010-06-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Report.pm: POD overhaul
+
+2010-06-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/amglue/directtcp.swg: fix unterminated array
+
+2010-06-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/net.m4: remove use of AS_HELP_STRING
+
+2010-06-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/fileheader-test.c: don't expect partnum=0 on dumpfiles
+       * common-src/fileheader.c: don't put partnum=1 on tape headers, etc.
+
+2010-06-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/fileheader.c: fix inaccurate partnum in such headers
+       * installcheck/Amanda_Recovery_Clerk.pl: add test for recovering with
+         DUMPFILE headers
+
+2010-06-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * ndmp-src/ndma_comm_dispatch.c ndmp-src/ndma_cops_query.c: fix
+         NDMOS_OPTION_NO_NDMPvX precompiler conditionals
+
+2010-06-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Device.pl: test the connect method
+
+2010-06-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * ndmp-src/ndma_comm_dispatch.c: uncomment and update code
+         to support NDMP_MOVER_CONNECT via ndmta.
+
+2010-06-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Device.pod perl/Amanda/Device.swg device-src/device.c
+         device-src/device.h: add a device_connect method
+       * device-src/ndmp-device.c: implement it
+       * ndmp-src/ndmpconnobj.c ndmp-src/ndmpconnobj.h: add
+         ndmp_connection_mover_connect
+       * perl/Amanda/Xfer.pod: update documentation using the word
+         "initiator"
+
+2010-06-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/s3-device.c: add S3_STORAGE_CLASS property
+       * device-src/s3.c device-src/s3.h: add storage_class
+       * installcheck/Amanda_Device.pl: set the property
+       * man/xml-source/amanda-devices.7.xml: document it
+
+2010-06-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Recovery/Planner.pm: fix matching on filelists - fixes
+         problems with amidxtaped: "Specified file list matches multiple
+         dumps"
+
+2010-06-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Report.pm: Set dump_failed and dump_strange flags.
+       * server-src/amreport.pl: Add STRANGE or MISSING to email subject.
+       * installcheck/Amanda_Report.pl: Test new flags.
+
+2010-06-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Report.pm: Rename 'tries' to 'dumps', it is a hash of
+         timestamps, each value is an array of try.
+       * perl/Amanda/Report/human.pm: Use 'dumps'.
+       * perl/Amanda/Report/postscript.pm: Use 'dumps'.
+       * perl/Amanda/Report/xml.pm: Use 'dumps'.
+       * contrib/amreport.rnc: Add 'dumps'
+       * server-src/amreport.pl: Use 'dumps'
+       * installcheck/amreport.pl: Check 'dumps'
+       * installcheck/Amanda_Report.pl: Check 'dumps'
+
+2010-06-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Scribe.pm (check_data_path): New method to check
+         the data_path.
+       * server-src/driver.c: Check FAILED result after PORT command.
+       * server-src/driverio.c: Send data_path in taper PORT-WRITE command.
+       * server-src/taper.pl: Parse data_path in PORT-WRITE command, call the
+         scribe check_data_path method.
+       * installcheck/taper.pl: Test it.
+
+2010-06-09 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/rpm/amanda.spec: remove Provides from main section,
+          remove amanda-client from server provides section.
+
+2010-06-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * installcheck/Amanda_DB_Catalog.pl, installcheck/Amanda_Logfile.pl,
+         installcheck/Amanda_Recovery_Planner.pl,
+         installcheck/Amanda_Taper_Scribe.pl, installcheck/amreport.pl,
+         installcheck/taper.pl, perl/Amanda/Report.pm,
+         perl/Amanda/Report/human.pm, perl/Amanda/Taper/Scribe.pm,
+         server-src/find.c, server-src/taper.pl: taper log a "config|error"
+         keyword in the "ERROR no-tape" line.
+
+2010-06-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Allow negative etimeout.
+
+2010-06-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * ndmp-src/ndmp4_enum_strs.c: add missing enum
+
+2010-06-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * ndmp-src/ndml_agent.c: add INADDR_NONE
+       * ndmp-src/ndmos_glib.h: remove solaris-specific conditional
+
+2010-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Device.swg: fix uninitialized variable
+
+2010-06-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/amfeatures.h: New fe_amindexd_quote_label.
+       * common-src/amfeatures.c: fe_amindexd_quote_label.
+       * perl/Amanda/Feature.pod: fe_amindexd_quote_label.
+       * server-src/amindexd.c: Quote label if fe_amindexd_quote_label.
+       * recover-src/amrecover.c: Add debugging statement.
+       * recover-src/display_commands.c: Parse quoted label.
+       * recover-src/extract_list.c: Parse quoted label.
+
+2010-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * xfer-src/xfer-element.h common-src/Makefile.am
+         common-src/queueing-test.c common-src/queueing.c
+         common-src/queueing.h: remove queueing support
+       * installcheck/Amanda_Device.pl device-src/Makefile.am
+         device-src/device-queueing.c device-src/device-queueing.h
+         device-src/device.c device-src/device.h device-src/property.h: remove
+         queue_fd, device_write_from_fd and device_read_to_fd
+       * perl/Amanda/Device.pod perl/Amanda/Device.swg: remove queue_fd,
+         write_from_fd, and read_to_fd; add test utilities to move random data
+         onto and off of devices
+
+2010-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Xfer.pl perl/Amanda/Xfer.pod
+         perl/Amanda/Xfer.swg perl/Amanda/Recovery/Planner.pm
+         server-src/amfetchdump.pl server-src/amidxtaped.pl
+         server-src/amrestore.pl xfer-src/filter-process.c
+         xfer-src/xfer-element.h: add a log_stderr argument to
+         Amanda::Xfer::Filter::Process
+       * server-src/amcheckdump.pl: use the transfer architecture
+
+2010-06-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Recovery/Scan.pm: Subsitute "all slots have been loaded"
+         by "label '$label' not found" for old changer scripts.
+
+2010-06-03  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/find.c: zero-pad timestamps out to 14 digits for
+         comparison
+       * perl/Amanda/Recovery/Clerk.pm: same
+
+2010-06-03 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/deb/buildpkg: remove TMPDIR, use SRCDIR instead.
+
+2010-06-03  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/gnutar.pl: always set LC_CTYPES=C for -t output; detect
+         redhat systems that change the wildcard default for include; and
+         consider 1.15.91 >= 1.16
+
+2010-06-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/planner.c: Fix printf format.
+
+2010-06-03  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/ampgsql.8.xml: suggestively document the ampgsql
+         restore process
+
+2010-06-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Tapelist.swg (write): Safely write the tapelist file.
+       * server-src/amrmtape.pl: Rely on A::Tapelist::write to do it safely.
+       * installcheck/amrmtape.pl: Fix.
+
+2010-06-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcleanupdisk.c: Use CLR and SET.
+       * server-src/planner.c: Use CLR, SET and ISSET.
+         Don't update csize if level < 0.
+
+2010-06-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Tapelist.swg: Return empty array if tapelist doesn't
+         exists.
+
+2010-06-02  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c: Print a debug message every 10 minutes if
+         something is transmitted.
+       * common-src/security-util.h (tcp_conn): Add logstamp.
+
+2010-06-02  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/dumper.c: Drop root privilege before executing compression
+         or encryption program.
+
+2010-06-02  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/gnutar.pl: fix version regex, and use utf-8 friendly
+         high-ascii characters in -t test
+
+2010-05-31  Jean-Louis Martineau <martineau@zmanda.com>
+       * installcheck/gnutar.pl: gnutar exclude in 1.22.90 is like 1.23.
+
+2010-05-31  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c(print_find_result): Quote label.
+
+2010-05-31  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/set_full_version: Add comments.
+
+2010-05-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/gnutar.pl: tests for gnutar globbing behavior
+       * installcheck/Makefile.am: run them
 
 2010-05-28 Dan Locks <dwlocks@zmanda.com>
        *  packaging/Makefile.am: include common in EXTRA_DIST
          this condition and switching to a new volume appropriately
 
 2010-05-26  Dustin J. Mitchell <dustin@zmanda.com>
-       * installcheck/Amanda_Device.pl: cast port to integer
-
-2010-05-26  Dustin J. Mitchell <dustin@zmanda.com>
-       * installcheck/Amanda_Device.pl: exit harder, to avoid cleanup
+       * config/amanda/libs.m4: Allow user to specify glib config explicitly
 
 2010-05-25  Dustin J. Mitchell <dustin@zmanda.com>
        * perl/Makefile.am: add libamxfer as a dependency of libamglue
 
 2010-05-25  Dustin J. Mitchell <dustin@zmanda.com>
        * device-src/amtapetype.pl: close and re-open devices between tests
+       * device-src/xfer-dest-device.c: fix memory leak
        * man/xml-source/amtapetype.8.xml: fix -f docs
 
 2010-05-21  Jean-Louis Martineau <martineau@zmanda.com>
 2010-05-21  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/driver.c: Always report "taperflush criteria not met".
 
-2010-05-21  Dustin J. Mitchell <dustin@zmanda.com>
+2010-05-20  Dustin J. Mitchell <dustin@zmanda.com>
        * installcheck/Amanda_Changer.pl: test more configs
        * man/xml-source/amanda.conf.5.xml: point users to
          amanda-changers(7)
        * perl/Amanda/Changer.pm: support either tpchanger or
          tapedev in changer defs
 
+2010-05-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/progs.m4: always use rpcgen
+       * ndmp-src/Makefile.am: always build rpc outputs
+       * ndmp-src/ndmp0.h ndmp-src/ndmp0_xdr.c ndmp-src/ndmp2.h
+         ndmp-src/ndmp2_xdr.c ndmp-src/ndmp3.h ndmp-src/ndmp3_xdr.c
+         ndmp-src/ndmp4.h ndmp-src/ndmp4_xdr.c ndmp-src/ndmp9.h
+         ndmp-src/ndmp9_xdr.c: remove from version control (and dist)
+
+2010-05-19  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/fileheader.c: don't print to stderr anymore
+
+2010-05-19  Dustin J. Mitchell <dustin@zmanda.com>
+       * ndmp-src/Makefile.am: use BUILT_SOURCES to build rpcgen products
+         first, since they are not solaris-compatible
+
 2010-05-19  Jean-Louis Martineau <martineau@zmanda.com>
        * application-src/amsamba.pl: filter "Server not using user level ..."
 
        * device-src/amtapetype.pl: don't fail when fsf_after_filemark is
          required
 
+2010-05-18  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Changer/rait.pm: add debug message when child slot
+         counts differ
+
+2010-05-18  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/net.m4: correct help messages
+
+2010-05-18  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml: fix typo
+
 2010-05-17  Dustin J. Mitchell <dustin@zmanda.com>
        * server-src/amfetchdump.pl: use syswrite so the filehandle gets
          properly flushed
 
-2010-05-17  Dustin J. Mitchell <dustin@zmanda.com>
-       * installcheck/Amanda_Device.pl: use IO::Socket::INET instead of
-         shelling out to 'nc'
-
 2010-05-17  Dustin J. Mitchell <dustin@zmanda.com>
        * perl/Amanda/Changer/ndmp.pm: add verbose property
        * installcheck/Amanda_Changer_ndmp.pl: use it
 
-2010-05-14  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/dumper.c: Handle indirecttcp.
-
-2010-05-14  Jean-Louis Martineau <martineau@zmanda.com>
-       * client-src/sendbackup.c: Handle indirecttcp.
-
-2010-05-14  Dustin J. Mitchell <dustin@zmanda.com>
-       * device-src/ndmp-device.c: add indirecttcp support
-       * installcheck/Amanda_Device.pl: test it lightly
-
 2010-05-14  Dustin J. Mitchell <dustin@zmanda.com>
        * ndmp-src/ndmpconnobj.c ndmp-src/ndmpconnobj.h: add window_length and
          window_offset to mover_get_state
        * common-src/bsd-security.c: Use global buffer for bsd_stream_read_sync
 
 2010-05-07  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/security-util.c; Use global buffer for
+       * common-src/security-util.c: Use global buffer for 
          security_stream_read_sync.
        * recover-src/amrecover.c, recover-src/extract_list.c: Free buffer
          returnned by security_stream_read_sync.
        * server-src/amindexd.c: Don't clean_backslash, indexd should be sent
          asis to amrecover.
 
-2010-05-06  Jean-Louis Martineau <martineau@zmanda.com>
-       * installcheck/taper.pl: Fix installcheck for previous patch.
-
-2010-05-06  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/taper.pl: prepend "CONFIG:" to the error message if it
-         is an error because of a configuration setting.
-       * perl/Amanda/Report/human.pm: Don't report such error.
-
 2010-05-05  Dustin J. Mitchell <dustin@zmanda.com>
        * perl/Amanda/Changer/rait.pm: eliminate warning when device does not
          have a valid status
        * perl/Amanda/Report/human.pm: don't assume parts are defined
 
 2010-05-04  Dustin J. Mitchell <dustin@zmanda.com>
-       * server-src/amvault.pl: add an --autolabel option to allow control
-         over which tapes are overwritten
-       * man/xml-source/amvault.8.xml: document it
+       * man/xml-source/amanda-devices.7.xml: add more regions
+       * man/xml-source/amcheckdump.8.xml: remove duplicate section
 
 2010-05-04  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/security-util.c: Free packet on close.
        * common-src/glib-util.c: reorgnize glib_init to be compatible with
          glib-2.24+
 
+2010-05-03  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amlabel.pl: change the text to be less ambiguous
+
 2010-05-03  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/disk_history.c: Keep all parts.
 
        * installcheck/Amanda_Recovery_Clerk.pl: test a multi-volume
          recovery
        * device-src/ndmp-device.c: add extra assertion
+       * device-src/xfer-dest-device.c: remove debug print
        * device-src/xfer-device.h device-src/xfer-source-recovery.c
          installcheck/Amanda_Xfer.pl perl/Amanda/XferServer.swg
          perl/Amanda/Xfer.pod: add use_device method, fix bugs in cancellation
          to pass after previous change
 
 2010-04-29  Jean-Louis Martineau <martineau@zmanda.com>
-       * perl/Amanda/Changer/robot.pm: Default state file is in 
+       * perl/Amanda/Changer/robot.pm: Default state file is in
                                        $localstatedir/amanda
        * man/xml-source/amanda-changers.7.xml: Document new location.
 
        * device-src/directtcp-connection.c: Typo.
 
 2010-04-27  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/amreport.pl: Print "FAIL" in email subject header if run 
+       * server-src/amreport.pl: Print "FAIL" in email subject header if run
                                  failed.
        * installcheck/amreport.pl: Test it.
 
 2010-04-27  Jean-Louis Martineau <martineau@zmanda.com>
        * perl/Amanda/Logfile.swg (find_all_logs): Sort the list.
 
-2010-04-27  Dustin J. Mitchell <dustin@zmanda.com>
-       * VERSION: 3.1.0beta2
-
 2010-04-27  Dustin J. Mitchell <dustin@zmanda.com>
        * server-src/planner.c: change degraded-mode messages to make more
          sense to the user
 
 2010-04-26  Jean-Louis Martineau <martineau@zmanda.com>
-       * perl/Amanda/Recovery/Scan.pm: Call _find_volume_no_inventory if new 
+       * perl/Amanda/Recovery/Scan.pm: Call _find_volume_no_inventory if new
          changer have no inventory.
 
+2010-04-26  Paul C. Mantz <pcmantz@zmanda.com>
+       * server-src/amreport.pl: print org & config in xml output
+
 2010-04-26  Jean-Louis Martineau <martineau@zmanda.com>
-       * perl/Amanda/Recovery/Scan.pm: Use default change if message is 
+       * perl/Amanda/Recovery/Scan.pm: Use default change if message is
                                        $DEFAULT_CHANGER
-       * server-src/amidxtaped.pl: Use DEFAULT_CHANGER if message eq 
+       * server-src/amidxtaped.pl: Use DEFAULT_CHANGER if message eq
                                    AMRECOVER_CHANGER
 
 2010-04-26  Dustin J. Mitchell <dustin@zmanda.com>
        * ndmp-src/ndml_nmb.c: Don't log successful halt.
        * server-src/dumper.c: Don't log no-op command.
 
+2010-04-23  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda-devices.7.xml: more detail for
+         STREAMING property
+
 2010-04-23  Dustin J. Mitchell <dustin@zmanda.com>
        * device-src/xfer-dest-taper-splitter.c: fix assertion failure
          reported by Wojciech Giel <wojciech.giel@cimr.cam.ac.uk>
 
 2010-04-23  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Header.pl: add checks for all fields
+
+2010-04-23  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/util.c: add debugging check to interruptible_accept
        * server-src/taper.pl: don't use IO::Socket, as it is badly broken
          and not thread-safe on Solaris 8
        * xfer-src/element-glue.c: add debugging checks
 2010-04-22  Jean-Louis Martineau <martineau@zmanda.com>
        * example/Makefile.am: fix 'make clean' to not erase source files.
 
+2010-04-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/progs.m4: check for, and reject, Solaris's
+         SGU lex, which is badly broken
+       * configure.in: use AMANDA_PROG_LEX
+
 2010-04-22  Dustin J. Mitchell <dustin@zmanda.com>
        * man/xml-source/amanda-changers.7.xml: fix typo, thanks to
          Jean-Francois Malouin
 2010-04-22  Jean-Louis Martineau <martineau@zmanda.com>
        * perl/Amanda/Changer/ndmp.pm: $conn = undef
 
+2010-04-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/match-test.c: lots of new tests
+       * common-src/match.c: fix comments, minor bugs in tar_to_regex and
+         match_level
+       * common-src/match.h: comments to describe each function
+       * man/xml-source/amanda.8.xml: update expression docs
+
 2010-04-21  Dustin J. Mitchell <dustin@zmanda.com>
        * server-src/amlabel.pl: add warning when the old label is in the
          tapelist
 
+2010-04-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Device.pl: test rait's MAX_VOLUME_USAGE
+       * device-src/rait-device.c: fix bugs
+
 2010-04-19  Jean-Louis Martineau <martineau@zmanda.com>
-       * perl/Amanda/Changer/compat.pm: Stop scan when the first is slot is 
+       * perl/Amanda/Changer/compat.pm: Stop scan when the first is slot is
          seen a second time.
 
+2010-04-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Config.swg: move val_t output typemap to a function
+
 2010-04-16  Dustin J. Mitchell <dustin@zmanda.com>
        * server-src/amadmin.c: show all custom compression/encryption options
          in amadmin disklist
 2010-04-15  Dustin J. Mitchell <dustin@zmanda.com>
        * installcheck/Amanda_Recovery_Scan.pl: don't use a system-global path
 
+2010-04-15  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/xfer-dest-device.c: don't use queueing anymore; this
+         removes the max_memory constructor argument
+       * perl/Amanda/XferServer.swg device-src/xfer-device.h: prototype
+         change
+       * perl/Amanda/Xfer.pod: docs
+       * device-src/amtapetype.pl installcheck/Amanda_Device.pl
+         installcheck/Amanda_Recovery_Clerk.pl installcheck/Amanda_Xfer.pl
+         installcheck/amrestore.pl server-src/amvault.pl: change constructor
+         invocation
+
+2010-04-15  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/util.c common-src/util.h: new interruptible_accept that
+         uses a prolong function to stop waiting
+       * common-src/stream.c: use interruptible_accept in stream_accept
+       * xfer-src/element-glue.c: use interruptible_accept to allow
+         directtcp_accept to be cancelled
+       * installcheck/Amanda_Xfer.pl: test xfer cancellation
+
 2010-04-14  Jean-Louis Martineau <martineau@zmanda.com>
            Satya Ganga <gsat@zmanda.com>
        * application-src/amsamba.pl: Fix use of include/exclude list.
 
+2010-04-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Taper_Scribe.pl perl/Amanda/Taper/Scribe.pm
+         server-src/taper.pl: rename dump_timestamp -> write_timestamp
+
 2010-04-14  Jean-Louis Martineau <martineau@zmanda.com>
        * ndmp-src/ndml_nmb.c: Always log NOTIFY_MOVER_HALTED.
 
+2010-04-13  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/conffile.c common-src/conffile.h: make file-pad and
+         tapebufs parameters errors
+       * perl/Amanda/Config.swg: remove parameters
+       * server-src/taper.pl: don't check tapebufs
+       * installcheck/Amanda_Config.pl: adjust testing
+       * man/xml-source/amanda-compatibility.7.xml: add deprecation
+         note about amrecover_do_fsf and amrecover_check_label
+
+2010-04-13  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/xfer-dest-taper-splitter.c
+         device-src/xfer-dest-taper-directtcp.c: make sure duration is positive
+
 2010-04-13  Dustin J. Mitchell <dustin@zmanda.com>
        * common-src/conffile.c: fix derived value for autolabel
 
        * ndmp-src/ndml_conn.c, ndmp-src/ndml_nmb.c:
          Always log NOTIFY_DATA_HALTED.
 
+2010-04-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/conffile.c: deprecate amrecover_do_fsf and
+         amrecover_check_label
+       * example/amanda.conf.in example/template.d/advanced.conf.in: remove
+       * man/xml-source/amanda.conf.5.xml: indicate deprecation
+       * NEWS: mention deprecation
+
 2010-04-12  Jean-Louis Martineau <martineau@zmanda.com>
        * perl/Amanda/Report/human.pm: typo.
 
        perl/Amanda/Report/xml.pm installcheck/amreport.pl
        installcheck/Amanda_Report.pl: taped segments called parts, not chunks
 
+
 2010-04-07  Jean-Louis Martineau <martineau@zmanda.com>
        * man/xml-source/amanda.conf.5.xml: Improve strategy "skip" man.
 
 2010-04-06  Paul C. Mantz <pcmantz@zmanda.com>
        * ndmp-src/ndmpconnobj.c: send NDMP4_LOG_* messages to debug log
        * ndmp-src/ndma_tape.c ndmp-src/ndma_tape_simulator.c: added
-         NDMP$_LOG_* messages for testing
+         NDMP4_LOG_* messages for testing
 
 2010-04-05  Jean-Louis Martineau <martineau@zmanda.com>
        * recover-src/extract_list.c: Fix USE-DATA-PATH offset and directory
        * perl/Amanda/Config.swg: swig CNF_SEND_AMREPORT_ON
        * installcheck/amreport.pl: installchecks
 
-2010-04-02  Paul C. Mantz <pcmantz@gmail.com>
-       * server-src/amreport.pl: accepts and ignores disk args in script mode
-       * installcheck/amreport.pl: checks
-
 2010-04-02  Dustin J. Mitchell <dustin@zmanda.com>
        * perl/Amanda/Util.pod: correct inaccurate claims in burp
 
 2010-04-02  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amstatus.pl: '$size{$hostpart} = 0' in taper cmd.
 
+2010-04-01  Paul C. Mantz <pcmantz@gmail.com>
+       * server-src/amreport.pl: accepts and ignores disk args in script mode
+       * installcheck/amreport.pl: checks
+
 2010-04-01  Jean-Louis Martineau <martineau@zmanda.com>
        * config/amanda/userid.m4: AM_CONDITIONAL(WANT_CHECK_USERID
        * installcheck/Makefile.am: Do not check amrecover if WANT_CHECK_USERID.
        * installcheck/amrecover.pl: Check 'localhost' hostname,
-                                    remove '^' from expect regex
+                                    remove '^' from expect regex
        * recover-src/uscan.l: Add [[:space:]]* in LINEFEED.
 
 2010-04-01  Dustin J. Mitchell <dustin@zmanda.com>
 
 2010-03-31  Jean-Louis Martineau <martineau@zmanda.com>
        * config/set_full_version: fix.
-        * config/amanda/config.m4: fix.
+       * config/amanda/config.m4: fix.
 
 2010-03-31  Jean-Louis Martineau <martineau@zmanda.com>
-        config/amanda/config.m4: Use -a.
+       * config/amanda/config.m4: Use -a.
 
 2010-03-31  Jean-Louis Martineau <martineau@zmanda.com>
        * config/set_full_version: Use -a.
        * config/set_full_version: Use grep.
 
 2010-03-31  Jean-Louis Martineau <martineau@zmanda.com>
-       config/Makefile.am: Add set_full_version to EXTRA_DIST.
+       config/Makefile.am: Add set_full_version to EXTRA_DIST.
        * config/set_full_version: Add the file.
 
 2010-03-31  Jean-Louis Martineau <martineau@zmanda.com>
        * config/amanda/version.m4: use $srcdir/VERSION
 
 2010-03-30  Jean-Louis Martineau <martineau@zmanda.com>
-       * VERSION: 3.1.0beta1.
+       * VERSION: 3.2.0alpha.
        * configure.in: Call AMANDA_VERSION.
        * config/amanda/version.m4: Add AMANDA_VERSION.
        * config/amanda/config.m4: Add AMANDA_GET_GIT_INFO.
 
-2010-03-29  Dustin J. Mitchell <dustin@zmanda.com>
-       * configure.in: update to rc19
-
 2010-03-30  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/driver.c: Retry direct to tape all aborted dump because
                               of missing holdingdisk space.
 
-2010-03-29  Dustin J. Mitchell <dustin@zmanda.com>
-       * configure.in: update to rc18
-
 2010-03-29  Paul C. Mantz <pcmantz@zmanda.com>
        * server-src/amcleanup.pl server-src/amflush.c: updated amreport usage
 
-2010-03-28  Dustin J. Mitchell <dustin@zmanda.com>
-       * installcheck/Installcheck/Run.pm: catch signal exits too
-       * installcheck/Makefile.am installcheck/amvault.pl: basic amvault
-         installcheck
-
 2010-03-28  Dustin J. Mitchell <dustin@zmanda.com>
        * server-src/amvault.pl: update with Changer and Catalog API changes
 
-2010-03-26  Dan Locks <dwlocks@zmanda.com>
-        * configure.in: update to rc17
-
 2010-03-26  Dustin J. Mitchell <dustin@zmanda.com>
        * installcheck/Makefile.am: don't run amrecover test under
          --without-restore
          emulating except_slots in chg-compat, preventing an infinite
          loop
 
-2010-03-25 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to rc16  NOTEST
-
-2010-03-23 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to rc15  NOTEST
-
-2010-03-23 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to rc14  NOTEST
-
-2010-03-23 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to beta1  NOTEST
-
 2010-03-23  Jean-Louis Martineau <martineau@zmanda.com>
        * application-src/amsamba.pl: check open failure correctly,
                                      improve debugging message.
        * installcheck/ampgsql.pl: test restores more carefully, including
          an empty incremental
 
-2010-03-22 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to rc13  NOTEST
-
-2010-03-22 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to rc12  NOTEST
-
 2010-03-22  Dustin J. Mitchell <dustin@zmanda.com>
        * common-src/amfeatures.c common-src/amfeatures.h
          perl/Amanda/Feature.pod: add a new feature to indicate that
 2010-03-19  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/amxml.c: data_path default ot DATA_PATH_AMANDA.
 
-2010-03-19 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to rc11.  NOTEST
-
 2010-03-19  Jean-Louis Martineau <martineau@zmanda.com>
        * recover-src/amrecover.c: Do add_config_override before loading the
                                   config.
 2010-03-18  Paul C. Mantz <pcmantz@zmanda.com>
        * perl/Amanda/Report.pm: updated POD
 
-2010-03-18 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to rc10.  NOTEST
-
 2010-03-18  Dustin J. Mitchell <dustin@zmanda.com>
        * application-src/ampgsql.pl: add a die_cb in command_validate and
          command_selfcheck
        * man/xml-source/amreport.8.xml: usage doc update
        * NEWS: added info about rewrite
 
-2010-03-17 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to rc08.  NOTEST
-
 2010-03-17  Paul C. Mantz <pcmantz@zmanda.com>
        * perl/Amanda/Report/human.pm: fixed premature disk truncation in
          dump summary
 
-2010-03-16 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to rc08.  NOTEST
-
 2010-03-16  Dustin J. Mitchell <dustin@zmanda.com>
        * perl/Amanda/Tests.swg: add a simple threaded function
        * perl/Makefile.am: and invoke it from 'make check'
 2010-03-11  Paul C. Mantz <pcmantz@zmanda.com>
        * perl/Amanda/Report.pm: fixed order that messages are reported
 
-2010-03-11 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: update to rc04
-
 2010-03-10  Dustin J. Mitchell <dustin@zmanda.com>
        * perl/Amanda/Changer/null.pm: note that constructor will not fail
        * server-src/amidxtaped.pl: use chg-null if the changer constructor
 2010-03-09  Paul C. Mantz <pcmantz@zmanda.com>
        * perl/Amanda/Report.pm: fixed caching of hostnames and dles
 
-2010-03-09 Dan Locks <dwlocks@zmanda.com>
-       *  configure.in: rc02
-
 2010-03-09  Dustin J. Mitchell <dustin@zmanda.com>
        * man/xml-source/amanda-applications.7.xml: add brief example of
          setting properties for an application
        * perl/Amanda/Report/human.pm: Report orig_size for FLUSH line.
        * installcheck/amreport.pl: check it.
 
+2010-03-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * ndmp-src/amndmjob_main.c, ndmp-src/ndmjob_main.c:
+         include conffile.h, not config.h.
+
 2010-03-05  Jean-Louis Martineau <martineau@zmanda.com>
        * config/amanda/version.m4: Allow 2 digits version.
 
 2010-03-05  Jean-Louis Martineau <martineau@zmanda.com>
-       * ndmp-src/amndmjob_main.c, ndmp-src/ndmjob_main.c:
-         include conffile.h, not config.h.
+       * packaging/deb/changelog, packaging/deb/rules,
+         packaging/deb/buildpkg, packaging/rpm/buildpkg,
+         packaging/rpm/amanda.spec,
+         configure.in: Change version to 3.2alpha.
 
 2010-03-05  Dustin J. Mitchell <dustin@zmanda.com>
        * configure.in config/amanda/progs.m4: AC_SUBST LPR-related
index fd2a01863fdd3035fac5918c59666363544bfe23..944880fa15e85084780c290b929924d3f8b6085f 100644 (file)
@@ -1 +1 @@
-3.1.0
+3.2.0
index b93f5ed949ac9cbbdb4b5fef9d22b31211c656e3..7e8d4c280aafeac1156dc83aec3694f76afb0561 100644 (file)
@@ -77,7 +77,7 @@ EXTRA_DIST += $(SNAPSHOT_STAMP) \
        FULL_VERSION
 
 FULL_VERSION: VERSION
-       config/set_full_version $(top_srcdir)
+       $(srcdir)/config/set_full_version $(top_srcdir)
 
 config.status: FULL_VERSION
 
index fe08336bdfddb4f54c8534bcdc81e5d99ae17061..27ec55efe743112df6afac3768c6a62a7c7a9962 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -125,7 +127,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -153,7 +154,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -166,10 +166,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -183,7 +187,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -196,10 +202,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -211,21 +220,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -356,7 +369,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -376,10 +389,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -435,78 +445,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -517,12 +582,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -537,17 +631,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -556,60 +654,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -617,13 +774,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -632,9 +795,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -670,7 +836,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -679,7 +844,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -687,19 +851,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -725,47 +912,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -773,6 +1016,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -795,19 +1039,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -817,13 +1063,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -867,6 +1110,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -936,6 +1180,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 ACLOCAL_AMFLAGS = --force -I config -I . -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive
 @WANT_CLIENT_TRUE@CLIENT_SUBDIRS = client-src application-src
 @WANT_SERVER_TRUE@SERVER_SUBDIRS = device-src server-src changer-src
@@ -1495,29 +1752,12 @@ uninstall-am: uninstall-pkgdataDATA
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
@@ -1528,7 +1768,7 @@ install-data-hook: installperms-data
 @WANT_INSTALLPERMS_FALSE@      rm -f "$(installperms_sh)"
 
 FULL_VERSION: VERSION
-       config/set_full_version $(top_srcdir)
+       $(srcdir)/config/set_full_version $(top_srcdir)
 
 config.status: FULL_VERSION
 
diff --git a/NEWS b/NEWS
index c66580bafe46b5bc6bc745b41b3ec3814f8d0116..fbb11ecda4ed9da52bb286abe502af57f2556bd9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,59 @@
+Changes in release 3.2.0alpha
+
+   * Support for multiple simultaneous writes to storage devices
+      o Can write to all available drives in parallel.
+      o Works only with the new changer API.
+      o Useful if two or more volumes are used in a single run.
+      o dump direct to tape can be scheduled any time during the run,
+        previously they were done sequencially after all dump to holding disk.
+      o enabled with the new 'taper-parallel-write' configuration option.
+   * Support for LEOM in storage devices
+      o allows splitting without partial parts, saving space
+      o much more efficient, since parts need not be cached on disk in most
+        cases
+   * new, simpler splitting commands in the tapetype section:
+     part-size, part-cache-type, part-cache-dir, part-cache-max-size; see
+     amanda.conf(5) for details
+   * Amanda server configuration file changes (amanda.conf)
+      o new configuration keyword:
+         + taper-parallel-write -- How many drive amanda can write to
+                                   in parallel.
+      o deprecated configuration keywords:
+         + amrecover_do_fsf
+         + amrecover_check_label
+   * the CONFIG parameter to amidxtaped is now required; this means that
+     versions of amrecover older than 2.4.3 will be unable to recover from
+     servers running Amanda-3.2 and later.
+   * The new dumptype and global parameters 'recovery-limit' can be used to
+     limit which hosts may recover from a particular DLE.  See amanda.conf(5)
+     and amanda-auth(7) for more information.
+   * Several old changers have been removed - these changers will work with
+     Amanda for the forseeable future, but are no longer included in the
+     distribution.
+      o chg-chio
+      o chg-chs
+      o chg-iomega
+      o chg-juke
+      o chg-mcutil
+      o chg-mtx
+      o chg-null (use the new "chg-null:")
+      o chg-rait (use the new "chg-rait:{dev1,dev2}")
+      o chg-rth
+      o chg-scsi-chio
+      o chg-scsi
+   * Amvault is much improved, but still experimental:
+      o supports assembling split parts on the source volume and re-splitting
+        them on the destination
+      o supports filtering dumps with the same syntax as amfetchdump
+      o a --fulls-only option skips all incremental dumps on the source
+      o an --export option tries to move tertiary volumes to import/export
+        slots when completed
+      o command-line syntax has changed incompatibly; see manpage or
+        'amvault --help'
+   * Rewritten and improved:
+      o amoverview
+      o amcheckdump
+
 Changes in release 3.1.0
 
    * Deprecated old changers; see amanda-changers(7) for replacements.  These
index 23ca33df68b5f2f7fe5337955a146804e5ecc1bf..d8b494ad146b438f9b266e24c13e0a3ed85eb68f 100644 (file)
@@ -1,3 +1,59 @@
+               Release Notes for amanda-3.2.0
+
+* Support for multiple simultaneous writes to storage devices
+   o Can write to all available drives in parallel.
+   o Works only with the new changer API.
+   o Useful if two or more volumes are used in a single run.
+   o dump direct to tape can be scheduled any time during the run,
+     previously they were done sequencially after all dump to holding disk.
+   o enabled with the new 'taper-parallel-write' configuration option.
+* Support for LEOM in storage devices
+   o allows splitting without partial parts, saving space
+   o much more efficient, since parts need not be cached on disk in most
+     cases
+* new, simpler splitting commands in the tapetype section:
+  part-size, part-cache-type, part-cache-dir, part-cache-max-size; see
+  amanda.conf(5) for details
+* Amanda server configuration file changes (amanda.conf)
+   o new configuration keyword:
+      + taper-parallel-write -- How many drive amanda can write to
+                                in parallel.
+   o deprecated configuration keywords:
+      + amrecover_do_fsf
+      + amrecover_check_label
+* the CONFIG parameter to amidxtaped is now required; this means that
+  versions of amrecover older than 2.4.3 will be unable to recover from
+  servers running Amanda-3.2 and later.
+* The new dumptype and global parameters 'recovery-limit' can be used to
+  limit which hosts may recover from a particular DLE.  See amanda.conf(5)
+  and amanda-auth(7) for more information.
+* Several old changers have been removed - these changers will work with
+  Amanda for the forseeable future, but are no longer included in the
+  distribution.
+   o chg-chio
+   o chg-chs
+   o chg-iomega
+   o chg-juke
+   o chg-mcutil
+   o chg-mtx
+   o chg-null (use the new "chg-null:")
+   o chg-rait (use the new "chg-rait:{dev1,dev2}")
+   o chg-rth
+   o chg-scsi-chio
+   o chg-scsi
+* Amvault is much improved, but still experimental:
+   o supports assembling split parts on the source volume and re-splitting
+     them on the destination
+   o supports filtering dumps with the same syntax as amfetchdump
+   o a --fulls-only option skips all incremental dumps on the source
+   o an --export option tries to move tertiary volumes to import/export
+     slots when completed
+   o command-line syntax has changed incompatibly; see manpage or
+     'amvault --help'
+* Rewritten and improved:
+   o amoverview
+   o amcheckdump
+
                Release Notes for amanda-3.1.0
 
 config
diff --git a/VERSION b/VERSION
index fd2a01863fdd3035fac5918c59666363544bfe23..944880fa15e85084780c290b929924d3f8b6085f 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.1.0
+3.2.0
index 2159a6e7c64505c61be8f319fd80d3c42ecff85c..73d98a3312a8423522a9ff984cee243e52e30770 100644 (file)
@@ -8025,7 +8025,6 @@ m4_include([config/amanda/amplot.m4])
 m4_include([config/amanda/bsd-security.m4])
 m4_include([config/amanda/bsdtcp-security.m4])
 m4_include([config/amanda/bsdudp-security.m4])
-m4_include([config/amanda/changer.m4])
 m4_include([config/amanda/components.m4])
 m4_include([config/amanda/compress.m4])
 m4_include([config/amanda/config.m4])
@@ -8053,7 +8052,6 @@ m4_include([config/amanda/readdir.m4])
 m4_include([config/amanda/readline.m4])
 m4_include([config/amanda/rsh-security.m4])
 m4_include([config/amanda/s3-device.m4])
-m4_include([config/amanda/shmem.m4])
 m4_include([config/amanda/socklen_t_equiv.m4])
 m4_include([config/amanda/ssh-security.m4])
 m4_include([config/amanda/summary.m4])
@@ -8066,10 +8064,14 @@ m4_include([config/amanda/version.m4])
 m4_include([config/gnulib/00gnulib.m4])
 m4_include([config/gnulib/alloca.m4])
 m4_include([config/gnulib/arpa_inet_h.m4])
+m4_include([config/gnulib/asm-underscore.m4])
 m4_include([config/gnulib/base64.m4])
 m4_include([config/gnulib/btowc.m4])
+m4_include([config/gnulib/dos.m4])
+m4_include([config/gnulib/environ.m4])
 m4_include([config/gnulib/errno_h.m4])
 m4_include([config/gnulib/extensions.m4])
+m4_include([config/gnulib/fcntl-o.m4])
 m4_include([config/gnulib/float_h.m4])
 m4_include([config/gnulib/fseeko.m4])
 m4_include([config/gnulib/fsusage.m4])
@@ -8083,7 +8085,9 @@ m4_include([config/gnulib/gnulib-comp.m4])
 m4_include([config/gnulib/hostent.m4])
 m4_include([config/gnulib/include_next.m4])
 m4_include([config/gnulib/inet_ntop.m4])
+m4_include([config/gnulib/inet_pton.m4])
 m4_include([config/gnulib/intmax_t.m4])
+m4_include([config/gnulib/langinfo_h.m4])
 m4_include([config/gnulib/localcharset.m4])
 m4_include([config/gnulib/locale-fr.m4])
 m4_include([config/gnulib/locale-ja.m4])
@@ -8096,10 +8100,13 @@ m4_include([config/gnulib/malloc.m4])
 m4_include([config/gnulib/mbrtowc.m4])
 m4_include([config/gnulib/mbsinit.m4])
 m4_include([config/gnulib/mbstate_t.m4])
+m4_include([config/gnulib/memchr.m4])
 m4_include([config/gnulib/mkdtemp.m4])
+m4_include([config/gnulib/mmap-anon.m4])
 m4_include([config/gnulib/multiarch.m4])
 m4_include([config/gnulib/netdb_h.m4])
 m4_include([config/gnulib/netinet_in_h.m4])
+m4_include([config/gnulib/nl_langinfo.m4])
 m4_include([config/gnulib/onceonly.m4])
 m4_include([config/gnulib/physmem.m4])
 m4_include([config/gnulib/printf.m4])
@@ -8111,21 +8118,25 @@ m4_include([config/gnulib/snprintf.m4])
 m4_include([config/gnulib/socklen.m4])
 m4_include([config/gnulib/sockpfaf.m4])
 m4_include([config/gnulib/ssize_t.m4])
+m4_include([config/gnulib/stat.m4])
 m4_include([config/gnulib/stdbool.m4])
+m4_include([config/gnulib/stddef_h.m4])
 m4_include([config/gnulib/stdint.m4])
 m4_include([config/gnulib/stdio_h.m4])
 m4_include([config/gnulib/stdlib_h.m4])
+m4_include([config/gnulib/string_h.m4])
 m4_include([config/gnulib/sys_socket_h.m4])
 m4_include([config/gnulib/sys_stat_h.m4])
 m4_include([config/gnulib/sys_time_h.m4])
 m4_include([config/gnulib/tempname.m4])
 m4_include([config/gnulib/threadlib.m4])
+m4_include([config/gnulib/time_h.m4])
 m4_include([config/gnulib/unistd_h.m4])
 m4_include([config/gnulib/vasnprintf.m4])
-m4_include([config/gnulib/visibility.m4])
-m4_include([config/gnulib/wchar.m4])
+m4_include([config/gnulib/warn-on-use.m4])
+m4_include([config/gnulib/wchar_h.m4])
 m4_include([config/gnulib/wcrtomb.m4])
-m4_include([config/gnulib/wctype.m4])
+m4_include([config/gnulib/wctype_h.m4])
 m4_include([config/gnulib/write.m4])
 m4_include([config/gettext-macros/codeset.m4])
 m4_include([config/gettext-macros/gettext.m4])
index 6edcb32b3e954956730a5e1dfafc3ed8fae50b6a..4c86e4b50e23e2b94a4078c503630a045a3c7589 100644 (file)
@@ -36,14 +36,6 @@ LDADD = ../common-src/libamanda.la \
        ../common-src/libamanda.la \
        ../gnulib/libgnu.la
 
-INSTALLPERMS_exec = \
-       dest=$(amlibexecdir) chown=amanda \
-               $(amlibexec_PROGRAMS)
-
-INSTALLPERMS_data = \
-       dest=$(amlibexecdir) chown=amanda \
-               $(amlibexec_SCRIPTS)
-
 lint:
        @ for p in $(amlibexec_PROGRAMS); do                                    \
                p=`basename $$p $(EXEEXT)`;                                     \
index eef723fcb2b5d28f04f52aaf6bd529d5c403052e..9f4d73cb22abe7a1a03edaa9f0dc7cb93bcdb53b 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -132,7 +134,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -160,7 +161,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -173,10 +173,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -190,7 +194,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -203,10 +209,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -218,21 +227,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -336,7 +349,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -356,10 +369,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -415,78 +425,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -497,12 +562,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -517,17 +611,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -536,60 +634,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -597,13 +754,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -612,9 +775,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -650,7 +816,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -659,7 +824,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -667,19 +831,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -705,47 +892,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -753,6 +996,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -775,19 +1019,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -797,13 +1043,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -847,6 +1090,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -906,6 +1150,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src \
                -I$(top_srcdir)/gnulib
@@ -931,14 +1188,6 @@ LDADD = ../common-src/libamanda.la \
        ../common-src/libamanda.la \
        ../gnulib/libgnu.la
 
-INSTALLPERMS_exec = \
-       dest=$(amlibexecdir) chown=amanda \
-               $(amlibexec_PROGRAMS)
-
-INSTALLPERMS_data = \
-       dest=$(amlibexecdir) chown=amanda \
-               $(amlibexec_SCRIPTS)
-
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -1308,29 +1557,12 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index 1c47ae446467868dfb2dbb49ef9a04e1bb08e4e5..5c15e0442efbae2afca8eeb3f762f25d442aa190 100644 (file)
@@ -212,6 +212,17 @@ main(
     safe_fd(-1, 0);
     safe_cd();
 
+    /*
+     * Nexenta needs the SUN_PERSONALITY env variable to be unset, otherwise
+     * the Sun version of tar in /usr/sun/sbin/tar is called instead.
+     *
+     * On other operating systems this will have no effect.
+     */
+
+#ifdef HAVE_UNSETENV
+    unsetenv("SUN_PERSONALITY");
+#endif
+
     /*
      * When called via inetd, it is not uncommon to forget to put the
      * argv[0] value on the config line.  On some systems (e.g. Solaris)
@@ -549,7 +560,7 @@ protocol_accept(
     }
 
     /*
-     * If we have errors (not warnings) from the config file, let the server
+     * If we have errors (not warnings) from the config file, let the remote system
      * know immediately.  Unfortunately, we only get one ERROR line, so if there
      * are multiple errors, we just show the first.
      */
@@ -574,6 +585,8 @@ protocol_accept(
        return;
     }
 
+    g_debug("authenticated peer name is '%s'", security_get_authenticated_peer_name(handle));
+
     /*
      * If pkt is NULL, then there was a problem with the new connection.
      */
@@ -1403,6 +1416,7 @@ process_readnetfd(
 
        /* fill info_end_buf from the tail end of combined_buf */
        memcpy(as->info_end_buf, combined_buf + n, INFO_END_LEN);
+       amfree(combined_buf);
 
        /* if we did see info_end_str, start reading the data fd (fd 0) */
        if (as->seen_info_end) {
@@ -1519,6 +1533,8 @@ service_new(
     struct active_service *as;
     pid_t pid;
     int newfd;
+    char *peer_name;
+    char *amanda_remote_host_env[2];
 
     assert(security_handle != NULL);
     assert(cmd != NULL);
@@ -1632,6 +1648,16 @@ service_new(
         * and start up.
         */
 
+       /* set up the AMANDA_AUTHENTICATED_PEER env var so child services
+        * can use it to authenticate */
+       peer_name = security_get_authenticated_peer_name(security_handle);
+       amanda_remote_host_env[0] = NULL;
+       amanda_remote_host_env[1] = NULL;
+       if (*peer_name) {
+           amanda_remote_host_env[0] =
+               g_strdup_printf("AMANDA_AUTHENTICATED_PEER=%s", peer_name);
+       }
+
        /*
         * The data stream is stdin in the new process
         */
@@ -1721,7 +1747,7 @@ service_new(
         aclose(data_write[STDERR_PIPE][1]);
        safe_fd(DATA_FD_OFFSET, DATA_FD_COUNT*2);
 
-       execle(cmd, cmd, "amandad", auth, (char *)NULL, safe_env());
+       execle(cmd, cmd, "amandad", auth, (char *)NULL, safe_env_full(amanda_remote_host_env));
        error(_("could not exec service %s: %s\n"), cmd, strerror(errno));
        /*NOTREACHED*/
     }
index 1173592af596437616db2d7e4260cb3ac1d0591b..1721a3220f78ac363240c8e3b4525a84d487415a 100644 (file)
@@ -28,6 +28,7 @@
  *
  */
 
+#include "amanda.h"
 #include "amandad.h"
 #include "util.h"
 
index 466f4cc0e9b99e38c55cda762332f01b9246693f..ef66352a75576d8c7cd58335741e91b36d119e65 100644 (file)
@@ -36,6 +36,3 @@ noinst_PROGRAMS = $(TESTS)
 amar_test_SOURCES = amar-test.c
 amar_test_LDADD = libamar.la \
        ../common-src/libtestutils.la
-
-INSTALLPERMS_exec = \
-       dest=$(sbindir) chown=amanda chmod=0750 $(sbin_PROGRAMS)
index 6ddfdaf3e5e7704abe1e48f1b1ca4b14f1a9cc6d..4cd3661df943795aba42bf120bd46971a850c5c9 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -134,7 +136,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -162,7 +163,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -175,10 +175,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -192,7 +196,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -205,10 +211,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -220,21 +229,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -344,7 +357,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -364,10 +377,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -423,78 +433,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -505,12 +570,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -525,17 +619,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -544,60 +642,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -605,13 +762,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -620,9 +783,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -658,7 +824,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -667,7 +832,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -675,19 +839,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -713,47 +900,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -761,6 +1004,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -783,19 +1027,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -805,13 +1051,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -855,6 +1098,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -914,6 +1158,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 INCLUDES = -I$(top_builddir)/common-src \
                 -I$(top_srcdir)/common-src \
                 -I$(top_srcdir)/gnulib
@@ -935,9 +1192,6 @@ amar_test_SOURCES = amar-test.c
 amar_test_LDADD = libamar.la \
        ../common-src/libtestutils.la
 
-INSTALLPERMS_exec = \
-       dest=$(sbindir) chown=amanda chmod=0750 $(sbin_PROGRAMS)
-
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -1413,29 +1667,12 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-sbinPROGRAMS
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index f0b0c109e19fe51fda7053d8291ccdea0563f082..1ceb220054280b305a7aeba5d4212d7ddb07dee2 100644 (file)
@@ -22,7 +22,3 @@ amplot.gp: amplot.g
        echo "pause -1;" >> amplot.gp.new
        rm -f amplot.gp
        mv amplot.gp.new amplot.gp
-
-INSTALLPERMS_data = \
-       dest=$(amplotdir) chown=amanda $(amplot_DATA) \
-       dest=$(sbindir) chown=amanda $(sbin_SCRIPTS)
index 188cd4aa1fee35c348d659065c4937eb78ac5606..166423bd1a42989603732b80eb4d6b82132a25fc 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -201,7 +203,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -229,7 +230,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -242,10 +242,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -259,7 +263,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -272,10 +278,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -287,21 +296,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -378,7 +391,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -398,10 +411,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -457,78 +467,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -539,12 +604,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -559,17 +653,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -578,60 +676,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -639,13 +796,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -654,9 +817,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -692,7 +858,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -701,7 +866,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -709,19 +873,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -747,47 +934,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -795,6 +1038,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -817,19 +1061,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -839,13 +1085,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -889,6 +1132,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -953,15 +1197,24 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 SCRIPTS_SHELL = amplot
 SCRIPTS_AWK = amcat.awk
 sbin_SCRIPTS = $(SCRIPTS_SHELL)
 amplotdir = $(amlibexecdir)
 amplot_DATA = $(SCRIPTS_AWK) amplot.awk amplot.g amplot.gp
-INSTALLPERMS_data = \
-       dest=$(amplotdir) chown=amanda $(amplot_DATA) \
-       dest=$(sbindir) chown=amanda $(sbin_SCRIPTS)
-
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -1097,6 +1350,7 @@ distdir: $(DISTFILES)
        $(MAKE) $(AM_MAKEFLAGS) \
          top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-hook
+@SYNTAX_CHECKS_FALSE@check-local:
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-local
 check: $(BUILT_SOURCES)
@@ -1185,7 +1439,7 @@ install-ps: install-ps-am
 
 install-ps-am:
 
-installcheck-am: installcheck-local
+installcheck-am:
 
 maintainer-clean: maintainer-clean-am
        -rm -f Makefile
@@ -1217,21 +1471,23 @@ uninstall-am: uninstall-amplotDATA uninstall-sbinSCRIPTS
        install-html-am install-info install-info-am install-man \
        install-pdf install-pdf-am install-ps install-ps-am \
        install-sbinSCRIPTS install-strip installcheck installcheck-am \
-       installcheck-local installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-generic \
-       mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
-       uninstall-amplotDATA uninstall-sbinSCRIPTS
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+       ps ps-am uninstall uninstall-am uninstall-amplotDATA \
+       uninstall-sbinSCRIPTS
 
 
 # Perl
 %: %.pl $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          rm $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  fi
+@SYNTAX_CHECKS_TRUE@   @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+@SYNTAX_CHECKS_TRUE@           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
+@SYNTAX_CHECKS_TRUE@           rm $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@   else \
+@SYNTAX_CHECKS_TRUE@           echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
+@SYNTAX_CHECKS_TRUE@   fi
 
 %.pl: %.pl.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
@@ -1255,33 +1511,22 @@ uninstall-am: uninstall-amplotDATA uninstall-sbinSCRIPTS
 %.awk: %.awk.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
 
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
 check-perl: $(SCRIPTS_PERL)
        @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
            test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-           if test -n "$(PERL)"; then \
-                   for perlobj in $$SCRIPTS_PERL; do \
-                           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
-                           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
-                           rm $$perlobj.nouselib; \
-                   done; \
-           fi \
-       fi
-check-local: check-perl
-
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
-       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
-       if test x"$(SKIP_CHECKS)" = x"" && \
-           test -n "$(PERL)"; then \
-               for perlobj in $$SCRIPTS_PERL; do \
-                       $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
-               done; \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
        fi
-installcheck-local: installcheck-perl
+@SYNTAX_CHECKS_TRUE@check-local: check-perl
 
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
 check-shell: $(SCRIPTS_SHELL)
        @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
@@ -1299,7 +1544,7 @@ check-shell: $(SCRIPTS_SHELL)
                        echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
        fi
-check-local: check-shell
+@SYNTAX_CHECKS_TRUE@check-local: check-shell
 
 # make sure that the sources for all shell and perl scripts get included
 # in the distribution
@@ -1339,29 +1584,12 @@ dist-hook: dist-scripts
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index 17f1dea2b0d8f76c4ee3b9850f290a1c2a458f68..c0cc36b7ec57c433dd72ae63f3351f37ac563fd9 100644 (file)
@@ -48,13 +48,7 @@ LDADD = ../common-src/libamanda.la \
        ../common-src/libamanda.la \
        ../gnulib/libgnu.la
 
-INSTALLPERMS_exec = dest=$(amlibexecdir) chown=amanda $(amlibexec_PROGRAMS) \
-                   dest=$(applicationdir) chown=amanda $(applicationexec_PROGRAMS) \
-                   dest=$(applicationdir) chown=amanda $(applicationexec_SCRIPTS)
-
-INSTALLPERMS_data = dest=$(amlibexecdir) chown=amanda $(amlibexec_SCRIPTS)
-
 if WANT_SETUID_CLIENT
-INSTALLPERMS_exec += dest=$(applicationdir) chown=root chmod=04750 \
-                    amgtar amstar
+INSTALLPERMS_exec = dest=$(applicationdir) chown=root:setuid chmod=04750 \
+                   amgtar amstar
 endif
index ae90dd5a53c265368372ca1453d929e6874dd4ce..80a02599bdd38a318cf153ef8f2bbb5757e0f627 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -187,9 +189,6 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh)
 amlibexec_PROGRAMS = teecount$(EXEEXT)
 applicationexec_PROGRAMS = amgtar$(EXEEXT) amstar$(EXEEXT)
-@WANT_SETUID_CLIENT_TRUE@am__append_2 = dest=$(applicationdir) chown=root chmod=04750 \
-@WANT_SETUID_CLIENT_TRUE@                   amgtar amstar
-
 subdir = application-src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps =  \
@@ -206,7 +205,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -234,7 +232,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -247,10 +244,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -264,7 +265,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -277,10 +280,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -292,21 +298,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -418,7 +428,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -438,10 +448,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -497,78 +504,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -579,12 +641,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -599,17 +690,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -618,60 +713,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -679,13 +833,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -694,9 +854,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -732,7 +895,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -741,7 +903,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -749,19 +910,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -787,47 +971,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -835,6 +1075,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -857,19 +1098,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -879,13 +1122,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -929,6 +1169,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -993,6 +1234,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src \
                -I$(top_srcdir)/client-src \
@@ -1030,11 +1284,9 @@ LDADD = ../common-src/libamanda.la \
        ../common-src/libamanda.la \
        ../gnulib/libgnu.la
 
-INSTALLPERMS_exec = dest=$(amlibexecdir) chown=amanda \
-       $(amlibexec_PROGRAMS) dest=$(applicationdir) chown=amanda \
-       $(applicationexec_PROGRAMS) dest=$(applicationdir) \
-       chown=amanda $(applicationexec_SCRIPTS) $(am__append_2)
-INSTALLPERMS_data = dest=$(amlibexecdir) chown=amanda $(amlibexec_SCRIPTS)
+@WANT_SETUID_CLIENT_TRUE@INSTALLPERMS_exec = dest=$(applicationdir) chown=root:setuid chmod=04750 \
+@WANT_SETUID_CLIENT_TRUE@                  amgtar amstar
+
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -1322,6 +1574,7 @@ distdir: $(DISTFILES)
        $(MAKE) $(AM_MAKEFLAGS) \
          top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-hook
+@SYNTAX_CHECKS_FALSE@check-local:
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-local
 check: $(BUILT_SOURCES)
@@ -1414,7 +1667,7 @@ install-ps: install-ps-am
 
 install-ps-am:
 
-installcheck-am: installcheck-local
+installcheck-am:
 
 maintainer-clean: maintainer-clean-am
        -rm -rf ./$(DEPDIR)
@@ -1453,10 +1706,10 @@ uninstall-am: uninstall-amlibexecPROGRAMS \
        install-html install-html-am install-info install-info-am \
        install-man install-pdf install-pdf-am install-ps \
        install-ps-am install-strip installcheck installcheck-am \
-       installcheck-local installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-amlibexecPROGRAMS \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-amlibexecPROGRAMS \
        uninstall-applicationexecPROGRAMS \
        uninstall-applicationexecSCRIPTS
 
@@ -1465,11 +1718,13 @@ uninstall-am: uninstall-amlibexecPROGRAMS \
 %: %.pl $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          rm $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  fi
+@SYNTAX_CHECKS_TRUE@   @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+@SYNTAX_CHECKS_TRUE@           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
+@SYNTAX_CHECKS_TRUE@           rm $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@   else \
+@SYNTAX_CHECKS_TRUE@           echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
+@SYNTAX_CHECKS_TRUE@   fi
 
 %.pl: %.pl.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
@@ -1493,33 +1748,22 @@ uninstall-am: uninstall-amlibexecPROGRAMS \
 %.awk: %.awk.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
 
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
 check-perl: $(SCRIPTS_PERL)
        @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
            test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-           if test -n "$(PERL)"; then \
-                   for perlobj in $$SCRIPTS_PERL; do \
-                           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
-                           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
-                           rm $$perlobj.nouselib; \
-                   done; \
-           fi \
-       fi
-check-local: check-perl
-
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
-       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
-       if test x"$(SKIP_CHECKS)" = x"" && \
-           test -n "$(PERL)"; then \
-               for perlobj in $$SCRIPTS_PERL; do \
-                       $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
-               done; \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
        fi
-installcheck-local: installcheck-perl
+@SYNTAX_CHECKS_TRUE@check-local: check-perl
 
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
 check-shell: $(SCRIPTS_SHELL)
        @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
@@ -1537,7 +1781,7 @@ check-shell: $(SCRIPTS_SHELL)
                        echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
        fi
-check-local: check-shell
+@SYNTAX_CHECKS_TRUE@check-local: check-shell
 
 # make sure that the sources for all shell and perl scripts get included
 # in the distribution
@@ -1577,29 +1821,12 @@ dist-hook: dist-scripts
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index 947a986ed25e28eb2d4a69c103e5ccbac5edbeb9..95869693fdc48a0c6c728425a95f1e26d5ae55b7 100644 (file)
@@ -57,6 +57,7 @@
  * EXIT-HANDLING   (1=GOOD 2=BAD)
  * TAR-BLOCKSIZE   (default does not add --blocking-factor option,
  *                  using tar's default)
+ * VERBOSE
  */
 
 #include "amanda.h"
@@ -120,6 +121,7 @@ typedef struct application_argument_s {
     dle_t      dle;
     int        argc;
     char     **argv;
+    int        verbose;
 } application_argument_t;
 
 enum { CMD_ESTIMATE, CMD_BACKUP };
@@ -136,7 +138,8 @@ static void amgtar_build_exinclude(dle_t *dle, int verbose,
 static char *amgtar_get_incrname(application_argument_t *argument, int level,
                                 FILE *mesgstream, int command);
 static GPtrArray *amgtar_build_argv(application_argument_t *argument,
-                               char *incrname, int command);
+                               char *incrname, char **file_exclude,
+                               char **file_include, int command);
 static char *gnutar_path;
 static char *gnutar_listdir;
 static char *gnutar_directory;
@@ -190,6 +193,7 @@ static struct option long_options[] = {
     {"command-options" , 1, NULL, 33},
     {"include-list-glob", 1, NULL, 34},
     {"exclude-list-glob", 1, NULL, 35},
+    {"verbose"          , 1, NULL, 36},
     {NULL, 0, NULL, 0}
 };
 
@@ -363,6 +367,7 @@ main(
     argument.command_options = NULL;
     argument.include_list_glob = NULL;
     argument.exclude_list_glob = NULL;
+    argument.verbose = 0;
     init_dle(&argument.dle);
 
     while (1) {
@@ -490,6 +495,9 @@ main(
        case 35: if (optarg)
                     argument.exclude_list_glob = stralloc(optarg);
                 break;
+       case 36: if (optarg  && strcasecmp(optarg, "YES") == 0)
+                    argument.verbose = 1;
+                break;
        case ':':
        case '?':
                break;
@@ -686,6 +694,8 @@ amgtar_estimate(
     times_t    start_time;
     int        level;
     GSList    *levels;
+    char      *file_exclude;
+    char      *file_include;
 
     if (!argument->level) {
         fprintf(stderr, "ERROR No level argument\n");
@@ -704,8 +714,6 @@ amgtar_estimate(
 
     if (argument->calcsize) {
        char *dirname;
-       char *file_exclude;
-       char *file_include;
        int   nb_exclude;
        int   nb_include;
 
@@ -720,6 +728,13 @@ amgtar_estimate(
 
        run_calcsize(argument->config, "GNUTAR", argument->dle.disk, dirname,
                     argument->level, file_exclude, file_include);
+
+       if (argument->verbose == 0) {
+           if (file_exclude)
+               unlink(file_exclude);
+           if (file_include)
+               unlink(file_include);
+        }
        return;
     }
 
@@ -737,7 +752,8 @@ amgtar_estimate(
        level = GPOINTER_TO_INT(levels->data);
        incrname = amgtar_get_incrname(argument, level, stdout, CMD_ESTIMATE);
        cmd = stralloc(gnutar_path);
-       argv_ptr = amgtar_build_argv(argument, incrname, CMD_ESTIMATE);
+       argv_ptr = amgtar_build_argv(argument, incrname, &file_exclude,
+                                    &file_include, CMD_ESTIMATE);
 
        start_time = curclock();
 
@@ -831,6 +847,14 @@ common_exit:
        if (incrname) {
            unlink(incrname);
        }
+
+       if (argument->verbose == 0) {
+           if (file_exclude)
+               unlink(file_exclude);
+           if (file_include)
+               unlink(file_include);
+        }
+
        g_ptr_array_free_full(argv_ptr);
        amfree(cmd);
 
@@ -876,6 +900,8 @@ amgtar_backup(
     amwait_t   wait_status;
     GPtrArray *argv_ptr;
     int        tarpid;
+    char      *file_exclude;
+    char      *file_include;
 
     mesgstream = fdopen(mesgf, "w");
     if (!mesgstream) {
@@ -908,7 +934,8 @@ amgtar_backup(
                                   GPOINTER_TO_INT(argument->level->data),
                                   mesgstream, CMD_BACKUP);
     cmd = stralloc(gnutar_path);
-    argv_ptr = amgtar_build_argv(argument, incrname, CMD_BACKUP);
+    argv_ptr = amgtar_build_argv(argument, incrname, &file_exclude,
+                                &file_include, CMD_BACKUP);
 
     tarpid = pipespawnv(cmd, STDIN_PIPE|STDERR_PIPE, 1,
                        &dumpin, &dataf, &outf, (char **)argv_ptr->pdata);
@@ -1017,6 +1044,13 @@ amgtar_backup(
 
     fclose(mesgstream);
 
+    if (argument->verbose == 0) {
+       if (file_exclude)
+           unlink(file_exclude);
+       if (file_include)
+           unlink(file_include);
+    }
+
     amfree(incrname);
     amfree(qdisk);
     amfree(cmd);
@@ -1032,6 +1066,9 @@ amgtar_restore(
     char      **env;
     int         j;
     char       *e;
+    char       *include_filename = NULL;
+    char       *exclude_filename = NULL;
+    int         tarpid;
 
     if (!gnutar_path) {
        error(_("GNUTAR-PATH not defined"));
@@ -1048,6 +1085,8 @@ amgtar_restore(
        g_ptr_array_add(argv_ptr, stralloc("--selinux"));
     if (gnutar_xattrs)
        g_ptr_array_add(argv_ptr, stralloc("--xattrs"));
+    /* ignore trailing zero blocks on input (this was the default until tar-1.21) */
+    g_ptr_array_add(argv_ptr, stralloc("--ignore-zeros"));
     g_ptr_array_add(argv_ptr, stralloc("-xpGvf"));
     g_ptr_array_add(argv_ptr, stralloc("-"));
     if (gnutar_directory) {
@@ -1073,7 +1112,6 @@ amgtar_restore(
        argument->dle.exclude_list->nb_element == 1) {
        FILE      *exclude;
        char      *sdisk;
-       char      *filename;
        int        in_argv;
        int        entry_in_exclude = 0;
        char       line[2*PATH_MAX];
@@ -1082,12 +1120,12 @@ amgtar_restore(
        if (argument->dle.disk) {
            sdisk = sanitise_filename(argument->dle.disk);
        } else {
-           sdisk = g_strdup_printf("installcheck-exclude-%d", getpid());
+           sdisk = g_strdup_printf("no_dle-%d", getpid());
        }
-       filename = vstralloc(AMANDA_TMPDIR, "/", "exclude-", sdisk,  NULL);
+       exclude_filename= vstralloc(AMANDA_TMPDIR, "/", "exclude-", sdisk,  NULL);
        exclude_list = fopen(argument->dle.exclude_list->first->name, "r");
 
-       exclude = fopen(filename, "w");
+       exclude = fopen(exclude_filename, "w");
        while (fgets(line, 2*PATH_MAX, exclude_list)) {
            char *escaped;
            line[strlen(line)-1] = '\0'; /* remove '\n' */
@@ -1103,7 +1141,7 @@ amgtar_restore(
        }
        fclose(exclude);
        g_ptr_array_add(argv_ptr, stralloc("--exclude-from"));
-       g_ptr_array_add(argv_ptr, filename);
+       g_ptr_array_add(argv_ptr, exclude_filename);
     }
 
     if (argument->exclude_list_glob) {
@@ -1115,7 +1153,6 @@ amgtar_restore(
        GPtrArray *argv_include = g_ptr_array_new();
        FILE      *include;
        char      *sdisk;
-       char      *filename;
        int        in_argv;
        guint      i;
        int        entry_in_include = 0;
@@ -1123,10 +1160,10 @@ amgtar_restore(
        if (argument->dle.disk) {
            sdisk = sanitise_filename(argument->dle.disk);
        } else {
-           sdisk = g_strdup_printf("installcheck-include-%d", getpid());
+           sdisk = g_strdup_printf("no_dle-%d", getpid());
        }
-       filename = vstralloc(AMANDA_TMPDIR, "/", "include-", sdisk,  NULL);
-       include = fopen(filename, "w");
+       include_filename = vstralloc(AMANDA_TMPDIR, "/", "include-", sdisk,  NULL);
+       include = fopen(include_filename, "w");
        if (argument->dle.include_list &&
            argument->dle.include_list->nb_element == 1) {
            char line[2*PATH_MAX];
@@ -1159,7 +1196,7 @@ amgtar_restore(
 
        if (entry_in_include) {
            g_ptr_array_add(argv_ptr, stralloc("--files-from"));
-           g_ptr_array_add(argv_ptr, filename);
+           g_ptr_array_add(argv_ptr, include_filename);
        }
 
        if (argument->include_list_glob) {
@@ -1174,11 +1211,27 @@ amgtar_restore(
     g_ptr_array_add(argv_ptr, NULL);
 
     debug_executing(argv_ptr);
-    env = safe_env();
-    become_root();
-    execve(cmd, (char **)argv_ptr->pdata, env);
-    e = strerror(errno);
-    error(_("error [exec %s: %s]"), cmd, e);
+
+    tarpid = fork();
+    switch (tarpid) {
+    case -1: error(_("%s: fork returned: %s"), get_pname(), strerror(errno));
+    case 0:
+       env = safe_env();
+       become_root();
+       execve(cmd, (char **)argv_ptr->pdata, env);
+       e = strerror(errno);
+       error(_("error [exec %s: %s]"), cmd, e);
+       break;
+    default: break;
+    }
+
+    waitpid(tarpid, NULL, 0);
+    if (argument->verbose == 0) {
+       if (exclude_filename)
+           unlink(exclude_filename);
+       if (include_filename)
+           unlink(include_filename);
+    }
 }
 
 static void
@@ -1199,6 +1252,8 @@ amgtar_validate(
 
     cmd = stralloc(gnutar_path);
     g_ptr_array_add(argv_ptr, stralloc(gnutar_path));
+    /* ignore trailing zero blocks on input (this was the default until tar-1.21) */
+    g_ptr_array_add(argv_ptr, stralloc("--ignore-zeros"));
     g_ptr_array_add(argv_ptr, stralloc("-tf"));
     g_ptr_array_add(argv_ptr, stralloc("-"));
     g_ptr_array_add(argv_ptr, NULL);
@@ -1366,21 +1421,21 @@ amgtar_get_incrname(
 
 GPtrArray *amgtar_build_argv(
     application_argument_t *argument,
-    char *incrname,
-    int   command)
+    char  *incrname,
+    char **file_exclude,
+    char **file_include,
+    int    command)
 {
     int    nb_exclude;
     int    nb_include;
-    char  *file_exclude;
-    char  *file_include;
     char  *dirname;
     char   tmppath[PATH_MAX];
     GPtrArray *argv_ptr = g_ptr_array_new();
     GSList    *copt;
 
     amgtar_build_exinclude(&argument->dle, 1,
-                          &nb_exclude, &file_exclude,
-                          &nb_include, &file_include);
+                          &nb_exclude, file_exclude,
+                          &nb_include, file_include);
 
     if (gnutar_directory) {
        dirname = gnutar_directory;
@@ -1431,14 +1486,14 @@ GPtrArray *amgtar_build_argv(
        g_ptr_array_add(argv_ptr, stralloc((char *)copt->data));
     }
 
-    if(file_exclude) {
+    if (*file_exclude) {
        g_ptr_array_add(argv_ptr, stralloc("--exclude-from"));
-       g_ptr_array_add(argv_ptr, stralloc(file_exclude));
+       g_ptr_array_add(argv_ptr, stralloc(*file_exclude));
     }
 
-    if(file_include) {
+    if (*file_include) {
        g_ptr_array_add(argv_ptr, stralloc("--files-from"));
-       g_ptr_array_add(argv_ptr, stralloc(file_include));
+       g_ptr_array_add(argv_ptr, stralloc(*file_include));
     }
     else {
        g_ptr_array_add(argv_ptr, stralloc("."));
index b836758c9d4767e4aad2d7bfce84294de27964ee..6504cb44e53ca3c965870dada08964465e90fd46 100644 (file)
@@ -1,5 +1,5 @@
 #!@PERL@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 use Getopt::Long;
 use File::Basename;
 
index 1a20a242e5f2dc30a0d9f278dbb853e71162ea5f..e8056d5de12f84ad6879588ba7a2ad681f30185b 100644 (file)
@@ -161,6 +161,7 @@ sub _check {
 
 sub _check_parent_dirs {
     my ($dir) = @_;
+    my $ok = 1;
     my $is_abs = substr($dir, 0, 1) eq "/";
     _check("$dir is an absolute path?", "Yes", "No. It should start with '/'",
        sub {$is_abs});
@@ -170,11 +171,14 @@ sub _check_parent_dirs {
     my $partial_path = '';
     for my $path_part (@parts) {
         $partial_path .= $path_part . (($partial_path || $is_abs)? '/' : '');
-        _check("$partial_path is executable?", "Yes", "No",
+        $ok &&=
+           _check("$partial_path is executable?", "Yes", "No",
                sub {-x $_[0]}, $partial_path);
-        _check("$partial_path is a directory?", "Yes", "No",
+        $ok &&=
+           _check("$partial_path is a directory?", "Yes", "No",
                sub {-d $_[0]}, $partial_path);
     }
+    $ok;
 }
 
 sub _ok_passfile_perms {
@@ -243,62 +247,101 @@ sub command_selfcheck {
            sub {!(-d $_[0])}, $Amanda::Constants::GNUTAR);
     _check_parent_dirs($Amanda::Constants::GNUTAR);
 
-    _check("TMPDIR $self->{'args'}->{'tmpdir'}",
+    _check("TMPDIR '$self->{'args'}->{'tmpdir'}'",
            "is an acessible directory", "is NOT an acessible directory",
-           sub {-d $_[0] && -r $_[0] && -w $_[0] && -x $_[0]},
+           sub {$_[0] && -d $_[0] && -r $_[0] && -w $_[0] && -x $_[0]},
            $self->{'args'}->{'tmpdir'});
-    _check("STATEDIR $self->{'args'}->{'statedir'}",
+
+    if (exists $self->{'props'}->{'pg-datadir'}) {
+       _check("PG-DATADIR property is",
+              "same as diskdevice", "differrent than diskdevice",
+              sub { $_[0] eq $_[1] },
+              $self->{'props'}->{'pg-datadir'}, $self->{'args'}->{'device'});
+    } else {
+       $self->{'props'}->{'pg-datadir'} = $self->{'args'}->{'device'};
+    }
+
+    _check("PG-DATADIR property", "is set", "is NOT set",
+          sub { $_[0] }, $self->{'props'}->{'pg-datadir'});
+       # note that the backup user need not be able ot read this dir
+
+    _check("STATEDIR '$self->{'args'}->{'statedir'}'",
            "is an acessible directory", "is NOT an acessible directory",
-           sub {-d $_[0] && -r $_[0] && -w $_[0] && -x $_[0]},
+           sub {$_[0] && -d $_[0] && -r $_[0] && -w $_[0] && -x $_[0]},
            $self->{'args'}->{'statedir'});
     _check_parent_dirs($self->{'args'}->{'statedir'});
 
     if ($self->{'args'}->{'device'}) {
+       my $try_connect = 1;
+
         for my $k (keys %{$self->{'props'}}) {
             print "OK client property: $k = $self->{'props'}->{$k}\n";
         }
 
-        _check("PG-ARCHIVEDIR $self->{'props'}->{'pg-archivedir'}",
-               "is a directory", "is NOT a directory",
-               sub {-d $_[0]}, $self->{'props'}->{'pg-archivedir'});
-        _check("PG-ARCHIVEDIR $self->{'props'}->{'pg-archivedir'}",
-               "is readable", "is NOT readable",
-               sub {-r $_[0]}, $self->{'props'}->{'pg-archivedir'});
-        _check("PG-ARCHIVEDIR $self->{'props'}->{'pg-archivedir'}",
-               "is executable", "is NOT executable",
-               sub {-x $_[0]}, $self->{'props'}->{'pg-archivedir'});
-        _check_parent_dirs($self->{'props'}->{'pg-archivedir'});
-        _check("Are both PG-PASSFILE and PG-PASSWORD set?",
-               "No (okay)",
-               "Yes. Please set only one or the other",
-               sub {!($self->{'props'}->{'pg-passfile'} and
-                      $self->{'props'}->{'pg-password'})});
+        if (_check("PG-ARCHIVEDIR property", "is set", "is NOT set",
+               sub { $_[0] }, $self->{'props'}->{'pg-archivedir'})) {
+           _check("PG-ARCHIVEDIR $self->{'props'}->{'pg-archivedir'}",
+                  "is a directory", "is NOT a directory",
+                  sub {-d $_[0]}, $self->{'props'}->{'pg-archivedir'});
+           _check("PG-ARCHIVEDIR $self->{'props'}->{'pg-archivedir'}",
+                  "is readable", "is NOT readable",
+                  sub {-r $_[0]}, $self->{'props'}->{'pg-archivedir'});
+           _check("PG-ARCHIVEDIR $self->{'props'}->{'pg-archivedir'}",
+                  "is executable", "is NOT executable",
+                  sub {-x $_[0]}, $self->{'props'}->{'pg-archivedir'});
+           _check_parent_dirs($self->{'props'}->{'pg-archivedir'});
+       }
+
+       $try_connect &&=
+           _check("Are both PG-PASSFILE and PG-PASSWORD set?",
+                  "No (okay)",
+                  "Yes. Please set only one or the other",
+                  sub {!($self->{'props'}->{'pg-passfile'} and
+                         $self->{'props'}->{'pg-password'})});
+
         if ($self->{'props'}->{'pg-passfile'}) {
-            _check("PG-PASSFILE $self->{'props'}->{'pg-passfile'}",
+           $try_connect &&=
+               _check("PG-PASSFILE $self->{'props'}->{'pg-passfile'}",
                    "has correct permissions", "does not have correct permissions",
                    \&_ok_passfile_perms, $self->{'props'}->{'pg-passfile'});
-            _check_parent_dirs($self->{'props'}->{'pg-passfile'});
+           $try_connect &&=
+               _check_parent_dirs($self->{'props'}->{'pg-passfile'});
         }
-        _check("PSQL-PATH $self->{'props'}->{'psql-path'}",
-               "is executable", "is NOT executable",
-               sub {-x $_[0]}, $self->{'props'}->{'psql-path'});
-        _check("PSQL-PATH $self->{'props'}->{'psql-path'}",
-               "is not a directory (okay)", "is a directory (it shouldn't be)",
-               sub {!(-d $_[0])}, $self->{'props'}->{'psql-path'});
-        _check_parent_dirs($self->{'props'}->{'psql-path'});
-        _check("Connecting to database server", "succeeded", "failed",
-               \&_run_psql_command, $self, '');
+
+        if (_check("PSQL-PATH property", "is set", "is NOT set and psql is not in \$PATH",
+               sub { $_[0] }, $self->{'props'}->{'psql-path'})) {
+           $try_connect &&=
+               _check("PSQL-PATH $self->{'props'}->{'psql-path'}",
+                      "is executable", "is NOT executable",
+                      sub {-x $_[0]}, $self->{'props'}->{'psql-path'});
+           $try_connect &&=
+               _check("PSQL-PATH $self->{'props'}->{'psql-path'}",
+                      "is not a directory (okay)", "is a directory (it shouldn't be)",
+                      sub {!(-d $_[0])}, $self->{'props'}->{'psql-path'});
+           $try_connect &&=
+               _check_parent_dirs($self->{'props'}->{'psql-path'});
+       } else {
+           $try_connect = 0;
+       }
+
+       if ($try_connect) {
+           $try_connect &&=
+               _check("Connecting to database server", "succeeded", "failed",
+                  \&_run_psql_command, $self, '');
+       }
         
-        my $label = "$self->{'label-prefix'}-selfcheck-" . time();
-        if (_check("Call pg_start_backup", "succeeded",
-                   "failed (is another backup running?)",
-                   \&_run_psql_command, $self, "SELECT pg_start_backup('$label')")
-            and _check("Call pg_stop_backup", "succeeded", "failed",
-                       \&_run_psql_command, $self, "SELECT pg_stop_backup()")) {
-
-            _check("Get info from .backup file", "succeeded", "failed",
-                   sub {my ($start, $end) = _get_backup_info($self, $label); $start and $end});
-        }
+       if ($try_connect) {
+           my $label = "$self->{'label-prefix'}-selfcheck-" . time();
+           if (_check("Call pg_start_backup", "succeeded",
+                      "failed (is another backup running?)",
+                      \&_run_psql_command, $self, "SELECT pg_start_backup('$label')")
+               and _check("Call pg_stop_backup", "succeeded", "failed",
+                          \&_run_psql_command, $self, "SELECT pg_stop_backup()")) {
+
+               _check("Get info from .backup file", "succeeded", "failed",
+                      sub {my ($start, $end) = _get_backup_info($self, $label); $start and $end});
+           }
+       }
     }
 }
 
@@ -381,7 +424,7 @@ sub _run_tar_totals {
             $size = $1;
         } else {
            chomp $l;
-           #$self->print_to_server($l, $Amanda::Script_App::ERROR);
+           $self->print_to_server($l, $Amanda::Script_App::ERROR);
            debug("TAR_ERR: $l");
        }
     }
@@ -765,6 +808,7 @@ sub command_restore {
    if ($self->{'args'}->{'level'} > 0) {
        debug("extracting incremental backup to $cur_dir/$_ARCHIVE_DIR_RESTORE");
        $status = system($self->{'args'}->{'gnutar-path'}, '--extract',
+          '--ignore-zeros',
           '--exclude', 'empty-incremental',
            '--directory', $_ARCHIVE_DIR_RESTORE) >> 8;
        (0 == $status) or die("Failed to extract level $self->{'args'}->{'level'} backup (exit status: $status)");
@@ -807,7 +851,7 @@ sub command_validate {
       return $self->default_validate();
    }
 
-   my(@cmd) = ($self->{'args'}->{'gnutar-path'}, "-tf", "-");
+   my(@cmd) = ($self->{'args'}->{'gnutar-path'}, "--ignore-zeros", "-tf", "-");
    debug("cmd:" . join(" ", @cmd));
    my $pid = open3('>&STDIN', '>&STDOUT', '>&STDERR', @cmd) ||
       $self->print_to_server_and_die("Unable to run @cmd",
index 0c947e87c2a36a636fd399968c7100ccdf844f1a..cfd7e427ede362b7ca588a539def534a8f7dec6d 100644 (file)
@@ -1,5 +1,5 @@
 #!@PERL@ 
-# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 use Getopt::Long;
 
 package Amanda::Application::Amraw;
@@ -158,11 +159,6 @@ sub command_backup {
     my $self = shift;
 
     my $level = $self->{level}[0];
-    my $mesgout_fd;
-    open($mesgout_fd, '>&=3') ||
-       $self->print_to_server_and_die("Can't open mesgout_fd: $!",
-                                      $Amanda::Script_App::ERROR);
-    $self->{mesgout} = $mesgout_fd;
 
     if (defined($self->{index})) {
        $self->{'index_out'} = IO::Handle->new_from_fd(4, 'w');
@@ -207,8 +203,8 @@ sub command_backup {
        if ($ksize < 32) {
            $ksize = 32;
        }
-       print $mesgout_fd "sendbackup: size $ksize\n";
-       print $mesgout_fd "sendbackup: end\n";
+       print {$self->{mesgout}} "sendbackup: size $ksize\n";
+       print {$self->{mesgout}} "sendbackup: end\n";
     }
 
     exit 0;
index 368b424b190dd02725acdc58e7d398d7dfcff0c0..f4654bdb413b01f75783bac875be6339d304dfba 100644 (file)
@@ -1,5 +1,5 @@
 #!@PERL@ 
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 use Getopt::Long;
 
 package Amanda::Application::Amsamba;
@@ -222,22 +223,10 @@ sub findpass {
     while ($line = <$amandapass>) {
        chomp $line;
        next if $line =~ /^#/;
-       my ($diskname, $userpasswd, $domain, $extra);
-       ($diskname, $userpasswd)   = Amanda::Util::skip_quoted_string($line);
-       if ($userpasswd) {
-           ($userpasswd, $domain) =
-                               Amanda::Util::skip_quoted_string($userpasswd);
-       }
-       if ($domain) {
-           ($domain, $extra) =
-                               Amanda::Util::skip_quoted_string($domain);
-       }
+       my ($diskname, $userpasswd, $domain, $extra) = Amanda::Util::split_quoted_string_friendly($line);
        if ($extra) {
            debug("Trailling characters ignored in amandapass line");
        }
-       $diskname = Amanda::Util::unquote_string($diskname);
-       $userpasswd = Amanda::Util::unquote_string($userpasswd);
-       $domain = Amanda::Util::unquote_string($domain);
        if (defined $diskname &&
            ($diskname eq '*' ||
             ($self->{unc}==0 && $diskname =~ m,^(//[^/]+)/\*$, && $1 eq $self->{cifshost}) ||
@@ -500,11 +489,6 @@ sub command_backup {
     my $self = shift;
 
     my $level = $self->{level}[0];
-    my $mesgout_fd;
-    open($mesgout_fd, '>&=3') ||
-       $self->print_to_server_and_die("Can't open mesgout_fd: $!",
-                                      $Amanda::Script_App::ERROR);
-    $self->{mesgout} = $mesgout_fd;
 
     $self->parsesharename();
     $self->findpass();
@@ -606,11 +590,11 @@ sub command_backup {
        open($indexout_fd, '>&=4') ||
            $self->print_to_server_and_die("Can't open indexout_fd: $!",
                                           $Amanda::Script_App::ERROR);
-       $self->parse_backup($index, $mesgout_fd, $indexout_fd);
+       $self->parse_backup($index, $self->{mesgout}, $indexout_fd);
        close($indexout_fd);
     }
     else {
-       $self->parse_backup($index_fd, $mesgout_fd, undef);
+       $self->parse_backup($index_fd, $self->{mesgout}, undef);
     }
     close($index);
 
@@ -634,8 +618,8 @@ sub command_backup {
        if ($ksize < 32) {
            $ksize = 32;
        }
-       print $mesgout_fd "sendbackup: size $ksize\n";
-       print $mesgout_fd "sendbackup: end\n";
+       print {$self->{mesgout}} "sendbackup: size $ksize\n";
+       print {$self->{mesgout}} "sendbackup: end\n";
     }
 
     waitpid $pid, 0;
index 2f8b17c26f9f80c23c25fbdeb9398dbd610f4bb1..bcd9988b267e68dd2ff3b3ce5f2a721f45e8fbda 100644 (file)
@@ -124,6 +124,7 @@ static void amstar_validate(application_argument_t *argument);
 static GPtrArray *amstar_build_argv(application_argument_t *argument,
                                int level,
                                int command);
+static int check_device(application_argument_t *argument);
 
 static char *star_path;
 static char *star_tardumps;
@@ -440,6 +441,11 @@ amstar_selfcheck(
        check_file(amandates_file, R_OK|W_OK);
     }
 
+    set_root_privs(1);
+    if (argument->dle.device) {
+       check_dir(argument->dle.device, R_OK);
+    }
+    set_root_privs(0);
 }
 
 static void
@@ -485,6 +491,10 @@ amstar_estimate(
        fprintf(stderr, "ERROR exclude-list not supported for backup\n");
     }
 
+    if (check_device(argument) == 0) {
+       return;
+    }
+
     qdisk = quote_string(argument->dle.disk);
     if (argument->calcsize) {
        char *dirname;
@@ -984,3 +994,39 @@ static GPtrArray *amstar_build_argv(
 
     return(argv_ptr);
 }
+
+static int
+check_device(
+    application_argument_t *argument)
+{
+    char *qdevice;
+    struct stat stat_buf;
+
+    qdevice = quote_string(argument->dle.device);
+    set_root_privs(1);
+    if(!stat(argument->dle.device, &stat_buf)) { 
+       if (!S_ISDIR(stat_buf.st_mode)) {
+           set_root_privs(0);
+           g_fprintf(stderr, _("ERROR %s is not a directory\n"), qdevice);
+           amfree(qdevice);
+           return 0;
+       }
+    } else {
+       set_root_privs(0);
+       g_fprintf(stderr, _("ERROR can not stat %s: %s\n"), qdevice,
+                  strerror(errno));
+       amfree(qdevice);
+       return 0;
+    }
+    if (access(argument->dle.device, R_OK|X_OK) == -1) {
+       set_root_privs(0);
+       g_fprintf(stderr, _("ERROR can not access %s: %s\n"),
+                 argument->dle.device, strerror(errno));
+       amfree(qdevice);
+       return 0;
+    }
+    set_root_privs(0);
+    amfree(qdevice);
+    return 1;
+}
+
index 38ba67856a3c64b05a17753097266cdacc20493e..a2747572a367407b45ed096e52d926c07935fde7 100755 (executable)
@@ -1,5 +1,5 @@
 #!@PERL@
-# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 use Getopt::Long;
 
 package Amanda::Application::Amsuntar;
@@ -226,11 +227,6 @@ sub command_backup {
    my $self = shift;
 
    $self->validate_inexclude();
-   my $mesgout_fd;
-   open($mesgout_fd, '>&=3') ||
-      $self->print_to_server_and_die("Can't open mesgout_fd: $!",
-                                    $Amanda::Script_App::ERROR);
-   $self->{mesgout} = $mesgout_fd;
 
    my(@cmd) = $self->build_command();
    my(@cmdtc) = $self->{teecount};
@@ -258,11 +254,11 @@ sub command_backup {
       open($indexout_fd, '>&=4') ||
       $self->print_to_server_and_die("Can't open indexout_fd: $!",
                                     $Amanda::Script_App::ERROR);
-      $result = $self->parse_backup($index_fd, $mesgout_fd, $indexout_fd);
+      $result = $self->parse_backup($index_fd, $self->{mesgout}, $indexout_fd);
       close($indexout_fd);
    }
    else {
-      $result = $self->parse_backup($index_fd, $mesgout_fd, undef);
+      $result = $self->parse_backup($index_fd, $self->{mesgout}, undef);
    }
    close($index_fd);
    my $size = <$errtc>;
@@ -276,12 +272,13 @@ sub command_backup {
 
    if ($result == 1) {
        debug("$self->{suntar} returned error" );
-       print $mesgout_fd "sendbackup: error [$self->{suntar} returned error]\n";
+       $self->print_to_server("$self->{suntar} returned error", 
+                             $Amanda::Script_App::ERROR);
    }
 
    my($ksize) = int ($size/1024);
-   print $mesgout_fd "sendbackup: size $ksize\n";
-   print $mesgout_fd "sendbackup: end\n";
+   print {$self->{mesgout}} "sendbackup: size $ksize\n";
+   print {$self->{mesgout}} "sendbackup: end\n";
    debug("sendbackup: size $ksize "); 
 
    exit 0;
index 63bb0bcc073f727fecd0664687ccb382e3e97de5..9d740cb8a7d4a0c4b34b4c565a6c2a85763da67c 100644 (file)
@@ -1,5 +1,5 @@
 #!@PERL@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 use Getopt::Long;
 
 package Amanda::Application::Amzfs_sendrecv;
@@ -168,12 +169,6 @@ sub output_size {
 sub command_backup {
     my $self = shift;
 
-    my $mesgout_fd;
-    open($mesgout_fd, '>&=3') ||
-       $self->print_to_server_and_die("Can't open mesgout_fd: $!",
-                                      $Amanda::Script_App::ERROR);
-    $self->{mesgout} = $mesgout_fd;
-
     if ($#{$self->{include_list}} >= 0) {
        $self->print_to_server("include-list not supported for backup",
                               $Amanda::Script_App::ERROR);
@@ -224,8 +219,8 @@ sub command_backup {
     my($ksize) = int ($size/1024);
     $ksize=32 if ($ksize<32);
 
-    print $mesgout_fd "sendbackup: size $ksize\n";
-    print $mesgout_fd "sendbackup: end\n";
+    print {$self->{mesgout}} "sendbackup: size $ksize\n";
+    print {$self->{mesgout}} "sendbackup: end\n";
 
     # destroy all snapshot of this level and higher
     $self->zfs_purge_snapshot($level, 9);
index 3872dd49ab50e57123d18229d8a8cf3fc1610bbf..676e60e57b4ad9858cb95dad4db7d1f49153aead 100644 (file)
@@ -1,5 +1,5 @@
 #!@PERL@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -26,6 +26,7 @@
 #
 use lib '@amperldir@';
 use strict;
+use warnings;
 use Getopt::Long;
 
 package Amanda::Script::Amzfs_snapshot;
index bf15980efd9a6367e1aa044d459c1bd9fbd2aac3..07694ac7b287d8593a05477f2a3896b9a05d3493 100644 (file)
@@ -1,5 +1,5 @@
 #!@PERL@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 use Getopt::Long;
 
 package Amanda::Script::Script_email;
index abf0a126f2ad3495e2ca7d09a02e0ae24369243c..e36992d451c115ad28776af6464f1fce757cadf1 100644 (file)
 include $(top_srcdir)/config/automake/vars.am
 include $(top_srcdir)/config/automake/scripts.am
 include $(top_srcdir)/config/automake/installperms.am
-include $(top_srcdir)/config/automake/precompile.am
-
-INCLUDES =     -I$(top_builddir)/common-src \
-               -I$(top_srcdir)/common-src   \
-               -I$(top_srcdir)/device-src   \
-               -I$(top_srcdir)/gnulib
-
-AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
-
-LINT=$(AMLINT)
-LINTFLAGS=$(AMLINTFLAGS)
-
-if WANT_CHG_SCSI_CHIO
-CHIO_SCSI = chg-scsi-chio
-endif
-
-if WANT_CHG_SCSI
-CHG_SCSI = chg-scsi
-endif
-
-amlibexec_PROGRAMS =   $(CHG_SCSI)
-EXTRA_PROGRAMS =       $(CHIO_SCSI)
-
-SCRIPTS_PERL = \
-               chg-chio \
-               chg-iomega \
-               chg-rth
 
 SCRIPTS_SHELL = \
                chg-manual \
                chg-multi \
-               chg-mtx \
-               chg-chs \
                chg-zd-mtx \
-               chg-rait \
-               chg-null \
-               chg-juke \
-               chg-mcutil \
                chg-disk
 
 SCRIPTS_INCLUDE = \
                chg-lib.sh
 EXTRA_DIST += chg-lib.sh.in
 
-amlibexec_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL)
+amlibexec_SCRIPTS = $(SCRIPTS_SHELL)
 amlibexec_DATA = $(SCRIPTS_INCLUDE)
-
-###
-# Because libamanda includes routines (e.g. regex) provided by some system
-# libraries, and because of the way libtool sets up the command line, we
-# need to list libamanda twice here, first to override the system library
-# routines, and second to pick up any references in the other libraries.
-###
-
-LDADD = ../common-src/libamanda.la \
-       ../common-src/libamanda.la \
-       ../device-src/libamdevice.la \
-       ../gnulib/libgnu.la \
-       $(READLINE_LIBS)
-
-chg_scsi_CSRC = chg-scsi.c scsi-changer-driver.c sense.c 
-if WANT_SCSI_AIX
-chg_scsi_CSRC += scsi-aix.c
-endif
-if WANT_SCSI_HPUX_NEW
-chg_scsi_CSRC += scsi-hpux_new.c
-endif
-if WANT_SCSI_IRIX
-chg_scsi_CSRC += scsi-irix.c
-endif
-if WANT_SCSI_LINUX
-chg_scsi_CSRC += scsi-linux.c
-endif
-if WANT_SCSI_SOLARIS
-chg_scsi_CSRC += scsi-solaris.c
-endif
-if WANT_SCSI_BSD
-chg_scsi_CSRC += scsi-bsd.c
-endif
-if WANT_SCSI_CAM
-chg_scsi_CSRC += scsi-cam.c
-endif
-
-chg_scsi_SOURCES = libscsi.h scsi-defs.h $(chg_scsi_CSRC)
-
-chg_scsi_chio_CSRC = chg-scsi-chio.c
-if WANT_SCSI_HPUX
-chg_scsi_chio_CSRC += scsi-hpux.c
-endif
-if WANT_SCSI_CHIO
-chg_scsi_chio_CSRC += scsi-chio.c
-endif
-chg_scsi_chio_SOURCES = libscsi.h $(chg_scsi_chio_CSRC)
-
-EXTRA_DIST += scsi-proto.c
-
-INSTALLPERMS_exec = \
-       chown=amanda \
-       dest=$(sbindir) $(sbin_PROGRAMS) \
-       dest=$(amlibexecdir) $(amlibexec_PROGRAMS) 
-
-INSTALLPERMS_data = \
-       chown=amanda \
-       dest=$(sbindir) $(sbin_SCRIPTS) \
-       dest=$(amlibexecdir) $(amlibexec_SCRIPTS) $(amlibexec_DATA)
-
-lint:
-       @ for p in $(amlibexec_PROGRAMS) $(EXTRA_PROGRAMS); do                  \
-               p=`basename $$p $(EXEEXT)`;                                     \
-               f="$$p.c $(libamandad_la_SOURCES)";                             \
-               (cd ../common-src; make listlibsrc);                            \
-               f="$$f "`cat ../common-src/listlibsrc.output`;                  \
-               (cd ../server-src; make listlibsrc);                            \
-               f="$$f "`cat ../server-src/listlibsrc.output`;                  \
-               echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
-                   $(INCLUDES) $$f;                                            \
-               if [ $$? -ne 0 ]; then                                          \
-                   exit 1;                                                     \
-               fi;                                                             \
-       done;                                                                   \
-        exit 0
index 00b225e0b4ed2788945e4ed3592f6f507c50a222..b1fe36bcaf91a53c841d1efbaad44b9ffba26241 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
 # time.  Note that files which have no special permissions requirements do not appear 
 # in this file at all, due to limitations of Automake.
 
-# vim:ft=automake
-
-
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
@@ -182,21 +181,9 @@ build_triplet = @build@
 host_triplet = @host@
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
        $(top_srcdir)/config/automake/installperms.am \
-       $(top_srcdir)/config/automake/precompile.am \
        $(top_srcdir)/config/automake/scripts.am \
        $(top_srcdir)/config/automake/vars.am
 @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh)
-amlibexec_PROGRAMS = $(am__EXEEXT_2)
-EXTRA_PROGRAMS = $(am__EXEEXT_1)
-@WANT_SCSI_AIX_TRUE@am__append_2 = scsi-aix.c
-@WANT_SCSI_HPUX_NEW_TRUE@am__append_3 = scsi-hpux_new.c
-@WANT_SCSI_IRIX_TRUE@am__append_4 = scsi-irix.c
-@WANT_SCSI_LINUX_TRUE@am__append_5 = scsi-linux.c
-@WANT_SCSI_SOLARIS_TRUE@am__append_6 = scsi-solaris.c
-@WANT_SCSI_BSD_TRUE@am__append_7 = scsi-bsd.c
-@WANT_SCSI_CAM_TRUE@am__append_8 = scsi-cam.c
-@WANT_SCSI_HPUX_TRUE@am__append_9 = scsi-hpux.c
-@WANT_SCSI_CHIO_TRUE@am__append_10 = scsi-chio.c
 subdir = changer-src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps =  \
@@ -213,7 +200,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -241,7 +227,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -254,10 +239,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -271,7 +260,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -284,10 +275,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -299,21 +293,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -342,44 +340,6 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-@WANT_CHG_SCSI_CHIO_TRUE@am__EXEEXT_1 = chg-scsi-chio$(EXEEXT)
-@WANT_CHG_SCSI_TRUE@am__EXEEXT_2 = chg-scsi$(EXEEXT)
-am__installdirs = "$(DESTDIR)$(amlibexecdir)" \
-       "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)"
-PROGRAMS = $(amlibexec_PROGRAMS)
-am__chg_scsi_SOURCES_DIST = libscsi.h scsi-defs.h chg-scsi.c \
-       scsi-changer-driver.c sense.c scsi-aix.c scsi-hpux_new.c \
-       scsi-irix.c scsi-linux.c scsi-solaris.c scsi-bsd.c scsi-cam.c
-@WANT_SCSI_AIX_TRUE@am__objects_1 = scsi-aix.$(OBJEXT)
-@WANT_SCSI_HPUX_NEW_TRUE@am__objects_2 = scsi-hpux_new.$(OBJEXT)
-@WANT_SCSI_IRIX_TRUE@am__objects_3 = scsi-irix.$(OBJEXT)
-@WANT_SCSI_LINUX_TRUE@am__objects_4 = scsi-linux.$(OBJEXT)
-@WANT_SCSI_SOLARIS_TRUE@am__objects_5 = scsi-solaris.$(OBJEXT)
-@WANT_SCSI_BSD_TRUE@am__objects_6 = scsi-bsd.$(OBJEXT)
-@WANT_SCSI_CAM_TRUE@am__objects_7 = scsi-cam.$(OBJEXT)
-am__objects_8 = chg-scsi.$(OBJEXT) scsi-changer-driver.$(OBJEXT) \
-       sense.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
-       $(am__objects_3) $(am__objects_4) $(am__objects_5) \
-       $(am__objects_6) $(am__objects_7)
-am_chg_scsi_OBJECTS = $(am__objects_8)
-chg_scsi_OBJECTS = $(am_chg_scsi_OBJECTS)
-chg_scsi_LDADD = $(LDADD)
-am__DEPENDENCIES_1 =
-chg_scsi_DEPENDENCIES = ../common-src/libamanda.la \
-       ../common-src/libamanda.la ../device-src/libamdevice.la \
-       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
-am__chg_scsi_chio_SOURCES_DIST = libscsi.h chg-scsi-chio.c scsi-hpux.c \
-       scsi-chio.c
-@WANT_SCSI_HPUX_TRUE@am__objects_9 = scsi-hpux.$(OBJEXT)
-@WANT_SCSI_CHIO_TRUE@am__objects_10 = scsi-chio.$(OBJEXT)
-am__objects_11 = chg-scsi-chio.$(OBJEXT) $(am__objects_9) \
-       $(am__objects_10)
-am_chg_scsi_chio_OBJECTS = $(am__objects_11)
-chg_scsi_chio_OBJECTS = $(am_chg_scsi_chio_OBJECTS)
-chg_scsi_chio_LDADD = $(LDADD)
-chg_scsi_chio_DEPENDENCIES = ../common-src/libamanda.la \
-       ../common-src/libamanda.la ../device-src/libamdevice.la \
-       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -401,26 +361,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(amlibexecdir)" \
+       "$(DESTDIR)$(amlibexecdir)"
 SCRIPTS = $(amlibexec_SCRIPTS)
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
-depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-       $(LDFLAGS) -o $@
-SOURCES = $(chg_scsi_SOURCES) $(chg_scsi_chio_SOURCES)
-DIST_SOURCES = $(am__chg_scsi_SOURCES_DIST) \
-       $(am__chg_scsi_chio_SOURCES_DIST)
+SOURCES =
+DIST_SOURCES =
 DATA = $(amlibexec_DATA)
-ETAGS = etags
-CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AIX_BACKUP = @AIX_BACKUP@
@@ -443,7 +389,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -463,10 +409,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -522,78 +465,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -604,12 +602,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -624,17 +651,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -643,60 +674,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -704,13 +794,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -719,9 +815,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -757,7 +856,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -766,7 +864,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -774,19 +871,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -812,47 +932,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -860,6 +1036,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -882,19 +1059,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -904,13 +1083,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -954,6 +1130,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -984,7 +1161,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUFFIXES = 
-EXTRA_DIST = chg-lib.sh.in scsi-proto.c
+EXTRA_DIST = chg-lib.sh.in
 BUILT_SOURCES = 
 MOSTLYCLEANFILES = 
 
@@ -1018,75 +1195,36 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
-INCLUDES = -I$(top_builddir)/common-src \
-               -I$(top_srcdir)/common-src   \
-               -I$(top_srcdir)/device-src   \
-               -I$(top_srcdir)/gnulib
-
-AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
-LINT = $(AMLINT)
-LINTFLAGS = $(AMLINTFLAGS)
-@WANT_CHG_SCSI_CHIO_TRUE@CHIO_SCSI = chg-scsi-chio
-@WANT_CHG_SCSI_TRUE@CHG_SCSI = chg-scsi
-SCRIPTS_PERL = \
-               chg-chio \
-               chg-iomega \
-               chg-rth
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
 
 SCRIPTS_SHELL = \
                chg-manual \
                chg-multi \
-               chg-mtx \
-               chg-chs \
                chg-zd-mtx \
-               chg-rait \
-               chg-null \
-               chg-juke \
-               chg-mcutil \
                chg-disk
 
 SCRIPTS_INCLUDE = \
                chg-lib.sh
 
-amlibexec_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL)
+amlibexec_SCRIPTS = $(SCRIPTS_SHELL)
 amlibexec_DATA = $(SCRIPTS_INCLUDE)
-
-###
-# Because libamanda includes routines (e.g. regex) provided by some system
-# libraries, and because of the way libtool sets up the command line, we
-# need to list libamanda twice here, first to override the system library
-# routines, and second to pick up any references in the other libraries.
-###
-LDADD = ../common-src/libamanda.la \
-       ../common-src/libamanda.la \
-       ../device-src/libamdevice.la \
-       ../gnulib/libgnu.la \
-       $(READLINE_LIBS)
-
-chg_scsi_CSRC = chg-scsi.c scsi-changer-driver.c sense.c \
-       $(am__append_2) $(am__append_3) $(am__append_4) \
-       $(am__append_5) $(am__append_6) $(am__append_7) \
-       $(am__append_8)
-chg_scsi_SOURCES = libscsi.h scsi-defs.h $(chg_scsi_CSRC)
-chg_scsi_chio_CSRC = chg-scsi-chio.c $(am__append_9) $(am__append_10)
-chg_scsi_chio_SOURCES = libscsi.h $(chg_scsi_chio_CSRC)
-INSTALLPERMS_exec = \
-       chown=amanda \
-       dest=$(sbindir) $(sbin_PROGRAMS) \
-       dest=$(amlibexecdir) $(amlibexec_PROGRAMS) 
-
-INSTALLPERMS_data = \
-       chown=amanda \
-       dest=$(sbindir) $(sbin_SCRIPTS) \
-       dest=$(amlibexecdir) $(amlibexec_SCRIPTS) $(amlibexec_DATA)
-
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
+.SUFFIXES: 
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -1116,55 +1254,6 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS)
-       @$(NORMAL_INSTALL)
-       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
-       @list='$(amlibexec_PROGRAMS)'; test -n "$(amlibexecdir)" || list=; \
-       for p in $$list; do echo "$$p $$p"; done | \
-       sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p || test -f $$p1; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
-       done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-       sed 'N;N;N;s,\n, ,g' | \
-       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-           if ($$2 == $$4) files[d] = files[d] " " $$1; \
-           else { print "f", $$3 "/" $$4, $$1; } } \
-         END { for (d in files) print "f", d, files[d] }' | \
-       while read type dir files; do \
-           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-           test -z "$$files" || { \
-           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(amlibexecdir)$$dir'"; \
-           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(amlibexecdir)$$dir" || exit $$?; \
-           } \
-       ; done
-
-uninstall-amlibexecPROGRAMS:
-       @$(NORMAL_UNINSTALL)
-       @list='$(amlibexec_PROGRAMS)'; test -n "$(amlibexecdir)" || list=; \
-       files=`for p in $$list; do echo "$$p"; done | \
-         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
-       test -n "$$list" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(amlibexecdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(amlibexecdir)" && rm -f $$files
-
-clean-amlibexecPROGRAMS:
-       @list='$(amlibexec_PROGRAMS)'; test -n "$$list" || exit 0; \
-       echo " rm -f" $$list; \
-       rm -f $$list || exit $$?; \
-       test -n "$(EXEEXT)" || exit 0; \
-       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-       echo " rm -f" $$list; \
-       rm -f $$list
-chg-scsi$(EXEEXT): $(chg_scsi_OBJECTS) $(chg_scsi_DEPENDENCIES) 
-       @rm -f chg-scsi$(EXEEXT)
-       $(LINK) $(chg_scsi_OBJECTS) $(chg_scsi_LDADD) $(LIBS)
-chg-scsi-chio$(EXEEXT): $(chg_scsi_chio_OBJECTS) $(chg_scsi_chio_DEPENDENCIES) 
-       @rm -f chg-scsi-chio$(EXEEXT)
-       $(LINK) $(chg_scsi_chio_OBJECTS) $(chg_scsi_chio_LDADD) $(LIBS)
 install-amlibexecSCRIPTS: $(amlibexec_SCRIPTS)
        @$(NORMAL_INSTALL)
        test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
@@ -1200,47 +1289,6 @@ uninstall-amlibexecSCRIPTS:
        echo " ( cd '$(DESTDIR)$(amlibexecdir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(amlibexecdir)" && rm -f $$files
 
-mostlyclean-compile:
-       -rm -f *.$(OBJEXT)
-
-distclean-compile:
-       -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chg-scsi-chio.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chg-scsi.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsi-aix.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsi-bsd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsi-cam.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsi-changer-driver.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsi-chio.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsi-hpux.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsi-hpux_new.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsi-irix.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsi-linux.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scsi-solaris.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sense.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
-
 mostlyclean-libtool:
        -rm -f *.lo
 
@@ -1266,58 +1314,12 @@ uninstall-amlibexecDATA:
        test -n "$$files" || exit 0; \
        echo " ( cd '$(DESTDIR)$(amlibexecdir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(amlibexecdir)" && rm -f $$files
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       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; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
 tags: TAGS
+TAGS:
 
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       set x; \
-       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; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       shift; \
-       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-         test -n "$$unique" || unique=$$empty_fix; \
-         if test $$# -gt 0; then \
-           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-             "$$@" $$unique; \
-         else \
-           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-             $$unique; \
-         fi; \
-       fi
 ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       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; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       test -z "$(CTAGS_ARGS)$$unique" \
-         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-            $$unique
-
-GTAGS:
-       here=`$(am__cd) $(top_builddir) && pwd` \
-         && $(am__cd) $(top_srcdir) \
-         && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+CTAGS:
+
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -1352,13 +1354,14 @@ distdir: $(DISTFILES)
        $(MAKE) $(AM_MAKEFLAGS) \
          top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-hook
+@SYNTAX_CHECKS_FALSE@check-local:
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-local
 check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA)
+all-am: Makefile $(SCRIPTS) $(DATA)
 installdirs:
-       for dir in "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)"; do \
+       for dir in "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: $(BUILT_SOURCES)
@@ -1394,14 +1397,11 @@ maintainer-clean-generic:
        -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 clean: clean-am
 
-clean-am: clean-amlibexecPROGRAMS clean-generic clean-libtool \
-       mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
        -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-tags
+distclean-am: clean-am distclean-generic
 
 dvi: dvi-am
 
@@ -1422,8 +1422,7 @@ install-dvi: install-dvi-am
 
 install-dvi-am:
 
-install-exec-am: install-amlibexecDATA install-amlibexecPROGRAMS \
-       install-amlibexecSCRIPTS
+install-exec-am: install-amlibexecDATA install-amlibexecSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 install-html: install-html-am
@@ -1444,17 +1443,15 @@ install-ps: install-ps-am
 
 install-ps-am:
 
-installcheck-am: installcheck-local
+installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-       mostlyclean-libtool
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -1464,39 +1461,37 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-amlibexecDATA uninstall-amlibexecPROGRAMS \
-       uninstall-amlibexecSCRIPTS
+uninstall-am: uninstall-amlibexecDATA uninstall-amlibexecSCRIPTS
 
 .MAKE: all check check-am install install-am install-data-am \
        install-exec-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
-       clean-amlibexecPROGRAMS clean-generic clean-libtool ctags \
-       dist-hook distclean distclean-compile distclean-generic \
-       distclean-libtool distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-amlibexecDATA \
-       install-amlibexecPROGRAMS install-amlibexecSCRIPTS \
-       install-data install-data-am install-data-hook install-dvi \
-       install-dvi-am install-exec install-exec-am install-exec-hook \
-       install-html install-html-am install-info install-info-am \
-       install-man install-pdf install-pdf-am install-ps \
-       install-ps-am install-strip installcheck installcheck-am \
-       installcheck-local installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-amlibexecDATA \
-       uninstall-amlibexecPROGRAMS uninstall-amlibexecSCRIPTS
+.PHONY: all all-am check check-am check-local clean clean-generic \
+       clean-libtool dist-hook distclean distclean-generic \
+       distclean-libtool distdir dvi dvi-am html html-am info info-am \
+       install install-am install-amlibexecDATA \
+       install-amlibexecSCRIPTS install-data install-data-am \
+       install-data-hook install-dvi install-dvi-am install-exec \
+       install-exec-am install-exec-hook install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+       uninstall-amlibexecDATA uninstall-amlibexecSCRIPTS
 
 
 # Perl
 %: %.pl $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          rm $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  fi
+@SYNTAX_CHECKS_TRUE@   @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+@SYNTAX_CHECKS_TRUE@           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
+@SYNTAX_CHECKS_TRUE@           rm $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@   else \
+@SYNTAX_CHECKS_TRUE@           echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
+@SYNTAX_CHECKS_TRUE@   fi
 
 %.pl: %.pl.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
@@ -1520,33 +1515,22 @@ uninstall-am: uninstall-amlibexecDATA uninstall-amlibexecPROGRAMS \
 %.awk: %.awk.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
 
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
 check-perl: $(SCRIPTS_PERL)
        @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
            test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-           if test -n "$(PERL)"; then \
-                   for perlobj in $$SCRIPTS_PERL; do \
-                           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
-                           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
-                           rm $$perlobj.nouselib; \
-                   done; \
-           fi \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
        fi
-check-local: check-perl
+@SYNTAX_CHECKS_TRUE@check-local: check-perl
 
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
-       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
-       if test x"$(SKIP_CHECKS)" = x"" && \
-           test -n "$(PERL)"; then \
-               for perlobj in $$SCRIPTS_PERL; do \
-                       $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
-               done; \
-       fi
-installcheck-local: installcheck-perl
-
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
 check-shell: $(SCRIPTS_SHELL)
        @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
@@ -1564,7 +1548,7 @@ check-shell: $(SCRIPTS_SHELL)
                        echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
        fi
-check-local: check-shell
+@SYNTAX_CHECKS_TRUE@check-local: check-shell
 
 # make sure that the sources for all shell and perl scripts get included
 # in the distribution
@@ -1604,29 +1588,12 @@ dist-hook: dist-scripts
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
@@ -1636,33 +1603,6 @@ install-data-hook: installperms-data
 @WANT_INSTALLPERMS_FALSE@installperms-init:
 @WANT_INSTALLPERMS_FALSE@      rm -f "$(installperms_sh)"
 
-# A rule to make precompiler output from C files.  This is not used during
-# ordinary builds, but but can very useful in debugging problems on strange
-# architectures.  With this rule, we can ask users to 'make foo.i' and send
-# the result to us.
-#
-# It touches some automake internals ($COMPILE), but since it's not
-# build-critical, that's OK.
-%.i : %.c
-       $(COMPILE) -E -o $@ $<
-
-lint:
-       @ for p in $(amlibexec_PROGRAMS) $(EXTRA_PROGRAMS); do                  \
-               p=`basename $$p $(EXEEXT)`;                                     \
-               f="$$p.c $(libamandad_la_SOURCES)";                             \
-               (cd ../common-src; make listlibsrc);                            \
-               f="$$f "`cat ../common-src/listlibsrc.output`;                  \
-               (cd ../server-src; make listlibsrc);                            \
-               f="$$f "`cat ../server-src/listlibsrc.output`;                  \
-               echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
-                   $(INCLUDES) $$f;                                            \
-               if [ $$? -ne 0 ]; then                                          \
-                   exit 1;                                                     \
-               fi;                                                             \
-       done;                                                                   \
-        exit 0
-
 # 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.
 .NOEXPORT:
diff --git a/changer-src/chg-chio.pl b/changer-src/chg-chio.pl
deleted file mode 100644 (file)
index e97ae9a..0000000
+++ /dev/null
@@ -1,482 +0,0 @@
-#! @PERL@ -w
-
-# Catch for sh/csh on systems without #! ability.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-        & eval 'exec @PERL@ -S $0 $argv:q'
-                if 0;
-
-# 
-# This changer script controls tape libraries on operating systems that have a
-# chgio program
-#      DSL 7000 on FreeBSD is an example
-#
-# The changer being used is a n tape juke, that can be used with 1, n-1 or n
-# tapes in the juke. The special slot is slot n. The script does not
-# make assumptions about the number of slots, except that the special slot
-# is the highest number. The slot is special in the sense that it contains the
-# the only tape if the juke contains 1 tape and contains no tape if the juke
-# contains n-1 tapes. See getCurrentTape.
-#
-# Furthermore, the script uses drive 0 and assumes that the device is able to
-# figure itself how to move a type from slot m to drive 0 if asked to do so and
-# multiple pickers are present.
-#
-# The numbering of the slots is by the way from 1 to n with slots. The chio
-# program returns the slot numbers numbered from 0 to n-1 however.
-# 
-# This script is built up out of bits and pieces of the other scripts
-# and no credits are claimed. Most notably the chg-rth.pl script was used. That
-# script was written by Erik Frederick, <edf@tyrell.mc.duke.edu>.
-# 
-# Permission to freely use and distribute is granted (by me and was granted by
-# the original authors).
-#
-# Nick Hibma - nick.hibma@jrc.it
-#
-
-require 5.001;
-
-($progname = $0) =~ s#/.*/##;
-
-use English;
-use Getopt::Long;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-$| = 1;
-
-if (-d "@AMANDA_DBGDIR@") {
-       $logfile = "@AMANDA_DBGDIR@/changer.debug";
-} else {
-       $logfile = "/dev/null";
-}
-die "$progname: cannot open $logfile: $ERRNO\n"
-       unless (open (LOG, ">> $logfile"));
-
-#
-# get the information from the configuration file
-#
-
-$prefix="@prefix@";
-$prefix=$prefix;               # avoid warnings about possible typo
-$exec_prefix="@exec_prefix@";
-$exec_prefix=$exec_prefix;     # Ditto
-$sbindir="@sbindir@";
-chomp ($tapeDevice = `$sbindir/amgetconf tapedev 2>&1`);
-die "tapedev not found in amanda.conf"
-       if !$tapeDevice or $tapeDevice eq "" or
-           $tapeDevice =~ m/no such parameter/;
-chomp ($changerDevice = `$sbindir/amgetconf changerdev 2>&1`);
-chomp $changerDevice;
-die "changerdev not found in amanda.conf"
-       if !$changerDevice or $changerDevice eq "" or
-           $changerDevice =~ m/no such parameter/;
-
-#
-# Initialise a few global variables
-#
-
-@slots = ();
-@drives = ();
-$max_slot = 0;
-$max_drive = 0;
-$nr_tapes = 0;
-
-@dow = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
-@moy = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
-       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
-
-sub do_time {
-       my (@t);
-       my ($r);
-
-       ###
-       # Get the local time for the value.
-       ###
-
-       @t = localtime (time ());
-
-       ###
-       # Return the result.
-       ###
-
-       $r = sprintf "%s %s %2d %2d:%02d:%02d %4d",
-         $dow[$t[6]],
-         $moy[$t[4]],
-         $t[3],
-         $t[2], $t[1], $t[0],
-         1900 + $t[5];
-
-       return $r;
-}
-
-sub getCurrentTape {
-       print LOG &do_time(), ": enter: getCurrentTape\n";
-
-       #
-       # Determines the slot number for the tape that is currently in the
-       # drive. getTapeParams and getTapeStatus should have been called.
-       # If there is no tape in the drive, no current tape, 0 is returned.
-       #
-
-       my($slot, $i);
-
-       if ( !$drives[0] ) {            # drive empty
-               $i = 0;
-       } elsif ( $nr_tapes == 1 ) {    # one tape -> comes from slot max_slot
-               $i = $max_slot;
-       } else {                        # find first empty slot
-               $i = 0;
-               while ( $i < $#slots and $slots[$i] ) {
-                       $i++
-               }
-               $i++;
-       }
-
-       print LOG &do_time(), ": leave: getCurrentTape: $i\n";
-       return $i;
-}
-
-sub getTapeStatus {
-       print LOG &do_time(), ": enter: getTapeStatus\n";
-
-       #
-       # Sets $nr_tapes, @slots, @drives, $current_tape
-       #
-
-       my($type,$num,$status);
-
-       print LOG &do_time(), ": running: @CHIO@ -f $changerDevice status\n";
-       if ( !(open(FH,"@CHIO@ -f $changerDevice status|")) ) {
-               print "$progname: '@CHIO@ -f $changerDevice status' failed, $!\n";
-               exit(2);
-       }
-
-       #
-       # This routine requires the format of the output of 'chio status' to 
-       # be as follows:
-       #   picker 0: 
-       #   slot 0: <ACCESS>
-       #   slot 1: <ACCESS,FULL>
-       #   slot 2: <ACCESS,FULL>
-       #   (etc.)
-       #   drive 0: <ACCESS,FULL>
-
-
-       @slots=();
-       @drives=();
-
-       while( defined ($line = <FH>) ) {
-               chomp( $line );
-               print LOG &do_time(), ": $line\n";
-               next unless $line =~ m/(\w+)\s+(\d+):\s*<([^>]+)>/;
-               ($type,$num,$status) = ($1,$2,$3);
-               if ( $type =~ m/slot/i ) {
-                       $slots[$num] = ( $status =~ m/full/i ) ? 1 : 0;
-                       if ($slots[ $num ]) { $nr_tapes++ }
-               } elsif ( $type =~ m/drive/i ) {
-                       $drives[$num] = 0;
-                       if (  $status =~ m/full/i ) {
-                               $drives[$num] = 1;
-                               $nr_tapes++;
-                       }
-               } else {
-                       # ignore 'picker', empty ones, etc...
-               }
-       }
-       close(FH);
-
-       if ( $nr_tapes == 0 ) {
-               print "$progname: No tapes in changer!\n";
-               exit(2);
-       }
-
-       $currentTape = &getCurrentTape(); 
-
-       print LOG &do_time(), ": leave: getTapeStatus: $nr_tapes\n";
-       return($nr_tapes);
-}
-
-sub getTapeParams {
-       print LOG &do_time(), ": enter: getTapeParams\n";
-  
-       #
-       # Requests information on the number of slots, pickers and drives
-       # from the changer.
-       #
-
-       my($max_slot,$max_drive,$max_picker);
-  
-       print LOG &do_time(), ": running: @CHIO@ -f $changerDevice params\n";
-       if ( !open(FH,"@CHIO@ -f $changerDevice params|") ) {
-               print "$progname: '@CHIO@ -f $changerDevice params' failed, $!\n";
-               exit(2);
-       }
-  
-       #
-       # the format of the output of 'chio params' should be
-       #  /dev/ch0: 8 slots, 1 drive, 1 picker
-       #  /dev/ch0: current picker: 0
-       #
-
-       $max_slot = 0;
-       $max_picker = -1;
-       $max_drive = 0;
-
-       while( defined ($line = <FH>) ) {
-               chomp $line;
-               print LOG &do_time(), ": $line\n";
-               $max_slot       = $1 if $line =~ m/(\d+) slot/i;
-               $max_drive      = $1 if $line =~ m/(\d+) drive/i;
-               $max_picker     = $1 if $line =~ m/(\d+) picker/i;
-
-       }
-       close(FH);
-       if ( $max_drive == 0 or $max_picker == -1 ) {
-               print "$progname: No drive or picker ? ($max_drive/$max_picker)\n";
-               exit(2);
-       }
-
-       print LOG &do_time(), ": leave: getTapeParams: $max_slot, $max_drive, $max_picker\n";
-       return ($max_slot, $max_drive, $max_picker);
-}
-
-sub testTape {
-       my($tape) = @_;
-
-       #
-       # Check a few parameters to avoid the most serious problems
-       #
-
-       return
-               if $currentTape == $tape;
-
-       if( $slots[$tape-1] == 0 ) {
-               print "<none> $progname: no tape in slot requested\n";
-               exit(1);
-       }
-       if( $tape > $max_slot ) {
-               print $tape," $progname: requested a tape > $max_slot\n";
-               exit(2);
-       }
-       if( $tape < 1 ) {
-               print $tape," $progname: requested a tape < 1\n";
-               exit(2);
-       }
-       return;
-}
-
-sub Load {
-       my($tape) = @_;
-       print LOG &do_time(), ": enter: Load: $tape\n";
-
-       #
-       # Load tape $tape into drive 0
-       #
-
-       print LOG &do_time(), ": running: @CHIO@ -f $changerDevice move slot ", $tape - 1, " drive 0\n";
-       if ( system("@CHIO@ -f $changerDevice move slot ".($tape-1)." drive 0") ) {
-               print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape into drive 0\n";
-               exit(2);
-       }
-
-       # wait for tape to load
-       $count = 1800;
-       while ( $count > 0 &&
-               system("$MT $MTF $tapeDevice status > /dev/null 2>&1" ) ) {
-               print LOG &do_time(), ": waiting for tape to load\n";
-               sleep 30;
-               $count -= 30;
-       }
-
-       print LOG &do_time(), ": leave: Load\n";
-}
-
-sub Unload {
-       my($tape) = @_;
-       print LOG &do_time(), ": enter: Unload: $tape\n";
-
-       #
-       # Unload the tape from drive 0 and put it into the slot specified by
-       # $tape.
-       #
-
-       #
-       # Ecrix AutoPAK devices (based on the Spectra Logics 215 changer)
-       # can lock up if you try to move a tape from a drive to an open slot
-       # without first rewinding and ejecting the tape.  This appears to
-       # occur when the operation times out and the ch driver sends a device
-       # or bus reset. Ecrix claims this is about to be fixed with a new
-       # firmware rev but for now it's safest to just explicitly eject
-       # the tape before moving the cartridge.
-       #
-       if ( system ("$MT $MTF $tapeDevice offline") ) {
-               print "$progname: Warning, failed to eject the tape with '$MT $MTF $tapeDevice offline'\n";
-               # NB: not fatal; let chio try it's thing
-       }
-
-       if ( system("@CHIO@ -f $changerDevice move drive 0 slot ".($tape-1)." ") ) {
-               print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape from drive 0\n";
-               exit(2);
-       }
-       print LOG &do_time(), ": leave: Unload\n";
-}
-
-sub changeTape {
-       my($tape) = @_;
-       print LOG &do_time(), ": enter: changeTape: $tape\n";
-
-       #
-       # Unload current tape and load a new tape from slot $tape.
-       #
-
-       if ($tape != $currentTape) {
-
-               &testTape($tape);
-
-               if( $currentTape != 0 ) {
-                       &Unload($currentTape);
-               }
-               &Load($tape);
-               $currentTape = $tape;
-       }
-       print LOG &do_time(), ": leave: changeTape\n";
-}
-
-
-#
-# Main program
-#
-
-#
-# Initialise
-#
-
-($max_slot, $max_drive) = &getTapeParams();
-
-$opt_slot = 0;                                 # perl -w fodder
-$opt_info = 0;                                 # perl -w fodder
-$opt_reset = 0;                                        # perl -w fodder
-$opt_eject = 0;                                        # perl -w fodder
-
-GetOptions("slot=s", "info", "reset", "eject"); 
-
-$nr_tapes = &getTapeStatus();
-
-#
-# Before we do anything with the tape changer we'll have to rewind the tape
-#
-
-if (-x "$sbindir/ammt") {
-       $MT="$sbindir/ammt";
-       $MTF="-f";
-} elsif (-x "@MT@") {
-       $MT="@MT@";
-       $MTF="@MT_FILE_FLAG@";
-} else {
-       print LOG &do_time(), ": mt program not found\n";
-       print "<none> mt program not found\n";
-       exit(1);
-}
-print LOG &do_time(), ": MT -> $MT $MTF\n";
-
-system ("$MT $MTF $tapeDevice rewind")
-       unless $currentTape == 0;
-
-
-if ( $opt_slot ) {
-       if ( $opt_slot =~ /first/ ) {
-               &changeTape(1);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /last/ ) {
-               &changeTape($max_slot);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /current/ ) {
-               &changeTape($currentTape);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /next/ ) {
-               $tape = $currentTape+1;
-               if ( $tape > $max_slot ) {
-                       $tape = 1;
-               }
-               while ( $slots[$tape-1] == 0 ) {        # there is at least 1 
-                       if ( ++$tape > $max_slot ) {
-                               $tape = 1;
-                       }
-               }
-               &changeTape($tape);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /prev/ ) {
-               $tape = $currentTape-1;
-               if ( $tape < 1 ) {
-                       $tape = $max_slot;
-               }
-               while ( $slots[$tape-1] == 0 ) {        # there is at least 1
-                       if ( --$tape < 1 ) {
-                               $tape = $max_slot;
-                       }
-               }
-               &changeTape($tape);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /^\d+$/ ) {
-               &changeTape($opt_slot);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /advance/ ) {
-               $tape=$currentTape+1;
-               if ( $tape > $max_slot ) {
-                       $tape = 1;
-               }
-               if ( $currentTape ) { 
-                       &Unload($currentTape);
-               }
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape , /dev/null\n";
-       }
-
-       exit 0;
-}
-
-if ( $opt_info ) {
-       if ( $currentTape == 0 ) {
-               &Load(1);                       # load random tape
-               $currentTape = 1;
-       }
-
-       print LOG &do_time(), ": $currentTape $max_slot 1\n";
-       print "$currentTape $max_slot 1\n";
-       exit 0;
-}
-
-if ( $opt_reset ) {
-       &changeTape(1);
-       print LOG &do_time(), ": $currentTape $tapeDevice\n";
-       print "$currentTape $tapeDevice\n";
-       exit 0;
-}
-
-if ( $opt_eject ) {
-       if ( $currentTape ) { 
-               &Unload($currentTape);
-               print "0 $tapeDevice\n";
-               exit 0;
-       } else {
-               print "$progname: drive was not loaded\n";
-               exit 1;
-       }
-}
-
-print "$progname: No command was received.  Exiting.\n";
-exit 1;
diff --git a/changer-src/chg-chs.sh b/changer-src/chg-chs.sh
deleted file mode 100644 (file)
index 4ec6f68..0000000
+++ /dev/null
@@ -1,386 +0,0 @@
-#!@SHELL@
-#
-# Amanda, The Advanced Maryland Automatic Network Disk Archiver
-# Copyright (c) 1991-1998 University of Maryland at College Park
-# All Rights Reserved.
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of U.M. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  U.M. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-# Author: James da Silva, Systems Design and Analysis Group
-#                         Computer Science Department
-#                         University of Maryland at College Park
-#
-
-#
-# chg-chs.sh - chs tape changer script
-#
-
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-sbindir="@sbindir@"
-amlibexecdir="@amlibexecdir@"
-. "${amlibexecdir}/amanda-sh-lib.sh"
-
-pname="chg-chs"
-
-# add sbin and ucb dirs
-PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
-export PATH
-
-if [ -d "@AMANDA_DBGDIR@" ]; then
-       logfile=@AMANDA_DBGDIR@/changer.debug
-else
-       logfile=/dev/null
-fi
-
-CHS=@CHS@
-
-ourconf=`amgetconf changerfile`
-changerdev=`amgetconf changerdev`
-if test -n "$changerdev" && test x"$changerdev" != x/dev/null; then
-       CHS="$CHS -f$changerdev"
-fi
-
-# read in some config parameters
-
-if [ \! -f $ourconf ]; then
-       answer=`_ '<none> %s: %s does not exist' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-firstslot=`awk '$1 == "firstslot" {print $2}' $ourconf 2>/dev/null`
-if [ "$firstslot" = "" ]; then
-       answer=`_ '<none> %s: firstslot not specified in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-lastslot=`awk '$1 == "lastslot" {print $2}' $ourconf 2>/dev/null`
-if [ "$lastslot" = "" ]; then
-       answer=`_ '<none> %s: lastslot not specified in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-nslots=`expr $lastslot - $firstslot + 1`
-
-gravity=`awk '$1 == "gravity" {print $2}' $ourconf 2>/dev/null`
-if [ "$gravity" = "" ]; then
-       answer=`_ '<none> %s: gravity not specified in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-needeject=`awk '$1 == "needeject" {print $2}' $ourconf 2>/dev/null`
-if [ "$needeject" = "" ]; then
-       answer=`_ '<none> %s: needeject not specified in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-multieject=`awk '$1 == "multieject" {print $2}' $ourconf 2>/dev/null`
-if [ "$multieject" = "" ]; then
-       echo `_ 'Note -> multieject not specified in %s' "$ourconf"` >> $logfile
-       multieject=0
-fi
-
-ejectdelay=`awk '$1 == "ejectdelay" {print $2}' $ourconf 2>/dev/null`
-if [ "$ejectdelay" = "" ]; then
-       echo `_ 'Note -> ejectdelay not specified in %s' "$ourconf"` >> $logfile
-       ejectdelay=0
-fi
-
-ourstate=`awk '$1 == "statefile" {print $2}' $ourconf 2>/dev/null`
-if [ "$ourstate" = "" ]; then
-       answer=`_ '<none> %s: statefile not specified in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-# read in state: only curslot and curloaded at the present time
-
-curslot=`awk '$1 == "curslot" {print $2}' $ourstate 2>/dev/null`
-if [ "$curslot" = "" ]; then
-       curslot=$firstslot
-fi
-
-curloaded=`awk '$1 == "curloaded" {print $2}' $ourstate 2>/dev/null`
-if [ "$curloaded" = "" ]; then
-       curloaded=0
-fi
-
-
-# process the command-line
-
-# control vars to avoid code duplication: not all shells have functions!
-usage=0
-checkgravity=0
-ejectslot=0
-loadslot=0
-slotempty=0
-
-if [ $# -ge 1 ]; then command=$1; else command="-usage"; fi
-
-case "$command" in
-
--info) # return basic information about changer
-
-       backwards=`expr 1 - $gravity`
-       answer="$curslot $nslots $backwards"
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 0
-       ;;
-
--reset) # reset changer
-
-       checkgravity=0
-       loadslot=1
-       newslot=$firstslot
-
-       # XXX put changer-specific reset here, if applicable
-       ;;
-
--eject) # eject tape if loaded
-
-       checkgravity=0
-       loadslot=0
-       newslot=$curslot
-       ejectslot=1
-
-       if [ $curloaded -eq 0 ]; then
-               answer=`_ '%s %s: slot already empty' "$curslot" "$pname"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 1
-       fi
-       ;;
-
--slot) # change to slot
-
-       checkgravity=1
-       loadslot=1
-
-       slotparm=$2
-       case "$slotparm" in
-       [0-9]*) 
-               newslot=$slotparm
-               if [ \( $newslot -gt $lastslot \) -o \
-                    \( $newslot -lt $firstslot \) ]; then
-                       answer =`_ '%s %s: no slot %s: legal range is %s ... %s' "$newslot" "$pname" "$newslot" "$firstslot" "$lastslot"`
-                       echo `_ 'Exit ->'` $answer >> $logfile
-                       echo $answer
-                       exit 1
-               fi
-               ;;
-       current)
-               newslot=$curslot
-               ;;
-       first)
-               newslot=$firstslot
-               ;;
-       last)
-               newslot=$lastslot
-               ;;
-       next|advance)
-               newslot=`expr $curslot + 1`
-               if [ $newslot -gt $lastslot ]; then
-                       newslot=$firstslot
-               fi
-               if [ $slotparm = advance ]; then
-                       loadslot=0
-               fi
-               ;;
-       prev)
-               newslot=`expr $curslot - 1`
-               if [ $newslot -lt $firstslot ]; then
-                       newslot=$lastslot
-               fi
-               ;;
-       *)
-               answer=`_ '<none> %s: bad slot name "%s"' "$pname" "$slotparm"`
-               echo `_ 'Exit ->'` "$answer" >> $logfile
-               echo $answer
-               exit 1
-               ;;
-       esac
-       ;;
-*)
-       usage=1
-       ;;
-esac
-
-
-if [ $usage -eq 1 ]; then
-       answer=`_ '<none> usage: %s {-reset | -slot [<slot-number>|current|next|prev|advance]}' "$pname"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-
-# check for legal move
-
-if [ \( $checkgravity -eq 1 \) -a \( $gravity -ne 0 \) ]; then
-       if [ \( $newslot -lt $curslot \) -o \( "$slotparm" = "prev" \) ]
-       then
-               answer=`_ '%s %s: cannot go backwards in gravity stacker' "$newslot" "$pname"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 1
-       fi
-fi
-
-# get tape device name
-
-device=`awk '$1 == "slot" && $2 == '$newslot' {print $3}' $ourconf 2>/dev/null`
-if [ "$device" = "" ]; then
-       answer=`_ '%s %s: slot %s device not specified in %s' "$newslot" "$pname" "$newslot" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-# check if load needs an eject first
-
-if [ \( $needeject -eq 1 \) -a \( $loadslot -eq 1 \) -a \
-     \( $curloaded -eq 1 \) -a \( $newslot -ne $curslot \) ]; then
-       ejectslot=1
-fi
-
-
-if [ $ejectslot -eq 1 ]; then  # eject the tape from the drive
-
-       # XXX put changer-specific load command here, if applicable
-
-       curloaded=0             # unless something goes wrong
-       slotempty=0
-
-       # generically, first check that the device is there
-
-       if [ ! -c $device ]; then
-               answer=`_ '%s %s: %s: not a device file' "$newslot" "$pname" "$device"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 2
-       fi
-
-       # if multiple eject is required, do it now
-       if [ $multieject -eq 1 ]; then
-               loopslot=$curslot
-               while [ $loopslot -lt $newslot ]; do
-                        try_eject_device $device
-                       if [ $? -ne 0 ]; then
-                               answer=`_ '%s %s: %s: unable to change slot %s' "$newslot" "$pname" "$device" "$loopslot"`
-                               echo `_ 'Exit ->'` $answer >> $logfile
-                               echo $answer
-                               exit 2
-                       fi
-                       loopslot=`/usr/bin/expr $loopslot + 1`
-               done
-       fi
-  
-       # second, try to unload the device
-        try_eject_device $device
-       $CHS deselect -d1 -s$curslot >/dev/null 2>&1
-       if [ $? -ne 0 ]; then
-               #
-               # XXX if the changer-specific eject command can distinguish
-               # betweeen "slot empty" and more serious errors, return 1
-               # for the first case, 2 for the second case.  Generically,
-               # we just presume an error signifies an empty slot.
-               #
-               #slotempty=1
-               answer=`_ '<none> %s: tape unload to slot %s failed' "$pname" "$curslot"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 2
-       else
-               sleep $ejectdelay
-       fi
-fi
-
-if [ \( $loadslot -eq 1 \) -a \( \( $curloaded -ne 1 \) -o \( \( $curloaded -eq 1 \) -a \( $newslot -ne $curslot \) \) \) ]; then      # load the tape from the slot
-
-       # XXX put changer-specific load command here, if applicable
-
-       curloaded=1             # unless something goes wrong
-       slotempty=0
-
-       # generically, first check that the device is there
-
-       if [ ! -c $device ]; then
-               answer=`_ '%s %s: %s: not a device file' "$newslot" "$pname" "$device"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 2
-       fi
-
-       $CHS select -s$newslot -d1 >/dev/null 2>&1
-       if [ $? -ne 0 ]; then
-               answer=`_ '<none> %s: tape load from slot %s failed' "$pname" "$newslot"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 2
-       fi
-       sleep 60
-
-       # second, try to rewind the device
-        amdevcheck_status $device
-       if [ $? -ne 0 ]; then
-               #
-               # XXX if the changer-specific load command can distinguish
-               # betweeen "slot empty" and more serious errors, return 1
-               # for the first case, 2 for the second case.  Generically,
-               # we just presume an error signifies an empty slot.
-               #
-               slotempty=1
-               curloaded=0
-       fi
-fi
-
-# update state
-
-echo "# $pname state cache: DO NOT EDIT!"      >  $ourstate
-echo curslot $newslot                          >> $ourstate
-echo curloaded $curloaded                      >> $ourstate
-
-# return slot info
-
-if [ $slotempty -eq 1 ]; then
-       answer=`_ '<none> %s: %s slot is empty: %s' "$pname" "$newslot" "$amdevcheck_message"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 1
-fi
-
-if [ "$command" = -slot -a "$slotparm" = advance ]; then
-       device=/dev/null
-fi
-
-answer="$newslot $device"
-echo `_ 'Exit ->'` $answer >> $logfile
-echo $answer
-exit 0
diff --git a/changer-src/chg-iomega.pl b/changer-src/chg-iomega.pl
deleted file mode 100644 (file)
index b6f96b1..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-#! @PERL@ -w
-
-# Catch for sh/csh on systems without #! ability.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-        & eval 'exec @PERL@ -S $0 $argv:q'
-                if 0;
-
-# 
-# This changer script is designed for IOMEGA or JAZZ disks of various sizes
-# as well as any other removable disk media.
-#
-# This is a PURELY MANUAL changer. It requests insertion of disk media via
-# messages on /dev/tty. So it cannot be used via crontab.
-#
-# Make sure you comply with any of the following.
-# - Add statements 
-#         tpchanger "chg-iomega"
-#         tapedev "file:<mount_point_of_removable_disk>"
-#         # (e.g. tapedev "file:/mnt/iomega" )
-#         tapetype IOMEGA      
-#
-#         
-#         define tapetype IOMEGA {
-#             comment "IOMega 250 MB floppys"
-#             length 250 mbytes
-#             filemark 100 kbytes
-#             speed 1 mbytes
-#         }
-#   to your /etc/amanda/<backup_set>/amanda.conf file
-# - Add entry to /etc/fstab to specify mount point of removable disk
-#   and make this disk mountable by any user.
-# - Format all disks, add a "data" sub directory and label all disks
-#   by a call to amlabel.
-# - Be aware that as of version 2.4.4p1, amanda can't handle backups that are
-#   larger than the size of the removable disk media. So make sure
-#   /etc/amanda/<backup_set>/disklist specifies chunks smaller than the 
-#   disk size.
-#
-# This script is built up out of bits and pieces of other scripts, in
-# particular chg-chio.pl. That script was written by 
-# Nick Hibma - nick.hibma@jrc.it
-# 
-# Permission to freely use and distribute is granted (by me and was granted by
-# the original authors).
-#
-# Christoph Pospiech <pospiech@de.ibm.com>
-#
-
-require 5.001;
-
-($progname = $0) =~ s#/.*/##;
-
-use English;
-use Getopt::Long;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-$| = 1;
-
-if (-d "@AMANDA_DBGDIR@") {
-       $logfile = "@AMANDA_DBGDIR@/changer.debug";
-} else {
-       $logfile = "/dev/null";
-}
-die "$progname: cannot open $logfile: $ERRNO\n"
-       unless (open (LOG, ">> $logfile"));
-
-
-#
-# get the information from the configuration file
-#
-
-$prefix="@prefix@";
-$prefix=$prefix;               # avoid warnings about possible typo
-$exec_prefix="@exec_prefix@";
-$exec_prefix=$exec_prefix;     # Ditto
-$sbindir="@sbindir@";
-
-chomp ($tapeDevice = `$sbindir/amgetconf tapedev 2>&1`);
-die "tapedev not found in amanda.conf"
-       if !$tapeDevice or $tapeDevice eq "" or
-           $tapeDevice =~ m/no such parameter/;
-chomp ($changerDevice = `$sbindir/amgetconf changerdev 2>&1`);
-chomp $changerDevice;
-die "changerdev not found in amanda.conf"
-       if !$changerDevice or $changerDevice eq "" or
-           $changerDevice =~ m/no such parameter/;
-
-#
-# Initialise a few global variables
-#
-
-$current_label = "";
-#$current_slot = 0;
-$max_slot = 1;
-
-@dow = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
-@moy = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
-       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
-
-sub do_time {
-       my (@t);
-       my ($r);
-
-       ###
-       # Get the local time for the value.
-       ###
-
-       @t = localtime (time ());
-
-       ###
-       # Return the result.
-       ###
-
-       $r = sprintf "%s %s %2d %2d:%02d:%02d %4d",
-         $dow[$t[6]],
-         $moy[$t[4]],
-         $t[3],
-         $t[2], $t[1], $t[0],
-         1900 + $t[5];
-
-       return $r;
-}
-
-
-sub is_mounted {
-    my $device = shift @_;
-    my ($directory) = ($device =~ m/file\:(.*)$/);
-    if ( -d "$directory/data" ) { return 1;}
-    else {return 0;}
-}
-
-sub request {
-    my $label = shift @_;
-    my $answer;
-    open (TTY, "+</dev/tty") or die "Can't open tty.\n";
-    print TTY "Insert Disk with label $label\n";
-    read TTY,$answer,1;
-    close TTY;
-    return $answer;
-}
-
-sub print_label {
-    my $label = shift @_;
-    open (TTY, "+</dev/tty") or die "Can't open tty.\n";
-    print TTY "The current Disk has label $label\n";
-    close TTY;
-}
-
-sub get_label {
-    my $device = shift @_;
-    my ($directory) = ($device =~ m/file\:(.*)$/);
-    my @dir_list =  glob("$directory/data/*");
-    while ( ($_= shift(@dir_list)) ) {
-       if ( /0+\.([\w\d]+)/ ) {return $1;}
-    }
-    return "no label";
-}
-
-
-sub Load {
-    my $device = shift @_;
-    my ($directory) = ($device =~ m/file\:(.*)$/);
-    my $label;
-    print LOG &do_time(), ": enter: Load $device\n";
-    if ( ! &is_mounted($device) ) {
-       print LOG &do_time(), ": mounting $directory\n";
-       system "mount $directory";
-    }
-    $label = get_label $device;
-    &print_label($label);
-    print LOG &do_time(), ": current label: $label\n";
-    print LOG &do_time(), ": leave: Load\n";
-
-}
-
-sub Unload {
-    my $device = shift @_;
-    my ($directory) = ($device =~ m/file\:(.*)$/);
-    print LOG &do_time(), ": enter: Unload $device\n";
-    if ( &is_mounted($device) ) {
-       print LOG &do_time(), ": ejecting $directory\n";
-       system "eject $directory";
-    }
-    print LOG &do_time(), ": leave: Unload\n";
-}
-
-
-
-#
-# Main program
-#
-
-#
-# Initialise
-#
-
-
-$opt_slot = 0;                                 # perl -w fodder
-$opt_info = 0;                                 # perl -w fodder
-$opt_reset = 0;                                        # perl -w fodder
-$opt_eject = 0;                                        # perl -w fodder
-$opt_search = 0;                                       # perl -w fodder
-$opt_label = 0;                                        # perl -w fodder
-
-GetOptions("slot=s", "info", "reset", "eject", "search=s", "label=s"); 
-
-
-if ( $opt_slot ) {
-    print LOG &do_time(), ": Loading slot $opt_slot requested\n";
-    if ( ! &is_mounted ($tapeDevice) ) {
-       &request ("any");
-       &Load ($tapeDevice);
-    }
-    $current_label = &get_label ($tapeDevice);
-    print LOG &do_time(), ": current label: $current_label\n";
-    print LOG &do_time(), ": 1 $tapeDevice\n";
-    print "1 $tapeDevice\n";
-    exit 0;
-}
-
-if ( $opt_info ) {
-    print LOG &do_time(), ": info requested\n";
-    $current_label = &get_label ($tapeDevice);
-    print LOG &do_time(), ": current label: $current_label\n";
-    print LOG &do_time(), ": 1 $max_slot 1 1\n";
-    print "1 $max_slot 1 1\n";
-    exit 0;
-}
-
-if ( $opt_reset ) {
-    print LOG &do_time(), ": reset requested\n";
-    &Unload ($tapeDevice);
-    &request ("any");
-    &Load ($tapeDevice);
-    $current_label = &get_label ($tapeDevice);
-    print LOG &do_time(), ": current label: $current_label\n";
-    print LOG &do_time(), ": 1 $tapeDevice\n";
-    print "1 $tapeDevice\n";
-    exit 0;
-}
-
-if ( $opt_eject ) {
-    print LOG &do_time(), ": eject requested\n";
-    &Unload ($tapeDevice);
-    print LOG &do_time(), ": 1 $tapeDevice\n";
-    print "1 $tapeDevice\n";
-    exit 0;
-}
-
-if ( $opt_search ) {
-    print LOG &do_time(), ": search label $opt_search requested\n";
-    $retry = 0;
-    $current_label = &get_label ($tapeDevice);
-    print LOG &do_time(), ": current label: $current_label\n";
-    while ( $opt_search ne $current_label && ++$retry < 5) {
-       &Unload ($tapeDevice);
-       &request ($opt_search);
-       &Load ($tapeDevice);
-       $current_label = &get_label ($tapeDevice);
-       print LOG &do_time(), ": search label: $opt_search\n";
-       print LOG &do_time(), ": current label: $current_label\n";
-    }
-    if ( $retry >= 5) {
-       print LOG &do_time(), ": disk not found\n";
-       print "disk not found\n";
-       exit 1;
-    } else {
-       print LOG &do_time(), ": 1 $tapeDevice\n";
-       print "1 $tapeDevice\n";
-       exit 0;
-    }
-}
-
-if ( $opt_label ) {
-    print LOG &do_time(), ": label $opt_label requested\n";
-    # no operation
-    print LOG &do_time(), ": 1 $tapeDevice\n";
-    print "1 $tapeDevice\n";
-    exit 0;
-}
-
-print "$progname: No command was received.  Exiting.\n";
-exit 1;
diff --git a/changer-src/chg-juke.sh b/changer-src/chg-juke.sh
deleted file mode 100755 (executable)
index 23c1e50..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-#!@SHELL@
-
-# chg-juke
-#
-# This assumes we have possibly rait-striped drives in several
-# jukeboxes, controlled by the Fermilab "juke" package
-#
-# So we could have 3 drives in 3 jukeboxes:
-#   changerscript="chg-juke"
-#   changerfile=/some/file
-#   tapedev="rait:/dev/nst{1,2,3}"
-#   changerdev="myjuke{0,1,2}"
-# Or, if the jukebox has multiple drives:
-#   changerscript="chg-juke"
-#   changerfile=/some/file
-#   tapedev="rait:/dev/nst{1,2,3}"
-#   changerdev="myjuke"
-# We need therefore to generate lists with csh to expand the tapedev 
-# and changerdev, and deal with the possibility that there are several 
-# jukeboxes and several drives in each jukebox involved.
-
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-sbindir="@sbindir@"
-amlibexecdir="@amlibexecdir@"
-. "${amlibexecdir}/amanda-sh-lib.sh"
-
-
-#
-# debugging...
-#
-if [ -d "@AMANDA_DBGDIR@" ]; then
-       DBGFILE=@AMANDA_DBGDIR@/changer.debug
-else
-       DBGFILE=/dev/null
-fi
-exec 2>$DBGFILE
-echo `_ 'args:'` $0 $* >&2
-set -x 
-
-#
-# the usual config fun
-#
-
-getconf=$sbindir/amgetconf
-
-#
-# make sure we can find JUKE later
-#
-JUKE_DIR=/usr/local
-# Fermilab specific
-if [ -f /usr/local/etc/setups.sh ]
-then
-    . /usr/local/etc/setups.sh
-    setup juke
-fi
-
-# add sbin, ucb, and the JUKE_DIR to PATH
-PATH="$PATH:$JUKE_DIR/bin:/usr/sbin:/sbin:/usr/ucb"
-export PATH JUKE_DIR
-
-build_drivelists() {
-    #
-    # figure out which drives are in which jukebox
-    #
-    count=0
-    for juke in $jlist
-    do
-       for d in $dlist
-       do
-           if juke list -j $juke drive $d | grep 'drive [0-9]' >&2
-           then
-               eval "drives_in_$juke=\"\$drives_in_$juke $d\""
-           fi
-       done
-    done
-}
-
-unload_drive_n_clean() {
-
-    #
-    # $1 is whether to clean it
-    #
-    cleanit=$1
-
-    #
-    # if the drive is ONLINE, mt unload it
-    #
-    if amdevcheck_status $tapedev; then
-        try_eject_device $tapedev
-    fi
-
-    #
-    # unload any tapes present, maybe load/unload a cleaning cartridge
-    #
-    for juke in $jlist
-    do
-       eval "jdlist=\"\$drives_in_$juke\""
-       for drive in $jdlist
-       do
-           juke unload -j $juke drive $drive >&2 || true
-           if juke list -j $juke drive $drive | grep '(empty)' >&2
-           then
-               :
-           else
-               echo `_ '%s %s unable to empty preceding tape from drive %s' "$slot" "$tapedev" "$drive"`
-               exit 1
-           fi
-
-           if $cleanit
-            then
-                juke load -j $juke drive $drive clean
-               sleep 120
-                juke unload -j $juke drive $drive
-            fi
-       done
-    done
-}
-
-load_drives() {
-    #
-    # load slots.  If it's a stripe, load several...
-    #
-    for juke in $jlist
-    do
-       eval "jdlist=\"\$drives_in_$juke\""
-       jndrives=`echo $jdlist | wc -w`
-       count=0
-       for drive in $jdlist
-       do
-           rslot=`expr $newslot '*' $jndrives + $count`
-           juke load -j $changerdev drive $drive slot $rslot >&2
-           if juke list -j $changerdev drive $drive | grep '(empty)' >&2
-           then
-               echo `_ '$slot $tapedev unable to load tape into drive' "$slot" "$tapedev"`
-               exit 1
-           fi
-           count=`expr $count + 1`
-       done
-    done
-
-    #
-    # wait for drive(s) to come online
-    #
-    count=0
-    until amdevcheck_status $tapedev; do
-       count=`expr $count + 1`
-       if [ $count -gt 24 ] 
-       then
-           echo `_ '%s %s never came online: %s' "$slot" "$tapedev" "$amdevcheck_message"`
-           exit 1
-       fi
-       sleep 5
-    done
-}
-
-
-ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$"
-
-#
-# get config variables
-#
-changerfile=`$getconf changerfile`
-    tapedev=`$getconf tapedev`
- changerdev=`$getconf changerdev`
-      dlist=`csh -c "echo $tapedev" | sed -e 's/rait://g' -e 's/tape://g'`
-    ndrives=`echo $dlist | wc -w`
-      jlist=`csh -c "echo $changerdev"`
-     njukes=`echo $jlist | wc -w`
- totalslots=`for juke in $jlist ; do juke list -j $juke; done | 
-               grep -v '^clean' | 
-               grep 'slot [0-9]' | 
-               wc -l`
-
-if [ $ndrives -gt 1 ]
-then
-   #
-   # if it's a 3 tape stripe and we have 30 actual slots
-   # we only have 10 virtual slots...
-   #
-   totalslots=`expr $totalslots / $ndrives`
-fi
-
-build_drivelists
-
-#
-# get current slot if we have one
-#
-if [ -f "$changerfile" ] 
-then
-    slot="`cat $changerfile`"
-else
-    slot=0
-    echo $slot > $changerfile
-fi
-
-#
-# We treat -reset just like -slot 0
-#
-if [ x$1 = 'x-reset' ]
-then
-    set : -slot 0
-    shift
-fi
-
-case x$1 in
-
-x-slot) 
-
-    #
-    # handle special slots...
-    #
-    case "$2" in
-    current)   newslot=$slot           ; load=true;;
-    next)      newslot=`expr $slot + 1`; load=true;;
-    advance)   newslot=`expr $slot + 1`; load=false;;
-    prev)      newslot=`expr $slot - 1`; load=true;;
-    first)     newslot=0               ; load=true;;
-    last)      newslot=-1              ; load=true;;
-    *)         newslot=$2              ; load=true;;
-    esac
-
-    if [ $newslot = "clean" ]
-    then
-       unload_drive_n_clean true
-    else 
-       if [ 0 -gt $newslot ]
-       then
-           newslot=`expr $totalslots - 1`
-       fi
-
-       if [ $totalslots -le  $newslot ]
-       then
-           newslot=0
-       fi
-
-       echo $newslot > $changerfile
-       slot=$newslot
-
-       if $load
-       then
-           unload_drive_n_clean false
-           load_drives
-       fi
-    fi
-
-    echo $slot $tapedev
-    ;;
-
-x-info)
-    echo $slot $totalslots 1
-    exit 0
-    ;;
-
-x-eject)
-    unload_drive_n_clean false
-    echo $slot $tapedev
-    ;;
-esac
-
-exit $rc
diff --git a/changer-src/chg-mcutil.sh b/changer-src/chg-mcutil.sh
deleted file mode 100644 (file)
index 6ddce74..0000000
+++ /dev/null
@@ -1,568 +0,0 @@
-#!@SHELL@ 
-#
-# Author: Robert Dege
-#
-#
-# version 1.2
-# -----------
-# fixed last_cleaned file so that if it doesn't exist, it gets created with current date, not '0,0'
-# fixed a bug that was reporting the wrong slot # to amcheck
-#
-# version 1.1
-# -----------
-# amverify was failing when using -slot current.  Fixed exit $code from 1 -> 0.
-# removed useless $current variables from movetape() function.
-#
-#
-#
-# Exit Status:
-# 0 Alles Ok
-# 1 Illegal Request
-# 2 Fatal Error
-#
-
-
-#
-# Set Path so that it includes Amanda binaries, and access to tapechanger & drive programs
-#
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-sbindir="@sbindir@"
-amlibexecdir="@amlibexecdir@"
-. "${amlibexecdir}/amanda-sh-lib.sh"
-
-# add sbin and ucb dirs
-PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
-export PATH
-
-
-#
-# Load configuration data from the config file
-#
-
-ourconf=`amgetconf changerfile`
-myname=$0
-
-
-if [ ! -f "$ourconf" ]; then
-        code=2
-        echo `_ 'Command Line ->'` $myname $@
-       echo `_ 'Exit(%s): %s not found as listed in amanda.conf' "$code" "$ourconf"` 1>&2
-        exit $code
-fi
-
-
-# grab mcutil info
-tmpval1=`grep ^mcutil $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^mcutil $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-        echo `_ 'Command Line ->'` $myname $@
-       echo `_ 'Exit(%s): mcutil not specified in %s' "$code" "$ourconf"` 1>&2
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       MCUTIL=$tmpval2
-else
-       MCUTIL=$tmpval1
-fi
-
-
-# grab tape info
-tmpval1=`grep ^tape $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^tape $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-        echo `_ 'Command Line ->'` $myname $@
-       echo `_ 'Exit(%s): tape not specified in %s' "$code" "$ourconf"` 1>&2
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       tape=$tmpval2
-else
-       tape=$tmpval1
-fi
-
-
-# grab firstslot info
-tmpval1=`grep ^firstslot $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^firstslot $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-        code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): firstslot not specified in %s' "$code" "$ourconf"` 1>&2
-        exit $code
-elif [ -z "$tmpval1" ]; then
-        firstslot=$tmpval2
-else
-        firstslot=$tmpval1
-fi
-
-
-# grab lastslot info
-tmpval1=`grep ^lastslot $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^lastslot $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-        code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): lastslot not specified in %s' "$code" "$ourconf"` 1>&2
-elif [ -z "$tmpval1" ]; then
-        lastslot=$tmpval2
-else
-        lastslot=$tmpval1
-fi
-
-
-# grab use_cleaning info
-tmpval1=`grep ^use_cleaning $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^use_cleaning $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-        code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): use_cleaning not specified in %s' "$code" "$ourconf"` 1>&2
-        exit $code
-elif [ -z "$tmpval1" ]; then
-        use_cleaning=$tmpval2
-else
-        use_cleaning=$tmpval1
-fi
-
-
-# grab cleanslot info
-tmpval1=`grep ^cleanslot $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^cleanslot $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-        code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): cleanslot not specified in %s' "$code" "$ourconf"` 1>&2
-        exit $code
-elif [ -z "$tmpval1" ]; then
-        cleanslot=$tmpval2
-else
-        cleanslot=$tmpval1
-fi
-
-
-# grab cleansleep info
-tmpval1=`grep ^cleansleep $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^cleansleep $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): cleansleep not specified in %s' "$code" "$ourconf"` 1>&2
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       cleansleep=$tmpval2
-else
-       cleansleep=$tmpval1
-fi
-
-
-# grab cleanme info
-tmpval1=`grep ^cleanme $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^cleanme $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): cleanme not specified in %s' "$code" "$ourconf"` 1>&2
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       cleanme=$tmpval2
-else
-       cleanme=$tmpval1
-fi
-
-
-# grab cleanfile info
-tmpval1=`grep ^cleanfile $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^cleanfile $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-        code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): cleanfile not specified in %s' "$code" "$ourconf"` 1>&2
-        exit $code
-elif [ -z "$tmpval1" ]; then
-        cleanfile=$tmpval2
-else
-        cleanfile=$tmpval1
-fi
-
-
-# grab lastfile info
-tmpval1=`grep ^lastfile $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^lastfile $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): lastfile not specified in %s' "$code" "$ourconf"` 1>&2
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       lastfile=$tmpval2
-else
-       lastfile=$tmpval1
-fi
-
-
-# grab currentslot info
-tmpval1=`grep ^currentslot $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^currentslot $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): currentslot not specified in %s' "$code" "$ourconf"` 1>&2
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       currentslot=$tmpval2
-else
-       currentslot=$tmpval1
-fi
-
-
-# grab logfile info
-tmpval1=`grep ^logfile $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^logfile $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): logfile not specified in %s' "$code" "$ourconf"` 1>&2
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       logfile=$tmpval2
-else
-       logfile=$tmpval1
-fi
-
-[ ! -w $logfile ] && logfile=/dev/null
-
-
-# grab slot0source info
-tmpval1=`grep ^slot0source $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^slot0source $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-        echo `_ 'Command Line ->'` $myname $@
-        echo `_ 'Exit(%s): slot0source not specified in %s' "$code" "$ourconf"` 1>&2
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       slot0source=$tmpval2
-else
-       slot0source=$tmpval1
-fi
-
-
-
-#
-# Verify currentslot contains a value
-#
-if [ ! -f $currentslot ] || [ `cat $currentslot` -lt $firstslot ];then
-   readstatus
-   echo $used > $currentslot
-fi
-
-current=`cat $currentslot`
-
-
-# Start logging to $logfile
-echo "\n\n==== `date` ====" >> $logfile
-echo `_ 'Command Line ->'` $myname $@ >> $logfile
-
-
-#
-# is Use Cleaning activated?
-#
-if [ $use_cleaning -eq 1 ]; then
-   curday=`date +%j`
-   curyear=`date +%Y`
-
-   [ ! -f $cleanfile ] && echo 0 > $cleanfile
-   [ ! -f $lastfile ] && echo $curday,$curyear > $lastfile
-
-
-#
-# Check to see when tape drive was last cleaned
-# output warning message if it's been too long
-# Currently, if it's been more than 45days, then
-# an error message is displayed everytime the
-# script is called, until the clean parameter
-# is run
-#
-   cleaned=`cat $cleanfile`
-   lastcleaned=`cut -d, -f1 $lastfile`
-   yearcleaned=`cut -d, -f2 $lastfile`
-
-  if [ `expr $curday - $lastcleaned`  -lt 0 ];then
-     diffday=`expr $curday - $lastcleaned + 365`
-     diffyear=`expr $curyear - $yearcleaned - 1`
-  else
-     diffday=`expr $curday - $lastcleaned`
-     diffyear=`expr $curyear - $yearcleaned`
-  fi
-
-  if [ $diffday -gt $cleanme ] || [ $diffyear -ge 1 ];then
-     if [ $diffyear -ge 1 ];then
-         echo `_ "Warning, it's been %s year(s) & %s day(s) since you last cleaned the tape drive!" "$diffyear" "$diffday"`
-     else
-         echo `_ "Warning, it's been %s day(s) since you last cleaned the tape drive!" "$diffday"`
-     fi
-  fi
-
-fi
-
-
-#
-# Read if there is a tape in the tape drive
-# If so, determine what slot is the tape from
-#
-readstatus() {
-  echo `_ "querying tape drive....."` >> $logfile
-  used=`expr \`$MCUTIL -e drive | tr = \] | cut -d\] -f2\` - $slot0source`
-  echo `_ " Done"` >> $logfile
-
-  # Give changer a chance to reset itself
-  sleep 3
-}
-
-
-#
-# If tape is in the drive, eject it
-#
-eject() {
-  echo `_ "tape drive eject was called"` >> $logfile
-
-  readstatus 
-
-  if [ $used -ge $firstslot ];then
-    $MCUTIL -m drive slot:$used
-    code=$?
-  else
-    code=1
-  fi
-
-  if [ $code -eq 0 ];then
-    answer=`_ 'Cartridge %s successfully ejected from %s' "$used" "$tape"`
-    echo `_ "Exit(%s): %s" "$code" "$answer"` >> $logfile
-    echo $current $answer      #For amtape output  
-    return $code
-  elif [ $code -eq 1 ];then
-    answer=`_ "No Cartridge in Tape Drive"`
-    echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
-    echo $current $answer      #For amtape output
-    exit $code
-  else
-    answer=`_ 'Tape abnormally failed'`
-    echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
-    echo $current $answer      #For amtape output
-    exit $code
-  fi
-}
-
-
-#
-# reset tape drive to a current state.
-# This involves ejecting the current tape (if occupied)
-# and inserting the tape in $firstslot
-#
-reset() {
-  echo `_ 'tape drive reset was called'` >> $logfile
-
-  readstatus
-
-  if [ $used -ge $firstslot ];then
-     eject
-  fi
-
-  res=`$MCUTIL -m slot:$firstslot drive`
-  code=$?
-
-
-  if [ $code -eq 0 ];then
-    echo $firstslot > $currentslot
-    answer=`_ '%s - Tape drive was successfully reset' "$firstslot"`
-  elif [ $code -eq 1 ];then
-    answer=`_ '%s - Tape drive reset failed\nCommand -> %s' "$firstslot" "$res"`
-  else
-    code=2
-    answer=`_ '%s - Tape abnormally failed -> %s' "$firstslot" "$res"`
-  fi
-
-  echo `_ 'Exit(%s): slot %s' "$code" "$answer"` >> $logfile
-  echo $firstslot      #For amtape output 
-  exit $code
-}
-
-
-
-
-#
-# Load a specific cartridge into the changer
-#
-loadslot() {
-  echo `_ "loadslot was called"` >> $logfile
-
-  readstatus
-
-  whichslot=$1
-
-  case $whichslot in
-    current)
-       if [ $current -ge $firstslot ];then
-          load=$current
-       else
-          load=$used
-       fi
-
-       movetape
-       ;;
-    next|advance)
-         [ $used -lt $firstslot ] && used=$current
-
-         load=`expr $used + 1`
-         [ $load -gt $lastslot ] && load=$firstslot
-
-         if [ $whichslot = advance ];then
-            echo $load > $currentslot
-            code=0
-            answer=`_ 'advancing to slot %s' "$load"`
-            echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
-            echo $load $code
-            exit $code
-         else
-            movetape
-         fi
-         ;;
-    prev)
-         [ $used -lt $firstslot ] && used=$current
-
-         load=`expr $used - 1`
-         [ $load -lt $firstslot ] && load=$lastslot
-         movetape
-         ;;
-    first)
-         load=$firstslot
-         movetape
-         ;;
-    last)
-         load=$lastslot
-         movetape
-         ;;
-    [$firstslot-$lastslot])
-            load=$1
-            movetape
-         ;;
-    clean)
-         if [ use_cleaning -eq 1 ];then
-            current=$cleanslot
-            eject
-            $MCUTIL slot:$cleanslot drive
-            sleep $cleansleep
-            echo "$curday,$curyear" > $lastfile
-            echo `expr $cleaned + 1` > $cleanfile
-            reset
-         else
-            code=1
-            answer=`_ "Cleaning not enabled in config"`
-            echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
-            echo $cleanslot $answer
-            exit $code
-         fi
-         ;;
-    *)
-       code=1
-       answer=`_ '"%s" invalid menu option' "$whichslot"`
-       echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
-       echo "$answer"
-       exit $code
-       ;;
-    esac
-}
-
-
-#
-# sub-function that slot calls to actually eject the tape
-# & load in the correct slot cartridge
-#
-movetape() {
-
-    # If the requested slot is already loaded in the tape drive
-    if [ $load -eq $used ]; then
-        code=0
-       answer=`_ 'slot %s is already loaded' "$load"`
-        echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
-        echo $load $tape       # For amtape output
-        exit $code
-    elif [ $used -ge $firstslot ];then
-       current=$load
-       eject
-    else
-       echo $load $tape        # For amtape output
-    fi
-
-    echo `_ 'Loading slot %s into Tape drive' "$load"` >> $logfile
-    $MCUTIL -m  slot:$load drive
-    code=$?
-
-    if [ $code -eq 0 ];then
-       echo $load > $currentslot
-       answer=`_ 'Cartridge %s successfully loaded in Tape drive' "$load"`
-    else
-       answer=`_ 'Cartridge %s failed to load in Tape drive' "$load"`
-    fi
-    echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
-    exit $code
-}
-
-
-info() {
-  echo `_ 'tape drive info was called'` >> $logfile
-
-  readstatus
-
-  if [ $used -lt 0 ];then
-    used=0
-  fi
-
-  code=0
-  answer="$used $lastslot 1"
-  echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
-  echo "$answer"
-  exit $code
-}
-
-
-  case $1 in
-    -slot)
-          shift
-          loadslot $*
-          ;;
-    -device)
-          echo $tape
-          ;;
-    -info)
-           shift
-           info
-           ;;
-    -reset)
-           shift
-           reset
-           ;;
-    -eject)
-           shift
-           eject
-           ;;
-    --help|-help)
-           echo `_ '-slot {current|next|previous|first|last|%s-%s|clean}' "$firstslot" "$lastslot"`
-           echo `_ '   current  - show contents of current slot'`
-           echo `_ '   next     - load tape from next slot'`
-           echo `_ '   previous - load tape from previous slot'`
-           echo `_ '   first    - load tape from first slot'`
-           echo `_ '   last     - load tape from last slot'`
-           echo `_ '   %s - %s  - load tape from slot <slot #>' "$firstslot" "$lastslot"`
-           echo `_ '   clean    - Clean the drive'`
-           echo `_ '-device   : Show current tape device'`
-           echo `_ '-reset    : Reset changer to known state'`
-           echo `_ '-eject    : Eject current tape from drive'`
-           echo `_ '-info     : Output {current slot | # of slots | can changer go backwards}'`
-           echo `_ '-help     : Display this help'`
-           ;;
-    *)
-       echo `_ "<usage> %s -{slot|device|reset|eject|help}" "$myname"`
-       ;;
- esac
diff --git a/changer-src/chg-mtx.sh b/changer-src/chg-mtx.sh
deleted file mode 100644 (file)
index 72ffe89..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-#!@SHELL@ 
-#
-# Exit Status:
-# 0 Alles Ok
-# 1 Illegal Request
-# 2 Fatal Error
-#
-
-# source utility functions and values from configure
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-amlibexecdir=@amlibexecdir@
-. ${amlibexecdir}/chg-lib.sh
-
-if [ -d "@AMANDA_DBGDIR@" ]; then
-       logfile=@AMANDA_DBGDIR@/changer.debug
-else
-       logfile=/dev/null
-fi
-
-myname=$0
-
-tape=`amgetconf tapedev`
-if [ -z "$tape" ]; then
-  echo "<none> tapedev not specified in amanda.conf";
-  exit 2;
-fi
-
-TAPE=`amgetconf changerdev`; export TAPE # for mtx command
-if [ -z "$TAPE" ]; then
-  echo "<none> changerdev not specified in amanda.conf";
-  exit 2;
-fi
-
-if [ "$tape" = "/dev/null" -o "$TAPE" = "/dev/null" ]; then
-  echo "<none> Both tapedev and changerdev must be specified in config file";
-  exit 2;
-fi
-
-firstslot=1
-lastslot=5
-# counted from 1 !!!
-cleanslot=6
-
-changerfile=`amgetconf changerfile`
-
-cleanfile=$changerfile-clean
-accessfile=$changerfile-access
-[ ! -f $cleanfile ] && echo 0 > $cleanfile
-[ ! -f $accessfile ] && echo 0 > $accessfile
-cleancount=`cat $cleanfile`
-accesscount=`cat $accessfile`
-#
-
-readstatus() {
-  used=`$MTX -s |
-    sed -n 's/Drive: No tape Loaded/-1/p;s/Drive: tape \(.\) loaded/\1/p'`
-
-  if [ -z "$used" ]; then
-    used="-1";
-  fi
-}
-
-
-eject() {
-  readstatus 
-  if [ $used -gt 0 ];then
-    $MTX -u $used
-    answer="0 $tape"
-    echo `_ 'Exit ->'` $answer >> $logfile
-    echo $answer
-    exit 0
-  else
-    answer=`_ '<none> %s: Drive was not loaded' "$myname"`     
-    echo `_ 'Exit ->'` $answer >> $logfile
-    echo $answer
-    exit 1
-  fi
-}
-
-reset() {
-  readstatus
-  if [ $used -gt 0 ];then
-    $MTX -u $used
-  fi
-  res=`$MTX -l 1`
-  if [ $? -eq 0 ];then
-    answer="1 $tape"
-    echo `_ 'Exit ->'` $answer >> $logfile
-    echo $answer
-    exit 0
-  else
-    answer="1 $res"
-    echo `_ 'Exit ->'` $answer >> $logfile
-    echo $answer
-    exit 1
-  fi
-}
-#
-#
-loadslot() {
-  readstatus
-  echo "     -> loaded $used" >> $logfile
-  whichslot=$1
-  case $whichslot in
-    current)
-            if [ $used -lt 0 ];then
-              $MTX -l 1
-              used=1
-            fi
-            answer="$used $tape"
-            echo `_ 'Exit ->'` $answer >> $logfile
-            echo $answer
-            exit 0
-            ;;
-    next|advance)
-         load=`expr $used + 1`
-         [ $load -gt $lastslot ] && load=$firstslot
-         ;;
-    prev)
-         load=`expr $used - 1`
-         [ $load -lt $firstslot ] && load=$lastslot
-         ;;
-    first)
-         load=$firstslot
-         ;;
-    last)
-         load=$lastslot
-         ;;
-    [$firstslot-$lastslot])
-         load=$1
-         ;;
-    clean)
-         load=$cleanslot
-         ;;
-    *)
-       answer=`_ '<none> %s: illegal request: "%s"' "$myname" "$whichslot"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 1
-       ;;
-    esac
-
-    if [ $load = $used ]; then
-        answer="$used $tape"
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 0
-    fi
-
-    if [ $load = $cleanslot ]; then
-       expr $cleancount + 1 > $cleanfile
-       echo 0 > $accessfile
-    else
-       expr $accesscount + 1 > $accessfile
-       if [ $accesscount -gt 9 ]; then
-               $myname -slot clean >/dev/null
-       fi
-    fi
-
-    # Slot 6 might contain an ordinary tape rather than a cleaning
-    # tape. A cleaning tape auto-ejects; an ordinary tape does not.
-    # We therefore have to read the status again to check what
-    # actually happened.
-    readstatus
-       
-
-    if [ $used -gt 0 ];then
-      echo "     -> unload $used" >> $logfile
-      res=`$MTX -u $used`
-      status=$?
-      echo "     -> status $status" >> $logfile
-      echo "     -> res    $res" >> $logfile
-      if [ $status -ne 0 ];then
-        answer=`_ '<none> %s: %s' "$myname" "$res"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-      fi
-    fi
-    if [ $whichslot = advance ];then
-      answer="$load /dev/null"
-      echo `_ 'Exit ->'` $answer >> $logfile
-      echo $answer
-      exit 0
-    fi
-    echo `_ '     -> load   %s' "$load"` >> $logfile
-    res=`$MTX -l $load`
-    status=$?
-    echo `_ '     -> status %s' "$status"` >> $logfile
-    echo `_ '     -> result %s' "$res"` >> $logfile
-    if [ $status -eq 0 ];then
-      amdevcheck_status $tape
-      answer="$load $tape"
-      code=0
-    else
-      answer="$load $res"
-      code=2
-    fi
-    echo `_ 'Exit ->'` $answer >> $logfile
-    echo $answer
-    exit $code
-}
-#
-info() {
-  readstatus
-  echo "     -> info   $used" >> $logfile
-  if [ $used -lt 0 ];then
-    used=0
-  fi
-  answer="$used $lastslot 1"
-  echo `_ 'Exit ->'` $answer >> $logfile
-  echo $answer
-  exit 0
-}
-#
-echo Args "->" "$@" >> $logfile
-while [ $# -ge 1 ];do
-  case $1 in
-    -slot)
-          shift
-          loadslot $*
-          ;;
-    -info)
-          shift
-          info
-          ;;
-    -reset)
-           shift
-           reset
-           ;;
-    -eject)
-           shift
-           eject
-           ;;
-    *)
-       answer=`_ '<none> %s: Unknown option %s' "$myname" "$1"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-       ;;
-  esac
-done
diff --git a/changer-src/chg-null.sh b/changer-src/chg-null.sh
deleted file mode 100644 (file)
index 6be1e09..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#!@SHELL@
-#
-# Exit Status:
-# 0 Alles Ok
-# 1 Illegal Request
-# 2 Fatal Error
-#
-
-# try to hit all the possibilities here
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-sbindir="@sbindir@"
-amlibexecdir="@amlibexecdir@"
-. "${amlibexecdir}/amanda-sh-lib.sh"
-
-debugdir=@AMANDA_DBGDIR@
-
-# add sbin and ucb dirs
-PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
-export PATH
-
-if [ -d "$debugdir" ]
-then
-       logfile=$debugdir/changer.debug
-else
-       logfile=/dev/null
-fi
-exec 2> $logfile
-set -x
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-myname=$0
-
-EGREP='@EGREP@'
-
-firstslot=1
-totalslots=200
-
-changerfile=`amgetconf$SUF changerfile`
-
-tapedev="null:/dev/xxx$$"
-
-cleanfile=$changerfile-clean
-accessfile=$changerfile-access
-slotfile=$changerfile-slot
-[ ! -f $cleanfile ] && echo 0 > $cleanfile
-[ ! -f $accessfile ] && echo 0 > $accessfile
-[ ! -f $slotfile ] && echo $firstslot > $slotfile
-cleancount=`cat $cleanfile`
-accesscount=`cat $accessfile`
-slot=`cat $slotfile`
-
-rc=0
-
-case x$1 in
-
-x-slot)
-
-    #
-    # handle special slots...
-    #
-    case "$2" in
-    current)   newslot=$slot           ; load=true;;
-    next)      newslot=`expr $slot + 1`; load=true;;
-    advance)   newslot=`expr $slot + 1`; load=false;;
-    prev)      newslot=`expr $slot - 1`; load=true;;
-    first)     newslot=0               ; load=true;;
-    last)      newslot=-1              ; load=true;;
-    *)         newslot=$2              ; load=true;;
-    esac
-
-    if [ 0 -gt $newslot ]
-    then
-       newslot=`expr $totalslots - 1`
-    fi
-
-    if [ $totalslots -le  $newslot ]
-    then
-       newslot=0
-    fi
-    echo $newslot > $changerfile-slot
-    slot=$newslot
-    echo $slot $tapedev
-    ;;
-
-x-info)
-    echo $slot $totalslots 1
-    ;;
-
-x-eject)
-    echo $slot $tapedev
-    ;;
-esac
-
-exit $rc
diff --git a/changer-src/chg-rait.sh b/changer-src/chg-rait.sh
deleted file mode 100644 (file)
index a59dbf7..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-#!@SHELL@
-
-# chg-rait
-#
-# This assumes we have rait-striped drives in several
-# other amanda changer configs.
-#
-# so we have a changerfile that lists other changers and
-# changer files.
-#   nchangers=3
-#   tpchanger_1="chg-mtx"
-#   changerdev_1="/dev/mtx1"
-#   changerfile_1="/some/file1"
-#   tapedev_1="/some/dev"
-#   tpchanger_2="chg-mtx"
-#   changerdev_2="/dev/mtx2"
-#   changerfile_2="/some/file2"
-#   tapedev_2="/some/dev"
-#   tpchanger_3="chg-mtx"
-#   changerdev_3="/dev/mtx3"
-#   changerfile_3="/some/file3"
-#   tapedev_3="/some/dev"
-#
-# the tapedev_n entries are only needed if the changer script in question
-# uses tapedev.
-#
-
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-sbindir="@sbindir@"
-amlibexecdir="@amlibexecdir@"
-. "${amlibexecdir}/amanda-sh-lib.sh"
-
-# add sbin and ucb dirs
-PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
-export PATH
-
-#
-# debugging...
-#
-if [ -d "@AMANDA_DBGDIR@" ]; then
-       DBGFILE=@AMANDA_DBGDIR@/rait-changer.debug
-       KIDDEBUG=@AMANDA_DBGDIR@/changer.debug
-       WORK=@AMANDA_DBGDIR@/chgwork$$
-else
-       DBGFILE=/dev/null
-       KIDDEBUG=/dev/null
-       WORK=/tmp/chgwork$$
-fi
-
-exec 2>$DBGFILE
-echo `_ "arguments: "` $0 $* >&2
-set -x
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-        SUF="-@VERSION@";
-else
-       SUF=
-fi
-getconf=$sbindir/amgetconf$SUF
-
-
-changerfile=`$getconf changerfile`
-. $changerfile
-
-#
-# get config items that other changers use to put in our
-# fake amanda.conf files.
-#
-org=`$getconf ORG`
-mailto=`$getconf mailto`
-
-#
-# make a working directory (with amanda.conf) for each changer, and start the
-# changer script in background for each one
-#
-
-i=1
-while [ $i -le $nchangers ]
-do
-   eval tpchanger=\$tpchanger_$i
-   eval changerdev=\$changerdev_$i
-   eval changerfile=\$changerfile_$i
-   eval tapedev=\$tapedev_$i
-
-   mkdir -p $WORK/$i
-   (
-       cd $WORK/$i
-
-       cat >> amanda.conf <<EOF
-org            "$ORG"
-mailto         "$mailto"
-tpchanger      "$tpchanger"
-changerdev     "$changerdev"
-changerfile    "$changerfile"
-tapedev        "$tapedev"
-
-define tapetype EXABYTE {
-    comment "default tapetype"
-    length 4200 mbytes
-    filemark 48 kbytes
-    speed 474 kbytes
-}
-EOF
-
-       (
-           $tpchanger "$@"
-           echo "$?"> exitcode
-       )  > stdout 2>stderr &
-    )
-
-    i=`expr $i + 1`
-done
-wait
-
-#
-# once they've all finished, collect up the results
-#
-
-myexit=0
-myslot=-1
-mymax=65536
-myflag=1
-mydev=""
-mysep="{"
-
-case x$1 in
-x-slot|x-reset|x-eject|x-search|x-label)
-
-    #
-    # read slot number and device from each
-    # slot numbers must match(?!), and is our resulting slot number
-    # resulting device is {dev1,dev2,...} from each one
-    #
-    i=1
-    while [ $i -le $nchangers ]
-    do
-       read exitcode < $WORK/$i/exitcode
-       read n dev < $WORK/$i/stdout
-       echo -------------- >&2
-        cat $WORK/$i/stderr >&2
-       cat $KIDDEBUG >&2
-       echo -------------- >&2
-
-       if [ "$exitcode" != 0 ]
-       then
-           myexit=$exitcode
-       fi
-       if [ $myslot = -1 ]
-       then
-           myslot=$n
-       fi
-       if [ $n != $myslot ]
-       then
-            # synch error!
-           myexit=1
-           echo `_ 'stackers are out of synch, issue a reset'` >&2
-       fi
-       mydev="$mydev$mysep$dev"
-       mysep=","
-
-       i=`expr $i + 1`
-    done
-    mydev="rait:$mydev}"
-    echo $myslot $mydev
-    ;;
-x-info)
-    #
-    # read info from each
-    # slot numbers must match(?!), and is our resulting slot number
-    # minimum max slots is our resulting max slots
-    # if any can't go backwards, the aggregate can't either
-    #
-    i=1
-    while [ $i -le $nchangers ]
-    do
-       read exitcode < $WORK/$i/exitcode
-       read n max flag < $WORK/$i/stdout
-       echo -------------- >&2
-        cat $WORK/$i/stderr >&2
-       cat $KIDDEBUG >&2
-       echo -------------- >&2
-
-       if [ "$exitcode" != 0 ]
-       then
-            myexit=$exitcode
-       fi
-       if [ $myslot = -1 ]
-       then
-           myslot=$n
-       fi
-       if [ $n != $myslot ]
-       then
-            # synch error!
-           myexit=1
-           echo `_ 'stackers are out of synch, issue a -reset'` >&2
-       fi
-       if [ $max -lt $mymax ]
-       then
-           mymax=$max
-       fi
-       if [ $flag = 0 ]
-       then
-           myflag=0
-       fi
-       i=`expr $i + 1`
-    done
-    echo $myslot $mymax $myflag
-
-esac
-
-#
-# clean up work directories
-#
-rm -rf $WORK
-
-exit $myexit
diff --git a/changer-src/chg-rth.pl b/changer-src/chg-rth.pl
deleted file mode 100644 (file)
index fc9ea9e..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-#!@PERL@
-
-# Catch for sh/csh on systems without #! ability.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-       & eval 'exec @PERL@ -S $0 $argv:q'
-               if 0;
-
-# rth-changer - 
-#   A tape changer script for the Robotic Tape Handling system OEM'd
-#   by Andataco (RTH-406) for use with Amanda, the Advanced Maryland
-#   Network Disk Archiver.
-#
-#    Author: Erik Frederick 1/10/97
-#            edf@tyrell.mc.duke.edu
-#
-# This changer script controls the HP c1553 tape drive via a
-# Peripheral Vision Inc. SCSI control subsystem that interprets
-# commands sent on the SCSI bus.  It may work with other tape drives
-# containing the PVI board.
-#
-# Permission to freely use and distribute is granted.
-#
-
-require 5.001;
-
-use Getopt::Long;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-$pname = "rth-changer";
-
-$prefix="@prefix@";
-$prefix=$prefix;               # avoid warnings about possible typo
-$exec_prefix="@exec_prefix@";
-$exec_prefix=$exec_prefix;     # ditto
-$sbindir="@sbindir@";
-$amlibexecdir="@amlibexecdir@";
-
-if (-x "$sbindir/ammt") {
-       $MT="$sbindir/ammt";
-       $MTF="-f";
-} elsif (-x "@MT@") {
-       $MT="@MT@";
-       $MTF="@MT_FILE_FLAG@";
-} else {
-       print "<none> $pname: mt program not found\n";
-       exit(1);
-}
-
-$tapeDevice=`$sbindir/amgetconf tapedev`;
-die "tapedev not found in amanda.conf"
-       if !$tapeDevice or $tapeDevice eq "" or
-           $tapeDevice =~ m/no such parameter/;
-
-sub getCurrentTape {
-
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for getting current tape: $!\n";
-    exit(2);
-  }
-  if (syswrite(RTH, "Rd_ElS", 6) != 6) {
-    print "$currentTape $pname: error in writing `Rd_ElS' to `$tapeDevice': $!\n";
-    exit(2);
-  }
-  if (!close(RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' for getting current tape: $!\n";
-    exit(2);
-  }
-
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for getting current tape: $!\n";
-    exit(2);
-  }
-  if (sysread(RTH, $status, 136) != 136) {
-    print "$currentTape $pname: error in reading rth status.\n";
-    exit(2);
-  }
-  if (!close(RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' for getting current tape: $!\n";
-    exit(2);
-  }
-
-  @statusBits=unpack("c*",$status);
-
-  if( ($statusBits[18] == 0x1) || ($statusBits[18]== 0x9)) {
-    return ($statusBits[27]-1);
-  }
-
-  return (0);
-}
-
-
-sub getTapeStatus {
-
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for getting tape status: $!\n";
-    exit(2);
-  }
-  if (syswrite(RTH, "Rd_ElS", 6) != 6) {
-    print "$currentTape $pname: error in writing `Rd_ElS' to `$tapeDevice': $!\n";
-    exit(2);
-  }
-  if (!close(RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' for getting tpae status: $!\n";
-    exit(2);
-  }
-
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for getting tape status: $!\n";
-    exit(2);
-  }
-  if (sysread(RTH, $status, 136) != 136) {
-    print "$currentTape $pname: error in reading rth status for tape $currentTape.\n";
-    exit(2);
-  }
-  if (!close(RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' for getting tape status: $!\n";
-    exit(2);
-  }
-
-  @statusBits=unpack("c*",$status);
-
-  $curTape=0;
-  for($i=42;$i<187;$i+=16) {
-    if($statusBits[$i] == 0x9) {
-      $slots[$curTape] = 1;
-    }
-    else {
-      $slots[$curTape] = 0;
-    }
-    $curTape++;
-  }
-
-  return (@slots);
-}
-
-sub rthLoad {
-  my($tape) = @_;
-
-  $command = sprintf "GeT%d", $tape;
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for loading tape: $!\n";
-    exit(2);
-  }
-  if (syswrite(RTH, $command, 4) != 4) {
-    print "$currentTape $pname: error in loading tape by writing `$command' to `$tapeDevice': $!\n";
-    exit(2);
-  }
-  if (!close (RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' when trying to load tape: $!\n";
-    exit(2);
-  }
-}
-
-sub rthUnload {
-  my($tape) = @_;
-
-  $command = sprintf "PuT%d", $tape;
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for unloading tape: $!\n";
-    exit(2);
-  }
-  if (syswrite(RTH, $command, 4) != 4) {
-    print "$currentTape $pname: error in unloading tape by writing `$command' to `$tapeDevice': $!\n";
-    exit(2);
-  }
-  if (!close (RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' when trying to unload tape: $!\n";
-    exit(2);
-  }
-}
-
-sub testTape {
-  my($tape) = @_;
-
-  @slots=getTapeStatus();
-
-  if($currentTape == $tape) {
-    return;
-  }
-
-  if($slots[$tape-1] == 0) {
-    print "<none> $pname: no tape in slot requested\n";
-    exit(1);
-  }
-  if($tape>6) {
-    print $tape," $pname: requested a tape > 6\n";
-    exit(2);
-  }
-  if($tape<1) {
-    print $tape," $pname: requested a tape < 1\n";
-    exit(2);
-  }
-  return;
-}
-
-sub changeTape {
-  my($tape) = @_;
-
-  if($tape==$currentTape) {
-    return;
-  }
-
-  testTape($tape);
-
-  if($currentTape==0) {
-    rthLoad($tape);
-    $currentTape=$tape;
-    return;
-  }
-  else {
-    rthUnload($currentTape);
-    rthLoad($tape);
-    $currentTape=$tape;
-  }
-}
-    
-
-$result = &GetOptions("slot=s", "info", "reset", "eject"); 
-
-system($MT, 'rewind');
-
-$nSlots=6;
-$firstTape=1;
-$lastTape=6;
-$currentTape=getCurrentTape(); 
-
-if($opt_slot) {
-  if($opt_slot =~ /first/) {
-    changeTape(1);
-    print $currentTape, " ", $tapeDevice, "\n";
-  }
-  if($opt_slot =~ /last/) {
-    changeTape(6);
-    print $currentTape, " ", $tapeDevice, "\n";
-  }
-  if($opt_slot =~ /current/) {
-    changeTape($currentTape);
-    print $currentTape, " ", $tapeDevice, "\n";
-  }
-  if($opt_slot =~ /next/) {
-    $tape=$currentTape+1;
-    if ($tape>6) {
-      $tape=1;
-    }
-    changeTape($tape);
-    print $currentTape, " ", $tapeDevice,"\n";
-  }
-  if($opt_slot =~ /prev/) {
-    $tape=$currentTape-1;
-    if($tape<1) {
-      $tape=6;
-    }
-    changeTape($tape);
-    print $currentTape, " ", $tapeDevice,"\n";
-  }
-  if($opt_slot =~ /\d/) {
-    changeTape($opt_slot);
-    print $currentTape, " ", $tapeDevice,"\n";
-  }
-  if($opt_slot =~ /advance/) {
-    $tape=$currentTape+1;
-    if ($tape>6) {
-      $tape=1;
-    }
-    if($currentTape) { 
-      rthUnload($currentTape);
-    }
-    print $currentTape, " ", "/dev/null","\n";
-  }
-
-  exit 0;
-}
-
-if($opt_info) {
-  print $currentTape, " 6 1\n";
-
-  exit 0;
-}
-
-if($opt_reset) {
-  changeTape(1);
-  print $currentTape, " ",$tapeDevice,"\n";
-  exit 0;
-}
-
-if($opt_eject) {
-  if($currentTape) { 
-    rthUnload($currentTape);
-    print "0 ",$tapeDevice,"\n";
-    exit 0;
-  } 
-  else {
-    print "0 $pname: drive was not loaded\n";
-    exit 1;
-  }
-}
-
-print "$pname: No command was received.  Exiting.\n";
-exit 1;
diff --git a/changer-src/chg-scsi-chio.c b/changer-src/chg-scsi-chio.c
deleted file mode 100644 (file)
index 3489c67..0000000
+++ /dev/null
@@ -1,1021 +0,0 @@
-/*
- *  $Id: chg-scsi-chio.c,v 1.12 2006/07/25 18:18:46 martinea Exp $
- *
- *  chg-scsi-chio.c -- generic SCSI changer driver
- *
- *  This program provides a driver to control generic
- *  SCSI changers, no matter what platform.  The host/OS
- *  specific portions of the interface are implemented
- *  in libscsi.a, which contains a module for each host/OS.
- *  The actual interface for HP/UX is in scsi-hpux.c;
- *  chio is in scsi-chio.c, etc..  A prototype system
- *  dependent scsi interface file is in scsi-proto.c.
- *
- *  Copyright 1997, 1998 Eric Schnoebelen <eric@cirr.com>
- *
- * This module based upon seagate-changer, by Larry Pyeatt
- *                  <pyeatt@cs.colostate.edu>
- *
- * The original introductory comments follow:
- *
- * This program was written to control the Seagate/Conner/Archive
- * autoloading DAT drive.  This drive normally has 4 tape capacity
- * but can be expanded to 12 tapes with an optional tape cartridge.
- * This program may also work on onther drives.  Try it and let me
- * know of successes/failures.
- *
- * I have attempted to conform to the requirements for Amanda tape
- * changer interface.  There could be some bugs.  
- *
- * This program works for me under Linux with Gerd Knorr's 
- * <kraxel@cs.tu-berlin.de> SCSI media changer driver installed 
- * as a kernel module.  The kernel module is available at 
- * http://sunsite.unc.edu/pub/Linux/kernel/patches/scsi/scsi-changer*
- * Since the Linux media changer is based on NetBSD, this program
- * should also work for NetBSD, although I have not tried it.
- * It may be necessary to change the IOCTL calls to work on other
- * OS's.  
- *
- * (c) 1897 Larry Pyeatt,  pyeatt@cs.colostate.edu 
- * All Rights Reserved.
- * 
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation.  The author makes no representations about the
- * suitability of this software for any purpose.   It is provided "as is"
- * without express or implied warranty.
- *
- * Michael C. Povel 03.06.98 added ejetct_tape and sleep for external tape
- * devices, and changed some code to allow multiple drives to use their
- * own slots. Also added support for reserverd slots.
- * At the moment these parameters are hard coded and only tested under Linux
- * 
- */
-
-#include "config.h"
-#include "amanda.h"
-#include "conffile.h"
-#include "libscsi.h"
-#include "scsi-defs.h"
-int Tape_Ready1 ( char *tapedev , int wait);
-
-char *tapestatfile = NULL;
-
-/*----------------------------------------------------------------------------*/
-
-typedef enum{
-  NUMDRIVE,EJECT,SLEEP,CLEANMAX,DRIVE,START,END,CLEAN,DEVICE,STATFILE,CLEANFILE,DRIVENUM,
-    CHANGERDEV,USAGECOUNT,SCSITAPEDEV, TAPESTATFILE
-    } token_t;
-
-typedef struct {
-  char *word;
-  token_t token;
-} tokentable_t;
-
-tokentable_t t_table[]={
-  { "number_configs",  NUMDRIVE},
-  { "eject",           EJECT},
-  { "sleep",           SLEEP},
-  { "cleanmax",                CLEANMAX},
-  { "config",          DRIVE},
-  { "startuse",                START},
-  { "enduse",          END},
-  { "cleancart",       CLEAN},
-  { "dev",             DEVICE},
-  { "statfile",                STATFILE},
-  { "cleanfile",       CLEANFILE},
-  { "drivenum",                DRIVENUM},
-  { "changerdev",      CHANGERDEV},
-  { "usagecount",      USAGECOUNT},
-  { "scsitapedev",     SCSITAPEDEV},
-  { "tapestatus",      TAPESTATFILE},
-  { NULL,              -1 }
-};
-
-changer_t *changer;
-
-void   init_changer_struct(changer_t *chg, size_t number_of_config);
-void   dump_changer_struct(changer_t *chg);
-void   free_changer_struct(changer_t **changer);
-void   parse_line(char *linebuffer,int *token,char **value);
-int    read_config(char *configfile, changer_t *chg);
-int    get_current_slot(char *count_file);
-void   put_current_slot(char *count_file,int slot);
-void   usage(char *argv[]);
-int    get_relative_target(int fd,int nslots,char *parameter,int loaded, 
-                        char *changer_file,int slot_offset,int maxslot);
-int    is_positive_number(char *tmp);
-int    ask_clean(char *tapedev);
-void   clean_tape(int fd,char *tapedev,char *cnt_file, int drivenum, 
-                int cleancart, int maxclean,char *usagetime);
-int    main(int argc, char *argv[]);
-
-
-/*
- * Initialize data structures with default values
-*/
-void
-init_changer_struct(
-    changer_t *        chg,
-    size_t     number_of_config)
-{
-  size_t i;
-  memset(chg, 0, SIZEOF(*chg));
-  chg->number_of_configs = number_of_config;
-  chg->eject = 1;
-  chg->sleep = 0;
-  chg->cleanmax = 0;
-  chg->device = NULL;
-  chg->conf = alloc(SIZEOF(config_t) * number_of_config);
-  for (i=0; i < number_of_config; i++){
-    chg->conf[i].drivenum     = 0;
-    chg->conf[i].start        = -1;
-    chg->conf[i].end          = -1;
-    chg->conf[i].cleanslot    = -1;
-    chg->conf[i].device       = NULL;
-    chg->conf[i].slotfile     = NULL;
-    chg->conf[i].cleanfile    = NULL;
-    chg->conf[i].timefile     = NULL;
-    chg->conf[i].scsitapedev  = NULL;
-    chg->conf[i].tapestatfile = NULL;
-    chg->conf[i].changerident = NULL;
-    chg->conf[i].tapeident    = NULL;
-  }
-}
-
-/*
- * Dump of information for debug
-*/
-void
-dump_changer_struct(
-    changer_t *        chg)
-{
-  int i;
-
-  dbprintf(_("Number of configurations: %d\n"), chg->number_of_configs);
-  dbprintf(_("Tapes need eject: %s\n"), (chg->eject>0 ? _("Yes") : _("No")));
-  dbprintf(_("Tapes need sleep: %lld seconds\n"), (long long)chg->sleep);
-  dbprintf(_("Clean cycles    : %d\n"), chg->cleanmax);
-  dbprintf(_("Changer device  : %s\n"), chg->device);
-  for (i = 0; i < chg->number_of_configs; i++){
-    dbprintf(_("Tape config Nr: %d\n"), i);
-    dbprintf(_("  Drive number  : %d\n"), chg->conf[i].drivenum);
-    dbprintf(_("  Start slot    : %d\n"), chg->conf[i].start);
-    dbprintf(_("  End slot      : %d\n"), chg->conf[i].end);
-    dbprintf(_("  Clean slot    : %d\n"), chg->conf[i].cleanslot);
-    if (chg->conf[i].device != NULL)
-      dbprintf(_("  Device name   : %s\n"), chg->conf[i].device);
-    else
-      dbprintf(_("  Device name   : none\n"));
-    if (chg->conf[i].scsitapedev != NULL)
-      dbprintf(_("  SCSI Tape dev : %s\n"), chg->conf[i].scsitapedev);
-    else
-      dbprintf(_("  SCSI Tape dev : none\n"));
-    if (chg->conf[i].tapestatfile != NULL)
-      dbprintf(_("  stat file     : %s\n"), chg->conf[i].tapestatfile);
-    else
-      dbprintf(_("  stat file     : none\n"));
-    if (chg->conf[i].slotfile != NULL)
-      dbprintf(_("  Slot file     : %s\n"), chg->conf[i].slotfile);
-    else
-      dbprintf(_("  Slot file     : none\n"));
-    if (chg->conf[i].cleanfile != NULL)
-      dbprintf(_("  Clean file    : %s\n"), chg->conf[i].cleanfile);
-    else
-      dbprintf(_("  Clean file    : none\n"));
-    if (chg->conf[i].timefile != NULL)
-      dbprintf(_("  Usage count   : %s\n"), chg->conf[i].timefile);
-    else
-      dbprintf(_("  Usage count   : none\n"));
-  }
-}
-
-/*
- * Free all allocated memory
- */
-void
-free_changer_struct(
-changer_t **changer)
-{
-  changer_t *chg;
-  int i;
-
-  assert(changer != NULL);
-  assert(*changer != NULL);
-
-  chg = *changer;
-  if (chg->device != NULL)
-    amfree(chg->device);
-  for (i=0; i<chg->number_of_configs; i++){
-    if (chg->conf[i].device != NULL)
-      amfree(chg->conf[i].device);
-    if (chg->conf[i].slotfile != NULL)
-      amfree(chg->conf[i].slotfile);
-    if (chg->conf[i].cleanfile != NULL)
-      amfree(chg->conf[i].cleanfile);
-    if (chg->conf[i].timefile != NULL)
-      amfree(chg->conf[i].timefile);
-  }
-  if (chg->conf != NULL)
-    amfree(chg->conf);
-  chg->conf = NULL;
-  chg->device = NULL;
-  amfree(*changer);
-}
-
-/*
- * This function parses a line, and returns a token and value
- */
-void
-parse_line(
-    char *     linebuffer,
-    int *      token,
-    char **    value)
-{
-  char *tok;
-  int i;
-  int ready = 0;
-  *token = -1;  /* No Token found */
-  tok=strtok(linebuffer," \t\n");
-
-  while ((tok != NULL) && (tok[0]!='#')&&(ready==0)){
-    if (*token != -1){
-      *value=tok;
-      ready=1;
-    } else {
-      i=0;
-      while ((t_table[i].word != NULL)&&(*token==-1)){
-        if (0==strcasecmp(t_table[i].word,tok)){
-          *token=t_table[i].token;
-        }
-        i++;
-      }
-    }
-    tok=strtok(NULL," \t\n");
-  }
-  return;
-}
-
-/*
- * This function reads the specified configfile and fills the structure
-*/
-int
-read_config(
-    char *     configfile,
-    changer_t *        chg)
-{
-  size_t numconf;
-  FILE *file;
-  int init_flag = 0;
-  size_t drivenum=0;
-  char *linebuffer;
-  int token;
-  char *value;
-
-  numconf = 1;  /* At least one configuration is assumed */
-  /* If there are more, it should be the first entry in the configurationfile */
-
-  if (NULL==(file=fopen(configfile,"r"))){
-    return (-1);
-  }
-
-  while (NULL != (linebuffer = agets(file))) {
-      if (linebuffer[0] == '\0') {
-       amfree(linebuffer);
-       continue;
-      }
-      parse_line(linebuffer,&token,&value);
-      if (token != -1){
-        if (0==init_flag) {
-          if (token != NUMDRIVE){
-            init_changer_struct(chg, numconf);
-          } else {
-            numconf = atoi(value);
-            init_changer_struct(chg, numconf);
-          }
-          init_flag=1;
-        }
-        switch (token){
-        case NUMDRIVE: if ((size_t)atoi(value) != numconf)
-          g_fprintf(stderr,_("Error: number_drives at wrong place, should be "
-                  "first in file\n"));
-        break;
-        case EJECT:
-          chg->eject = atoi(value);
-          break;
-        case SLEEP:
-          chg->sleep = atoi(value);
-          break;
-        case CHANGERDEV:
-          chg->device = stralloc(value);
-          break;
-        case SCSITAPEDEV:
-          chg->conf[drivenum].scsitapedev = stralloc(value);
-          break;
-        case TAPESTATFILE:
-          chg->conf[drivenum].tapestatfile = stralloc(value);
-          break;
-        case CLEANMAX:
-          chg->cleanmax = atoi(value);
-          break;
-        case DRIVE:
-          drivenum = atoi(value);
-          if(drivenum >= numconf){
-            g_fprintf(stderr,_("Error: drive must be less than number_drives\n"));
-          }
-          break;
-        case DRIVENUM:
-          if (drivenum < numconf){
-            chg->conf[drivenum].drivenum = atoi(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " drivenum ignored\n"));
-          }
-          break;
-        case START:
-          if (drivenum < numconf){
-            chg->conf[drivenum].start = atoi(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " startuse ignored\n"));
-          }
-          break;
-        case END:
-          if (drivenum < numconf){
-            chg->conf[drivenum].end = atoi(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " enduse ignored\n"));
-          }
-          break;
-        case CLEAN:
-          if (drivenum < numconf){
-            chg->conf[drivenum].cleanslot = atoi(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " cleanslot ignored\n"));
-          }
-          break;
-        case DEVICE:
-          if (drivenum < numconf){
-            chg->conf[drivenum].device = stralloc(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " device ignored\n"));
-          }
-          break;
-        case STATFILE:
-          if (drivenum < numconf){
-            chg->conf[drivenum].slotfile = stralloc(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " slotfile ignored\n"));
-          }
-          break;
-        case CLEANFILE:
-          if (drivenum < numconf){
-            chg->conf[drivenum].cleanfile = stralloc(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " cleanfile ignored\n"));
-          }
-          break;
-        case USAGECOUNT:
-          if (drivenum < numconf){
-            chg->conf[drivenum].timefile = stralloc(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " usagecount ignored\n"));
-          }
-          break;
-        default:
-          g_fprintf(stderr,_("Error: Unknown token\n"));
-          break;
-        }
-      }
-    amfree(linebuffer);
-  }
-  amfree(linebuffer);
-
-  fclose(file);
-  return 0;
-}
-
-/*----------------------------------------------------------------------------*/
-
-/*  The tape drive does not have an idea of current slot so
- *  we use a file to store the current slot.  It is not ideal
- *  but it gets the job done  
- */
-int get_current_slot(char *count_file)
-{
-  FILE *inf;
-  int retval;
-  if ((inf=fopen(count_file,"r")) == NULL) {
-    g_fprintf(stderr, _("%s: unable to open current slot file (%s)\n"),
-            get_pname(), count_file);
-    return 0;
-  }
-
-  if (fscanf(inf, "%d", &retval) != 1) {
-    g_fprintf(stderr, _("%s: unable to read current slot file (%s)\n"),
-            get_pname(), count_file);
-    retval = 0;
-  }
-
-  fclose(inf);
-  return retval;
-}
-
-void put_current_slot(char *count_file,int slot)
-{
-  FILE *inf;
-
-  if ((inf=fopen(count_file,"w")) == NULL) {
-    g_fprintf(stderr, _("%s: unable to open current slot file (%s)\n"),
-            get_pname(), count_file);
-    exit(2);
-  }
-  g_fprintf(inf, "%d\n", slot);
-  fclose(inf);
-}
-
-/* ---------------------------------------------------------------------- 
-   This stuff deals with parsing the command line */
-
-typedef struct com_arg
-{
-  char *str;
-  int command_code;
-  int takesparam;
-} argument;
-
-
-typedef struct com_stru
-{
-  int command_code;
-  char *parameter;
-} command;
-
-
-void   parse_args(int argc, char *argv[], command *rval);
-
-/* major command line args */
-#define COMCOUNT 5
-#define COM_SLOT 0
-#define COM_INFO 1
-#define COM_RESET 2
-#define COM_EJECT 3
-#define COM_CLEAN 4
-argument argdefs[]={{"-slot",COM_SLOT,1},
-                    {"-info",COM_INFO,0},
-                    {"-reset",COM_RESET,0},
-                    {"-eject",COM_EJECT,0},
-                    {"-clean",COM_CLEAN,0}};
-
-
-/* minor command line args */
-#define SLOTCOUNT 5
-#define SLOT_CUR 0
-#define SLOT_NEXT 1
-#define SLOT_PREV 2
-#define SLOT_FIRST 3
-#define SLOT_LAST 4
-argument slotdefs[]={{"current",SLOT_CUR,0},
-                     {"next",SLOT_NEXT,0},
-                     {"prev",SLOT_PREV,0},
-                     {"first",SLOT_FIRST,0},
-                     {"last",SLOT_LAST,0}};
-
-int is_positive_number(char *tmp) /* is the string a valid positive int? */
-{
-  int i=0;
-  if ((tmp==NULL)||(tmp[0]==0))
-    return 0;
-  while ((tmp[i]>='0')&&(tmp[i]<='9')&&(tmp[i]!=0))
-    i++;
-  if (tmp[i]==0)
-    return 1;
-  else
-    return 0;
-}
-
-void usage(char *argv[])
-{
-  int cnt;
-  g_printf(_("%s: Usage error.\n"), argv[0]);
-  for (cnt=0; cnt < COMCOUNT; cnt++){
-    g_printf("      %s    %s",argv[0],argdefs[cnt].str);
-    if (argdefs[cnt].takesparam)
-      g_printf(_(" <param>\n"));
-    else
-      g_printf("\n");
-  }
-  exit(2);
-}
-
-
-void parse_args(int argc, char *argv[],command *rval)
-{
-  int i=0;
-  if ((argc < 2) || (argc > 3)) {
-    usage(argv);
-    /*NOTREACHED*/
-  }
-
-  while ((i<COMCOUNT)&&(strcmp(argdefs[i].str,argv[1])))
-    i++;
-  if (i == COMCOUNT) {
-    usage(argv);
-    /*NOTREACHED*/
-  }
-  rval->command_code = argdefs[i].command_code;
-  if (argdefs[i].takesparam) {
-    if (argc < 3) {
-      usage(argv);
-      /*NOTREACHED*/
-    }
-    rval->parameter=argv[2];      
-  }
-  else {
-    if (argc > 2) {
-      usage(argv);
-      /*NOTREACHED*/
-    }
-    rval->parameter=0;
-  }
-}
-
-/* used to find actual slot number from keywords next, prev, first, etc */
-int
-get_relative_target(
-    int                fd,
-    int                nslots,
-    char *     parameter,
-    int                loaded, 
-    char *     changer_file,
-    int                slot_offset,
-    int                maxslot)
-{
-  int current_slot,i;
-
-  (void)loaded;                /* Quiet unused warning */
-  if (changer_file != NULL)
-    {
-      current_slot=get_current_slot(changer_file);
-    } else {
-      current_slot =   GetCurrentSlot(fd, 0);
-    }
-  if (current_slot > maxslot){
-    current_slot = slot_offset;
-  }
-  if (current_slot < slot_offset){
-    current_slot = slot_offset;
-  }
-
-  i=0;
-  while((i < SLOTCOUNT) && (strcmp(slotdefs[i].str,parameter)))
-    i++;
-
-  switch(i) {
-  case SLOT_CUR:
-    break;
-
-  case SLOT_NEXT:
-    if (++current_slot==nslots+slot_offset)
-      return slot_offset;
-    break;
-
-  case SLOT_PREV:
-    if (--current_slot<slot_offset)
-      return maxslot;
-    break;
-
-  case SLOT_FIRST:
-    return slot_offset;
-
-  case SLOT_LAST:
-    return maxslot;
-
-  default: 
-    g_printf(_("<none> no slot `%s'\n"),parameter);
-    close(fd);
-    exit(2);
-    /*NOTREACHED*/
-  }
-  return current_slot;
-}
-
-/*
- * This function should ask the drive if it wants to be cleaned
- */
-int
-ask_clean(
-    char *     tapedev)
-{
-  return get_clean_state(tapedev);
-}
-
-/*
- * This function should move the cleaning cartridge into the drive
- */
-void
-clean_tape(
-    int                fd,
-    char *     tapedev,
-    char *     cnt_file,
-    int                drivenum,
-    int                cleancart,
-    int                maxclean,
-    char *     usagetime)
-{
-  int counter;
-  char *mailer;
-
-  if (cleancart == -1 ){
-    return;
-  }
-
-  mailer = getconf_str(CNF_MAILER);
-
-  /* Now we should increment the counter */
-  if (cnt_file != NULL){
-    counter = get_current_slot(cnt_file);
-    counter++;
-    if (counter>=maxclean){
-      /* Now we should inform the administrator */
-      char *mail_cmd;
-      FILE *mailf;
-      int mail_pipe_opened = 1;
-      if (mailer && *mailer != '\0') {
-        if (getconf_seen(CNF_MAILTO) && strlen(getconf_str(CNF_MAILTO)) > 0 && 
-           validate_mailto(getconf_str(CNF_MAILTO))) {
-          mail_cmd = vstralloc(mailer,
-                             " -s", " \"", _("AMANDA PROBLEM: PLEASE FIX"), "\"",
-                             " ", getconf_str(CNF_MAILTO),
-                             NULL);
-          if ((mailf = popen(mail_cmd, "w")) == NULL) {
-                 g_printf(_("Mail failed\n"));
-                 error(_("could not open pipe to \"%s\": %s"),
-                       mail_cmd, strerror(errno));
-                 /*NOTREACHED*/
-         }
-        } else {
-          mail_pipe_opened = 0;
-          mailf = stderr;
-           g_fprintf(mailf, _("\nNo mail recipient specified, output redirected to stderr"));
-        }
-      } else {
-        mail_pipe_opened = 0;
-        mailf = stderr;
-        g_fprintf(mailf, _("\nNo mailer specified; output redirected to stderr"));
-      }
-      g_fprintf(mailf, _("\nThe usage count of your cleaning tape in slot %d"),
-             cleancart);
-      g_fprintf(mailf,_("\nis more than %d. (cleanmax)"),maxclean);
-      g_fprintf(mailf,_("\nTapedrive %s needs to be cleaned"),tapedev);
-      g_fprintf(mailf,_("\nPlease insert a new cleaning tape and reset"));
-      g_fprintf(mailf,_("\nthe countingfile %s"),cnt_file);
-
-      if(mail_pipe_opened == 1 && pclose(mailf) != 0) {
-        error(_("mail command failed: %s"), mail_cmd);
-               /*NOTREACHED*/
-      }
-      
-
-      return;
-    }
-    put_current_slot(cnt_file,counter);
-  }
-  load(fd,drivenum,cleancart);
-  
-  if (drive_loaded(fd, drivenum))
-    unload(fd,drivenum,cleancart);  
-  unlink(usagetime);
-}
-/* ----------------------------------------------------------------------*/
-
-int
-main(
-    int                argc,
-    char **    argv)
-{
-  int loaded;
-  int target = -1;
-  int oldtarget;
-  command com;   /* a little DOS joke */
-  
-  /*
-   * drive_num really should be something from the config file, but..
-   * for now, it is set to zero, since most of the common changers
-   * used by amanda only have one drive ( until someone wants to 
-   * use an EXB60/120, or a Breece Hill Q45.. )
-   */
-  int    drive_num = 0;
-  int need_eject = 0; /* Does the drive need an eject command ? */
-  unsigned need_sleep = 0; /* How many seconds to wait for the drive to get ready */
-  int clean_slot = -1;
-  int maxclean = 0;
-  char *clean_file=NULL;
-  char *time_file=NULL;
-
-  int use_slots;
-  int slot_offset;
-  int confnum;
-
-  int fd, slotcnt, drivecnt;
-  int endstatus = 0;
-  char *changer_dev = NULL;
-  char *tape_device = NULL;
-  char *changer_file = NULL;
-  char *scsitapedevice = NULL;
-
-  /*
-   * Configure program for internationalization:
-   *   1) Only set the message locale for now.
-   *   2) Set textdomain for all amanda related programs to "amanda"
-   *      We don't want to be forced to support dozens of message catalogs.
-   */  
-  setlocale(LC_MESSAGES, "C");
-  textdomain("amanda"); 
-
-  set_pname("chg-scsi");
-
-  /* Don't die when child closes pipe */
-  signal(SIGPIPE, SIG_IGN);
-
-  dbopen(DBG_SUBDIR_SERVER);
-  parse_args(argc,argv,&com);
-
-  changer = alloc(SIZEOF(changer_t));
-  config_init(CONFIG_INIT_USE_CWD, NULL);
-
-  if (config_errors(NULL) >= CFGERR_WARNINGS) {
-    config_print_errors();
-    if (config_errors(NULL) >= CFGERR_ERRORS) {
-      g_critical(_("errors processing config file"));
-    }
-  }
-
-  changer_dev = getconf_str(CNF_CHANGERDEV);
-  changer_file = getconf_str(CNF_CHANGERFILE);
-  tape_device = getconf_str(CNF_TAPEDEV);
-
-  /* Get the configuration parameters */
-
-  if (strlen(tape_device)==1){
-    read_config(changer_file, changer);
-    confnum=atoi(tape_device);
-    use_slots    = changer->conf[confnum].end-changer->conf[confnum].start+1;
-    slot_offset  = changer->conf[confnum].start;
-    drive_num    = changer->conf[confnum].drivenum;
-    need_eject   = changer->eject;
-    need_sleep   = changer->sleep;
-    clean_file   = stralloc(changer->conf[confnum].cleanfile);
-    clean_slot   = changer->conf[confnum].cleanslot;
-    maxclean     = changer->cleanmax;
-    if (NULL != changer->conf[confnum].timefile)
-      time_file = stralloc(changer->conf[confnum].timefile);
-    if (NULL != changer->conf[confnum].slotfile)
-      changer_file = stralloc(changer->conf[confnum].slotfile);
-    else
-      changer_file = NULL;
-    if (NULL != changer->conf[confnum].device)
-      tape_device  = stralloc(changer->conf[confnum].device);
-    if (NULL != changer->device)
-      changer_dev  = stralloc(changer->device); 
-    if (NULL != changer->conf[confnum].scsitapedev)
-      scsitapedevice = stralloc(changer->conf[confnum].scsitapedev);
-    if (NULL != changer->conf[confnum].tapestatfile)
-      tapestatfile = stralloc(changer->conf[confnum].tapestatfile);
-    dump_changer_struct(changer);
-    /* get info about the changer */
-    fd = OpenDevice(INDEX_CHANGER , changer_dev,
-                       "changer_dev", changer->conf[confnum].changerident);
-    if (fd == -1) {
-      int localerr = errno;
-      g_fprintf(stderr, _("%s: open: %s: %s\n"), get_pname(), 
-              changer_dev, strerror(localerr));
-      g_printf(_("%s open: %s: %s\n"), "<none>", changer_dev, strerror(localerr));
-      dbprintf(_("open: %s: %s\n"), changer_dev, strerror(localerr));
-      return 2;
-    }
-
-    if (tape_device == NULL)
-      {
-        tape_device = stralloc(changer_dev);
-      }
-
-    if (scsitapedevice == NULL)
-      {
-         scsitapedevice = stralloc(tape_device);
-      }
-
-    if ((changer->conf[confnum].end == -1) || (changer->conf[confnum].start == -1)){
-      slotcnt = get_slot_count(fd);
-      use_slots    = slotcnt;
-      slot_offset  = 0;
-    }
-    free_changer_struct(&changer);
-  } else {
-    /* get info about the changer */
-    confnum = 0;
-    fd = OpenDevice(INDEX_CHANGER , changer_dev,
-                       "changer_dev", changer->conf[confnum].changerident);
-    if (fd == -1) {
-      int localerr = errno;
-      g_fprintf(stderr, _("%s: open: %s: %s\n"), get_pname(), 
-              changer_dev, strerror(localerr));
-      g_printf(_("%s open: %s: %s\n"), _("<none>"), changer_dev, strerror(localerr));
-      dbprintf(_("open: %s: %s\n"), changer_dev, strerror(localerr));
-      return 2;
-    }
-    slotcnt = get_slot_count(fd);
-    use_slots    = slotcnt;
-    slot_offset  = 0;
-    drive_num    = 0;
-    need_eject   = 0;
-    need_sleep   = 0;
-  }
-
-  drivecnt = get_drive_count(fd);
-
-  if (drive_num > drivecnt) {
-    g_printf(_("%s drive number error (%d > %d)\n"), _("<none>"), 
-           drive_num, drivecnt);
-    g_fprintf(stderr, _("%s: requested drive number (%d) greater than "
-            "number of supported drives (%d)\n"), get_pname(), 
-            drive_num, drivecnt);
-    dbprintf(_("requested drive number (%d) greater than "
-              "number of supported drives (%d)\n"), drive_num, drivecnt);
-    CloseDevice("", fd);
-    return 2;
-  }
-
-  loaded = drive_loaded(fd, drive_num);
-
-  switch(com.command_code) {
-  case COM_SLOT:  /* slot changing command */
-    if (is_positive_number(com.parameter)) {
-      if ((target = atoi(com.parameter))>=use_slots) {
-        g_printf(_("<none> no slot `%d'\n"),target);
-        close(fd);
-        endstatus = 2;
-        break;
-      } else {
-        target = target+slot_offset;
-      }
-    } else
-      target=get_relative_target(fd, use_slots,
-                                 com.parameter,
-                                 loaded, 
-                                 changer_file,slot_offset,slot_offset+use_slots);
-    if (loaded) {
-      if (changer_file != NULL)
-        {
-          oldtarget=get_current_slot(changer_file);
-        } else {
-          oldtarget = GetCurrentSlot(fd, drive_num);
-        }
-      if ((oldtarget)!=target) {
-        if (need_eject)
-          eject_tape(scsitapedevice, need_eject);
-        (void)unload(fd, drive_num, oldtarget);
-        if (ask_clean(scsitapedevice))
-          clean_tape(fd,tape_device,clean_file,drive_num,
-                     clean_slot,maxclean,time_file);
-        loaded=0;
-      }
-    }
-    if (changer_file != NULL)
-      {
-      put_current_slot(changer_file, target);
-    }
-    if (!loaded && isempty(fd, target)) {
-      g_printf(_("%d slot %d is empty\n"),target-slot_offset,
-             target-slot_offset);
-      close(fd);
-      endstatus = 1;
-      break;
-    }
-    if (!loaded)
-      if (load(fd, drive_num, target) != 0) {
-        g_printf(_("%d slot %d move failed\n"),target-slot_offset,
-               target-slot_offset);  
-        close(fd);
-        endstatus = 2;
-        break;
-      }
-    if (need_sleep)
-      Tape_Ready1(scsitapedevice, need_sleep);
-    g_printf(_("%d %s\n"), target-slot_offset, tape_device);
-    break;
-
-  case COM_INFO:
-    if (changer_file != NULL)
-      {
-        g_printf("%d ", get_current_slot(changer_file)-slot_offset);
-      } else {
-        g_printf("%d ", GetCurrentSlot(fd, drive_num)-slot_offset);
-      }
-    g_printf("%d 1\n", use_slots);
-    break;
-
-  case COM_RESET:
-    if (changer_file != NULL)
-      {
-        target=get_current_slot(changer_file);
-      } else {
-        target = GetCurrentSlot(fd, drive_num);
-      }
-    if (loaded) {
-      if (!isempty(fd, target))
-        target=find_empty(fd,0 ,0);
-      if (need_eject)
-        eject_tape(scsitapedevice, need_eject);
-      (void)unload(fd, drive_num, target);
-      if (ask_clean(scsitapedevice))
-        clean_tape(fd,tape_device,clean_file,drive_num,clean_slot,
-                   maxclean,time_file);
-    }
-
-    if (isempty(fd, slot_offset)) {
-      g_printf(_("0 slot 0 is empty\n"));
-      close(fd);
-      endstatus = 1;
-      break;
-    }
-
-    if (load(fd, drive_num, slot_offset) != 0) {
-      g_printf(_("%d slot %d move failed\n"),slot_offset,
-             slot_offset);  
-      close(fd);
-      endstatus = 2;
-      break;
-    }
-    if (changer_file != NULL)
-    {
-      put_current_slot(changer_file, slot_offset);
-    }
-    if (need_sleep)
-      Tape_Ready1(scsitapedevice, need_sleep);
-    if (changer_file != NULL)
-      {
-        g_printf("%d %s\n", get_current_slot(changer_file), tape_device);
-      } else {
-        g_printf("%d %s\n", GetCurrentSlot(fd, drive_num), tape_device);
-      }
-    break;
-
-  case COM_EJECT:
-    if (loaded) {
-      if (changer_file != NULL)
-        {
-          target=get_current_slot(changer_file);
-        } else {
-          target = GetCurrentSlot(fd, drive_num);
-        }
-      if (need_eject)
-        eject_tape(scsitapedevice, need_eject);
-      (void)unload(fd, drive_num, target);
-      if (ask_clean(scsitapedevice))
-        clean_tape(fd,tape_device,clean_file,drive_num,clean_slot,
-                   maxclean,time_file);
-      g_printf("%d %s\n", target, tape_device);
-    } else {
-      g_printf(_("%d drive was not loaded\n"), target);
-      endstatus = 1;
-    }
-    break;
-  case COM_CLEAN:
-    if (loaded) {
-      if (changer_file  != NULL)
-        {
-          target=get_current_slot(changer_file);
-        } else {
-          target = GetCurrentSlot(fd, drive_num);
-        }
-      if (need_eject)
-        eject_tape(scsitapedevice, need_eject);
-      (void)unload(fd, drive_num, target);
-    } 
-    clean_tape(fd,tape_device,clean_file,drive_num,clean_slot,
-               maxclean,time_file);
-    g_printf(_("%s cleaned\n"), tape_device);
-    break;
-  };
-
-  CloseDevice("", 0);
-  dbclose();
-  return endstatus;
-}
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * tab-width: 4
- * End:
- */
diff --git a/changer-src/chg-scsi.c b/changer-src/chg-scsi.c
deleted file mode 100644 (file)
index 221f476..0000000
+++ /dev/null
@@ -1,1968 +0,0 @@
-static char rcsid[] = "$Id: chg-scsi.c,v 1.52 2006/07/25 18:18:46 martinea Exp $";
-/*
- * 
- *
- *  chg-scsi.c -- generic SCSI changer driver
- *
- *  This program provides the framework to control
- *  SCSI changers. It is based on the original chg-scsi
- *  from Eric Schnoebelen <eric@cirr.com> (Original copyright below)
- *  The device dependent part is handled by scsi-changer-driver.c
- *  The SCSI OS interface is handled by scsi-ostype.c
- *
- *  Original copyrights:
- *
- *  This program provides a driver to control generic
- *  SCSI changers, no matter what platform.  The host/OS
- *  specific portions of the interface are implemented
- *  in libscsi.a, which contains a module for each host/OS.
- *  The actual interface for HP/UX is in scsi-hpux.c;
- *  chio is in scsi-chio.c, etc..  A prototype system
- *  dependent scsi interface file is in scsi-proto.c.
- *
- *  Copyright 1997, 1998 Eric Schnoebelen <eric@cirr.com>
- *
- * This module based upon seagate-changer, by Larry Pyeatt
- *                  <pyeatt@cs.colostate.edu>
- *
- * The original introductory comments follow:
- *
- * This program was written to control the Seagate/Conner/Archive
- * autoloading DAT drive.  This drive normally has 4 tape capacity
- * but can be expanded to 12 tapes with an optional tape cartridge.
- * This program may also work on onther drives.  Try it and let me
- * know of successes/failures.
- *
- * I have attempted to conform to the requirements for Amanda tape
- * changer interface.  There could be some bugs.  
- *
- * This program works for me under Linux with Gerd Knorr's 
- * <kraxel@cs.tu-berlin.de> SCSI media changer driver installed 
- * as a kernel module.  The kernel module is available at 
- * http://sunsite.unc.edu/pub/Linux/kernel/patches/scsi/scsi-changer*
- * Since the Linux media changer is based on NetBSD, this program
- * should also work for NetBSD, although I have not tried it.
- * It may be necessary to change the IOCTL calls to work on other
- * OS's.  
- *
- * (c) 1897 Larry Pyeatt,  pyeatt@cs.colostate.edu 
- * All Rights Reserved.
- * 
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation.  The author makes no representations about the
- * suitability of this software for any purpose.   It is provided "as is"
- * without express or implied warranty.
- *
- * Michael C. Povel 03.06.98 added ejetct_tape and sleep for external tape
- * devices, and changed some code to allow multiple drives to use their
- * own slots. Also added support for reserverd slots.
- * At the moment these parameters are hard coded and only tested under Linux
- * 
- */
-
-
-#include "config.h"
-#include "amanda.h"
-#include "conffile.h"
-#include "libscsi.h"
-#include "scsi-defs.h"
-
-char *tapestatfile = NULL;
-FILE *debug_file = NULL;
-
-/* 
- * So we have 3 devices, here will all the infos be stored after an
- * successfull open 
- */
-
-OpenFiles_T *pDev = NULL;
-
-/* Defined in scsi-changer-driver.c
- */
-extern int ElementStatusValid;
-extern ElementInfo_T *pMTE; /*Medium Transport Element */
-extern ElementInfo_T *pSTE; /*Storage Element */
-extern ElementInfo_T *pIEE; /*Import Export Element */
-extern ElementInfo_T *pDTE; /*Data Transfer Element */
-extern size_t MTE;             /*Counter for the above element types */
-extern size_t STE;
-extern size_t IEE;
-extern size_t DTE;
-
-int do_inventory = 0;     /* Set if load/unload functions thinks an inventory should be done */
-int clean_slot = -1;
-
-typedef enum{
-  NUMDRIVE,EJECT,SLEEP,CLEANMAX,DRIVE,START,END,CLEAN,DEVICE,STATFILE,CLEANFILE,DRIVENUM,
-    CHANGERDEV,USAGECOUNT,SCSITAPEDEV, TAPESTATFILE, LABELFILE, CHANGERIDENT,
-    TAPEIDENT, EMUBARCODE, HAVEBARCODE, DEBUGLEVEL, AUTOINV
-    } token_t;
-
-typedef struct {
-  char *word;
-  token_t token;
-} tokentable_t;
-
-tokentable_t t_table[] = {
-  { "number_configs",  NUMDRIVE},
-  { "autoinv",         AUTOINV},
-  { "eject",           EJECT},
-  { "sleep",           SLEEP},
-  { "cleanmax",                CLEANMAX},
-  { "config",          DRIVE},
-  { "startuse",                START},
-  { "enduse",          END},
-  { "cleancart",       CLEAN},
-  { "dev",             DEVICE},
-  { "statfile",                STATFILE},
-  { "cleanfile",       CLEANFILE},
-  { "drivenum",                DRIVENUM},
-  { "changerdev",      CHANGERDEV},
-  { "usagecount",      USAGECOUNT},
-  { "scsitapedev",     SCSITAPEDEV},
-  { "tapestatus",      TAPESTATFILE},
-  { "labelfile",       LABELFILE},
-  { "changerident",    CHANGERIDENT},
-  { "tapeident",       TAPEIDENT},
-  { "emubarcode",      EMUBARCODE},
-  { "havebarcode",     HAVEBARCODE},
-  { "debuglevel",      DEBUGLEVEL},
-  { NULL,              -1 }
-};
-changer_t *changer;
-int ask_clean(char *tapedev);
-int get_current_slot(char *count_file);
-int get_relative_target(int fd, int nslots, char *parameter,
-               int param_index, int loaded, char *slot_file,
-               int slot_offset, int maxslot);
-int is_positive_number(char *tmp);
-int MapBarCode(char *labelfile, MBC_T *result);
-int read_config(char *configfile, changer_t *chg);
-void clean_tape(int fd, char *tapedev, char *cnt_file, int drivenum,
-               int cleancart, int maxclean, char *usagetime);
-void dump_changer_struct(changer_t *chg);
-void free_changer_struct(changer_t **chg);
-void init_changer_struct(changer_t *chg, int number_of_config);
-void parse_line(char *linebuffer, int *token,char **value);
-void put_current_slot(char *count_file, int slot);
-void usage(char *argv[]);
-
-int main(int argc, char *argv[]);
-
-
-/* Initialize data structures with default values */
-void
-init_changer_struct(
-    changer_t *chg,
-    int number_of_config)
-{
-  int i;
-  memset(chg, 0, SIZEOF(*chg));
-  chg->number_of_configs = number_of_config;
-  chg->eject = 1;
-  chg->conf = alloc(SIZEOF(config_t) * (size_t)number_of_config);
-  for (i=0; i < number_of_config; i++){
-    chg->conf[i].drivenum     = 0;
-    chg->conf[i].start        = -1;
-    chg->conf[i].end          = -1;
-    chg->conf[i].cleanslot    = -1;
-    chg->conf[i].device       = NULL;
-    chg->conf[i].slotfile     = NULL;
-    chg->conf[i].cleanfile    = NULL;
-    chg->conf[i].timefile     = NULL;
-    chg->conf[i].scsitapedev  = NULL;
-    chg->conf[i].tapestatfile = NULL;
-    chg->conf[i].changerident = NULL;
-    chg->conf[i].tapeident    = NULL;
-  }
-}
-
-/* Dump of information for debug */
-void
-dump_changer_struct(
-    changer_t *chg)
-{
-  int i;
-
-  dbprintf(_("Number of configurations: %d\n"), chg->number_of_configs);
-  dbprintf(_("Tapes need eject: %s\n"), (chg->eject>0 ? _("Yes") : _("No")));
-       dbprintf (_("\traw: %d\n"),chg->eject);
-  dbprintf(_("Inv. auto update: %s\n"), (chg->autoinv>0 ? _("Yes") : _("No")));
-  dbprintf (_("\traw: %d\n"),chg->autoinv);
-  dbprintf(_("barcode reader  : %s\n"), (chg->havebarcode>0 ? _("Yes") : _("No")));
-  dbprintf (_("\traw: %d\n"),chg->havebarcode);
-  dbprintf(_("Emulate Barcode : %s\n"), (chg->emubarcode>0 ? _("Yes") : _("No")));
-  dbprintf (_("\traw: %d\n"),chg->emubarcode);
-  if (chg->debuglevel != NULL)
-     dbprintf(_("debug level     : %s\n"), chg->debuglevel);
-  dbprintf(_("Tapes need sleep: %ld seconds\n"), (long int)chg->sleep);
-  dbprintf(_("Clean cycles    : %d\n"), chg->cleanmax);
-  dbprintf(_("Changer device  : %s\n"), chg->device);
-  if (chg->labelfile != NULL)
-    dbprintf(_("Label file      : %s\n"), chg->labelfile);
-  for (i=0; i<chg->number_of_configs; i++){
-    dbprintf(_("Tape config Nr: %d\n"), i);
-    dbprintf(_("  Drive number  : %d\n"), chg->conf[i].drivenum);
-    dbprintf(_("  Start slot    : %d\n"), chg->conf[i].start);
-    dbprintf(_("  End slot      : %d\n"), chg->conf[i].end);
-    dbprintf(_("  Clean slot    : %d\n"), chg->conf[i].cleanslot);
-
-    if (chg->conf[i].device != NULL)
-      dbprintf(_("  Device name   : %s\n"), chg->conf[i].device);
-    else
-      dbprintf(_("  Device name   : none\n"));
-
-    if (chg->conf[i].changerident != NULL)
-      dbprintf(_("  changer ident : %s\n"), chg->conf[i].changerident);
-    else
-      dbprintf(_("  changer ident : none\n"));
-
-    if (chg->conf[i].scsitapedev != NULL)
-      dbprintf(_("  SCSI Tape dev : %s\n"), chg->conf[i].scsitapedev);
-    else
-      dbprintf(_("  SCSI Tape dev : none\n"));
-
-    if (chg->conf[i].tapeident != NULL)
-      dbprintf(_("  tape ident    : %s\n"), chg->conf[i].tapeident);
-    else
-      dbprintf(_("  tape ident    : none\n"));
-
-    if (chg->conf[i].tapestatfile != NULL)
-      dbprintf(_("  stat file     : %s\n"), chg->conf[i].tapestatfile);
-    else
-      dbprintf(_("  stat file     : none\n"));
-
-    if (chg->conf[i].slotfile != NULL)
-      dbprintf(_("  Slot file     : %s\n"), chg->conf[i].slotfile);
-    else
-      dbprintf(_("  Slot file     : none\n"));
-
-    if (chg->conf[i].cleanfile != NULL)
-      dbprintf(_("  Clean file    : %s\n"), chg->conf[i].cleanfile);
-    else
-      dbprintf(_("  Clean file    : none\n"));
-
-    if (chg->conf[i].timefile != NULL)
-      dbprintf(_("  Usage count   : %s\n"), chg->conf[i].timefile);
-    else
-      dbprintf(_("  Usage count   : none\n"));
-  }
-}
-
-/* Free all allocated memory */
-void
-free_changer_struct(
-    changer_t **changer)
-{
-  changer_t *chg;
-  int i;
-
-  chg = *changer;
-  if (chg->device != NULL)
-    amfree(chg->device);
-  for (i = 0; i < chg->number_of_configs; i++){
-    if (chg->conf[i].device != NULL)
-      amfree(chg->conf[i].device);
-    if (chg->conf[i].slotfile != NULL)
-      amfree(chg->conf[i].slotfile);
-    if (chg->conf[i].cleanfile != NULL)
-      amfree(chg->conf[i].cleanfile);
-    if (chg->conf[i].timefile != NULL)
-      amfree(chg->conf[i].timefile);
-  }
-  if (chg->conf != NULL)
-    amfree(chg->conf);
-  chg->conf = NULL;
-  chg->device = NULL;
-  amfree(*changer);
-}
-
-/* This function parses a line, and returns a token and value */
-void
-parse_line(
-    char *linebuffer,
-    int *token,
-    char **value)
-{
-  char *tok;
-  int i;
-  int ready = 0;
-  *token = -1;  /* No Token found */
-  tok=strtok(linebuffer," \t\n");
-
-  while ((tok != NULL) && (tok[0]!='#')&&(ready==0)){
-    if (*token != -1){
-      *value=tok;
-      ready=1;
-    } else {
-      i=0;
-      while ((t_table[i].word != NULL)&&(*token==-1)){
-        if (0==strcasecmp(t_table[i].word,tok)){
-          *token=t_table[i].token;
-        }
-        i++;
-      }
-    }
-    tok=strtok(NULL," \t\n");
-  }
-}
-
-/* This function reads the specified configfile and fills the structure */
-int
-read_config(
-    char *configfile,
-    changer_t *chg)
-{
-  int numconf;
-  FILE *file;
-  int init_flag = 0;
-  int drivenum=0;
-  char *linebuffer;
-  int token;
-  char *value;
-  char *p;
-
-  numconf = 1;  /* At least one configuration is assumed */
-  /* If there are more, it should be the first entry in the configurationfile */
-
-  assert(chg != NULL);
-  if ((file=fopen(configfile,"r")) == NULL) {
-    return (-1);
-  }
-
-  while ((NULL != (linebuffer = agets(file)))) {
-      if (linebuffer[0] == '\0') {
-       amfree(linebuffer);
-       continue;
-      }
-      parse_line(linebuffer, &token, &value);
-      if (token != -1){
-       if (value == NULL)
-         value = "0";
-
-        if (init_flag == 0) {
-          if (token != NUMDRIVE){
-            init_changer_struct(chg, numconf);
-          } else {
-            numconf = atoi(value);
-           if (numconf < 1 || numconf > 100) {
-               g_fprintf(stderr,_("numconf %d is bad\n"), numconf);
-               numconf = 1;
-           }
-            init_changer_struct(chg, numconf);
-          }
-          init_flag=1;
-        }
-        switch (token) {
-        case NUMDRIVE: if (atoi(value) != numconf)
-          g_fprintf(stderr,_("Error: number_drives at wrong place, should be "
-                  "first in file\n"));
-        break;
-        case AUTOINV:
-          chg->autoinv = 1;
-          break;
-        case EMUBARCODE:
-          chg->emubarcode = 1;
-          break;
-        case DEBUGLEVEL:
-          if (chg->debuglevel != NULL) {
-              g_fprintf(stderr,_("Error: debuglevel is specified twice "
-                                 "(%s then %s).\n"), chg->debuglevel, value);
-              amfree(chg->debuglevel);
-          }
-          chg->debuglevel = stralloc(value);
-          break;
-        case EJECT:
-          chg->eject = atoi(value);
-          break;
-        case HAVEBARCODE:
-          chg->havebarcode = atoi(value);
-          break;
-       case SLEEP:
-          chg->sleep = (unsigned)atoi(value);
-          break;
-        case LABELFILE:
-          if (chg->labelfile != NULL) {
-              g_fprintf(stderr,_("Error: labelfile is specified twice "
-                                 "(%s then %s).\n"), chg->labelfile, value);
-              amfree(chg->labelfile);
-          }
-          chg->labelfile = stralloc(value);
-          break;
-        case CHANGERDEV:
-          if (chg->device != NULL) {
-              g_fprintf(stderr,_("Error: changerdev is specified twice "
-                                 "(%s then %s).\n"), chg->device, value);
-              amfree(chg->device);
-          }
-          chg->device = stralloc(value);
-          break;
-        case SCSITAPEDEV:
-          chg->conf[drivenum].scsitapedev = stralloc(value);
-          break;
-        case TAPESTATFILE:
-          chg->conf[drivenum].tapestatfile = stralloc(value);
-          break;
-        case CHANGERIDENT:
-          chg->conf[drivenum].changerident = stralloc(value);
-         if (drivenum < 0 || drivenum > 100) {
-           g_fprintf(stderr,_("drivenum %d is bad\n"), drivenum);
-           drivenum = 0;
-         }
-         if (strcmp(chg->conf[drivenum].changerident,"generic_changer") != 0) {
-            p = chg->conf[drivenum].changerident;
-            while (*p != '\0')
-            {
-              if (*p == '_')
-              {
-                *p=' ';
-              }
-              p++;
-            }
-         }
-          break;
-        case TAPEIDENT:
-          chg->conf[drivenum].tapeident = stralloc(value);
-          break;
-        case CLEANMAX:
-          chg->cleanmax = atoi(value);
-          break;
-        case DRIVE:
-          drivenum = atoi(value);
-          if (drivenum < 0) {
-            g_fprintf(stderr,_("Error: drive must be >= 0\n"));
-           drivenum = 0;
-          } else if (drivenum >= numconf) {
-            g_fprintf(stderr,_("Error: drive must be less than number_drives\n"));
-           drivenum = numconf;
-          }
-          break;
-        case DRIVENUM:
-          if (drivenum < numconf){
-            chg->conf[drivenum].drivenum = atoi(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " drivenum ignored\n"));
-          }
-          break;
-        case START:
-          if (drivenum < numconf){
-            chg->conf[drivenum].start = atoi(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " startuse ignored\n"));
-          }
-          break;
-        case END:
-          if (drivenum < numconf){
-            chg->conf[drivenum].end = atoi(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " enduse ignored\n"));
-          }
-          break;
-        case CLEAN:
-          if (drivenum < numconf){
-            chg->conf[drivenum].cleanslot = atoi(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " cleanslot ignored\n"));
-          }
-          break;
-        case DEVICE:
-          if (drivenum < numconf){
-            chg->conf[drivenum].device = stralloc(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " device ignored\n"));
-          }
-          break;
-        case STATFILE:
-          if (drivenum < numconf){
-            chg->conf[drivenum].slotfile = stralloc(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " slotfile ignored\n"));
-          }
-          break;
-        case CLEANFILE:
-          if (drivenum < numconf){
-            chg->conf[drivenum].cleanfile = stralloc(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " cleanfile ignored\n"));
-          }
-          break;
-        case USAGECOUNT:
-          if (drivenum < numconf){
-            chg->conf[drivenum].timefile = stralloc(value);
-          } else {
-            g_fprintf(stderr,_("Error: drive is not less than number_drives"
-                    " usagecount ignored\n"));
-          }
-          break;
-        default:
-          g_fprintf(stderr,_("Error: Unknown token\n"));
-          break;
-        }
-      }
-    amfree(linebuffer);
-  }
-  amfree(linebuffer);
-
-  fclose(file);
-  return 0;
-}
-
-/*----------------------------------------------------------------------------*/
-
-/*  The tape drive does not have an idea of current slot so
- *  we use a file to store the current slot.  It is not ideal
- *  but it gets the job done  
- */
-int
-get_current_slot(
-    char *count_file)
-{
-  FILE *inf;
-  int retval = -1;
-  int ret;          /* return value for the fscanf function */
-  if ((inf=fopen(count_file,"r")) == NULL) {
-    g_fprintf(stderr, _("%s: unable to open (%s)\n"),
-            get_pname(), count_file);
-    exit(2);
-  }
-
-  ret = fscanf(inf,"%d",&retval);
-  fclose(inf);
-  
-  /*
-   * check if we got an result
-   * if no set retval to -1 
-  */
-  if (ret == 0 || ret == EOF)
-    {
-      retval = -1;
-    }
-
-  if (retval < 0 || retval > 10000) {
-    retval = -1;
-  }
-  return retval;
-}
-
-void
-put_current_slot(
-    char *count_file,
-    int slot)
-{
-  FILE *inf;
-
-  if (!count_file)
-    return;
-
-  if ((inf=fopen(count_file,"w")) == NULL) {
-    g_fprintf(stderr, _("%s: unable to open current slot file (%s)\n"),
-            get_pname(), count_file);
-    exit(2);
-  }
-  g_fprintf(inf, "%d\n", slot);
-  fclose(inf);
-}
-
-/* 
- * Here we handle the inventory DB
- * With this it should be possible to do an mapping
- * Barcode      -> Volume label
- * Volume Label -> Barcode
- * Volume label -> Slot number
- * Return Values:
- * 1 -> Action was ok
- * 0 -> Action failed
- *
- * The passed struct MBC_T will hold the found entry in the DB
- */
-
-int
-MapBarCode(
-    char *labelfile,
-    MBC_T *result)
-{
-  FILE *fp;
-  int version;
-  LabelV2_T *plabelv2;
-  long unusedpos= 0;
-  int unusedrec = 0;
-  int record    = 0;
-  int loop      = 1;
-  size_t rsize;
-  long pos;
-  int rc;
-
-  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : Parameter\n"));
-  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("labelfile -> %s, vol -> %s, barcode -> %s, action -> %c, slot -> %d, from -> %d\n"),
-             labelfile,
-             result->data.voltag,
-             result->data.barcode,
-             result->action,
-             result->data.slot,
-             result->data.from);
-  
-  if (labelfile == NULL)
-    {
-      DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_("Got empty labelfile (NULL)\n"));
-      ChgExit("MapBarCode", _("MapBarCode name of labelfile is not set\n"),FATAL);
-      /*NOTREACHED*/
-    }
-  if (access(labelfile, F_OK) == -1)
-    {
-      DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("MapBarCode : creating %s"), labelfile);
-      if ((fp = fopen(labelfile, "w+")) == NULL)
-        {
-          DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_(" failed\n"));
-          ChgExit("MapBarCode", _("MapBarCode, creating labelfile failed\n"), FATAL);
-         /*NOTREACHED*/
-        }
-      g_fprintf(fp,":%d:", LABEL_DB_VERSION);
-      fclose(fp);
-    }
-  
-  if ((fp = fopen(labelfile, "r+")) == NULL)
-    {
-       DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_("MapBarCode : failed to open %s\n"), labelfile);
-       ChgExit("MapBarCode", _("MapBarCode, opening labelfile for read/write failed\n"), FATAL);
-       /*NOTREACHED*/
-    }
-  
-  if (fscanf(fp,":%d:", &version) != 1) {
-     ChgExit("MapBarCode", _("MapBarCode, DB Version unreadable.\n"), FATAL);
-     /*NOTREACHED*/
-  }
-  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : DB version %d\n"), version);
-  
-  pos = ftell(fp);
-  if (version != LABEL_DB_VERSION)
-    {
-      ChgExit("MapBarCode", _("MapBarCode, DB Version does not match\n"), FATAL);
-      /*NOTREACHED*/
-    }
-
-  if (( plabelv2 = (LabelV2_T *)alloc(SIZEOF(LabelV2_T))) == NULL)
-    {
-      DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_("MapBarCode : alloc failed\n"));
-      ChgExit("MapBarCode", _("MapBarCode alloc failed\n"), FATAL);
-      /*NOTREACHED*/
-    }
-  
-  memset(plabelv2, 0, SIZEOF(LabelV2_T));
-
-  while(feof(fp) == 0 && loop == 1)
-    {
-      rsize = fread(plabelv2, 1, SIZEOF(LabelV2_T), fp);
-      if (rsize == SIZEOF(LabelV2_T))
-      {
-      record++;
-      DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : (%d) VolTag \"%s\", BarCode %s, inuse %d, slot %d, from %d, loadcount %d\n"),record,
-                 plabelv2->voltag,
-                 plabelv2->barcode,
-                 plabelv2->valid,
-                 plabelv2->slot,
-                 plabelv2->from,
-                 plabelv2->LoadCount);
-      switch (result->action)
-        {
-          /*
-           * Only dump the info
-           */ 
-        case BARCODE_DUMP:
-          g_printf(_("Slot -> %d, from -> %d, valid -> %d, Tag -> %s, Barcode -> %s, Loadcount %u\n"),
-                 plabelv2->slot,
-                 plabelv2->from,
-                 plabelv2->valid,
-                 plabelv2->voltag,
-                 plabelv2->barcode,
-                 plabelv2->LoadCount
-                 );
-          break;
-          /*
-           * Set all the record to invalid, used by the Inventory function
-           */
-        case RESET_VALID:
-          plabelv2->valid = 0;
-          if (fseek(fp, pos, SEEK_SET) == -1) {
-           fclose(fp);
-           amfree(plabelv2);
-           return 0; /* Fail */
-         }
-          if (fwrite(plabelv2, 1, SIZEOF(LabelV2_T), fp) < SIZEOF(LabelV2_T)) {
-           fclose(fp);
-           amfree(plabelv2);
-           return 0; /* Fail */
-         }
-          break;
-          /*
-           * Add an entry
-           */
-        case BARCODE_PUT:
-          /*
-           * If it is an invalid record we can use it,
-           * so save the record number.
-           * This value is used at the end if no other
-           * record/action matches.
-           */
-          if (plabelv2->valid == 0)
-            {
-                 unusedpos = pos;
-                 unusedrec = record;
-            }
-
-          /*
-           * OK this record matches the barcode label
-           * so use/update it
-           */
-          if (strcmp(plabelv2->barcode, result->data.barcode) == 0)
-            {
-
-              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : update entry\n"));
-             if (fseek(fp, pos, SEEK_SET) == -1) {
-               fclose(fp);
-               amfree(plabelv2);
-               return 0; /* Fail */
-             }
-              plabelv2->valid = 1;
-              plabelv2->from = result->data.from;
-              plabelv2->slot = result->data.slot;
-              plabelv2->LoadCount = plabelv2->LoadCount + result->data.LoadCount;
-              strncpy(plabelv2->voltag, result->data.voltag,
-                     SIZEOF(plabelv2->voltag));
-              strncpy(plabelv2->barcode, result->data.barcode,
-                     SIZEOF(plabelv2->barcode));
-              rc = (fwrite(plabelv2, 1, SIZEOF(LabelV2_T), fp) < SIZEOF(LabelV2_T));
-              fclose(fp);
-             amfree(plabelv2);
-              return(rc);
-            }
-          break;
-          /*
-           * Look for an entry an return the entry
-           * if the voltag (the tape name) matches
-           */
-        case FIND_SLOT:
-          if (strcmp(plabelv2->voltag, result->data.voltag) == 0)
-            {
-              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode FIND_SLOT : \n"));
-              memcpy(&(result->data), plabelv2, SIZEOF(LabelV2_T));
-             amfree(plabelv2);
-              return(1);
-           }
-          break;
-          /*
-           * Update the entry,
-           * reason can be an load, incr the LoadCount
-           * or an new tape
-           */
-        case UPDATE_SLOT:
-          if (strcmp(plabelv2->voltag, result->data.voltag) == 0)
-            {
-              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode UPDATE_SLOT : update entry\n"));
-             if (fseek(fp, pos, SEEK_SET) == -1) {
-               fclose(fp);
-               amfree(plabelv2);
-               return 0; /* Fail */
-             }
-              strncpy(plabelv2->voltag, result->data.voltag,
-                    SIZEOF(plabelv2->voltag));
-              strncpy(plabelv2->barcode, result->data.barcode,
-                    SIZEOF(plabelv2->barcode));
-              plabelv2->valid = 1;
-              plabelv2->slot = result->data.slot;
-              plabelv2->from = result->data.from;
-              plabelv2->LoadCount = plabelv2->LoadCount + result->data.LoadCount;
-              rc = (fwrite(plabelv2, 1, SIZEOF(LabelV2_T), fp) < SIZEOF(LabelV2_T));
-              fclose(fp);
-             amfree(plabelv2);
-              return(rc);
-            }
-          break;
-          /*
-           * Look for the barcode label of an given volume label
-           * return the slot number and the barcode label.
-           * If the entry is not valid return -1 as slot number
-           */
-        case BARCODE_VOL:
-         /*
-          * DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode: (%d) inside BARCODE_VOL\n"), record);
-         DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("file value: %s, searched for value: %s\n"), plabelv2->voltag, result->data.voltag);
-         */
-          if (strcmp(plabelv2->voltag, result->data.voltag) == 0)
-            {
-              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : VOL %s match\n"), result->data.voltag);
-              fclose(fp);
-              
-              memcpy(&(result->data), plabelv2, SIZEOF(LabelV2_T));
-             amfree(plabelv2);
-              return(1);
-            }
-          break;
-          /*
-           * Look for an entry which matches the passed
-           * barcode label
-           */
-        case BARCODE_BARCODE:
-          if (strcmp(plabelv2->barcode, result->data.barcode) == 0)
-            {
-              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : BARCODE %s match\n"), result->data.barcode);
-              fclose(fp);
-              
-              memcpy(&(result->data), plabelv2, SIZEOF(LabelV2_T));
-             amfree(plabelv2);
-              return(1);
-            }
-          break;
-
-        default:
-          DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : unknown action\n"));
-          break;
-        }
-      pos = ftell(fp);
-      } else {
-         DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : feof (%d)\n"), feof(fp));
-         DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : error in read record expect %d, got %d\n"),SIZEOF(LabelV2_T), rsize);
-       loop=0;
-      }
-    }
-
-  /*
-   * OK, if we come here and the action is either
-   * PUT or update it seems that we have to create a new
-   * record, becuae none of the exsisting records matches
-   */
-  if (result->action == BARCODE_PUT || result->action == UPDATE_SLOT )
-    {
-      /*
-       * If we have an entry where the valid flag was set to 0
-       * we can use this record, so seek to this position
-       * If we have no record for reuse the new record will be written to the end.
-       */
-      if (unusedpos != 0)
-        {
-          DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : reuse record %d\n"), unusedrec);
-          if (fseek(fp, unusedpos, SEEK_SET) == -1) {
-           fclose(fp);
-           amfree(plabelv2);
-           return 0; /* Fail */
-         }
-        }
-      /*
-       * Set all values to zero
-       */
-      memset(plabelv2, 0, SIZEOF(LabelV2_T));     
-
-      strncpy(plabelv2->voltag, result->data.voltag,
-             SIZEOF(plabelv2->voltag));
-      strncpy(plabelv2->barcode, result->data.barcode,
-             SIZEOF(plabelv2->barcode));
-      plabelv2->valid = 1;
-      plabelv2->from = result->data.from;
-      plabelv2->slot = result->data.slot;
-      rc = (fwrite(plabelv2, 1, SIZEOF(LabelV2_T), fp) < SIZEOF(LabelV2_T));
-      fclose(fp);
-      amfree(plabelv2);
-      return(rc);
-    }
-
-  /*
-   * If we hit this point nothing was 
-   * found, so return an 0
-   */
-  fclose(fp);
-  amfree(plabelv2);
-  return(0);
-}
-
-/* ---------------------------------------------------------------------- 
-   This stuff deals with parsing the command line */
-
-typedef struct com_arg
-{
-  char *str;
-  int command_code;
-  int takesparam;
-} argument;
-
-
-typedef struct com_stru
-{
-  int command_code;
-  char *parameter;
-} command;
-
-void parse_args(int argc, char *argv[],command *rval);
-
-/* major command line args */
-#define COMCOUNT 13
-#define COM_SLOT 0
-#define COM_INFO 1
-#define COM_RESET 2
-#define COM_EJECT 3
-#define COM_CLEAN 4
-#define COM_LABEL 5
-#define COM_SEARCH 6
-#define COM_STATUS 7
-#define COM_TRACE 8
-#define COM_INVENTORY 9
-#define COM_DUMPDB 10
-#define COM_SCAN 11
-#define COM_GEN_CONF 12
-argument argdefs[]={{"-slot",COM_SLOT,1},
-                    {"-info",COM_INFO,0},
-                    {"-reset",COM_RESET,0},
-                    {"-eject",COM_EJECT,0},
-                    {"-clean",COM_CLEAN,0},
-                    {"-label",COM_LABEL,1},
-                    {"-search",COM_SEARCH,1},
-                    {"-status",COM_STATUS,1},
-                    {"-trace",COM_TRACE,1},
-                    {"-inventory", COM_INVENTORY,0},
-                    {"-dumpdb", COM_DUMPDB,0},
-                    {"-scan", COM_SCAN,0},
-                    {"-genconf", COM_GEN_CONF,0}
-       };
-
-
-/* minor command line args */
-#define SLOT_CUR 0
-#define SLOT_NEXT 1
-#define SLOT_PREV 2
-#define SLOT_FIRST 3
-#define SLOT_LAST 4
-#define SLOT_ADVANCE 5
-argument slotdefs[]={{"current",SLOT_CUR,0},
-                     {"next",SLOT_NEXT,0},
-                     {"prev",SLOT_PREV,0},
-                     {"first",SLOT_FIRST,0},
-                     {"last",SLOT_LAST,0},
-                     {"advance",SLOT_ADVANCE,0},
-       };
-#define SLOTCOUNT (int)(sizeof(slotdefs) / sizeof(slotdefs[0]))
-
-/* is the string a valid positive int? */
-int
-is_positive_number(
-    char *tmp)
-{
-  int i=0;
-  if ((tmp==NULL)||(tmp[0]==0))
-    return 0;
-  while ((tmp[i]>='0')&&(tmp[i]<='9')&&(tmp[i]!=0))
-    i++;
-  if (tmp[i]==0)
-    return 1;
-  else
-    return 0;
-}
-
-void
-usage(
-    char *argv[])
-{
-  int cnt;
-  g_printf(_("%s: Usage error.\n"), argv[0]);
-  for (cnt=0; cnt < COMCOUNT; cnt++){
-    g_printf("      %s    %s",argv[0],argdefs[cnt].str);
-    if (argdefs[cnt].takesparam)
-      g_printf(" <param>\n");
-    else
-      g_printf("\n");
-  }
-  exit(2);
-}
-
-
-void
-parse_args(
-    int argc,
-    char *argv[],
-    command *rval)
-{
-  int i;
-
-  for (i=0; i < argc; i++)
-    dbprintf(_("ARG [%d] : %s\n"), i, argv[i]);
-  i = 0;
-  if ((argc<2)||(argc>3))
-    usage(argv);
-  while ((i<COMCOUNT)&&(strcmp(argdefs[i].str,argv[1])))
-    i++;
-  if (i==COMCOUNT)
-    usage(argv);
-  rval->command_code = argdefs[i].command_code;
-  if (argdefs[i].takesparam) {
-    if (argc<3)
-      usage(argv);
-    rval->parameter=argv[2];      
-  }
-  else {
-    if (argc>2)
-      usage(argv);
-    rval->parameter=0;
-  }
-}
-
-/* used to find actual slot number from keywords next, prev, first, etc */
-int
-get_relative_target(
-    int fd,
-    int nslots,
-    char *parameter,
-    int param_index,
-    int loaded,
-    char *slot_file,
-    int slot_offset,
-    int maxslot)
-{
-  int current_slot;
-  
-  (void)loaded;        /* Quiet unused parameter warning */
-
-  current_slot = get_current_slot(slot_file);
-
-  if (current_slot > maxslot) {
-    current_slot = slot_offset;
-  }
-  if (current_slot < slot_offset) {
-    current_slot = slot_offset;
-  }
-
-  switch(param_index) {
-  case SLOT_CUR:
-    return current_slot;
-
-  case SLOT_NEXT:
-  case SLOT_ADVANCE:
-    if (++current_slot==nslots+slot_offset)
-      return slot_offset;
-    return current_slot;
-
-  case SLOT_PREV:
-    if (--current_slot<slot_offset)
-      return maxslot;
-    return current_slot;
-
-  case SLOT_FIRST:
-    return slot_offset;
-
-  case SLOT_LAST:
-    return maxslot;
-
-  default: 
-    break;
-  }
-  g_printf(_("<none> no slot `%s'\n"),parameter);
-  close(fd);
-  exit(2);
-  /*NOTREACHED*/
-}
-
-/* This function should ask the drive if it wants to be cleaned */
-int
-ask_clean(
-    char *tapedev)
-{
-  int ret;
-
-  ret = get_clean_state(tapedev);
-
-  if (ret < 0) /* < 0 means query does not work ... */
-  {
-    return(0);
-  }
-  return ret;
-}
-
-/* This function should move the cleaning cartridge into the drive */
-void
-clean_tape(
-    int fd,
-    char *tapedev,
-    char *cnt_file,
-    int drivenum, 
-    int cleancart,
-    int maxclean,
-    char *usagetime)
-{
-  int counter;
-  char *mailer;
-
-  if (cleancart == -1 ){
-    return;
-  }
-
-  /* Now we should increment the counter */
-  if (cnt_file != NULL){
-    mailer = getconf_str(CNF_MAILER);
-    counter = get_current_slot(cnt_file);
-    counter++;
-    if (counter>=maxclean){
-      /* Now we should inform the administrator */
-      char *mail_cmd = NULL;
-      FILE *mailf = NULL;
-      int mail_pipe_opened = 1;
-      if (mailer && *mailer != '\0') {
-        if (getconf_seen(CNF_MAILTO) && strlen(getconf_str(CNF_MAILTO)) > 0 &&
-           validate_mailto(getconf_str(CNF_MAILTO))) {
-          mail_cmd = vstralloc(mailer,
-                             " -s", " \"", _("AMANDA PROBLEM: PLEASE FIX"), "\"",
-                             " ", getconf_str(CNF_MAILTO),
-                             NULL);
-          if ((mailf = popen(mail_cmd, "w")) == NULL) {
-                 g_printf(_("Mail failed\n"));
-                 error(_("could not open pipe to \"%s\": %s"),
-                       mail_cmd, strerror(errno));
-                 /*NOTREACHED*/
-          }
-        } else {
-         mail_pipe_opened = 0;
-          mailf = stderr;
-          g_fprintf(mailf, _("\nNo mail recipient specified, output redirected to stderr"));
-        }
-      } else {
-        mail_pipe_opened = 0;
-        mailf = stderr;
-        g_fprintf(mailf, _("\nNo mailer specified; output redirected to stderr"));
-      }
-      g_fprintf(mailf,_("\nThe usage count of your cleaning tape in slot %d"),
-              cleancart);
-      g_fprintf(mailf,_("\nis more than %d. (cleanmax)"),maxclean);
-      g_fprintf(mailf,_("\nTapedrive %s needs to be cleaned"),tapedev);
-      g_fprintf(mailf,_("\nPlease insert a new cleaning tape and reset"));
-      g_fprintf(mailf,_("\nthe countingfile %s"),cnt_file);
-
-      if(mail_pipe_opened == 1 && pclose(mailf) != 0) {
-               error(_("mail command failed: %s"), mail_cmd);
-       /*NOTREACHED*/
-      }
-      return;
-    }
-    put_current_slot(cnt_file, counter);
-  }
-  load(fd,drivenum,cleancart);
-  /*
-   * Hack, sleep for some time
-   */
-
-  sleep(60);
-
-  if (drive_loaded(fd, drivenum))
-    unload(fd, drivenum, cleancart);  
-  if (usagetime)
-    unlink(usagetime);
-}
-/* ----------------------------------------------------------------------*/
-
-int
-main(
-    int                argc,
-    char **    argv)
-{
-  int loaded;
-  int target, oldtarget;
-  command com;   /* a little DOS joke */
-  int x;
-  MBC_T *pbarcoderes;
-  /*
-   * drive_num really should be something from the config file, but..
-   * for now, it is set to zero, since most of the common changers
-   * used by amanda only have one drive ( until someone wants to 
-   * use an EXB60/120, or a Breece Hill Q45.. )
-   */
-  unsigned char emubarcode;
-  int drive_num;
-  int need_eject; /* Does the drive need an eject command ? */
-  time_t need_sleep; /* How many seconds to wait for the drive to get ready */
-
-  int maxclean;
-  char *clean_file;
-  char *time_file;
-
-  /*
-   * For the emubarcode stuff
-   */
-  int use_slots;
-  int slot_offset;
-  int confnum;
-
-  int fd;
-  int slotcnt;
-  int drivecnt;
-  int endstatus = 0;
-
-  char *changer_dev;
-  char *tape_device;
-  char *chg_scsi_conf;          /* The config file for us */
-  char *slot_file;             /* Where we will place the info which
-                                         * slot is loaded
-                                         */
-  char *scsitapedevice;
-
-  int param_index = 0;
-
-  /*
-   * Configure program for internationalization:
-   *   1) Only set the message locale for now.
-   *   2) Set textdomain for all amanda related programs to "amanda"
-   *      We don't want to be forced to support dozens of message catalogs.
-   */  
-  setlocale(LC_MESSAGES, "C");
-  textdomain("amanda"); 
-
-  changer = alloc(SIZEOF(changer_t));
-  pbarcoderes = alloc(SIZEOF(MBC_T));
-
-  memset(pbarcoderes, 0 , SIZEOF(MBC_T));
-  changer->number_of_configs = 0;
-  changer->eject = 0;
-  changer->sleep = 0;
-  changer->cleanmax = 0;
-  changer->device = NULL;
-  changer->labelfile = NULL;
-  changer->conf = NULL;
-#ifdef CHG_SCSI_STANDALONE
-  g_printf(_("Ups standalone\n"));
-#else
-  set_pname("chg-scsi");
-
-  /* Don't die when child closes pipe */
-  signal(SIGPIPE, SIG_IGN);
-
-  dbopen(DBG_SUBDIR_SERVER);
-
-  dbprintf("chg-scsi: %s\n", rcsid);
-  ChangerDriverVersion();
-
-  if (debug_file == NULL)
-    {
-        debug_file = dbfp();
-    }
-  
-  parse_args(argc,argv,&com);
-
-  pDev = (OpenFiles_T *)alloc(SIZEOF(OpenFiles_T) * CHG_MAXDEV);
-  memset(pDev, 0, SIZEOF(OpenFiles_T) * CHG_MAXDEV );
-
-
-  switch(com.command_code) 
-    {
-    case COM_SCAN:
-      ScanBus(1);
-      return(0);
-
-    case COM_GEN_CONF:
-      ScanBus(0);
-      PrintConf();
-      return(0);
-
-    default:
-      break;
-    }
-
-  config_init(CONFIG_INIT_USE_CWD, NULL);
-
-  if (config_errors(NULL) >= CFGERR_WARNINGS) {
-    config_print_errors();
-    if (config_errors(NULL) >= CFGERR_ERRORS) {
-      g_critical(_("errors processing config file"));
-    }
-  }
-
-  chg_scsi_conf = getconf_str(CNF_CHANGERFILE);
-  tape_device = getconf_str(CNF_TAPEDEV);
-
-  /* Get the configuration parameters */
-  /* Attention, this will not support more than 10 tape devices 0-9 */
-  /* */
-  if (strlen(tape_device)==1){
-    if (read_config(chg_scsi_conf, changer) == -1)
-    {
-      g_fprintf(stderr, _("%s open: of %s failed\n"), get_pname(), chg_scsi_conf);
-      return (2);
-    }
-    confnum=atoi(tape_device);
-    if (changer->number_of_configs == 0)
-    {
-       g_fprintf(stderr,_("%s: changer->conf[%d] == NULL\n"),
-               get_pname(), confnum);
-       return (2);
-    }
-    if (confnum >= changer->number_of_configs) {
-       g_fprintf(stderr,_("%s: Configuration %s config # out of range (%d >= %d)\n"),
-               get_pname(), chg_scsi_conf,
-               confnum, 
-               changer->number_of_configs);
-       return (2);
-    }
-
-    use_slots    = changer->conf[confnum].end-changer->conf[confnum].start+1;
-    slot_offset  = changer->conf[confnum].start;
-    drive_num    = changer->conf[confnum].drivenum;
-    need_eject   = changer->eject;
-    need_sleep   = changer->sleep;
-
-    if ( NULL != changer->conf[confnum].cleanfile)
-      clean_file   = stralloc(changer->conf[confnum].cleanfile);
-    else
-      clean_file = NULL;
-
-    clean_slot   = changer->conf[confnum].cleanslot;
-    maxclean     = changer->cleanmax;
-    emubarcode   = changer->emubarcode;
-    if (NULL != changer->conf[confnum].timefile)
-      time_file = stralloc(changer->conf[confnum].timefile);
-    else
-      time_file = NULL;
-
-    if (NULL != changer->conf[confnum].slotfile)
-      slot_file = stralloc(changer->conf[confnum].slotfile);
-    else
-      slot_file = NULL;
-
-    if (NULL != changer->conf[confnum].device)
-      tape_device  = stralloc(changer->conf[confnum].device);
-    else
-      tape_device = NULL;
-
-    if (NULL != changer->device)
-      changer_dev  = stralloc(changer->device); 
-    else
-      changer_dev = NULL;
-
-    if (NULL != changer->conf[confnum].scsitapedev)
-      scsitapedevice = stralloc(changer->conf[confnum].scsitapedev);
-    else
-      scsitapedevice = NULL;
-
-    if (NULL != changer->conf[confnum].tapestatfile)
-      tapestatfile = stralloc(changer->conf[confnum].tapestatfile);
-    else
-      tapestatfile = NULL;
-    dump_changer_struct(changer);
-
-
-
-    /* 
-     * The changer device.
-     * If we can't open it fail with a message
-     */
-
-    if (OpenDevice(INDEX_CHANGER , changer_dev, "changer_dev", changer->conf[confnum].changerident) == 0)
-      {
-        int localerr = errno;
-        g_fprintf(stderr, _("%s: open: %s: %s\n"), get_pname(), 
-                changer_dev, strerror(localerr));
-        g_printf(_("%s open: %s: %s\n"), _("<none>"), changer_dev, strerror(localerr));
-        dbprintf(_("open: %s: %s\n"), changer_dev, strerror(localerr));
-        return 2;
-      }
-
-    fd = INDEX_CHANGER;
-
-    /*
-     * The tape device.
-     * We need it for:
-     * eject if eject is set
-     * inventory (reading of the labels) if emubarcode (not yet)
-     */
-    if (tape_device != NULL)
-      {
-        if (OpenDevice(INDEX_TAPE, tape_device, "tape_device", changer->conf[confnum].tapeident) == 0)
-          {
-            dbprintf(_("warning open of %s: failed\n"),  tape_device);
-          }
-      }
-
-    /*
-     * This is for the status pages of the SCSI tape, nice to have but no must....
-     */
-    if (scsitapedevice != NULL)
-      {
-        if (OpenDevice(INDEX_TAPECTL, scsitapedevice, "scsitapedevice", changer->conf[confnum].tapeident) == 0)
-          {
-            dbprintf(_("warning open of %s: failed\n"), scsitapedevice);
-          }
-      }
-    
-
-    /*
-     * So if we need eject we need either an raw device to eject with an ioctl,
-     * or an SCSI device to send the SCSI eject.
-     */
-
-    if (need_eject != 0 )
-      {
-        if (pDev[INDEX_TAPE].avail == 0 && pDev[INDEX_TAPECTL].avail == 0)
-          {
-            g_printf(_("No device found for tape eject"));
-            return(2);
-          }
-      }
-
-       
-    if ((changer->conf[confnum].end == -1) || (changer->conf[confnum].start == -1)){
-      slotcnt = get_slot_count(fd);
-      use_slots    = slotcnt;
-      slot_offset  = 0;
-    }
-
-    /*
-     * Now check if we have all what we need
-     * If either emubarcode is set or the changer support barcode
-     * we need an label file
-     */
-    
-    if ( changer->emubarcode == 1 || BarCode(INDEX_CHANGER) == 1) 
-      {
-        if (changer->labelfile == NULL)
-          {
-            g_printf(_("labelfile param not set in your config\n"));
-            return(2);
-          }
-      }
-    
-    if (slot_file == NULL)
-      {
-        g_printf(_("slotfile param. not set in your config\n"));
-        return(2);
-      }
-    
-    if (access(slot_file,R_OK|W_OK) != 0)
-      {
-        g_printf(_("slotfile %s does not exsist or is not read/write\n"), slot_file);
-        return(2);
-      }
-
-  } else { /* if (strlen(tape_device)==1) */
-       g_printf(_("please check your config and use a config file for chg-scsi\n"));
-       return(2);
-  }
-
-  drivecnt = get_drive_count(fd);
-
-  if (drive_num > drivecnt) {
-    g_printf(_("%s drive number error (%d > %d)\n"), _("<none>"), 
-           drive_num, drivecnt);
-    g_fprintf(stderr, _("%s: requested drive number (%d) greater than "
-            "number of supported drives (%d)\n"), get_pname(), 
-            drive_num, drivecnt);
-    dbprintf(_("requested drive number (%d) is greater than "
-              "number of supported drives (%d)\n"), drive_num, drivecnt);
-    return 2;
-  }
-
-  loaded = (int)drive_loaded(fd, drive_num);
-  target = -1;
-
-  switch(com.command_code) {
-/* This is only for the experts ;-) */
-  case COM_TRACE:
-       ChangerReplay(com.parameter);
-  break;
-/*
-*/
-  case COM_DUMPDB:
-    pbarcoderes->action = BARCODE_DUMP;
-    MapBarCode(changer->labelfile, pbarcoderes);
-    break;
-  case COM_STATUS:
-    ChangerStatus(com.parameter, changer->labelfile,
-               BarCode(fd), slot_file, changer_dev, tape_device);
-    break;
-  case COM_LABEL: /* Update BarCode/Label mapping file */
-    pbarcoderes->action = BARCODE_PUT;
-    strncpy(pbarcoderes->data.voltag, com.parameter,
-          SIZEOF(pbarcoderes->data.voltag));
-    strncpy(pbarcoderes->data.barcode, pDTE[drive_num].VolTag,
-          SIZEOF(pbarcoderes->data.barcode));
-    MapBarCode(changer->labelfile, pbarcoderes);
-    g_printf("0 0 0\n");
-    break;
-
-    /*
-     * Inventory does an scan of the library and updates the mapping in the label DB
-     */
-  case COM_INVENTORY:
-    do_inventory = 1;                                     /* Tell the label check not to exit on label errors */
-    if (loaded)
-      {
-        oldtarget = get_current_slot(slot_file);
-        if (oldtarget < 0)
-          {
-            dbprintf(_("COM_INVENTORY: get_current_slot %d\n"), oldtarget);
-            oldtarget = find_empty(fd, slot_offset, use_slots);
-            dbprintf(_("COM_INVENTORY: find_empty %d\n"), oldtarget);
-          }
-
-        if (need_eject)
-          {
-            eject_tape(scsitapedevice, need_eject);
-          } else {
-            if (pDev[INDEX_TAPECTL].avail == 1 && pDev[INDEX_TAPE].avail == 1)
-              {
-                LogSense(INDEX_TAPE);
-              }
-          }
-
-        (void)unload(fd, drive_num, oldtarget);
-        if (ask_clean(scsitapedevice))
-          clean_tape(fd,tape_device,clean_file,drive_num,
-                     clean_slot, maxclean, time_file);
-      }
-    Inventory(changer->labelfile, drive_num, need_eject, 0, 0, clean_slot);
-    do_inventory = 0;                        /* If set on exit the labeldb will be set to invalid ..... */
-    break;
-   /*
-     * Search for the tape, the index is the volume label
-     */
-  case COM_SEARCH:
-    
-    /*
-     * If we have an barcode reader use
-     * this way
-     */
-    if (BarCode(fd) == 1 && emubarcode != 1)
-      {
-        dbprintf(_("search : look for %s\n"), com.parameter);
-        pbarcoderes->action = BARCODE_VOL;
-        pbarcoderes->data.slot = -1;
-        strncpy(pbarcoderes->data.voltag, com.parameter,
-              SIZEOF(pbarcoderes->data.voltag));
-        if (MapBarCode(changer->labelfile, pbarcoderes) == 1)
-          {
-            /*
-             * If both values are unset we have an problem
-             * so leave the program
-             */
-            if (pbarcoderes->data.slot == -1 && pbarcoderes->data.barcode == NULL)
-              {
-                g_printf(_("Label %s not found (1)\n"),com.parameter);
-                endstatus = 2;
-                close(fd);
-                break;
-              }
-            
-
-            /*
-             * Let's see, if we got an barcode check if it is
-             * in the current inventory
-             */
-            if (pbarcoderes->data.barcode != NULL)
-              {
-                for (x = 0; x < (int)STE; x++)
-                  {
-                    if (strcmp(pSTE[x].VolTag, pbarcoderes->data.barcode) == 0)
-                      {
-                        dbprintf(_("search : found slot %d\n"), x);
-                        target = x;
-                      }
-                  }
-                /*
-                 * Not found in the STE slots
-                 * my be in the DTE (tape)
-                 * If we find it check if it is in the right drive
-                 * if we have more than one drive.
-                 */
-                for (x = 0; x < (int)DTE; x++)
-                  {
-                    if (strcmp(pDTE[x].VolTag, pbarcoderes->data.barcode) == 0)
-                      {
-                        dbprintf(_("search : found in tape %d\n"), x);
-                        /*
-                         */
-                        if (x == drive_num) {
-                          oldtarget = get_current_slot(slot_file);
-                          g_printf("%d %s\n", oldtarget - slot_offset, tape_device);
-                          return(0);
-                        } else {
-                          g_printf(_("LABEL in wrong tape Unit\n"));
-                          return(2);
-                        }
-                      }
-                  }
-                /*
-                 * not found, so do an exit...
-                 */               
-                if (target == -1)
-                  {
-                    g_printf(_("Label %s not found (2) \n"),com.parameter);
-                    close(fd);
-                    endstatus = 2;
-                    break;
-                  }
-              }  /* if barcode[0] != 0 */
-
-            /*
-             * If we didn't find anything we will try the info
-             * from the DB. A reason for not finding anything in the inventory
-             * might be an unreadable barcode label
-             */
-            if (target == -1 && pbarcoderes->data.slot != -1)
-              {
-                target = pbarcoderes->data.slot;
-              }
-
-            /*
-             * OK, if target is still -1 do the exit
-             */
-            if (target == -1)
-              {
-                g_printf(_("Label %s not found (3)\n"),com.parameter);
-                close(fd);
-                endstatus = 2;
-                break;
-              }
-          }
-               
-      }
-
-    /*
-     * And now if we have emubarcode set and no barcode reader
-     * use this one
-     */
-    if (emubarcode == 1 && BarCode(fd) != 1)
-      {
-        dbprintf(_("search : look for %s\n"), com.parameter);
-        pbarcoderes->action = FIND_SLOT;
-        pbarcoderes->data.slot = -1;
-        strncpy(pbarcoderes->data.voltag, com.parameter,
-              SIZEOF(pbarcoderes->data.voltag));
-
-        if (MapBarCode(changer->labelfile, pbarcoderes) == 1)
-          {
-            if (pbarcoderes->data.valid == 1)
-              {
-                target = pbarcoderes->data.slot;
-              } else {
-                g_printf(_("Barcode DB out of sync \n"));
-                close(fd);
-                endstatus=2;
-                break;
-              }
-          } else {
-            g_printf(_("Label %s not found \n"),com.parameter);
-            close(fd);
-            endstatus = 2;
-            break;
-          }
-      } 
-
-    /*
-     * The slot changing command
-     */
-  case COM_SLOT: 
-    if (target == -1)
-      {
-        if (is_positive_number(com.parameter)) {
-          if ((target = atoi(com.parameter))>=use_slots) {
-            g_printf(_("<none> no slot `%d'\n"),target);
-            close(fd);
-            endstatus = 2;
-            break;
-          } else {
-            target = target + slot_offset;
-          }
-        } else {
-          param_index=0;
-          while((param_index < SLOTCOUNT) &&
-               (strcmp(slotdefs[param_index].str,com.parameter))) {
-            param_index++;
-         }
-          target=get_relative_target(fd, use_slots,
-                                     com.parameter,param_index,
-                                     loaded, 
-                                     slot_file,
-                                    slot_offset,
-                                    (slot_offset + use_slots - 1));
-        }
-      }
-
-    if (loaded) {
-      oldtarget = get_current_slot(slot_file);
-      if (oldtarget < 0)
-        {
-          dbprintf(_("COM_SLOT: get_current_slot %d\n"), oldtarget);
-          oldtarget = find_empty(fd, slot_offset, use_slots);
-          dbprintf(_("COM_SLOT: find_empty %d\n"), oldtarget);
-        }
-      
-      /*
-       * TODO check if the request slot for the unload is empty
-       */
-
-       
-      if ((oldtarget)!=target) {
-        if (need_eject)
-          {
-            eject_tape(scsitapedevice, need_eject);
-          } else {
-            /*
-             * If we have an SCSI path to the tape and an raw io path
-             * try to read the Error Counter and the label
-             */
-            if (pDev[INDEX_TAPECTL].avail == 1 && pDev[INDEX_TAPE].avail == 1)
-              {
-                LogSense(INDEX_TAPE);
-              }
-          }
-
-        (void)unload(fd, drive_num, oldtarget);
-        if (ask_clean(scsitapedevice))
-          clean_tape(fd, tape_device, clean_file, drive_num,
-                     clean_slot, maxclean, time_file);
-        loaded=0;
-      }
-    }
-    
-    put_current_slot(slot_file, target);
-    
-    if (!loaded && isempty(fd, target)) {
-      g_printf(_("%d slot %d is empty\n"),target - slot_offset,
-             target - slot_offset);
-      close(fd);
-      endstatus = 1;
-      break;
-    }
-
-    if (!loaded && param_index != SLOT_ADVANCE)
-      {
-        if (ask_clean(scsitapedevice))
-          clean_tape(fd, tape_device, clean_file, drive_num,
-                     clean_slot, maxclean, time_file);
-        if (load(fd, drive_num, target) != 0) {
-          g_printf(_("%d slot %d move failed\n"),target - slot_offset,
-                 target - slot_offset);  
-          close(fd);
-          endstatus = 2;
-          break;
-        }
-      }
-
-    if (need_sleep)
-      {
-        if (pDev[INDEX_TAPECTL].inqdone == 1)
-          {
-            if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1)
-              {
-                g_printf(_("tape not ready\n"));
-                endstatus = 2;
-                break;
-              }
-          } else {
-            if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1)
-              {
-                g_printf(_("tape not ready\n"));
-                endstatus = 2;
-                break;
-              }          
-        }
-      }
-
-    g_printf("%d %s\n", target - slot_offset, tape_device);
-    break;
-
-  case COM_INFO:
-    loaded = (int)get_current_slot(slot_file);
-
-    if (loaded < 0)
-      {
-        loaded = find_empty(fd, slot_offset, use_slots);
-      }
-    loaded = loaded - (int)slot_offset;
-      
-    g_printf("%d %d 1", loaded, use_slots);
-
-    if (BarCode(fd) == 1 || emubarcode == 1)
-      {
-        g_printf(" 1\n");
-      } else {
-        g_printf(" 0\n");
-      }
-    break;
-
-  case COM_RESET:
-    target=get_current_slot(slot_file);
-
-    if (target < 0)
-    {
-      dbprintf(_("COM_RESET: get_current_slot %d\n"), target);
-      target = find_empty(fd, slot_offset, use_slots);
-      dbprintf(_("COM_RESET: find_empty %d\n"), target);
-    }
-
-    if (loaded) {
-      
-      if (!isempty(fd, target))
-        target = find_empty(fd, slot_offset, use_slots);
-      
-      if (need_eject)
-        {
-          eject_tape(scsitapedevice, need_eject);
-        } else {
-          /*
-           * If we have an SCSI path to the tape and an raw io path
-           * try to read the Error Counter and the label
-           */
-          if (pDev[INDEX_TAPECTL].avail == 1 && pDev[INDEX_TAPE].avail == 1)
-            {
-              LogSense(INDEX_TAPE);
-            }
-        }
-      
-      (void)unload(fd, drive_num, target);
-      if (ask_clean(scsitapedevice))
-        clean_tape(fd,tape_device, clean_file, drive_num, clean_slot,
-                   maxclean, time_file);
-    }
-    
-    if (isempty(fd, slot_offset)) {
-      g_printf(_("0 slot 0 is empty\n"));
-      close(fd);
-      endstatus = 1;
-      break;
-    }
-    
-    if (load(fd, drive_num, slot_offset) != 0) {
-      g_printf(_("%d slot %d move failed\n"),
-            drive_num, slot_offset);  
-      close(fd);
-      put_current_slot(slot_file, slot_offset);
-      endstatus = 2;
-      break;
-    }
-    
-    put_current_slot(slot_file, slot_offset);
-    
-    if (need_sleep)
-      {
-        if (pDev[INDEX_TAPECTL].inqdone == 1)
-          {
-            if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1)
-              {
-                g_printf(_("tape not ready\n"));
-                endstatus = 2;
-                break;
-              }
-          } else {
-            if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1)
-              {
-                g_printf(_("tape not ready\n"));
-                endstatus = 2;
-                break;
-              }          
-          }
-      }
-    
-    g_printf(_("%d %s\n"), slot_offset, tape_device);
-    break;
-
-  case COM_EJECT:
-    if (loaded) {
-      target = get_current_slot(slot_file);
-      if (target < 0)
-        {
-          dbprintf(_("COM_EJECT: get_current_slot %d\n"), target);
-          target = find_empty(fd, slot_offset, use_slots);
-          dbprintf(_("COM_EJECT: find_empty %d\n"), target);
-        }
-      
-      if (need_eject)
-        {
-          eject_tape(scsitapedevice, need_eject);
-        } else {
-          if (pDev[INDEX_TAPECTL].avail == 1 && pDev[INDEX_TAPE].avail == 1)
-            {
-              LogSense(INDEX_TAPE);
-            }
-        }
-
-
-      (void)unload(fd, drive_num, target);
-      if (ask_clean(scsitapedevice))
-        clean_tape(fd, tape_device, clean_file, drive_num, clean_slot,
-                   maxclean, time_file);
-      g_printf("%d %s\n", target, tape_device);
-    } else {
-      g_printf(_("%d drive was not loaded\n"), target);
-      endstatus = 1;
-    }
-    break;
-  case COM_CLEAN:
-    if (loaded) {
-      target = get_current_slot(slot_file);
-      if (target < 0)
-        {
-          dbprintf(_("COM_CLEAN: get_current_slot %d\n"), target);
-          target = find_empty(fd, slot_offset, use_slots);
-          dbprintf(_("COM_CLEAN: find_empty %d\n"),target);
-        }
-
-      if (need_eject)
-        {
-          eject_tape(scsitapedevice, need_eject);
-        } else {
-          if (pDev[INDEX_TAPECTL].avail == 1 && pDev[INDEX_TAPE].avail == 1)
-            {
-              LogSense(INDEX_TAPE);
-            }
-        }
-
-      (void)unload(fd, drive_num, target);
-    } 
-
-    clean_tape(fd, tape_device, clean_file, drive_num, clean_slot,
-               maxclean, time_file);
-    g_printf(_("%s cleaned\n"), tape_device);
-    break;
-  };
-
-/* FIX ME, should be an function to close the device */  
-/*   if (pChangerDev != NULL) */
-/*     close(pChangerDev->fd); */
-/*   if (pTapeDev != NULL) */
-/*     close(pTapeDev->fd); */
-
-/*   if (pTapeDevCtl != NULL) */
-/*     close(pTapeDevCtl->fd); */
-
-
-#endif
-  if (do_inventory == 1 && endstatus == 0 && changer->labelfile != NULL)
-    {
-      if (changer->autoinv == 1)
-        {
-          DebugPrint(DEBUG_INFO,SECTION_INFO, _("Do an inventory \n"));
-          Inventory(changer->labelfile, drive_num, changer->eject,
-               0, 0, clean_slot);
-        } else {
-          DebugPrint(DEBUG_INFO,SECTION_INFO, _("Set all entrys in DB to invalid\n"));
-          memset(pbarcoderes, 0 , SIZEOF(MBC_T));
-          pbarcoderes->action = RESET_VALID;
-          MapBarCode(changer->labelfile,pbarcoderes);
-        }
-    }
-
-  DebugPrint(DEBUG_INFO,SECTION_INFO,_("Exit status -> %d\n"), endstatus);
-  dbclose();
-  return endstatus;
-}
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * tab-width: 4
- * End:
- */
diff --git a/changer-src/libscsi.h b/changer-src/libscsi.h
deleted file mode 100644 (file)
index e0d190d..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *     $Id: libscsi.h,v 1.10 2006/05/25 01:47:07 johnfranks Exp $
- *
- *     libscsi.h -- library header for routines to handle the changer
- *                     support for chio based systems
- *
- *     Author: Eric Schnoebelen, eric@cirr.com
- *     based on work by: Larry Pyeatt,  pyeatt@cs.colostate.edu 
- *     Copyright: 1997, Eric Schnoebelen
- *             
- *      Michael C. Povel 03.06.98 added function eject_tape
- */
-
-#ifndef LIBSCSI_H
-#define LIBSCSI_H
-
-#include "amanda.h"
-
-/*
- * This function gets the actual cleaning state of the drive 
- */
-int get_clean_state(char *tape);
-
-/*
- * This function gets the next empty slot from the changer
- * (From this slot the tape is loaded ...)
- */
-int GetCurrentSlot(int fd, int drive);
-
-/*
- * Eject the actual tape from the tapedrive
- */
-int eject_tape(char *tape, int type);
-
-
-/* 
- * is the specified slot empty?
- */
-int isempty(int fd, int slot);
-
-/*
- * find the first empty slot 
- */
-int find_empty(int fd, int start, int count);
-
-/*
- * returns one if there is a tape loaded in the drive 
- */
-int drive_loaded(int fd, int drivenum);
-
-
-/*
- * unloads the drive, putting the tape in the specified slot 
- */
-int unload(int fd, int drive, int slot);
-
-/*
- * moves tape from the specified slot into the drive 
- */
-int load(int fd, int drive, int slot);
-
-/* 
- * return the number of slots in the robot
- */
-int get_slot_count(int fd);
-
-/*
- * return the number of drives in the robot
- */
-int get_drive_count(int fd);
-
-#endif /* !LIBSCSI_H */
diff --git a/changer-src/scsi-aix.c b/changer-src/scsi-aix.c
deleted file mode 100644 (file)
index b768c73..0000000
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: scsi-aix.c,v 1.23 2006/05/25 01:47:07 johnfranks Exp $
- *
- * Interface to execute SCSI commands on an AIX System
- *
- * Copyright (c) Thomas Hepper th@ant.han.de
- */
-
-
-#include <amanda.h>
-
-#include <scsi-defs.h>
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#include <sys/scarray.h>
-#include <sys/tape.h>
-
-#include <scsi-defs.h>
-#include <gscdds.h>
-
-void SCSI_OS_Version(void)
-{
-#ifndef lint
-   static char rcsid[] = "$Id: scsi-aix.c,v 1.23 2006/05/25 01:47:07 johnfranks Exp $";
-   DebugPrint(DEBUG_INFO, SECTION_INFO, "scsi-os-layer: %s\n",rcsid);
-#endif
-}
-
-
-int SCSI_OpenDevice(int ip)
-{
-  int DeviceFD;
-  int i;
-  extern OpenFiles_T *pDev;
-  
-  if (pDev[ip].inqdone == 0)
-    {
-      pDev[ip].inqdone = 1;
-      /*
-       * Check if it is an gsc (generic SCSI device)
-       */
-      if (strncmp("/dev/gsc", pDev[ip].dev, 8) == 0)
-        {
-         pDev[ip].flags = AIX_USE_GSC;
-          DeviceFD = open(pDev[ip].dev, 0);
-        } else {
-          DeviceFD = openx(pDev[ip].dev, O_RDWR, 0, SC_DIAGNOSTIC);
-        }
-      if (DeviceFD >= 0)
-       {
-         pDev[ip].avail = 1;
-          pDev[ip].fd = DeviceFD;
-          pDev[ip].SCSI = 0;
-          pDev[ip].devopen = 1;
-          pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE);
-
-          if (SCSI_Inquiry(ip, pDev[ip].inquiry, INQUIRY_SIZE) == 0)
-           {
-             if (pDev[ip].inquiry->type == TYPE_TAPE || pDev[ip].inquiry->type == TYPE_CHANGER)
-               {
-                 for (i=0;i < 16;i++)
-                   pDev[ip].ident[i] = pDev[ip].inquiry->prod_ident[i];
-                 for (i=15; i >= 0 && !isalnum(pDev[ip].ident[i]) ; i--)
-                   {
-                     pDev[ip].ident[i] = '\0';
-                   }
-                 pDev[ip].SCSI = 1;
-
-                 if (pDev[ip].inquiry->type == TYPE_TAPE)
-                 {
-                         pDev[ip].type = stralloc("tape");
-                 }
-
-                 if (pDev[ip].inquiry->type == TYPE_CHANGER)
-                 {
-                         pDev[ip].type = stralloc("changer");
-                 }
-
-                 PrintInquiry(pDev[ip].inquiry);
-                 return(1); 
-               } else {
-                 close(DeviceFD);
-                 free(pDev[ip].inquiry);
-                 return(0);
-               }
-           }
-           free(pDev[ip].inquiry);
-           pDev[ip].inquiry = NULL;
-           return(1);
-       } else {
-        dbprintf(_("SCSI_OpenDevice %s failed\n"), pDev[ip].dev);
-         return(0);
-       }
-    } else {
-      if ((DeviceFD = openx(pDev[ip].dev, O_RDWR, 0, SC_DIAGNOSTIC)) >= 0)
-        {
-          pDev[ip].fd = DeviceFD;
-          pDev[ip].devopen = 1;
-          return(1);
-        }
-    }
-  return(0);
-}
-
-int SCSI_CloseDevice(int DeviceFD)
-{
-  int ret;
-  extern OpenFiles_T *pDev;
-
-  ret = close(pDev[DeviceFD].fd);
-  pDev[DeviceFD].devopen = 0;
-  return(ret);
-
-}
-
-int SCSI_ExecuteCommand(int DeviceFD,
-                        Direction_T Direction,
-                        CDB_T CDB,
-                        size_t CDB_Length,
-                        void *DataBuffer,
-                        size_t DataBufferLength,
-                        RequestSense_T *RequestSenseBuf,
-                        size_t RequestSenseLength)
-{
-  extern OpenFiles_T *pDev;
-  extern FILE * debug_file;
-  CDB_T CDBSENSE;
-  CDB_T SINQ;
-  ExtendedRequestSense_T ExtendedRequestSense;
-  struct sc_iocmd ds;
-  scmd_t scmd;
-  char sbyte;
-  int Result;
-  int isbusy = 0;
-  int target = 3;
-
-  /* Basic sanity checks */
-  assert(CDB_Length <= UCHAR_MAX);
-  assert(RequestSenseLength <= UCHAR_MAX);
-
-  /* Clear buffer for cases where sense is not returned */
-  memset(RequestSenseBuf, 0, RequestSenseLength);
-
-  if (pDev[DeviceFD].avail == 0)
-    {
-      return(SCSI_ERROR);
-    }
-
-
-  if (pDev[DeviceFD].flags == AIX_USE_GSC)
-    {
-      scmd.cdb = CDB;
-      scmd.cdblen = CDB_Length;
-      scmd.data_buf = DataBuffer;
-      scmd.datalen = DataBufferLength;
-      scmd.sense_buf = (unsigned char *)RequestSenseBuf;
-      scmd.senselen = RequestSenseLength;
-      scmd.statusp = &sbyte;
-      scmd.timeval = 60;
-      switch (Direction) 
-        {
-        case Input:
-          scmd.rw = 0;
-          break;
-        case Output:
-          scmd.rw = 1;
-          break;
-        }
-
-      if (ioctl(pDev[DeviceFD].fd, GSC_CMD, (caddr_t) &scmd) < 0) {
-        return(SCSI_ERROR);
-      }
-      return(SCSI_OK);
-
-    } else {
-      bzero(&ds, SIZEOF(struct sc_iocmd));
-      bzero(RequestSenseBuf, RequestSenseLength);
-      bzero(&ExtendedRequestSense, SIZEOF(ExtendedRequestSense_T));
-      
-      ds.flags = SC_ASYNC; 
-      /* Timeout */
-      ds.timeout_value = 60;
-      bcopy(CDB, ds.scsi_cdb, CDB_Length);
-      ds.command_length = CDB_Length;
-      /* 
-       *  Data buffer for results 
-       * If the size of the buffer is 0
-       * then keep this fields untouched           
-       */
-      if (DataBufferLength > 0)
-        {
-          ds.buffer = DataBuffer;
-          ds.data_length = DataBufferLength;
-        }
-      
-      /* Sense Buffer is not available on AIX ?*/
-      /*
-        ds.req_sense_length = 255;
-        ds.request_sense_ptr = (unsigned char *)RequestSense;
-      */
-      switch (Direction) 
-        {
-        case Input:
-          ds.flags = ds.flags | B_READ;
-          break;
-        case Output:
-          ds.flags = ds.flags | B_WRITE;
-          break;
-        }
-      DecodeSCSI(CDB, "SCSI_ExecuteCommand : ");
-      
-      if (pDev[DeviceFD].devopen == 0)
-        if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(SCSI_ERROR);
-      Result = ioctl(pDev[DeviceFD].fd, STIOCMD, &ds);
-      SCSI_CloseDevice(DeviceFD);
-      
-      if ( Result < 0)
-        {
-          switch (ds.scsi_bus_status)
-            {
-            case SC_GOOD_STATUS:
-              SINQ[0] = SC_COM_REQUEST_SENSE;
-              SINQ[1] = 0; 
-              SINQ[2] = 0;
-              SINQ[3] = 0;
-              SINQ[4] = 0x1D;
-              SINQ[5] = 0x80;
-              bcopy(SINQ, ds.scsi_cdb, 6);
-              ds.command_length = 6;
-              ds.buffer = (unsigned char *)RequestSenseBuf;
-              ds.data_length = RequestSenseLength;
-              
-              if (pDev[DeviceFD].devopen == 0)
-                if (SCSI_OpenDevice(DeviceFD) == 0)
-                  return(SCSI_ERROR);
-              Result = ioctl(pDev[DeviceFD].fd, STIOCMD, &ds);
-              SCSI_CloseDevice(DeviceFD);
-              return(SCSI_OK);
-
-            case SC_BUSY_STATUS:
-              return(SCSI_BUSY);
-
-            case SC_CHECK_CONDITION:
-              SINQ[0] = SC_COM_REQUEST_SENSE;
-              SINQ[1] = 0; 
-              SINQ[2] = 0;
-              SINQ[3] = 0;
-              SINQ[4] = 0x1D;
-              SINQ[5] = 0x80;
-              bcopy(SINQ, ds.scsi_cdb, 6);
-              ds.command_length = 6;
-              ds.buffer = (unsigned char *)RequestSenseBuf;
-              ds.data_length = (unsigned char)RequestSenseLength;
-
-              if (pDev[DeviceFD].devopen == 0)
-                if (SCSI_OpenDevice(DeviceFD) == 0)
-                  return(SCSI_ERROR);
-              Result = ioctl(pDev[DeviceFD].fd, STIOCMD, &ds);
-              SCSI_CloseDevice(DeviceFD);
-              return(SCSI_CHECK);
-
-            default:
-              /*
-               * Makes no sense yet, may result in an endless loop
-               *
-               RequestSense(DeviceFD, &ExtendedRequestSense, 0);
-               DecodeExtSense(&ExtendedRequestSense, "SCSI_ExecuteCommand:", debug_file);
-               bcopy(&ExtendedRequestSense, RequestSenseBuf, RequestSenseLength);
-              */
-              dbprintf(_("ioctl on %d return %d\n"), pDev[DeviceFD].fd, Result);
-              dbprintf(_("ret: %d errno: %d (%s)\n"), Result, errno, "");
-              dbprintf(_("data_length:     %d\n"), ds.data_length);
-              dbprintf(_("buffer:          0x%X\n"), ds.buffer);
-              dbprintf(_("timeout_value:   %d\n"), ds.timeout_value);
-              dbprintf(_("status_validity: %d\n"), ds.status_validity);
-              dbprintf(_("scsi_bus_status: 0x%X\n"), ds.scsi_bus_status);
-              dbprintf(_("adapter_status:  0x%X\n"), ds.adapter_status);
-              dbprintf(_("adap_q_status:   0x%X\n"), ds.adap_q_status);
-              dbprintf(_("q_tag_msg:       0x%X\n"), ds.q_tag_msg);
-              dbprintf(_("flags:           0X%X\n"), ds.flags);
-              return(SCSI_ERROR);
-            }
-        }
-      return(SCSI_OK);
-    }
-}
-
-int SCSI_Scan(void)
-{
-  int fd;
-  struct sc_inquiry si;
-  u_char buf[255];
-  int target;
-  int lun;
-  int isbusy;
-  char type;
-  char bus[] = "/dev/scsi0";
-  
-  if ((fd = open(bus, O_RDWR)) == -1)
-    return(1);
-
-  for (target = 0; target < 7; target++) 
-    {
-      for (lun = 0; lun < 7; lun++)
-        {
-          g_printf(_("Target:Lun %d:%d\n"), target,lun);
-          if (ioctl(fd, SCIOSTART, IDLUN(target, lun)) == -1) {
-            if (errno == EINVAL) {
-              g_printf(_("is in use\n"));
-              isbusy = 1;
-            } else {
-              return(1);
-            }
-          } else {
-            isbusy = 0;
-          }
-          
-          bzero(&si, SIZEOF(si));
-          si.scsi_id = target;
-          si.lun_id = lun;
-          si.inquiry_len = 255;
-          si.inquiry_ptr = (char *)&buf;
-          if (ioctl(fd, SCIOINQU, &si) == -1)
-            {
-              g_printf("SCIOINQU: %s\n", strerror(errno));
-            } else {
-              dump_hex(&buf, 255, DEBUG_INFO, SECTION_SCSI);
-              type = buf[0] & 0x1lf;
-              buf[8+28] = 0;
-              g_printf(_("%-28s|Device Type %d\n"),buf[8], type);
-            }
-          if (!isbusy && ioctl(fd, SCIOSTOP, IDLUN(target, lun)) == -1)
-            return(1);
-        }
-    }
-}
-
-int Tape_Ioctl(int DeviceFD, int command)
-{
-  extern OpenFiles_T *pDev;
-  int ret = -1;
-  return(ret);
-}
-
-int Tape_Status( int DeviceFD)
-{
-/*
-  Not yet
-*/
-  return(-1);
-}
-
-int ScanBus(int print)
-{
-/*
-  Not yet
-*/
-  SCSI_Scan();
-  return(-1);
-}
-
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-file-style: gnu
- * End:
- */
diff --git a/changer-src/scsi-bsd.c b/changer-src/scsi-bsd.c
deleted file mode 100644 (file)
index bff9495..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: scsi-bsd.c,v 1.18 2006/05/25 01:47:07 johnfranks Exp $
- *
- * Interface to execute SCSI commands on an BSD System (FreeBSD)
- *
- * Copyright (c) Thomes Hepper th@ant.han.de
- */
-
-
-#include "amanda.h"
-
-#include <sys/scsiio.h>
-#include <sys/mtio.h>
-
-#include <scsi-defs.h>
-
-void SCSI_OS_Version()
-{
-#ifndef lint
-   static char rcsid[] = "$Id: scsi-bsd.c,v 1.18 2006/05/25 01:47:07 johnfranks Exp $";
-   DebugPrint(DEBUG_INFO, SECTION_INFO, "scsi-os-layer: %s\n",rcsid);
-#endif
-}
-
-
-/*
- * Check if the device is already open,
- * if no open it and save it in the list 
- * of open files.
- * 
- * Return:
- * 0  -> device not opened
- * 1  -> sucess , device open
- */
-int SCSI_OpenDevice(int ip)
-{
-  extern OpenFiles_T *pDev;
-  int i;
-  char * DeviceName;
-
-
-  /*
-   * If the SCSI inquiry was not done lets try to get
-   * some infos about the device
-   */
-  if (pDev[ip].inqdone == 0) {
-    pDev[ip].inqdone = 1;                                                     /* Set it to 1, so the inq is done */
-    pDev[ip].SCSI = 0;                                                        /* This will only be set if the inquiry works */
-    pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE);
-    
-    if (( pDev[ip].fd = open(pDev[ip].dev, O_RDWR)) >= 0)                      /* We need the device in read/write mode */
-      {
-        pDev[ip].devopen = 1;                                                 /* The device is open for use */
-        pDev[ip].avail = 1;                                                   /* And it is available, it could be opened */
-        if (SCSI_Inquiry(ip, pDev[ip].inquiry, INQUIRY_SIZE) == 0)            /* Lets try to get the result of an SCSI inquiry */
-          {
-            if (pDev[ip].inquiry->type == TYPE_TAPE || pDev[ip].inquiry->type == TYPE_CHANGER)  /* If it worked and we got an type of */
-                                                                                                /* either tape or changer continue */
-              {
-                for (i=0;i < 16 ;i++)                                         /* Copy the product ident to the pDev struct */
-                  pDev[ip].ident[i] = pDev[ip].inquiry->prod_ident[i];
-                for (i=15; i >= 0 && !isalnum(pDev[ip].ident[i]); i--)        /* And terminate it with an \0, remove all white space */
-                  {
-                    pDev[ip].ident[i] = '\0';
-                  }
-                pDev[ip].SCSI = 1;                                            /* OK, its an SCSI device ... */
-
-                 if (pDev[ip].inquiry->type == TYPE_TAPE)
-                 {
-                         pDev[ip].type = stralloc("tape");
-                 }
-
-                 if (pDev[ip].inquiry->type == TYPE_CHANGER)
-                 {
-                         pDev[ip].type = stralloc("changer");
-                 }
-
-                PrintInquiry(pDev[ip].inquiry);                               /* Some debug output */
-                return(1);                                                    /* All done */
-              } else {
-                free(pDev[ip].inquiry);                                       /* The SCSI was ok, but not an TAPE/CHANGER device ... */
-                pDev[ip].devopen = 0;
-                pDev[ip].avail = 0;
-                close(pDev[ip].fd); 
-                return(0);                                                    /*Might be an ChgExit is better */
-              }
-          } else { /* if SCSI_Inquiry */                                      /* The inquiry failed */
-            free(pDev[ip].inquiry);                                           /* free the allocated memory */
-            pDev[ip].inquiry = NULL;
-            return(1);                                                        /* Its not an SCSI device, but can be used for read/write */
-          }
-      }  /* open() */
-    return(0);                                                                /* Open failed .... */
-  } else { /* pDev[ip].inqdone */                                             /* OK this is the way we go if the device */
-    if (( pDev[ip].fd = open(pDev[ip].dev, O_RDWR)) >= 0)                      /* was opened successfull before */
-      {
-        pDev[ip].devopen = 1;
-        return(1);
-      } 
-  }
-  return(0);                                                                 /* Default, return device not available */
-}
-
-/*
- * Close the device 
- * abd set the flags in the device struct 
- *
- */
-int SCSI_CloseDevice(int DeviceFD)
-{
-  int ret;
-  extern OpenFiles_T *pDev;
-  
-  ret = close(pDev[DeviceFD].fd) ;
-  pDev[DeviceFD].devopen = 0;
-  return(ret);
-}
-
-int SCSI_ExecuteCommand(int DeviceFD,
-                        Direction_T Direction,
-                        CDB_T CDB,
-                        size_t CDB_Length,
-                        void *DataBuffer,
-                        size_t DataBufferLength,
-                        RequestSense_T *pRequestSense,
-                        size_t RequestSenseLength)
-{
-  extern OpenFiles_T *pDev;
-  ExtendedRequestSense_T ExtendedRequestSense;
-  scsireq_t ds;
-  int Zero = 0, Result;
-  int retries = 5;
-  extern int errno;
-  
-  /* Basic sanity checks */
-  assert(CDB_Length <= UCHAR_MAX);
-  assert(RequestSenseLength <= UCHAR_MAX);
-
-  /* Clear buffer for cases where sense is not returned */
-  memset(pRequestSense, 0, RequestSenseLength);
-
-  if (pDev[DeviceFD].avail == 0)
-    {
-      return(SCSI_ERROR);
-    }
-
-  memset(&ds, 0, SIZEOF(scsireq_t));
-  memset(pRequestSense, 0, RequestSenseLength);
-  memset(&ExtendedRequestSense, 0 , SIZEOF(ExtendedRequestSense_T)); 
-  
-  ds.flags = SCCMD_ESCAPE; 
-  /* Timeout */
-  ds.timeout = 120000;
-  /* Set the cmd */
-  memcpy(ds.cmd, CDB, CDB_Length);
-  ds.cmdlen = CDB_Length;
-  /* Data buffer for results */
-  if (DataBufferLength > 0)
-    {
-      ds.databuf = (caddr_t)DataBuffer;
-      ds.datalen = DataBufferLength;
-    }
-  /* Sense Buffer */
-  /*
-    ds.sense = (u_char)pRequestSense;
-  */
-  ds.senselen = RequestSenseLength;
-    
-  switch (Direction) 
-    {
-    case Input:
-      ds.flags = ds.flags | SCCMD_READ;
-      break;
-    case Output:
-      ds.flags = ds.flags | SCCMD_WRITE;
-      break;
-    }
-    
-  while (--retries > 0) {
-    
-    if (pDev[DeviceFD].devopen == 0)
-        if (SCSI_OpenDevice(DeviceFD) == 0)
-            return(SCSI_ERROR);
-    Result = ioctl(pDev[DeviceFD].fd, SCIOCCOMMAND, &ds);
-    SCSI_CloseDevice(DeviceFD);
-   
-    memcpy(pRequestSense, ds.sense, RequestSenseLength);
-    if (Result < 0)
-      {
-        dbprintf("errno : %s\n",strerror(errno));
-        return (SCSI_ERROR);
-      }
-    dbprintf("SCSI_ExecuteCommand(BSD) %02X STATUS(%02X) \n", CDB[0], ds.retsts);
-    switch (ds.retsts)
-      {
-      case SCCMD_BUSY:                /*  BUSY */
-        break;
-
-      case SCCMD_OK:                /*  GOOD */
-        return(SCSI_OK);
-
-      case SCCMD_SENSE:               /*  CHECK CONDITION */
-        return(SCSI_SENSE);
-
-      default:
-        continue;
-      }
-  }   
-  return(SCSI_SENSE);
-}
-
-/*
- * Send the command to the device with the
- * ioctl interface
- */
-int Tape_Ioctl( int DeviceFD, int command)
-{
-  extern OpenFiles_T *pDev;
-  struct mtop mtop;
-  int ret = 0;
-
-  if (pDev[DeviceFD].devopen == 0)
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-
-  switch (command)
-    {
-    case IOCTL_EJECT:
-      mtop.mt_op = MTOFFL;
-      mtop.mt_count = 1;
-      break;
-    default:
-      break;
-    }
-
-  if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0)
-    {
-      dbprintf(_("Tape_Ioctl error ioctl %s\n"),strerror(errno));
-      SCSI_CloseDevice(DeviceFD);
-      return(-1);
-    }
-
-  SCSI_CloseDevice(DeviceFD);
-  return(ret);  
-}
-
-int Tape_Status( int DeviceFD)
-{
-/* 
-  Not yet
-*/
-  return(-1);
-}
-
-int ScanBus(int print)
-{
-/*
-  Not yet
-*/
-  return(-1);
-}
-
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-file-style: gnu
- * End:
- */
diff --git a/changer-src/scsi-cam.c b/changer-src/scsi-cam.c
deleted file mode 100644 (file)
index d01d2d4..0000000
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: scsi-cam.c,v 1.15 2006/05/25 01:47:07 johnfranks Exp $
- *
- * Interface to execute SCSI commands on an system with cam support
- * Current support is for FreeBSD 4.x
- *
- * Copyright (c) Thomes Hepper th@ant.han.de
- */
-
-
-#include "amanda.h"
-
-#ifdef HAVE_CAMLIB_H
-# include <camlib.h>
-#endif
-
-#include <cam/scsi/scsi_message.h>
-
-#ifdef HAVE_SYS_MTIO_H
-#include <sys/mtio.h>
-#endif
-
-#include <scsi-defs.h>
-
-extern OpenFiles_T *pChangerDev;
-extern OpenFiles_T *pTapeDev;
-extern OpenFiles_T *pTapeDevCtl;
-extern FILE *debug_file;
-
-
-void SCSI_OS_Version()
-{
-#ifndef lint
-   static char rcsid[] = "$Id: scsi-cam.c,v 1.15 2006/05/25 01:47:07 johnfranks Exp $";
-   DebugPrint(DEBUG_INFO, SECTION_INFO, "scsi-os-layer: %s\n",rcsid);
-#endif
-}
-
-/* parse string of format 1:2:3 and fill in path, target, lun
-   returns 0  if it doesn't look like btl
-   returns 1  if parse successful
-   calls ChgExit if it looks like btl but formatted improperly
-*/
-
-int parse_btl(char *DeviceName, 
-          path_id_t *path, target_id_t *target, lun_id_t *lun) 
-{
-  char *p;
-  if (strstr(DeviceName, ":") == NULL) 
-    return 0;
-
-  p = strtok(DeviceName, ":");
-  if (sscanf(p,"%d", path) != 1) {
-      free(DeviceName);
-      ChgExit("SCSI_OpenDevice",
-       _("Path conversion error. Digits expected"), FATAL);
-  }
-          
-  if ((p = strtok(NULL,":")) == NULL) {
-      free(DeviceName);
-      ChgExit("SCSI_OpenDevice", _("target in Device Name not found"), FATAL);
-  }
-
-  if (sscanf(p,"%d", target) != 1) {
-      free(DeviceName);
-      ChgExit("SCSI_OpenDevice",
-       _("Target conversion error. Digits expected"), FATAL);
-  }
-
-  if ((p = strtok(NULL,":")) == NULL) {
-      free(DeviceName);
-      ChgExit("SCSI_OpenDevice", _("lun in Device Name not found"), FATAL);
-  }
-  if (sscanf(p,"%d", lun) != 1) {
-      free(DeviceName);
-      ChgExit("SCSI_OpenDevice",
-       _("LUN conversion error. Digits expected"), FATAL);
-  }
-
-  return 1;
-}
-
-/*
- * Check if the device is already open,
- * if no open it and save it in the list 
- * of open files.
- * DeviceName can be an device name, /dev/nrsa0 for example
- * or an bus:target:lun path, 0:4:0 for bus 0 target 4 lun 0
- */
-
-int SCSI_OpenDevice(int ip)
-{
-  extern OpenFiles_T *pDev;
-  char *DeviceName;
-  int DeviceFD;
-  int i;
-  path_id_t path;
-  target_id_t target;
-  lun_id_t lun;
-
-  DeviceName = stralloc(pDev[ip].dev);
-
-  if (pDev[ip].inqdone == 0) {
-    pDev[ip].inqdone = 1;
-    pDev[ip].SCSI = 0;
-    pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE);
-    if (parse_btl(DeviceName, &path, &target, &lun)) 
-        pDev[ip].curdev = cam_open_btl(path, target, lun, O_RDWR, NULL);
-    else
-        pDev[ip].curdev = cam_open_device(DeviceName, O_RDWR);
-
-    free(DeviceName);
-    if (pDev[ip].curdev) {
-      pDev[ip].avail = 1;
-      pDev[ip].SCSI = 1;
-      pDev[ip].devopen = 1;
-      if (SCSI_Inquiry(ip, pDev[ip].inquiry, INQUIRY_SIZE) == 0) {
-        if (pDev[ip].inquiry->type == TYPE_TAPE || pDev[ip].inquiry->type == TYPE_CHANGER) {
-          for (i=0;i < 16;i++)
-            pDev[ip].ident[i] = pDev[ip].inquiry->prod_ident[i];
-
-          for (i=15; i >= 0 && !isalnum(pDev[ip].ident[i]); i--) {
-            pDev[ip].ident[i] = '\0';
-          }
-          pDev[ip].SCSI = 1;
-
-         if (pDev[ip].inquiry->type == TYPE_TAPE)
-         {
-                 pDev[ip].type = stralloc("tape");
-         }
-
-         if (pDev[ip].inquiry->type == TYPE_CHANGER)
-         {
-                 pDev[ip].type = stralloc("changer");
-         }
-
-          PrintInquiry(pDev[ip].inquiry);
-          return(1);
-        } else {
-          free(pDev[ip].inquiry);
-          return(0);
-        }
-      } else {
-        pDev[ip].SCSI = 0;
-        free(pDev[ip].inquiry);
-        pDev[ip].inquiry = NULL;
-        return(1);
-      }
-    } else { /* Device open failed */
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice open failed\n"));
-      return(0);
-    }
-  }
-  if (parse_btl(DeviceName, &path, &target, &lun))
-      pDev[ip].curdev = cam_open_btl(path, target, lun, O_RDWR, NULL);
-  else
-      pDev[ip].curdev = cam_open_device(DeviceName, O_RDWR);
-
-  free(DeviceName);
-
-  if (pDev[ip].curdev) {
-    pDev[ip].devopen = 1;
-    return(1);
-  } else  {
-    return(0);
-  }
-}
-
-int SCSI_CloseDevice(int DeviceFD)
-{
-  int ret;
-  extern OpenFiles_T *pDev;
-
-  if (pDev[DeviceFD].SCSI == 1)
-    {
-      cam_close_device(pDev[DeviceFD].curdev);
-      pDev[DeviceFD].devopen = 0;
-    } else {
-      close(pDev[DeviceFD].fd);
-    }
-  return(0);
-}
-
-int SCSI_ExecuteCommand(int DeviceFD,
-                        Direction_T Direction,
-                        CDB_T CDB,
-                        size_t CDB_Length,
-                        void *DataBuffer,
-                        size_t DataBufferLength,
-                        RequestSense_T *pRequestSense,
-                        size_t RequestSenseLength)
-{
-  ExtendedRequestSense_T ExtendedRequestSense;
-  extern OpenFiles_T *pDev;
-  union ccb *ccb;
-  int ret;
-  guint32 ccb_flags;
-  OpenFiles_T *pwork = NULL;
-
-  /* Basic sanity checks */
-  assert(CDB_Length <= UCHAR_MAX);
-  assert(RequestSenseLength <= UCHAR_MAX);
-
-  /* Clear buffer for cases where sense is not returned */
-  memset(pRequestSense, 0, RequestSenseLength);
-
-  if (pDev[DeviceFD].avail == 0)
-    {
-      return(SCSI_ERROR);
-    }
-
-  /* 
-   * CLear the SENSE buffer
-   */
-  bzero(pRequestSense, RequestSenseLength);
-
-  DecodeSCSI(CDB, "SCSI_ExecuteCommand : ");
-
-  ccb = cam_getccb(pDev[DeviceFD].curdev);
-
-  /* Build the CCB */
-  bzero(&(&ccb->ccb_h)[1], SIZEOF(struct ccb_scsiio));
-  bcopy(&CDB[0], &ccb->csio.cdb_io.cdb_bytes, CDB_Length);
-
-  switch (Direction)
-    {
-    case Input:
-      if (DataBufferLength == 0)
-        {
-          ccb_flags = CAM_DIR_NONE;
-        } else {
-          ccb_flags = CAM_DIR_IN;
-        }
-      break;
-    case Output:
-      if (DataBufferLength == 0)
-        {
-          ccb_flags = CAM_DIR_NONE;
-        } else {     
-          ccb_flags = CAM_DIR_OUT;
-        }
-      break;
-    default:
-      ccb_flags = CAM_DIR_NONE;
-      break;
-    }
-  
-  cam_fill_csio(&ccb->csio,
-                /* retires */ 1,
-                /* cbfncp */ NULL,
-                /* flags */ ccb_flags,
-                /* tag_action */ MSG_SIMPLE_Q_TAG,
-                /* data_ptr */ (guint8*)DataBuffer,
-                /* dxfer_len */ DataBufferLength,
-                /* sense_len */ SSD_FULL_SIZE,
-                /* cdb_len */ CDB_Length,
-                /* timeout */ 600 * 1000);
-  
-
-  if (pDev[DeviceFD].devopen == 0)
-    {
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-        {
-          cam_freeccb(ccb);
-          return(SCSI_ERROR);
-       }
-    }
-  
-  ret = cam_send_ccb(pDev[DeviceFD].curdev, ccb);
-  SCSI_CloseDevice(DeviceFD);
-
-  if ( ret == -1)
-    {
-      cam_freeccb(ccb);
-      return(SCSI_ERROR);
-    }
-  
-  /* 
-   * copy the SENSE data to the Sense Buffer !!
-   */
-  memcpy(pRequestSense, &ccb->csio.sense_data, RequestSenseLength);
-  
-  /* ToDo add error handling */
-  if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
-    {
-      dbprintf(_("SCSI_ExecuteCommand return %d\n"), (ccb->ccb_h.status & CAM_STATUS_MASK));
-      return(SCSI_ERROR);
-    }
-
-  cam_freeccb(ccb);
-  return(SCSI_OK);
-}
-
-/*
- * Send the command to the device with the
- * ioctl interface
- */
-int Tape_Ioctl( int DeviceFD, int command)
-{
-  extern OpenFiles_T *pDev;
-  struct mtop mtop;
-  int ret = 0;
-
-  if (pDev[DeviceFD].devopen == 0)
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-
-  switch (command)
-    {
-    case IOCTL_EJECT:
-      mtop.mt_op = MTOFFL;
-      mtop.mt_count = 1;
-      break;
-    default:
-      break;
-    }
-
-  if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0)
-    {
-      dbprintf(_("Tape_Ioctl error ioctl %s\n"), strerror(errno));
-      SCSI_CloseDevice(DeviceFD);
-      return(-1);
-    }
-
-  SCSI_CloseDevice(DeviceFD);
-  return(ret);  
-}
-
-int Tape_Status( int DeviceFD)
-{
-  extern OpenFiles_T *pDev;
-  struct mtget mtget;
-  int ret = 0;
-  
-  if (pDev[DeviceFD].devopen == 0)
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-
-  if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0)
-  {
-     dbprintf(_("Tape_Status error ioctl %s\n"), strerror(errno));
-     SCSI_CloseDevice(DeviceFD);
-     return(-1);
-  }
-
-  dbprintf("ioctl -> mtget.mt_dsreg %lX\n",mtget.mt_dsreg);
-  dbprintf("ioctl -> mtget.mt_erreg %lX\n",mtget.mt_erreg);
-
-  /*
-   * I have no idea what is the meaning of the bits in mt_erreg
-   * I assume that nothing set is tape loaded
-   * 0x2 is no tape online
-   */
-  if (mtget.mt_erreg == 0)
-    {
-      ret = ret | TAPE_ONLINE;
-    }
-
-  if (mtget.mt_erreg & 0x2)
-    {
-      ret = ret | TAPE_NOT_LOADED;
-    }
-  
-  SCSI_CloseDevice(DeviceFD);
-  return(ret);
-}
-
-/*
- * Scans the bus for device with the type 'tape' or 'robot'
- *
- */
-int ScanBus(int print)
-{
-  int bus,target,lun;
-  int count = 0;
-  extern OpenFiles_T *pDev;
-  
-  for (bus = 0;bus < 3; bus++)
-    {
-      pDev[count].dev = malloc(10);
-      for (target = 0;target < 8; target++)
-        {
-          for (lun = 0; lun < 8; lun++)
-            {
-              g_sprintf(pDev[count].dev, "%d:%d:%d", bus, target, lun);
-              pDev[count].inqdone = 0;
-              if (OpenDevice(count, pDev[count].dev, "Scan", NULL))
-                {
-                  if (pDev[count].inquiry->type == TYPE_TAPE ||
-                      pDev[count].inquiry->type == TYPE_CHANGER)
-                    {
-                      count++;
-                      pDev[count].dev = malloc(10);
-                    } else {
-                      if (print)
-                        {
-                          g_printf(_("bus:target:lun -> %s == "),pDev[count].dev);
-                          
-                          switch (pDev[count].inquiry->type)
-                            {
-                            case TYPE_DISK:
-                              g_printf(_("Disk"));
-                              break;
-                            case TYPE_TAPE:
-                              g_printf(_("Tape"));
-                              break;
-                            case TYPE_PRINTER:
-                              g_printf(_("Printer"));
-                              break;
-                            case TYPE_PROCESSOR:
-                              g_printf(_("Processor"));
-                              break;
-                            case TYPE_WORM:
-                              g_printf(_("Worm"));
-                              break;
-                            case TYPE_CDROM:
-                              g_printf(_("Cdrom"));
-                              break;
-                            case TYPE_SCANNER:
-                              g_printf(_("Scanner"));
-                              break;
-                            case TYPE_OPTICAL:
-                              g_printf(_("Optical"));
-                              break;
-                            case TYPE_CHANGER:
-                              g_printf(_("Changer"));
-                              break;
-                            case TYPE_COMM:
-                              g_printf(_("Comm"));
-                              break;
-                            default:
-                              g_printf(_("unknown %d"),pDev[count].inquiry->type);
-                              break;
-                            }
-                          g_printf("\n");
-                        }
-                    } 
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-file-style: gnu
- * End:
- */
diff --git a/changer-src/scsi-changer-driver.c b/changer-src/scsi-changer-driver.c
deleted file mode 100644 (file)
index 8693bf3..0000000
+++ /dev/null
@@ -1,6633 +0,0 @@
-static char rcsid[] = "$Id: scsi-changer-driver.c,v 1.52 2006/07/21 00:25:50 martinea Exp $";
-/*
- * Interface to control a tape robot/library connected to the SCSI bus
- *
- * Copyright (c) Thomas Hepper th@ant.han.de
- */
-
-#include "amanda.h"
-
-#include "arglist.h"
-
-#include "scsi-defs.h"
-
-#include "device.h"
-
-extern FILE *debug_file;
-extern changer_t *changer;    /* Needed for the infos about emubarcode and labelfile */
-
-int PrintInquiry(SCSIInquiry_T *);
-int GenericElementStatus(int DeviceFD, int InitStatus);
-int SDXElementStatus(int DeviceFD, int InitStatus);
-int DLT448ElementStatus(int DeviceFD, int InitStatus);
-ElementInfo_T *LookupElement(int addr);
-int GenericResetStatus(int DeviceFD);
-int RequestSense(int, ExtendedRequestSense_T *, int  );
-void dump_hex(u_char *, size_t, int, int);
-void TerminateString(char *string, size_t length);
-void ChgExit(char *, char *, int);
-int BarCode(int fd);
-int LogSense(int fd);
-int SenseHandler(int fd, u_char flag, u_char SenseKey, u_char AdditionalSenseCode, u_char AdditionalSenseCodeQualifier, RequestSense_T *buffer);
-
-int SCSI_AlignElements(int DeviceFD, size_t MTE, size_t DTE, size_t STE);
-
-int DoNothing0(void);
-int DoNothing1(int);
-int DoNothing2(int, int);
-int DoNothing3(int, int, int);
-
-int GenericMove(int, int, int);
-int SDXMove(int, int, int);
-int CheckMove(ElementInfo_T *from, ElementInfo_T *to);
-int GenericRewind(int);
-/* int GenericStatus(void); */
-int GenericFree(void);
-int TapeStatus(void);                   /* Is the tape loaded ? */
-int DLT4000Eject(char *Device, int type);
-int GenericEject(char *Device, int type);
-int SCSI_LogSenseClean(char *Device);           /* Does the tape need a clean */
-int GenericClean(char *Device);                 /* Does the tape need a clean */
-int GenericBarCode(int DeviceFD);               /* Do we have Barcode reader support */
-int NoBarCode(int DeviceFD);
-
-int GenericSearch(void);
-void Inventory(char *labelfile, int drive, int eject, int start, int stop, int clean);
-
-int TreeFrogBarCode(int DeviceFD);
-int EXB_BarCode(int DeviceFD);
-int GenericSenseHandler(int fd, u_char flags, u_char SenseKey, u_char AdditionalSenseCode, u_char AdditionalSenseCodeQualifier, RequestSense_T *);
-
-ElementInfo_T *LookupElement(int address);
-int eject_tape(char *tapedev, int type);
-int unload(int fd, int drive, int slot);
-int load(int fd, int drive, int slot);
-int GetElementStatus(int DeviceFD);
-int drive_loaded(int fd, int drivenum);
-
-/*
- * Log Pages Decode
- */
-void WriteErrorCountersPage(LogParameter_T *, size_t);
-void ReadErrorCountersPage(LogParameter_T *, size_t);
-void C1553APage30(LogParameter_T *, size_t);
-void C1553APage37(LogParameter_T *, size_t);
-void EXB85058HEPage39(LogParameter_T *, size_t);
-void EXB85058HEPage3c(LogParameter_T *, size_t);
-int Decode(LogParameter_T *, unsigned *);
-int DecodeModeSense(u_char *buffer, size_t offset, char *pstring, char block, FILE *out);
-
-int SCSI_Run(int DeviceFD,
-            Direction_T Direction,
-            CDB_T CDB,
-            size_t CDB_Length,
-            void *DataBuffer,
-            size_t DataBufferLength,
-            RequestSense_T *pRequestSense,
-            size_t RequestSenseLength);
-
-int SCSI_Move(int DeviceFD, u_char chm, int from, int to);
-int SCSI_LoadUnload(int DeviceFD, RequestSense_T *pRequestSense, u_char byte1, u_char load);
-int SCSI_TestUnitReady(int, RequestSense_T *);
-int SCSI_ModeSense(int DeviceFD, u_char *buffer, u_char size, u_char byte1, u_char byte2);
-int SCSI_ModeSelect(int DeviceFD,
-                    u_char *buffer,
-                    u_char length,
-                    u_char save,
-                    u_char mode,
-                    u_char lun);
-
-int SCSI_ReadElementStatus(int DeviceFD,
-                           u_char type,
-                           u_char lun,
-                           u_char VolTag,
-                           int StartAddress,
-                           size_t NoOfElements,
-                          size_t DescriptorSize,
-                          u_char **data);
-
-FILE *StatFile;
-static int barcode;   /* cache the result from the BarCode function */
-
-SC_COM_T SCSICommand[] = {
-  {0x00,
-   6,
-   "TEST UNIT READY"},
-  {0x01,
-   6,
-   "REWIND"},
-  {0x03,
-   6,
-   "REQUEST SENSE"},
-  {0x07,
-   6,
-   "INITIALIZE ELEMENT STATUS"},
-  {0x12,
-   6,
-   "INQUIRY"},
-  {0x13,
-   6,
-   "ERASE"},
-  {0x15,
-   6,
-   "MODE SELECT"},
-  {0x1A,
-   6,
-   "MODE SENSE"},
-  {0x1B,
-   6,
-   "UNLOAD"},
-  {0x4D,
-   10,
-   "LOG SENSE"},
-  {0xA5,
-   12,
-   "MOVE MEDIUM"},
-  { 0xE5,
-    12,
-   "VENDOR SPECIFIC"},
-  {0xB8,
-   12,
-   "READ ELEMENT STATUS"},
-  {0, 0, 0}
-};
-
-ChangerCMD_T ChangerIO[] = {
-  {"generic_changer",
-   "Generic driver changer [generic_changer]",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  /* HP Devices */
-  {"C1553A",
-   "HP Auto Loader [C1553A]",
-   GenericMove,
-   GenericElementStatus,
-   DoNothing1,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  /* Exabyte Devices */
-  {"EXB-10e",
-   "Exabyte Robot [EXB-10e]",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  {"EXB-120",
-   "Exabyte Robot [EXB-120]",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   EXB_BarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  {"EXB-210",
-   "Exabyte Robot [EXB-210]",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   EXB_BarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  {"EXB-85058HE-0000",
-   "Exabyte Tape [EXB-85058HE-0000]",
-   DoNothing3,
-   DoNothing2,
-   DoNothing1,
-   DoNothing0,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  /* Tandberg Devices */
-  {"TDS 1420",
-   "Tandberg Robot (TDS 1420)",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-    /* ADIC Devices */
-  {"VLS DLT",
-   "ADIC VLS DLT Library [VLS DLT]",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  {"VLS SDX",
-   "ADIC VLS DLT Library [VLS SDX]",
-   SDXMove,
-   SDXElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  {"FastStor DLT",
-   "ADIC FastStor DLT Library [FastStor DLT]",
-   SDXMove,
-   DLT448ElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  {"Scalar DLT 448",
-   "ADIC DLT 448 [Scalar DLT 448]",
-   GenericMove,
-   DLT448ElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-   /* Sepctra Logic Devices */
-  {"215",
-   "Spectra Logic TreeFrog[215]",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   TreeFrogBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  /* BreeceHill Q7 */
-  {"Quad 7",
-   "Breece Hill Quad 7",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  /* Quantum Devices */
-  {"L500",
-   "ATL [L500]",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  /*
-   * And now the tape devices
-   */
-  /* The generic handler if nothing matches */
-  {"generic_tape",
-   "Generic driver tape [generic_tape]",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   GenericClean,
-   GenericRewind,
-   NoBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  {"DLT8000",
-   "DLT Tape [DLT8000]",
-   DoNothing3,
-   DoNothing2,
-   DoNothing1,
-   DoNothing0,
-   DLT4000Eject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  {"DLT7000",
-   "DLT Tape [DLT7000]",
-   DoNothing3,
-   DoNothing2,
-   DoNothing1,
-   DoNothing0,
-   DLT4000Eject,
-   GenericClean,
-   GenericRewind,
-   GenericBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  {"DLT4000",
-   "DLT Tape [DLT4000]",
-   DoNothing3,
-   DoNothing2,
-   DoNothing1,
-   DoNothing0,
-   DLT4000Eject,
-   GenericClean,
-   GenericRewind,
-   NoBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-  {"SLR100",
-   "Tandberg SLR100",
-   GenericMove,
-   GenericElementStatus,
-   GenericResetStatus,
-   GenericFree,
-   GenericEject,
-   SCSI_LogSenseClean,
-   GenericRewind,
-   NoBarCode,
-   GenericSearch,
-   GenericSenseHandler},
-   {NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
-};
-
-
-LogPageDecode_T DecodePages[] = {
-  {2,
-   "C1553A",
-   WriteErrorCountersPage},
-  {3,
-   "C1553A",
-   ReadErrorCountersPage},
-  {0x30,
-   "C1553A",
-   C1553APage30},
-  {0x37,
-   "C1553A",
-   C1553APage37},
-  {2,
-   "*",
-   WriteErrorCountersPage},
-  {3,
-   "*",
-   ReadErrorCountersPage},
-  {0x39,
-   "EXB-85058HE-0000",
-   EXB85058HEPage39},
-  {0x3c,
-   "EXB-85058HE-0000",
-   EXB85058HEPage3c},
-  {0, NULL, NULL}
-};
-
-
-int ElementStatusValid = 0;         /* Set if the READ ELEMENT STATUS was OK, an no error is pending */
-int LibModeSenseValid = 0;          /* Set if we did an scussefull MODE SENSE */
-
-char *SlotArgs = 0;
-/* Pointer to MODE SENSE Pages */
-u_char *pModePage = NULL;
-EAAPage_T *pEAAPage = NULL;
-DeviceCapabilitiesPage_T *pDeviceCapabilitiesPage = NULL;
-u_char *pVendorUnique = NULL;
-
-/*
- *  New way, every element type has its on array
- * which is dynamic allocated by the ElementStatus function,
-*/
-ElementInfo_T *pMTE = NULL; /*Medium Transport Element */
-ElementInfo_T *pSTE = NULL; /*Storage Element */
-ElementInfo_T *pIEE = NULL; /*Import Export Element */
-ElementInfo_T *pDTE = NULL; /*Data Transfer Element */
-size_t MTE = 0;                /*Counter for the above element types */
-size_t STE = 0;
-size_t IEE = 0;
-size_t DTE = 0;
-
-char *chgscsi_datestamp = NULL;       /* Result pointer for tape_rdlabel */
-char *chgscsi_label = NULL;           /* Result pointer for tape_rdlabel */
-char *chgscsi_result = NULL;          /* Needed for the result string of MapBarCode */
-
-/*
- * This used to be in tape-src/tapeio.c; this is the Device API version.
- */
-
-static char *
-tape_rdlabel(
-    char *devname,
-    char **datestamp,
-    char **label)
-{
-    Device *dev;
-    char *r = NULL;
-
-    dev = device_open(devname);
-    if (dev->status != DEVICE_STATUS_SUCCESS) {
-       r = g_strdup(device_error_or_status(dev));
-       g_object_unref(dev);
-       return r;
-    }
-
-    if (!device_configure(dev, TRUE) || !device_read_label(dev)) {
-       r = g_strdup(device_error_or_status(dev));
-       g_object_unref(dev);
-       return r;
-    }
-
-    *datestamp = g_strdup(dev->volume_time);
-    *label = g_strdup(dev->volume_label);
-
-    return NULL;
-}
-
-/*
- * First all functions which are called from extern
- */
-
-
-/*
- * Print the scsi-changer-driver version
- */
-
-void
-ChangerDriverVersion(void)
-{
-  DebugPrint(DEBUG_ERROR, SECTION_INFO, "scsi-changer-driver: %s\n",rcsid);
-  SCSI_OS_Version();
-}
-
-/*
- * Try to generate an template which can be used as an example for the config file
- *
- */
-void
-PrintConf(void)
-{
-  extern OpenFiles_T *pDev;
-  int count;
-  char *cwd;
-
-  g_printf(_("# Please replace every ??? with the correct parameter.\n"));
-  g_printf(_("# It is not possible to guess everything :-)\n"));
-  g_printf(_("# Remove the line if the option is not needed."));
-  g_printf(_("#   Example: cleanmax if you have no cleaning tape"));
-  g_printf(_("#\n"));
-  g_printf(_(
-   "number_configs  1 # Number of configs, you can have more than 1 config\n"
-   "                  # if you have for example more than one drive, or you\n"
-   "                  # to split your lib to use different dump levels\n"
-   "                  #\n"));
-  g_printf(_(
-   "emubarcode      1 # If you drive has no barcode reader this will try\n"
-   "                  # keep an inventory of your tapes to find them faster\n"
-   "                  #\n"));
-  g_printf(_(
-   "havebarcode     0 # Set this to 1 if you have a library with a\n"
-   "                  # barcode reader\n"
-   "                  #\n"));
-  g_printf(_(
-   "debuglevel    0:0 # For debuging, see the docs /docs/TAPE-CHANGER\n"
-   "                  #\n"));
-  g_printf(_(
-   "eject         ??? # set this to 1 if your drive needs an eject before move\n"
-   "                  #\n"));
-  g_printf(_(
-   "sleep         ??? # How long to wait after an eject command before moving\n"
-   "                  # the tape\n"
-   "                  #\n"));
-
-  for (count = 0; count < CHG_MAXDEV ; count++)
-    {
-      if (pDev[count].dev)
-       {
-         if (pDev[count].inquiry != NULL && pDev[count].inquiry->type == TYPE_CHANGER)
-           {
-             g_printf(_("changerdev   %s # This is the device to communicate with the robot\n"), pDev[count].dev);
-             break;
-           }
-       }
-    }
-
-  /*
-   * Did we reach the end of the list ?
-   * If no we found an changer and now we try to
-   * get the element status for the count of slots
-   */
-  if (count < CHG_MAXDEV)
-    {
-      pDev[count].functions->function_status(count, 1);
-    } else {
-      g_printf(_("changerdev ???       # Ups nothing found. Please check the docs\n"));
-    }
-
-  g_printf(_(
-   "                     #\n"));
-  g_printf(_(
-   "                     # Here now comes the config for the first tape\n"));
-  g_printf(_(
-   "config             0 # This value is the one which is used in the amanda\n"
-   "                     # config file to tell the chg-scsi programm which tape\n"
-   "                     # and which slots to use\n"
-   "                     #\n"));
-  g_printf(_(
-   "cleancart        ??? # The slot where the cleaning tape is located\n"
-   "                     # remove it if you have no cleaning tape\n"
-   "                     #\n"));
-  g_printf(_(
-   "drivenum           0 # Which tape drive to use if there are more than one drive\n"
-   "                     #\n"));
-  g_printf(_(
-   "dev              ??? # Which is the raw device to read/write data from the tape\n"
-   "                     # It is important to use the non rewinding tape, like\n"
-   "                     # /dev/nrst0 on linux, /dev/nrsa0 on BSD ....\n"
-   "                     #\n"));
-
-  /*
-   * OK now lets see if we have an direct SCSI channel
-   * to the tape
-   * If not thats not a problem
-   */
-  for (count = 0; count < CHG_MAXDEV; count++)
-    {
-      if (pDev[count].dev)
-       {
-         if (pDev[count].inquiry != NULL && pDev[count].inquiry->type == TYPE_TAPE)
-           {
-             g_printf(_(
-               "scsitapedev   %s # This is the device to communicate with the tape\n"
-               "                 # to get some device stats, not so important, and\n"
-               "                 # if you run into problems delete it completely\n"
-               "                 #\n"), pDev[count].dev);
-             break;
-           }
-       }
-    }
-
-
-  if (STE != 0)
-    {
-      g_printf(_(
-       "startuse          0  # Which is the first slot to use\n"
-       "                     #\n"));
-      g_printf(_(
-       "enduse            %zu  # Which is the last slot to use.\n"), STE);
-    } else {
-      g_printf(_(
-       "startuse         ??? # Which is the first slot to use\n"
-       "                     #\n"));
-      g_printf(_(
-       "enduse           ??? # Which is the last slot to use.\n"));
-    }
-    g_printf(_(
-       "                     # Decrement this value by 1 if you have a\n"
-       "                     # cleaning tape in the last slot\n"
-       "                     #\n"));
-
-  if ((cwd = getcwd(NULL, 0)) == NULL) {
-      cwd = _("<unknown>");
-  }
-
-  g_printf(_("statfile %s/tape0-slot #\n"),cwd);
-  g_printf(_("cleanfile %s/tape0-clean #\n"), cwd);
-  g_printf(_("usagecount %s/tape0-totaltime #\n"), cwd);
-  g_printf(_("tapestatus %s/tape0-tapestatus #\n"), cwd);
-  g_printf(_("labelfile %s/labelfile #\n"), cwd);
-}
-
-
-
-/*
- * Try to create a list of tapes and labels which are in the current
- * magazin. The drive must be empty !!
- *
- * labelfile -> file name of the db
- * drive -> which drive should we use
- * eject -> the tape device needs an eject before move
- * start -> start at slot start
- * stop  -> stop at slot stop
- * clean -> if we have an cleaning tape than this is the slot number of it
- *
- * return
- * 0  -> fail
- * 1  -> successfull
- *
- * ToDo:
- * Check if the tape/changer is ready for the next move
- * If an tape is loaded unload it and do initialize element status to
- * get all labels if an bar code reader is installed
- */
-void
-Inventory(
-    char *     labelfile,
-    int                drive,
-    int                eject,
-    int                start,
-    int                stop,
-    int                clean)
-{
-  extern OpenFiles_T *pDev;
-  size_t x;
-  static int inv_done = 0;     /* Inventory function called ?, marker to disable recursion */
-  MBC_T *pbarcoderes;          /* Here we will pass the parameter to MapBarCode and get the result */
-
-  (void)start; /* Quiet unused parameter warning */
-  (void)stop;  /* Quiet unused parameter warning */
-
-  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("##### START Inventory\n"));
-  pbarcoderes = alloc(SIZEOF(MBC_T));
-  memset(pbarcoderes, 0 , SIZEOF(MBC_T));
-
-  if (inv_done != 0)
-    {
-      DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("##### STOP inv_done -> %d Inventory\n"),inv_done);
-      free(pbarcoderes);
-      return;
-      /*NOTREACHED*/
-    }
-  inv_done = 1;
-  barcode = BarCode(INDEX_CHANGER);
-
-  pbarcoderes->action = RESET_VALID;
-
-  MapBarCode(labelfile,pbarcoderes);
-
-  /*
-   * Check if an tape is loaded, if yes unload it
-   * and do an INIT ELEMENT STATUS
-   */
-
-  if (pDTE[0].status == 'F')
-    {
-      if (eject)
-       {
-         (void)eject_tape("", eject);
-       }
-      (void)unload(INDEX_TAPE, 0, 0);
-    }
-
-  GenericResetStatus(INDEX_CHANGER);
-
-  for (x = 0; x < STE; x++)
-    {
-      if (x == (size_t)clean)
-       {
-         continue;
-       }
-
-      /*
-       * Load the tape, on error try the next
-       * error could be an empty slot for example
-       */
-      if (load(INDEX_CHANGER, drive, x ) != 0)
-       {
-         DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE, _("Load drive(%d) from(%d) failed\n"), drive, x);
-         continue;
-       }
-
-      /*
-       * Wait until the tape is ready
-       */
-      Tape_Ready(INDEX_TAPECTL, 60);
-
-      SCSI_CloseDevice(INDEX_TAPE);
-
-      if ((chgscsi_result = (char *)tape_rdlabel(pDev[INDEX_TAPE].dev, &chgscsi_datestamp, &chgscsi_label)) == NULL)
-      {
-       pbarcoderes->action = UPDATE_SLOT;
-       strncpy(pbarcoderes->data.voltag, chgscsi_label,
-               SIZEOF(pbarcoderes->data.voltag));
-       pbarcoderes->data.slot = x;
-       pbarcoderes->data.from = 0;
-       pbarcoderes->data.LoadCount = 1;
-       if (BarCode(INDEX_CHANGER) == 1)
-         {
-           strncpy(pbarcoderes->data.barcode, pDTE[drive].VolTag,
-                   SIZEOF(pbarcoderes->data.barcode));
-           MapBarCode(labelfile, pbarcoderes);
-         } else {
-           MapBarCode(labelfile, pbarcoderes);
-         }
-      } else {
-       DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE, _("Read label failed\n"));
-      }
-
-      if (eject)
-       {
-         (void)eject_tape("", eject);
-       }
-
-      (void)unload(INDEX_TAPE, drive, x);
-    }
-  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("##### STOP Inventory\n"));
-  free(pbarcoderes);
-}
-
-/*
- * Check if the slot ist empty
- * slot -> slot number to check
- */
-int
-isempty(
-    int                fd,
-    int                slot)
-{
-  extern OpenFiles_T *pDev;
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### START isempty\n"));
-
-  if (ElementStatusValid == 0)
-    {
-      if ( pDev[fd].functions->function_status(fd, 1) != 0)
-        {
-          DebugPrint(DEBUG_ERROR,SECTION_TAPE,_("##### STOP isempty [-1]\n"));
-          return(-1);
-         /*NOTREACHED*/
-        }
-    }
-
-  if (pSTE[slot].status == 'E')
-    {
-      DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP isempty [1]\n"));
-      return(1);
-      /*NOTREACHED*/
-    }
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP isempty [0]\n"));
-  return(0);
-}
-
-int
-get_clean_state(
-    char *tapedev)
-{
-  extern OpenFiles_T *pDev;
-  /* Return 1 if cleaning is needed */
-  int ret;
-
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### START get_clean_state\n"));
-
-  if (pDev[INDEX_TAPECTL].SCSI == 0)
-    {
-      DebugPrint(DEBUG_ERROR,SECTION_TAPE,_("##### STOP get_clean_state [-1]\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-  ret=pDev[INDEX_TAPECTL].functions->function_clean(tapedev);
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP get_clean_state [%d]\n"), ret);
-  return(ret);
-}
-
-/*
- * eject the tape
- * The parameter tapedev is not used.
- * Type describes if we should force the SCSI eject if available
- * normal eject is done with the ioctl
- */
-/* This function ejects the tape from the drive */
-
-int
-eject_tape(
-    char *     tapedev,
-    int                type)
-{
-  extern OpenFiles_T *pDev;
-  int ret;
-
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### START eject_tape %s\n"),tapedev);
-  if (pDev[INDEX_TAPECTL].functions == NULL)
-    return(-1);
-
-  /*
-   * Try to read the label
-   */
-  if (pDev[INDEX_TAPE].avail == 1 && (changer->emubarcode == 1 || BarCode(INDEX_CHANGER)))
-    {
-
-      if (pDev[INDEX_TAPECTL].SCSI == 1 && pDev[INDEX_TAPECTL].avail) {
-        DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### eject_tape rewind\n");
-       pDev[INDEX_TAPECTL].functions->function_rewind(INDEX_TAPECTL);
-      } else {
-        DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### eject_tape rewind2\n");
-       pDev[INDEX_TAPE].functions->function_rewind(INDEX_TAPE);
-      }
-
-      if (pDev[INDEX_TAPE].devopen == 1)
-       {
-          DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### eject_tape close\n");
-         SCSI_CloseDevice(INDEX_TAPE);
-       }
-
-      DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### tape_eject tape_rdlabel\n");
-      chgscsi_result = (char *)tape_rdlabel(pDev[INDEX_TAPE].dev, &chgscsi_datestamp, &chgscsi_label);
-    }
-
-  if (pDev[INDEX_TAPECTL].SCSI == 1 && pDev[INDEX_TAPECTL].avail == 1 && type == 1)
-    {
-      DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### tape_eject eject\n");
-      ret=pDev[INDEX_TAPECTL].functions->function_eject(tapedev, type);
-      DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP (SCSI)eject_tape [%d]\n"), ret);
-      return(ret);
-      /*NOTREACHED*/
-    }
-
-  if (pDev[INDEX_TAPE].avail == 1)
-    {
-      ret=Tape_Ioctl(INDEX_TAPE, IOCTL_EJECT);
-      DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP (ioctl)eject_tape [%d]\n"), ret);
-      return(ret);
-      /*NOTREACHED*/
-    }
-
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP eject_tape [-1]\n"));
-  return(-1);
-}
-
-
-/* Find an empty slot, starting at start, ending at start+count */
-int
-find_empty(
-    int        fd,
-    int        start,
-    int        count)
-{
-  extern OpenFiles_T *pDev;
-  size_t x;
-  size_t end;
-
-  DebugPrint(DEBUG_INFO,SECTION_ELEMENT,_("###### START find_empty\n"));
-
-  if (ElementStatusValid == 0)
-    {
-      if ( pDev[fd].functions->function_status(fd , 1) != 0)
-        {
-          DebugPrint(DEBUG_ERROR,SECTION_ELEMENT,
-                    _("###### END find_empty [-1]\n"));
-          return((ssize_t)-1);
-         /*NOTREACHED*/
-        }
-    }
-
-  if (count == 0)
-    {
-      end = STE;
-    } else {
-      end = start + count;
-    }
-
-  if (end > STE)
-    {
-      end = STE;
-    }
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,
-            _("start at %zu, end at %zu\n"),
-            (size_t)start,
-            (size_t)end);
-
-  for (x = start; x < end; x++)
-    {
-      if (pSTE[x].status == 'E')
-        {
-          DebugPrint(DEBUG_INFO,SECTION_ELEMENT,
-                    _("###### END find_empty [%lu]\n"), x);
-          return((ssize_t)x);
-         /*NOTREACHED*/
-        }
-    }
-  DebugPrint(DEBUG_ERROR,SECTION_ELEMENT,_("###### END find_empty [-1]\n"));
-  return((ssize_t)-1);
-}
-
-/*
- * See if the tape is loaded based on the information we
- * got back from the ReadElementStatus
- * return values
- * -1 -> Error (Fatal)
- * 0  -> drive is empty
- * 1  -> drive is loaded
- */
-int
-drive_loaded(
-    int                fd,
-    int                drivenum)
-{
-  extern OpenFiles_T *pDev;
-
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("###### START drive_loaded\n"));
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,
-               _("        drive_loaded : fd %d drivenum %d \n"), fd, drivenum);
-
-
-  if (ElementStatusValid == 0)
-    {
-      if (pDev[INDEX_CHANGER].functions->function_status(INDEX_CHANGER, 1) != 0)
-       {
-         DebugPrint(DEBUG_ERROR,SECTION_TAPE,_("Fatal error\n"));
-         return(-1);
-         /*NOTREACHED*/
-       }
-    }
-
-  if (pDTE[drivenum].status == 'E') {
-    DebugPrint(DEBUG_INFO,SECTION_TAPE,_("###### STOP drive_loaded (empty)\n"));
-    return(0);
-    /*NOTREACHED*/
-  }
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("###### STOP drive_loaded (not empty)\n"));
-  return(1);
-}
-
-
-/*
- * unload the specified drive into the specified slot
- * (storage element)
- *
- * TODO:
- * Check if the MTE is empty
- */
-int
-unload(
-    int                fd,
-    int                drive,
-    int                slot)
-{
-  extern OpenFiles_T *pDev;
-  extern int do_inventory;
-  MBC_T *pbarcoderes;
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("###### START unload\n"));
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,
-                       _("              unload : fd %d, slot %d, drive %d \n"),
-                       fd, slot, drive);
-  pbarcoderes = alloc(SIZEOF(MBC_T));
-  memset(pbarcoderes, 0, SIZEOF(MBC_T));
-
-  /*
-   * If the Element Status is not valid try to
-   * init it
-   */
-  if (ElementStatusValid == 0)
-    {
-      if (pDev[INDEX_CHANGER].functions->function_status(INDEX_CHANGER , 1) != 0)
-       {
-         DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Element Status not valid, reset failed\n"));
-         DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1)\n"));
-         free(pbarcoderes);
-         return(-1);
-         /*NOTREACHED*/
-       }
-    }
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,
-               _("              unload : unload drive %d[%d] slot %d[%d]\n"),
-               drive, pDTE[drive].address, slot, pSTE[slot].address);
-
-  /*
-   * Unloading an empty tape unit makes no sense
-   * so return with an error
-   */
-  if (pDTE[drive].status == 'E')
-    {
-      DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("unload : Drive %d address %d is empty\n"), drive, pDTE[drive].address);
-      DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1)\n"));
-      free(pbarcoderes);
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  /*
-   * If the destination slot is full
-   * try to find an enpty slot
-   */
-  if (pSTE[slot].status == 'F')
-    {
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("unload : Slot %d address %d is full\n"), drive, pSTE[slot].address);
-      if ( ElementStatusValid == 0)
-       {
-         DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("unload: Element Status not valid, can't find an empty slot\n"));
-         free(pbarcoderes);
-         return(-1);
-         /*NOTREACHED*/
-       }
-
-      slot = find_empty(fd, 0, 0);
-      if (slot == -1 )
-      {
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("unload: No Empty slot found\n"));
-             free(pbarcoderes);
-             return(-1);
-             /*NOTREACHED*/
-      }
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("unload : found empty one, try to unload to slot %d\n"), slot);
-    }
-
-
-
-  /*
-   * If eject is not set we must read the label info
-   */
-
-  if (changer->eject == 0)
-    {
-      if (pDev[INDEX_TAPE].avail == 1 && (changer->emubarcode == 1 || BarCode(INDEX_CHANGER)))
-       {
-
-         if (pDev[INDEX_TAPECTL].SCSI == 1 && pDev[INDEX_TAPECTL].avail) {
-           pDev[INDEX_TAPECTL].functions->function_rewind(INDEX_TAPECTL);
-         } else {
-           pDev[INDEX_TAPE].functions->function_rewind(INDEX_TAPE);
-         }
-
-         if (pDev[INDEX_TAPE].devopen == 1)
-           {
-             SCSI_CloseDevice(INDEX_TAPE);
-           }
-
-         chgscsi_result = (char *)tape_rdlabel(pDev[INDEX_TAPE].dev, &chgscsi_datestamp, &chgscsi_label);
-       }
-    }
-
-  /*
-   * Do the unload/move
-   */
-  if (pDev[INDEX_CHANGER].functions->function_move(INDEX_CHANGER,
-           pDTE[drive].address, pSTE[slot].address) != 0) {
-      DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1 move failed)\n"));
-      free(pbarcoderes);
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-
-  /*
-   * Update the Status
-   */
-  if (pDev[INDEX_CHANGER].functions->function_status(INDEX_CHANGER , 1) != 0)
-    {
-      DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1 update status failed)\n"));
-      free(pbarcoderes);
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  /*
-   * Did we get an error from tape_rdlabel
-   * if no update the vol/label mapping
-   * If chgscsi_label is NULL don't do it
-   */
-  if (chgscsi_result  == NULL && chgscsi_label != NULL && changer->labelfile != NULL)
-  {
-    /*
-     * OK this is only needed if we have emubarcode set
-     * There we need an exact inventory to get the search function working
-     * and returning correct results
-     */
-    if (BarCode(INDEX_CHANGER) == 0 && changer->emubarcode == 1)
-      {
-       /*
-        * We got something, update the db
-        * but before check if the db has as entry the slot
-        * to where we placed the tape, if no force an inventory
-        */
-       pbarcoderes->action = FIND_SLOT;
-       strncpy(pbarcoderes->data.voltag, chgscsi_label,
-               SIZEOF(pbarcoderes->data.voltag));
-       strncpy(pbarcoderes->data.barcode, pSTE[slot].VolTag,
-              SIZEOF(pbarcoderes->data.barcode));
-       pbarcoderes->data.slot = 0;
-       pbarcoderes->data.from = 0;
-       pbarcoderes->data.LoadCount = 0;
-
-
-       if ( MapBarCode(changer->labelfile, pbarcoderes) == 0) /* Nothing known about this, do an Inventory */
-         {
-           do_inventory = 1;
-         } else {
-           if (slot != pbarcoderes->data.slot)
-             {
-               DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Slot DB out of sync, slot %d != map %d"),slot, pbarcoderes->data.slot);
-               do_inventory = 1;
-             }
-         }
-      }
-  }
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP unload(0)\n"));
-  free(pbarcoderes);
-  return(0);
-}
-
-
-/*
- * load the media from the specified element (slot) into the
- * specified data transfer unit (drive)
- * fd     -> pointer to the internal device structure pDev
- * driver -> which drive in the library
- * slot   -> the slot number from where to load
- *
- * return -> 0 = success
- *           !0 = failure
- */
-int
-load(
-    int                fd,
-    int                drive,
-    int                slot)
-{
-  char *result = NULL;          /* Needed for the result of tape_rdlabel */
-  int ret;
-  extern OpenFiles_T *pDev;
-  extern int do_inventory;
-  MBC_T *pbarcoderes;
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("###### START load\n"));
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("%-20s : fd %d, drive %d, slot %d \n"), "load", fd, drive, slot);
-  pbarcoderes = alloc(SIZEOF(MBC_T));
-  memset(pbarcoderes, 0 , SIZEOF(MBC_T));
-
-  if (ElementStatusValid == 0)
-      {
-          if (pDev[fd].functions->function_status(fd, 1) != 0)
-              {
-               DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1)\n"));
-               DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n"));
-               free(pbarcoderes);
-               return(-1);
-               /*NOTREACHED*/
-              }
-      }
-
-  /*
-   * Check if the requested slot is in the range of available slots
-   * The library starts counting at 1, we start at 0, so if the request slot
-   * is ge than the value we got from the ModeSense fail with an return value
-   * of 2
-   */
-  if ((size_t)slot >= STE)
-    {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : slot %d ge STE %d\n"),slot, STE);
-      ChgExit("load", _("slot >= STE"), FATAL);
-      /*NOTREACHED*/
-    }
-
-  /*
-   * And the same for the tape drives
-   */
-  if (drive >= (int)DTE)
-    {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : drive %d ge DTE %d\n"),drive, DTE);
-      ChgExit("load", _("drive >= DTE"), FATAL);
-      /*NOTREACHED*/
-    }
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("load : load drive %d[%d] slot %d[%d]\n"),drive,
-            pDTE[drive].address,
-            slot,
-            pSTE[slot].address);
-
-  if (pDTE[drive].status == 'F')
-    {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : Drive %d address %d is full\n"), drive, pDTE[drive].address);
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n"));
-      free(pbarcoderes);
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  if (pSTE[slot].status == 'E')
-    {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : Slot %d address %d is empty\n"), drive, pSTE[slot].address);
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n"));
-      free(pbarcoderes);
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  ret = pDev[fd].functions->function_move(fd, pSTE[slot].address, pDTE[drive].address);
-
-  /*
-   * Update the Status
-   */
-  if (pDev[fd].functions->function_status(fd, 1) != 0)
-      {
-       DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n"));
-       free(pbarcoderes);
-       return(-1);
-       /*NOTREACHED*/
-      }
-
-  /*
-   * Try to read the label
-   * and update the label/slot database
-   */
-  if (pDev[INDEX_TAPE].avail == 1 && (changer->emubarcode == 1 || BarCode(INDEX_CHANGER)))
-    {
-
-      if (pDev[INDEX_TAPECTL].SCSI == 1 && pDev[INDEX_TAPECTL].avail) {
-       pDev[INDEX_TAPECTL].functions->function_rewind(INDEX_TAPECTL);
-      } else {
-       pDev[INDEX_TAPE].functions->function_rewind(INDEX_TAPE);
-      }
-
-      if (pDev[INDEX_TAPE].devopen == 1)
-       {
-         SCSI_CloseDevice(INDEX_TAPE);
-       }
-
-      result = (char *)tape_rdlabel(pDev[INDEX_TAPE].dev, &chgscsi_datestamp, &chgscsi_label);
-    }
-
-  /*
-   * Did we get an error from tape_rdlabel
-   * if no update the vol/label mapping
-   */
-  if (result  == NULL && changer->labelfile != NULL && chgscsi_label != NULL )
-    {
-      /*
-       * We got something, update the db
-       * but before check if the db has as entry the slot
-       * to where we placed the tape, if no force an inventory
-       */
-      strncpy(pbarcoderes->data.voltag, chgscsi_label,
-             SIZEOF(pbarcoderes->data.voltag));
-      pbarcoderes->data.slot = 0;
-      pbarcoderes->data.from = 0;
-      pbarcoderes->data.LoadCount = 0;
-
-
-      /*
-       * If we have an barcode reader we only do an update
-       * If emubarcode is set we check if the
-       * info in the DB is up to date, if no we set the do_inventory flag
-       */
-
-      if (BarCode(INDEX_CHANGER) == 1 && changer->emubarcode == 0)
-       {
-         pbarcoderes->action = UPDATE_SLOT;
-         strncpy(pbarcoderes->data.barcode, pDTE[drive].VolTag,
-                 SIZEOF(pbarcoderes->data.barcode));
-         pbarcoderes->data.LoadCount = 1;
-         pbarcoderes->data.slot = slot;
-         MapBarCode(changer->labelfile, pbarcoderes);
-       }
-
-      if (BarCode(INDEX_CHANGER) == 0 && changer->emubarcode == 1)
-       {
-         pbarcoderes->action = FIND_SLOT;
-         if (MapBarCode(changer->labelfile, pbarcoderes) == 0) /* Nothing found, do an inventory */
-           {
-             do_inventory = 1;
-           } else { /* We got something, is it correct ? */
-             if (slot != pbarcoderes->data.slot && do_inventory == 0)
-               {
-                 DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Slot DB out of sync, slot %d != map %d"),slot, pbarcoderes->data.slot);
-                 ChgExit("Load", _("Label DB out of sync"), FATAL);
-                 /*NOTREACHED*/
-               } else { /* OK, so increment the load count */
-                 pbarcoderes->action = UPDATE_SLOT;
-                 pbarcoderes->data.LoadCount = 1;
-                 pbarcoderes->data.slot = slot;
-                 MapBarCode(changer->labelfile, pbarcoderes);
-               }
-           }
-       }
-
-      if (BarCode(INDEX_CHANGER) == 1 && changer->emubarcode == 1)
-       {
-         ChgExit("Load", _("BarCode == 1 and emubarcode == 1"), FATAL);
-         /*NOTREACHED*/
-       }
-
-      DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("##### STOP load (%d)\n"),ret);
-      free(pbarcoderes);
-      return(ret);
-      /*NOTREACHED*/
-    }
-    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("##### STOP load (%d)\n"),ret);
-    free(pbarcoderes);
-    return(ret);
-}
-
-/*
- * Returns the number of Storage Slots which the library has
- * fd -> pointer to the internal devie structure pDev
- * return -> Number of slots
- */
-int
-get_slot_count(
-    int fd)
-{
-  extern OpenFiles_T *pDev;
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("###### START get_slot_count\n"));
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("%-20s : fd %d\n"), "get_slot_count", fd);
-
-  if (ElementStatusValid == 0)
-    {
-      pDev[fd].functions->function_status(fd, 1);
-    }
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,
-            _("##### STOP get_slot_count (%zu)\n"), STE);
-  return((ssize_t)STE);
-  /*
-   * return the number of slots in the robot
-   * to the caller
-   */
-}
-
-
-/*
- * retreive the number of data-transfer devices /Tape drives)
- * fd     -> pointer to the internal devie structure pDev
- * return -> -1 on failure
- */
-int
-get_drive_count(
-    int fd)
-{
-
-  extern OpenFiles_T *pDev;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### START get_drive_count\n"));
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-20s : fd %d\n"), "get_drive_count", fd);
-
-  if (ElementStatusValid == 0)
-      {
-          if ( pDev[fd].functions->function_status(fd, 1) != 0)
-           {
-               DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("Error getting drive count\n"));
-               DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("##### STOP get_drive_count (-1)\n"));
-               return(-1);
-               /*NOTREACHED*/
-           }
-      }
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,
-            _("###### STOP get_drive_count (%zu drives)\n"), DTE);
-  return((ssize_t)DTE);
-}
-
-/*
- * Now the internal functions
- */
-
-/*
- * Open the device and placeit in the list of open files
- * The OS has to decide if it is an SCSI Commands capable device
- */
-
-int
-OpenDevice(
-    int                ip,
-    char *     DeviceName,
-    char *     ConfigName,
-    char *     ident)
-{
-  extern OpenFiles_T *pDev;
-  char tmpstr[16];
-  ChangerCMD_T *p = (ChangerCMD_T *)&ChangerIO;
-
-  if (!ConfigName)
-       return 1;
-  if (!DeviceName)
-       return 1;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START OpenDevice\n"));
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("OpenDevice : %s\n"), DeviceName);
-
-  pDev[ip].ConfigName = strdup(ConfigName);
-  pDev[ip].dev = strdup(DeviceName);
-
-  if (SCSI_OpenDevice(ip) != 0 )
-    {
-      if (ident != NULL)   /* Override by config */
-      {
-        while(p->ident != NULL)
-          {
-            if (strcmp(ident, p->ident) == 0)
-              {
-                pDev[ip].functions = p;
-               strncpy(pDev[ip].ident, ident, 17);
-                DebugPrint(DEBUG_INFO, SECTION_SCSI,_("override using ident = %s, type = %s\n"),p->ident, p->type);
-               DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice\n"));
-                return(1);
-               /*NOTREACHED*/
-              }
-            p++;
-          }
-         ChgExit("OpenDevice", _("ident not found"), FATAL);
-         /*NOTREACHED*/
-      } else {
-        while(p->ident != NULL)
-          {
-            if (strcmp(pDev[ip].ident, p->ident) == 0)
-              {
-                pDev[ip].functions = p;
-                DebugPrint(DEBUG_INFO, SECTION_SCSI,_("using ident = %s, type = %s\n"),p->ident, p->type);
-               DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice\n"));
-                return(1);
-               /*NOTREACHED*/
-              }
-            p++;
-          }
-      }
-      /* Nothing matching found, try generic */
-      /* divide generic in generic_type, where type is the */
-      /* num returned by the inquiry command */
-      p = (ChangerCMD_T *)&ChangerIO;
-      g_snprintf(&tmpstr[0], SIZEOF(tmpstr), "%s_%s","generic",pDev[0].type);
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### OpenDevice trying GENERIC Device %s\n",tmpstr);
-      while(p->ident != NULL)
-        {
-          if (strcmp(tmpstr, p->ident) == 0)
-            {
-              pDev[ip].functions = p;
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("using ident = %s, type = %s\n"),p->ident, p->type);
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice\n"));
-              return(1);
-             /*NOTREACHED*/
-            }
-          p++;
-        }
-    } else { /* Something failed, lets see what */
-      DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("##### STOP OpenDevice failed\n"));
-    }
-  pDev[ip].functions = NULL;
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice (nothing found) !!\n"));
-  return(0);
-}
-
-
-/*
- * This functions checks if the library has an barcode reader.
- * fd     -> pointer to the internal devie structure pDev
- */
-int
-BarCode(
-    int                fd)
-{
-  int ret;
-  extern OpenFiles_T *pDev;
-
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START BarCode\n"));
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("%-20s : fd %d\n"), "BarCode", fd);
-
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("Ident = [%s], function = [%s]\n"), pDev[fd].ident,
-            pDev[fd].functions->ident);
-  ret = pDev[fd].functions->function_barcode(fd);
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP BarCode (%d)\n"),ret);
-  return(ret);
-}
-
-
-/*
- * This functions check if the tape drive is ready
- *
- * fd     -> pointer to the internal devie structure pDev
- * wait -> time to wait for the ready status
- *
- */
-int
-Tape_Ready(
-    int                fd,
-    time_t     wait_time)
-{
-  extern OpenFiles_T *pDev;
-  int done;
-  int ret;
-  time_t cnt = 0;
-
-  RequestSense_T *pRequestSense;
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START Tape_Ready\n"));
-
-  /*
-   * Which device should we use to get the
-   * tape status
-   */
-
-  /*
-   * First the ioctl tapedevice
-   */
-  if (pDev[INDEX_TAPE].avail == 1)
-    {
-      fd = INDEX_TAPE;
-    }
-
-  /*
-   * But if available and can do SCSI
-   * the scsitapedev
-   */
-  if (pDev[INDEX_TAPECTL].avail == 1 && pDev[INDEX_TAPECTL].SCSI == 1)
-    {
-      fd = INDEX_TAPECTL;
-    }
-
-  if (pDev[fd].avail == 1 && pDev[fd].SCSI == 0)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : Can't send SCSI commands, try ioctl\n"));
-      /*
-       * Do we get an non negative result.
-       * If yes this function is available
-       * and we can use it to get the status
-       * of the tape
-       */
-      ret = Tape_Status(fd);
-      if (ret >= 0)
-       {
-         while (cnt < wait_time)
-           {
-             if ( ret & TAPE_ONLINE)
-               {
-                 DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : Ready after %d seconds\n"),cnt);
-                 DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n"));
-                 return(0);
-                 /*NOTREACHED*/
-               }
-             cnt++;
-             sleep(1);
-             ret = Tape_Status(fd);
-           }
-
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : not ready, stop after %d seconds\n"),cnt);
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n"));
-         return(0);
-         /*NOTREACHED*/
-
-       }
-       DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : no ioctl interface, will sleep for %d seconds\n"), wait_time);
-       sleep(wait_time);
-       DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n"));
-       return(0);
-       /*NOTREACHED*/
-    }
-
-  pRequestSense = alloc(SIZEOF(RequestSense_T));
-
-  /*
-   * Ignore errors at this point
-   */
-  GenericRewind(fd);
-
-  /*
-   * Wait until we get an ready condition
-   */
-
-  done = 0;
-  while (!done && (cnt < wait_time))
-    {
-      ret = SCSI_TestUnitReady(fd, pRequestSense );
-      switch (ret)
-       {
-       case SCSI_OK:
-         done = 1;
-         break;
-       case SCSI_SENSE:
-         switch (SenseHandler(fd, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-           {
-           case SENSE_NO:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_NO\n"));
-             done = 1;
-             break;
-           case SENSE_TAPE_NOT_ONLINE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
-             break;
-           case SENSE_IGNORE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_IGNORE\n"));
-             done = 1;
-             break;
-           case SENSE_ABORT:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_ABORT\n"));
-             amfree(pRequestSense);
-             return(-1);
-             /*NOTREACHED*/
-           case SENSE_RETRY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_RETRY\n"));
-             break;
-           default:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) default (SENSE)\n"));
-             done = 1;
-             break;
-           }
-         break;
-       case SCSI_ERROR:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeReady (TestUnitReady) SCSI_ERROR\n"));
-         free(pRequestSense);
-         return(-1);
-         /*NOTREACHED*/
-       case SCSI_BUSY:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SCSI_BUSY\n"));
-         break;
-       case SCSI_CHECK:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SCSI_CHECK\n"));
-         break;
-       default:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeReady (TestUnitReady) unknown (%d)\n"),ret);
-         break;
-       }
-      sleep(1);
-      cnt++;
-    }
-
-  amfree(pRequestSense);
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready after %d sec\n"), cnt);
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n"));
-  return(0);
-}
-
-
-int
-DecodeSCSI(
-    CDB_T      CDB,
-    char *     string)
-{
-  SC_COM_T *pSCSICommand;
-  int x;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI, _("##### START DecodeSCSI\n"));
-  pSCSICommand = (SC_COM_T *)&SCSICommand;
-
-  while (pSCSICommand->name != NULL)
-    {
-      if (CDB[0] == pSCSICommand->command)
-        {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%s %s"), string, pSCSICommand->name);
-          for (x=0; x < pSCSICommand->length; x++)
-            {
-              DebugPrint(DEBUG_INFO, SECTION_SCSI," %02X", CDB[x]);
-            }
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"\n");
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP DecodeSCSI\n"));
-          return(0);
-         /*NOTREACHED*/
-       }
-      pSCSICommand++;
-    }
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Not found %X\n"), CDB[0]);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP DecodeSCSI\n"));
-  return(0);
-}
-
-int
-DecodeModeSense(
-    u_char *   buffer,
-    size_t     offset,
-    char *     pstring,
-    char       block,
-    FILE *     out)
-{
-  ReadWriteErrorRecoveryPage_T *prp;
-  DisconnectReconnectPage_T *pdrp;
-  size_t length = (size_t)buffer[0] - 4 - offset;
-
-  (void)pstring;       /* Quiet unused parameter warning */
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START DecodeModeSense\n"));
-
-  dump_hex(buffer, 255, DEBUG_INFO, SECTION_SCSI);
-
-  /* Jump over the Parameter List header  and an offset if we have something
-   * Unknown at the start (ADIC-218) at the moment
-   *
-   */
-  buffer = buffer + 4 + offset;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("buffer length = %d\n"), length);
-
-  if (block) /* Do we have an block descriptor page ?*/
-    {
-      if (out != NULL)
-        g_fprintf(out, _("DecodeModeSense : Density Code %x\n"), (unsigned)buffer[0]);
-      buffer++;
-
-      if (out != NULL)
-       g_fprintf(out, _("DecodeModeSense : Number of Blocks %d\n"), V3(buffer));
-      buffer = buffer + 4;
-
-      if (out != NULL)
-       g_fprintf(out, _("DecodeModeSense : Block Length %d\n"), V3(buffer));
-      buffer = buffer + 3;
-    }
-
-  while (length > 0)
-    {
-      switch (*buffer & 0x3f)
-        {
-        case 0:
-            pVendorUnique = buffer;
-            buffer++;
-            break;
-        case 0x1:
-          prp = (ReadWriteErrorRecoveryPage_T *)buffer;
-         if (out != NULL)
-          {
-               g_fprintf(out, _("DecodeModeSense : Read/Write Error Recovery Page\n"));
-               g_fprintf(out,_("\tTransfer Block            %d\n"), prp->tb);
-               g_fprintf(out,_("\tEnable Early Recovery     %d\n"), prp->eer);
-               g_fprintf(out,_("\tPost Error                %d\n"), prp->per);
-               g_fprintf(out,_("\tDisable Transfer on Error %d\n"), prp->dte);
-               g_fprintf(out,_("\tDisable ECC Correction    %d\n"), prp->dcr);
-               g_fprintf(out,_("\tRead Retry Count          %d\n"), prp->ReadRetryCount);
-               g_fprintf(out,_("\tWrite Retry Count         %d\n"), prp->WriteRetryCount);
-         }
-          buffer++;
-          break;
-        case 0x2:
-          pdrp = (DisconnectReconnectPage_T *)buffer;
-         if (out != NULL)
-          {
-               g_fprintf(out, _("DecodeModeSense : Disconnect/Reconnect Page\n"));
-               g_fprintf(out,_("\tBuffer Full Ratio     %d\n"), pdrp->BufferFullRatio);
-               g_fprintf(out,_("\tBuffer Empty Ratio    %d\n"), pdrp->BufferEmptyRatio);
-               g_fprintf(out,_("\tBus Inactivity Limit  %d\n"),
-                  V2(pdrp->BusInactivityLimit));
-               g_fprintf(out,_("\tDisconnect Time Limit %d\n"),
-                  V2(pdrp->DisconnectTimeLimit));
-               g_fprintf(out,_("\tConnect Time Limit    %d\n"),
-                  V2(pdrp->ConnectTimeLimit));
-               g_fprintf(out,_("\tMaximum Burst Size    %d\n"),
-                  V2(pdrp->MaximumBurstSize));
-               g_fprintf(out,_("\tDTDC                  %d\n"), pdrp->DTDC);
-         }
-          buffer++;
-          break;
-        case 0x1d:
-          pEAAPage = (EAAPage_T *)buffer;
-         if (out != NULL)
-         {
-               g_fprintf(out,_("DecodeModeSense : Element Address Assignment Page\n"));
-               g_fprintf(out,_("\tMedium Transport Element Address     %d\n"),
-                    V2(pEAAPage->MediumTransportElementAddress));
-               g_fprintf(out,_("\tNumber of Medium Transport Elements  %d\n"),
-                    V2(pEAAPage->NoMediumTransportElements));
-               g_fprintf(out, _("\tFirst Storage Element Address       %d\n"),
-                    V2(pEAAPage->FirstStorageElementAddress));
-               g_fprintf(out, _("\tNumber of  Storage Elements         %d\n"),
-                    V2(pEAAPage->NoStorageElements));
-               g_fprintf(out, _("\tFirst Import/Export Element Address %d\n"),
-                    V2(pEAAPage->FirstImportExportElementAddress));
-               g_fprintf(out, _("\tNumber of  ImportExport Elements    %d\n"),
-                    V2(pEAAPage->NoImportExportElements));
-               g_fprintf(out, _("\tFirst Data Transfer Element Address %d\n"),
-                    V2(pEAAPage->FirstDataTransferElementAddress));
-               g_fprintf(out, _("\tNumber of  Data Transfer Elements   %d\n"),
-                    V2(pEAAPage->NoDataTransferElements));
-         }
-          buffer++;
-          break;
-        case 0x1f:
-          pDeviceCapabilitiesPage = (DeviceCapabilitiesPage_T *)buffer;
-         if (out != NULL)
-         {
-               g_fprintf(out, _("DecodeModeSense : MT can store data cartridges %d\n"),
-                    pDeviceCapabilitiesPage->MT);
-               g_fprintf(out, _("DecodeModeSense : ST can store data cartridges %d\n"),
-                    pDeviceCapabilitiesPage->ST);
-               g_fprintf(out, _("DecodeModeSense : IE can store data cartridges %d\n"),
-                    pDeviceCapabilitiesPage->IE);
-               g_fprintf(out, _("DecodeModeSense : DT can store data cartridges %d\n"),
-                    pDeviceCapabilitiesPage->DT);
-               g_fprintf(out, _("DecodeModeSense : MT to MT %d\n"),
-                    pDeviceCapabilitiesPage->MT2MT);
-               g_fprintf(out, _("DecodeModeSense : MT to ST %d\n"),
-                    pDeviceCapabilitiesPage->MT2ST);
-               g_fprintf(out, _("DecodeModeSense : MT to IE %d\n"),
-                    pDeviceCapabilitiesPage->MT2IE);
-               g_fprintf(out, _("DecodeModeSense : MT to DT %d\n"),
-                    pDeviceCapabilitiesPage->MT2DT);
-               g_fprintf(out, _("DecodeModeSense : ST to MT %d\n"),
-                    pDeviceCapabilitiesPage->ST2ST);
-               g_fprintf(out, _("DecodeModeSense : ST to MT %d\n"),
-                    pDeviceCapabilitiesPage->ST2ST);
-               g_fprintf(out, _("DecodeModeSense : ST to DT %d\n"),
-                    pDeviceCapabilitiesPage->ST2DT);
-               g_fprintf(out, _("DecodeModeSense : IE to MT %d\n"),
-                    pDeviceCapabilitiesPage->IE2MT);
-               g_fprintf(out, _("DecodeModeSense : IE to ST %d\n"),
-                    pDeviceCapabilitiesPage->IE2IE);
-               g_fprintf(out, _("DecodeModeSense : IE to ST %d\n"),
-                    pDeviceCapabilitiesPage->IE2DT);
-               g_fprintf(out, _("DecodeModeSense : IE to ST %d\n"),
-                    pDeviceCapabilitiesPage->IE2DT);
-               g_fprintf(out, _("DecodeModeSense : DT to MT %d\n"),
-                    pDeviceCapabilitiesPage->DT2MT);
-               g_fprintf(out, _("DecodeModeSense : DT to ST %d\n"),
-                    pDeviceCapabilitiesPage->DT2ST);
-               g_fprintf(out, _("DecodeModeSense : DT to IE %d\n"),
-                    pDeviceCapabilitiesPage->DT2IE);
-               g_fprintf(out, _("DecodeModeSense : DT to DT %d\n"),
-                    pDeviceCapabilitiesPage->DT2DT);
-         }
-          buffer++;
-          break;
-        default:
-          buffer++;  /* set pointer to the length information */
-          break;
-        }
-      /* Error if *buffer (length) is 0 */
-      if (*buffer == 0)
-        {
-          /*           EAAPage = NULL; */
-          /*           DeviceCapabilitiesPage = NULL; */
-          return(-1);
-         /*NOTREACHED*/
-        }
-      length = length - (size_t)*buffer - 2;
-      buffer = buffer + (size_t)*buffer + 1;
-    }
-  return(0);
-}
-
-int
-DecodeSense(
-    RequestSense_T *   sense,
-    char *             pstring,
-    FILE *             out)
-{
-  if (out == NULL)
-    {
-      return(0);
-      /*NOTREACHED*/
-    }
-  g_fprintf(out,_("##### START DecodeSense\n"));
-  g_fprintf(out,_("%sSense Keys\n"), pstring);
-  if (sense->ErrorCode == 0x70)
-    {
-    g_fprintf(out,_("\tExtended Sense                     \n"));
-    } else {
-      g_fprintf(out,_("\tErrorCode                     %02x\n"), sense->ErrorCode);
-      g_fprintf(out,_("\tValid                         %d\n"), sense->Valid);
-    }
-  g_fprintf(out,_("\tASC                           %02X\n"), sense->AdditionalSenseCode);
-  g_fprintf(out,_("\tASCQ                          %02X\n"), sense->AdditionalSenseCodeQualifier);
-  g_fprintf(out,_("\tSense key                     %02X\n"), sense->SenseKey);
-  switch (sense->SenseKey)
-    {
-    case 0:
-      g_fprintf(out,_("\t\tNo Sense\n"));
-      break;
-    case 1:
-      g_fprintf(out,_("\t\tRecoverd Error\n"));
-      break;
-    case 2:
-      g_fprintf(out,_("\t\tNot Ready\n"));
-      break;
-    case 3:
-      g_fprintf(out,_("\t\tMedium Error\n"));
-      break;
-    case 4:
-      g_fprintf(out,_("\t\tHardware Error\n"));
-      break;
-    case 5:
-      g_fprintf(out,_("\t\tIllegal Request\n"));
-      break;
-    case 6:
-      g_fprintf(out,_("\t\tUnit Attention\n"));
-      break;
-    case 7:
-      g_fprintf(out,_("\t\tData Protect\n"));
-      break;
-    case 8:
-      g_fprintf(out,_("\t\tBlank Check\n"));
-      break;
-    case 9:
-      g_fprintf(out,_("\t\tVendor uniq\n"));
-      break;
-    case 0xa:
-      g_fprintf(out,_("\t\tCopy Aborted\n"));
-      break;
-    case 0xb:
-      g_fprintf(out,_("\t\tAborted Command\n"));
-      break;
-    case 0xc:
-      g_fprintf(out,_("\t\tEqual\n"));
-      break;
-    case 0xd:
-      g_fprintf(out,_("\t\tVolume Overflow\n"));
-      break;
-    case 0xe:
-      g_fprintf(out,_("\t\tMiscompare\n"));
-      break;
-    case 0xf:
-      g_fprintf(out,_("\t\tReserved\n"));
-      break;
-    }
-  return(0);
-}
-
-int
-DecodeExtSense(
-    ExtendedRequestSense_T *   sense,
-    char *                     pstring,
-    FILE *                     out)
-{
-  ExtendedRequestSense_T *p;
-
-  g_fprintf(out,_("##### START DecodeExtSense\n"));
-  p = sense;
-
-  g_fprintf(out,_("%sExtended Sense\n"), pstring);
-  DecodeSense((RequestSense_T *)p, pstring, out);
-  g_fprintf(out,_("\tLog Parameter Page Code         %02X\n"), sense->LogParameterPageCode);
-  g_fprintf(out,_("\tLog Parameter Code              %02X\n"), sense->LogParameterCode);
-  g_fprintf(out,_("\tUnderrun/Overrun Counter        %02X\n"), sense->UnderrunOverrunCounter);
-  g_fprintf(out,_("\tRead/Write Error Counter        %d\n"), V3((char *)sense->ReadWriteDataErrorCounter));
-  if (sense->AdditionalSenseLength > (u_char)sizeof(RequestSense_T))
-    {
-      if (sense->PF)
-        g_fprintf(out,_("\tPower Fail\n"));
-      if (sense->BPE)
-        g_fprintf(out,_("\tSCSI Bus Parity Error\n"));
-      if (sense->FPE)
-        g_fprintf(out,_("\tFormatted Buffer parity Error\n"));
-      if (sense->ME)
-        g_fprintf(out,_("\tMedia Error\n"));
-      if (sense->ECO)
-        g_fprintf(out,_("\tError Counter Overflow\n"));
-      if (sense->TME)
-        g_fprintf(out,_("\tTapeMotion Error\n"));
-      if (sense->TNP)
-        g_fprintf(out,_("\tTape Not Present\n"));
-      if (sense->LBOT)
-        g_fprintf(out,_("\tLogical Beginning of tape\n"));
-      if (sense->TMD)
-        g_fprintf(out,_("\tTape Mark Detect Error\n"));
-      if (sense->WP)
-        g_fprintf(out,_("\tWrite Protect\n"));
-      if (sense->FMKE)
-        g_fprintf(out,_("\tFilemark Error\n"));
-      if (sense->URE)
-        g_fprintf(out,_("\tUnder Run Error\n"));
-      if (sense->WEI)
-        g_fprintf(out,_("\tWrite Error 1\n"));
-      if (sense->SSE)
-        g_fprintf(out,_("\tServo System Error\n"));
-      if (sense->FE)
-        g_fprintf(out,_("\tFormatter Error\n"));
-      if (sense->UCLN)
-        g_fprintf(out,_("\tCleaning Cartridge is empty\n"));
-      if (sense->RRR)
-        g_fprintf(out,_("\tReverse Retries Required\n"));
-      if (sense->CLND)
-        g_fprintf(out,_("\tTape Drive has been cleaned\n"));
-      if (sense->CLN)
-        g_fprintf(out,_("\tTape Drive needs to be cleaned\n"));
-      if (sense->PEOT)
-        g_fprintf(out,_("\tPhysical End of Tape\n"));
-      if (sense->WSEB)
-        g_fprintf(out,_("\tWrite Splice Error\n"));
-      if (sense->WSEO)
-        g_fprintf(out,_("\tWrite Splice Error\n"));
-      g_fprintf(out,_("\tRemaing 1024 byte tape blocks   %d\n"), V3((char *)sense->RemainingTape));
-      g_fprintf(out,_("\tTracking Retry Counter          %02X\n"), sense->TrackingRetryCounter);
-      g_fprintf(out,_("\tRead/Write Retry Counter        %02X\n"), sense->ReadWriteRetryCounter);
-      g_fprintf(out,_("\tFault Sympton Code              %02X\n"), sense->FaultSymptomCode);
-    }
-  return(0);
-}
-
-int
-PrintInquiry(
-    SCSIInquiry_T *    SCSIInquiry)
-{
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START PrintInquiry\n"));
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "qualifier", SCSIInquiry->qualifier);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "type", SCSIInquiry->type);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "data_format", SCSIInquiry->data_format);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "ansi_version", SCSIInquiry->ansi_version);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "ecma_version", SCSIInquiry->ecma_version);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "iso_version", SCSIInquiry->iso_version);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "type_modifier", SCSIInquiry->type_modifier);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "removable", SCSIInquiry->removable);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.8s\n"), "vendor_info", SCSIInquiry->vendor_info);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.16s\n"), "prod_ident", SCSIInquiry->prod_ident);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.4s\n"), "prod_version", SCSIInquiry->prod_version);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.19s\n"), "vendor_specific", SCSIInquiry->vendor_specific);
-  return(0);
-}
-
-
-int
-DoNothing0(void)
-{
-  dbprintf(_("##### START DoNothing\n"));
-  return(0);
-}
-
-int
-DoNothing1(
-    int                unused1)
-{
-  (void)unused1;       /* Quiet unused parameter warning */
-
-  dbprintf(_("##### START DoNothing\n"));
-  return(0);
-}
-
-int
-DoNothing2(
-    int                unused1,
-    int                unused2)
-{
-  (void)unused1;       /* Quiet unused parameter warning */
-  (void)unused2;       /* Quiet unused parameter warning */
-
-  dbprintf(_("##### START DoNothing\n"));
-  return(0);
-}
-
-int
-DoNothing3(
-    int                unused1,
-    int                unused2,
-    int                unused3)
-{
-  (void)unused1;       /* Quiet unused parameter warning */
-  (void)unused2;       /* Quiet unused parameter warning */
-  (void)unused3;       /* Quiet unused parameter warning */
-
-  dbprintf(_("##### START DoNothing\n"));
-  return(0);
-}
-
-int
-GenericFree(void)
-{
-  dbprintf(_("##### START GenericFree\n"));
-  return(0);
-}
-
-int
-GenericSearch(void)
-{
-  dbprintf(_("##### START GenericSearch\n"));
-  return(0);
-}
-
-int
-TreeFrogBarCode(
-    int DeviceFD)
-{
-  extern OpenFiles_T *pDev;
-
-  ModePageTreeFrogVendorUnique_T *pVendor;
-
-  dbprintf(_("##### START TreeFrogBarCode\n"));
-  if (pModePage == NULL)
-    {
-      pModePage = alloc(0xff);
-    }
-
-  if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x0, 0x3f) == 0)
-    {
-      DecodeModeSense(pModePage, 0, _("TreeFrogBarCode :"), 0, debug_file);
-
-      if (pVendorUnique == NULL)
-      {
-         dbprintf(_("TreeFrogBarCode : no pVendorUnique\n"));
-         return(0);
-        /*NOTREACHED*/
-      }
-      pVendor = ( ModePageTreeFrogVendorUnique_T *)pVendorUnique;
-
-      dbprintf(_("TreeFrogBarCode : EBARCO %d\n"), pVendor->EBARCO);
-      dbprintf(_("TreeFrogCheckSum : CHKSUM  %d\n"), pVendor->CHKSUM);
-
-      dump_hex((u_char *)pDev[INDEX_CHANGER].inquiry, INQUIRY_SIZE, DEBUG_INFO, SECTION_ELEMENT);
-      return(pVendor->EBARCO);
-      /*NOTREACHED*/
-    }
-  return(0);
-}
-
-int
-EXB_BarCode(
-    int                DeviceFD)
-{
-  extern OpenFiles_T *pDev;
-
-  ModePageEXB120VendorUnique_T *pVendor;
-  ModePageEXB120VendorUnique_T *pVendorWork;
-
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START EXB_BarCode\n"));
-  if (pModePage == NULL && LibModeSenseValid == 0)
-    {
-      pModePage = alloc(0xff);
-
-      if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0)
-       {
-         DecodeModeSense(pModePage, 0, _("EXB_BarCode :"), 0, debug_file);
-         LibModeSenseValid = 1;
-       } else {
-         LibModeSenseValid = -1;
-       }
-    }
-
-  if (LibModeSenseValid == 1)
-    {
-      if (pVendorUnique == NULL)
-       {
-         DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : no pVendorUnique\n"));
-         return(0);
-        /*NOTREACHED*/
-      }
-      pVendor = ( ModePageEXB120VendorUnique_T *)pVendorUnique;
-
-      DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : NBL %d\n"), pVendor->NBL);
-      DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : PS  %d\n"), pVendor->PS);
-      if (pVendor->NBL == 1 && pVendor->PS == 1 )
-        {
-          pVendorWork = alloc((size_t)pVendor->ParameterListLength + 2);
-          DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : setting NBL to 1\n"));
-          memcpy(pVendorWork, pVendor, (size_t)pVendor->ParameterListLength + 2);
-          pVendorWork->NBL = 0;
-          pVendorWork->PS = 0;
-          pVendorWork->RSVD0 = 0;
-          if (SCSI_ModeSelect(DeviceFD, (u_char *)pVendorWork, (u_char)(pVendorWork->ParameterListLength + 2), 0, 1, 0) == 0)
-            {
-              DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : SCSI_ModeSelect OK\n"));
-              /* Hack !!!!!!
-               */
-              pVendor->NBL = 0;
-
-              /* And now again !!!
-               */
-              GenericResetStatus(DeviceFD);
-            } else {
-              DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : SCSI_ModeSelect failed\n"));
-            }
-            amfree(pVendorWork);
-        }
-      dump_hex((u_char *)pDev[INDEX_CHANGER].inquiry, INQUIRY_SIZE, DEBUG_INFO, SECTION_BARCODE);
-      DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : vendor_specific[19] %x\n"),
-                pDev[INDEX_CHANGER].inquiry->vendor_specific[19]);
-    }
-  return(1);
-}
-
-int
-NoBarCode(
-    int DeviceFD)
-{
-  (void)DeviceFD;      /* Quiet unused parameter warning */
-
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START NoBarCode\n"));
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP  NoBarCode\n"));
-  return(0);
-}
-
-int
-GenericBarCode(
-    int                DeviceFD)
-{
-  (void)DeviceFD;      /* Quiet unused parameter warning */
-
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START GenericBarCode\n"));
-  if ( changer->havebarcode  >= 1)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP GenericBarCode (havebarcode) => %d\n"),changer->havebarcode);
-      return(1);
-      /*NOTREACHED*/
-    }
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP GenericBarCode => 0\n"));
-  return(0);
-}
-
-int
-SenseHandler(
-    int                        DeviceFD,
-    u_char             flag,
-    u_char             SenseKey,
-    u_char             AdditionalSenseCode,
-    u_char             AdditionalSenseCodeQualifier,
-    RequestSense_T *   buffer)
-{
-  extern OpenFiles_T *pDev;
-  int ret = 0;
-  dbprintf(_("##### START SenseHandler\n"));
-  if (pDev[DeviceFD].inqdone == 1)
-    {
-      dbprintf(_("Ident = [%s], function = [%s]\n"), pDev[DeviceFD].ident,
-               pDev[DeviceFD].functions->ident);
-      ret = pDev[DeviceFD].functions->function_error(DeviceFD, flag, SenseKey, AdditionalSenseCode, AdditionalSenseCodeQualifier, buffer);
-    } else {
-      dbprintf(_("    Ups no sense\n"));
-    }
-  dbprintf(_("#### STOP SenseHandler\n"));
-  return(ret);
-}
-
-/*
- * Try to get information about the tape,
- * Tape loaded ? Online etc
- * Use the mtio ioctl to get the information if no SCSI Path
- * to the tape drive is available.
- *
- * TODO:
- * Pass an parameter to identify which unit to use
- * if there are more than one
- * Implement the SCSI path if available
-*/
-int
-TapeStatus(void)
-{
-  extern OpenFiles_T *pDev;
-  int ret;
-  int done;
-  int cnt;
-  RequestSense_T *pRequestSense;
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START TapeStatus\n"));
-
-  /*
-   * If it is an device which understand SCSI commands the
-   * normal ioctl (MTIOCGET for example) may fail
-   * So try an Inquiry
-   */
-  if (pDev[INDEX_TAPECTL].SCSI == 1)
-    {
-      pRequestSense = alloc(SIZEOF(RequestSense_T));
-      memset(pRequestSense, 0, SIZEOF(RequestSense_T));
-
-      for (done = 0, cnt = 0; !done && (cnt < 60); cnt++)
-       {
-         ret = SCSI_TestUnitReady(INDEX_TAPECTL, pRequestSense);
-         DebugPrint(DEBUG_INFO, SECTION_SCSI, _("TapeStatus TestUnitReady ret %d\n"),ret);
-         switch (ret)
-           {
-           case SCSI_OK:
-           case SCSI_SENSE:
-             switch (SenseHandler(INDEX_TAPECTL, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-               {
-               case SENSE_IGNORE:
-               case SENSE_NO:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_NO\n"));
-                 pDTE[0].status = 'F';
-                 DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### FULL\n"));
-                 done = 1;
-                 break;
-
-               case SENSE_TAPE_NOT_ONLINE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
-                 pDTE[0].status = 'E';
-                 DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### EMPTY\n"));
-                 done = 1;
-                 break;
-
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_ABORT\n"));
-                 done = 1;
-                 break;
-
-               case SENSE_RETRY:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_RETRY\n"));
-                 break;
-
-               default:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) default (SENSE)\n"));
-                 break;
-               }
-             break;
-
-           case SCSI_ERROR:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeStatus (TestUnitReady) SCSI_ERROR\n"));
-             done = 1;
-             break;
-
-           case SCSI_BUSY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SCSI_BUSY\n"));
-             break;
-
-           case SCSI_CHECK:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SCSI_CHECK\n"));
-             break;
-
-           default:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeStatus (TestUnitReady) unknown (%d)\n"),ret);
-             break;
-
-           }
-         if (!done)
-           sleep(2);
-       }
-        amfree(pRequestSense);
-    } else {
-      ret = Tape_Status(INDEX_TAPE);
-      if ( ret & TAPE_ONLINE)
-       {
-         pDTE[0].status ='F';
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### FULL\n"));
-       } else {
-         pDTE[0].status = 'E';
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### EMPTY\n"));
-       }
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP TapeStatus\n"));
-    }
-    return(0);
-}
-
-int
-DLT4000Eject(
-    char *     Device,
-    int                type)
-{
-  extern OpenFiles_T *pDev;
-
-  RequestSense_T *pRequestSense;
-  ExtendedRequestSense_T *pExtendedRequestSense;
-  int ret;
-  int cnt = 0;
-  int done;
-
-  (void)Device;        /* Quiet unused parameter warning */
-
-  dbprintf(_("##### START DLT4000Eject\n"));
-
-  pRequestSense = alloc(SIZEOF(RequestSense_T));
-  pExtendedRequestSense = alloc(SIZEOF(ExtendedRequestSense_T));
-
-  if ( type > 1)
-    {
-      dbprintf(_("DLT4000Eject : use mtio ioctl for eject on %s\n"), pDev[INDEX_TAPE].dev);
-      free(pExtendedRequestSense);
-      free(pRequestSense);
-      return(Tape_Ioctl(INDEX_TAPE, IOCTL_EJECT));
-      /*NOTREACHED*/
-    }
-
-
-
-  if (pDev[INDEX_TAPECTL].SCSI == 0)
-    {
-      dbprintf(_("DLT4000Eject : Device %s not able to receive SCSI commands\n"), pDev[INDEX_TAPE].dev);
-      free(pExtendedRequestSense);
-      free(pRequestSense);
-      return(Tape_Ioctl(INDEX_TAPE, IOCTL_EJECT));
-      /*NOTREACHED*/
-    }
-
-
-  dbprintf(_("DLT4000Eject : SCSI eject on %s = %s\n"), pDev[INDEX_TAPECTL].dev, pDev[INDEX_TAPECTL].ConfigName);
-
-  RequestSense(INDEX_TAPECTL, pExtendedRequestSense, 0);
-  DecodeExtSense(pExtendedRequestSense, _("DLT4000Eject : "), debug_file);
-  /* Unload the tape, 0 ==  wait for success
-   * 0 == unload
-   */
-  ret = SCSI_LoadUnload(INDEX_TAPECTL, pRequestSense, 0, 0);
-
-  RequestSense(INDEX_TAPECTL, pExtendedRequestSense, 0);
-  DecodeExtSense(pExtendedRequestSense, _("DLT4000Eject : "), debug_file);
-
-  /* < 0 == fatal */
-  if (ret >= 0) {
-      free(pExtendedRequestSense);
-      free(pRequestSense);
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  done = 0;
-  while (!done && cnt < 300)
-    {
-      ret = SCSI_TestUnitReady(INDEX_TAPECTL, pRequestSense);
-      DebugPrint(DEBUG_INFO, SECTION_SCSI, _("DLT4000Eject TestUnitReady ret %d\n"),ret);
-      switch (ret)
-       {
-       case SCSI_OK:
-         done = 1;
-         break;
-       case SCSI_SENSE:
-         switch (SenseHandler(INDEX_TAPECTL, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-           {
-           case SENSE_NO:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_NO\n"));
-             done = 1;
-             break;
-           case SENSE_TAPE_NOT_ONLINE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
-             done = 1;
-             break;
-           case SENSE_IGNORE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_IGNORE\n"));
-             done = 1;
-             break;
-           case SENSE_ABORT:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_ABORT\n"));
-             free(pExtendedRequestSense);
-             free(pRequestSense);
-             return(-1);
-             /*NOTREACHED*/
-           case SENSE_RETRY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_RETRY\n"));
-             break;
-           default:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) default (SENSE)\n"));
-             done = 1;
-             break;
-           }
-         break;
-       case SCSI_ERROR:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SCSI_ERROR\n"));
-         free(pExtendedRequestSense);
-         free(pRequestSense);
-         return(-1);
-         /*NOTREACHED*/
-       case SCSI_BUSY:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SCSI_BUSY\n"));
-         break;
-       case SCSI_CHECK:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SCSI_CHECK\n"));
-         break;
-       default:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) unknown (%d)\n"),ret);
-         break;
-       }
-
-      cnt++;
-      sleep(2);
-    }
-
-  dbprintf(_("DLT4000Eject : Ready after %d sec, done = %d\n"), cnt * 2, done);
-
-  free(pExtendedRequestSense);
-  free(pRequestSense);
-
-  return(0);
-}
-
-/*
- * Ejects an tape either with the ioctl interface
- * or by using the SCSI interface if available.
- *
- * TODO:
- * Before unload check if there is an tape in the drive
- *
- */
-int
-GenericEject(
-    char *     Device,
-    int                type)
-{
-  extern OpenFiles_T *pDev;
-  RequestSense_T *pRequestSense;
-  int ret;
-  int cnt = 0;
-  int done;
-
-  (void)Device;        /* Quiet unused parameter warning */
-  (void)type;  /* Quiet unused parameter warning */
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE, _("##### START GenericEject\n"));
-
-  pRequestSense = alloc(SIZEOF(RequestSense_T));
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericEject : SCSI eject on %s = %s\n"),
-             pDev[INDEX_TAPECTL].dev, pDev[INDEX_TAPECTL].ConfigName);
-
-  /*
-   * Can we use SCSI commands ?
-   */
-  if (pDev[INDEX_TAPECTL].SCSI == 1)
-    {
-      LogSense(INDEX_TAPECTL);
-      /*
-       * Unload the tape, 1 == don't wait for success
-       * 0 == unload
-       */
-      ret = SCSI_LoadUnload(INDEX_TAPECTL, pRequestSense, 1, 0);
-
-      /* < 0 == fatal */
-      if (ret < 0) {
-        DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject SCSI_LoadUnload failed\n");
-       free(pRequestSense);
-       return(-1);
-       /*NOTREACHED*/
-      }
-
-      done = 0;
-      while (!done && cnt < 300)
-       {
-         ret = SCSI_TestUnitReady(INDEX_TAPECTL, pRequestSense);
-         DebugPrint(DEBUG_INFO, SECTION_SCSI, _("GenericEject TestUnitReady ret %d\n"),ret);
-         switch (ret)
-           {
-           case SCSI_OK:
-           case SCSI_SENSE:
-             switch (SenseHandler(INDEX_TAPECTL, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-               {
-               case SENSE_NO:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_NO\n"));
-                 break;
-               case SENSE_TAPE_NOT_ONLINE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
-                 done = 1;
-                 break;
-               case SENSE_IGNORE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_IGNORE\n"));
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_ABORT\n"));
-                 free(pRequestSense);
-                 return(-1);
-                 /*NOTREACHED*/
-               case SENSE_RETRY:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_RETRY\n"));
-                 break;
-               default:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) default (SENSE)\n"));
-                 break;
-               }
-             break;
-           case SCSI_ERROR:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericEject (TestUnitReady) SCSI_ERROR\n"));
-             free(pRequestSense);
-             return(-1);
-             /*NOTREACHED*/
-           case SCSI_BUSY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SCSI_BUSY\n"));
-             break;
-           case SCSI_CHECK:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SCSI_CHECK\n"));
-             break;
-           default:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericEject (TestUnitReady) unknown (%d)\n"),ret);
-             break;
-           }
-         cnt++;
-         sleep(2);
-       }
-    } else {
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericEject : Device can't understand SCSI try ioctl\n"));
-      Tape_Ioctl(INDEX_TAPECTL, IOCTL_EJECT);
-    }
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,
-            _("GenericEject : Ready after %d sec\n"), cnt * 2);
-  free(pRequestSense);
-  return(0);
-}
-
-/*
- * Rewind the tape
- *
- * TODO:
- * Make the retry counter an config option,
- *
- * Return:
- * -1 -> error
- * 0  -> success
- */
-int
-GenericRewind(
-    int                DeviceFD)
-{
-  CDB_T CDB;
-  extern OpenFiles_T *pDev;
-  RequestSense_T *pRequestSense;
-  int ret;
-  int cnt = 0;
-  int done;
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START GenericRewind pDEV -> %d\n"),DeviceFD);
-
-
-  /*
-   * If we can use the SCSI device than use it, else use the ioctl
-   * function
-   */
-  if (pDev[DeviceFD].SCSI == 1)
-    {
-      pRequestSense = alloc(SIZEOF(RequestSense_T));
-
-      /*
-       * Before doing the rewind check if the tape is ready to accept commands
-       */
-
-      done = 0;
-      while (!done)
-       {
-         ret = SCSI_TestUnitReady(DeviceFD, (RequestSense_T *)pRequestSense );
-         DebugPrint(DEBUG_INFO, SECTION_TAPE, _("GenericRewind (TestUnitReady) ret %d\n"),ret);
-         switch (ret)
-           {
-           case SCSI_OK:
-             done = 1;
-             break;
-                   case SCSI_SENSE:
-             switch (SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-               {
-               case SENSE_NO:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_NO\n"));
-                 done = 1;
-                 break;
-               case SENSE_TAPE_NOT_ONLINE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
-                 free(pRequestSense);
-                 return(-1);
-                 /*NOTREACHED*/
-               case SENSE_IGNORE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_IGNORE\n"));
-                 done = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_ABORT\n"));
-                 free(pRequestSense);
-                 return(-1);
-                 /*NOTREACHED*/
-               case SENSE_RETRY:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_RETRY\n"));
-                 break;
-               default:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) default (SENSE)\n"));
-                 done = 1;
-                 break;
-               }  /* switch (SenseHandler(DeviceFD, 0, pRequestSense->SenseKey.... */
-             break;
-
-           case SCSI_ERROR:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_ERROR\n"));
-             free(pRequestSense);
-             return(-1);
-             /*NOTREACHED*/
-
-           case SCSI_BUSY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_BUSY\n"));
-             break;
-           case SCSI_CHECK:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_CHECK\n"));
-             break;
-           default:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) unknown (%d)\n"),ret);
-             break;
-           }
-
-         sleep(1);
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,_(" Wait .... (%d)\n"),cnt);
-         if (cnt > 180)
-           {
-             DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP GenericRewind (-1)\n"));
-             free(pRequestSense);
-             return(-1);
-             /*NOTREACHED*/
-           }
-       } /* while !done */
-
-      cnt = 0;
-
-      CDB[0] = SC_COM_REWIND;
-      CDB[1] = 1;
-      CDB[2] = 0;
-      CDB[3] = 0;
-      CDB[4] = 0;
-      CDB[5] = 0;
-
-      done = 0;
-      while (!done)
-       {
-         ret = SCSI_Run(DeviceFD, Input, CDB, 6,
-                        NULL, 0,
-                        pRequestSense,
-                        SIZEOF(RequestSense_T));
-
-         DecodeSense(pRequestSense, _("GenericRewind : "), debug_file);
-
-         if (ret > 0)
-           {
-             if (pRequestSense->SenseKey != UNIT_ATTENTION)
-               {
-                 done = 1;
-               }
-           }
-         if (ret == 0)
-           {
-             done = 1;
-           }
-         if (ret < 0)
-           {
-             DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericRewind : failed %d\n"), ret);
-             done = 1;
-           }
-       }
-
-      done = 0;
-      while (!done && (cnt < 300))
-       {
-         ret = SCSI_TestUnitReady(DeviceFD, pRequestSense);
-         DebugPrint(DEBUG_INFO, SECTION_SCSI, _("GenericRewind TestUnitReady ret %d\n"),ret);
-         switch (ret)
-           {
-           case SCSI_OK:
-             done = 1;
-             break;
-           case SCSI_SENSE:
-             switch (SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-               {
-               case SENSE_NO:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_NO\n"));
-                 done = 1;
-                 break;
-               case SENSE_TAPE_NOT_ONLINE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
-                 free(pRequestSense);
-                 return(-1);
-                 /*NOTREACHED*/
-               case SENSE_IGNORE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_IGNORE\n"));
-                 done = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_ABORT\n"));
-                 free(pRequestSense);
-                 return(-1);
-                 /*NOTREACHED*/
-               case SENSE_RETRY:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_RETRY\n"));
-                 break;
-               default:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) default (SENSE)\n"));
-                 done = 1;
-                 break;
-               }
-             break;
-           case SCSI_ERROR:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_ERROR\n"));
-             return(-1);
-             /*NOTREACHED*/
-
-           case SCSI_BUSY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_BUSY\n"));
-             break;
-           case SCSI_CHECK:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_CHECK\n"));
-             break;
-           default:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) unknown (%d)\n"),ret);
-             break;
-           }
-
-         cnt++;
-         sleep(2);
-       }
-
-      amfree(pRequestSense);
-
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericRewind : Ready after %d sec, "
-                       "done = %d\n"), cnt * 2, done);
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericRewind (0)\n"));
-    } else {
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericRewind : use ioctl rewind\n"));
-      if (pDev[DeviceFD].devopen == 1)
-       {
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Close Device\n"));
-         SCSI_CloseDevice(DeviceFD);
-       }
-      /* no actual rewind operation here -- the device itself will handle that */
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericRewind (0)\n"));
-    }
-
-  return(0);
-}
-
-
-/*
- * Check if the tape has the tape clean
- * bit set in the return of an request sense
- *
- */
-int
-GenericClean(
-    char *     Device)
-{
-  extern OpenFiles_T *pDev;
-  ExtendedRequestSense_T ExtRequestSense;
-  int ret = 0;
-
-  (void)Device;        /* Quiet unused parameter warning */
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START GenericClean\n"));
-  if (pDev[INDEX_TAPECTL].SCSI == 0)
-      {
-          DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("GenericClean : can't send SCSI commands\n"));
-         DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP GenericClean\n"));
-          return(0);
-         /*NOTREACHED*/
-      }
-
-  /*
-   * Request Sense Data, reset the counter
-   */
-  if ( RequestSense(INDEX_TAPECTL, &ExtRequestSense, 1) == 0)
-    {
-
-      DecodeExtSense(&ExtRequestSense, _("GenericClean : "), debug_file);
-      if(ExtRequestSense.CLN) {
-       ret = 1;
-      } else {
-       ret = 0;
-      }
-    } else {
-      DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Got error from RequestSense\n"));
-    }
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericClean (%d)\n"),ret);
-  return(ret);
-}
-
-int
-SCSI_LogSenseClean(
-    char *     Device)
-{ 
-  extern OpenFiles_T *pDev;
-  CDB_T CDB;
-  RequestSense_T *pRequestSense;
-  int ret = 0;
-  u_char *buffer;
-  size_t size = 128;
-      
-  (void)Device;        /* Quiet unused parameter warning */
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START SCSI_LogSenseClean\n");
-  if (pDev[INDEX_TAPECTL].SCSI == 0)
-      {
-          DebugPrint(DEBUG_ERROR, SECTION_TAPE,"SCSILogSenseClean : can't send SCSI commands\n");
-         DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP SCSI_LogSenseClean\n");
-          return(0);
-         /*NOTREACHED*/
-      }
-
-   if (NULL ==  (buffer = alloc(size))){
-          DebugPrint(DEBUG_ERROR, SECTION_TAPE,"SCSI_LogSenseClean : can't alloc buffer\n");
-         DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP SCSI_LogSenseClean\n");
-          return(0);
-   }
-   if (NULL == (pRequestSense = alloc(SIZEOF(RequestSense_T)))){
-          DebugPrint(DEBUG_ERROR, SECTION_TAPE,"SCSI_LogSenseClean : can't alloc memory\n");
-         DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP SCSI_LogSenseClean\n");
-          return(0);
-   }
-   
-   memset(buffer, 0, size);
-   CDB[0] = SC_COM_LOG_SENSE;
-   CDB[1] = 0;
-   CDB[2] = (u_char)(0x40 | 0x33);/* 0x40 for current values 0x33 Head Cleaning Page*/
-   CDB[3] = 0;
-   CDB[4] = 0;
-   CDB[5] = 0;
-   CDB[6] = 00;
-   MSB2(&CDB[7], size);
-   CDB[9] = 0;
-
-   if (SCSI_Run(INDEX_TAPECTL, Input, CDB, 10,
-                           buffer,
-                           size,
-                           pRequestSense,
-                           SIZEOF(RequestSense_T)) != 0)
-     {
-       DecodeSense(pRequestSense, "SCSI_LogSenseClean : ",debug_file);
-       free(pRequestSense);
-       free(buffer);
-       DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP SCSI_LogSenseClean (0) Page could not be read.\n");
-       return(0);
-       /*NOTREACHED*/
-     }
-  if (1==(0x1 & buffer[8])){ /* Bit 0 of the 4th byte in the Clean Head Log Parameter, which are the bytes */
-                           /* 4 to 8 on the Log Sense Page 0x33                                          */
-    ret = 1;
-  }else {
-    ret = 0; 
-  }  
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP SCSI_LogSenseClean (%d)\n",ret);
-  free(pRequestSense);
-  free(buffer);
-  return(ret);
-}
-
-int
-GenericResetStatus(
-    int                DeviceFD)
-{
-  CDB_T CDB;
-  RequestSense_T *pRequestSense;
-  int ret = 0;
-  int retry = 1;
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START GenericResetStatus\n"));
-
-  pRequestSense = alloc(SIZEOF(RequestSense_T));
-
-  while (retry)
-    {
-      CDB[0] = SC_COM_IES;   /* */
-      CDB[1] = 0;
-      CDB[2] = 0;
-      CDB[3] = 0;
-      CDB[4] = 0;
-      CDB[5] = 0;
-
-
-      ret = SCSI_Run(DeviceFD, Input, CDB, 6,
-                                NULL, 0,
-                                pRequestSense,
-                                SIZEOF(RequestSense_T));
-
-      if (ret < 0)
-        {
-          /*        g_fprintf(stderr, _("%s: Request Sense[Inquiry]: %02X"), */
-          /*                "chs", ((u_char *) &pRequestSense)[0]); */
-          /*        for (i = 1; i < SIZEOF(RequestSense_T); i++)                */
-          /*          g_fprintf(stderr, " %02X", ((u_char *) &pRequestSense)[i]); */
-          /*        g_fprintf(stderr, "\n");    */
-         free(pRequestSense);
-          return(ret);
-         /*NOTREACHED*/
-        }
-      if ( ret > 0 )
-        {
-          switch (SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-            {
-            case SENSE_IGNORE:
-             free(pRequestSense);
-              return(0);
-              /*NOTREACHED*/
-            case SENSE_ABORT:
-             free(pRequestSense);
-              return(-1);
-              /*NOTREACHED*/
-            case SENSE_RETRY:
-              retry++;
-              if (retry < MAX_RETRIES )
-                {
-                  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("GenericResetStatus : retry %d\n"), retry);
-                  sleep(2);
-                } else {
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericResetStatus : return (-1)\n"));
-                 free(pRequestSense);
-                  return(-1);
-                 /*NOTREACHED*/
-                }
-              break;
-            default:
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericResetStatus :  (default) return (-1)\n"));
-             free(pRequestSense);
-              return(-1);
-              /*NOTREACHED*/
-            }
-        }
-      if (ret == 0)
-        retry = 0;
-    }
-  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("##### STOP GenericResetStatus (%d)\n"),ret);
-  free(pRequestSense);
-  return(ret);
-}
-
-/* GenericSenseHandler
- * Handles the conditions/sense wich is returned by an SCSI command
- * pwork is an pointer to the structure OpenFiles_T, which is filled with information
- * about the device to which we talk. Information are for example
- * The vendor, the ident, which fd, etc. This strucure is filled when we open the
- * device
- * flag tells how to handle the information passed in the buffer,
- * 0 -> Sense Key available
- * 1 -> No Sense key available
- * buffer is a pointer to the data from the request sense result.
- *
- * TODO:
- * Limit recursion, may run in an infinite loop
- */
-int
-GenericSenseHandler(
-    int                        ip,
-    u_char             flag,
-    u_char             SenseKey,
-    u_char             AdditionalSenseCode,
-    u_char             AdditionalSenseCodeQualifier,
-    RequestSense_T *   pRequestSense)
-{
-  extern OpenFiles_T *pDev;
-  int ret;
-  char *info = NULL;
-
-  dbprintf(_("##### START GenericSenseHandler\n"));
-
-  DecodeSense(pRequestSense, _("GenericSenseHandler : "), debug_file);
-
-  ret = Sense2Action(pDev[ip].ident,
-                    pDev[ip].inquiry->type,
-                    flag, SenseKey,
-                    AdditionalSenseCode,
-                    AdditionalSenseCodeQualifier,
-                    &info);
-
-  dbprintf(_("##### STOP GenericSenseHandler: %s\n"), _(info));
-  return(ret);
-}
-
-/*
- * Do the move. We don't address the MTE element (the gripper)
- * here. We assume that the library use the right MTE.
- * The difference to GenericMove is that we do an align element
- * before the move.
- *
- * Return:
- *         == 0 -> success
- *         != 0 -> error either from the SCSI command or from
- *                 the element handling
- * TODO:
-*/
-int
-SDXMove(
-    int                DeviceFD,
-    int                from,
-    int                to)
-{
-  extern OpenFiles_T *pDev;
-  ElementInfo_T *pfrom;
-  ElementInfo_T *pto;
-  int ret;
-  int tapestat;
-  int moveok;
-  int SDX_MTE = 0;      /* This are parameters  passed */
-  int SDX_STE = -1;     /* to                          */
-  int SDX_DTE = -1;     /* AlignElements               */
-
-  DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### START SDXMove\n"));
-
-  DebugPrint(DEBUG_INFO, SECTION_MOVE,_("%-20s : from = %d, to = %d\n"), "SDXMove", from, to);
-
-
-  if ((pfrom = LookupElement(from)) == NULL)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : ElementInfo for %d not found\n"), from);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  if ((pto = LookupElement(to)) == NULL)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : ElementInfo for %d not found\n"), to);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  if (pfrom->status == 'E')
-    {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : from %d is empty\n"), from);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  if (pto->status == 'F')
-    {
-      switch (pto->status)
-      {
-         case CHANGER:
-           break;
-         case STORAGE:
-           DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : Destination Element %d Type %d is full\n"),
-                pto->address, pto->type);
-            to = find_empty(DeviceFD, 0, 0);
-           if (to == -1 )
-           {
-                   DebugPrint(DEBUG_ERROR, SECTION_MOVE,_("SDXMove : no empty slot found for unload\n"));
-                   return(-1);
-                   /*NOTREACHED*/
-           }
-            DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : Unload to %d\n"), to);
-            if ((pto = LookupElement(to)) == NULL)
-            {
-             DebugPrint(DEBUG_INFO, SECTION_MOVE, _("SDXMove : ElementInfo for %d not found\n"), to);
-             DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
-             return(-1);
-             /*NOTREACHED*/
-            }
-           break;
-         case IMPORT:
-           break;
-         case TAPETYPE:
-           break;
-      }
-    }
-
-  moveok = CheckMove(pfrom, pto);
-
-  switch (pto->type)
-  {
-    case TAPETYPE:
-      SDX_DTE = pto->address;
-      break;
-    case STORAGE:
-     SDX_STE = pto->address;
-     break;
-    case IMPORT:
-     SDX_STE = pto->address;
-     break;
-  }
-
-  switch (pfrom->type)
-  {
-    case TAPETYPE:
-      SDX_DTE = pfrom->address;
-      break;
-    case STORAGE:
-     SDX_STE = pfrom->address;
-     break;
-    case IMPORT:
-     SDX_STE = pfrom->address;
-     break;
-  }
-
-  if (SDX_DTE >= 0 && SDX_STE >= 0)
-  {
-    ret = SCSI_AlignElements(DeviceFD, SDX_MTE, SDX_DTE, SDX_STE);
-    DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### SCSI_AlignElemnts ret = %d\n"),ret);
-    if (ret != 0 )
-    {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-  } else {
-    DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### Error setting STE/DTE %d/%d\n"), SDX_STE, SDX_DTE);
-    DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
-    return(-1);
-    /*NOTREACHED*/
-  }
-
-  /*
-   * If from is a tape we must check if it is loaded
-   * and if yes we have to eject it
-  */
-  if (pfrom->type == TAPETYPE)
-  {
-    tapestat = Tape_Status(INDEX_TAPE);
-    if ( tapestat & TAPE_ONLINE)
-    {
-      if (pDev[INDEX_TAPECTL].SCSI == 1)
-      {
-        ret = eject_tape(pDev[INDEX_TAPECTL].dev,1);
-      } else {
-        ret = eject_tape(pDev[INDEX_TAPE].dev,2);
-      }
-    }
-  }
-
-  if ((ret == 0) && moveok)
-  {
-    ret = SCSI_Move(DeviceFD, 0, from, to);
-  } else {
-    DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
-    return(ret);
-    /*NOTREACHED*/
-  }
-  DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
-  return(ret);
-}
-
-/*
- * Do the move. We don't address the MTE element (the gripper)
- * here. We assume that the library use the right MTE
- *
- * Return:
- *         == 0 -> success
- *         != 0 -> error either from the SCSI command or from
- *                 the element handling
- * TODO:
-*/
-int
-GenericMove(
-    int                DeviceFD,
-    int                from,
-    int                to)
-{
-  ElementInfo_T *pfrom;
-  ElementInfo_T *pto;
-  int ret = 0;
-
-  DebugPrint(DEBUG_INFO, SECTION_MOVE, _("##### START GenericMove\n"));
-
-  DebugPrint(DEBUG_INFO, SECTION_MOVE, _("%-20s : from = %d, to = %d\n"), "GenericMove", from, to);
-
-
-  if ((pfrom = LookupElement(from)) == NULL)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : ElementInfo for %d not found\n"), from);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  if ((pto = LookupElement(to)) == NULL)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : ElementInfo for %d not found\n"), to);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  if (pfrom->status == 'E')
-    {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : from %d is empty\n"), from);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  if (pto->status == 'F')
-    {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : Destination Element %d Type %d is full\n"),
-                pto->address, pto->type);
-      to = find_empty(DeviceFD, 0, 0);
-      if ( to == -1)
-      {
-             DebugPrint(DEBUG_ERROR, SECTION_MOVE, _("GenericMove : no empty slot found\n"));
-             return(-1);
-             /*NOTREACHED*/
-      }
-      DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : Unload to %d\n"), to);
-      if ((pto = LookupElement(to)) == NULL)
-        {
-          DebugPrint(DEBUG_ERROR, SECTION_MOVE, _(" Ups should not happen\n"));
-         DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n"));
-         return(-1);
-         /*NOTREACHED*/
-        }
-    }
-
-  if (CheckMove(pfrom, pto))
-    {
-      ret = SCSI_Move(DeviceFD, 0, from, to);
-    }
-
-  DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : SCSI_Move return (%d)\n"), ret);
-  DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n"));
-  return(ret);
-}
-
-/*
- * Check if a move based on the information we got from the Mode Sense command
- * is legal
- * Return Values:
- * 1 => OK
- * 0 => Not OK
- */
-
-int
-CheckMove(
-    ElementInfo_T *    from,
-    ElementInfo_T *    to)
-{
-       int moveok = 0;
-
-       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("##### START CheckMove\n"));
-       if (pDeviceCapabilitiesPage != NULL )
-         {
-           DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : checking if move from %d to %d is legal\n"), from->address, to->address);
-           switch (from->type)
-             {
-             case CHANGER:
-               DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : MT2"));
-               switch (to->type)
-                 {
-                 case CHANGER:
-                   if (pDeviceCapabilitiesPage->MT2MT == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case STORAGE:
-                   if (pDeviceCapabilitiesPage->MT2ST == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case IMPORT:
-                   if (pDeviceCapabilitiesPage->MT2IE == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case TAPETYPE:
-                   if (pDeviceCapabilitiesPage->MT2DT == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 default:
-                   break;
-                 }
-               break;
-             case STORAGE:
-               DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : ST2"));
-               switch (to->type)
-                 {
-                 case CHANGER:
-                   if (pDeviceCapabilitiesPage->ST2MT == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case STORAGE:
-                   if (pDeviceCapabilitiesPage->ST2ST == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case IMPORT:
-                   if (pDeviceCapabilitiesPage->ST2IE == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case TAPETYPE:
-                   if (pDeviceCapabilitiesPage->ST2DT == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 default:
-                   break;
-                 }
-               break;
-             case IMPORT:
-               DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : IE2"));
-               switch (to->type)
-                 {
-                 case CHANGER:
-                   if (pDeviceCapabilitiesPage->IE2MT == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case STORAGE:
-                   if (pDeviceCapabilitiesPage->IE2ST == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case IMPORT:
-                   if (pDeviceCapabilitiesPage->IE2IE == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case TAPETYPE:
-                   if (pDeviceCapabilitiesPage->IE2DT == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 default:
-                   break;
-                 }
-               break;
-             case TAPETYPE:
-               DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : DT2"));
-               switch (to->type)
-                 {
-                 case CHANGER:
-                   if (pDeviceCapabilitiesPage->DT2MT == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case STORAGE:
-                   if (pDeviceCapabilitiesPage->DT2ST == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case IMPORT:
-                   if (pDeviceCapabilitiesPage->DT2IE == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 case TAPETYPE:
-                   if (pDeviceCapabilitiesPage->DT2DT == 1)
-                     {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n"));
-                       moveok = 1;
-                     }
-                   break;
-                 default:
-                   break;
-                 }
-               break;
-             default:
-               break;
-             }
-         } else {
-           DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : pDeviceCapabilitiesPage == NULL"));
-           /*
-             ChgExit("CheckMove", _("DeviceCapabilitiesPage == NULL"), FATAL);
-           */
-           moveok=1;
-         }
-
-       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("###### STOP CheckMove\n"));
-       return(moveok);
-}
-
-/*
- */
-
-int
-GetCurrentSlot(
-    int                fd,
-    int                drive)
-{
-  extern OpenFiles_T *pDev;
-  size_t x;
-  dbprintf(_("##### START GetCurrentSlot\n"));
-
-  (void)fd;    /* Quiet unused parameter warning */
-
-  if (pDev[0].SCSI == 0)
-      {
-          dbprintf(_("GetCurrentSlot : can't send SCSI commands\n"));
-          return(-1);
-         /*NOTREACHED*/
-      }
-
-  if (ElementStatusValid == 0)
-    {
-      if (pDev[0].functions->function_status(0, 1) != 0)
-        {
-          return(-1);
-         /*NOTREACHED*/
-        }
-    }
-
-  /* If the from address is the as the same as the tape address skip it */
-  if (pDTE[drive].from >= 0 && pDTE[drive].from != pDTE[drive].address)
-    {
-      for (x = 0; x < STE;x++)
-        {
-          if (pSTE[x].address == pDTE[drive].from)
-            return(x);
-           /*NOTREACHED*/
-        }
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  for (x = 0; x < STE;x++)
-    {
-      if (pSTE[x].status == 'E') {
-          return(x);
-         /*NOTREACHED*/
-        }
-    }
-
-  /* Ups nothing loaded */
-  return(-1);
-}
-
-
-
-/*
- * Reworked function to get the ElementStatus
- * This function will first call the GetElementStatus
- * function to get the Element status,
- * and than check if there are abnormal conditions.
- *
- * If there are error conditions try to fix them
- *
- */
-int
-GenericElementStatus(
-    int                DeviceFD,
-    int                InitStatus)
-{
-  int MTEError = 0;
-  int STEError = 0;
-  int IEEError = 0;
-  int DTEError = 0;
-
-  extern OpenFiles_T *pDev;
-
-  int error = 0;    /* If set do an INIT ELEMENT STATUS */
-  size_t x;         /* The standard loop counter :-) */
-  int retry = 2;    /* Redo it if an error has been reset */
-
-  (void)InitStatus;    /* Quiet unused parameter warning */
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START GenericElementStatus\n"));
-
-  if (pEAAPage == NULL)
-    {
-      /*
-       * If this pointer is null
-       * then try to read the parameter with MODE SENSE
-       *
-       */
-      if (pModePage == NULL && LibModeSenseValid == 0)
-        {
-          pModePage = alloc(0xff);
-
-         if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0)
-           {
-             LibModeSenseValid = 1;
-             DecodeModeSense(pModePage, 0, _("GenericElementStatus :"), 0, debug_file);
-           } else {
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("GetElementStatus : failed SCSI_ModeSense\n"));
-             LibModeSenseValid = -1;
-           }
-        }
-    }
-
-  while ((GetElementStatus(DeviceFD) == 0) && (retry-- > 0))
-    {
-      for (x = 0; x < MTE; x++)
-       {
-         if (pMTE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pMTE[x].ASC, pMTE[x].ASCQ, (RequestSense_T *)&pMTE[x]))
-               {
-               case SENSE_IES:
-                 MTEError = 1;
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on MTE\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-      for (x = 0; x < IEE; x++)
-       {
-         if (pIEE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pIEE[x].ASC, pIEE[x].ASCQ, (RequestSense_T *)&pIEE[x]))
-               {
-               case SENSE_IES:
-                 IEEError = 1;
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on IEE\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-
-      for (x = 0; x < STE; x++)
-       {
-         if (pSTE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pSTE[x].ASC, pSTE[x].ASCQ, (RequestSense_T *)&pSTE[x]))
-               {
-               case SENSE_IES:
-                 STEError = 1;
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on IES\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-      for (x = 0; x < DTE; x++)
-       {
-         if (pDTE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pDTE[x].ASC, pDTE[x].ASCQ, (RequestSense_T *)&pDTE[x]))
-               {
-               case SENSE_IES:
-                 DTEError = 1;
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on DTE\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-      /*
-       * OK, we have an error, do an INIT ELMENT
-       * For the tape if not handled by the robot we have
-       * to do some extra checks
-       */
-      if (error == 1)
-       {
-         if (GenericResetStatus(DeviceFD) != 0)
-           {
-             ElementStatusValid = 0;
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Can't init status STEError(%d) MTEError(%d) DTEError(%d) IEEError(%d)\n"), STEError, MTEError, DTEError, IEEError);
-             return(-1);
-             /*NOTREACHED*/
-           }
-         error = 0;
-       }
-
-      if (DTEError == 1)
-       {
-         TapeStatus();
-         /*
-          * If the status is empty to an move from tape to tape
-          * This is if the tape is ejected, but not unloaded
-          */
-         if (pDTE[0].status == 'E')
-           {
-             DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("GenericElementStatus : try to move tape to tape drive\n"));
-             pDev[DeviceFD].functions->function_move(DeviceFD, pDTE[0].address, pDTE[0].address);
-           }
-       }
-         /* Done GetElementStatus */
-    }
-
-  if (error != 0)
-    {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Can't init status (after loop)\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  ElementStatusValid = 1;
-  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("#### STOP GenericElementStatus\n"));
-  return(0);
-}
-
-
-/*
- * This is for the ADIC changer, it seems that they have an diferent
- * offset in the mode sense data before the first mode page (+12)
- */
-int
-DLT448ElementStatus(
-    int                DeviceFD,
-    int                InitStatus)
-{
-  int DTEError = 0;
-
-  extern OpenFiles_T *pDev;
-
-  int error = 0;   /* If set do an INIT ELEMENT STATUS */
-  size_t x;        /* The standard loop counter :-) */
-  int loop = 2;    /* Redo it if an error has been reset */
-
-  (void)InitStatus;    /* Quiet unused parameter warning */
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START DLT448ElementStatus\n"));
-
-  if (pEAAPage == NULL)
-    {
-      /*
-       * If this pointer is null
-       * then try to read the parameter with MODE SENSE
-       *
-       */
-      if (pModePage == NULL && LibModeSenseValid == 0)
-        {
-          pModePage = alloc(0xff);
-
-         if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0)
-           {
-             LibModeSenseValid = 1;
-             DecodeModeSense(pModePage, 12, _("DLT448ElementStatus :"), 0, debug_file);
-           } else {
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("DLT448ElementStatus : failed SCSI_ModeSense\n"));
-             LibModeSenseValid = -1;
-           }
-        }
-    }
-
-  while (GetElementStatus(DeviceFD) == 0 && loop-- > 0)
-    {
-      for (x = 0; x < MTE; x++)
-       {
-         if (pMTE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pMTE[x].ASC, pMTE[x].ASCQ, (RequestSense_T *)&pMTE[x]))
-               {
-               case SENSE_IES:
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on MTE\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-      for (x = 0; x < IEE; x++)
-       {
-         if (pIEE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pIEE[x].ASC, pIEE[x].ASCQ, (RequestSense_T *)&pIEE[x]))
-               {
-               case SENSE_IES:
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on IEE\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-
-      for (x = 0; x < STE; x++)
-       {
-         /*
-          * Needed for the hack to guess the tape status if an error
-          * for the tape is pending
-          */
-         if (pSTE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pSTE[x].ASC, pSTE[x].ASCQ, (RequestSense_T *)&pSTE[x]))
-               {
-               case SENSE_IES:
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on IES\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-      for (x = 0; x < DTE; x++)
-       {
-         if (pDTE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pDTE[x].ASC, pDTE[x].ASCQ, (RequestSense_T *)&pDTE[x]))
-               {
-               case SENSE_IES:
-                 DTEError = 1;
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on DTE\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-      /*
-       * OK, we have an error, do an INIT ELMENT
-       * For the tape if not handled by the robot we have
-       * to do some extra checks
-       */
-      if (error == 1)
-       {
-         if (GenericResetStatus(DeviceFD) != 0)
-           {
-             ElementStatusValid = 0;
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Can't init status\n"));
-             return(-1);
-             /*NOTREACHED*/
-           }
-         error = 0;
-       }
-
-      if (DTEError == 1)
-       {
-         TapeStatus();
-         /*
-          * If the status is empty to an move from tape to tape
-          * This is if the tape is ejected, but not unloaded
-          */
-         if (pDTE[0].status == 'E')
-           {
-             DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("DLT448ElementStatus : try to move tape to tape drive\n"));
-             pDev[DeviceFD].functions->function_move(DeviceFD, pDTE[0].address, pDTE[0].address);
-           }
-       }
-         /* Done GetElementStatus */
-    }
-
-  if (error != 0)
-    {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Can't init status (after loop)\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  ElementStatusValid = 1;
-  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("#### STOP DLT448ElementStatus\n"));
-  return(0);
-}
-
-
-/*
- * Much the same like GenericElementStatus but
- * it seemes that for the STE Elements ASC/ASCQ is not set
- * on an error, only the except bit is set
-*/
-int
-SDXElementStatus(
-    int                DeviceFD,
-    int                InitStatus)
-{
-  int error = 0;   /* If set do an INIT ELEMENT STATUS */
-  size_t x;        /* The standard loop counter :-) */
-  int loop = 2;    /* Redo it if an error has been reset */
-
-  (void)InitStatus;    /* Quiet unused parameter warning */
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START SDXElementStatus\n"));
-
-  if (pEAAPage == NULL)
-    {
-      /*
-       * If this pointer is null
-       * then try to read the parameter with MODE SENSE
-       *
-       */
-      if (pModePage == NULL && LibModeSenseValid == 0)
-        {
-          pModePage = alloc(0xff);
-
-         if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0)
-           {
-             LibModeSenseValid = 1;
-             DecodeModeSense(pModePage, 0, _("SDXElementStatus :"), 0, debug_file);
-           } else {
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("SDXElementStatus : failed SCSI_ModeSense\n"));
-             LibModeSenseValid = -1;
-           }
-        }
-    }
-
-  while (GetElementStatus(DeviceFD) == 0 && loop--)
-    {
-      error = 0;
-      for (x = 0; x < MTE; x++)
-       {
-         if (pMTE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pMTE[x].ASC, pMTE[x].ASCQ, (RequestSense_T *)&pMTE[x]))
-               {
-               case SENSE_IES:
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on MTE\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-      for (x = 0; x < IEE; x++)
-       {
-         if (pIEE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pIEE[x].ASC, pIEE[x].ASCQ, (RequestSense_T *)&pIEE[x]))
-               {
-               case SENSE_IES:
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on IEE\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-
-      for (x = 0; x < STE; x++)
-       {
-         if (pSTE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pSTE[x].ASC, pSTE[x].ASCQ, (RequestSense_T *)&pSTE[x]))
-               {
-               case SENSE_IES:
-                 error = 1;
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on IES\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-      for (x = 0; x < DTE; x++)
-       {
-         if (pDTE[x].ASC > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, SENSE_CHG_ELEMENT_STATUS, pDTE[x].ASC, pDTE[x].ASCQ, (RequestSense_T *)&pDTE[x]))
-               {
-               case SENSE_IES:
-                 /*
-                 error = 1;
-                 */
-                 break;
-               case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on DTE\n"));
-                 return(-1);
-                 /*NOTREACHED*/
-               }
-           }
-       }
-
-      /*
-       * OK, we have an error, do an INIT ELMENT
-       * For the tape if not handled by the robot we have
-       * to do some extra checks
-       */
-      if (error == 1)
-       {
-         if (GenericResetStatus(DeviceFD) != 0)
-           {
-             ElementStatusValid = 0;
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Can't init status\n"));
-             return(-1);
-             /*NOTREACHED*/
-           }
-       }
-
-      /* Done GetElementStatus */
-    }
-
-  if (error != 0)
-    {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Can't init status\n"));
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  ElementStatusValid = 1;
-  TapeStatus();
-  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("#### STOP SDXElementStatus\n"));
-  return(0);
-}
-
-
-/*
- * Reads the element information from the library. There are 2 ways to do this.
- * Either check the result from the mode sense page to see which types of elements
- * are available (STE/DTE/MTE....), or do an read element status with the option give
- * me all and than check what is available.
- *
- * Only do the read, error handling is done by the calling function
- *
- * Return Values:
- * < 0   -> Error
- * == 0  -> OK
- *
- * TODO:
- */
-int
-GetElementStatus(
-    int DeviceFD)
-{
-  u_char *DataBuffer = NULL;
-  size_t DataBufferLength;
-  ElementStatusData_T *ElementStatusData;
-  ElementStatusPage_T *ElementStatusPage;
-  MediumTransportElementDescriptor_T *MediumTransportElementDescriptor;
-  StorageElementDescriptor_T *StorageElementDescriptor;
-  DataTransferElementDescriptor_T *DataTransferElementDescriptor;
-  ImportExportElementDescriptor_T *ImportExportElementDescriptor;
-  size_t x;
-  size_t offset;
-  size_t length;       /* Length of an Element */
-  size_t NoOfElements;
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("##### START GetElementStatus\n"));
-
-  barcode = BarCode(DeviceFD);
-
-  /*
-   * If the MODE_SENSE was successfull we use this Information to read the Elelement Info
-   */
-  if (pEAAPage != NULL)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Reading Element Status with the info from mode sense\n"));
-      /* First the Medim Transport*/
-      if (V2(pEAAPage->NoMediumTransportElements)  > 0)
-        {
-          MTE = V2(pEAAPage->NoMediumTransportElements) ;
-          pMTE = alloc(SIZEOF(ElementInfo_T) * MTE);
-          memset(pMTE, 0, SIZEOF(ElementInfo_T) * MTE);
-
-          if (SCSI_ReadElementStatus(DeviceFD,
-                                     CHANGER,
-                                     0,
-                                     (u_char)barcode,
-                                     V2(pEAAPage->MediumTransportElementAddress),
-                                     (MTE + (size_t)1),
-                                    SIZEOF(MediumTransportElementDescriptor_T),
-                                     &DataBuffer) != 0)
-            {
-              ChgExit("genericElementStatus",_("Can't read MTE status"), FATAL);
-             /*NOTREACHED*/
-            }
-          // ElementStatusData = (ElementStatusData_T *)DataBuffer;
-          offset = SIZEOF(ElementStatusData_T);
-
-          ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset];
-          offset = offset + SIZEOF(ElementStatusPage_T);
-         length = V2(ElementStatusPage->length);
-
-          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("MTE Length %d(%d)\n"), length,
-                       SIZEOF(MediumTransportElementDescriptor_T));
-
-          for (x = 0; x < MTE; x++)
-            {
-              MediumTransportElementDescriptor = (MediumTransportElementDescriptor_T *)&DataBuffer[offset];
-
-              if (ElementStatusPage->pvoltag == 1)
-                {
-                  strncpy((char *)pMTE[x].VolTag,
-                          (char *)MediumTransportElementDescriptor->pvoltag,
-                          TAG_SIZE);
-                  TerminateString(pMTE[x].VolTag, TAG_SIZE+1);
-                }
-
-              pMTE[x].type = ElementStatusPage->type;
-              pMTE[x].address = V2(MediumTransportElementDescriptor->address);
-              pMTE[x].except = MediumTransportElementDescriptor->except;
-              pMTE[x].full = MediumTransportElementDescriptor->full;
-             if (MediumTransportElementDescriptor->full > 0)
-               {
-                  pMTE[x].status = 'F';
-               } else {
-                  pMTE[x].status = 'E';
-               }
-
-             if (length >= 5)
-               {
-                 pMTE[x].ASC = MediumTransportElementDescriptor->asc;
-               } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC MTE\n"));
-               }
-
-             if (length >= 6)
-               {
-                 pMTE[x].ASCQ = MediumTransportElementDescriptor->ascq;
-               } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ MTE\n"));
-               }
-
-             if (length >= 0xa)
-               {
-                 if (MediumTransportElementDescriptor->svalid == 1)
-                   {
-                     pMTE[x].from = V2(MediumTransportElementDescriptor->source);
-                   } else {
-                     pMTE[x].from = -1;
-                   }
-               } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source MTE\n"));
-               }
-             offset = offset + length;
-            }
-           free(DataBuffer);
-           DataBuffer = NULL;
-        }
-      /*
-       * Storage Elements
-       */
-      if ( V2(pEAAPage->NoStorageElements)  > 0)
-        {
-          free(pSTE);
-          STE = V2(pEAAPage->NoStorageElements);
-          pSTE = alloc(SIZEOF(ElementInfo_T) * STE);
-          memset(pSTE, 0, SIZEOF(ElementInfo_T) * STE);
-
-          if (SCSI_ReadElementStatus(DeviceFD,
-                                     STORAGE,
-                                     0,
-                                     (u_char)barcode,
-                                     V2(pEAAPage->FirstStorageElementAddress),
-                                     STE,
-                                    SIZEOF(StorageElementDescriptor_T),
-                                     &DataBuffer) != 0)
-            {
-              ChgExit("GetElementStatus", _("Can't read STE status"), FATAL);
-             /*NOTREACHED*/
-            }
-         assert(DataBuffer != NULL);
-
-          // ElementStatusData = (ElementStatusData_T *)DataBuffer;
-          offset = SIZEOF(ElementStatusData_T);
-
-          ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset];
-          offset = offset + SIZEOF(ElementStatusPage_T);
-         length = V2(ElementStatusPage->length);
-          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("STE Length %d\n"),length);
-
-          for (x = 0; x < STE; x++)
-            {
-              StorageElementDescriptor = (StorageElementDescriptor_T *)&DataBuffer[offset];
-              if (ElementStatusPage->pvoltag == 1)
-                {
-                  strncpy(pSTE[x].VolTag,
-                          (char *)StorageElementDescriptor->pvoltag,
-                          TAG_SIZE);
-                  TerminateString(pSTE[x].VolTag, TAG_SIZE+1);
-                }
-
-
-              pSTE[x].type = ElementStatusPage->type;
-              pSTE[x].address = V2(StorageElementDescriptor->address);
-              pSTE[x].except = StorageElementDescriptor->except;
-              pSTE[x].full = StorageElementDescriptor->full;
-              if (StorageElementDescriptor->full > 0)
-               {
-                 pSTE[x].status = 'F';
-               } else {
-                 pSTE[x].status = 'E';
-               }
-
-             if (length >= 5)
-               {
-                 pSTE[x].ASC = StorageElementDescriptor->asc;
-               } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC STE\n"));
-               }
-
-             if (length >= 6)
-               {
-                 pSTE[x].ASCQ = StorageElementDescriptor->ascq;
-               } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ STE\n"));
-               }
-
-             if (length >= 0xa)
-               {
-                 if (StorageElementDescriptor->svalid == 1)
-                   {
-                     pSTE[x].from = V2(StorageElementDescriptor->source);
-                   } else {
-                     pSTE[x].from = -1;
-                   }
-               } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n"));
-               }
-
-              offset = offset + length;
-            }
-           free(DataBuffer);
-           DataBuffer = NULL;
-        }
-      /*
-       * Import/Export Elements
-       */
-      if ( V2(pEAAPage->NoImportExportElements) > 0)
-        {
-          free(pIEE);
-          IEE = V2(pEAAPage->NoImportExportElements);
-          pIEE = alloc(SIZEOF(ElementInfo_T) * IEE);
-          memset(pIEE, 0, SIZEOF(ElementInfo_T) * IEE);
-
-          if (SCSI_ReadElementStatus(DeviceFD,
-                                     IMPORT,
-                                     0,
-                                     (u_char)barcode,
-                                     V2(pEAAPage->FirstImportExportElementAddress),
-                                     IEE,
-                                    SIZEOF(ImportExportElementDescriptor_T),
-                                     &DataBuffer) != 0)
-            {
-              ChgExit("GetElementStatus", _("Can't read IEE status"), FATAL);
-             /*NOTREACHED*/
-            }
-         assert(DataBuffer != NULL);
-
-          // ElementStatusData = (ElementStatusData_T *)DataBuffer;
-          offset = SIZEOF(ElementStatusData_T);
-
-          ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset];
-          offset = offset + SIZEOF(ElementStatusPage_T);
-         length = V2(ElementStatusPage->length);
-          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("IEE Length %d\n"),length);
-
-          for (x = 0; x < IEE; x++)
-            {
-              ImportExportElementDescriptor = (ImportExportElementDescriptor_T *)&DataBuffer[offset];
-              if (ElementStatusPage->pvoltag == 1)
-                {
-                  strncpy(pIEE[x].VolTag,
-                          (char *)ImportExportElementDescriptor->pvoltag,
-                          TAG_SIZE);
-                  TerminateString(pIEE[x].VolTag, TAG_SIZE+1);
-                }
-              pIEE[x].type = ElementStatusPage->type;
-              pIEE[x].address = V2(ImportExportElementDescriptor->address);
-              pIEE[x].except = ImportExportElementDescriptor->except;
-              pIEE[x].full = ImportExportElementDescriptor->full;
-             if (ImportExportElementDescriptor->full > 0)
-               {
-                 pIEE[x].status = 'F';
-               } else {
-                 pIEE[x].status = 'E';
-               }
-
-             if (length >= 5)
-               {
-                 pIEE[x].ASC = ImportExportElementDescriptor->asc;
-               } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC IEE\n"));
-               }
-
-             if (length >= 6)
-               {
-                 pIEE[x].ASCQ = ImportExportElementDescriptor->ascq;
-               } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ IEE\n"));
-               }
-
-             if (length >= 0xa)
-               {
-                 if (ImportExportElementDescriptor->svalid == 1)
-                   {
-                     pIEE[x].from = V2(ImportExportElementDescriptor->source);
-                   } else {
-                     pIEE[x].from = -1;
-                   }
-               } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source IEE\n"));
-               }
-
-              offset = offset + length;
-            }
-           free(DataBuffer);
-           DataBuffer = NULL;
-        }
-      /*
-       * Data Transfer Elements
-       */
-      if (V2(pEAAPage->NoDataTransferElements) >0)
-        {
-         free(pDTE);
-          DTE = V2(pEAAPage->NoDataTransferElements) ;
-          pDTE = alloc(SIZEOF(ElementInfo_T) * DTE);
-          memset(pDTE, 0, SIZEOF(ElementInfo_T) * DTE);
-
-          if (SCSI_ReadElementStatus(DeviceFD,
-                                     TAPETYPE,
-                                     0,
-                                     (u_char)barcode,
-                                     V2(pEAAPage->FirstDataTransferElementAddress),
-                                     DTE,
-                                    SIZEOF(DataTransferElementDescriptor_T),
-                                     &DataBuffer) != 0)
-            {
-              ChgExit("GenericElementStatus", _("Can't read DTE status"), FATAL);
-             /*NOTREACHED*/
-            }
-         assert(DataBuffer != NULL);
-
-          // ElementStatusData = (ElementStatusData_T *)DataBuffer;
-          offset = SIZEOF(ElementStatusData_T);
-
-          ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset];
-          offset = offset + SIZEOF(ElementStatusPage_T);
-         length = V2(ElementStatusPage->length);
-          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("DTE Length %d\n"),length);
-
-          for (x = 0; x < DTE; x++)
-            {
-              DataTransferElementDescriptor = (DataTransferElementDescriptor_T *)&DataBuffer[offset];
-              if (ElementStatusPage->pvoltag == 1)
-                {
-                  strncpy(pDTE[x].VolTag,
-                          (char *)DataTransferElementDescriptor->pvoltag,
-                          TAG_SIZE);
-                  TerminateString(pDTE[x].VolTag, TAG_SIZE+1);
-                }
-              pDTE[x].type = ElementStatusPage->type;
-             pDTE[x].address = V2(DataTransferElementDescriptor->address);
-              pDTE[x].except = DataTransferElementDescriptor->except;
-              pDTE[x].scsi = DataTransferElementDescriptor->scsi;
-              pDTE[x].full = DataTransferElementDescriptor->full;
-              if (DataTransferElementDescriptor->full > 0)
-               {
-                 pDTE[x].status = 'F';
-               } else {
-                 pDTE[x].status = 'E';
-               }
-
-             if (length >= 5)
-             {
-               pDTE[x].ASC = DataTransferElementDescriptor->asc;
-             } else {
-               DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC DTE\n"));
-             }
-
-             if (length >= 6)
-               {
-                 pDTE[x].ASCQ = DataTransferElementDescriptor->ascq;
-             } else {
-               DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ DTE\n"));
-             }
-
-             if (length >= 0xa)
-               {
-                 if (DataTransferElementDescriptor->svalid == 1)
-                   {
-                     pDTE[x].from = V2(DataTransferElementDescriptor->source);
-                   } else {
-                     pDTE[x].from = -1;
-                   }
-               } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n"));
-               }
-
-              offset = offset + length;
-            }
-           free(DataBuffer);
-           DataBuffer = NULL;
-        }
-    } else {
-      /*
-       * And now the old way, when we get here the read mode sense page has failed ...
-       */
-      DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Reading Element Status the old way .... (max 255 elements)\n"));
-      if (SCSI_ReadElementStatus(DeviceFD,
-                                 0,
-                                 0,
-                                 (u_char)barcode,
-                                 0,
-                                 (size_t)0xff,
-                                (size_t)0x7f,
-                                 &DataBuffer) != 0)
-        {
-          ChgExit("GenericElementStatus",_("Can't get ElementStatus"), FATAL);
-         /*NOTREACHED*/
-        }
-      assert(DataBuffer != NULL);
-
-      ElementStatusData = (ElementStatusData_T *)DataBuffer;
-      DataBufferLength = V3(ElementStatusData->count);
-
-      offset = SIZEOF(ElementStatusData_T);
-
-      while (offset < DataBufferLength)
-        {
-          ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset];
-          NoOfElements = V3(ElementStatusPage->count) / V2(ElementStatusPage->length);
-          offset = offset + SIZEOF(ElementStatusPage_T);
-         length = V2(ElementStatusPage->length);
-
-          switch (ElementStatusPage->type)
-            {
-            case CHANGER:
-             free(pMTE);
-              MTE = NoOfElements;
-              pMTE = alloc(SIZEOF(ElementInfo_T) * MTE);
-              memset(pMTE, 0, SIZEOF(ElementInfo_T) * MTE);
-
-              for (x = 0; x < NoOfElements; x++)
-                {
-                  MediumTransportElementDescriptor = (MediumTransportElementDescriptor_T *)&DataBuffer[offset];
-                  if (ElementStatusPage->pvoltag == 1)
-                    {
-                      strncpy(pMTE[x].VolTag,
-                              (char *)MediumTransportElementDescriptor->pvoltag,
-                              TAG_SIZE);
-                      TerminateString(pMTE[x].VolTag, TAG_SIZE+1);
-                    }
-                  pMTE[x].type = ElementStatusPage->type;
-                  pMTE[x].address = V2(MediumTransportElementDescriptor->address);
-                  pMTE[x].except = MediumTransportElementDescriptor->except;
-                  pMTE[x].full = MediumTransportElementDescriptor->full;
-                 if (MediumTransportElementDescriptor->full > 0)
-                   {
-                     pMTE[x].status = 'F';
-                   } else {
-                     pMTE[x].status = 'E';
-                   }
-
-                 if (length >= 5)
-                   {
-                     pMTE[x].ASC = MediumTransportElementDescriptor->asc;
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC MTE\n"));
-                   }
-
-                 if (length >= 6)
-                   {
-                     pMTE[x].ASCQ = MediumTransportElementDescriptor->ascq;
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ MTE\n"));
-                   }
-
-                 if (length >= 0xa)
-                   {
-                     if (MediumTransportElementDescriptor->svalid == 1)
-                       {
-                         pMTE[x].from = V2(MediumTransportElementDescriptor->source);
-                       } else {
-                         pMTE[x].from = -1;
-                       }
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source MTE\n"));
-                   }
-
-                 offset = offset + length;
-               }
-              break;
-            case STORAGE:
-             free(pSTE);
-              STE = NoOfElements;
-              pSTE = alloc(SIZEOF(ElementInfo_T) * STE);
-              memset(pSTE, 0, SIZEOF(ElementInfo_T) * STE);
-
-              for (x = 0; x < NoOfElements; x++)
-                {
-                 StorageElementDescriptor = (StorageElementDescriptor_T *)&DataBuffer[offset];
-                  if (ElementStatusPage->pvoltag == 1)
-                    {
-                      strncpy(pSTE[x].VolTag,
-                              (char *)StorageElementDescriptor->pvoltag,
-                              TAG_SIZE);
-                      TerminateString(pSTE[x].VolTag, TAG_SIZE+1);
-                    }
-
-                  pSTE[x].type = ElementStatusPage->type;
-                  pSTE[x].address = V2(StorageElementDescriptor->address);
-                  pSTE[x].except = StorageElementDescriptor->except;
-                  pSTE[x].full = StorageElementDescriptor->full;
-                 if (StorageElementDescriptor->full > 0)
-                   {
-                     pSTE[x].status = 'F';
-                   } else {
-                     pSTE[x].status = 'E';
-                   }
-
-                 if (length >= 5)
-                   {
-                     pSTE[x].ASC = StorageElementDescriptor->asc;
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC STE\n"));
-                   }
-
-                 if (length >= 6)
-                   {
-                     pSTE[x].ASCQ = StorageElementDescriptor->ascq;
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ STE\n"));
-                   }
-
-                 if (length >= 0xa)
-                   {
-                     if (StorageElementDescriptor->svalid == 1)
-                       {
-                         pSTE[x].from = V2(StorageElementDescriptor->source);
-                       } else {
-                         pSTE[x].from = -1;
-                       }
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n"));
-                   }
-
-                  offset = offset + length;
-                }
-              break;
-            case IMPORT:
-             free(pIEE);
-              IEE = NoOfElements;
-              pIEE = alloc(SIZEOF(ElementInfo_T) * IEE);
-              memset(pIEE, 0, SIZEOF(ElementInfo_T) * IEE);
-
-              for (x = 0; x < NoOfElements; x++)
-                {
-                  ImportExportElementDescriptor = (ImportExportElementDescriptor_T *)&DataBuffer[offset];
-                  if (ElementStatusPage->pvoltag == 1)
-                    {
-                      strncpy(pIEE[x].VolTag,
-                              (char *)ImportExportElementDescriptor->pvoltag,
-                              TAG_SIZE);
-                      TerminateString(pIEE[x].VolTag, TAG_SIZE+1);
-                    }
-                  ImportExportElementDescriptor = (ImportExportElementDescriptor_T *)&DataBuffer[offset];
-                  pIEE[x].type = ElementStatusPage->type;
-                  pIEE[x].address = V2(ImportExportElementDescriptor->address);
-                  pIEE[x].except = ImportExportElementDescriptor->except;
-                  pIEE[x].full = ImportExportElementDescriptor->full;
-                 if (ImportExportElementDescriptor->full > 0)
-                   {
-                     pIEE[x].status = 'F';
-                   } else {
-                     pIEE[x].status = 'E';
-                   }
-
-                 if (length >= 5)
-                   {
-                     pIEE[x].ASC = ImportExportElementDescriptor->asc;
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC IEE\n"));
-                   }
-
-                 if (length >= 6)
-                   {
-                     pIEE[x].ASCQ = ImportExportElementDescriptor->ascq;
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ IEE\n"));
-                   }
-
-                 if (length >= 0xa)
-                   {
-                     if (ImportExportElementDescriptor->svalid == 1)
-                       {
-                         pIEE[x].from = V2(ImportExportElementDescriptor->source);
-                       } else {
-                         pIEE[x].from = -1;
-                       }
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source IEE\n"));
-                   }
-
-                 offset = offset + length;
-               }
-             break;
-            case TAPETYPE:
-             free(pDTE);
-              DTE = NoOfElements;
-              pDTE = alloc(SIZEOF(ElementInfo_T) * DTE);
-              memset(pDTE, 0, SIZEOF(ElementInfo_T) * DTE);
-
-              for (x = 0; x < NoOfElements; x++)
-                {
-                 DataTransferElementDescriptor = (DataTransferElementDescriptor_T *)&DataBuffer[offset];
-                  if (ElementStatusPage->pvoltag == 1)
-                    {
-                      strncpy(pSTE[x].VolTag,
-                              (char *)DataTransferElementDescriptor->pvoltag,
-                              TAG_SIZE);
-                      TerminateString(pSTE[x].VolTag, TAG_SIZE+1);
-                    }
-                  pDTE[x].type = ElementStatusPage->type;
-                  pDTE[x].address = V2(DataTransferElementDescriptor->address);
-                  pDTE[x].except = DataTransferElementDescriptor->except;
-                  pDTE[x].scsi = DataTransferElementDescriptor->scsi;
-                  pDTE[x].full = DataTransferElementDescriptor->full;
-                 if (DataTransferElementDescriptor->full > 0)
-                   {
-                     pDTE[x].status = 'F';
-                   } else {
-                     pDTE[x].status = 'E';
-                   }
-
-                 if (length >= 5)
-                   {
-                     pDTE[x].ASC = DataTransferElementDescriptor->asc;
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC DTE\n"));
-                   }
-
-                 if (length >= 6)
-                   {
-                     pDTE[x].ASCQ = DataTransferElementDescriptor->ascq;
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ DTE\n"));
-                   }
-
-                 if (length >= 0xa)
-                   {
-                     if (DataTransferElementDescriptor->svalid == 1)
-                       {
-                         pDTE[x].from = V2(DataTransferElementDescriptor->source);
-                       } else {
-                         pDTE[x].from = -1;
-                       }
-                   } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n"));
-                   }
-
-                 offset = offset + length;
-                }
-              break;
-            default:
-              offset = offset + length;
-              DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("GetElementStatus : UnGknown Type %d\n"),ElementStatusPage->type);
-              break;
-            }
-        }
-       free(DataBuffer);
-    }
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tMedia Transport Elements (robot arms) :\n"));
-
-  for ( x = 0; x < MTE; x++)
-    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02x\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n"),
-              pMTE[x].address, pMTE[x].status, pMTE[x].except, pMTE[x].ASC,
-              pMTE[x].ASCQ, pMTE[x].type, pMTE[x].from, pMTE[x].VolTag);
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tStorage Elements (Media slots) :\n"));
-
-  for ( x = 0; x < STE; x++)
-    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n"),
-              pSTE[x].address, pSTE[x].status, pSTE[x].except, pSTE[x].ASC,
-              pSTE[x].ASCQ, pSTE[x].type, pSTE[x].from, pSTE[x].VolTag);
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tData Transfer Elements (tape drives) :\n"));
-
-  for ( x = 0; x < DTE; x++)
-    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n\t\t\tSCSI ADDRESS = %d\n"),
-              pDTE[x].address, pDTE[x].status, pDTE[x].except, pDTE[x].ASC,
-              pDTE[x].ASCQ, pDTE[x].type, pDTE[x].from, pDTE[x].VolTag,pDTE[x].scsi);
-
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tImport/Export Elements  :\n"));
-
-  for ( x = 0; x < IEE; x++)
-    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n"),
-              pIEE[x].address, pIEE[x].status, pIEE[x].except, pIEE[x].ASC,
-              pIEE[x].ASCQ, pIEE[x].type, pIEE[x].from, pIEE[x].VolTag);
-
-
-
-  return(0);
-}
-
-/*
- * Get sense data
- * If ClearErrorCounters is set the counters will be reset.
- * Used by GenericClean for example
- *
- * TODO
- */
-int
-RequestSense(
-    int                                DeviceFD,
-    ExtendedRequestSense_T *   ExtendedRequestSense,
-    int                                ClearErrorCounters)
-{
-  CDB_T CDB;
-  int ret;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START RequestSense\n"));
-
-  CDB[0] = SC_COM_REQUEST_SENSE;               /* REQUEST SENSE */
-  CDB[1] = 0;                                  /* Logical Unit Number = 0, Reserved */
-  CDB[2] = 0;                                  /* Reserved */
-  CDB[3] = 0;                                  /* Reserved */
-  CDB[4] = (u_char)sizeof(ExtendedRequestSense_T);   /* Allocation Length */
-  CDB[5] = (u_char)((ClearErrorCounters << 7) & 0x80); /*  */
-
-  memset(ExtendedRequestSense, 0, SIZEOF(ExtendedRequestSense_T));
-
-  ret = SCSI_Run(DeviceFD, Input, CDB, 6,
-                (char *) ExtendedRequestSense,
-                SIZEOF(ExtendedRequestSense_T),
-                (RequestSense_T *) ExtendedRequestSense,
-                SIZEOF(ExtendedRequestSense_T));
-
-
-  if (ret < 0)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP RequestSense (%d)\n"),ret);
-      return(ret);
-      /*NOTREACHED*/
-    }
-
-  if ( ret > 0)
-    {
-      DecodeExtSense(ExtendedRequestSense, "RequestSense : ",debug_file);
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP RequestSense (%d)\n"), ExtendedRequestSense->SenseKey);
-      return(ExtendedRequestSense->SenseKey);
-      /*NOTREACHED*/
-    }
-
-  dump_hex((u_char *)ExtendedRequestSense ,
-          SIZEOF(ExtendedRequestSense_T),
-          DEBUG_INFO, SECTION_SCSI);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP RequestSense (0)\n"));
-  return(0);
-}
-
-
-/*
- * Lookup function pointer for device ....
- */
-
-
-ElementInfo_T *
-LookupElement(
-    int                address)
-{
-  size_t x;
-
-  dbprintf(_("##### START LookupElement\n"));
-
-  if (DTE > 0)
-    {
-      for (x = 0; x < DTE; x++)
-        {
-          if (pDTE[x].address == address)
-         {
-            dbprintf(_("##### STOP LookupElement (DTE)\n"));
-            return(&pDTE[x]);
-           /*NOTREACHED*/
-         }
-        }
-    }
-
-  if (MTE > 0)
-    {
-      for (x = 0; x < MTE; x++)
-        {
-          if (pMTE[x].address == address)
-         {
-            dbprintf(_("##### STOP LookupElement (MTE)\n"));
-            return(&pMTE[x]);
-           /*NOTREACHED*/
-         }
-        }
-    }
-
-  if (STE > 0)
-    {
-      for (x = 0; x < STE; x++)
-        {
-          if (pSTE[x].address == address)
-         {
-            dbprintf(_("##### STOP LookupElement (STE)\n"));
-            return(&pSTE[x]);
-           /*NOTREACHED*/
-         }
-        }
-    }
-
-  if (IEE > 0)
-    {
-      for ( x = 0; x < IEE; x++)
-        {
-          if (pIEE[x].address == address)
-         {
-            dbprintf(_("##### STOP LookupElement (IEE)\n"));
-            return(&pIEE[x]);
-           /*NOTREACHED*/
-         }
-        }
-    }
-  return(NULL);
-}
-
-/*
- * Here comes everything what decode the log Pages
- *
- * TODO:
- * Fix the result handling from TestUnitReady
- *
- */
-int
-LogSense(
-    int                DeviceFD)
-{
-  extern OpenFiles_T *pDev;
-  CDB_T CDB;
-  RequestSense_T *pRequestSense;
-  LogSenseHeader_T *LogSenseHeader;
-  LogParameter_T *LogParameter;
-  struct LogPageDecode *p;
-  int found;
-  extern char *tapestatfile;
-  int i;
-  unsigned ParameterCode;
-  unsigned value;
-  size_t length;
-  int count;
-  u_char *buffer;
-  u_char *logpages;
-  size_t nologpages;
-  size_t size = 128;
-
-  (void)DeviceFD;      /* Quiet unused parameter warning */
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START LogSense\n"));
-
-  if ((tapestatfile != NULL) && (pDev[INDEX_TAPECTL].SCSI == 1) &&
-      ((StatFile = fopen(tapestatfile,"a")) != NULL))
-    {
-      pRequestSense = alloc(SIZEOF(RequestSense_T));
-
-      if (GenericRewind(INDEX_TAPECTL) < 0)
-        {
-          DebugPrint(DEBUG_INFO, SECTION_TAPE,_("LogSense : Rewind failed\n"));
-          free(pRequestSense);
-         fclose(StatFile);
-          return(0);
-         /*NOTREACHED*/
-        }
-      /*
-       * Try to read the tape label
-       */
-      if (pDev[INDEX_TAPE].inqdone == 1)
-        {
-         if (pDev[INDEX_TAPE].devopen == 1)
-           {
-             SCSI_CloseDevice(INDEX_TAPE);
-           }
-
-         if ((chgscsi_result = (char *)tape_rdlabel(pDev[INDEX_TAPE].dev, &chgscsi_datestamp, &chgscsi_label)) == NULL)
-           {
-             g_fprintf(StatFile, _("==== %s ==== %s ====\n"), chgscsi_datestamp, chgscsi_label);
-           } else {
-             g_fprintf(StatFile, "%s\n", chgscsi_result);
-           }
-       }
-
-      buffer = alloc(size);
-      memset(buffer, 0, size);
-      /*
-       * Get the known log pages
-       */
-
-      CDB[0] = SC_COM_LOG_SENSE;
-      CDB[1] = 0;
-      CDB[2] = 0x40;    /* 0x40 for current values */
-      CDB[3] = 0;
-      CDB[4] = 0;
-      CDB[5] = 0;
-      CDB[6] = 00;
-      MSB2(&CDB[7], size);
-      CDB[9] = 0;
-
-      if (SCSI_Run(INDEX_TAPECTL, Input, CDB, 10,
-                              buffer,
-                              size,
-                              pRequestSense,
-                              SIZEOF(RequestSense_T)) != 0)
-        {
-          DecodeSense(pRequestSense, "LogSense : ",debug_file);
-          free(pRequestSense);
-          free(buffer);
-         fclose(StatFile);
-          return(0);
-         /*NOTREACHED*/
-        }
-
-      LogSenseHeader = (LogSenseHeader_T *)buffer;
-      nologpages = V2(LogSenseHeader->PageLength);
-      logpages = alloc(nologpages);
-
-      memcpy(logpages, buffer + SIZEOF(LogSenseHeader_T), nologpages);
-
-      for (count = 0; count < (int)nologpages; count++) {
-        if (logpages[count] != 0  ) {
-          memset(buffer, 0, size);
-          CDB[0] = SC_COM_LOG_SENSE;
-          CDB[1] = 0;
-          CDB[2] = (u_char)(0x40 | logpages[count]);/* 0x40 for current values */
-          CDB[3] = 0;
-          CDB[4] = 0;
-          CDB[5] = 0;
-          CDB[6] = 00;
-          MSB2(&CDB[7], size);
-          CDB[9] = 0;
-
-          if (SCSI_Run(INDEX_TAPECTL, Input, CDB, 10,
-                                  buffer,
-                                  size,
-                                  pRequestSense,
-                                  SIZEOF(RequestSense_T)) != 0)
-            {
-              DecodeSense(pRequestSense, "LogSense : ",debug_file);
-              free(pRequestSense);
-             free(logpages);
-              free(buffer);
-             fclose(StatFile);
-              return(0);
-             /*NOTREACHED*/
-            }
-          LogSenseHeader = (LogSenseHeader_T *)buffer;
-          length = V2(LogSenseHeader->PageLength);
-          LogParameter = (LogParameter_T *)(buffer + SIZEOF(LogSenseHeader_T));
-          /*
-           * Decode the log pages
-           */
-          p = (struct LogPageDecode *)&DecodePages;
-          found = 0;
-
-         dump_hex((u_char *)LogParameter, 64, DEBUG_INFO, SECTION_SCSI);
-
-          while(p->ident != NULL) {
-            if ((strcmp(pDev[INDEX_TAPECTL].ident, p->ident) == 0 ||strcmp("*", p->ident) == 0)  && p->LogPage == logpages[count]) {
-              p->decode(LogParameter, length);
-              found = 1;
-              g_fprintf(StatFile, "\n");
-              break;
-            }
-            p++;
-          }
-
-          if (!found) {
-            g_fprintf(StatFile, _("Logpage No %d = %x\n"), count ,logpages[count]);
-
-            while ((u_char *)LogParameter < (buffer + length)) {
-              i = LogParameter->ParameterLength;
-              ParameterCode = V2(LogParameter->ParameterCode);
-              switch (i) {
-              case 1:
-                value = V1((u_char *)LogParameter + SIZEOF(LogParameter_T));
-                g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i);
-                break;
-              case 2:
-                value = V2((u_char *)LogParameter + SIZEOF(LogParameter_T));
-                g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i);
-                break;
-              case 3:
-                value = V3((u_char *)LogParameter + SIZEOF(LogParameter_T));
-                g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i);
-                break;
-              case 4:
-                value = V4((u_char *)LogParameter + SIZEOF(LogParameter_T));
-                g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i);
-                break;
-              case 5:
-                value = V5((u_char *)LogParameter + SIZEOF(LogParameter_T));
-                g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i);
-                break;
-              default:
-                g_fprintf(StatFile, _("ParameterCode %02X size %d\n"), ParameterCode, i);
-              }
-              LogParameter = (LogParameter_T *)((u_char *)LogParameter +  SIZEOF(LogParameter_T) + i);
-            }
-            g_fprintf(StatFile, "\n");
-          }
-        }
-      }
-
-      /*
-       * Test only !!!!
-       * Reset the cumulative counters
-       */
-      CDB[0] = SC_COM_LOG_SELECT;
-      CDB[1] = 2;
-      CDB[2] = 0xc0;
-      CDB[3] = 0;
-      CDB[4] = 0;
-      CDB[5] = 0;
-      CDB[6] = 0;
-      CDB[7] = 0;
-      CDB[8] = 0;
-      CDB[9] = 0;
-
-      if (SCSI_Run(INDEX_TAPECTL, Input, CDB, 10,
-                              buffer,
-                              size,
-                              pRequestSense,
-                              SIZEOF(RequestSense_T)) != 0)
-        {
-          DecodeSense(pRequestSense, "LogSense : ",debug_file);
-          free(pRequestSense);
-         free(logpages);
-         /*@ignore@*/
-          free(buffer);
-         /*@end@*/
-         fclose(StatFile);
-          return(0);
-         /*NOTREACHED*/
-        }
-
-      free(pRequestSense);
-      free(logpages);
-      /*@ignore@*/
-      free(buffer);
-      /*@end@*/
-      fclose(StatFile);
-    }
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP LogSense\n"));
-  return(0);
-}
-
-void
-WriteErrorCountersPage(
-    LogParameter_T *   buffer,
-    size_t             length)
-{
-  int i;
-  unsigned value;
-  LogParameter_T *LogParameter;
-  unsigned ParameterCode;
-  LogParameter = buffer;
-
-  g_fprintf(StatFile, _("\tWrite Error Counters Page\n"));
-
-  while ((u_char *)LogParameter < ((u_char *)buffer + length)) {
-    i = LogParameter->ParameterLength;
-    ParameterCode = V2(LogParameter->ParameterCode);
-
-    value = 0;
-    if (Decode(LogParameter, &value) == 0) {
-      switch (ParameterCode) {
-      case 2:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Rewrites"),
-                value);
-        break;
-      case 3:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Errors Corrected"),
-                value);
-        break;
-      case 4:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Times E. Processed"),
-                value);
-        break;
-      case 5:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Bytes Processed"),
-                value);
-        break;
-      case 6:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Unrecoverable Errors"),
-                value);
-        break;
-      default:
-        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
-                ParameterCode,
-                value, i);
-        break;
-      }
-    } else {
-      g_fprintf(StatFile, _("Error decoding Result\n"));
-    }
-    LogParameter = (LogParameter_T *)((u_char *)LogParameter +  SIZEOF(LogParameter_T) + i);
-  }
-}
-
-void
-ReadErrorCountersPage(
-    LogParameter_T *   buffer,
-    size_t             length)
-{
-  int i;
-  unsigned value;
-  LogParameter_T *LogParameter;
-  unsigned ParameterCode;
-  LogParameter = buffer;
-
-  g_fprintf(StatFile, _("\tRead Error Counters Page\n"));
-
-  while ((u_char *)LogParameter < ((u_char *)buffer + length)) {
-    i = LogParameter->ParameterLength;
-    ParameterCode = V2(LogParameter->ParameterCode);
-
-    value = 0;
-    if (Decode(LogParameter, &value) == 0) {
-      switch (ParameterCode) {
-      case 2:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Rereads"),
-                value);
-        break;
-      case 3:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Errors Corrected"),
-                value);
-        break;
-      case 4:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Times E. Processed"),
-                value);
-        break;
-      case 5:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Bytes Processed"),
-                value);
-        break;
-      case 6:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Unrecoverable Errors"),
-                value);
-        break;
-      default:
-        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
-                ParameterCode,
-                value, i);
-        break;
-      }
-    } else {
-      g_fprintf(StatFile, _("Error decoding Result\n"));
-    }
-    LogParameter = (LogParameter_T *)((u_char *)LogParameter +  SIZEOF(LogParameter_T) + i);
-  }
-}
-
-void
-C1553APage30(
-    LogParameter_T *   buffer,
-    size_t             length)
-{
-  int i;
-  unsigned value;
-  LogParameter_T *LogParameter;
-  unsigned ParameterCode;
-  LogParameter = buffer;
-
-  g_fprintf(StatFile, _("\tData compression transfer Page\n"));
-
-  while ((u_char *)LogParameter < ((u_char *)buffer + length)) {
-    i = LogParameter->ParameterLength;
-    ParameterCode = V2(LogParameter->ParameterCode);
-
-    value = 0;
-    if (Decode(LogParameter, &value) == 0) {
-      switch (ParameterCode) {
-      default:
-        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
-                ParameterCode,
-                value, i);
-        break;
-      }
-    }
-    LogParameter = (LogParameter_T *)((u_char *)LogParameter +  SIZEOF(LogParameter_T) + i);
-  }
-}
-
-void
-C1553APage37(
-    LogParameter_T *   buffer,
-    size_t             length)
-{
-  int i;
-  unsigned value;
-  LogParameter_T *LogParameter;
-  unsigned ParameterCode;
-  LogParameter = buffer;
-
-  g_fprintf(StatFile, _("\tDrive Counters Page\n"));
-
-  while ((u_char *)LogParameter < ((unsigned char *)buffer + length)) {
-    i = LogParameter->ParameterLength;
-    ParameterCode = V2(LogParameter->ParameterCode);
-
-    value = 0;
-    if (Decode(LogParameter, &value) == 0) {
-      switch (ParameterCode) {
-      case 1:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total loads"),
-                value);
-        break;
-      case 2:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total write drive errors"),
-                value);
-        break;
-      case 3:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total read drive errors"),
-                value);
-        break;
-      default:
-        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
-                ParameterCode,
-                value, i);
-        break;
-      }
-    }
-    LogParameter = (LogParameter_T *)((u_char *)LogParameter +  SIZEOF(LogParameter_T) + i);
-  }
-}
-
-void
-EXB85058HEPage39(
-    LogParameter_T *   buffer,
-    size_t             length)
-{
-  int i;
-  unsigned value;
-  LogParameter_T *LogParameter;
-  unsigned ParameterCode;
-  LogParameter = buffer;
-
-  g_fprintf(StatFile, _("\tData Compression Page\n"));
-
-  while ((u_char *)LogParameter < ((unsigned char *)buffer + length)) {
-    i = LogParameter->ParameterLength;
-    ParameterCode = V2(LogParameter->ParameterCode);
-
-    value = 0;
-    if (Decode(LogParameter, &value) == 0) {
-      switch (ParameterCode) {
-      case 5:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("KB to Compressor"),
-                value);
-        break;
-      case 7:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("KB to tape"),
-                value);
-        break;
-      default:
-        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
-                ParameterCode,
-                value, i);
-        break;
-      }
-    }
-    LogParameter = (LogParameter_T *)((u_char *)LogParameter +  SIZEOF(LogParameter_T) + i);
-  }
-}
-
-void
-EXB85058HEPage3c(
-    LogParameter_T *   buffer,
-    size_t             length)
-{
-  int i;
-  unsigned value;
-  LogParameter_T *LogParameter;
-  unsigned ParameterCode;
-  LogParameter = buffer;
-
-  g_fprintf(StatFile, _("\tDrive Usage Information Page\n"));
-
-  while ((u_char *)LogParameter < ((unsigned char *)buffer + length)) {
-    i = LogParameter->ParameterLength;
-    ParameterCode = V2(LogParameter->ParameterCode);
-
-    value = 0;
-    if (Decode(LogParameter, &value) == 0) {
-      switch (ParameterCode) {
-      case 1:
-      case 2:
-      case 3:
-      case 4:
-      case 5:
-        break;
-      case 6:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Total Load Count"),
-                value);
-        break;
-      case 7:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("MinutesSince Last Clean"),
-                value);
-        break;
-      case 8:
-      case 9:
-        break;
-      case 0xa:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Cleaning Count"),
-                value);
-        break;
-      case 0xb:
-      case 0xc:
-      case 0xd:
-      case 0xe:
-      case 0xf:
-      case 0x10:
-        break;
-      case 0x11:
-        g_fprintf(StatFile, _("%-30s = %u\n"),
-                _("Time to clean"),
-                value);
-        break;
-      case 0x12:
-      case 0x13:
-      case 0x14:
-        break;
-      default:
-        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
-                ParameterCode,
-                value, i);
-        break;
-      }
-    }
-    LogParameter = (LogParameter_T *)((u_char *)LogParameter +  SIZEOF(LogParameter_T) + i);
-  }
-}
-
-int
-Decode(
-    LogParameter_T *   LogParameter,
-    unsigned *         value)
-{
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START Decode\n"));
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Decode Parameter with length %d\n"), LogParameter->ParameterLength);
-
-  *value = 0;
-  switch (LogParameter->ParameterLength) {
-  case 1:
-    *value = V1((u_char *)LogParameter + SIZEOF(LogParameter_T));
-    break;
-  case 2:
-    *value = V2((u_char *)LogParameter + SIZEOF(LogParameter_T));
-    break;
-  case 3:
-    *value = V3((u_char *)LogParameter + SIZEOF(LogParameter_T));
-    break;
-  case 4:
-    *value = V4((u_char *)LogParameter + SIZEOF(LogParameter_T));
-    break;
-  case 5:
-    *value = V5((u_char *)LogParameter + SIZEOF(LogParameter_T));
-    break;
-  case 6:
-    *value = V6((u_char *)LogParameter + SIZEOF(LogParameter_T));
-    break;
-  default:
-    g_fprintf(StatFile, _("Can't decode ParameterCode %02X size %d\n"),
-            V2(LogParameter->ParameterCode), LogParameter->ParameterLength);
-    DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP Decode (1)\n"));
-    return(1);
-    /*NOTREACHED*/
-  }
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Result = %d\n"), *value);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP Decode(0)\n"));
-  return(0);
-}
-
-void
-DumpDev(
-    OpenFiles_T *      p,
-    char *             device)
-{
-       if (p != NULL)
-       {
-               g_printf(_("%s Devicefd   %d\n"), device, p->fd);
-               g_printf(_("%s Can SCSI   %d\n"), device, p->SCSI);
-               g_printf(_("%s Device     %s\n"), device, (p->dev != NULL)? p->dev:_("No set"));
-               g_printf(_("%s ConfigName %s\n"), device, (p->ConfigName != NULL) ? p->ConfigName:_("Not ser"));
-       } else {
-               g_printf(_("%s Null Pointer ....\n"), device);
-       }
-       g_printf(_("\n"));
-}
-
-void
-ChangerReplay(
-    char *     option)
-{
-    u_char buffer[1024];
-    FILE *ip;
-    int x;
-    unsigned bufferx;
-
-    (void)option;      /* Quiet unused parameter warning */
-
-    if ((ip=fopen("/tmp/chg-scsi-trace", "r")) == NULL)
-      {
-       exit(1);
-      }
-
-    for (x = 0; x < 1024; x++)
-      {
-        if (fscanf(ip, "%2x", &bufferx) == EOF) 
-         {
-           break;
-           /*NOTREACHED*/
-         }
-        buffer[x] = (u_char)bufferx;
-        x++;
-      }
-
-    DecodeModeSense(&buffer[0], 12, "DLT448ElementStatus :", 0, debug_file);
-    fclose(ip);
-}
-
-/*
- * Display all Information we can get about the library....
- */
-void
-ChangerStatus(
-    char *     option,
-    char *     labelfile,
-    int                HasBarCode,
-    char *     changer_file,
-    char *     changer_dev,
-    char *     tape_device)
-{
-  extern OpenFiles_T *pDev;
-  size_t x;
-  FILE *out;
-  ExtendedRequestSense_T ExtRequestSense;
-  MBC_T *pbarcoderes;
-
-  ChangerCMD_T *p = (ChangerCMD_T *)&ChangerIO;
-  pbarcoderes = alloc(SIZEOF(MBC_T));
-  memset(pbarcoderes, 0, SIZEOF(MBC_T));
-
-  if (pModePage == NULL) {
-        pModePage = alloc(0xff);
-  }
-
-  if ((out = fdopen(1 , "w")) == NULL)
-    {
-      g_printf(_("Error fdopen stdout\n"));
-      free(pbarcoderes);
-      return;
-      /*NOTREACHED*/
-    }
-
-  if (strcmp("types", option) == 0 || strcmp("all", option) == 0)
-  {
-    while(p->ident != NULL)
-      {
-         g_printf (_("Ident = %s, type = %s\n"),p->ident, p->type);
-         p++;
-      }
-    DumpSense();
-  }
-
-  if (strcmp("robot", option) == 0 || strcmp("all", option) == 0)
-      {
-        if (ElementStatusValid == 0)
-          {
-            if (pDev[INDEX_CHANGER].functions->function_status(pDev[INDEX_CHANGER].fd, 1) != 0)
-              {
-                g_printf(_("Can not initialize changer status\n"));
-               free(pbarcoderes);
-               fclose(out);
-                return;
-               /*NOTREACHED*/
-              }
-          }
-        /*      0123456789012345678901234567890123456789012 */
-       if (HasBarCode)
-       {
-               g_printf(_("Address Type Status From Barcode Label\n"));
-       } else {
-               g_printf(_("Address Type Status From\n"));
-       }
-        g_printf(_("-------------------------------------------\n"));
-
-
-        for ( x = 0; x < MTE; x++)
-       if (HasBarCode)
-       {
-          g_printf(_("%07d MTE  %s  %04d %s "),pMTE[x].address,
-                 (pMTE[x].full ? _("Full ") :_("Empty")),
-                 pMTE[x].from, pMTE[x].VolTag);
-
-         if (pMTE[x].full == 1)
-           {
-             pbarcoderes->action = BARCODE_BARCODE;
-             strncpy(pbarcoderes->data.barcode, pMTE[x].VolTag,
-                     SIZEOF(pbarcoderes->data.barcode));
-
-             if (MapBarCode(labelfile, pbarcoderes) == 0 )
-               {
-                 g_printf(_("No mapping\n"));
-               } else {
-                 g_printf(_("%s \n"),pbarcoderes->data.voltag);
-               }
-           } else {
-             g_printf("\n");
-           }
-       } else {
-          g_printf(_("%07d MTE  %s  %04d \n"),pMTE[x].address,
-                 (pMTE[x].full ? _("Full ") :_("Empty")),
-                 pMTE[x].from);
-       }
-
-
-        for ( x = 0; x < STE; x++)
-       if (HasBarCode)
-       {
-          g_printf(_("%07d STE  %s  %04d %s "),pSTE[x].address,
-                 (pSTE[x].full ? _("Full "):_("Empty")),
-                 pSTE[x].from, pSTE[x].VolTag);
-
-         if (pSTE[x].full == 1)
-           {
-             pbarcoderes->action = BARCODE_BARCODE;
-             strncpy(pbarcoderes->data.barcode, pSTE[x].VolTag,
-                     SIZEOF(pbarcoderes->data.barcode));
-
-             if (MapBarCode(labelfile, pbarcoderes) == 0 )
-               {
-                 g_printf(_("No mapping\n"));
-               } else {
-                 g_printf(_("%s \n"),pbarcoderes->data.voltag);
-               }
-           } else {
-             g_printf("\n");
-           }
-       } else {
-          g_printf(_("%07d STE  %s  %04d %s\n"),pSTE[x].address,
-                 (pSTE[x].full ? _("Full"):_("Empty")),
-                 pSTE[x].from, pSTE[x].VolTag);
-       }
-
-
-        for ( x = 0; x < DTE; x++)
-       if (HasBarCode)
-       {
-          g_printf(_("%07d DTE  %s  %04d %s "),pDTE[x].address,
-                 (pDTE[x].full ? _("Full") : _("Empty")),
-                 pDTE[x].from, pDTE[x].VolTag);
-
-         if (pDTE[x].full == 1)
-           {
-             pbarcoderes->action = BARCODE_BARCODE;
-             strncpy(pbarcoderes->data.barcode, pDTE[x].VolTag,
-                     SIZEOF(pbarcoderes->data.barcode));
-
-             if (MapBarCode(labelfile, pbarcoderes) == 0 )
-               {
-                 g_printf(_("No mapping\n"));
-               } else {
-                 g_printf("%s \n",pbarcoderes->data.voltag);
-               }
-           } else {
-             g_printf("\n");
-           }
-
-       } else {
-          g_printf(_("%07d DTE  %s  %04d %s\n"),pDTE[x].address,
-                 (pDTE[x].full ?_( "Full ") : _("Empty")),
-                 pDTE[x].from, pDTE[x].VolTag);
-       }
-
-        for ( x = 0; x < IEE; x++)
-       if (HasBarCode)
-       {
-          g_printf(_("%07d IEE  %s  %04d %s "),pIEE[x].address,
-                 (pIEE[x].full ? _("Full ") : _("Empty")),
-                 pIEE[x].from, pIEE[x].VolTag);
-
-         if (pIEE[x].full == 1)
-           {
-             pbarcoderes->action = BARCODE_BARCODE;
-             strncpy(pbarcoderes->data.barcode, pIEE[x].VolTag,
-                     SIZEOF(pbarcoderes->data.barcode));
-
-             if (MapBarCode(labelfile, pbarcoderes) == 0 )
-               {
-                 g_printf(_("No mapping\n"));
-               } else {
-                 g_printf(_("%s \n"),pbarcoderes->data.voltag);
-               }
-           } else {
-             g_printf("\n");
-           }
-
-       } else {
-          g_printf(_("%07d IEE  %s  %04d %s\n"),pIEE[x].address,
-                 (pIEE[x].full ? _("Full ") : _("Empty")),
-                 pIEE[x].from, pIEE[x].VolTag);
-       }
-
-      }
-
-  if (strcmp("sense", option) == 0 || strcmp("all", option) == 0)
-    {
-      if (pDev[INDEX_CHANGER].SCSI == 1)
-       {
-           g_printf(_("\nSense Status from robot:\n"));
-           RequestSense(INDEX_CHANGER , &ExtRequestSense, 0);
-           DecodeExtSense(&ExtRequestSense, "", out);
-       }
-
-      if (pDev[INDEX_TAPE].SCSI == 1)
-        {
-          g_printf("\n");
-          g_printf(_("Sense Status from tape (tapectl):\n"));
-          RequestSense(INDEX_TAPE, &ExtRequestSense, 0);
-          DecodeExtSense(&ExtRequestSense, "", out);
-        }
-
-      if (pDev[INDEX_TAPECTL].SCSI == 1)
-        {
-          g_printf("\n");
-          g_printf(_("Sense Status from tape (tapectl):\n"));
-          RequestSense(INDEX_TAPECTL, &ExtRequestSense, 0);
-          DecodeExtSense(&ExtRequestSense, "", out);
-        }
-    }
-
-    if (strcmp("ModeSenseRobot", option) == 0 || strcmp("all", option) == 0)
-      {
-        g_printf("\n");
-        if (SCSI_ModeSense(INDEX_CHANGER, pModePage, 0xff, 0x08, 0x3f) == 0)
-          {
-            DecodeModeSense(pModePage, 0, "Changer :" , 0, out);
-          }
-      }
-
-    if (strcmp("ModeSenseTape", option) == 0 || strcmp("all", option) == 0)
-      {
-        if (pDev[INDEX_TAPECTL].SCSI == 1)
-        {
-          g_printf("\n");
-          if (SCSI_ModeSense(INDEX_TAPECTL, pModePage, 0xff, 0x0, 0x3f) == 0)
-            {
-              DecodeModeSense(pModePage, 0, "Tape :" , 1, out);
-            }
-        }
-      }
-
-    if (strcmp("fd", option) == 0 || strcmp("all", option) == 0)
-    {
-      g_printf("changer_dev  %s\n",changer_dev);
-      g_printf("changer_file %s\n", changer_file);
-      g_printf("tape_device  %s\n\n", tape_device);
-      DumpDev(&pDev[INDEX_TAPE], "pTapeDev");
-      DumpDev(&pDev[INDEX_TAPECTL], "pTapeDevCtl");
-      DumpDev(&pDev[INDEX_CHANGER], "pChangerDev");
-    }
-
-  if (GenericClean("") == 1)
-    g_printf(_("Tape needs cleaning\n"));
-
-  free(pbarcoderes);
-  fclose(out);
-}
-
-void
-dump_hex(
-    u_char *   p,
-    size_t     size,
-    int                level,
-    int                section)
-{
-    size_t row_count = 0;
-    int x;
-
-    while (row_count < size)
-    {
-        DebugPrint(level, section,"%02X ", (u_char)p[row_count]);
-        if (((row_count + 1) % 16) == 0)
-          {
-            dbprintf("   ");
-            for (x = 16; x > 0; x--)
-              {
-               if (isalnum((u_char)p[row_count - x + 1 ]))
-                 DebugPrint(level, section,"%c",(u_char)p[row_count - x + 1]);
-               else
-                 DebugPrint(level, section,".");
-             }
-            DebugPrint(level, section,"\n");
-          }
-       row_count++;
-    }
-    DebugPrint(level, section,"\n");
-}
-
-void
-TerminateString(
-    char *     string,
-    size_t     length)
-{
-  ssize_t x;
-
-  for (x = (ssize_t)length; x >= 0 && !isalnum((int)string[x]); x--)
-    string[x] = '\0';
-}
-
-void
-ChgExit(
-    char *     where,
-    char *     reason,
-    int level)
-{
-    (void)level;       /* Quiet unused parameter warning */
-
-   dbprintf(_("ChgExit in %s, reason %s\n"), where, reason);
-   g_fprintf(stderr,"%s\n",reason);
-   exit(2);
-}
-
-/* OK here starts a new set of functions.
- * Every function is for one SCSI command.
- * Prefix is SCSI_ and then the SCSI command name
-*/
-
-/*
- * SCSI_Run is an wrapper arround SCSI_ExecuteCommand
- * It seems to be an good idea to check first if the device
- * is ready for accepting commands, and if this is true send
- * the command
- */
-int
-SCSI_Run(
-    int                        DeviceFD,
-    Direction_T                Direction,
-    CDB_T              CDB,
-    size_t             CDB_Length,
-    void *             DataBuffer,
-    size_t             DataBufferLength,
-    RequestSense_T *   pRequestSense,
-    size_t             RequestSenseLength)
-{
-  int ret = 0;
-  int ok = 0;
-  int maxtries = 0;
-  RequestSense_T *pRqS;
-
-  /* Basic sanity checks */
-  assert(CDB_Length <= UCHAR_MAX);
-  assert(RequestSenseLength <= UCHAR_MAX);
-
-  pRqS = (RequestSense_T *)pRequestSense;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Run TestUnitReady\n"));
-  while (!ok && maxtries < MAXTRIES)
-    {
-      ret = SCSI_TestUnitReady(DeviceFD, (RequestSense_T *)pRequestSense );
-      DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Run TestUnitReady ret %d\n"),ret);
-      switch (ret)
-       {
-       case SCSI_OK:
-         ok=1;
-         break;
-       case SCSI_SENSE:
-         switch (SenseHandler(DeviceFD, 0, pRqS->SenseKey, pRqS->AdditionalSenseCode, pRqS->AdditionalSenseCodeQualifier, pRqS))
-           {
-           case SENSE_NO:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_NO\n"));
-             ok=1;
-             break;
-           case SENSE_TAPE_NOT_ONLINE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
-             ok=1;
-             break;
-           case SENSE_IGNORE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_IGNORE\n"));
-             ok=1;
-             break;
-           case SENSE_ABORT:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_ABORT\n"));
-             return(-1);
-             /*NOTREACHED*/
-           case SENSE_RETRY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_RETRY\n"));
-             break;
-           default:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) default (SENSE)\n"));
-             ok=1;
-             break;
-           }
-         break;
-       case SCSI_ERROR:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_ERROR\n"));
-         return(-1);
-         /*NOTREACHED*/
-       case SCSI_BUSY:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_BUSY\n"));
-         break;
-       case SCSI_CHECK:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_CHECK\n"));
-         break;
-       default:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) unknown (%d)\n"),ret);
-         break;
-       }
-      if (!ok)
-      {
-       sleep(1);
-        maxtries++;
-      }
-    }
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run TestUnitReady after %d sec:\n"),maxtries);
-
-  if (ok != 1)
-    {
-      DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run Exit %d\n"),ret);
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  ok = 0;
-  maxtries = 0;
-  while (!ok && maxtries < MAXTRIES)
-    {
-      ret = SCSI_ExecuteCommand(DeviceFD,
-                               Direction,
-                               CDB,
-                               CDB_Length,
-                               DataBuffer,
-                               DataBufferLength,
-                               pRequestSense,
-                               RequestSenseLength);
-
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run Exit %d\n"),ret);
-      switch (ret)
-       {
-       case SCSI_OK:
-         ok=1;
-         break;
-       case SCSI_SENSE:
-         switch (SenseHandler(DeviceFD, 0, pRqS->SenseKey, pRqS->AdditionalSenseCode, pRqS->AdditionalSenseCodeQualifier, pRqS))
-           {
-           case SENSE_NO:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_NO\n"));
-             ok=1;
-             break;
-           case SENSE_TAPE_NOT_ONLINE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_TAPE_NOT_ONLINE\n"));
-             ok=1;
-             break;
-           case SENSE_IGNORE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_IGNORE\n"));
-             ok=1;
-             break;
-           case SENSE_ABORT:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run SENSE_ABORT\n"));
-             return(-1);
-             /*NOTREACHED*/
-           case SENSE_RETRY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_RETRY\n"));
-             break;
-           default:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run default (SENSE)\n"));
-             ok=1;
-             break;
-           }
-         break;
-       case SCSI_ERROR:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run SCSI_ERROR\n"));
-         return(-1);
-         /*NOTREACHED*/
-       case SCSI_BUSY:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SCSI_BUSY\n"));
-         break;
-       case SCSI_CHECK:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_CHECK\n"));
-         break;
-       default:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) unknown (%d)\n"),ret);
-         break;
-       }
-      maxtries++;
-      sleep(1);
-    }
-
-  if (ok == 1)
-    {
-      return(0);
-      /*NOTREACHED*/
-    }
-  return(-1);
-}
-
-/*
- * This a vendor specific command !!!!!!
- * First seen at AIT :-)
- */
-int
-SCSI_AlignElements(
-    int                DeviceFD,
-    size_t     AE_MTE,
-    size_t     AE_DTE,
-    size_t     AE_STE)
-{
-  RequestSense_T *pRequestSense;
-  int retry;
-  CDB_T CDB;
-  int ret;
-  int i;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_AlignElements\n"));
-
-  pRequestSense = alloc(SIZEOF(RequestSense_T));
-
-  for (retry = 0; retry < MAX_RETRIES; retry++)
-    {
-      CDB[0]  = 0xE5;
-      CDB[1]  = 0;
-      MSB2(&CDB[2],AE_MTE);    /* Which MTE to use, default 0 */
-      MSB2(&CDB[4],AE_DTE);    /* Which DTE to use, no range check !! */
-      MSB2(&CDB[6],AE_STE);    /* Which STE to use, no range check !! */
-      CDB[8]  = 0;
-      CDB[9]  = 0;
-      CDB[10] = 0;
-      CDB[11] = 0;
-
-      ret = SCSI_Run(DeviceFD, Input, CDB, 12,
-                                NULL, 0, pRequestSense, SIZEOF(RequestSense_T));
-
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : SCSI_Run = %d\n"), ret);
-      DecodeSense(pRequestSense, _("SCSI_AlignElements :"),debug_file);
-
-      if (ret < 0)
-        {
-          DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("%s: Request Sense[Inquiry]: %02X"),
-                    "chs", ((u_char *) &pRequestSense)[0]);
-          for (i = 1; i < (int)sizeof(RequestSense_T); i++)
-            DebugPrint(DEBUG_ERROR, SECTION_SCSI," %02X", ((u_char *) &pRequestSense)[i]);
-          DebugPrint(DEBUG_ERROR, SECTION_SCSI,"\n");
-          return(ret);
-         /*NOTREACHED*/
-        }
-      if ( ret > 0)
-        {
-          switch(SenseHandler(DeviceFD, 0 , pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-            {
-            case SENSE_IGNORE:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : SENSE_IGNORE\n"));
-              return(0);
-              /*NOTREACHED*/
-            case SENSE_RETRY:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : SENSE_RETRY no %d\n"), retry);
-              break;
-            case SENSE_ABORT:
-              DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_AlignElements : SENSE_ABORT\n"));
-              return(-1);
-              /*NOTREACHED*/
-            case SENSE_TAPE_NOT_UNLOADED:
-              DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_AlignElements : Tape still loaded, eject failed\n"));
-              return(-1);
-              /*NOTREACHED*/
-            default:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : end %d\n"), pRequestSense->SenseKey);
-              return(pRequestSense->SenseKey);
-              /*NOTREACHED*/
-            }
-        }
-      if (ret == 0)
-        {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : end %d\n"), ret);
-          return(ret);
-         /*NOTREACHED*/
-        }
-    }
-  DebugPrint(DEBUG_ERROR, SECTION_SCSI,
-           _("SCSI_AlignElements: Retries exceeded = %d\n"), retry);
-  return(-1);
-}
-
-
-int
-SCSI_Move(
-    int                DeviceFD,
-    u_char     chm,
-    int                from,
-    int                to)
-{
-  RequestSense_T *pRequestSense;
-  int retry;
-  CDB_T CDB;
-  int ret = -1;
-  int i;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_Move\n"));
-
-  pRequestSense = alloc(SIZEOF(RequestSense_T));
-
-  for (retry = 0; (ret != 0) && (retry < MAX_RETRIES); retry++)
-    {
-      CDB[0]  = SC_MOVE_MEDIUM;
-      CDB[1]  = 0;
-      CDB[2]  = 0;
-      CDB[3]  = chm;     /* Address of CHM */
-      MSB2(&CDB[4],from);
-      MSB2(&CDB[6],to);
-      CDB[8]  = 0;
-      CDB[9]  = 0;
-      CDB[10] = 0;
-      CDB[11] = 0;
-
-      ret = SCSI_Run(DeviceFD, Input, CDB, 12,
-                                NULL, 0, pRequestSense, SIZEOF(RequestSense_T));
-
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Move : SCSI_Run = %d\n"), ret);
-      DecodeSense(pRequestSense, _("SCSI_Move :"),debug_file);
-
-      if (ret < 0)
-        {
-          DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("%s: Request Sense[Inquiry]: %02X"),
-                    "chs", ((u_char *) &pRequestSense)[0]);
-          for (i = 1; i < (int)sizeof(RequestSense_T); i++)
-            DebugPrint(DEBUG_ERROR, SECTION_SCSI," %02X", ((u_char *) &pRequestSense)[i]);
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"\n");
-          return(ret);
-         /*NOTREACHED*/
-        }
-      if ( ret > 0)
-        {
-          switch(SenseHandler(DeviceFD,  0 , pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-            {
-            case SENSE_IGNORE:
-              dbprintf(_("SCSI_Move : SENSE_IGNORE\n"));
-              return(0);
-              /*NOTREACHED*/
-            case SENSE_RETRY:
-              dbprintf(_("SCSI_Move : SENSE_RETRY no %d\n"), retry);
-              break;
-            case SENSE_ABORT:
-              dbprintf(_("SCSI_Move : SENSE_ABORT\n"));
-              return(-1);
-              /*NOTREACHED*/
-            case SENSE_TAPE_NOT_UNLOADED:
-              dbprintf(_("SCSI_Move : Tape still loaded, eject failed\n"));
-              return(-1);
-              /*NOTREACHED*/
-            default:
-              dbprintf(_("SCSI_Move : end %d\n"), pRequestSense->SenseKey);
-              return(pRequestSense->SenseKey);
-              /*NOTREACHED*/
-            }
-        }
-    }
-  dbprintf(_("SCSI_Move : end %d\n"), ret);
-  return(ret);
-}
-
-int
-SCSI_LoadUnload(
-    int                        DeviceFD,
-    RequestSense_T *   pRequestSense,
-    u_char             byte1,
-    u_char             load)
-{
-  CDB_T CDB;
-  int ret;
-
-  dbprintf(_("##### START SCSI_LoadUnload\n"));
-
-  CDB[0] = SC_COM_UNLOAD;
-  CDB[1] = byte1;
-  CDB[2] = 0;
-  CDB[3] = 0;
-  CDB[4] = load;
-  CDB[5] = 0;
-
-
-  ret = SCSI_Run(DeviceFD, Input, CDB, 6,
-                            NULL, 0,
-                            pRequestSense,
-                            SIZEOF(RequestSense_T));
-
-  if (ret < 0)
-    {
-      dbprintf(_("SCSI_Unload : failed %d\n"), ret);
-      return(-1);
-      /*NOTREACHED*/
-    }
-
-  dbprintf(_("##### STOP SCSI_LoadUnload\n"));
-  return(ret);
-}
-
-int
-SCSI_TestUnitReady(
-    int                        DeviceFD,
-    RequestSense_T *   pRequestSense)
-{
-  CDB_T CDB;
-  int ret;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_TestUnitReady\n"));
-
-  CDB[0] = SC_COM_TEST_UNIT_READY;
-  CDB[1] = 0;
-  CDB[2] = 0;
-  CDB[3] = 0;
-  CDB[4] = 0;
-  CDB[5] = 0;
-
-  ret = SCSI_ExecuteCommand(DeviceFD, Input, CDB, 6,
-                      NULL, (size_t)0,
-                      pRequestSense,
-                      SIZEOF(RequestSense_T));
-
-  /*
-   * We got an error, so let the calling function handle this
-   */
-  if (ret > 0)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady (1)\n"));
-      return(ret);
-      /*NOTREACHED*/
-    }
-
-  /*
-   * OK, no error condition
-   * If no sense is set, the Unit is ready
-   */
-  if (pRequestSense->ErrorCode == 0 && pRequestSense->SenseKey == 0)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady (1)\n"));
-      return(0);
-      /*NOTREACHED*/
-    }
-
-  /*
-   * Some sense is set
-   */
-  if (pRequestSense->ErrorCode != 0){
-    DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady ErrorCode set\n"));
-  }
-  if (pRequestSense->SenseKey != 0) {
-    DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady Sense Key set\n"));
-  }
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady (0)\n"));
-  return(SCSI_SENSE);
-}
-
-
-int
-SCSI_ModeSelect(
-    int                DeviceFD,
-    u_char *   buffer,
-    u_char     length,
-    u_char     save,
-    u_char     mode,
-    u_char     lun)
-{
-  CDB_T CDB;
-  RequestSense_T *pRequestSense;
-  int ret = -1;
-  int retry;
-  u_char *sendbuf;
-
-  dbprintf(_("##### START SCSI_ModeSelect\n"));
-
-  dbprintf(_("SCSI_ModeSelect start length = %u:\n"), (unsigned)length);
-  pRequestSense = alloc(SIZEOF(RequestSense_T));
-  sendbuf = alloc((size_t)length + 4);
-  memset(sendbuf, 0 , (size_t)length + 4);
-
-  memcpy(&sendbuf[4], buffer, (size_t)length);
-  dump_hex(sendbuf, (size_t)length+4, DEBUG_INFO, SECTION_SCSI);
-
-  for (retry = 0; (ret != 0) && (retry < MAX_RETRIES); retry++)
-    {
-      memset(pRequestSense, 0, SIZEOF(RequestSense_T));
-
-      CDB[0] = SC_COM_MODE_SELECT;
-      CDB[1] = (u_char)(((lun << 5) & 0xF0) | ((mode << 4) & 0x10) | (save & 1));
-      CDB[2] = 0;
-      CDB[3] = 0;
-      CDB[4] = (u_char)(length + 4);
-      CDB[5] = 0;
-      ret = SCSI_Run(DeviceFD, Output, CDB, 6,
-                                sendbuf,
-                                (size_t)length + 4,
-                                pRequestSense,
-                                SIZEOF(RequestSense_T));
-      if (ret < 0)
-        {
-          dbprintf(_("SCSI_ModeSelect : ret %d\n"), ret);
-         goto done;
-          /*NOTREACHED*/
-        }
-
-      if ( ret > 0)
-        {
-          switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey,
-                             pRequestSense->AdditionalSenseCode,
-                             pRequestSense->AdditionalSenseCodeQualifier,
-                             pRequestSense))
-            {
-            case SENSE_IGNORE:
-              dbprintf(_("SCSI_ModeSelect : SENSE_IGNORE\n"));
-             goto done;
-              /*NOTREACHED*/
-
-            case SENSE_RETRY:
-              dbprintf(_("SCSI_ModeSelect : SENSE_RETRY no %d\n"), retry);
-              break;
-
-            default:
-             ret = pRequestSense->SenseKey;
-             goto end;
-            }
-        }
-    }
-end:
-  dbprintf(_("SCSI_ModeSelect end: %d\n"), ret);
-
-done:
-  free(pRequestSense);
-  free(sendbuf);
-  return(ret);
-}
-
-
-
-int
-SCSI_ModeSense(
-    int                DeviceFD,
-    u_char *   buffer,
-    u_char     size,
-    u_char     byte1,
-    u_char     byte2)
-{
-  CDB_T CDB;
-  RequestSense_T *pRequestSense;
-  int ret = 1;
-  int retry = 1;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_ModeSense\n"));
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense start length = %d:\n"), size);
-  pRequestSense = alloc(SIZEOF(RequestSense_T));
-
-  while (ret && retry < MAX_RETRIES)
-    {
-      memset(pRequestSense, 0, SIZEOF(RequestSense_T));
-      memset(buffer, 0, size);
-
-      CDB[0] = SC_COM_MODE_SENSE;
-      CDB[1] = byte1;
-      CDB[2] = byte2;
-      CDB[3] = 0;
-      CDB[4] = size;
-      CDB[5] = 0;
-      ret = SCSI_Run(DeviceFD, Input, CDB, 6,
-                                buffer,
-                                size,
-                                pRequestSense,
-                                SIZEOF(RequestSense_T));
-      if (ret < 0)
-        {
-          return(ret);
-         /*NOTREACHED*/
-        }
-
-      if ( ret > 0)
-        {
-          switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-            {
-            case SENSE_IGNORE:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_IGNORE\n"));
-              return(0);
-              /*NOTREACHED*/
-            case SENSE_RETRY:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_RETRY no %d\n"), retry);
-              break;
-            default:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : end %d\n"), pRequestSense->SenseKey);
-              return(pRequestSense->SenseKey);
-              /*NOTREACHED*/
-            }
-        }
-      retry++;
-    }
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense end: %d\n"), ret);
-  return(ret);
-}
-
-int
-SCSI_Inquiry(
-    int                        DeviceFD,
-    SCSIInquiry_T *    buffer,
-    size_t             size)
-{
-  CDB_T CDB;
-  RequestSense_T *pRequestSense;
-  int i;
-  int ret = -1;
-  int retry = 1;
-
-  assert(size <= UCHAR_MAX);
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI, _("##### START SCSI_Inquiry\n"));
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Inquiry start length = %d:\n"), size);
-
-  pRequestSense = alloc((size_t)size);
-
-  while (retry > 0 && retry < MAX_RETRIES)
-    {
-      memset(buffer, 0, size);
-      CDB[0] = SC_COM_INQUIRY;
-      CDB[1] = 0;
-      CDB[2] = 0;
-      CDB[3] = 0;
-      CDB[4] = (u_char)size;
-      CDB[5] = 0;
-
-      ret = SCSI_ExecuteCommand(DeviceFD, Input, CDB, 6,
-                                buffer,
-                                size,
-                                pRequestSense,
-                                SIZEOF(RequestSense_T));
-      if (ret < 0)
-        {
-          DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("%s: Request Sense[Inquiry]: %02X"),
-                    "chs", ((u_char *) pRequestSense)[0]);
-          for (i = 1; i < (int)sizeof(RequestSense_T); i++)
-            DebugPrint(DEBUG_ERROR, SECTION_SCSI," %02X", ((u_char *) pRequestSense)[i]);
-          DebugPrint(DEBUG_ERROR, SECTION_SCSI, "\n");
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("Inquiry end: %d\n"), ret);
-         return(ret);
-         /*NOTRACHED*/
-        }
-      if ( ret > 0)
-        {
-          switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-            {
-            case SENSE_IGNORE:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Inquiry : SENSE_IGNORE\n"));
-              return(0);
-              /*NOTREACHED*/
-            case SENSE_RETRY:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Inquiry : SENSE_RETRY no %d\n"), retry);
-              break;
-            default:
-              DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("SCSI_Inquiry : end %d\n"), pRequestSense->SenseKey);
-              return(pRequestSense->SenseKey);
-              /*NOTREACHED*/
-            }
-        }
-      retry++;
-      if (ret == 0)
-        {
-          dump_hex((u_char *)buffer, size, DEBUG_INFO, SECTION_SCSI);
-          DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Inquiry : end %d\n"), ret);
-          return(ret);
-         /*NOTRACHED*/
-        }
-    }
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Inquiry end: %d\n"), ret);
-  return(ret);
-}
-
-/*
- * Read the Element Status. If DescriptorSize  != 0 then
- * allocate DescriptorSize * NoOfElements for the result from the
- * Read Element Status command.
- * If DescriptorSize == 0 than try to figure out how much space is needed
- * by
- * 1. do an read with an allocation size of 8
- * 2. from the result take the 'Byte Count of Descriptor Available'
- * 3. do again an Read Element Status with the result from 2.
- *
- */
-int
-SCSI_ReadElementStatus(
-    int                DeviceFD,
-    u_char     type,
-    u_char     lun,
-    u_char     VolTag,
-    int                StartAddress,
-    size_t     NoOfElements,
-    size_t     DescriptorSize,
-    u_char **  data)
-{
-  CDB_T CDB;
-  size_t DataBufferLength;
-  ElementStatusData_T *ElementStatusData;
-  RequestSense_T *pRequestSense;
-  int retry = 1;
-  int ret = -1;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_ReadElementStatus\n"));
-
-  pRequestSense = alloc(SIZEOF(RequestSense_T));
-
-  /*
-   * How many elements, if <= 0 than exit with an fatal error
-   */
-  if (NoOfElements == 0)
-    {
-      ChgExit("SCSI_ReadElementStatus",_("No of Elements passed are le 0"),FATAL);
-      /*NOTREACHED*/
-    }
-
-  VolTag = (u_char)((VolTag << 4) & 0x10);
-  type = (u_char)(type & 0xf);
-  lun = (u_char)((lun << 5) & 0xe0);
-
-  /* if  DescriptorSize == 0
-   * try to get the allocation length for the second call
-   */
-  if (DescriptorSize == 0)
-    {
-      *data = newalloc(*data, 8);
-      memset(*data, 0, 8);
-
-      while (retry > 0 && retry < MAX_RETRIES)
-       {
-         memset(pRequestSense, 0, SIZEOF(RequestSense_T) );
-
-         CDB[0] = SC_COM_RES;          /* READ ELEMENT STATUS */
-         CDB[1] = (u_char)(VolTag | type | lun); /* Element Type Code , VolTag, LUN */
-         MSB2(&CDB[2], StartAddress);  /* Starting Element Address */
-         MSB2(&CDB[4], NoOfElements);  /* Number Of Element */
-         CDB[6] = 0;                             /* Reserved */
-         MSB3(&CDB[7],8);                   /* Allocation Length */
-         CDB[10] = 0;                           /* Reserved */
-         CDB[11] = 0;                           /* Control */
-
-         ret = SCSI_Run(DeviceFD, Input, CDB, 12,
-                        *data, 8,
-                        pRequestSense, SIZEOF(RequestSense_T));
-
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ReadElementStatus : (1) SCSI_Run %d\n"), ret);
-         if (ret < 0)
-           {
-             DecodeSense(pRequestSense, "SCSI_ReadElementStatus :",debug_file);
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret);
-             return(ret);
-             /*NOTRACHED*/
-           }
-         if ( ret > 0)
-           {
-             switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-               {
-               case SENSE_IGNORE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_IGNORE\n"));
-                 retry = 0;
-                 break;
-               case SENSE_RETRY:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_RETRY no %d\n"), retry);
-                 sleep(2);
-                 break;
-               default:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : end %d\n"), pRequestSense->SenseKey);
-                 return(pRequestSense->SenseKey);
-                 /*NOTREACHED*/
-               }
-           }
-         retry++;
-         if (ret == 0)
-           {
-             retry=0;
-           }
-       }
-      if (retry > 0)
-       {
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret);
-         return(ret);
-         /*NOTRACHED*/
-       }
-
-      ElementStatusData = (ElementStatusData_T *)*data;
-      DataBufferLength = V3(ElementStatusData->count);
-
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ReadElementStatus: DataBufferLength %X, ret %d\n"),DataBufferLength, ret);
-
-      dump_hex(*data, 8, DEBUG_INFO, SECTION_ELEMENT);
-    } else { /* DescriptorSize != 0 */
-      DataBufferLength = NoOfElements * DescriptorSize;
-    }
-
-  DataBufferLength = DataBufferLength + 8;
-  *data = newalloc(*data, DataBufferLength);
-  memset(*data, 0, DataBufferLength);
-  retry = 1;
-
-  while (retry > 0 && retry < MAX_RETRIES)
-    {
-      memset(pRequestSense, 0, SIZEOF(RequestSense_T) );
-
-      CDB[0] = SC_COM_RES;           /* READ ELEMENT STATUS */
-      CDB[1] = (u_char)(VolTag | type | lun);  /* Element Type Code, VolTag, LUN */
-      MSB2(&CDB[2], StartAddress);   /* Starting Element Address */
-      MSB2(&CDB[4], NoOfElements);   /* Number Of Element */
-      CDB[6] = 0;                              /* Reserved */
-      MSB3(&CDB[7],DataBufferLength);  /* Allocation Length */
-      CDB[10] = 0;                                 /* Reserved */
-      CDB[11] = 0;                                 /* Control */
-
-      ret = SCSI_Run(DeviceFD, Input, CDB, 12,
-                                *data, DataBufferLength,
-                                pRequestSense, SIZEOF(RequestSense_T));
-
-
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ReadElementStatus : (2) SCSI_Run %d\n"), ret);
-      if (ret < 0)
-        {
-          DecodeSense(pRequestSense, _("SCSI_ReadElementStatus :"),debug_file);
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret);
-          return(ret);
-         /*NOTRACHED*/
-        }
-      if ( ret > 0)
-        {
-          switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
-            {
-            case SENSE_IGNORE:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_IGNORE\n"));
-              retry = 0;
-              break;
-            case SENSE_RETRY:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_RETRY no %d\n"), retry);
-              sleep(2);
-              break;
-            default:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : end %d\n"), pRequestSense->SenseKey);
-              return(pRequestSense->SenseKey);
-              /*NOTREACHED*/
-            }
-        }
-      retry++;
-      if (ret == 0)
-        {
-          retry=0;
-        }
-    }
-
-  if (retry > 0)
-    {
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret);
-      return(ret);
-      /*NOTRACHED*/
-    }
-
-  dump_hex(*data, DataBufferLength, DEBUG_INFO, SECTION_SCSI);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret);
-  return(ret);
-}
-
-printf_arglist_function2(void DebugPrint, int, level, int, section, char *, fmt)
-{
-  va_list argp;
-  char buf[1024];
-  int dlevel;
-  int dsection = -1;
-  time_t ti = time(NULL);
-
-  if (changer->debuglevel)
-    {
-      if (sscanf(changer->debuglevel,"%d:%d", &dlevel, &dsection) != 2) {
-       dbprintf(_("Parse error: line is '%s' expected [0-9]*:[0-9]*\n"),
-                 changer->debuglevel);
-        dlevel=1;
-        dsection=1;
-      }
-    } else {
-      dlevel=1;
-      dsection=1;
-    }
-
-  arglist_start(argp, fmt);
-  g_vsnprintf(buf, SIZEOF(buf), fmt, argp);
-  if (dlevel >= level)
-    {
-      if (section == dsection || dsection == 0)
-       {
-         if (strchr(buf, '\n') != NULL && strlen(buf) > 1)
-          {
-            dbprintf(_("%ld:%s"), (long)ti, buf);
-         } else {
-            dbprintf("%s", buf);
-         }
-       }
-    }
-  arglist_end(argp);
-}
diff --git a/changer-src/scsi-chio.c b/changer-src/scsi-chio.c
deleted file mode 100644 (file)
index 32c3dbb..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- *     $Id: scsi-chio.c,v 1.14 2006/05/25 01:47:07 johnfranks Exp $
- *
- *     scsi-chio.c -- library routines to handle the changer
- *                     support for chio based systems
- *
- *     Author: Eric Schnoebelen, eric@cirr.com
- *     based on work by: Larry Pyeatt,  pyeatt@cs.colostate.edu 
- *     Copyright: 1997, 1998 Eric Schnoebelen
- *
- *     Patch: Michael Enkelis, michaele@mxim.com)
- */
-
-#include "config.h"
-#include "amanda.h"
-
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/mtio.h>
-
-/* This include comes with Gerd Knor's SCSI media changer driver.
- * If you are porting to another system, this is the file that defines
- * ioctl calls for the changer.  You will have to track it down yourself
- * and possibly change all the ioctl() calls in this program.  
- */
-
-#if defined(HAVE_LINUX_CHIO_H)
-#  include <linux/chio.h>
-#else
-# if defined(HAVE_CHIO_H)
-#   include <chio.h>
-# else /* HAVE_SYS_CHIO_H must be defined */
-#   include <sys/chio.h>
-# endif        /* HAVE_CHIO_H */
-#endif  /* HAVE_LINUX_CHIO_H */
-
-char *modname = "@(#)" __FILE__ 
-               ": SCSI support library for the chio(2) interface @(#)";
-
-/*
- * cache the general changer information, for faster access elsewhere
- */
-static struct changer_params changer_info;
-static int changer_info_init = 0;
-int GetCurrentSlot(int fd, int drive);
-int GetDeviceStatus (char *tapedev);
-int OpenDevice (char *tapedev);
-int CloseDevice (char *device, int DeviceFD);
-int Tape_Ready1 ( char *tapedev , int wait);
-int isempty(int fd, int slot);
-int find_empty(int fd, int start, int count);
-int get_clean_state(char *tapedev);
-int get_slot_count(int fd);
-int get_drive_count(int fd);
-int eject_tape(char *tapedev);
-int drive_loaded(int fd, int drivenum);
-int unload(int fd, int drive, int slot);
-int load(int fd, int drive, int slot);
-
-static int get_changer_info(int fd)
-{
-int rc = 0;
-
-    if ( !changer_info_init ) {
-       rc = ioctl(fd, CHIOGPARAMS, &changer_info);
-       changer_info_init++;
-    }
-    return (rc);
-}
-
-/* Get the number of the first free slot
- * return > 0 number of empty slot
- * return = 0 no slot free
- * return < 0 error
- */
-int GetCurrentSlot(int fd, int drive)
-{
-    struct changer_element_status  ces;
-    int slot;
-    int i, rc;
-
-    (void)drive;
-
-    get_changer_info(fd);
-
-    ces.ces_type = CHET_ST;
-    ces.ces_data = malloc(changer_info.cp_nslots);
-
-    rc = ioctl(fd, CHIOGSTATUS, &ces);
-    if (rc) {
-       dbprintf(_("changer status query failed: 0x%x %s\n"), rc, strerror(errno));
-       return -1;
-    }
-    for (slot = 0; slot < changer_info.cp_nslots; slot++)
-    {
-       i = ces.ces_data[slot] & CESTATUS_FULL;
-       dbprintf(_("\tGetCurrentSlot slot %d = %d\n"), slot, i);
-       if (!i)
-            return(slot);
-    }
-    return -1;
-}
-
-int get_clean_state(char *tapedev)
-{
-int rc;
-#if defined(BUILTIN)
-    rc = 0;
-#else
-#define GMT_CLN(x)     ((x) & 0x00008000)
-    rc = ( GMT_CLN(GetDeviceStatus(tapedev)) );
-#endif /* BUILTIN */
-    return rc;
-}
-
-int eject_tape(char *tapedev)
-/* This function ejects the tape from the drive */
-{
-int mtfd;
-struct mtop mt_com;
-
-    if ( (mtfd = OpenDevice(tapedev) ) < 0) {
-        dbprintf(_("eject_tape : failed\n"));
-        perror(tapedev);
-        exit(2);
-    }
-    mt_com.mt_op = MTOFFL;
-    mt_com.mt_count = 1;
-    if (ioctl(mtfd, MTIOCTOP, (char *)&mt_com) < 0) {
-/*
-    If the drive already ejected the tape due an error, or because it
-    was a cleaning tape, threre can be an error, which we should ignore 
-
-       perror(tapedev);
-       exit(2);
-*/
-    }
-    return(CloseDevice(tapedev, mtfd));
-}
-
-
-/* 
- * this routine checks a specified slot to see if it is empty 
- */
-int isempty(int fd, int slot)
-{
-struct changer_element_status  ces;
-int                            i,rc;
-int type=CHET_ST;
-
-    get_changer_info(fd);
-
-    ces.ces_type = type;
-    ces.ces_data = malloc(changer_info.cp_nslots);
-
-    rc = ioctl(fd, CHIOGSTATUS, &ces);
-    if (rc) {
-       dbprintf(_("changer status query failed: 0x%x %s\n"), rc,strerror(errno));
-       return -1;
-    }
-
-    i = ces.ces_data[slot] & CESTATUS_FULL;
-
-    free(ces.ces_data);
-    return !i;
-}
-
-/*
- * find the first empty slot 
- */
-int find_empty(int fd, int start, int count)
-{
-struct changer_element_status  ces;
-int                            i,rc;
-int type=CHET_ST;
-
-    (void)start;
-    (void)count;
-
-    get_changer_info(fd);
-
-    ces.ces_type = type;
-    ces.ces_data = malloc(changer_info.cp_nslots);
-
-    rc = ioctl(fd,CHIOGSTATUS,&ces);
-    if (rc) {
-       dbprintf(_("changer status query failed: 0x%x %s\n"), rc, strerror(errno));
-       return -1;
-    }
-
-    i = 0; 
-    while ((i < changer_info.cp_nslots)&&(ces.ces_data[i] & CESTATUS_FULL))
-       i++;
-    free(ces.ces_data);
-    return i;
-}
-
-/*
- * returns one if there is a tape loaded in the drive 
- */
-int drive_loaded(int fd, int drivenum)
-{
-struct changer_element_status  ces;
-int                            i,rc;
-int type=CHET_DT;
-
-    get_changer_info(fd);
-
-    ces.ces_type = type;
-    ces.ces_data = malloc(changer_info.cp_ndrives);
-
-    rc = ioctl(fd, CHIOGSTATUS, &ces);
-    if (rc) {
-       dbprintf(_("drive status query failed: 0x%x %s\n"), rc, strerror(errno));
-       return -1;
-    }
-
-    i = (ces.ces_data[drivenum] & CESTATUS_FULL);
-
-    free(ces.ces_data);
-    return i;
-}
-
-
-/*
- * unloads the drive, putting the tape in the specified slot 
- */
-int unload(int fd, int drive, int slot)
-{
-struct changer_move  move;
-int rc;
-
-    dbprintf(_("unload : fd = %d, drive = %d, slot =%d\n"),fd, drive, slot);
-
-    move.cm_fromtype = CHET_DT;
-    move.cm_fromunit = drive;
-    move.cm_totype = CHET_ST;
-    move.cm_tounit = slot;
-    move.cm_flags = 0;
-
-    rc = ioctl(fd, CHIOMOVE, &move);
-    if (rc){
-       dbprintf(_("drive unload failed (MOVE): 0x%x %s\n"), rc, strerror(errno));
-       return(-2);
-    }
-    return 0;
-}
-
-
-/*
- * moves tape from the specified slot into the drive 
- */
-int load(int fd, int drive, int slot)
-{
-struct changer_move  move;
-int rc;
-
-    dbprintf(_("load : fd = %d, drive = %d, slot =%d\n"),fd, drive, slot);
-
-    move.cm_fromtype = CHET_ST;
-    move.cm_fromunit = slot;
-    move.cm_totype = CHET_DT;
-    move.cm_tounit = drive;
-    move.cm_flags = 0;
-
-    rc = ioctl(fd,CHIOMOVE,&move);
-    if (rc){
-       dbprintf(_("drive load failed (MOVE): 0x%x %s\n"), rc, strerror(errno));
-       return(-2);
-    }
-    return(0);
-}
-
-int get_slot_count(int fd)
-{ 
-int rc;
-
-    rc = get_changer_info(fd);
-    if (rc) {
-        dbprintf(_("slot count query failed: 0x%x %s\n"), rc, strerror(errno));
-        return -1;
-    }
-
-    return changer_info.cp_nslots;
-}
-
-int get_drive_count(int fd)
-{ 
-int rc;
-
-    rc = get_changer_info(fd);
-    if (rc) {
-        dbprintf(_("drive count query failed: 0x%x %s\n"), rc, strerror(errno));
-        return -1;
-    }
-
-    return changer_info.cp_ndrives;
-}
-
-/* This function should ask the drive if it is ready */
-int Tape_Ready1 ( char *tapedev , int wait)
-#if defined(BUILTIN)
-{
-  FILE *out=NULL;
-  int cnt=0;
-  
-  while ((cnt < wait) && (NULL==(out=fopen(tapedev,"w+")))){
-    cnt++;
-    sleep(1);
-  }
-  if (out != NULL)
-    fclose(out);
-  return 0;
-}
-
-#else
-{
-  int cnt=0;
-
-  dbprintf(_("Tape_Ready1 : wait for BOT : max %d seconds\n"),wait);
-  /* loop on status BOT */
-  while ((cnt < wait)) {
-    if ( GMT_BOT(GetDeviceStatus(tapedev)) ) {
-     break;
-    }
-    /* dbprintf(("Tape_Ready1 : cnt %d\n",cnt)); */
-    cnt++;
-    sleep(1);
-  }
-  if (cnt >= wait) {
-   dbprintf(_("Tape_Ready1 : BOT not found : %d seconds\n"),cnt);
-   return(-1);
-  } else {
-   dbprintf(_("Tape_Ready1 : BOT : %d seconds\n"),cnt);
-  return 0;
-  }
-}
-#endif /* BUILTIN */
-
-int GetDeviceStatus (char *tapedev)
-{
-  struct mtget status;
-  int mtfd, rc;
-
-  mtfd = OpenDevice(tapedev);
-  ioctl (mtfd, MTIOCGET, (char *)&status);
-  CloseDevice(tapedev, mtfd);
-  rc = status.mt_gstat;
-  return rc;
-}
-
-int OpenDevice (char *tapedev)
-{
-  int DeviceFD;
-
-  DeviceFD = open(tapedev, O_RDWR);
-  return DeviceFD;
-}
-
-int CloseDevice (char *device, int DeviceFD)
-{
-   int rc;
-
-   dbprintf(_("CloseDevice(%s)\n"), device);
-   rc = close(DeviceFD);
-
-   return rc;
-}
-
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-default-style: gnu
- * End:
- */
diff --git a/changer-src/scsi-defs.h b/changer-src/scsi-defs.h
deleted file mode 100644 (file)
index b32a180..0000000
+++ /dev/null
@@ -1,1207 +0,0 @@
-
-/*
- * Copyright (c) 1998 T.Hepper
- */
-#ifndef SCSIDEFS_H
-#define SCSIDEFS_H
-
-#ifndef WORDS_BIGENDIAN
-#define LITTLE_ENDIAN_BITFIELDS
-#endif
-
-typedef enum { Input, Output } Direction_T; 
-typedef unsigned char CDB_T[12];
-
-#ifdef _AIX
-typedef unsigned int PackedBit;
-#define AIX_USE_GSC 1
-#else
-typedef unsigned char PackedBit;
-#endif
-
-#define INDEX_CHANGER 0
-#define INDEX_TAPE 1
-#define INDEX_TAPECTL 2
-
-#define CHG_MAXDEV 32          /* Maximum number of devices handled by pDev */
-                               /* Must be large to hold the result of ScanBus */
-
-#define TAPETYPE 4
-#define IMPORT 3
-#define STORAGE 2
-#define CHANGER 1
-
-#define TAG_SIZE 36
-#define MAXTRIES 100  /* How many tries until SCSI_TestUnitReady should return an ok */
-/*
- * Sense Key definitions
-*/
-#define SENSE_NULL 0
-#define SENSE_RECOVERED_ERROR 1
-#define NOT_READY 2
-#define SENSE_NOT_READY 2
-#define SENSE_MEDIUM_ERROR 3
-#define SENSE_HARDWARE_ERROR 4
-#define HARDWARE_ERROR 4
-#define ILLEGAL_REQUEST 5
-#define SENSE_ILLEGAL_REQUEST 5
-#define UNIT_ATTENTION 6
-#define SENSE_UNIT_ATTENTION 6
-#define SENSE_DATA_PROTECT 7
-#define SENSE_BLANK_CHECK 8
-#define SENSE_VENDOR_SPECIFIC 0x9
-#define SENSE_ABORTED_COMMAND 0xb
-#define SENSE_VOLUME_OVERFLOW 0xd
-#define SENSE_CHG_ELEMENT_STATUS 0xe
-
-#define MAX_RETRIES 100
-
-#define INQUIRY_SIZE SIZEOF(SCSIInquiry_T)
-
-/*
- * Return values from the OS dependent part
- * of the SCSI interface
- *
- * The underlaying functions must decide what to do
- */
-#define SCSI_ERROR -1
-#define SCSI_OK 0
-#define SCSI_SENSE 1
-#define SCSI_BUSY 2
-#define SCSI_CHECK 3
-
-
-/*
- *  SCSI Commands
-*/
-#define SC_COM_TEST_UNIT_READY 0
-#define SC_COM_REWIND 0x1
-#define SC_COM_REQUEST_SENSE 0x3
-#define SC_COM_IES 0x7
-#define SC_COM_INQUIRY 0x12
-#define SC_COM_MODE_SELECT 0x15
-#define SC_COM_ERASE 0x19
-#define SC_COM_MODE_SENSE 0x1A
-#define SC_COM_UNLOAD 0x1B
-#define SC_COM_LOCATE 0x2B
-#define SC_COM_LOG_SELECT 0x4C
-#define SC_COM_LOG_SENSE 0x4d
-#define SC_MOVE_MEDIUM 0xa5
-#define SC_COM_RES 0xb8
-/*
- * Define for LookupDevice
- */
-#define LOOKUP_NAME 1
-#define LOOKUP_FD 2
-#define LOOKUP_TYPE 3
-#define LOOKUP_CONFIG 4
-/* 
- * Define for the return codes from SenseHandler
- */
-#define SENSE_ABORT -1
-#define SENSE_IGNORE 0
-#define SENSE_RETRY 2
-#define SENSE_IES 3
-#define SENSE_TAPE_NOT_ONLINE 4
-#define SENSE_TAPE_NOT_LOADED 5
-#define SENSE_NO 6
-#define SENSE_TAPE_NOT_UNLOADED 7
-#define SENSE_CHM_FULL 8
-/*
- * Defines for the type field in the inquiry command
- */
-#define TYPE_DISK 0
-#define TYPE_TAPE 1
-#define TYPE_PRINTER 2
-#define TYPE_PROCESSOR 3
-#define TYPE_WORM 4
-#define TYPE_CDROM 5
-#define TYPE_SCANNER 6
-#define TYPE_OPTICAL 7
-#define TYPE_CHANGER 8
-#define TYPE_COMM 9
-
-/* Defines for Tape_Status */
-#define TAPE_ONLINE 1        /* Tape is loaded */
-#define TAPE_BOT 2           /* Tape is at begin of tape */
-#define TAPE_EOT 4           /* Tape is at end of tape */
-#define TAPE_WR_PROT 8       /* Tape is write protected */
-#define TAPE_NOT_LOADED 16   /* Tape is not loaded */
-
-/* Defines for the function Tape_Ioctl */
-#define IOCTL_EJECT 0
-
-/* Defines for exit status */
-#define WARNING 1
-#define FATAL  2
-
-/* macros for building scsi msb array parameter lists */
-#ifndef B
-#define B(s,i) ((unsigned char)(((s) >> (i)) & 0xff))
-#endif
-#ifndef B1
-#define B1(s)  ((unsigned char)((s) & 0xff))
-#endif
-#define B2(s)                       B((s),8),   B1(s)
-#define B3(s)            B((s),16), B((s),8),   B1(s)
-#define B4(s) B((s),24), B((s),16), B((s),8),   B1(s)
-
-/* macros for converting scsi msb array to binary */
-#define V1(s)           (s)[0]
-#define V2(s)         (((s)[0] << 8) | (s)[1])
-#define V3(s)       (((((s)[0] << 8) | (s)[1]) << 8) | (s)[2])
-#define V4(s)     (((((((s)[0] << 8) | (s)[1]) << 8) | (s)[2]) << 8) | (s)[3])
-#define V5(s)   (((((((((s)[0] << 8) | (s)[1]) << 8) | (s)[2]) << 8) | (s)[3]) << 8) | (s)[4])
-#define V6(s) (((((((((((s)[0] << 8) | (s)[1]) << 8) | (s)[2]) << 8) | (s)[3]) << 8) | (s)[4]) << 8) | (s)[5])
-
-/* macros for converting binary into scsi msb array */
-#define MSB1(s,v)                                                (s)[0]=B1(v)
-#define MSB2(s,v)                                 (s)[0]=B(v,8), (s)[1]=B1(v)
-#define MSB3(s,v)                 (s)[0]=B(v,16), (s)[1]=B(v,8), (s)[2]=B1(v)
-#define MSB4(s,v) (s)[0]=B(v,24), (s)[1]=B(v,16), (s)[2]=B(v,8), (s)[3]=B1(v)
-
-#define LABEL_DB_VERSION 2
-
-#define DEBUG_INFO 9
-#define DEBUG_ERROR 1
-#define DEBUG_ALL 0
-
-#define SECTION_ALL 0
-#define SECTION_INFO 1
-#define SECTION_SCSI 2
-#define SECTION_MAP_BARCODE 3
-#define SECTION_ELEMENT 4
-#define SECTION_BARCODE 5
-#define SECTION_TAPE 6
-#define SECTION_MOVE 7
-/*----------------------------------------------------------------------------*/
-/* Some stuff for our own configurationfile */
-typedef struct {  /* The information we can get for any drive (configuration) */
-  int  drivenum;    /* Which drive to use in the library */
-  int  start;       /* Which is the first slot we may use */
-  int  end;         /* The last slot we are allowed to use */
-  int  cleanslot;   /* Where the cleaningcartridge stays */
-  char *scsitapedev; /* Where can we send raw SCSI commands to the tape */
-  char *device;      /* Which device is associated to the drivenum */
-  char *slotfile;    /* Where we should have our memory */   
-  char *cleanfile;   /* Where we count how many cleanings we did */
-  char *timefile;    /* Where we count the time the tape was used*/
-  char *tapestatfile;/* Where can we place some drive stats */
-  char *changerident;/* Config to use for changer control, ovverride result from inquiry */
-  char *tapeident;   /* Same as above for the tape device */
-}config_t; 
-
-typedef struct {
-  int number_of_configs; /* How many different configurations are used */
-  int eject;             /* Do the drives need an eject-command */
-  int autoinv;           /* Do automaticly an inventory if an tape is not in the db or not active in the db */
-  int havebarcode;       /* Do we have an barcode reader installed */
-  char *debuglevel;      /* How many debug info to print */
-  unsigned char emubarcode;    /* Emulate the barcode feature,  used for keeping an inventory of the lib */
-  time_t sleep;          /* How many seconds to wait for the drive to get ready */
-  int cleanmax;          /* How many runs could be done with one cleaning tape */
-  char *device;          /* Which device is our changer */
-  char *labelfile;       /* Mapping from Barcode labels to volume labels */
-  config_t *conf;
-}changer_t;
-
-typedef struct {
-  char voltag[128];
-  char barcode[TAG_SIZE];
-  unsigned char valid;
-} LabelV1_T;
-
-typedef struct {
-  char voltag[128];              /* Tape volume label */
-  char barcode[TAG_SIZE];        /* Barcode of the tape */
-  int slot;                      /* in which slot is the tape */
-  int from;                      /* from where it comes, needed to move a tape
-                                 * back to the right slot from the drive
-                                 */
-
-  unsigned int LoadCount;      /* How many times has the tape been loaded */
-  unsigned int RecovError;     /* How many recovered errors */
-  unsigned int UnrecovError;   /* How man unrecoverd errors */
-  unsigned char valid;         /* Is this tape in the current magazin */
-} LabelV2_T;
-
-typedef enum {BARCODE_PUT, BARCODE_VOL, BARCODE_BARCODE, BARCODE_DUMP, RESET_VALID, FIND_SLOT, UPDATE_SLOT } MBCAction_T;
-typedef struct {
-  LabelV2_T data;
-  MBCAction_T action;
-} MBC_T;
-
-
-/* ======================================================= */
-/* RequestSense_T */
-/* ======================================================= */
-typedef struct  
-{
-#ifdef LITTLE_ENDIAN_BITFIELDS 
-    PackedBit     ErrorCode:7;                    /* Byte 0 Bits 0-6 */
-    PackedBit     Valid:1;                              /* Byte 0 Bit 7    */
-#else 
-    PackedBit     Valid:1;                              /* Byte 0 Bit 7    */
-    PackedBit     ErrorCode:7;                    /* Byte 0 Bits 0-6 */
-#endif
-    unsigned char SegmentNumber;                  /* Byte 1 */ 
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     SenseKey:4;                     /* Byte 2 Bits 0-3 */
-    PackedBit     :1;                             /* Byte 2 Bit 4    */
-    PackedBit     RILI:1;                                /* Byte 2 Bit 5    */
-    PackedBit     REOM:1;                                /* Byte 2 Bit 6    */
-    PackedBit     Filemark:1;                           /* Byte 2 Bit 7    */
-#else 
-    PackedBit     Filemark:1;                           /* Byte 2 Bit 7    */
-    PackedBit     REOM:1;                                /* Byte 2 Bit 6    */
-    PackedBit     RILI:1;                                /* Byte 2 Bit 5    */
-    PackedBit     :1;                             /* Byte 2 Bit 4    */ 
-    PackedBit     SenseKey:4;                     /* Byte 2 Bits 0-3 */
-#endif
-    unsigned char Information[4];                 /* Bytes 3-6       */ 
-    unsigned char AdditionalSenseLength;          /* Byte 7          */   
-    unsigned char CommandSpecificInformation[4];  /* Bytes 8-11      */ 
-    unsigned char AdditionalSenseCode;            /* Byte 12         */
-    unsigned char AdditionalSenseCodeQualifier;   /* Byte 13         */ 
-    unsigned char Byte14;                          /* Byte 14         */ 
-    unsigned char Byte15;                           /* Byte 15         */ 
-    
-} RequestSense_T;     
-
-/* ======================================================= */
-/* ExtendedRequestSense_T */
-/* ======================================================= */
-typedef struct  
-{
-#ifdef LITTLE_ENDIAN_BITFIELDS 
-    PackedBit     ErrorCode:7;                    /* Byte 0 Bits 0-6 */
-    PackedBit     Valid:1;                        /* Byte 0 Bit 7    */
-#else 
-    PackedBit     Valid:1;                        /* Byte 0 Bit 7    */
-    PackedBit     ErrorCode:7;                    /* Byte 0 Bits 0-6 */
-#endif
-    unsigned char SegmentNumber;                  /* Byte 1 */ 
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     SenseKey:4;                     /* Byte 2 Bits 0-3 */
-    PackedBit     :1;                             /* Byte 2 Bit 4    */
-    PackedBit     RILI:1;                         /* Byte 2 Bit 5    */
-    PackedBit     REOM:1;                         /* Byte 2 Bit 6    */
-    PackedBit     Filemark:1;                     /* Byte 2 Bit 7    */
-#else 
-    PackedBit     Filemark:1;                     /* Byte 2 Bit 7    */
-    PackedBit     REOM:1;                         /* Byte 2 Bit 6    */
-    PackedBit     RILI:1;                         /* Byte 2 Bit 5    */
-    PackedBit     :1;                             /* Byte 2 Bit 4    */ 
-    PackedBit     SenseKey:4;                     /* Byte 2 Bits 0-3 */
-#endif
-    unsigned char Information[4];                 /* Bytes 3-6       */ 
-    unsigned char AdditionalSenseLength;          /* Byte 7          */   
-    unsigned char LogParameterPageCode;           /* Bytes 8         */ 
-    unsigned char LogParameterCode;               /* Bytes 9         */ 
-    unsigned char Byte10;                         /* Bytes 10        */ 
-    unsigned char UnderrunOverrunCounter;         /* Bytes 11        */ 
-    unsigned char AdditionalSenseCode;            /* Byte 12         */
-    unsigned char AdditionalSenseCodeQualifier;   /* Byte 13         */ 
-    unsigned char Byte14;                         /* Byte 14         */ 
-    unsigned char Byte15;                         /* Byte 15         */ 
-    unsigned char ReadWriteDataErrorCounter[3];   /* Byte 16-18      */ 
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     LBOT:1;                         /* Byte 19 Bits 0 */
-    PackedBit     TNP:1;                          /* Byte 19 Bits 1 */
-    PackedBit     TME:1;                          /* Byte 19 Bits 2 */
-    PackedBit     ECO:1;                          /* Byte 19 Bits 3 */
-    PackedBit     ME:1;                           /* Byte 19 Bits 4 */
-    PackedBit     FPE:1;                          /* Byte 19 Bits 5 */
-    PackedBit     BPE:1;                          /* Byte 19 Bits 6 */
-    PackedBit     PF:1;                           /* Byte 19 Bits 7 */
-#else 
-    PackedBit     PF:1;                           /* Byte 19 Bits 7 */
-    PackedBit     BPE:1;                          /* Byte 19 Bits 6 */
-    PackedBit     FPE:1;                          /* Byte 19 Bits 5 */
-    PackedBit     ME:1;                           /* Byte 19 Bits 4 */
-    PackedBit     ECO:1;                          /* Byte 19 Bits 3 */
-    PackedBit     TME:1;                          /* Byte 19 Bits 2 */
-    PackedBit     TNP:1;                          /* Byte 19 Bits 1 */
-    PackedBit     LBOT:1;                         /* Byte 19 Bits 0 */
-#endif
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     FE:1;                           /* Byte 20 Bits 0 */
-    PackedBit     SSE:1;                          /* Byte 20 Bits 1 */
-    PackedBit     WEI:1;                          /* Byte 20 Bits 2 */
-    PackedBit     URE:1;                          /* Byte 20 Bits 3 */
-    PackedBit     FMKE:1;                         /* Byte 20 Bits 4 */
-    PackedBit     WP:1;                           /* Byte 20 Bits 5 */
-    PackedBit     TMD:1;                          /* Byte 20 Bits 6 */
-    PackedBit     :1;                             /* Byte 20 Bits 7 */
-#else 
-    PackedBit     :1;                             /* Byte 20 Bits 7 */
-    PackedBit     TMD:1;                          /* Byte 20 Bits 6 */
-    PackedBit     WP:1;                           /* Byte 20 Bits 5 */
-    PackedBit     FMKE:1;                         /* Byte 20 Bits 4 */
-    PackedBit     URE:1;                          /* Byte 20 Bits 3 */
-    PackedBit     WEI:1;                          /* Byte 20 Bits 2 */
-    PackedBit     SSE:1;                          /* Byte 20 Bits 1 */
-    PackedBit     FE:1;                           /* Byte 20 Bits 0 */
-#endif
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     WSEO:1;                         /* Byte 21 Bits 0 */
-    PackedBit     WSEB:1;                         /* Byte 21 Bits 1 */
-    PackedBit     PEOT:1;                         /* Byte 21 Bits 2 */
-    PackedBit     CLN:1;                          /* Byte 21 Bits 3 */
-    PackedBit     CLND:1;                         /* Byte 21 Bits 4 */
-    PackedBit     RRR:1;                          /* Byte 21 Bits 5 */
-    PackedBit     UCLN:1;                         /* Byte 21 Bits 6 */
-    PackedBit     :1;                             /* Byte 21 Bits 7 */
-#else 
-    PackedBit     :1;                             /* Byte 21 Bits 7 */
-    PackedBit     UCLN:1;                         /* Byte 21 Bits 6 */
-    PackedBit     RRR:1;                          /* Byte 21 Bits 5 */
-    PackedBit     CLND:1;                         /* Byte 21 Bits 4 */
-    PackedBit     CLN:1;                          /* Byte 21 Bits 3 */
-    PackedBit     PEOT:1;                         /* Byte 21 Bits 2 */
-    PackedBit     WSEB:1;                         /* Byte 21 Bits 1 */
-    PackedBit     WSEO:1;                         /* Byte 21 Bits 0 */
-#endif
-    unsigned char Byte21;                          /* Byte 22         */ 
-    unsigned char RemainingTape[3];                /* Byte 23-25      */ 
-    unsigned char TrackingRetryCounter;            /* Byte 26         */ 
-    unsigned char ReadWriteRetryCounter;           /* Byte 27         */ 
-    unsigned char FaultSymptomCode;                /* Byte 28         */ 
-    
-} ExtendedRequestSense_T;     
-
-/* ======================================================= */
-/*  ReadElementStatus_T */
-/* ======================================================= */
-typedef struct 
-{
-    unsigned char cmd;                           /* Byte 1 */
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     type : 4;
-    PackedBit     voltag :1;
-    PackedBit     lun :3;
-#else
-    PackedBit     lun :3;
-    PackedBit     voltag :1;
-    PackedBit     type : 4;
-#endif
-    unsigned char start[2];                    /* Byte 3-4 */
-    unsigned char number[2];                   /* Byte 5-6 */
-    unsigned char byte4;                       /* Byte 7 */
-    unsigned char length[4];                   /* Byte 8-11 */
-    unsigned char byte78[2];                   /* Byte 12-13 */
-} ReadElementStatus_T;
-
-/* ======================================================= */
-/* ElementStatusPage_T */
-/* ======================================================= */
-typedef struct 
-{
-    unsigned char type;     /* Byte 1 = Element Type Code*/
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     bitres  : 6;
-    PackedBit     avoltag : 1;
-    PackedBit     pvoltag : 1;
-#else
-    PackedBit     pvoltag : 1;
-    PackedBit     avoltag : 1;
-    PackedBit     bitres  : 6;
-#endif
-    unsigned char length[2];    /* Byte 2-3  = Element Descriptor Length */
-    unsigned char byte4;        /* Byte 4 */
-    unsigned char count[3];     /* Byte 5-7 = Byte Count of Descriptor Available */
-} ElementStatusPage_T;
-
-
-/* ======================================================= */
-/* ElementStatusData_T */
-/* ======================================================= */
-typedef struct 
-{
-    unsigned char first[2];    /* Byte 1-2 = First Element Adress Reported */
-    unsigned char number[2];   /* Byte 3-4 = Number of Elements Available */
-    unsigned char byte5;      /* Reserved */
-    unsigned char count[3];     /* Byte 6-8 = Byte Count of Report Available */
-} ElementStatusData_T;
-
-/* ======================================================= */
-/* MediumTransportElementDescriptor_T */
-/* ======================================================= */
-typedef struct 
-{
-    unsigned char address[2];   /* Byte 1-2 = Element Address */
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     full   : 1;
-    PackedBit     rsvd   : 1;
-    PackedBit     except : 1;
-    PackedBit     res    : 5;
-#else
-    PackedBit     res    : 5;
-    PackedBit     except : 1;
-    PackedBit     rsvd   : 1;
-    PackedBit     full   : 1;
-#endif
-    unsigned char byte4;        /* Byte 4      */
-    unsigned char asc;          /* Byte 5 ASC  */
-    unsigned char ascq;         /* Byte 6 ASCQ */
-    unsigned char byte79[3];    /* Byte 7-9    */
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     byte10res : 6;
-    PackedBit     invert : 1;
-    PackedBit     svalid : 1;
-#else
-    PackedBit     svalid : 1;
-    PackedBit     invert : 1;
-    PackedBit     byte10res : 6;
-#endif
-    unsigned char source[2];
-  unsigned char pvoltag[36];
-  unsigned char res4[4];
-} MediumTransportElementDescriptor_T;
-
-/* ======================================================= */
-/* ImportExportElementDescriptor_T */
-/* ======================================================= */
-typedef struct 
-{
-  unsigned char address[2];   /* Byte 1 = Element Address */
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-  PackedBit     full   : 1;
-  PackedBit     impexp : 1;
-  PackedBit     except : 1;
-  PackedBit     access : 1;
-  PackedBit     exenab : 1;
-  PackedBit     inenab : 1;
-  PackedBit     res    : 2;
-#else
-  PackedBit     res    : 2;
-  PackedBit     inenab : 1;
-  PackedBit     exenab : 1;
-  PackedBit     access : 1;
-  PackedBit     except : 1;
-  PackedBit     rsvd   : 1;
-  PackedBit     full   : 1;
-#endif
-    unsigned char byte4;
-    unsigned char asc;
-    unsigned char ascq;
-    unsigned char byte79[3];
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     byte10res : 6;
-    PackedBit     invert : 1;
-    PackedBit     svalid : 1;
-#else
-    PackedBit     svalid : 1;
-    PackedBit     invert : 1;
-    PackedBit     byte10res : 6;
-#endif
-    unsigned char source[2];
-  unsigned char pvoltag[36];
-  unsigned char res4[4];
-  unsigned char mediadomain[1];
-  unsigned char mediatype[1];
-  unsigned char res5[2];
-} ImportExportElementDescriptor_T;
-
-/* ======================================================= */
-/* StorageElementDescriptor_T */
-/* ======================================================= */
-typedef struct 
-{
-    unsigned char address[2];
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     full   : 1;
-    PackedBit     rsvd   : 1;
-    PackedBit     except : 1;
-    PackedBit     access : 1;
-    PackedBit     res    : 4;
-#else
-    PackedBit     res    : 4;
-    PackedBit     access : 1;
-    PackedBit     except : 1;
-    PackedBit     rsvd   : 1;
-    PackedBit     full   : 1;
-#endif
-    unsigned char res1;
-    unsigned char asc;
-    unsigned char ascq;
-    unsigned char res2[3];
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     res3   : 6;
-    PackedBit     invert : 1;
-    PackedBit     svalid : 1;
-#else
-    PackedBit     svalid : 1;
-    PackedBit     invert : 1;
-    PackedBit     res3   : 6;
-#endif
-    unsigned char source[2];
-  unsigned char pvoltag[36];
-  unsigned char res4[4];
-  unsigned char mediadomain[1];
-  unsigned char mediatype[1];
-  unsigned char res5[2];
-} StorageElementDescriptor_T;
-
-/* ======================================================= */
-/* DataTransferElementDescriptor_T */
-/* ======================================================= */
-typedef struct 
-{
-    unsigned char address[2];
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     full    : 1;
-    PackedBit     rsvd    : 1;
-    PackedBit     except  : 1;
-    PackedBit     access  : 1;
-    PackedBit     res     : 4;
-#else
-    PackedBit     res     : 4;
-    PackedBit     access  : 1;
-    PackedBit     except  : 1;
-    PackedBit     rsvd    : 1;
-    PackedBit     full    : 1;
-#endif
-    unsigned char res1;
-    unsigned char asc;
-    unsigned char ascq;
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     lun     : 3;
-    PackedBit     rsvd1   : 1;
-    PackedBit     luvalid : 1;
-    PackedBit     idvalid : 1;
-    PackedBit     rsvd2   : 1;
-    PackedBit     notbus  : 1;
-#else
-    PackedBit     notbus  : 1;
-    PackedBit     rsvd2   : 1;
-    PackedBit     idvalid : 1;
-    PackedBit     luvalid : 1;
-    PackedBit     rsvd1   : 1;
-    PackedBit     lun     : 3;
-#endif
-    unsigned char scsi;
-    unsigned char res2;
-#ifdef LITTLE_ENDIAN_BITFIELDS        
-    PackedBit     res3    : 6;
-    PackedBit     invert  : 1;
-    PackedBit     svalid  : 1;
-#else
-    PackedBit     svalid  : 1;
-    PackedBit     invert  : 1;
-    PackedBit     res3    : 6;
-#endif
-    unsigned char source[2];
-  unsigned char pvoltag[36];
-    unsigned char res4[42];
-} DataTransferElementDescriptor_T;
-
-/* ======================================================= */
-/* SCSIInquiry_T */
-/* ======================================================= */
-typedef struct
-{
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit     type : 5;
-    PackedBit     qualifier : 3;
-
-    PackedBit     type_modifier : 7;
-    PackedBit     removable : 1;
-
-    PackedBit     ansi_version : 3;
-    PackedBit     ecma_version : 3;
-    PackedBit     iso_version : 2;
-
-    PackedBit     data_format : 4;
-    PackedBit     res3_54 : 2;
-    PackedBit     termiop : 1;
-    PackedBit     aenc : 1;
-#else
-    PackedBit     qualifier : 3;
-    PackedBit     type : 5;
-  
-    PackedBit     removable : 1;
-    PackedBit     type_modifier : 7;
-  
-    PackedBit     iso_version : 2;
-    PackedBit     ecma_version : 3;
-    PackedBit     ansi_version : 3;
-  
-    PackedBit     aenc : 1;
-    PackedBit     termiop : 1;
-    PackedBit     res3_54 : 2;
-    PackedBit     data_format : 4;
-#endif
-  
-    unsigned char add_len;
-  
-    unsigned char  res2;
-    unsigned char res3;
-  
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit     softreset : 1;
-    PackedBit     cmdque : 1;
-    PackedBit     res7_2 : 1;
-    PackedBit     linked  : 1;
-    PackedBit     sync : 1;
-    PackedBit     wbus16 : 1;
-    PackedBit     wbus32 : 1;
-    PackedBit     reladr : 1;
-#else
-    PackedBit     reladr : 1;
-    PackedBit     wbus32 : 1;
-    PackedBit     wbus16 : 1;
-    PackedBit     sync : 1;
-    PackedBit     linked  : 1;
-    PackedBit     res7_2 : 1;
-    PackedBit     cmdque : 1;
-    PackedBit     softreset : 1;
-#endif
-    char vendor_info[8];
-    char prod_ident[16];
-    char prod_version[4];
-    char vendor_specific[20];
-} SCSIInquiry_T;
-
-/* ======================================================= */
-/* ModeSenseHeader_T */
-/* ======================================================= */
-typedef struct
-{
-    unsigned char DataLength;
-    unsigned char MediumType;
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit Speed:4;
-    PackedBit BufferedMode:3;
-    PackedBit WP:1;
-#else
-    PackedBit WP:1;
-    PackedBit BufferedMode:3;
-    PackedBit Speed:4;
-#endif
-    unsigned char BlockDescLength;
-} ModeSenseHeader_T;
-/* ======================================================= */
-/* ModeBlockDescriptor_T */
-/* ======================================================= */
-typedef struct 
-{
-    unsigned char DensityCode;
-    unsigned char NumberOfBlocks[3];
-    unsigned char Reserved;
-    unsigned char BlockLength[3];
-} ModeBlockDescriptor_T;
-/* ======================================================= */
-/* LogSenseHeader_T */
-/* ======================================================= */
-typedef struct 
-{
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit PageCode:6;
-    PackedBit Reserved:2;
-#else
-    PackedBit Reserved:2;
-    PackedBit PageCode:6;
-#endif
-    unsigned char Reserved1;
-    unsigned char PageLength[2];
-} LogSenseHeader_T ;
-/* ======================================================= */
-/* LogParameters_T */
-/* ======================================================= */
-typedef struct
-{
-    unsigned char ParameterCode[2];
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit LP:1;
-    PackedBit RSCD:1;
-    PackedBit TMC:1;
-    PackedBit ETC:1;
-    PackedBit TSD:1;
-    PackedBit DS:1;
-    PackedBit DU:1;
-#else
-    PackedBit DU:1;
-    PackedBit DS:1;
-    PackedBit TSD:1;
-    PackedBit ETC:1;
-    PackedBit TMC:1;
-    PackedBit RSCD:1;
-    PackedBit LP:1;
-#endif
-    char ParameterLength;
-} LogParameter_T;
-/*
- * Pages returned by the MODE_SENSE command
- */
-typedef struct {
-    unsigned char SenseDataLength;
-    char res[3];
-} ParameterListHeader_T;
-/* ======================================================= */
-/* ReadWriteErrorRecoveryPage_T */
-/* ======================================================= */
-typedef struct 
-{
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit PageCode : 6;
-    PackedBit res      : 1;
-    PackedBit PS       : 1;
-#else
-    PackedBit PS       : 1;
-    PackedBit res      : 1;
-    PackedBit PageCode : 6;
-#endif
-    unsigned char ParameterListLength;
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit dcr  :1;  /* Disable ECC Correction */
-    PackedBit dte  :1;  /* Disable Transfer on Error */
-    PackedBit per  :1;  /* Enable Post  Error reporting */
-    PackedBit eer  :1;  /* Enable early recovery */
-    PackedBit res1 :1;
-    PackedBit tb   :1;  /* Transfer block (when not fully recovered) */
-    PackedBit res2 :1;
-    PackedBit res3 :1;
-#else
-    PackedBit res3 :1;
-    PackedBit res2 :1;
-    PackedBit tb   :1;
-    PackedBit res1 :1;
-    PackedBit eer  :1;
-    PackedBit per  :1;
-    PackedBit dte  :1;
-    PackedBit dcr  :1;
-#endif
-    unsigned char ReadRetryCount;
-    unsigned char res4[4];
-    unsigned char WriteRetryCount;
-    unsigned char res5[3];
-} ReadWriteErrorRecoveryPage_T; 
-/* ======================================================= */
-/* EDisconnectReconnectPage_T */
-/* ======================================================= */
-typedef struct 
-{
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit PageCode : 6;
-    PackedBit RSVD     : 1;
-    PackedBit PS       : 1;
-#else
-    PackedBit PS       : 1;
-    PackedBit RSVD     : 1;
-    PackedBit PageCode : 6;
-#endif
-
-    unsigned char BufferFullRatio;
-    unsigned char BufferEmptyRatio;
-    unsigned char BusInactivityLimit[2];
-    unsigned char DisconnectTimeLimit[2];
-    unsigned char ConnectTimeLimit[2];
-    unsigned char MaximumBurstSize[2];
-
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit DTDC :2;
-    PackedBit res  :6;
-#else
-    PackedBit res  :6;
-    PackedBit DTDC :2;
-#endif
-    unsigned char res1[3];
-} DisconnectReconnectPage_T;
-
-/* ======================================================= */
-/* EAAPage_T */
-/* ======================================================= */
-typedef struct 
-{
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit PageCode : 6;
-    PackedBit RSVD     : 1;
-    PackedBit PS       : 1;
-#else
-    PackedBit PS       : 1;
-    PackedBit RSVD     : 1;
-    PackedBit PageCode : 6;
-#endif
-    unsigned char ParameterListLength;
-    unsigned char MediumTransportElementAddress[2];
-    unsigned char NoMediumTransportElements[2];
-    unsigned char FirstStorageElementAddress[2];
-    unsigned char NoStorageElements[2];
-    unsigned char FirstImportExportElementAddress[2];
-    unsigned char NoImportExportElements[2];
-    unsigned char FirstDataTransferElementAddress[2];
-    unsigned char NoDataTransferElements[2];
-    unsigned char res[2];
-} EAAPage_T;    
-/* ======================================================= */
-/* TransPortGeometryDescriptorPage_T */
-/* ======================================================= */
-typedef struct {
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit PageCode : 6;
-    PackedBit RSVD     : 1;
-    PackedBit PS       : 1;
-#else
-    PackedBit PS       : 1;
-    PackedBit RSVD     : 1;
-    PackedBit PageCode : 6;
-#endif
-    unsigned char ParameterListLength;
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit Rotate    : 1;
-    PackedBit res       : 7;
-#else
-    PackedBit res       : 7;
-    PackedBit Rotate    : 1;
-#endif
-    unsigned char MemberNumber;
-} TransportGeometryDescriptorPage_T;  
-/* ======================================================= */
-/* DeviceCapabilitiesPage_T */
-/* ======================================================= */
-typedef struct
-{
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit PageCode : 6;
-    PackedBit RSVD     : 1;
-    PackedBit PS       : 1;
-#else
-    PackedBit PS       : 1;
-    PackedBit RSVD     : 1;
-    PackedBit PageCode : 6;
-#endif
-    unsigned char ParameterLength;
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit MT        : 1;
-    PackedBit ST        : 1;
-    PackedBit IE        : 1;
-    PackedBit DT        : 1;
-    PackedBit res1      : 4;
-#else
-    PackedBit res1      : 4;
-    PackedBit DT        : 1;
-    PackedBit IE        : 1;
-    PackedBit ST        : 1;
-    PackedBit MT        : 1;
-#endif
-    unsigned char res;
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit MT2MT     : 1;
-    PackedBit MT2ST     : 1;
-    PackedBit MT2IE     : 1;
-    PackedBit MT2DT     : 1;
-    PackedBit res2      : 4;
-#else
-    PackedBit res2      : 4;
-    PackedBit MT2DT     : 1;
-    PackedBit MT2IE     : 1;
-    PackedBit MT2ST     : 1;
-    PackedBit MT2MT     : 1;
-#endif
-
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit ST2MT     : 1;
-    PackedBit ST2ST     : 1;
-    PackedBit ST2IE     : 1;
-    PackedBit ST2DT     : 1;
-    PackedBit res3      : 4;
-#else
-    PackedBit res3      : 4;
-    PackedBit ST2DT     : 1;
-    PackedBit ST2IE     : 1;
-    PackedBit ST2ST     : 1;
-    PackedBit ST2MT     : 1;
-#endif
-
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit IE2MT     : 1;
-    PackedBit IE2ST     : 1;
-    PackedBit IE2IE     : 1;
-    PackedBit IE2DT     : 1;
-    PackedBit res4      : 4;
-#else
-    PackedBit res4      : 4;
-    PackedBit IE2DT     : 1;
-    PackedBit IE2IE     : 1;
-    PackedBit IE2ST     : 1;
-    PackedBit IE2MT     : 1;
-#endif
-
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit DT2MT     : 1;
-    PackedBit DT2ST     : 1;
-    PackedBit DT2IE     : 1;
-    PackedBit DT2DT     : 1;
-    PackedBit res5      : 4;
-#else
-    PackedBit res5      : 4;
-    PackedBit DT2DT     : 1;
-    PackedBit DT2IE     : 1;
-    PackedBit DT2ST     : 1;
-    PackedBit DT2MT     : 1;
-#endif
-    unsigned char res0819[12];
-} DeviceCapabilitiesPage_T;  
-/* ======================================================= */
-/* ModePageEXB10hLCD_T */
-/* ======================================================= */
-typedef struct ModePageEXB10hLCD
-{
-  unsigned char PageCode;
-  unsigned char ParameterListLength;
-
-#ifdef LITTLE_ENDIAN_BITFIELDS
-  PackedBit WriteLine4 : 1;
-  PackedBit WriteLine3 : 1;
-  PackedBit WriteLine2 : 1;
-  PackedBit WriteLine1 : 1;
-  PackedBit res        : 4;
-#else
-  PackedBit res        : 4;
-  PackedBit WriteLine1 : 1;
-  PackedBit WriteLine2 : 1;
-  PackedBit WriteLine3 : 1;
-  PackedBit WriteLine4 : 1;
-#endif
-  unsigned char reserved;
-  unsigned char line1[20];
-  unsigned char line2[20];
-  unsigned char line3[20];
-  unsigned char line4[20];
-} ModePageEXB10hLCD_T;
-/* ======================================================= */
-/* ModePageEXBBaudRatePage_T */
-/* ======================================================= */
-typedef struct ModePageEXBBaudRatePage
-{
-  unsigned char PageCode;
-  unsigned char ParameterListLength;
-  unsigned char BaudRate[2];
-} ModePageEXBBaudRatePage_T;
-/* ======================================================= */
-/* ModePageEXB120VendorUnique_T */
-/* ======================================================= */
-typedef struct ModePageEXB120VendorUnique
-{
-#ifdef  LITTLE_ENDIAN_BITFIELDS
-    PackedBit PageCode : 6;
-    PackedBit RSVD0    : 1;
-    PackedBit PS       : 1;
-#else
-    PackedBit PS       : 1;
-    PackedBit RSVD0    : 1;
-    PackedBit PageCode : 6;
-#endif
-    unsigned char ParameterListLength;
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit MDC  : 2;
-    PackedBit NRDC : 1;
-    PackedBit RSVD : 1;
-    PackedBit NBL  : 1;
-    PackedBit PRTY : 1;
-    PackedBit UINT : 1;
-    PackedBit AINT : 1;
-#else
-    PackedBit AINT : 1;
-    PackedBit UINT : 1;
-    PackedBit PRTY : 1;
-    PackedBit NBL  : 1;
-    PackedBit RSVD : 1;
-    PackedBit NRDC : 1;
-    PackedBit MDC  : 2;
-#endif
-    unsigned char MaxParityRetries;
-    unsigned char DisplayMessage[60];
-} ModePageEXB120VendorUnique_T;
-/* ======================================================= */
-/* ModePageTreeFrogVendorUnique_T */
-/* ======================================================= */
-typedef struct ModePageTreeFrogVendorUnique
-{
-#ifdef  LITTLE_ENDIAN_BITFIELDS
-    PackedBit PageCode : 6;
-    PackedBit res0     : 1;
-    PackedBit PS       : 1;
-#else
-    PackedBit PS       : 1;
-    PackedBit res0     : 1;
-    PackedBit PageCode : 6;
-#endif
-    unsigned char ParameterListLength;
-#ifdef LITTLE_ENDIAN_BITFIELDS
-    PackedBit EBARCO  : 1;
-    PackedBit CHKSUM  : 1;
-    PackedBit res2    : 6;
-#else
-    PackedBit res2    : 6;
-    PackedBit CHKSUM  : 1;
-    PackedBit EBARCO  : 1;
-#endif
-    unsigned char res3;
-    unsigned char res4;
-    unsigned char res5;
-    unsigned char res6;
-    unsigned char res7;
-    unsigned char res8;
-    unsigned char res9;
-} ModePageTreeFrogVendorUnique_T;
-/* ======================================================= */
-/* ElementInfo_T */
-/* ======================================================= */
-typedef struct ElementInfo
-{
-    int type;       /* CHANGER - 1, STORAGE - 2, TAPE - 4 */
-    int address;    /* Adress of this Element */
-    int from;       /* From where did it come */
-    char status;    /* F -> Full, E -> Empty */
-    char VolTag[TAG_SIZE+1]; /* Label Info if Barcode reader exsist */
-    unsigned char ASC;  /* Additional Sense Code from read element status */
-    unsigned char ASCQ; /* */
-    unsigned char scsi; /* if DTE, which scsi address */
-
-  PackedBit svalid : 1;
-  PackedBit invert : 1;
-  PackedBit full   : 1;
-  PackedBit impexp : 1;
-  PackedBit except : 1;
-  PackedBit access : 1;
-  PackedBit inenab : 1;
-  PackedBit exenab : 1;
-
-} ElementInfo_T;
-
-
-
-typedef struct {
-    char *ident;                  /* Name of the device from inquiry */
-    char *type;                   /* Device Type, tape|robot */
-    int (*function_move)(int, int, int);
-    int (*function_status)(int, int);
-    int (*function_reset_status)(int);
-    int (*function_free)(void);
-    int (*function_eject)(char *, int);
-    int (*function_clean)(char *);
-    int (*function_rewind)(int);
-    int (*function_barcode)(int);
-    int (*function_search)(void);
-    int (*function_error)(int, unsigned char, unsigned char, unsigned char, unsigned char, RequestSense_T *);
-} ChangerCMD_T ;
-
-typedef struct {
-    unsigned char command;        /* The SCSI command byte */
-    int length;                   /* How long */
-    char *name;                   /* Name of the command */
-} SC_COM_T;
-
-typedef struct OpenFiles {
-    int fd;                       /* The filedescriptor */
-#ifdef HAVE_CAM_LIKE_SCSI
-    struct cam_device *curdev;
-#endif
-  unsigned char avail;          /* Is this device available */
-  unsigned char devopen;        /* Is the device open */
-  unsigned char inqdone;        /* Did we try to get device infos, was an open sucessfull */
-  unsigned char SCSI;           /* Can we send SCSI commands */
-  int flags;                    /* Can be used for some flags ... */
-  char *dev;                    /* The device which is used */
-  char *type;                  /* Type of device, tape/changer */
-  char *ConfigName;             /* The name in the config */
-  char ident[17];               /* The identifier from the inquiry command */
-  ChangerCMD_T *functions;      /* Pointer to the function array for this device */
-  SCSIInquiry_T *inquiry;       /* The result from the Inquiry */
-} OpenFiles_T;
-
-typedef struct LogPageDecode {
-    int LogPage;
-    char *ident;
-    void (*decode)(LogParameter_T *, size_t);
-} LogPageDecode_T;
-
-typedef struct {
-   char *ident;        /* Ident as returned from the inquiry */
-   char *vendor;       /* Vendor as returned from the inquiry */
-   unsigned char type; /* removable .... */
-   unsigned char sense;/* Sense key as returned from the device */
-   unsigned char asc;  /* ASC as set in the sense struct */
-   unsigned char ascq; /* ASCQ as set in the sense struct */
-   int  ret;           /* What we think that we should return on this conditon */
-   char text[80];      /* A short text describing this condition */
-} SenseType_T;                                                                                    
-
-/* ======================================================= */
-/* Function-Declaration */
-/* ======================================================= */
-int SCSI_OpenDevice(int);
-int OpenDevice(int, char *DeviceName, char *ConfigName, char *ident);
-
-int SCSI_CloseDevice(int DeviceFD); 
-int CloseDevice(char *, int); 
-int Tape_Eject(int);
-int Tape_Status(int);
-void DumpSense(void);
-int Sense2Action(char *ident,
-                       unsigned char type,
-                       unsigned char ignsense,
-                       unsigned char sense,
-                       unsigned char asc,
-                       unsigned char ascq,
-                       char **text);
-
-int SCSI_ExecuteCommand(int DeviceFD,
-                        Direction_T Direction,
-                        CDB_T CDB,
-                        size_t CDB_Length,
-                        void *DataBuffer,
-                        size_t DataBufferLength,
-                        RequestSense_T *RequestSense,
-                        size_t RequestSenseLength);
-
-int Tape_Ioctl(int DeviceFD, int command);
-void ChangerStatus(char * option,
-                       char * labelfile,
-                       int HasBarCode,
-                       char *changer_file,
-                       char *changer_dev,
-                       char *tape_device);
-
-int SCSI_Inquiry(int, SCSIInquiry_T *, size_t);
-int PrintInquiry(SCSIInquiry_T *);
-int DecodeSCSI(CDB_T CDB, char *string);
-
-int RequestSense(int fd, ExtendedRequestSense_T *s, int ClearErrorCounters);
-int DecodeSense(RequestSense_T *sense, char *pstring, FILE *out);
-int DecodeExtSense(ExtendedRequestSense_T *sense, char *pstring, FILE *out);
-
-void ChgExit(char *, char *, int);
-
-void ChangerReplay(char *option);
-void ChangerStatus(char *option, char *labelfile, int HasBarCode, char *changer_file, char *changer_dev, char *tape_device);
-int BarCode(int fd);
-int MapBarCode(char *labelfile, MBC_T *);
-
-int Tape_Ready(int fd, time_t wait_time);
-
-void Inventory(char *labelfile, int drive, int eject, int start, int stop, int clean);
-void ChangerDriverVersion(void);
-void PrintConf(void);
-int LogSense(int fd);
-int ScanBus(int print);
-void DebugPrint(int level, int section, char * fmt, ...);
-int DecodeSense(RequestSense_T *sense, char *pstring, FILE *out);
-void SCSI_OS_Version(void);
-int get_clean_state(char *tapedev);
-int find_empty(int fd, int start, int count);
-int get_slot_count(int fd);
-int get_drive_count(int fd);
-int GetCurrentSlot(int fd, int drive);
-void DumpDev(OpenFiles_T *p, char *device);
-int isempty(int fd, int slot);
-
-#endif /* !SCSIDEFS_H */
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-file-style: gnu
- * End:
- */
diff --git a/changer-src/scsi-hpux.c b/changer-src/scsi-hpux.c
deleted file mode 100644 (file)
index 1d379a8..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: scsi-hpux.c,v 1.15 2006/05/25 01:47:07 johnfranks Exp $
- *
- *     scsi-chio.c -- library routines to handle the changer
- *                     support for chio based systems
- *
- *     Author: Eric Schnoebelen, eric@cirr.com
- *     interface based on work by: Larry Pyeatt, pyeatt@cs.colostate.edu 
- *     Copyright: 1997, 1998 Eric Schnoebelen
- *             
- *      Michael C. Povel 03.06.98 added dummy for eject_tape
- */
-
-#include "amanda.h"
-
-# include <sys/scsi.h>
-# include <sys/mtio.h>  /* for eject_tape ioctls */
-
-char *moddesc = "@(#)" __FILE__
-               ": HP/UX SCSI changer support routines @(#)";
-
-/* 
- * a cache of the robotics information, for use elsewhere
- */
-static struct element_addresses changer_info;
-static int changer_info_init = 0;
-
-
-/* Get the number of the first free slot
- * return > 0 number of empty slot
- * return = 0 no slot free
- * return < 0 error
- */
-int GetCurrentSlot(int fd)
-{
-
-}
-
-static int get_changer_info(fd)
-{
-    int rc = 0;
-
-    if (!changer_info_init) {
-       rc = ioctl(fd, SIOC_ELEMENT_ADDRESSES, &changer_info);
-       changer_info_init++;
-    }
-    return (rc);
-}
-
-int get_clean_state(char *dev)
-{
-#if 0
-/*
-  This code works for Linux .... 
-  maybe someone can do something like this under HPUX
-*/
-    int status;
-    unsigned char *cmd;
-    unsigned char buffer[255];
-    int filenr;
-
-    if ((filenr = open(dev, O_RDWR)) < 0) {
-        perror(dev);
-        return 0;
-    }
-    memset(buffer, 0, SIZEOF(buffer));
-
-    *((int *) buffer) = 0;      /* length of input data */
-    *(((int *) buffer) + 1) = 100;     /* length of output buffer */
-
-    cmd = (char *) (((int *) buffer) + 2);
-
-    cmd[0] = 0x4d;         /* LOG SENSE  */
-    cmd[2] = (1 << 6)|0x33;     /* PageControl, PageCode */
-    cmd[7] = 00;                 /* allocation length hi */
-    cmd[8] = 100;                 /* allocation length lo */
-
-    status = ioctl(filenr, 1 /* SCSI_IOCTL_SEND_COMMAND */ , buffer);
-
-    if (status)
-        return 0;
-
-    if ((buffer[16] & 0x1) == 1)
-          return 1;
-
-#endif
-    return 0;
-
-}
-
-
-void eject_tape(char *tape)
-     /* This function ejects the tape from the drive */
-{
-/*
-  This code works for Linux .... 
-  This code works for HPUX too, see 'man 7 mt'
-*/
-    int mtfd;
-    struct mtop mt_com;
-
-    if ((mtfd = open(tape, O_RDWR)) < 0) {
-        perror(tape);
-        exit(2);
-    }
-    mt_com.mt_op = MTOFFL;
-    mt_com.mt_count = 1;
-    if (ioctl(mtfd, MTIOCTOP, (char *)&mt_com) < 0) {
-/* Ignore the error
-       perror(tape);
-       exit(2);
-*/
-    }
-    close(mtfd);
-}
-
-/* 
- * this routine checks a specified slot to see if it is empty 
- */
-int isempty(int fd, int slot)
-{
-struct element_status es;
-int rc;
-
-    /*
-     * fill the cache as required
-     */
-    get_changer_info(fd);
-
-    es.element = changer_info.first_storage + slot;
-
-    rc = ioctl(fd, SIOC_ELEMENT_STATUS, &es);
-    if (rc) {
-       g_fprintf(stderr, _("%s: element status query failed: 0x%x %s\n"),
-                               get_pname(), rc, strerror(errno));
-       return(-1);
-    }
-
-    return !es.full;
-}
-
-/*
- * find the first empty slot 
- */
-int find_empty(int fd, int start, int count)
-{
-struct element_status  es;
-int i, rc;
-
-    get_changer_info(fd);
-
-    i = changer_info.first_storage;
-    do {
-       es.element = i++;
-       rc = ioctl(fd, SIOC_ELEMENT_STATUS, &es);
-    } while ( (i <= (changer_info.first_storage + changer_info.num_storages))
-               && !rc && es.full);
-
-    if (rc) {
-       g_fprintf(stderr,_("%s: element status query failed: 0x%x %s\n"),
-                               get_pname(), rc, strerror(errno));
-       return -1;
-    }
-    return (i - changer_info.first_storage - 1);
-}
-
-/*
- * returns one if there is a tape loaded in the drive 
- */
-int drive_loaded(int fd, int drivenum)
-{
-struct element_status  es;
-int                            i,rc;
-
-    get_changer_info(fd);
-
-    es.element = changer_info.first_data_transfer + drivenum;
-
-    rc = ioctl(fd, SIOC_ELEMENT_STATUS, &es);
-    if (rc) {
-       g_fprintf(stderr,_("%s: drive status quer failed: 0x%x %s\n"),
-                               get_pname(), rc, strerror(errno));
-       return(-1);
-    }
-
-    return es.full;
-}
-
-
-/*
- * unloads the drive, putting the tape in the specified slot 
- */
-int unload(int fd, int drive, int slot)
-{
-struct move_medium_parms  move;
-int rc;
-
-    get_changer_info(fd);
-
-    /*
-     * pick the first transport, just for simplicity
-     */
-    move.transport = changer_info.first_transport;
-
-    move.source = changer_info.first_data_transfer + drive;
-    move.destination = changer_info.first_storage + slot;
-    move.invert = 0;
-
-    rc = ioctl(fd, SIOC_MOVE_MEDIUM, &move);
-    if (rc){
-       g_fprintf(stderr,_("%s: move medium command failed: 0x%x %s\n"),
-               get_pname(), rc, strerror(errno));
-       return(-2);
-    }
-    return 0;
-}
-
-
-/*
- * moves tape from the specified slot into the drive 
- */
-int load(int fd, int drive, int slot)
-{
-struct move_medium_parms  move;
-int rc;
-
-    get_changer_info(fd);
-
-    /*
-     * use the first transport defined in the changer, for lack of a
-     * better choice..
-     */
-    move.transport = changer_info.first_transport;
-
-    move.source = changer_info.first_storage + slot;
-    move.destination = changer_info.first_data_transfer + drive;
-    move.invert = 0;
-
-    rc = ioctl(fd, SIOC_MOVE_MEDIUM,&move);
-    if (rc){
-       g_fprintf(stderr,_("%s: drive load failed (MOVE): 0x%x %s\n"),
-               get_pname(), rc, strerror(errno));
-       return(-2);
-    }
-    return (rc);
-}
-
-int get_slot_count(int fd)
-{ 
-int rc;
-
-    rc = get_changer_info(fd);
-    if (rc) {
-        g_fprintf(stderr, _("%s: storage size query failed: 0x%x %s\n"), get_pname(),
-                                               rc, strerror(errno));
-        return -1;
-    }
-
-    return(changer_info.num_storages);
-
-}
-
-int get_drive_count(int fd)
-{ 
-    int rc;
-
-    rc = get_changer_info(fd);
-    if (rc) {
-        g_fprintf(stderr, _("%s: drive count query failed: 0x%x %s\n"), get_pname(),
-                                               rc, strerror(errno));
-        return -1;
-    }
-
-    return changer_info.num_data_transfers;
-}
-
-/* This function should ask the drive if it is ready */
-int Tape_Ready(char *tapedev, char *changerdev, int changerfd, int wait)
-{
-  FILE *out=NULL;
-  int cnt=0;
-
-  if (strcmp(tapedev, changerdev) == 0)
-    {
-      sleep(wait);
-      return(0);
-    }
-
-  while ((cnt<wait) && (NULL==(out=fopen(tapedev,"w+")))){
-    cnt++;
-    sleep(1);
-  }
-  if (out != NULL)
-    fclose(out);
-  return 0;
-}
-
-int OpenDevice(char * tapedev)
-{
-  int DeviceFD;
-
-  DeviceFD = open(tapedev, O_RDWR);
-  dbprintf(_("OpenDevice(%s) returns %d\n"), tapedev, DeviceFD);
-  return(DeviceFD);
-}
-
-int CloseDevice(char *device, int DeviceFD)
-{
-  int ret;
-
-  ret = close(DeviceFD);
-  dbprintf(_("CloseDevice(%s) returns %d\n"), device, ret);
-  return(ret);
-}
diff --git a/changer-src/scsi-hpux_new.c b/changer-src/scsi-hpux_new.c
deleted file mode 100644 (file)
index 288bff2..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: scsi-hpux_new.c,v 1.19 2006/05/25 01:47:08 johnfranks Exp $
- *
- * Interface to execute SCSI commands on an HP-UX Workstation
- *
- * Copyright (c) Thomas Hepper th@ant.han.de
- */
-
-
-#include "amanda.h"
-
-#include <sys/scsi.h>
-#include <sys/mtio.h>
-
-#include <scsi-defs.h>
-
-void SCSI_OS_Version()
-{
-#ifndef lint
-    static char rcsid[] = "$Id: scsi-hpux_new.c,v 1.19 2006/05/25 01:47:08 johnfranks Exp $";
-   DebugPrint(DEBUG_INFO, SECTION_INFO, "scsi-os-layer: %s\n",rcsid);
-#endif
-}
-
-int SCSI_OpenDevice(int ip)
-{
-  extern OpenFiles_T *pDev;
-  int DeviceFD;
-  int i;
-
-  if (pDev[ip].inqdone == 0)
-    {
-      pDev[ip].inqdone = 1;
-      if ((DeviceFD = open(pDev[ip].dev, O_RDWR| O_NDELAY)) >= 0)
-        {
-          pDev[ip].avail = 1;
-          pDev[ip].fd = DeviceFD;
-          pDev[ip].devopen = 1;
-          pDev[ip].SCSI = 0;
-          pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE);
-          
-          if (SCSI_Inquiry(ip, pDev[ip].inquiry, INQUIRY_SIZE) == 0)
-            {
-              if (pDev[ip].inquiry->type == TYPE_TAPE || pDev[ip].inquiry->type == TYPE_CHANGER)
-                {
-                  for (i=0;i < 16;i++)
-                    pDev[ip].ident[i] = pDev[ip].inquiry->prod_ident[i];
-                  for (i=15; i >= 0 && !isalnum(pDev[ip].inquiry->prod_ident[i]) ; i--)
-                    {
-                      pDev[ip].inquiry->prod_ident[i] = '\0';
-                    }
-                  pDev[ip].SCSI = 1;
-
-                 if (pDev[ip].inquiry->type == TYPE_TAPE)
-                 {
-                         pDev[ip].type = stralloc("tape");
-                 }
-
-                 if (pDev[ip].inquiry->type == TYPE_CHANGER)
-                 {
-                         pDev[ip].type = stralloc("changer");
-                 }
-
-                  PrintInquiry(pDev[ip].inquiry);
-                  return(1);    
-                } else {
-                  close(DeviceFD);
-                  free(pDev[ip].inquiry);
-                  return(0);
-              }
-            }
-            close(DeviceFD);
-            free(pDev[ip].inquiry);
-            pDev[ip].inquiry = NULL;
-            return(1);
-        }
-    } else {
-      if ((DeviceFD = open(pDev[ip].dev, O_RDWR| O_NDELAY)) >= 0)
-        {
-          pDev[ip].fd = DeviceFD;
-          pDev[ip].devopen = 1;
-          return(1);
-        }
-    }
-
-  return(0); 
-}
-
-int SCSI_CloseDevice(int DeviceFD)
-{
-  extern OpenFiles_T *pDev;
-  int ret;
-
-  ret = close(pDev[DeviceFD].fd);
-  pDev[DeviceFD].devopen = 0;
-  return(ret);
-}
-
-int SCSI_ExecuteCommand(int DeviceFD,
-                        Direction_T Direction,
-                        CDB_T CDB,
-                        size_t CDB_Length,
-                        void *DataBuffer,
-                        size_t DataBufferLength,
-                        RequestSense_T *RequestSenseBuf,
-                        size_t RequestSenseLength)
-{
-  extern OpenFiles_T *pDev;
-  struct sctl_io sctl_io;
-  int Retries = 3;
-  int Zero = 0, Result;
-  
-  /* Basic sanity checks */
-  assert(CDB_Length <= UCHAR_MAX);
-  assert(RequestSenseLength <= UCHAR_MAX);
-
-  /* Clear buffer for cases where sense is not returned */
-  memset(RequestSenseBuf, 0, RequestSenseLength);
-
-  if (pDev[DeviceFD].avail == 0)
-    {
-      return(SCSI_ERROR);
-    }
-
-
-  memset(&sctl_io, '\0', SIZEOF(struct sctl_io));
-
-  sctl_io.flags = 0;  
-  sctl_io.max_msecs = 240000;
-  /* Set the cmd */
-  memcpy(sctl_io.cdb, CDB, CDB_Length);
-  sctl_io.cdb_length = CDB_Length;
-  /* Data buffer for results */
-  sctl_io.data = DataBuffer;
-  sctl_io.data_length = (unsigned)DataBufferLength;
-
-  switch (Direction) 
-    {
-    case Input:
-      sctl_io.flags = sctl_io.flags | SCTL_READ;
-      break;
-    case Output:
-      break;
-    }
-
-  while (--Retries > 0) {
-
-    if (pDev[DeviceFD].devopen == 0)
-      {
-        if (SCSI_OpenDevice(DeviceFD) == 0)
-          {
-            dbprintf(_("SCSI_ExecuteCommand could not open %s: %s\n"),
-                      pDev[DeviceFD].dev,
-                     strerror(errno));
-            sleep(1); /* Give device a little time befor retry */
-            continue;
-          }
-      }
-
-    DecodeSCSI(CDB, "SCSI_ExecuteCommand : ");
-    Result = ioctl(pDev[DeviceFD].fd, SIOC_IO, &sctl_io);
-    SCSI_CloseDevice(DeviceFD);
-    if (Result < 0)
-      {
-        return(SCSI_ERROR);
-      }
-    
-    SCSI_CloseDevice(DeviceFD);
-
-    memcpy(RequestSenseBuf, sctl_io.sense, RequestSenseLength);
-    
-    switch(sctl_io.cdb_status)
-      {
-      case S_GOOD:
-        return(SCSI_OK);
-
-      case S_CHECK_CONDITION:
-        return(SCSI_CHECK);
-
-      default:
-        return(SCSI_ERROR);
-      }
-  }
-  return(SCSI_ERROR);
-}
-/*
- * Send the command to the device with the
- * ioctl interface
- */
-int Tape_Ioctl( int DeviceFD, int command)
-{
-  extern OpenFiles_T *pDev;
-  struct mtop mtop;
-  int ret = 0;
-
-  if (pDev[DeviceFD].devopen == 0)
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-
-  switch (command)
-    {
-    case IOCTL_EJECT:
-      mtop.mt_op = MTOFFL;
-      mtop.mt_count = 1;
-      break;
-
-    default:
-      break;
-    }
-
-  if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0)
-    {
-      dbprintf(_("Tape_Ioctl error ioctl %s\n"), strerror(errno));
-      SCSI_CloseDevice(DeviceFD);
-      return(-1);
-    }
-
-  SCSI_CloseDevice(DeviceFD);
-  return(ret);  
-}
-
-
-
-int Tape_Status( int DeviceFD)
-{
-  extern OpenFiles_T *pDev;
-  struct mtget mtget;
-  int ret = 0;
-
-  if (pDev[DeviceFD].devopen == 0)
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-
-  if (ioctl(pDev[DeviceFD].fd, MTIOCGET, &mtget) != 0)
-  {
-     dbprintf(_("Tape_Status error ioctl %s\n"), strerror(errno));
-     SCSI_CloseDevice(DeviceFD);
-     return(-1);
-  }
-
-  dbprintf(_("ioctl -> mtget.mt_gstat %X\n"),mtget.mt_gstat);
-  if (GMT_ONLINE(mtget.mt_gstat))
-  {
-    ret = TAPE_ONLINE;
-  }
-
-  if (GMT_BOT(mtget.mt_gstat))
-  {
-    ret = ret | TAPE_BOT;
-  }
-
-  if (GMT_EOT(mtget.mt_gstat))
-  {
-    ret = ret | TAPE_EOT;
-  }
-
-  if (GMT_WR_PROT(mtget.mt_gstat))
-  {
-    ret = ret | TAPE_WR_PROT;
-  }
-
-  SCSI_CloseDevice(DeviceFD);
-  return(ret); 
-}
-
-int ScanBus(int print)
-{
-/*
-  Not yet
-*/
-  return(-1);
-}
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-file-style: gnu
- * End:
- */
diff --git a/changer-src/scsi-irix.c b/changer-src/scsi-irix.c
deleted file mode 100644 (file)
index 412a648..0000000
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: scsi-irix.c,v 1.23 2006/05/25 01:47:08 johnfranks Exp $
- *
- * Interface to execute SCSI commands on an SGI Workstation
- *
- * Copyright (c) Thomas Hepper th@ant.han.de
- */
-
-
-#include "amanda.h"
-
-#include <sys/scsi.h>
-#include <sys/dsreq.h>
-#include <sys/mtio.h>
-
-#include <scsi-defs.h>
-
-void SCSI_OS_Version()
-{
-#ifndef lint
-   static char rcsid[] = "$Id: scsi-irix.c,v 1.23 2006/05/25 01:47:08 johnfranks Exp $";
-   DebugPrint(DEBUG_INFO, SECTION_INFO, "scsi-os-layer: %s\n",rcsid);
-#endif
-}
-
-
-/*
- */
-int SCSI_OpenDevice(int ip)
-{
-  extern OpenFiles_T *pDev;
-  int DeviceFD;
-  int i;
-  
-  if (pDev[ip].inqdone == 0)
-    {
-      if ((DeviceFD = open(pDev[ip].dev, O_RDWR | O_EXCL)) >= 0)
-        {
-          pDev[ip].inqdone = 1;          pDev[ip].SCSI = 0;
-          pDev[ip].avail = 1;
-          pDev[ip].fd = DeviceFD;
-          pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE);
-          if (SCSI_Inquiry(ip, pDev[ip].inquiry, INQUIRY_SIZE) == 0)
-            {
-              if (pDev[ip].inquiry->type == TYPE_TAPE || pDev[ip].inquiry->type == TYPE_CHANGER)
-                {
-                  for (i=0;i < 16 ;i++)
-                    pDev[ip].ident[i] = pDev[ip].inquiry->prod_ident[i];
-                  for (i=15; i >= 0 && !isalnum((int)pDev[ip].ident[i]) ; i--)
-                    {
-                      pDev[ip].ident[i] = '\0';
-                    }
-                  pDev[ip].SCSI = 1;
-                  close(DeviceFD);
-
-                 if (pDev[ip].inquiry->type == TYPE_TAPE)
-                 {
-                         pDev[ip].type = stralloc("tape");
-                 }
-
-                 if (pDev[ip].inquiry->type == TYPE_CHANGER)
-                 {
-                         pDev[ip].type = stralloc("changer");
-                 }
-
-                  PrintInquiry(pDev[ip].inquiry);
-                  return(1);
-                } else { /* ! TYPE_TAPE ! TYPE_CHANGER */
-                  close(DeviceFD);
-                  free(pDev[ip].inquiry);
-                  pDev[ip].inquiry = NULL;
-                  pDev[ip].avail = 0;
-                  return(0);
-                }
-            }
-           /* inquiry failed or no SCSI communication available */
-            close(DeviceFD);
-            free(pDev[ip].inquiry);
-            pDev[ip].inquiry = NULL;
-            pDev[ip].avail = 0;
-            return(0);
-        }
-    } else {
-      if ((DeviceFD = open(pDev[ip].dev, O_RDWR | O_EXCL)) >= 0)
-        {
-          pDev[ip].fd = DeviceFD;
-          pDev[ip].devopen = 1;
-          return(1);
-        } else {
-          pDev[ip].devopen = 0;
-          return(0);
-        }
-    }
-  return(0); 
-}
-
-int SCSI_CloseDevice(int DeviceFD)
-{
-  extern OpenFiles_T *pDev;
-  int ret = 0;
-  
-  if (pDev[DeviceFD].devopen == 1)
-    {
-      pDev[DeviceFD].devopen = 0;
-      ret = close(pDev[DeviceFD].fd);
-    }
-
-  return(ret);
-}
-
-int SCSI_ExecuteCommand(int DeviceFD,
-                        Direction_T Direction,
-                        CDB_T CDB,
-                        size_t CDB_Length,
-                        void *DataBuffer,
-                        size_t DataBufferLength,
-                        RequestSense_T *pRequestSense,
-                        size_t RequestSenseLength)
-{
-  extern OpenFiles_T *pDev;
-  ExtendedRequestSense_T ExtendedRequestSense;
-  struct dsreq ds;
-  int Result;
-  int retries = 5;
-  
-  /* Basic sanity checks */
-  assert(CDB_Length <= UCHAR_MAX);
-  assert(RequestSenseLength <= UCHAR_MAX);
-
-  /* Clear buffer for cases where sense is not returned */
-  memset(pRequestSense, 0, RequestSenseLength);
-
-  if (pDev[DeviceFD].avail == 0)
-    {
-      return(SCSI_ERROR);
-    }
-  
-  memset(&ds, 0, SIZEOF(struct dsreq));
-  memset(pRequestSense, 0, RequestSenseLength);
-  memset(&ExtendedRequestSense, 0 , SIZEOF(ExtendedRequestSense_T)); 
-  
-  ds.ds_flags = DSRQ_SENSE|DSRQ_TRACE|DSRQ_PRINT; 
-  /* Timeout */
-  ds.ds_time = 120000;
-  /* Set the cmd */
-  ds.ds_cmdbuf = (caddr_t)CDB;
-  ds.ds_cmdlen = CDB_Length;
-  /* Data buffer for results */
-  ds.ds_databuf = (caddr_t)DataBuffer;
-  ds.ds_datalen = DataBufferLength;
-  /* Sense Buffer */
-  ds.ds_sensebuf = (caddr_t)pRequestSense;
-  ds.ds_senselen = RequestSenseLength;
-  
-  switch (Direction) 
-    {
-    case Input:
-      ds.ds_flags = ds.ds_flags | DSRQ_READ;
-      break;
-    case Output:
-      ds.ds_flags = ds.ds_flags | DSRQ_WRITE;
-      break;
-    }
-  
-  while (--retries > 0) {
-    if (pDev[DeviceFD].devopen == 0)
-      {
-        if (SCSI_OpenDevice(DeviceFD) == 0)
-          {
-            dbprintf(_("SCSI_ExecuteCommand could not open %s: %s\n"),
-                      pDev[DeviceFD].dev,
-                     strerror(errno));
-            sleep(1); /* Give device a little time befor retry */
-            continue;
-          }
-      }
-    Result = ioctl(pDev[DeviceFD].fd, DS_ENTER, &ds);
-    SCSI_CloseDevice(DeviceFD);
-
-    if (Result < 0)
-      {
-        RET(&ds) = DSRT_DEVSCSI;
-        SCSI_CloseDevice(DeviceFD);
-        return (SCSI_ERROR);
-      }
-    DecodeSCSI(CDB, "SCSI_ExecuteCommand : ");
-    dbprintf(_("\t\t\tSTATUS(%02X) RET(%02X)\n"), STATUS(&ds), RET(&ds));
-    switch (STATUS(&ds))
-      {
-      case ST_BUSY:                /*  BUSY */
-        break;
-
-      case STA_RESERV:             /*  RESERV CONFLICT */
-        if (retries > 0)
-          sleep(2);
-        continue;
-
-      case ST_GOOD:                /*  GOOD 0x00 */
-        switch (RET(&ds))
-          {
-          case DSRT_SENSE:
-            return(SCSI_SENSE);
-          }
-          return(SCSI_OK);
-
-      case ST_CHECK:               /*  CHECK CONDITION 0x02 */ 
-        switch (RET(&ds))
-          {
-          case DSRT_SENSE:
-            return(SCSI_SENSE);
-          }
-        return(SCSI_CHECK);
-
-      case ST_COND_MET:            /*  INTERM/GOOD 0x10 */
-      default:
-        continue;
-      }
-  }     
-  return(SCSI_ERROR);
-}
-
-int Tape_Ioctl ( int DeviceFD, int command)
-{
-  extern OpenFiles_T *pDev;
-  struct mtop mtop;
-  
-  if (pDev[DeviceFD].devopen == 0)
-    {
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-    }
-  
-  switch (command)
-    {
-    case IOCTL_EJECT:
-      mtop.mt_op = MTUNLOAD;
-      mtop.mt_count = 1;
-      break;
-    default:
-      break;
-    }
-  
-  ioctl(pDev[DeviceFD].fd, MTIOCTOP, &mtop);
-  SCSI_CloseDevice(DeviceFD);
-  return(0);
-}
-
-int Tape_Status( int DeviceFD)
-{
-  extern OpenFiles_T *pDev;
-  struct mtget mtget;
-  int ret = 0;
-
-  if (pDev[DeviceFD].devopen == 0)
-    {
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-    }
-
-  if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0)
-    {
-      dbprintf(_("Tape_Status error ioctl %s\n"),strerror(errno));
-      SCSI_CloseDevice(DeviceFD);
-      return(-1);
-    }
-  
-  switch(mtget.mt_dposn)
-    {
-    case MT_EOT:
-      ret = ret | TAPE_EOT;
-      break;
-    case MT_BOT:
-      ret = ret | TAPE_BOT;
-      break;
-    case MT_WPROT:
-      ret = ret | TAPE_WR_PROT;
-      break;
-    case MT_ONL:
-      ret = TAPE_ONLINE;
-      break;
-    case MT_EOD:
-      break;
-    case MT_FMK:
-      break;
-    default:
-      break;
-    }
-
-  SCSI_CloseDevice(DeviceFD);
-  return(ret); 
-}
-
-int ScanBus(int print)
-{
-  DIR *dir;
-  struct dirent *dirent;
-  extern OpenFiles_T *pDev;
-  extern int errno;
-  int count = 0;
-
-  if ((dir = opendir("/dev/scsi")) == NULL)
-    {
-      dbprintf(_("Can not read /dev/scsi: %s"), strerror(errno));
-      return 0;
-    }
-
-  while ((dirent = readdir(dir)) != NULL)
-    {
-      if (strstr(dirent->d_name, "sc") != NULL)
-      {
-        pDev[count].dev = malloc(10);
-        pDev[count].inqdone = 0;
-        g_sprintf(pDev[count].dev,"/dev/scsi/%s", dirent->d_name);
-        if (OpenDevice(count,pDev[count].dev, "Scan", NULL ))
-          {
-            SCSI_CloseDevice(count);
-            pDev[count].inqdone = 0;
-            
-            if (print)
-              {
-                g_printf(_("name /dev/scsi/%s "), dirent->d_name);
-                
-                switch (pDev[count].inquiry->type)
-                  {
-                  case TYPE_DISK:
-                    g_printf(_("Disk"));
-                    break;
-                  case TYPE_TAPE:
-                    g_printf(_("Tape"));
-                    break;
-                  case TYPE_PRINTER:
-                    g_printf(_("Printer"));
-                    break;
-                  case TYPE_PROCESSOR:
-                    g_printf(_("Processor"));
-                    break;
-                  case TYPE_WORM:
-                    g_printf(_("Worm"));
-                    break;
-                  case TYPE_CDROM:
-                    g_printf(_("Cdrom"));
-                    break;
-                  case TYPE_SCANNER:
-                    g_printf(_("Scanner"));
-                    break;
-                  case TYPE_OPTICAL:
-                    g_printf(_("Optical"));
-                    break;
-                  case TYPE_CHANGER:
-                    g_printf(_("Changer"));
-                    break;
-                  case TYPE_COMM:
-                    g_printf(_("Comm"));
-                    break;
-                  default:
-                    g_printf(_("unknown %d"),pDev[count].inquiry->type);
-                    break;
-                  }
-                g_printf("\n");
-              }
-            count++;
-           g_printf(_("Count %d\n"),count);
-          } else {
-            free(pDev[count].dev);
-            pDev[count].dev=NULL;
-          }
-      }
-    }
-  return 0;
-}
-
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-file-style: gnu
- * End:
- */
diff --git a/changer-src/scsi-linux.c b/changer-src/scsi-linux.c
deleted file mode 100644 (file)
index 396e897..0000000
+++ /dev/null
@@ -1,665 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: scsi-linux.c,v 1.30 2006/07/06 11:57:28 martinea Exp $
- *
- * Interface to execute SCSI commands on Linux
- *
- * Copyright (c) Thomas Hepper th@ant.han.de
- */
-
-
-#include "amanda.h"
-
-#ifdef HAVE_SCSI_SG_H
-#include <scsi/sg.h>
-#define LINUX_SG
-#endif
-
-#ifdef HAVE_SYS_MTIO_H
-#include <sys/mtio.h>
-#endif
-
-#include <scsi-defs.h>
-
-extern OpenFiles_T *pDev;
-
-void SCSI_OS_Version(void)
-{
-#ifndef lint
-   static char rcsid[] = "$Id: scsi-linux.c,v 1.30 2006/07/06 11:57:28 martinea Exp $";
-   DebugPrint(DEBUG_ERROR, SECTION_INFO, "scsi-os-layer: %s\n",rcsid);
-#endif
-}
-
-int SCSI_CloseDevice(int DeviceFD)
-{
-  int ret = 0;
-  
-  if (pDev[DeviceFD].devopen == 1)
-    {
-      pDev[DeviceFD].devopen = 0;
-      ret = close(pDev[DeviceFD].fd);
-    }
-
-  return(ret);
-}
-
-/* Open a device to talk to an scsi device, either per ioctl, or
- * direct writing....
- * Return:
- * 0 -> error
- * 1 -> OK
- *
- * TODO:
- * Define some readable defs for the falgs which can be set (like in the AIX dreiver)
- *
- */
-#ifdef LINUX_SG
-int SCSI_OpenDevice(int ip)
-{
-  int DeviceFD;
-  int i;
-  int timeout;
-  struct stat pstat;
-  char *buffer = NULL ;           /* Will contain the device name after checking */
-  int openmode = O_RDONLY;
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_OpenDevice\n"));
-  if (pDev[ip].inqdone == 0)
-    {
-      pDev[ip].inqdone = 1;
-      if (strncmp("/dev/sg", pDev[ip].dev, 7) != 0) /* Check if no sg device for an link .... */
-        {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : checking if %s is a sg device\n"), pDev[ip].dev);
-          if (lstat(pDev[ip].dev, &pstat) != -1)
-            {
-              if (S_ISLNK(pstat.st_mode) == 1)
-                {
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : is a link, checking destination\n"));
-                  if ((buffer = (char *)malloc(513)) == NULL)
-                    {
-                      DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_OpenDevice : malloc failed\n"));
-                      return(0);
-                    }
-                  memset(buffer, 0, 513);
-                  if (( i = readlink(pDev[ip].dev, buffer, 512)) == -1)
-                    {
-                      if (errno == ENAMETOOLONG )
-                        {
-                        } else {
-                          pDev[ip].SCSI = 0;
-                        }
-                    }
-                  if ( i >= 7)
-                    {
-                      if (strncmp("/dev/sg", buffer, 7) == 0)
-                        {
-                          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : link points to %s\n"), buffer) ;
-                          pDev[ip].flags = 1;
-                        }
-                    }
-                } else {/* S_ISLNK(pstat.st_mode) == 1 */
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("No link %s\n"), pDev[ip].dev) ;
-                  buffer = stralloc(pDev[ip].dev);
-                }
-            } else {/* lstat(DeviceName, &pstat) != -1 */ 
-              DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("can't stat device %s\n"), pDev[ip].dev);
-              return(0);
-            }
-        } else {
-          buffer = stralloc(pDev[ip].dev);
-          pDev[ip].flags = 1;
-        }
-      
-      if (pDev[ip].flags == 1)
-        {
-          openmode = O_RDWR;
-        }
-      
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Try to open %s\n"), buffer);
-      if ((DeviceFD = open(buffer, openmode)) >= 0)
-        {
-          pDev[ip].avail = 1;
-          pDev[ip].devopen = 1;
-          pDev[ip].fd = DeviceFD;
-        } else {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice open failed\n"));
-         amfree(buffer);
-          return(0);
-        }
-      
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("done\n"));
-      if ( pDev[ip].flags == 1)
-        {
-          pDev[ip].SCSI = 1;
-        }
-      
-      pDev[ip].dev = buffer;
-      if (pDev[ip].SCSI == 1)
-        {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : use SG interface\n"));
-          if ((timeout = ioctl(pDev[ip].fd, SG_GET_TIMEOUT)) > 0) 
-            {
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : current timeout %d\n"), timeout);
-              timeout = 60000;
-              if (ioctl(pDev[ip].fd, SG_SET_TIMEOUT, &timeout) == 0)
-                {
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : timeout set to %d\n"), timeout);
-                }
-            }
-          pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE);
-          if (SCSI_Inquiry(ip, pDev[ip].inquiry, (u_char)INQUIRY_SIZE) == 0)
-            {
-              if (pDev[ip].inquiry->type == TYPE_TAPE || pDev[ip].inquiry->type == TYPE_CHANGER)
-                {
-                  for (i=0;i < 16;i++)
-                    pDev[ip].ident[i] = pDev[ip].inquiry->prod_ident[i];
-                  for (i=15; i >= 0 && !isalnum(pDev[ip].ident[i]); i--)
-                    {
-                      pDev[ip].ident[i] = '\0';
-                    }
-                  pDev[ip].SCSI = 1;
-
-                 if (pDev[ip].inquiry->type == TYPE_TAPE)
-                 {
-                         pDev[ip].type = stralloc("tape");
-                 }
-
-                 if (pDev[ip].inquiry->type == TYPE_CHANGER)
-                 {
-                         pDev[ip].type = stralloc("changer");
-                 }
-
-                  PrintInquiry(pDev[ip].inquiry);
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n"));
-                  return(1);
-                } else {
-                  close(DeviceFD);
-                  amfree(pDev[ip].inquiry);
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (0)\n"));
-                  return(0);
-                }
-            } else {
-              pDev[ip].SCSI = 0;
-              pDev[ip].devopen = 0;
-              close(DeviceFD);
-              amfree(pDev[ip].inquiry);
-              pDev[ip].inquiry = NULL;
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n"));
-              return(1);
-            }
-        } else /* if (pDev[ip].SCSI == 1) */ {  
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Device not capable for SCSI commands\n"));
-          pDev[ip].SCSI = 0;
-          pDev[ip].devopen = 0;
-          close(DeviceFD);
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n"));
-          return(1);
-        }
-    } else { /* if (pDev[ip].inqdone == 0) */
-      if (pDev[ip].flags == 1)
-        {
-          openmode = O_RDWR;
-        } else {
-          openmode = O_RDONLY;
-        }
-      if ((DeviceFD = open(pDev[ip].dev, openmode)) >= 0)
-        {
-          pDev[ip].devopen = 1;
-          pDev[ip].fd = DeviceFD;
-          if (pDev[ip].flags == 1)
-            {
-              if ((timeout = ioctl(pDev[ip].fd, SG_GET_TIMEOUT)) > 0) 
-                {
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : current timeout %d\n"), timeout);
-                  timeout = 60000;
-                  if (ioctl(pDev[ip].fd, SG_SET_TIMEOUT, &timeout) == 0)
-                    {
-                      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : timeout set to %d\n"), timeout);
-                    }
-                }
-            }
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n"));
-          return(1);
-        } else {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice open failed\n"));
-          return(0);
-        }
-    }
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice should not happen !!\n"));
-  return(0);
-}
-
-#define SCSI_OFF SIZEOF(struct sg_header)
-int SCSI_ExecuteCommand(int DeviceFD,
-                        Direction_T Direction,
-                        CDB_T CDB,
-                        size_t CDB_Length,
-                        void *DataBuffer,
-                        size_t DataBufferLength,
-                        RequestSense_T *pRequestSense,
-                        size_t RequestSenseLength)
-{
-  struct sg_header *psg_header;
-  char *buffer;
-  size_t osize = 0;
-  ssize_t status;
-
-  /* Basic sanity checks */
-  assert(CDB_Length <= UCHAR_MAX);
-  assert(RequestSenseLength <= UCHAR_MAX);
-
-  /* Clear buffer for cases where sense is not returned */
-  memset(pRequestSense, 0, RequestSenseLength);
-
-  if (pDev[DeviceFD].avail == 0)
-    {
-      return(-1);
-    }
-
-  if (pDev[DeviceFD].devopen == 0)
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-  
-  if (SCSI_OFF + CDB_Length + DataBufferLength > 4096) 
-    {
-      SCSI_CloseDevice(DeviceFD);
-      return(-1);
-    }
-
-  buffer = (char *)malloc(SCSI_OFF + CDB_Length + DataBufferLength);
-  if (buffer == NULL)
-    {
-      dbprintf(_("SCSI_ExecuteCommand memory allocation failure.\n"));
-      SCSI_CloseDevice(DeviceFD);
-      return(-1);
-    }
-  memset(buffer, 0, SCSI_OFF + CDB_Length + DataBufferLength);
-  memcpy(buffer + SCSI_OFF, CDB, CDB_Length);
-  
-  psg_header = (struct sg_header *)buffer;
-  if (CDB_Length >= 12)
-    {
-      psg_header->twelve_byte = 1;
-    } else {
-      psg_header->twelve_byte = 0;
-    }
-  psg_header->result = 0;
-  psg_header->reply_len = (int)(SCSI_OFF + DataBufferLength);
-  
-  switch (Direction)
-    {
-    case Input:
-      osize = 0;
-      break;
-    case Output:
-      osize = DataBufferLength;
-      break;
-    }
-  
-  DecodeSCSI(CDB, "SCSI_ExecuteCommand : ");
-  
-  status = write(pDev[DeviceFD].fd, buffer, SCSI_OFF + CDB_Length + osize);
-  if ( (status < (ssize_t)0) ||
-       (status != (ssize_t)(SCSI_OFF + CDB_Length + osize)) ||
-       (psg_header->result != 0)) 
-    {
-      dbprintf(_("SCSI_ExecuteCommand error send \n"));
-      SCSI_CloseDevice(DeviceFD);
-      amfree(buffer);
-      return(SCSI_ERROR);
-    }
-  
-  memset(buffer, 0, SCSI_OFF + DataBufferLength);
-  status = read(pDev[DeviceFD].fd, buffer, SCSI_OFF + DataBufferLength);
-  memset(pRequestSense, 0, RequestSenseLength);
-  memcpy(pRequestSense, psg_header->sense_buffer, 16);
-  
-  if ( (status < 0) ||
-       (status != (ssize_t)(SCSI_OFF + DataBufferLength)) || 
-       (psg_header->result != 0)) 
-    { 
-      dbprintf(_("SCSI_ExecuteCommand error read \n"));
-      dbprintf(_("Status %zd (%zd) %2X\n"), status, SCSI_OFF + DataBufferLength,psg_header->result );
-      SCSI_CloseDevice(DeviceFD);
-      amfree(buffer);
-      return(SCSI_ERROR);
-    }
-
-  if (DataBufferLength)
-    {
-       memcpy(DataBuffer, buffer + SCSI_OFF, DataBufferLength);
-    }
-
-  SCSI_CloseDevice(DeviceFD);
-  amfree(buffer);
-  return(SCSI_OK);
-}
-
-#else
-
-static inline int min(int x, int y)
-{
-  return (x < y ? x : y);
-}
-
-
-static inline int max(int x, int y)
-{
-  return (x > y ? x : y);
-}
-
-int SCSI_OpenDevice(int ip)
-{
-  int DeviceFD;
-  int i;
-
-  if (pDev[ip].inqdone == 0)
-    {
-      pDev[ip].inqdone = 1;
-      if ((DeviceFD = open(pDev[ip].dev, O_RDWR)) >= 0)
-        {
-          pDev[ip].avail = 1;
-          pDev[ip].fd = DeviceFD;
-          pDev[ip].SCSI = 0;
-          pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE);
-          dbprintf(_("SCSI_OpenDevice : use ioctl interface\n"));
-          if (SCSI_Inquiry(ip, pDev[ip].inquiry, (u_char)INQUIRY_SIZE) == 0)
-            {
-              if (pDev[ip].inquiry->type == TYPE_TAPE || pDev[ip].inquiry->type == TYPE_CHANGER)
-                {
-                  for (i=0;i < 16 && pDev[ip].inquiry->prod_ident[i] != ' ';i++)
-                    pDev[ip].ident[i] = pDev[ip].inquiry->prod_ident[i];
-                  pDev[ip].ident[i] = '\0';
-                  pDev[ip].SCSI = 1;
-                  PrintInquiry(pDev[ip].inquiry);
-                  return(1);
-                } else {
-                  amfree(pDev[ip].inquiry);
-                  close(DeviceFD);
-                  return(0);
-                }
-            } else {
-              close(DeviceFD);
-              amfree(pDev[ip].inquiry);
-              pDev[ip].inquiry = NULL;
-              return(1);
-            }
-        }
-      return(1); 
-    } else {
-      if ((DeviceFD = open(pDev[ip].dev, O_RDWR)) >= 0)
-        {
-          pDev[ip].fd = DeviceFD;
-          pDev[ip].devopen = 1;
-          return(1);
-        } else {
-          pDev[ip].devopen = 0;
-          return(0);
-        }
-    }
-}
-
-int SCSI_ExecuteCommand(int DeviceFD,
-                        Direction_T Direction,
-                        CDB_T CDB,
-                        int CDB_Length,
-                        void *DataBuffer,
-                        int DataBufferLength,
-                        RequestSense_T *pRequestSense,
-                        int RequestSenseLength)
-{
-  unsigned char *Command;
-  int Zero = 0, Result;
-  if (pDev[DeviceFD].avail == 0)
-    {
-      return(SCSI_ERROR);
-    }
-
-  if (pDev[DeviceFD].devopen == 0)
-    {
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-    }
-
-  memset(pRequestSense, 0, RequestSenseLength);
-  switch (Direction)
-    {
-    case Input:
-      Command = (unsigned char *)
-        malloc(8 + max(DataBufferLength, RequestSenseLength));
-      memcpy(&Command[0], &Zero, 4);
-      memcpy(&Command[4], &DataBufferLength, 4);
-      memcpy(&Command[8], CDB, CDB_Length);
-      break;
-    case Output:
-      Command = (unsigned char *)
-        malloc(8 + max(CDB_Length + DataBufferLength, RequestSenseLength));
-      memcpy(&Command[0], &DataBufferLength, 4);
-      memcpy(&Command[4], &Zero, 4);
-      memcpy(&Command[8], CDB, CDB_Length);
-      memcpy(&Command[8 + CDB_Length], DataBuffer, DataBufferLength);
-      break;
-    }
-  
-  DecodeSCSI(CDB, "SCSI_ExecuteCommand : ");
-  
-  Result = ioctl(pDev[DeviceFD].fd, SCSI_IOCTL_SEND_COMMAND, Command);
-  if (Result != 0)
-    memcpy(pRequestSense, &Command[8], RequestSenseLength);
-  else if (Direction == Input)
-    memcpy(DataBuffer, &Command[8], DataBufferLength);
-  amfree(Command);
-  SCSI_CloseDevice(DeviceFD);
-
-  switch(Result)
-    {
-      case 0:
-        return(SCSI_OK);
-        break;
-    default:
-      return(SCSI_SENSE);
-      break;
-    }
-}
-#endif
-
-/*
- * Send the command to the device with the
- * ioctl interface
- */
-int Tape_Ioctl( int DeviceFD, int command)
-{
-  struct mtop mtop;
-  int ret = 0;
-
-  if (pDev[DeviceFD].devopen == 0)
-    {
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-    }
-
-  switch (command)
-    {
-    case IOCTL_EJECT:
-      mtop.mt_op = MTOFFL;
-      mtop.mt_count = 1;
-      break;
-     default:
-      break;
-    }
-
-  if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0)
-    {
-      dbprintf(_("Tape_Ioctl error ioctl %s\n"),strerror(errno));
-      SCSI_CloseDevice(DeviceFD);
-      return(-1);
-    }
-
-  SCSI_CloseDevice(DeviceFD);
-  return(ret);  
-}
-
-int Tape_Status( int DeviceFD)
-{
-  struct mtget mtget;
-  int ret = 0;
-
-  memset(&mtget, 0, SIZEOF(mtget));
-  if (pDev[DeviceFD].devopen == 0)
-    {
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-    }
-
-  if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0)
-  {
-     DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Tape_Status error ioctl %s\n"),
-               strerror(errno));
-     SCSI_CloseDevice(DeviceFD);
-     return(-1);
-  }
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("ioctl -> mtget.mt_gstat %lX\n"),mtget.mt_gstat);
-  if (GMT_ONLINE(mtget.mt_gstat))
-    {
-      ret = TAPE_ONLINE;
-    }
-  
-  if (GMT_BOT(mtget.mt_gstat))
-    {
-      ret = ret | TAPE_BOT;
-    }
-  
-  if (GMT_EOT(mtget.mt_gstat))
-    {
-      ret = ret | TAPE_EOT;
-    }
-  
-  if (GMT_WR_PROT(mtget.mt_gstat))
-    {
-      ret = ret | TAPE_WR_PROT;
-    }
-  
-  if (GMT_DR_OPEN(mtget.mt_gstat))
-    {
-      ret = ret | TAPE_NOT_LOADED;
-    }
-  
-  SCSI_CloseDevice(DeviceFD);
-  return(ret); 
-}
-
-/*
- * This functions scan all /dev/sg* devices
- * It opens the device an print the result of the inquiry 
- *
- */
-int ScanBus(int print)
-{
-  DIR *dir;
-  struct dirent *dirent;
-  int count = 0;
-
-  if ((dir = opendir("/dev/")) == NULL)
-    {
-      dbprintf(_("/dev/ error: %s"), strerror(errno));
-      return 0;
-    }
-
-  while ((dirent = readdir(dir)) != NULL)
-    {
-      if (strstr(dirent->d_name, "sg") != NULL)
-      {
-        pDev[count].dev = malloc(10);
-        pDev[count].inqdone = 0;
-        g_snprintf(pDev[count].dev, SIZEOF(pDev[count].dev),
-           "/dev/%s", dirent->d_name);
-        if (OpenDevice(count,pDev[count].dev, "Scan", NULL ))
-          {
-            SCSI_CloseDevice(count);
-            pDev[count].inqdone = 0;
-            
-            if (print)
-              {
-                g_printf(_("name /dev/%s "), dirent->d_name);
-                
-                switch (pDev[count].inquiry->type)
-                  {
-                  case TYPE_DISK:
-                    g_printf(_("Disk"));
-                    break;
-                  case TYPE_TAPE:
-                    g_printf(_("Tape"));
-                    break;
-                  case TYPE_PRINTER:
-                    g_printf(_("Printer"));
-                    break;
-                  case TYPE_PROCESSOR:
-                    g_printf(_("Processor"));
-                    break;
-                  case TYPE_WORM:
-                    g_printf(_("Worm"));
-                    break;
-                  case TYPE_CDROM:
-                    g_printf(_("Cdrom"));
-                    break;
-                  case TYPE_SCANNER:
-                    g_printf(_("Scanner"));
-                    break;
-                  case TYPE_OPTICAL:
-                    g_printf(_("Optical"));
-                    break;
-                  case TYPE_CHANGER:
-                    g_printf(_("Changer"));
-                    break;
-                  case TYPE_COMM:
-                    g_printf(_("Comm"));
-                    break;
-                  default:
-                    g_printf(_("unknown %d"),pDev[count].inquiry->type);
-                    break;
-                  }
-                g_printf("\n");
-              }
-            count++;
-           g_printf(_("Count %d\n"),count);
-          } else {
-            amfree(pDev[count].dev);
-            pDev[count].dev=NULL;
-          }
-      }
-    }
-  return 0;
-}
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-file-style: gnu
- * End:
- */
diff --git a/changer-src/scsi-proto.c b/changer-src/scsi-proto.c
deleted file mode 100644 (file)
index 4c53d17..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *     $Id: scsi-proto.c,v 1.4 2006/05/25 01:47:10 johnfranks Exp $
- *
- *     scsi-proto.c -- library routines to handle the changer
- *                     Prototype file for customization
- *
- *     Author: Eric Schnoebelen, eric@cirr.com
- *     interface based on work by: Larry Pyeatt, pyeatt@cs.colostate.edu 
- *     Copyright: 1997, 1998 Eric Schnoebelen
- *             
- *      Michael C. Povel 03.06.98 added dummy for eject_tape
- */
-
-#include "config.h"
-#include "amanda.h"
-#include "libscsi.h"
-
-char *modname = "@(#)" __FILE__
-               ": SCSI support library for the proto scsi interface @(#)";
-
-/* 
- * this routine checks a specified slot to see if it is empty 
- */
-int isempty(int fd, int slot)
-{
-    /*
-     * ask the robotics, which have knowledge of the storage elements
-     * if the requested slot is empty.
-     *
-     * nslot available for use when the number of slots needs to be known
-     * to allocate memory.
-     */
-    return (slot_empty? 1 : 0);
-}
-
-int get_clean_state(char *dev)
-{
-   /* Ask the device, if it needs a cleaning */
-    return (needs_cleaning? 1 : 0);
-
-}
-
-/*
- *
- */
-void eject_tape(char *tape)
-/* This function ejects the tape from the drive */
-{
-    eject_it;
-}
-
-
-/*
- * find the first empty slot 
- */
-int find_empty( int fd, int start, int end)
-{
-    /*
-     * find an empty slot to insert a tape into (if required)
-     *
-     * loop through the list of slots, checking see if it is currently 
-     * occupied.
-     */
-    return (emtpy_slot);
-}
-
-/*
- * returns one if there is a tape loaded in the drive 
- */
-int drive_loaded(int fd, int drivenum)
-{
-    /*
-     * check the status of the transport (tape drive).
-     *
-     * return 1 if the drive is occupied, 0 otherwise.
-     */
-    return (occupied ? 1 : 0);
-}
-
-
-/*
- * unloads the drive, putting the tape in the specified slot 
- */
-int unload(int fd, int drive, int slot)
-{
-    /*
-     * unload the specified drive into the specified slot
-     * (storage element)
-     */
-    return (success);
-}
-
-
-/*
- * moves tape from the specified slot into the drive 
- */
-int load(int fd, int drive, int slot)
-{
-    /*
-     * load the media from the specified element (slot) into the
-     * specified data transfer unit (drive)
-     */
-    return (success);
-}
-
-int get_slot_count(int fd)
-{ 
-
-    /*
-     * return the number of slots in the robot 
-     * to the caller 
-     */
-
-    return number_of_storage_elements;
-}
-
-int get_drive_count(int fd)
-{ 
-
-    /*
-     * retreive the number of data-transfer devices
-     */
-    return number_of_data-transfer_devices;
-}
diff --git a/changer-src/scsi-solaris.c b/changer-src/scsi-solaris.c
deleted file mode 100644 (file)
index 33cf875..0000000
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: scsi-solaris.c,v 1.26 2006/05/25 01:47:10 johnfranks Exp $
- *
- * Interface to execute SCSI commands on an Sun Workstation
- *
- * Copyright (c) Thomas Hepper th@ant.han.de
- */
-
-
-#include "amanda.h"
-
-#include <sys/scsi/impl/uscsi.h>
-
-#include <scsi-defs.h>
-#include <sys/mtio.h>
-
-void SCSI_OS_Version(void)
-{
-#ifndef lint
-   static char rcsid[] = "$Id: scsi-solaris.c,v 1.26 2006/05/25 01:47:10 johnfranks Exp $";
-   DebugPrint(DEBUG_INFO, SECTION_INFO, "scsi-os-layer: %s\n",rcsid);
-#endif
-}
-
-int SCSI_OpenDevice(int ip)
-{
-  int DeviceFD;
-  int i;
-  extern OpenFiles_T *pDev;
-
-  if (pDev[ip].inqdone == 0)
-    {
-      pDev[ip].inqdone = 1;
-      if ((DeviceFD = open(pDev[ip].dev, O_RDWR| O_NONBLOCK)) >= 0)
-        {
-          pDev[ip].avail = 1;
-          pDev[ip].fd = DeviceFD;
-          pDev[ip].SCSI = 0;
-          pDev[ip].devopen = 1;
-          pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE);
-          
-          if (SCSI_Inquiry(ip, pDev[ip].inquiry, (unsigned char)INQUIRY_SIZE) == 0)
-            {
-              if (pDev[ip].inquiry->type == TYPE_TAPE || pDev[ip].inquiry->type == TYPE_CHANGER)
-                {
-                  for (i=0;i < 16;i++)
-                    pDev[ip].ident[i] = pDev[ip].inquiry->prod_ident[i];
-                  for (i=15; i >= 0 && !isalnum((int)pDev[ip].ident[i]) ; i--)
-                    {
-                      pDev[ip].ident[i] = '\0';
-                    }
-                  pDev[ip].SCSI = 1;
-
-                 if (pDev[ip].inquiry->type == TYPE_TAPE)
-                 {
-                         pDev[ip].type = stralloc("tape");
-                 }
-
-                 if (pDev[ip].inquiry->type == TYPE_CHANGER)
-                 {
-                         pDev[ip].type = stralloc("changer");
-                 }
-
-                  PrintInquiry(pDev[ip].inquiry);
-                  return(1);
-                } else {
-                  close(DeviceFD);
-                  free(pDev[ip].inquiry);
-                  return(0);
-                }
-            }
-            free(pDev[ip].inquiry);
-            pDev[ip].inquiry = NULL;
-            return(1);
-        } else {
-          dbprintf(_("SCSI_OpenDevice %s failed\n"), pDev[ip].dev);
-          return(0);
-        }
-    } else {
-      if ((DeviceFD = open(pDev[ip].dev, O_RDWR| O_NDELAY)) >= 0)
-        {
-          pDev[ip].fd = DeviceFD;
-          pDev[ip].devopen = 1;
-          return(1);
-        }
-    }
-  return(0); 
-}
-
-
-int SCSI_CloseDevice(int DeviceFD)
-{
-  int ret;
-  extern OpenFiles_T *pDev;
-
-  ret = close(pDev[DeviceFD].fd);
-  pDev[DeviceFD].devopen = 0;
-  return(ret);
-}
-
-
-int SCSI_ExecuteCommand(int DeviceFD,
-                        Direction_T Direction,
-                        CDB_T CDB,
-                        size_t CDB_Length,
-                        void *DataBuffer,
-                        size_t DataBufferLength,
-                        RequestSense_T *RequestSense,
-                        size_t RequestSenseLength)
-{
-  extern OpenFiles_T *pDev;
-  extern FILE * debug_file;
-  int ret = 0;
-  int retries = 1;
-  struct uscsi_cmd Command;
-  static int depth = 0;
-
-  /* Basic sanity checks */
-  assert(CDB_Length <= UCHAR_MAX);
-  assert(RequestSenseLength <= UCHAR_MAX);
-
-  /* Clear buffer for cases where sense is not returned */
-  memset(RequestSense, 0, RequestSenseLength);
-
-  if (pDev[DeviceFD].avail == 0)
-    {
-      return(SCSI_ERROR);
-    }
-  
-  if (depth++ > 2)
-  {
-     --depth;
-     SCSI_CloseDevice(DeviceFD);
-     return SCSI_ERROR;
-  }
-  memset(&Command, 0, SIZEOF(struct uscsi_cmd));
-  memset(RequestSense, 0, RequestSenseLength);
-  switch (Direction)
-    {
-    case Input:
-      if (DataBufferLength > 0)
-        memset(DataBuffer, 0, DataBufferLength);
-
-      /* Command.uscsi_flags =  USCSI_READ | USCSI_RQENABLE;    */
-      Command.uscsi_flags = USCSI_DIAGNOSE | USCSI_ISOLATE
-        | USCSI_READ | USCSI_RQENABLE;
-      break;
-    case Output:
-      /* Command.uscsi_flags =  USCSI_WRITE | USCSI_RQENABLE;   */
-      Command.uscsi_flags = USCSI_DIAGNOSE | USCSI_ISOLATE
-        | USCSI_WRITE | USCSI_RQENABLE;
-      break;
-    }
-  /* Set timeout to 5 minutes. */
-  Command.uscsi_timeout = 300;
-  Command.uscsi_cdb = (caddr_t) CDB;
-  Command.uscsi_cdblen = (u_char)CDB_Length;
-
-  if (DataBufferLength > 0)
-    {  
-      Command.uscsi_bufaddr = DataBuffer;
-      Command.uscsi_buflen = DataBufferLength;
-    } else {
-/*
- * If there is no data buffer force the direction to write, read with
- * a null buffer will fail (errno 22)
- */
-      Command.uscsi_flags = USCSI_DIAGNOSE | USCSI_ISOLATE
-        | USCSI_WRITE | USCSI_RQENABLE;
-   }
-
-  Command.uscsi_rqbuf = (caddr_t)RequestSense;
-  Command.uscsi_rqlen = (u_char)RequestSenseLength;
-  DecodeSCSI(CDB, "SCSI_ExecuteCommand : ");
-  while (retries > 0)
-  {
-    if (pDev[DeviceFD].devopen == 0)
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-        {
-         sleep(1);
-         continue;
-        }
-
-    if ((ret = ioctl(pDev[DeviceFD].fd, USCSICMD, &Command)) >= 0)
-    {
-      ret = Command.uscsi_status;
-      break;
-    }
-    dbprintf(_("ioctl on %d failed, errno %s, ret %d\n"),
-             pDev[DeviceFD].fd, strerror(errno), ret);
-#if 0
-    RequestSense(DeviceFD, &pExtendedRequestSense, 0);
-#endif
-    DecodeSense(RequestSense, "SCSI_ExecuteCommand:", debug_file);
-    retries--;
-  }
-  --depth;
-  SCSI_CloseDevice(DeviceFD);
-
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("ioctl ret (%d)\n"),ret);
-  return(SCSI_OK);
-}
-
-/*
- * Send the command to the device with the
- * ioctl interface
- */
-int Tape_Ioctl( int DeviceFD, int command)
-{
-  extern OpenFiles_T *pDev;
-  struct mtop mtop;
-  int ret = 0;
-
-  if (pDev[DeviceFD].devopen == 0)
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-
-  switch (command)
-    {
-    case IOCTL_EJECT:
-      mtop.mt_op = MTOFFL;
-      mtop.mt_count = 1;
-      break;
-     default:
-      break;
-    }
-
-  if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0)
-    {
-      dbprintf(_("Tape_Ioctl error ioctl %s\n"), strerror(errno));
-      SCSI_CloseDevice(DeviceFD);
-      return(-1);
-    }
-
-  SCSI_CloseDevice(DeviceFD);
-  return(ret);  
-}
-
-int Tape_Status( int DeviceFD)
-{
-  extern OpenFiles_T *pDev;
-  struct mtget mtget;
-  int ret = -1;
-
-  memset(&mtget, 0, SIZEOF(mtget));
-  if (pDev[DeviceFD].devopen == 0)
-      if (SCSI_OpenDevice(DeviceFD) == 0)
-          return(-1);
-  
-  if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0)
-    {
-      dbprintf(_("Tape_Status error ioctl %s\n"), strerror(errno));
-      SCSI_CloseDevice(DeviceFD);
-      return(-1);
-    }
-
-  /*
-   * I have no idea what is the meaning of the bits in mt_erreg
-   * I assume that nothing set is tape loaded
-   * 0x2 is no tape online
-   */
-
-  DebugPrint(DEBUG_INFO, SECTION_TAPE, _("ioctl result for mt_dsreg (%d)\n"), mtget.mt_dsreg);
-  DebugPrint(DEBUG_INFO, SECTION_TAPE, _("ioctl result for mt_erreg (%d)\n"), mtget.mt_erreg);
-
-  if (mtget.mt_erreg == 0)
-    {
-      ret = ret | TAPE_ONLINE;
-    }
-
-  if (mtget.mt_erreg & 0x2)
-    {
-      ret = ret | TAPE_NOT_LOADED;
-    }
-
-  SCSI_CloseDevice(DeviceFD);
-
-  return(ret); 
-}
-
-int ScanBus(int print)
-{
-       (void)print;    /* Quiet unused parameter warning */
-       return(-1);
-}
-
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * c-file-style: gnu
- * End:
- */
diff --git a/changer-src/sense.c b/changer-src/sense.c
deleted file mode 100644 (file)
index cca3904..0000000
+++ /dev/null
@@ -1,936 +0,0 @@
-#include "amanda.h"
-
-#include "scsi-defs.h"
-/*
- Handling of Sense codes which are returned from the device
- At the moment the following status us returned
- SENSE_ABORT           -> -1 , some strange happend, abort everything
- SENSE_IGNORE          -> 0 , nothing special, only info
- SENSE_NO_TAPE         -> 1 , this is for tape devices, not tape online (not used any longer ??)
- SENSE_RETRY           -> 2 , retry the command
- SENSE_IES             -> 3 , initialize element status
- SENSE_TAPE_NOT_LOADED         -> 4 , no tape loaded
- SENSE_NO                      -> 5 , no sense information
- SENSE_TAPE_NOT_UNLOADED -> 6 , tape is not ejected
- SENSE_IES             -> FF , Sense from initialize element status
- */
-
-       SenseType_T SenseType [] = {
-/*
- * Generic one, this is used if not information is found based on the ident of the device
- */
-       { "generic", "", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
-       { "generic", "", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "generic", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
-       { "generic", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
-
-       { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
-       { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("The drive is not ready, but it is in the process of becoming ready")},
-       { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "generic", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "generic", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
-       { "generic", "", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
-
-       { "generic", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
-       { "generic", "", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
-
-       { "generic", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "generic", "", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "generic", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "generic", "", TYPE_TAPE,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "generic", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-
-       { "generic", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
-       { "generic", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "generic", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
-       { "generic", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
-
-       { "generic", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
-       { "generic", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "generic", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "generic", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
-       { "generic", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
-
-       { "generic", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
-       { "generic", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
-
-       { "generic", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "generic", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "generic", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "generic", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "generic", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-
-       { "generic", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-/*
- *
- * ADIC DAT Autochanger
- *
- */
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
-
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
-
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
-
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x28, 0x01, SENSE_IES, T_("Door opend")},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-
-       { "DAT AutoChanger", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-
-/*
- *
- *     L500 (for the L500 ATL library)
- * */
-
-       { "L500", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
-       { "L500", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0a, 0x0, SENSE_IGNORE, T_("Error Log overflow")},
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x44, 0xc1, SENSE_IGNORE, T_("EEPROM Copy 1 bad")},
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x44, 0xc2, SENSE_IGNORE, T_("EEPROM Copy 2 bad")},
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x47, 0x0, SENSE_IGNORE, T_("SCSI parity error")},
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x48, 0x0, SENSE_IGNORE, T_("SCSI IDE message received")},
-       { "L500", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
-
-       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_ABORT, T_("Scsi port not initialized")},
-       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x04, 0x01, SENSE_RETRY, T_("Becoming ready, scanning magazines, etc")},
-       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x04, 0x03, SENSE_ABORT, T_("Unit not ready: manual intervention required: Door Open")},
-/* needed? */
-       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "L500", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-/*     Not used by L500
-       { "L500", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
-       { "L500", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
-*/
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0,  0x0,  SENSE_ABORT, T_("Hardware Error")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x3a, 0x80, SENSE_ABORT, T_("Media not present")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x40, 0x84, SENSE_ABORT, T_("POST soft failure")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x80, SENSE_ABORT, T_("Loader Communications timeout")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x81, SENSE_ABORT, T_("Loader communications UART error or buffer overflow")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x86, SENSE_ABORT, T_("bad status returned from loader")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0xc3, SENSE_ABORT, T_("EEPROM both copies bad")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0xff, SENSE_ABORT, T_("Unexpected status from test")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x70, SENSE_ABORT, T_("Cartridge has no home")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x71, SENSE_ABORT, T_("Loader mechanism problem")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x72, SENSE_ABORT, T_("Tape drive handle problem")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x73, SENSE_IGNORE, T_("No cartridge in drive during unload")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x74, SENSE_ABORT, T_("Loader mechanism problem, after retries")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x75, SENSE_ABORT, T_("Timeout moving cartridge from drive")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x76, SENSE_ABORT, T_("Timeout unloading cartridge into slot")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x77, SENSE_ABORT, T_("Couldn't unlock door after retries")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x78, SENSE_ABORT, T_("Error during SCAN MAGAZINE")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x79, SENSE_ABORT, T_("Couldn't lock door after retries")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x80, SENSE_ABORT, T_("Unexpected door open")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x81, SENSE_ABORT, T_("Didn't find all expected slots during elevator movement")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x82, SENSE_ABORT, T_("Cartridge alreay in drive during LOAD CARTRIDGE")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x83, SENSE_ABORT, T_("Slot empty during LOAD CARTRIDGE")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x84, SENSE_ABORT, T_("Cleaning Tape expired")},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x85, SENSE_ABORT, T_("Cleaning Failed")},
-       { "L500", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR,   UCHAR_MAX,   UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
-
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0,   SENSE_ABORT, T_("Illegal Request")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x1a, 0x0,  SENSE_ABORT, T_("Parameter length error")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x20, 0x0,  SENSE_ABORT, T_("SCSI invalid opcode")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, T_("Invalid element address")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x00, SENSE_ABORT, T_("Invalid CDB")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x81, SENSE_ABORT, T_("Invalid mode on WRITE BUFFER")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x82, SENSE_ABORT, T_("Invalid drive specified")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x83, SENSE_ABORT, T_("SEND DIAG Invalid test number")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x86, SENSE_ABORT, T_("Invalid offset on WRITE BUFFER")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x87, SENSE_ABORT, T_("Invalid size on WRITE BUFFER")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x89, SENSE_ABORT, T_("Image data too large on WRITE BUFFER")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8b, SENSE_ABORT, T_("Invalid image for CUP")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8c, SENSE_ABORT, T_("Non-immediate command during CUP")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8e, SENSE_ABORT, T_("Invalid personality for CUP")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8f, SENSE_ABORT, T_("Bad controller image EDC")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x25, 0x0,  SENSE_ABORT, T_("Invalid LUN")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x26, 0x0,  SENSE_ABORT, T_("Parameter list error: invalid field")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x26, 0x01, SENSE_ABORT, T_("Parameter list error: parameter not supported")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x39, 0x0,  SENSE_ABORT, T_("Saving parameters not supported")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3a, 0x81, SENSE_ABORT, T_("Cleaning Slot empty")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3a, 0x82, SENSE_ABORT, T_("Cleaning slot doesn't have a cleaning slot")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3b, 0x0d, SENSE_ABORT, T_("Destination element full")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3b, 0x0e, SENSE_ABORT, T_("Source slot or drive empty")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3d, 0x0,  SENSE_ABORT, T_("SCSI invalid ID message")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x53, 0x0,  SENSE_ABORT, T_("Media Load/Eject failure")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x53, 0x01, SENSE_ABORT, T_("Cartridge failed to unload")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0xf1, 0x0,  SENSE_ABORT, T_("Command unspecified")},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0xf1, 0x02, SENSE_ABORT, T_("Unrecognized loader command")},
-       { "L500", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX,    SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0,  0x0,  SENSE_RETRY, T_("Unit Attention")},
-       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x28, 0x0,  SENSE_RETRY, T_("Not ready to Ready transition")},
-       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x29, 0x0,  SENSE_RETRY, T_("Reset occured")},
-       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x2a, 0x01, SENSE_ABORT, T_("Mode parameters changed")},
-       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x3f, 0x01, SENSE_ABORT, T_("Microcode has changed")},
-       { "L500", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX,     SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
-
-/*     Not used by L500
-       { "L500", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-*/
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x43, 0x0, SENSE_ABORT, T_("SCSI message error")},
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x47, 0x0, SENSE_ABORT, T_("SCSI parity error")},
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x48, 0x0, SENSE_ABORT, T_("SCSI IDE message received")},
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x49, 0x0, SENSE_ABORT, T_("SCSI invalid message")},
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x4e, 0x0, SENSE_ABORT, T_("SCSI overlapped commands")},
-
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ABORTED_COMMAND")},
-       { "L500", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-
-/*
- * HP C1553A Tape
- */
-       { "C1553A", "", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
-       { "C1553A", "", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "C1553A", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
-       { "C1553A", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
-
-       { "C1553A", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
-       { "C1553A", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "C1553A", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "C1553A", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
-       { "C1553A", "", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
-
-       { "C1553A", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
-       { "C1553A", "", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
-
-       { "C1553A", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "C1553A", "", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "C1553A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "C1553A", "", TYPE_TAPE,  SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "C1553A", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-
-       { "C1553A", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "C1553A", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
-
-       { "C1553A", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
-       { "C1553A", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "C1553A", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
-
-       { "C1553A", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
-
-       { "C1553A", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "C1553A", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "C1553A", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-
-       { "C1553A", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-/*
- * HP C1537A Tape
- */
-       { "C1537A", "", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
-       { "C1537A", "", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "C1537A", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
-       { "C1537A", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
-
-       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
-       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x04, 0x0, SENSE_RETRY, T_("tape is being ejected")},
-       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x04, 0x01, SENSE_RETRY, T_("tape is being loaded")},
-       { "C1537A", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "C1537A", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
-       { "C1537A", "", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
-
-       { "C1537A", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
-       { "C1537A", "", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
-
-       { "C1537A", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "C1537A", "", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "C1537A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "C1537A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, T_("Not Ready to Ready Transition")},
-       { "C1537A", "", TYPE_TAPE,  SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "C1537A", "", TYPE_TAPE,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-
-       { "C1537A", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-/*
- * Tandberg TapeLibrary 1420
- */
-       { "TDS 1420", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x0, SENSE_IES, T_("IES")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x1, SENSE_IES, T_("IES")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x4, SENSE_IGNORE, T_("IES")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
-
-       { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "TDS 1420", "", TYPE_TAPE, SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
-
-       { "TDS 1420", "", TYPE_TAPE, SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
-
-       { "TDS 1420", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "TDS 1420", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
-
-       { "TDS 1420", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-
-/*
- * Tandberg SLR100 Tape Drive
- */
-
-       { "SLR100", "", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"},
-       { "SLR100", "", TYPE_TAPE, SENSE_NULL ,0x00 ,0x01 , SENSE_ABORT ," FILEMARK_DETECTED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_NULL ,0x00 ,0x02 , SENSE_IGNORE ," END-OF-PARTITION/MEDIUM_DETECTED_ON_WRITE__LEW_PASSED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_NULL ,0x00 ,0x03 , SENSE_ABORT ," SETMARK_DETECTED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_NULL ,0x00 ,0x04 , SENSE_ABORT ," BEGINNING-OF-PARTITION/MEDIUM_DETECTED "},
-       { "SLR100", "", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
-
-       { "SLR100", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"},
-       { "SLR100", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x00, 0x17, SENSE_IGNORE, "Cleaning Requested"},
-       { "SLR100", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x03, 0x02, SENSE_IGNORE, "Excessive Write Errors"},
-       { "SLR100", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR ,0x0C ,0x05 , SENSE_ABORT ," DATA_EXPANSION_OCCURRED_DURING_COMPRESSION "},
-       { "SLR100", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5B, 0x02, SENSE_IGNORE, "Log Counter at Maximum"},
-       { "SLR100", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"},
-
-       { "SLR100", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"},
-       { "SLR100", "", TYPE_TAPE, SENSE_NOT_READY ,0x04 ,0x00 , SENSE_ABORT ," LOGICAL_UNIT_NOT_READY_CAUSE_NOT_REPORTABLE "},
-       { "SLR100", "", TYPE_TAPE, SENSE_NOT_READY ,0x04 ,0x01 , SENSE_RETRY ," LOGICAL_UNIT_IS_IN_THE_PROCESS_OF_BECOMMING_READY "},
-       { "SLR100", "", TYPE_TAPE, SENSE_NOT_READY ,0x04 ,0x02 , SENSE_ABORT ," LOGICAL-UNIT_NOT_READY_INITIALIZING_COMMAND_REQUIRED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_NOT_READY ,0x30 ,0x03 , SENSE_ABORT ," CLEANING_CARTRIDGE_INSTALLED "},
-       { "SLR100", "", TYPE_TAPE ,SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "SLR100", "", TYPE_TAPE, SENSE_NOT_READY ,0x53 ,0x02 , SENSE_ABORT ," MEDIUM_REMOVAL_PREVENTED "},
-       { "SLR100", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
-
-       { "SLR100", "", TYPE_TAPE ,SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x00 ,0x02 , SENSE_ABORT ," END-OF-PARTITION/MEDIUM_DETECTED_ON_READ__PHYSICAL_END_REACHED "},
-       { "SLR100", "", TYPE_TAPE ,SENSE_MEDIUM_ERROR, 0x03, 0x02, SENSE_IGNORE, "Excessive Write Errors(SERVO)"},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x09 ,0x00 , SENSE_ABORT ," TRACK_FOLLOWING_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x11 ,0x00 , SENSE_IGNORE ," UNRECOVERED_READ_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x11 ,0x01 , SENSE_IGNORE ," READ_RETRIES_EXHAUSTED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x11 ,0x0D , SENSE_ABORT ," DECOMPRESSION_CRC_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x11 ,0x0E , SENSE_ABORT ," CANNOT_DECOMPRESS_USING_THE_DECLARED_ALGORITHM "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x15 ,0x01 , SENSE_ABORT ," MECHANICAL_POSITIONING_ERROR__ILLEGAL_HEAD_POSITION "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x30 ,0x01 , SENSE_ABORT ," CANNOT_READ_MEDIUM_-_UNKNOWN_FORMAT "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x30 ,0x02 , SENSE_ABORT ," CANNOT_READ_MEDIUM__INCOMPATIBLE_FORMAT "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x30 ,0x07 , SENSE_ABORT ," CLEANING_FAILURE "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x50 ,0x01 , SENSE_IGNORE ," WRITE_APPEND_POSITION_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x51 ,0x00 , SENSE_ABORT ," ERASE_FAILURE "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x52 ,0x00 , SENSE_ABORT ," CARTRIDGE_FAULT__BAD_CARTRIDGE "},
-       { "SLR100", "", TYPE_TAPE, SENSE_MEDIUM_ERROR ,0x52 ,0x00 , SENSE_IGNORE ," CARTRIDGE_FAULT__REFERENCE_BURST_SEEK_FAILURE "},
-       { "SLR100", "", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"},
-
-       { "SLR100", "", TYPE_TAPE ,SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"},
-       { "SLR100", "", TYPE_TAPE, SENSE_HARDWARE_ERROR ,0x09 ,0x01 , SENSE_ABORT ," TRACKING_SERVO_FAILURE "},
-       { "SLR100", "", TYPE_TAPE, SENSE_HARDWARE_ERROR ,0x40 ,0x80 , SENSE_ABORT ," DIAGNOSTIC_FAILURE__BUFFER_PARITY_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_HARDWARE_ERROR ,0x40 ,0x81 , SENSE_ABORT ," DIAGNOSTIC_FAILURE__WRITE_CHIP_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_HARDWARE_ERROR ,0x40 ,0xA0 , SENSE_ABORT ," DIAGNOSTIC_FAILURE__MULTIPLE_ERRORS "},
-       { "SLR100", "", TYPE_TAPE, SENSE_HARDWARE_ERROR ,0x44 ,0x00 , SENSE_ABORT ," INTERNAL_TARGET_FAILURE "},
-       { "SLR100", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
-
-       { "SLR100", "", TYPE_TAPE ,SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x1A ,0x00 , SENSE_ABORT ," PARAMETER_LIST_LENGTH_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x20 ,0x00 , SENSE_ABORT ," INVALID_COMMAND_OPERATION_CODE "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x24 ,0x00 , SENSE_ABORT ," INVALID_FIELD_IN_CDB "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x25 ,0x00 , SENSE_ABORT ," LOGICAL_UNIT_NOT_SUPPORTED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x26 ,0x00 , SENSE_ABORT ," INVALID_FIELD_IN_PARAMETER_LIST "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x2C ,0x00 , SENSE_ABORT ," COMMAND_SEQUENCE_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x30 ,0x00 , SENSE_ABORT ," INCOMPATIBLE_MEDIUM_INSTALLED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x30 ,0x06 , SENSE_ABORT ," CANNOT_FORMAT_MEDIUM__INCOMPATIBLE_MEDIUM "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x3D ,0x00 , SENSE_ABORT ," INVALID_BITS_IN_IDENTIFY_MESSAGE "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x43 ,0x00 , SENSE_ABORT ," MESSAGE_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST ,0x50 ,0x00 , SENSE_ABORT ," WRITE_APPEND_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
-
-       { "SLR100", "", TYPE_TAPE ,SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "SLR100", "", TYPE_TAPE, SENSE_UNIT_ATTENTION ,0x28 ,0x00 , SENSE_RETRY ," NOT_READY_TO_READY_TRANSITION__MEDIUM_MAY_HAVE_CHANGED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_UNIT_ATTENTION ,0x29 ,0x00 , SENSE_RETRY ," POWER_ON_/_RESET_OCCURRED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_UNIT_ATTENTION ,0x2A ,0x01 , SENSE_RETRY ," MODE_PARAMETERS_CHANGED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_UNIT_ATTENTION ,0x2A ,0x02 , SENSE_RETRY ," LOG_PARAMETERS_CHANGED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_UNIT_ATTENTION ,0x3F ,0x01 , SENSE_RETRY ," MICROCODE_HAS_BEEN_CHANGED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_UNIT_ATTENTION ,0x5B ,0x01 , SENSE_RETRY ," THRESHOLD_CONDITION_MET "},
-       { "SLR100", "", TYPE_TAPE, SENSE_UNIT_ATTENTION ,0x82 ,0x83 , SENSE_RETRY ," CLEANING_CARTRIDGE_EJECTED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"},
-
-       { "SLR100", "", TYPE_TAPE, SENSE_ABORTED_COMMAND ,0x47 ,0x00 , SENSE_RETRY ," SCSI_PARITY_ERROR "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ABORTED_COMMAND ,0x48 ,0x00 , SENSE_ABORT ," INITIATOR_DETECTED_ERROR_MESSAGE_RECEIVED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ABORTED_COMMAND ,0x4E ,0x00 , SENSE_ABORT ," OVERLAPPED_COMMANDS_ATTEMPTED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_ABORTED_COMMAND ,0x53 ,0x00 , SENSE_ABORT ," MEDIA_LOAD_OR_EJECT_FAILED "},
-
-       { "SLR100", "", TYPE_TAPE, SENSE_CHG_ELEMENT_STATUS ,0x1D ,0x00 , SENSE_IGNORE ," MISCOMPARE_DURING_VERIFY_OPERATION "},
-
-       { "SLR100", "", TYPE_TAPE, SENSE_DATA_PROTECT ,0x27 ,0x05 , SENSE_ABORT ," PERMANENT_WRITE_PROTECTED_(CARTRIDGE_END_OF_LIFE) "},
-       { "SLR100", "", TYPE_TAPE, SENSE_DATA_PROTECT ,0x27 ,0x00 , SENSE_RETRY ," WRITE_PROTECTED "},
-
-       { "SLR100", "", TYPE_TAPE, SENSE_VOLUME_OVERFLOW ,0x00 ,0x02 , SENSE_IGNORE ," END-OF-PARTITION/MEDIUM_DETECTED_ON_WRITE__PHYSICAL_END_REACHED "},
-
-       { "SLR100", "", TYPE_TAPE, SENSE_BLANK_CHECK ,0x00 ,0x05 , SENSE_ABORT ," END-OF-DATA_DETECTED "},
-       { "SLR100", "", TYPE_TAPE, SENSE_BLANK_CHECK ,0x14 ,0x00 , SENSE_ABORT ," RECORDED_ENTITY_NOT_FOUND "},
-
-       { "SLR100", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
-
-/*
- * DLT 8000 Tape
- */
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0,   SENSE_NO, T_("No Sense")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x01,  SENSE_NO, T_("Unexpected FM encountered")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x02,  SENSE_NO, T_("EOM encountered")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x04,  SENSE_NO, T_("BOM encountered")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x5d, 0x00, SENSE_NO, T_("Failure prediction threshold exceeded")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x27, 0x82, SENSE_NO, T_("Data safety write protect")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX,    SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x17, SENSE_IGNORE, T_("Cleaning requested")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0a, 0x00, SENSE_IGNORE, T_("Error log overflow")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0a, 0x80, SENSE_IGNORE, T_("Error log generated")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x37, 0x0,  SENSE_IGNORE, T_("Rounded parameter")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x38, 0x08, SENSE_IGNORE, T_("repositioning error")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x44, 0xc1, SENSE_IGNORE, T_("EEPROM copy1 area bad")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x44, 0xc2, SENSE_IGNORE, T_("EEPROM copy2 area bad")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x47, 0x00, SENSE_IGNORE, T_("SCSI parity error")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x48, 0x00, SENSE_IGNORE, T_("IDE Message received")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x51, 0x00, SENSE_IGNORE, T_("Erase Failure")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x53, 0x01, SENSE_IGNORE, T_("Unload Tape failure")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5b, 0x01, SENSE_IGNORE, T_("Threshold met")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5b, 0x02, SENSE_IGNORE, T_("Log counter at maximum")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x80, 0x02, SENSE_IGNORE, T_("Cleaning requested")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x80, 0x03, SENSE_IGNORE, T_("Soft error exceeds threshold")},
-/*     { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x47, 0x0, SENSE_IGNORE, T_("Scsi Parity Error")}, */
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready (this shouldn't happen should it?)")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("The drive is not ready, but it is in the process of becoming ready")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x30,0x02, SENSE_ABORT, T_("Incompatible tape format")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x30,0x03, SENSE_ABORT, T_("Cleaning Cartridge in drive")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x5a,0x01, SENSE_ABORT, T_("Asynchronous eject occurred")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, T_("Not ready to ready transition")},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-
-/*
- * DLT 7000 Tape
- */
-       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
-       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")},
-       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
-       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "DLT7000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "DLT7000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "DLT7000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "DLT7000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "DLT7000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-/*
- * DLT 4000 Tape
- */
-       { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
-       { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")},
-       { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
-       { "DLT4000", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "DLT4000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "DLT4000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "DLT4000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "DLT4000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "DLT4000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-/*
- * AIT VLS DLT Library
- */
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")},
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "VLS_DLT", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-
-       { "VLS_DLT", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-/*
- * AIT VLS SDX Library
- */
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")},
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "VLS_SDX", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-
-       { "VLS_SDX", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-/*
- * Exabyte 85058 Tape
- */
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "EXB-85058HE-0000", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
-/*
- * Exabyte 10e Library (Robot)
- */
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, T_("Retry, no sense")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, T_("Illegal Request")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, T_("IES")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("Library door is open")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("The data cartridge magazine is missing")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, T_("The library is in CHS Monitor mode")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, T_("The library is performing a power-on self test")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, T_("The library is in LCD mode")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, T_("The library is in Sequential mode")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, T_("CHM full during reset")},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "EXB-10e", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-
-       { "EXB-10e", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found for EXB-10e")},
-
-/*
- * Exabyte 210 Library (Robot)
- */
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, T_("Retry, no sense")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, T_("Illegal Request")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, T_("IES")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("Library door is open")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("The data cartridge magazine is missing")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, T_("The library is in CHS Monitor mode")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, T_("The library is performing a power-on self test")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, T_("The library is in LCD mode")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, T_("The library is in Sequential mode")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "EXB-210", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, T_("CHM full during reset")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, T_("Invalid element address")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x24, 0x00, SENSE_ABORT, T_("Invalid Invert Field")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x0d, SENSE_ABORT, T_("Destination element occupied")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x0e, SENSE_ABORT, T_("Source Element empty")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x87, SENSE_ABORT, T_("Cartridge stuck in tape")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x90, SENSE_ABORT, T_("Source cart is loaded inside the tape drive and not accessible")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x03, SENSE_ABORT, T_("Source magazine not installed")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x04, SENSE_ABORT, T_("Destination magazine no installed")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x05, SENSE_ABORT, T_("Source tape drive not installed")},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x06, SENSE_ABORT, T_("Destination tape drive not installed")},
-
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x0, SENSE_IES, T_("Label questionable")},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x1, SENSE_IGNORE, T_("Cannot read bar code label")},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x2, SENSE_ABORT, T_("Cartzridge magazine not present")},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x3, SENSE_IES, T_("Label and full status questionable")},
-               { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x4, SENSE_ABORT, T_("Tape drive not installed")},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x7, SENSE_IES, T_("Full status questionable")},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x8, SENSE_IGNORE, T_("Bar code label upside down")},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x9, SENSE_IGNORE, T_("No bar code label")},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0xa, SENSE_IGNORE, T_("Ignore")},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-
-       { "EXB-210", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found for EXB-10e")},
-
-/*
- * Exabyte 230D Library (Robot)
- */
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, T_("Retry, no sense")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, T_("Illegal Request")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, T_("IES")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
-
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("Library door is open")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("The data cartridge magazine is missing")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, T_("The library is in CHS Monitor mode")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, T_("The library is performing a power-on self test")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, T_("The library is in LCD mode")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, T_("The library is in Sequential mode")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, T_("CHM full during reset")},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       { "EXB-230D", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-
-       { "EXB-230D", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found for EXB-10e")},
-/*
- * Spectra TreeFrog  library
- */
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense, Unit Ready")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NULL, UCHAR_MAX, UCHAR_MAX, SENSE_NO, T_("No Sense, Unit Ready")},
-
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Unit Not Ready")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Unit is Becoming Ready")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x83, SENSE_ABORT, T_("Door is open, Robot is Disabled")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
-
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x4C, 0x0, SENSE_ABORT, T_("Unit Failed Initialization")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x84, 0x4, SENSE_ABORT, T_("DRAM Memory Failure")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x84, 0x4, SENSE_ABORT, T_("Two ore More SCSI ID's in the library are tehe same")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x81, 0x4, SENSE_ABORT, T_("Tape may be broken;of tape is a cleaning tape;or Drive B is broken")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x0, SENSE_ABORT, T_("Bad FPROM or invalid device in socket")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x1, SENSE_ABORT, T_("FPROM Erase Operation Failed")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x2, SENSE_ABORT, T_("FFPROM Write Operation Failed")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x1, SENSE_ABORT, T_("Robot not Initialized")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x99, SENSE_ABORT, T_("Generic Robotics  Error")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x2, SENSE_ABORT, T_("Long Axis Robotics Error")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x3, SENSE_ABORT, T_("Short Axis Robotics Error")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x4, SENSE_ABORT, T_("Ambient Light Detected")},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
-
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x1A, 0x0, SENSE_ABORT, T_("Parameter List Length Error")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x20, 0x0, SENSE_ABORT, T_("Invalid Command Code")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, T_("Invalid Element Address")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x24, 0x0, SENSE_ABORT, T_("Invalid Field in CDB")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x25, 0x0, SENSE_ABORT, T_("LUN Not Supported")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x26, 0x0, SENSE_ABORT, T_("Invalid Parameter Field")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0xd, SENSE_ABORT, T_("Medium Destination is full")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0xe, SENSE_ABORT, T_("Medium Source Element is Full")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3d, 0x80, SENSE_ABORT, T_("Disconnects Must be Allowed")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x18, SENSE_ABORT, T_("Conflict, Element is Reserved")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x81, 0x2, SENSE_ABORT, T_("Library is Full of Tapes")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x81, 0x3, SENSE_ABORT, T_("Grip Arm not Empty")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, UCHAR_MAX , UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
-
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_IES, T_("Inventory possible Altered")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x29, 0x0, SENSE_RETRY, T_("A Reset Has Occured")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x24, 0x1, SENSE_IGNORE, T_("Mode Parameter Have CHanged")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_UNIT_ATTENTION")},
-
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x00, SENSE_ABORT, T_("Barcode Label is Unread")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x01, SENSE_ABORT, T_("Problem Reading Barcode")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x11, SENSE_ABORT, T_("Tape in Drive & Unmounted")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x00, SENSE_ABORT, T_("Unsupported SCSI Command")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x01, SENSE_ABORT, T_("No Response from SCSI Target")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x02, SENSE_ABORT, T_("Check Condition form Target")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x03, SENSE_ABORT, T_("SCSI ID Same as Library's ID")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x08,  SENSE_ABORT, T_("Busy Condition from Target")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x18, SENSE_ABORT, T_("SCSI Reservation Conflict")},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC,  UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_VENDOR_SPECIFIC")},
-
-       { "215", "SPECTRA", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
-
-       { "215", "SPECTRA", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing found for Spectra/215")},
-
-       { NULL, "", 0x0, UCHAR_MAX, 0x0, 0x0, 0x0, ""},
-
-       };
-
-
-void
-DumpSense(void)
-{
-       SenseType_T *pwork = (SenseType_T *)&SenseType;
-
-       while (pwork->ident != NULL)
-       {
-               if (pwork->sense == UCHAR_MAX)
-               {
-                       g_printf("\n");
-               } else {
-                       g_printf(_("%s %s %02X %02X %02X %d %s\n"),pwork->ident, pwork->vendor,
-                               pwork->sense,
-                               pwork->asc,
-                               pwork->ascq,
-                               pwork->ret,
-                               _(pwork->text));
-               }
-               pwork++;
-       }
-}
-
-/*
- * Decode the Sense Key,ASC, ASCQ and device type, and return an action Type.
- *     type describes the device type as returned by the inquiry command
- *     ignsense changes the way the ASC/ASCQ values are handled.
- *      if = 0 the sense key is also used for decoding,
- *      if > 0 the sense key is ignored in the search, and only ASC/ASCQ will be checked
- *     sense is the sense key returned by the scsi command
- *     ASC is the ASC value returned by the scsi command
- *     ASCQ is the ASCQ value returned by the scsi command
- *     text is a pointer to store the clear text reason from the table.
- *
- *     TODO:
- *
-*/
-int
-Sense2Action(
-    char *             ident,
-    unsigned char      type,
-    unsigned char      ignsense,
-    unsigned char      sense,
-    unsigned char      asc,
-    unsigned char      ascq,
-    char **            text)
-{
-       /*
-        * Decode the combination of sense key, ASC, ASCQ and return what to do with this
-        * status
-        * A future extension could be to call direct a function which handles this case
-        *
-        */
-       SenseType_T *pwork = (SenseType_T *)&SenseType;
-       SenseType_T *generic = NULL;
-        int in = 0;
-
-       dbprintf(_("Sense2Action START : type(%d), ignsense(%d), sense(%02X), asc(%02X), ascq(%02X)\n"),
-               type,
-               ignsense,
-               sense,
-               asc,
-               ascq);
-
-       while (pwork->ident != NULL)
-       {
-               if (strcmp(pwork->ident, "generic") == 0 && pwork->type == type && generic == NULL)
-               {
-                       generic = pwork;
-               }
-
-               if (strcmp((char *)pwork->ident, (char *)ident) == 0 && pwork->type == type)
-                {
-                       in = 1;
-                } else {
-                       if (in == 1)
-                       {
-                               dbprintf(_("Sense2Action       : no match\n"));
-                               break;
-                       }
-                       pwork++;
-                       continue;
-               }
-
-               if (in == 1)
-               {
-                       /* End of definitions for this device */
-                       if (pwork->sense == UCHAR_MAX)
-                       {
-                               *text = stralloc(pwork->text);
-                               dbprintf(_("Sense2Action   END : no match for %s %s\n"),
-                                       pwork->ident,
-                                       pwork->vendor);
-                               return(pwork->ret);
-                       }
-
-                       if (ignsense)
-                       {
-                               if (pwork->asc ==  asc && pwork->ascq == ascq)
-                               {
-                                       *text = stralloc(pwork->text);
-                                       dbprintf(_("Sense2Action END(IGN) : match for %s %s  return -> %d/%s\n"),
-                                               pwork->ident,
-                                               pwork->vendor,
-                                               pwork->ret,
-                                               _(*text));
-                                       return(pwork->ret);
-                               }
-                               pwork++;
-                               continue;
-                       }
-
-                       if (pwork->sense == sense)
-                       {
-                               /* Matching ASC/ASCQ, if yes return the defined result code */
-                               if (pwork->asc ==  asc && pwork->ascq == ascq)
-                               {
-                                       *text = (char *)stralloc(pwork->text);
-                                       dbprintf(_("Sense2Action   END : match for %s %s  return -> %d/%s\n"),
-                                               pwork->ident,
-                                               pwork->vendor,
-                                               pwork->ret,
-                                               _(*text));
-                                       return(pwork->ret);
-                               }
-
-                               /* End of definitions for this sense type, if yes return the default
-                                * for this type
-                                */
-                               if (    pwork->asc == UCHAR_MAX && pwork->ascq == UCHAR_MAX)
-                               {
-                                       *text = (char *)stralloc(pwork->text);
-                                       dbprintf(_("Sense2Action   END : no match for %s %s  return -> %d/%s\n"),
-                                               pwork->ident,
-                                               pwork->vendor,
-                                               pwork->ret,
-                                               _(*text));
-                                       return(pwork->ret);
-                               }
-                       }
-               }
-               pwork++;
-       }
-
-       /*
-        * Ok no match found, so lets return the values from the generic table
-        */
-       dbprintf(_("Sense2Action generic start :\n"));
-       while (generic != NULL) {
-               if (generic->ident == NULL)
-                  break;
-
-               if (generic->sense == UCHAR_MAX)
-               {
-                       *text = (char *)stralloc(generic->text);
-                       dbprintf(_("Sense2Action generic END : match for %s %s  return -> %d/%s\n"),
-                               generic->ident,
-                               generic->vendor,
-                               generic->ret,
-                               _(*text));
-                       return(generic->ret);
-               }
-
-               if (ignsense)
-               {
-                       if (generic->asc ==  asc && generic->ascq == ascq)
-                       {
-                               *text = (char *)stralloc(generic->text);
-                               dbprintf(_("Sense2Action generic END(IGN) : match for %s %s  return -> %d/%s\n"),
-                                       generic->ident,
-                                       generic->vendor,
-                                       generic->ret,
-                                       _(*text));
-                               return(generic->ret);
-                       }
-                       generic++;
-                       continue;
-               }
-
-               if (generic->sense == sense)
-               {
-                       /* Matching ASC/ASCQ, if yes return the defined result code */
-                       if (generic->asc ==  asc && generic->ascq == ascq)
-                       {
-                               *text = (char *)stralloc(generic->text);
-                               dbprintf(_("Sense2Action generic END : match for %s %s  return -> %d/%s\n"),
-                                       generic->ident,
-                                       generic->vendor,
-                                       generic->ret,
-                                       _(*text));
-                               return(generic->ret);
-                       }
-
-                       /* End of definitions for this sense type, if yes return the default
-                        * for this type
-                        */
-                       if (    generic->asc == UCHAR_MAX && generic->ascq == UCHAR_MAX)
-                       {
-                               *text = (char *)stralloc(generic->text);
-                               dbprintf(_("Sense2Action generic END : no match for %s %s  return -> %d/%s\n"),
-                                       generic->ident,
-                                       generic->vendor,
-                                       generic->ret,
-                                       _(*text));
-                               return(generic->ret);
-                       }
-                       generic++;
-                       continue;
-               }
-               generic++;
-       }
-
-       dbprintf(_("Sense2Action END:\n"));
-       *text = (char *)stralloc("No match found");
-       return(SENSE_ABORT);
-}
index 6bbb0c8c47ac824ed244eb56781e6ed45a234356..e7dea7ba74113e894d721fddda44c10bc246aa17 100644 (file)
@@ -61,15 +61,8 @@ sendbackup_SOURCES =         sendbackup.c            sendbackup.h      \
 noinst_HEADERS =       amandates.h     getfsent.h      \
                        findpass.h      client_util.h
                        
-INSTALLPERMS_exec = chown=amanda \
-       dest=$(amlibexecdir) $(amlibexec_PROGRAMS)
-
-INSTALLPERMS_data = chown=amanda \
-       dest=$(sbindir) $(sbin_SCRIPTS) \
-       dest=$(amlibexecdir) $(amlibexec_SCRIPTS)
-
 if WANT_SETUID_CLIENT
-INSTALLPERMS_exec += dest=$(amlibexecdir) chown=root chmod=04750 \
+INSTALLPERMS_exec = dest=$(amlibexecdir) chown=root:setuid chmod=04750 \
                calcsize killpgrp rundump runtar
 endif
 
index 66ff8f44d359d53b1ae7b9e98a1fc77604bf6a44..41a73fd0977accfade7b66b808ddf80362e52910 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -193,9 +195,6 @@ amlibexec_PROGRAMS = noop$(EXEEXT) calcsize$(EXEEXT) killpgrp$(EXEEXT) \
        sendbackup$(EXEEXT) sendsize$(EXEEXT)
 @WANT_SAMBA_TRUE@am__append_2 = findpass.c
 EXTRA_PROGRAMS = $(am__EXEEXT_1)
-@WANT_SETUID_CLIENT_TRUE@am__append_3 = dest=$(amlibexecdir) chown=root chmod=04750 \
-@WANT_SETUID_CLIENT_TRUE@              calcsize killpgrp rundump runtar
-
 subdir = client-src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps =  \
@@ -212,7 +211,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -240,7 +238,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -253,10 +250,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -270,7 +271,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -283,10 +286,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -298,21 +304,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -477,7 +487,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -497,10 +507,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -556,78 +563,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -638,12 +700,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -658,17 +749,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -677,60 +772,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -738,13 +892,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -753,9 +913,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -791,7 +954,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -800,7 +962,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -808,19 +969,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -846,47 +1030,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -894,6 +1134,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -916,19 +1157,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -938,13 +1181,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -988,6 +1228,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -1052,6 +1293,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/amandad-src  \
@@ -1091,11 +1345,8 @@ sendbackup_SOURCES = sendbackup.c                sendbackup.h      \
 noinst_HEADERS = amandates.h   getfsent.h      \
                        findpass.h      client_util.h
 
-INSTALLPERMS_exec = chown=amanda dest=$(amlibexecdir) \
-       $(amlibexec_PROGRAMS) $(am__append_3)
-INSTALLPERMS_data = chown=amanda \
-       dest=$(sbindir) $(sbin_SCRIPTS) \
-       dest=$(amlibexecdir) $(amlibexec_SCRIPTS)
+@WANT_SETUID_CLIENT_TRUE@INSTALLPERMS_exec = dest=$(amlibexecdir) chown=root:setuid chmod=04750 \
+@WANT_SETUID_CLIENT_TRUE@              calcsize killpgrp rundump runtar
 
 getfsent_SOURCES = getfsent.test.c
 all: $(BUILT_SOURCES)
@@ -1406,6 +1657,7 @@ distdir: $(DISTFILES)
        $(MAKE) $(AM_MAKEFLAGS) \
          top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-hook
+@SYNTAX_CHECKS_FALSE@check-local:
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-local
 check: $(BUILT_SOURCES)
@@ -1497,7 +1749,7 @@ install-ps: install-ps-am
 
 install-ps-am:
 
-installcheck-am: installcheck-local
+installcheck-am:
 
 maintainer-clean: maintainer-clean-am
        -rm -rf ./$(DEPDIR)
@@ -1534,23 +1786,24 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
        install-exec-am install-exec-hook install-html install-html-am \
        install-info install-info-am install-man install-pdf \
        install-pdf-am install-ps install-ps-am install-strip \
-       installcheck installcheck-am installcheck-local installdirs \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-       pdf pdf-am ps ps-am tags uninstall uninstall-am \
-       uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
-       uninstall-amlibexecSCRIPTS
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-amlibLTLIBRARIES \
+       uninstall-amlibexecPROGRAMS uninstall-amlibexecSCRIPTS
 
 
 # Perl
 %: %.pl $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          rm $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  fi
+@SYNTAX_CHECKS_TRUE@   @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+@SYNTAX_CHECKS_TRUE@           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
+@SYNTAX_CHECKS_TRUE@           rm $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@   else \
+@SYNTAX_CHECKS_TRUE@           echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
+@SYNTAX_CHECKS_TRUE@   fi
 
 %.pl: %.pl.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
@@ -1574,33 +1827,22 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
 %.awk: %.awk.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
 
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
 check-perl: $(SCRIPTS_PERL)
        @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
            test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-           if test -n "$(PERL)"; then \
-                   for perlobj in $$SCRIPTS_PERL; do \
-                           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
-                           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
-                           rm $$perlobj.nouselib; \
-                   done; \
-           fi \
-       fi
-check-local: check-perl
-
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
-       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
-       if test x"$(SKIP_CHECKS)" = x"" && \
-           test -n "$(PERL)"; then \
-               for perlobj in $$SCRIPTS_PERL; do \
-                       $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
-               done; \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
        fi
-installcheck-local: installcheck-perl
+@SYNTAX_CHECKS_TRUE@check-local: check-perl
 
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
 check-shell: $(SCRIPTS_SHELL)
        @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
@@ -1618,7 +1860,7 @@ check-shell: $(SCRIPTS_SHELL)
                        echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
        fi
-check-local: check-shell
+@SYNTAX_CHECKS_TRUE@check-local: check-shell
 
 # make sure that the sources for all shell and perl scripts get included
 # in the distribution
@@ -1658,29 +1900,12 @@ dist-hook: dist-scripts
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index a350aa0e76cc4030c02835167783728dfcab3a49..5dc4974f8f31dd586f8f2f79468af9eb53e4a8ab 100644 (file)
@@ -706,8 +706,7 @@ application_property_add_to_argv(
        }
     }
 
-    g_hash_table_foreach(dle->application_property,
-                        &proplist_add_to_argv, argv_ptr);
+    property_add_to_argv(argv_ptr, dle->application_property);
     return;
 }
 
@@ -1009,7 +1008,8 @@ run_client_script(
 
     script->result = g_new0(client_script_result_t, 1);
     script->result->proplist =
-                   g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
+                 g_hash_table_new_full(g_str_hash, g_str_equal,
+                                       &g_free, &g_slist_free_full_gpointer);
     script->result->output = g_ptr_array_new();
     script->result->err = g_ptr_array_new();
 
@@ -1221,6 +1221,7 @@ run_client_scripts(
            g_ptr_array_free(script->result->err, TRUE);
            script->result->err = NULL;
        }
+       amfree(script->result);
     }
 }
 
index e31392f6fa9f16fe8a16edf335fd782445439532..7d56768e31c3a6622cdf3dbb6a74e8abb5115434 100644 (file)
@@ -104,14 +104,6 @@ void parse_options(char *str,
                   am_feature_t *features,
                   int verbose);
 
-/* Count the size of an ARGV to store all properties of an application for
- * a dle. include/exclude options are converted to properties.
- *
- * @param dle: the dle
- * @returns: size of an ARGV needed.
- */
-int application_property_argv_size(dle_t *dle);
-
 /* Add all properties of an application for a dle to an ARGV.
  * include/exclude options are converted to properties.
  *
index 61994496e16c9dea7e0e902af47dcc1cf8eafb4e..7b1e6fb9c0063bd6c3a184040b09156be8fb41e3 100644 (file)
@@ -33,8 +33,8 @@
  * argv[2] will be argv[0] of the DUMP program
  * ...
  */
-#include "util.h"
 #include "amanda.h"
+#include "util.h"
 #include "conffile.h"
 
 int main(int argc, char **argv);
index ac5ed538c8cd29a7964b1e5680943156564cdf00..5f6cb075db48e0495d8a99501e3b197bacbdd14a 100644 (file)
@@ -306,7 +306,7 @@ main(
 
     if (am_has_feature(g_options->features, fe_req_xml)) {
        char  *errmsg = NULL;
-       dle_t *dles, *dle;
+       dle_t *dles, *dle, *dle_next;
 
        dles = amxml_parse_node_FILE(stdin, &errmsg);
        if (errmsg) {
@@ -329,6 +329,10 @@ main(
            run_client_scripts(EXECUTE_ON_POST_HOST_AMCHECK, g_options, dle,
                               stdout);
        }
+       for (dle = dles; dle != NULL; dle = dle_next) {
+           dle_next = dle->next;
+           free_dle(dle);
+       }
     }
 
     check_overall();
index ffb260c6e6dad338657cc1ca078ce48163f8c008..dacb961e143ab296e4c4e19e3de67a14994795cd 100644 (file)
@@ -39,7 +39,6 @@
 #include "getfsent.h"
 #include "conffile.h"
 #include "amandates.h"
-#include "stream.h"
 
 #define sendbackup_debug(i, ...) do {  \
        if ((i) <= debug_sendbackup) {  \
@@ -578,49 +577,6 @@ main(
 
        switch(application_api_pid=fork()) {
        case 0:
-           application_api_info_tapeheader(mesgfd, dle->program, dle);
-
-           /* find directt-tcp address from indirect direct-tcp */
-           if (dle->data_path == DATA_PATH_DIRECTTCP &&
-               bsu->data_path_set & DATA_PATH_DIRECTTCP &&
-               strncmp(dle->directtcp_list->data, "255.255.255.255:", 16) == 0) {
-               char *indirect_tcp;
-               char *str_port;
-               in_port_t port;
-               int fd;
-               char buffer[32770];
-               int size;
-               char *s, *s1;
-
-               indirect_tcp = stralloc(dle->directtcp_list->data);
-               g_slist_free(dle->directtcp_list);
-               dle->directtcp_list = NULL;
-               str_port = strchr(indirect_tcp, ':');
-               str_port++;
-               port = atoi(str_port);
-               fd = stream_client("localhost", port, 32768, 32768, NULL, 0);
-               if (fd <= 0) {
-                   g_debug("Failed to connect to indirect-direct-tcp port: %s",
-                           strerror(errno));
-                   exit(1);
-               }
-               size = full_read(fd, buffer, 32768);
-               if (size <= 0) {
-                   g_debug("Failed to read from indirect-direct-tcp port: %s",
-                           strerror(errno));
-                   exit(1);
-               }
-               buffer[size++] = ' ';
-               buffer[size] = '\0';
-               s1 = buffer;
-               while ((s = strchr(s1, ' ')) != NULL) {
-                   *s++ = '\0';
-                   dle->directtcp_list = g_slist_append(dle->directtcp_list, stralloc(s1));
-                   s1 = s;
-               }
-               amfree(indirect_tcp);
-           }
-
            argv_ptr = g_ptr_array_new();
            cmd = vstralloc(APPLICATION_DIR, "/", dle->program, NULL);
            g_ptr_array_add(argv_ptr, stralloc(dle->program));
@@ -690,6 +646,7 @@ main(
                }
                fcntl(indexfd, F_SETFD, 0);
            }
+           application_api_info_tapeheader(mesgfd, dle->program, dle);
            if (indexfd != 0) {
                safe_fd(3, 2);
            } else {
index 3c2815a89100fce4e47fde302858b0f05b9c4374..8eb5c046c56afe7ca5e13589afefbadf3445b137 100644 (file)
@@ -693,8 +693,8 @@ free_estimates(
     amfree(est->qamdevice);
     amfree(est->dirname);
     amfree(est->qdirname);
-    if(est->dle) {
-/* free DLE */
+    if (est->dle) {
+       free_dle(est->dle);
     }
 }
 
@@ -864,11 +864,13 @@ application_api_calc_estimate(
     if (est->dle->data_path == DATA_PATH_AMANDA &&
        (bsu->data_path_set & DATA_PATH_AMANDA)==0) {
        g_printf("%s %d ERROR application %s doesn't support amanda data-path\n", est->qamname, 0, est->dle->program);
+       amfree(bsu);
        return;
     }
     if (est->dle->data_path == DATA_PATH_DIRECTTCP &&
        (bsu->data_path_set & DATA_PATH_DIRECTTCP)==0) {
        g_printf("%s %d ERROR application %s doesn't support directtcp data-path\n", est->qamname, 0, est->dle->program);
+       amfree(bsu);
        return;
     }
 
@@ -943,8 +945,10 @@ application_api_calc_estimate(
        }
     }
 
-    if (nb_level == 0)
+    if (nb_level == 0) {
+       amfree(bsu);
        return;
+    }
 
     if (bsu->multi_estimate) {
        for (i=0;i<nb_level;i++) {
@@ -964,6 +968,8 @@ application_api_calc_estimate(
            }
        }
     }
+
+    amfree(bsu);
 }
 
 
index 2736c656c20822310e0cd2a374d246e039395649..d57d351eb20317136cc357b046efdbab0b9c477c 100644 (file)
@@ -34,7 +34,6 @@ libamanda_la_SOURCES =                \
        packet.c                \
        pipespawn.c             \
        protocol.c              \
-       queueing.c              \
        semaphore.c             \
        security.c              \
        security-util.c         \
@@ -112,7 +111,6 @@ noinst_HEADERS =            \
        packet.h                \
        pipespawn.h             \
        protocol.h              \
-       queueing.h              \
        semaphore.h             \
        security.h              \
        security-util.h         \
@@ -205,7 +203,7 @@ libtestutils_la_SOURCES = \
 
 # automake-style tests
 
-TESTS = amflock-test event-test semaphore-test queueing-test quoting-test \
+TESTS = amflock-test event-test semaphore-test quoting-test \
        ipc-binary-test hexencode-test fileheader-test match-test
 noinst_PROGRAMS = $(TESTS)
 
@@ -218,9 +216,6 @@ event_test_LDADD = libamanda.la libtestutils.la
 semaphore_test_SOURCES = semaphore-test.c
 semaphore_test_LDADD = libamanda.la libtestutils.la
 
-queueing_test_SOURCES = queueing-test.c
-queueing_test_LDADD = libamanda.la libtestutils.la
-
 quoting_test_SOURCES = quoting-test.c
 quoting_test_LDADD = libamanda.la libtestutils.la
 
@@ -268,9 +263,6 @@ sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL)
 
 # installation
 
-INSTALLPERMS_data = dest=$(sbindir) chown=amanda $(sbin_SCRIPTS) \
-                   dest=$(amlibexecdir) chown=amanda $(amlibexec_SCRIPTS) $(amlibexec_DATA)
-
 lint:
        @echo $(LINT) $(libamanda_la_SOURCES)
        @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(libamanda_la_SOURCES)
index f9dfc62cbd437cd837ac7797694816f6b7db9583..126c527dc75e414aa9d76a17440f8518bbedc44f 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -201,10 +203,9 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
 @WANT_KRB5_SECURITY_TRUE@am__append_11 = krb5-security.c
 EXTRA_PROGRAMS = genversion$(EXEEXT) $(am__EXEEXT_1)
 TESTS = amflock-test$(EXEEXT) event-test$(EXEEXT) \
-       semaphore-test$(EXEEXT) queueing-test$(EXEEXT) \
-       quoting-test$(EXEEXT) ipc-binary-test$(EXEEXT) \
-       hexencode-test$(EXEEXT) fileheader-test$(EXEEXT) \
-       match-test$(EXEEXT)
+       semaphore-test$(EXEEXT) quoting-test$(EXEEXT) \
+       ipc-binary-test$(EXEEXT) hexencode-test$(EXEEXT) \
+       fileheader-test$(EXEEXT) match-test$(EXEEXT)
 noinst_PROGRAMS = $(am__EXEEXT_2)
 subdir = common-src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -222,7 +223,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -250,7 +250,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -263,10 +262,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -280,7 +283,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -293,10 +298,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -308,21 +316,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -379,12 +391,12 @@ libamanda_la_DEPENDENCIES = ../gnulib/libgnu.la
 am__libamanda_la_SOURCES_DIST = alloc.c amfeatures.c amflock.c \
        ipc-binary.c amxml.c clock.c columnar.c conffile.c debug.c \
        dgram.c event.c file.c fileheader.c glib-util.c match.c \
-       packet.c pipespawn.c protocol.c queueing.c semaphore.c \
-       security.c security-util.c simpleprng.c sl.c sockaddr-util.c \
-       stream.c tapelist.c timestamp.c util.c amflock-posix.c \
-       amflock-flock.c amflock-lockf.c amflock-lnlock.c \
-       rsh-security.c ssh-security.c bsd-security.c bsdtcp-security.c \
-       bsdudp-security.c krb5-security.c local-security.c
+       packet.c pipespawn.c protocol.c semaphore.c security.c \
+       security-util.c simpleprng.c sl.c sockaddr-util.c stream.c \
+       tapelist.c timestamp.c util.c amflock-posix.c amflock-flock.c \
+       amflock-lockf.c amflock-lnlock.c rsh-security.c ssh-security.c \
+       bsd-security.c bsdtcp-security.c bsdudp-security.c \
+       krb5-security.c local-security.c
 @WANT_AMFLOCK_POSIX_TRUE@am__objects_1 = amflock-posix.lo
 @WANT_AMFLOCK_FLOCK_TRUE@am__objects_2 = amflock-flock.lo
 @WANT_AMFLOCK_LOCKF_TRUE@am__objects_3 = amflock-lockf.lo
@@ -398,8 +410,8 @@ am__libamanda_la_SOURCES_DIST = alloc.c amfeatures.c amflock.c \
 am_libamanda_la_OBJECTS = alloc.lo amfeatures.lo amflock.lo \
        ipc-binary.lo amxml.lo clock.lo columnar.lo conffile.lo \
        debug.lo dgram.lo event.lo file.lo fileheader.lo glib-util.lo \
-       match.lo packet.lo pipespawn.lo protocol.lo queueing.lo \
-       semaphore.lo security.lo security-util.lo simpleprng.lo sl.lo \
+       match.lo packet.lo pipespawn.lo protocol.lo semaphore.lo \
+       security.lo security-util.lo simpleprng.lo sl.lo \
        sockaddr-util.lo stream.lo tapelist.lo timestamp.lo util.lo \
        $(am__objects_1) $(am__objects_2) $(am__objects_3) \
        $(am__objects_4) $(am__objects_5) $(am__objects_6) \
@@ -416,10 +428,9 @@ am_libtestutils_la_OBJECTS = testutils.lo
 libtestutils_la_OBJECTS = $(am_libtestutils_la_OBJECTS)
 am__EXEEXT_1 = file$(EXEEXT) bsdsecurity$(EXEEXT)
 am__EXEEXT_2 = amflock-test$(EXEEXT) event-test$(EXEEXT) \
-       semaphore-test$(EXEEXT) queueing-test$(EXEEXT) \
-       quoting-test$(EXEEXT) ipc-binary-test$(EXEEXT) \
-       hexencode-test$(EXEEXT) fileheader-test$(EXEEXT) \
-       match-test$(EXEEXT)
+       semaphore-test$(EXEEXT) quoting-test$(EXEEXT) \
+       ipc-binary-test$(EXEEXT) hexencode-test$(EXEEXT) \
+       fileheader-test$(EXEEXT) match-test$(EXEEXT)
 PROGRAMS = $(noinst_PROGRAMS)
 am_amflock_test_OBJECTS = amflock-test.$(OBJEXT)
 amflock_test_OBJECTS = $(am_amflock_test_OBJECTS)
@@ -450,9 +461,6 @@ ipc_binary_test_DEPENDENCIES = libamanda.la libtestutils.la
 am_match_test_OBJECTS = match-test.$(OBJEXT)
 match_test_OBJECTS = $(am_match_test_OBJECTS)
 match_test_DEPENDENCIES = libamanda.la libtestutils.la
-am_queueing_test_OBJECTS = queueing-test.$(OBJEXT)
-queueing_test_OBJECTS = $(am_queueing_test_OBJECTS)
-queueing_test_DEPENDENCIES = libamanda.la libtestutils.la
 am_quoting_test_OBJECTS = quoting-test.$(OBJEXT)
 quoting_test_OBJECTS = $(am_quoting_test_OBJECTS)
 quoting_test_DEPENDENCIES = libamanda.la libtestutils.la
@@ -478,15 +486,15 @@ SOURCES = $(libamanda_la_SOURCES) $(nodist_libamanda_la_SOURCES) \
        $(bsdsecurity_SOURCES) $(event_test_SOURCES) $(file_SOURCES) \
        $(fileheader_test_SOURCES) $(genversion_SOURCES) \
        $(hexencode_test_SOURCES) $(ipc_binary_test_SOURCES) \
-       $(match_test_SOURCES) $(queueing_test_SOURCES) \
-       $(quoting_test_SOURCES) $(semaphore_test_SOURCES)
+       $(match_test_SOURCES) $(quoting_test_SOURCES) \
+       $(semaphore_test_SOURCES)
 DIST_SOURCES = $(am__libamanda_la_SOURCES_DIST) \
        $(libtestutils_la_SOURCES) $(amflock_test_SOURCES) \
        $(bsdsecurity_SOURCES) $(event_test_SOURCES) $(file_SOURCES) \
        $(fileheader_test_SOURCES) $(genversion_SOURCES) \
        $(hexencode_test_SOURCES) $(ipc_binary_test_SOURCES) \
-       $(match_test_SOURCES) $(queueing_test_SOURCES) \
-       $(quoting_test_SOURCES) $(semaphore_test_SOURCES)
+       $(match_test_SOURCES) $(quoting_test_SOURCES) \
+       $(semaphore_test_SOURCES)
 DATA = $(amlibexec_DATA)
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
@@ -515,7 +523,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -535,10 +543,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -594,78 +599,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -676,12 +736,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -696,17 +785,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -715,60 +808,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -776,13 +928,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -791,9 +949,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -829,7 +990,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -838,7 +998,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -846,19 +1005,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -884,47 +1066,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -932,6 +1170,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -954,19 +1193,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -976,13 +1217,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -1026,6 +1264,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -1091,6 +1330,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 INCLUDES = -I$(top_srcdir)/gnulib   
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
 AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
@@ -1100,12 +1352,12 @@ LINTFLAGS = $(AMLINTFLAGS)
 libamanda_la_SOURCES = alloc.c amfeatures.c amflock.c ipc-binary.c \
        amxml.c clock.c columnar.c conffile.c debug.c dgram.c event.c \
        file.c fileheader.c glib-util.c match.c packet.c pipespawn.c \
-       protocol.c queueing.c semaphore.c security.c security-util.c \
-       simpleprng.c sl.c sockaddr-util.c stream.c tapelist.c \
-       timestamp.c util.c $(am__append_2) $(am__append_3) \
-       $(am__append_4) $(am__append_5) $(am__append_6) \
-       $(am__append_7) $(am__append_8) $(am__append_9) \
-       $(am__append_10) $(am__append_11) local-security.c
+       protocol.c semaphore.c security.c security-util.c simpleprng.c \
+       sl.c sockaddr-util.c stream.c tapelist.c timestamp.c util.c \
+       $(am__append_2) $(am__append_3) $(am__append_4) \
+       $(am__append_5) $(am__append_6) $(am__append_7) \
+       $(am__append_8) $(am__append_9) $(am__append_10) \
+       $(am__append_11) local-security.c
 # version.c is generated; see below
 nodist_libamanda_la_SOURCES = version.c
 libamanda_la_LIBADD = \
@@ -1133,7 +1385,6 @@ noinst_HEADERS = \
        packet.h                \
        pipespawn.h             \
        protocol.h              \
-       queueing.h              \
        semaphore.h             \
        security.h              \
        security-util.h         \
@@ -1209,8 +1460,6 @@ event_test_SOURCES = event-test.c
 event_test_LDADD = libamanda.la libtestutils.la
 semaphore_test_SOURCES = semaphore-test.c
 semaphore_test_LDADD = libamanda.la libtestutils.la
-queueing_test_SOURCES = queueing-test.c
-queueing_test_LDADD = libamanda.la libtestutils.la
 quoting_test_SOURCES = quoting-test.c
 quoting_test_LDADD = libamanda.la libtestutils.la
 ipc_binary_test_SOURCES = ipc-binary-test.c
@@ -1246,11 +1495,6 @@ SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL)
 amlibexec_DATA = $(SCRIPTS_INCLUDE)
 amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL)
 sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL)
-
-# installation
-INSTALLPERMS_data = dest=$(sbindir) chown=amanda $(sbin_SCRIPTS) \
-                   dest=$(amlibexecdir) chown=amanda $(amlibexec_SCRIPTS) $(amlibexec_DATA)
-
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -1366,9 +1610,6 @@ ipc-binary-test$(EXEEXT): $(ipc_binary_test_OBJECTS) $(ipc_binary_test_DEPENDENC
 match-test$(EXEEXT): $(match_test_OBJECTS) $(match_test_DEPENDENCIES) 
        @rm -f match-test$(EXEEXT)
        $(LINK) $(match_test_OBJECTS) $(match_test_LDADD) $(LIBS)
-queueing-test$(EXEEXT): $(queueing_test_OBJECTS) $(queueing_test_DEPENDENCIES) 
-       @rm -f queueing-test$(EXEEXT)
-       $(LINK) $(queueing_test_OBJECTS) $(queueing_test_LDADD) $(LIBS)
 quoting-test$(EXEEXT): $(quoting_test_OBJECTS) $(quoting_test_DEPENDENCIES) 
        @rm -f quoting-test$(EXEEXT)
        $(LINK) $(quoting_test_OBJECTS) $(quoting_test_LDADD) $(LIBS)
@@ -1486,8 +1727,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipespawn.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queueing-test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queueing.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quoting-test.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsh-security.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security-util.Plo@am__quote@
@@ -1729,6 +1968,7 @@ distdir: $(DISTFILES)
        $(MAKE) $(AM_MAKEFLAGS) \
          top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-hook
+@SYNTAX_CHECKS_FALSE@check-local:
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
 check: $(BUILT_SOURCES)
@@ -1822,7 +2062,7 @@ install-ps: install-ps-am
 
 install-ps-am:
 
-installcheck-am: installcheck-local
+installcheck-am:
 
 maintainer-clean: maintainer-clean-am
        -rm -rf ./$(DEPDIR)
@@ -1860,24 +2100,25 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecDATA \
        install-exec-am install-exec-hook install-html install-html-am \
        install-info install-info-am install-man install-pdf \
        install-pdf-am install-ps install-ps-am install-sbinSCRIPTS \
-       install-strip installcheck installcheck-am installcheck-local \
-       installdirs maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-compile mostlyclean-generic \
-       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
-       uninstall-am uninstall-amlibLTLIBRARIES \
-       uninstall-amlibexecDATA uninstall-amlibexecSCRIPTS \
-       uninstall-sbinSCRIPTS
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-amlibLTLIBRARIES uninstall-amlibexecDATA \
+       uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS
 
 
 # Perl
 %: %.pl $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          rm $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  fi
+@SYNTAX_CHECKS_TRUE@   @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+@SYNTAX_CHECKS_TRUE@           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
+@SYNTAX_CHECKS_TRUE@           rm $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@   else \
+@SYNTAX_CHECKS_TRUE@           echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
+@SYNTAX_CHECKS_TRUE@   fi
 
 %.pl: %.pl.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
@@ -1901,33 +2142,22 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecDATA \
 %.awk: %.awk.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
 
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
 check-perl: $(SCRIPTS_PERL)
        @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
            test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-           if test -n "$(PERL)"; then \
-                   for perlobj in $$SCRIPTS_PERL; do \
-                           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
-                           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
-                           rm $$perlobj.nouselib; \
-                   done; \
-           fi \
-       fi
-check-local: check-perl
-
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
-       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
-       if test x"$(SKIP_CHECKS)" = x"" && \
-           test -n "$(PERL)"; then \
-               for perlobj in $$SCRIPTS_PERL; do \
-                       $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
-               done; \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
        fi
-installcheck-local: installcheck-perl
+@SYNTAX_CHECKS_TRUE@check-local: check-perl
 
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
 check-shell: $(SCRIPTS_SHELL)
        @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
@@ -1945,7 +2175,7 @@ check-shell: $(SCRIPTS_SHELL)
                        echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
        fi
-check-local: check-shell
+@SYNTAX_CHECKS_TRUE@check-local: check-shell
 
 # make sure that the sources for all shell and perl scripts get included
 # in the distribution
@@ -1985,29 +2215,12 @@ dist-hook: dist-scripts
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
@@ -2038,6 +2251,8 @@ version.c: genversion$(EXEEXT)
        -rm -f version.c
        ./genversion$(EXEEXT) > version.c
 
+# installation
+
 lint:
        @echo $(LINT) $(libamanda_la_SOURCES)
        @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(libamanda_la_SOURCES)
index d2d9eaed7d57823d8db459abd4e4858ad79a65ec..c470b9d974c33a248edca731b19bce016f8396fe 100644 (file)
@@ -315,13 +315,11 @@ debug_vstrextend(
         return *oldstr;
 }
 
-
-extern char **environ;
 /*
- * safe_env - build a "safe" environment list.
+ * safe_env_full - build a "safe" environment list.
  */
 char **
-safe_env(void)
+safe_env_full(char **add)
 {
     static char *safe_env_list[] = {
        "TZ",
@@ -351,14 +349,24 @@ safe_env(void)
     size_t l1, l2;
     char **env;
     int    env_cnt;
+    int nadd = 0;
+
+    /* count ADD */
+    for (p = add; p && *p; p++)
+       nadd++;
 
     if (getuid() == geteuid() && getgid() == getegid()) {
        env_cnt = 1;
        for (env = environ; *env != NULL; env++)
            env_cnt++;
-       if ((q = (char **)malloc(env_cnt*SIZEOF(char *))) != NULL) {
+       if ((q = (char **)malloc((nadd+env_cnt)*SIZEOF(char *))) != NULL) {
            envp = q;
            p = envp;
+           /* copy in ADD */
+           for (env = add; env && *env; env++) {
+               *p = *env;
+               p++;
+           }
            for (env = environ; *env != NULL; env++) {
                if (strncmp("LANG=", *env, 5) != 0 &&
                    strncmp("LC_", *env, 3) != 0) {
@@ -371,8 +379,15 @@ safe_env(void)
        return envp;
     }
 
-    if ((q = (char **)malloc(SIZEOF(safe_env_list))) != NULL) {
+    if ((q = (char **)malloc(nadd*sizeof(char *) + SIZEOF(safe_env_list))) != NULL) {
        envp = q;
+       /* copy in ADD */
+       for (p = add; p && *p; p++) {
+           *q = *p;
+           q++;
+       }
+
+       /* and copy any SAFE_ENV that are already set */
        for (p = safe_env_list; *p != NULL; p++) {
            if ((v = getenv(*p)) == NULL) {
                continue;                       /* no variable to dup */
@@ -392,70 +407,3 @@ safe_env(void)
     }
     return envp;
 }
-
-/*
- * amtable_alloc -- (re)allocate enough space for some number of elements.
- *
- * input:      table -- pointer to pointer to table
- *             current -- pointer to current number of elements
- *             elsize -- size of a table element
- *             count -- desired number of elements
- *             bump -- round up factor
- *             init_func -- optional element initialization function
- * output:     table -- possibly adjusted to point to new table area
- *             current -- possibly adjusted to new number of elements
- */
-
-int
-debug_amtable_alloc(
-    const char *file,
-    int                line,
-    void **    table,
-    size_t *   current,
-    size_t     elsize,
-    size_t     count,
-    int                bump,
-    void (*init_func)(void *))
-{
-    void *table_new;
-    size_t table_count_new;
-    size_t i;
-
-    if (count >= *current) {
-       table_count_new = ((count + bump) / bump) * bump;
-       table_new = debug_alloc(file, line, table_count_new * elsize);
-       if (0 != *table) {
-           memcpy(table_new, *table, *current * elsize);
-           free(*table);
-       }
-       *table = table_new;
-       memset(((char *)*table) + *current * elsize,
-              0,
-              (table_count_new - *current) * elsize);
-       if (init_func != NULL) {
-           for (i = *current; i < table_count_new; i++) {
-               (*init_func)(((char *)*table) + i * elsize);
-           }
-       }
-       *current = table_count_new;
-    }
-    return 0;
-}
-
-/*
- * amtable_free -- release a table.
- *
- * input:      table -- pointer to pointer to table
- *             current -- pointer to current number of elements
- * output:     table -- possibly adjusted to point to new table area
- *             current -- possibly adjusted to new number of elements
- */
-
-void
-amtable_free(
-    void **    table,
-    size_t *   current)
-{
-    amfree(*table);
-    *current = 0;
-}
index c364bf4e3ef9e24b360908931f0d379d0c668fe2..d9593cd7bd85eaf04adddfc69fe46d9f859006f0 100755 (executable)
@@ -1,6 +1,6 @@
 #! @SHELL@
 #
-# Copyright (c) 2007,2008 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2007, 2008, 2010 Zmanda Inc.  All Rights Reserved.
 # 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -52,24 +52,25 @@ FDNUMBER=3
 
 if test x$1 = x-d ; then
     # decrypt
-    n=`head -c 10 - | tr -d -c 0-9a-zA-Z`
+    n=`/bin/dd bs=10 count=1 2> /dev/null | tr -d -c 0-9a-zA-Z`
     if test x${n} != xbz2aespipe ; then
-        echo `_ 'bz2aespipe: wrong magic - aborted'` >/dev/tty
+        echo "bz2aespipe: wrong magic - aborted" >/dev/tty
         exit 1
     fi
-    itercountk=`head -c 10 - | tr -d -c 0-9`
+    itercountk=`/bin/dd bs=10 count=1 2> /dev/null | tr -d -c 0-9`
     if test x${itercountk} = x ; then itercountk=0; fi
-    n=`head -c 1 - | tr -d -c 0-9`
+    n=`/bin/dd bs=1 count=1 2> /dev/null | tr -d -c 0-9`
     encryption=AES128
     if test x${n} = x1 ; then encryption=AES192; fi
     if test x${n} = x2 ; then encryption=AES256; fi
-    n=`head -c 1 - | tr -d -c 0-9`
+    n=`/bin/dd bs=1 count=1 2> /dev/null | tr -d -c 0-9`
     hashfunc=SHA256
     if test x${n} = x1 ; then hashfunc=SHA384; fi
     if test x${n} = x2 ; then hashfunc=SHA512; fi
     if test x${n} = x3 ; then hashfunc=RMD160; fi
-    seedstr=`head -c 24 - | tr -d -c 0-9a-zA-Z+/`
-    aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${encryption} -H ${hashfunc} -S ${seedstr} -C ${itercountk} -d
+    seedstr=`/bin/dd bs=24 count=1 2> /dev/null | tr -d -c 0-9a-zA-Z+/`
+    aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${encryption} -H ${hashfunc} \
+       -S ${seedstr} -C ${itercountk} -d
 else
     # encrypt
     echo -n bz2aespipe
@@ -85,6 +86,7 @@ else
     if test x${n} = x160 ; then hashstr=3; fi
     seedstr=`head -c 18 /dev/urandom | uuencode -m - | head -n 2 | tail -n 1`
     echo -n ${aesstr}${hashstr}${seedstr}
-    aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${ENCRYPTION} -H ${HASHFUNC} -S ${seedstr} -C ${ITERCOUNTK} -w ${WAITSECONDS}
+    aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${ENCRYPTION} -H ${HASHFUNC} \
+       -S ${seedstr} -C ${ITERCOUNTK} -w ${WAITSECONDS}
 fi
 exit 0
index 510ba076515b3b63c599304d3fbb6a95a850511f..0958790cdfbab2ebd1e94fc4b07be995ee312b04 100644 (file)
@@ -450,27 +450,11 @@ char *debug_vstrextend(const char *file, int line, char **oldstr, ...);
 #define agets(f)             debug_agets(__FILE__,__LINE__,(f))
 #define areads(f)            debug_areads(__FILE__,__LINE__,(f))
 
-extern int debug_amtable_alloc(const char *file,
-                                 int line,
-                                 void **table,
-                                 size_t *current,
-                                 size_t elsize,
-                                 size_t count,
-                                 int bump,
-                                 void (*init_func)(void *));
-
-#define amtable_alloc(t,c,s,n,b,f) debug_amtable_alloc(__FILE__,      \
-                                                    __LINE__,        \
-                                                    (t),             \
-                                                    (c),             \
-                                                    (s),             \
-                                                    (n),             \
-                                                    (b),             \
-                                                    (f))
-
-extern void amtable_free(void **, size_t *);
-
-char **        safe_env(void);
+/* return a "safe" version of the current environment; pass this to execle */
+#define safe_env() safe_env_full(NULL)
+
+/* like safe_env, but optionally add additional environment variables */
+char **        safe_env_full(char **add);
 
 time_t unctime(char *timestr);
 
index 6f364df6da86e5bbf930b4b73fb3310edae8c4e1..c7b80503e7ba4a89406e64bc39c4217dd78a5e92 100644 (file)
@@ -161,6 +161,7 @@ am_init_feature_set(void)
        am_add_feature(f, fe_amrecover_origsize_in_header);
        am_add_feature(f, fe_amidxtaped_abort);
        am_add_feature(f, fe_amrecover_correct_disk_quoting);
+       am_add_feature(f, fe_amindexd_quote_label);
     }
     return f;
 }
index 7934088b98a57d18a8e8e1162f6c689e10bbc250..8c5b5f82f4d511567128d85b73f215f1b09eb724 100644 (file)
@@ -187,6 +187,7 @@ typedef enum {
     fe_amrecover_origsize_in_header,
     fe_amidxtaped_abort,
     fe_amrecover_correct_disk_quoting,
+    fe_amindexd_quote_label,
 
     /*
      * All new features must be inserted immediately *before* this entry.
index 1b519a390062187b53dffba8f859157fbcbfdb9d..c6636cd34544273b6deb05faa9e6453a8acf5bd0 100644 (file)
@@ -1,5 +1,5 @@
 #! @PERL@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 use Amanda::Config qw( :getconf :init );
 use Amanda::Debug qw( :logging );
 use Amanda::Util qw( :constants );
index 3402ae8b0406c2764f2a0f7a281040e3e92f39bf..fedf5cc985d2e87c1f6729cd1938b211cdc43c28 100644 (file)
@@ -76,6 +76,48 @@ alloc_dle(void)
     return dle;
 }
 
+void
+free_dle(
+    dle_t *dle)
+{
+    scriptlist_t scriptlist;
+
+    amfree(dle->disk);
+    amfree(dle->device);
+    amfree(dle->program);
+    g_slist_free(dle->estimatelist);
+    g_slist_free_full(dle->levellist);
+    amfree(dle->dumpdate);
+    amfree(dle->compprog);
+    amfree(dle->srv_encrypt);
+    amfree(dle->clnt_encrypt);
+    amfree(dle->srv_decrypt_opt);
+    amfree(dle->clnt_decrypt_opt);
+    amfree(dle->auth);
+    free_sl(dle->exclude_file);
+    free_sl(dle->exclude_list);
+    free_sl(dle->include_file);
+    free_sl(dle->include_list);
+    if (dle->application_property)
+       g_hash_table_destroy(dle->application_property);
+    for(scriptlist = dle->scriptlist; scriptlist != NULL;
+                                     scriptlist = scriptlist->next) {
+       free_script_data((script_t *)scriptlist->data);
+    }
+    g_slist_free_full(dle->scriptlist);
+    g_slist_free_full(dle->directtcp_list);
+    amfree(dle);
+}
+
+void
+free_script_data(
+    script_t *script)
+{
+    amfree(script->plugin);
+    if (script->property)
+       g_hash_table_destroy(script->property);
+}
+
 void
 init_dle(
     dle_t *dle)
@@ -375,12 +417,12 @@ amstart_element(
        } else {
            data_user->has_backup_program = 1;
            data_user->property =
-                   g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
+                   g_hash_table_new_full(g_str_hash, g_str_equal, &g_free, &free_property_t);
            data_user->has_plugin = 0;
        }
     } else if (strcmp(element_name, "script") == 0) {
        data_user->property =
-                   g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
+                   g_hash_table_new_full(g_str_hash, g_str_equal, &g_free, &free_property_t);
        data_user->script = malloc(sizeof(script_t));
        data_user->script->plugin = NULL;
        data_user->script->execute_on = 0;
@@ -537,11 +579,13 @@ amtext(
        strcmp(last_element_name, "include") == 0) {
        g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
                    "XML: %s doesn't have text '%s'", last_element_name, tt);
+       amfree(tt);
        return;
     } else if(strcmp(last_element_name, "disk") == 0) {
        if (dle->disk != NULL) {
            g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
                        "XML: multiple text in %s", last_element_name);
+           amfree(tt);
            return;
        }
        dle->disk = tt;
@@ -549,6 +593,7 @@ amtext(
        if (dle->device != NULL) {
            g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
                        "XML: multiple text in %s", last_element_name);
+           amfree(tt);
            return;
        }
        dle->device = tt;
@@ -587,12 +632,15 @@ amtext(
        if (dle->program != NULL) {
            g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
                        "XML: multiple text in %s", last_element_name);
+           amfree(tt);
            return;
        }
-       dle->program = tt;
        if (strcmp(tt, "APPLICATION") == 0) {
            dle->program_is_application_api = 1;
            dle->program = NULL;
+           amfree(tt);
+       } else {
+           dle->program = tt;
        }
     } else if(strcmp(last_element_name, "plugin") == 0) {
        last_element2 = g_slist_nth(data_user->element_names, 1);
@@ -632,6 +680,7 @@ amtext(
        } else {
            error("priority outside of property");
        }
+       amfree(tt);
     } else if(strcmp(last_element_name, "value") == 0) {
        last_element2 = g_slist_nth(data_user->element_names, 1);
        if (!last_element2) {
@@ -694,10 +743,13 @@ amtext(
        } else {
            g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
                        "XML: Invalid %s (%s)", last_element_name, tt);
+           amfree(tt);
            return;
        }
+       amfree(tt);
     } else if(strcmp(last_element_name, "spindle") == 0) {
        dle->spindle = atoi(tt);
+       amfree(tt);
     } else if(strcmp(last_element_name, "compress") == 0) {
        if (strcmp(tt, "FAST") == 0) {
            dle->compress = COMP_FAST;
@@ -758,17 +810,24 @@ amtext(
            error("XML: optional");
        }
        last_element2_name = last_element2->data;
-       dle->clnt_encrypt = tt;
+       if (dle->encrypt == ENCRYPT_SERV_CUST)
+           dle->srv_encrypt = tt;
+       else
+           dle->clnt_encrypt = tt;
     } else if(strcmp(last_element_name, "decrypt-option") == 0) {
        last_element2 = g_slist_nth(data_user->element_names, 1);
        if (!last_element2) {
            error("XML: optional");
        }
        last_element2_name = last_element2->data;
-       dle->clnt_decrypt_opt = tt;
+       if (dle->encrypt == ENCRYPT_SERV_CUST)
+           dle->srv_decrypt_opt = tt;
+       else
+           dle->clnt_decrypt_opt = tt;
     } else if(strcmp(last_element_name, "exclude") == 0 ||
              strcmp(last_element_name, "include") == 0) {
        data_user->has_optional = 0;
+       amfree(tt);
     } else if(strcmp(last_element_name, "file") == 0) {
        last_element2 = g_slist_nth(data_user->element_names, 1);
        if (!last_element2) {
@@ -812,6 +871,7 @@ amtext(
        data_user->has_optional = 1;
        amfree(tt);
     } else if(strcmp(last_element_name, "script") == 0) {
+       amfree(tt);
     } else if(strcmp(last_element_name, "execute_on") == 0) {
        char *sep;
        char *tt1 = tt;
@@ -865,6 +925,7 @@ amtext(
        } else {
            data_user->script->execute_where = ES_SERVER;
        }
+       amfree(tt);
     } else if(strcmp(last_element_name, "datapath") == 0) {
        if (strcmp(tt, "AMANDA") == 0) {
            dle->data_path = DATA_PATH_AMANDA;
@@ -880,6 +941,7 @@ amtext(
     } else {
        g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
                    "XML: amtext not defined for '%s'", last_element_name);
+       amfree(tt);
        return;
     }
 }
index a8954e46b63447d4fcfedf71ab0abd406cda1cfe..2f64b62426dbab646464c8fa3b9340ac892ff35f 100644 (file)
@@ -87,6 +87,8 @@ typedef struct a_dle_s {
 
 dle_t *alloc_dle(void);
 void   init_dle(dle_t *dle);
+void   free_dle(dle_t *dle);
+void   free_script_data(script_t *script);
 dle_t *amxml_parse_node_CHAR(char *txt, char **errmsg);
 dle_t *amxml_parse_node_FILE(FILE *file, char **errmsg);
 char  *amxml_format_tag(char *tag, char *value);
index be023602e9fe1a39ab494dcb4e3b9aef3823c1f0..ad2929219e93031d2b060aa15cae0391edfadacb 100644 (file)
@@ -73,6 +73,7 @@ const security_driver_t bsd_security_driver = {
     "BSD",
     bsd_connect,
     bsd_accept,
+    sec_get_authenticated_peer_name_hostname,
     bsd_close,
     udpbsd_sendpkt,
     udp_recvpkt,
@@ -138,7 +139,7 @@ bsd_connect(
     (void)conf_fn;     /* Quiet unused parameter warning */
     (void)datap;        /* Quiet unused parameter warning */
 
-    bh = alloc(SIZEOF(*bh));
+    bh = g_new0(struct sec_handle, 1);
     bh->proto_handle=NULL;
     security_handleinit(&bh->sech, &bsd_security_driver);
 
@@ -398,7 +399,7 @@ bsd_stream_server(
 
     assert(bh != NULL);
 
-    bs = alloc(SIZEOF(*bs));
+    bs = g_new0(struct sec_stream, 1);
     security_streaminit(&bs->secstr, &bsd_security_driver);
     bs->socket = stream_server(SU_GET_FAMILY(&bh->udp->peer), &bs->port,
                               (size_t)STREAM_BUFSIZE, (size_t)STREAM_BUFSIZE,
@@ -453,7 +454,7 @@ bsd_stream_client(
 
     assert(bh != NULL);
 
-    bs = alloc(SIZEOF(*bs));
+    bs = g_new0(struct sec_stream, 1);
     security_streaminit(&bs->secstr, &bsd_security_driver);
     bs->fd = stream_client(bh->hostname, (in_port_t)id,
        STREAM_BUFSIZE, STREAM_BUFSIZE, &bs->port, 0);
index 03906c9a03ed2fdcb2b53d610f5dd35486b808f1..25a32ac5c1165644b7004276017df2abbd3fb43a 100644 (file)
@@ -66,6 +66,7 @@ const security_driver_t bsdtcp_security_driver = {
     "BSDTCP",
     bsdtcp_connect,
     bsdtcp_accept,
+    sec_get_authenticated_peer_name_hostname,
     sec_close,
     stream_sendpkt,
     stream_recvpkt,
@@ -118,7 +119,7 @@ bsdtcp_connect(
 
     auth_debug(1, _("bsdtcp: bsdtcp_connect: %s\n"), hostname);
 
-    rh = alloc(sizeof(*rh));
+    rh = g_new0(struct sec_handle, 1);
     security_handleinit(&rh->sech, &bsdtcp_security_driver);
     rh->hostname = NULL;
     rh->rs = NULL;
index cd265b3b47b5053e79c6e09bdbfce0bfab347bea..41ff9bfc056395f206f5b452175f2592860aa7a4 100644 (file)
@@ -63,6 +63,7 @@ const security_driver_t bsdudp_security_driver = {
     "BSDUDP",
     bsdudp_connect,
     bsdudp_accept,
+    sec_get_authenticated_peer_name_hostname,
     bsdudp_close,
     udpbsd_sendpkt,
     udp_recvpkt,
@@ -120,7 +121,7 @@ bsdudp_connect(
     (void)datap;       /* Quiet unused parameter warning */
     assert(hostname != NULL);
 
-    bh = alloc(sizeof(*bh));
+    bh = g_new0(struct sec_handle, 1);
     bh->proto_handle=NULL;
     bh->rc = NULL;
     security_handleinit(&bh->sech, &bsdudp_security_driver);
index 11ea02d1e060f222a46cd5460867e3bd2ca5602f..19d87da4718f099fa7caf5cc50f1491cf607672e 100644 (file)
@@ -63,7 +63,7 @@ typedef enum {
     CONF_CHANGERDEV,           CONF_CHANGERFILE,       CONF_LABELSTR,
     CONF_BUMPPERCENT,          CONF_BUMPSIZE,          CONF_BUMPDAYS,
     CONF_BUMPMULT,             CONF_ETIMEOUT,          CONF_DTIMEOUT,
-    CONF_CTIMEOUT,             CONF_TAPEBUFS,          CONF_TAPELIST,
+    CONF_CTIMEOUT,             CONF_TAPELIST,
     CONF_DEVICE_OUTPUT_BUFFER_SIZE,
     CONF_DISKFILE,             CONF_INFOFILE,          CONF_LOGDIR,
     CONF_LOGFILE,              CONF_DISKDIR,           CONF_DISKSIZE,
@@ -90,6 +90,7 @@ typedef enum {
     CONF_EXECUTE_ON,           CONF_EXECUTE_WHERE,     CONF_SEND_AMREPORT_ON,
     CONF_DEVICE,               CONF_ORDER,
     CONF_DATA_PATH,            CONF_AMANDA,            CONF_DIRECTTCP,
+    CONF_TAPER_PARALLEL_WRITE,
 
     /* execute on */
     CONF_PRE_DLE_AMCHECK,      CONF_PRE_HOST_AMCHECK,
@@ -122,10 +123,10 @@ typedef enum {
     CONF_SPLIT_DISKBUFFER,     CONF_FALLBACK_SPLITSIZE,CONF_SRVCOMPPROG,
     CONF_CLNTCOMPPROG,         CONF_SRV_ENCRYPT,       CONF_CLNT_ENCRYPT,
     CONF_SRV_DECRYPT_OPT,      CONF_CLNT_DECRYPT_OPT,  CONF_AMANDAD_PATH,
-    CONF_CLIENT_USERNAME,      CONF_CLIENT_PORT,
+    CONF_CLIENT_USERNAME,      CONF_CLIENT_PORT,       CONF_ALLOW_SPLIT,
 
     /* tape type */
-    /*COMMENT,*/               CONF_BLOCKSIZE,         CONF_FILE_PAD,
+    /*COMMENT,*/               CONF_BLOCKSIZE,
     CONF_LBL_TEMPL,            CONF_FILEMARK,          CONF_LENGTH,
     CONF_SPEED,                        CONF_READBLOCKSIZE,
 
@@ -160,6 +161,13 @@ typedef enum {
     CONF_AUTOLABEL,            CONF_ANY_VOLUME,        CONF_OTHER_CONFIG,
     CONF_NON_AMANDA,           CONF_VOLUME_ERROR,      CONF_EMPTY,
 
+    /* part_cache_type */
+    CONF_PART_SIZE,            CONF_PART_CACHE_TYPE,   CONF_PART_CACHE_DIR,
+    CONF_PART_CACHE_MAX_SIZE,  CONF_DISK,              CONF_MEMORY,
+
+    /* recovery-limit */
+    CONF_RECOVERY_LIMIT,       CONF_SAME_HOST,
+
     /* holdingdisk */
     CONF_NEVER,                        CONF_AUTO,              CONF_REQUIRED,
 
@@ -473,6 +481,7 @@ static void read_str(conf_var_t *, val_t *);
 static void read_ident(conf_var_t *, val_t *);
 static void read_time(conf_var_t *, val_t *);
 static void read_size(conf_var_t *, val_t *);
+static void read_size_byte(conf_var_t *, val_t *);
 static void read_bool(conf_var_t *, val_t *);
 static void read_compress(conf_var_t *, val_t *);
 static void read_encrypt(conf_var_t *, val_t *);
@@ -494,6 +503,8 @@ static void read_execute_where(conf_var_t *, val_t *);
 static void read_holdingdisk(conf_var_t *, val_t *);
 static void read_int_or_str(conf_var_t *, val_t *);
 static void read_autolabel(conf_var_t *, val_t *);
+static void read_part_cache_type(conf_var_t *, val_t *);
+static void read_recovery_limit(conf_var_t *, val_t *);
 
 /* Functions to get various types of values.  These are called by
  * read_functions to take care of any variations in the way that these
@@ -503,6 +514,7 @@ static void read_autolabel(conf_var_t *, val_t *);
 static time_t  get_time(void);
 static int     get_int(void);
 static ssize_t get_size(void);
+static ssize_t get_size_byte(void);
 static gint64  get_int64(void);
 static int     get_bool(void);
 
@@ -518,6 +530,7 @@ static void ckseen(seen_t *seen);
  * a parser table entry.  They call conf_parserror if the value in their
  * second argument is invalid.  */
 static void validate_nonnegative(conf_var_t *, val_t *);
+static void validate_non_zero(conf_var_t *, val_t *);
 static void validate_positive(conf_var_t *, val_t *);
 static void validate_runspercycle(conf_var_t *, val_t *);
 static void validate_bumppercent(conf_var_t *, val_t *);
@@ -645,6 +658,8 @@ static void conf_init_intrange(val_t *val, int i1, int i2);
 static void conf_init_proplist(val_t *val); /* to empty list */
 static void conf_init_application(val_t *val);
 static void conf_init_autolabel(val_t *val);
+static void conf_init_part_cache_type(val_t *val, part_cache_type_t i);
+static void conf_init_recovery_limit(val_t *val);
 
 /*
  * Command-line Handling
@@ -797,6 +812,7 @@ keytab_t client_keytab[] = {
 
 keytab_t server_keytab[] = {
     { "ALL", CONF_ALL },
+    { "ALLOW_SPLIT", CONF_ALLOW_SPLIT },
     { "AMANDA", CONF_AMANDA },
     { "AMANDAD_PATH", CONF_AMANDAD_PATH },
     { "AMRECOVER_CHANGER", CONF_AMRECOVER_CHANGER },
@@ -857,6 +873,7 @@ keytab_t server_keytab[] = {
     { "DEVICE_PROPERTY", CONF_DEVICE_PROPERTY },
     { "DIRECTORY", CONF_DIRECTORY },
     { "DIRECTTCP", CONF_DIRECTTCP },
+    { "DISK", CONF_DISK },
     { "DISKFILE", CONF_DISKFILE },
     { "DISPLAYUNIT", CONF_DISPLAYUNIT },
     { "DTIMEOUT", CONF_DTIMEOUT },
@@ -877,7 +894,6 @@ keytab_t server_keytab[] = {
     { "FALLBACK_SPLITSIZE", CONF_FALLBACK_SPLITSIZE },
     { "FAST", CONF_FAST },
     { "FILE", CONF_EFILE },
-    { "FILE_PAD", CONF_FILE_PAD },
     { "FILEMARK", CONF_FILEMARK },
     { "FIRST", CONF_FIRST },
     { "FIRSTFIT", CONF_FIRSTFIT },
@@ -912,6 +928,7 @@ keytab_t server_keytab[] = {
     { "MAXDUMPS", CONF_MAXDUMPS },
     { "MAXDUMPSIZE", CONF_MAXDUMPSIZE },
     { "MAXPROMOTEDAY", CONF_MAXPROMOTEDAY },
+    { "MEMORY", CONF_MEMORY },
     { "MEDIUM", CONF_MEDIUM },
     { "NETUSAGE", CONF_NETUSAGE },
     { "NEVER", CONF_NEVER },
@@ -923,6 +940,10 @@ keytab_t server_keytab[] = {
     { "ORDER", CONF_ORDER },
     { "ORG", CONF_ORG },
     { "OTHER_CONFIG", CONF_OTHER_CONFIG },
+    { "PART_CACHE_DIR", CONF_PART_CACHE_DIR },
+    { "PART_CACHE_MAX_SIZE", CONF_PART_CACHE_MAX_SIZE },
+    { "PART_CACHE_TYPE", CONF_PART_CACHE_TYPE },
+    { "PART_SIZE", CONF_PART_SIZE },
     { "PLUGIN", CONF_PLUGIN },
     { "PRE_DLE_AMCHECK", CONF_PRE_DLE_AMCHECK },
     { "PRE_HOST_AMCHECK", CONF_PRE_HOST_AMCHECK },
@@ -946,6 +967,7 @@ keytab_t server_keytab[] = {
     { "PROGRAM", CONF_PROGRAM },
     { "PROPERTY", CONF_PROPERTY },
     { "RECORD", CONF_RECORD },
+    { "RECOVERY_LIMIT", CONF_RECOVERY_LIMIT },
     { "REP_TRIES", CONF_REP_TRIES },
     { "REQ_TRIES", CONF_REQ_TRIES },
     { "REQUIRED", CONF_REQUIRED },
@@ -954,6 +976,7 @@ keytab_t server_keytab[] = {
     { "RESERVED_TCP_PORT", CONF_RESERVED_TCP_PORT },
     { "RUNSPERCYCLE", CONF_RUNSPERCYCLE },
     { "RUNTAPES", CONF_RUNTAPES },
+    { "SAME_HOST", CONF_SAME_HOST },
     { "SCRIPT", CONF_SCRIPT },
     { "SCRIPT_TOOL", CONF_SCRIPT_TOOL },
     { "SEND_AMREPORT_ON", CONF_SEND_AMREPORT_ON },
@@ -973,12 +996,12 @@ keytab_t server_keytab[] = {
     { "STARTTIME", CONF_STARTTIME },
     { "STRANGE", CONF_STRANGE },
     { "STRATEGY", CONF_STRATEGY },
-    { "TAPEBUFS", CONF_TAPEBUFS },
     { "DEVICE_OUTPUT_BUFFER_SIZE", CONF_DEVICE_OUTPUT_BUFFER_SIZE },
     { "TAPECYCLE", CONF_TAPECYCLE },
     { "TAPEDEV", CONF_TAPEDEV },
     { "TAPELIST", CONF_TAPELIST },
     { "TAPERALGO", CONF_TAPERALGO },
+    { "TAPER_PARALLEL_WRITE", CONF_TAPER_PARALLEL_WRITE },
     { "FLUSH_THRESHOLD_DUMPED", CONF_FLUSH_THRESHOLD_DUMPED },
     { "FLUSH_THRESHOLD_SCHEDULED", CONF_FLUSH_THRESHOLD_SCHEDULED },
     { "TAPERFLUSH", CONF_TAPERFLUSH },
@@ -1137,13 +1160,13 @@ conf_var_t server_var [] = {
    { CONF_INPARALLEL           , CONFTYPE_INT      , read_int         , CNF_INPARALLEL           , validate_inparallel },
    { CONF_DUMPORDER            , CONFTYPE_STR      , read_str         , CNF_DUMPORDER            , NULL },
    { CONF_MAXDUMPS             , CONFTYPE_INT      , read_int         , CNF_MAXDUMPS             , validate_positive },
-   { CONF_ETIMEOUT             , CONFTYPE_INT      , read_int         , CNF_ETIMEOUT             , validate_positive },
+   { CONF_ETIMEOUT             , CONFTYPE_INT      , read_int         , CNF_ETIMEOUT             , validate_non_zero },
    { CONF_DTIMEOUT             , CONFTYPE_INT      , read_int         , CNF_DTIMEOUT             , validate_positive },
    { CONF_CTIMEOUT             , CONFTYPE_INT      , read_int         , CNF_CTIMEOUT             , validate_positive },
-   { CONF_TAPEBUFS             , CONFTYPE_INT      , read_int         , CNF_TAPEBUFS             , validate_positive },
-   { CONF_DEVICE_OUTPUT_BUFFER_SIZE, CONFTYPE_SIZE , read_size        , CNF_DEVICE_OUTPUT_BUFFER_SIZE, validate_positive },
+   { CONF_DEVICE_OUTPUT_BUFFER_SIZE, CONFTYPE_SIZE , read_size_byte   , CNF_DEVICE_OUTPUT_BUFFER_SIZE, validate_positive },
    { CONF_COLUMNSPEC           , CONFTYPE_STR      , read_str         , CNF_COLUMNSPEC           , NULL },
    { CONF_TAPERALGO            , CONFTYPE_TAPERALGO, read_taperalgo   , CNF_TAPERALGO            , NULL },
+   { CONF_TAPER_PARALLEL_WRITE , CONFTYPE_INT      , read_int         , CNF_TAPER_PARALLEL_WRITE , NULL },
    { CONF_SEND_AMREPORT_ON     , CONFTYPE_SEND_AMREPORT_ON, read_send_amreport_on, CNF_SEND_AMREPORT_ON       , NULL },
    { CONF_FLUSH_THRESHOLD_DUMPED, CONFTYPE_INT     , read_int         , CNF_FLUSH_THRESHOLD_DUMPED, validate_nonnegative },
    { CONF_FLUSH_THRESHOLD_SCHEDULED, CONFTYPE_INT  , read_int         , CNF_FLUSH_THRESHOLD_SCHEDULED, validate_nonnegative },
@@ -1184,19 +1207,23 @@ conf_var_t server_var [] = {
    { CONF_RESERVED_UDP_PORT    , CONFTYPE_INTRANGE , read_intrange    , CNF_RESERVED_UDP_PORT    , validate_reserved_port_range },
    { CONF_RESERVED_TCP_PORT    , CONFTYPE_INTRANGE , read_intrange    , CNF_RESERVED_TCP_PORT    , validate_reserved_port_range },
    { CONF_UNRESERVED_TCP_PORT  , CONFTYPE_INTRANGE , read_intrange    , CNF_UNRESERVED_TCP_PORT  , validate_unreserved_port_range },
+   { CONF_RECOVERY_LIMIT       , CONFTYPE_RECOVERY_LIMIT, read_recovery_limit, CNF_RECOVERY_LIMIT, NULL },
    { CONF_UNKNOWN              , CONFTYPE_INT      , NULL             , CNF_CNF                  , NULL }
 };
 
 conf_var_t tapetype_var [] = {
-   { CONF_COMMENT       , CONFTYPE_STR     , read_str   , TAPETYPE_COMMENT      , NULL },
-   { CONF_LBL_TEMPL     , CONFTYPE_STR     , read_str   , TAPETYPE_LBL_TEMPL    , NULL },
-   { CONF_BLOCKSIZE     , CONFTYPE_SIZE    , read_size  , TAPETYPE_BLOCKSIZE    , validate_blocksize },
-   { CONF_READBLOCKSIZE , CONFTYPE_SIZE    , read_size  , TAPETYPE_READBLOCKSIZE, validate_blocksize },
-   { CONF_LENGTH        , CONFTYPE_INT64   , read_int64 , TAPETYPE_LENGTH       , validate_nonnegative },
-   { CONF_FILEMARK      , CONFTYPE_INT64   , read_int64 , TAPETYPE_FILEMARK     , NULL },
-   { CONF_SPEED         , CONFTYPE_INT     , read_int   , TAPETYPE_SPEED        , validate_nonnegative },
-   { CONF_FILE_PAD      , CONFTYPE_BOOLEAN , read_bool  , TAPETYPE_FILE_PAD     , NULL },
-   { CONF_UNKNOWN       , CONFTYPE_INT     , NULL       , TAPETYPE_TAPETYPE     , NULL }
+   { CONF_COMMENT              , CONFTYPE_STR     , read_str          , TAPETYPE_COMMENT         , NULL },
+   { CONF_LBL_TEMPL            , CONFTYPE_STR     , read_str          , TAPETYPE_LBL_TEMPL       , NULL },
+   { CONF_BLOCKSIZE            , CONFTYPE_SIZE    , read_size         , TAPETYPE_BLOCKSIZE       , validate_blocksize },
+   { CONF_READBLOCKSIZE        , CONFTYPE_SIZE    , read_size         , TAPETYPE_READBLOCKSIZE   , validate_blocksize },
+   { CONF_LENGTH               , CONFTYPE_INT64   , read_int64        , TAPETYPE_LENGTH          , validate_nonnegative },
+   { CONF_FILEMARK             , CONFTYPE_INT64   , read_int64        , TAPETYPE_FILEMARK        , NULL },
+   { CONF_SPEED                , CONFTYPE_INT     , read_int          , TAPETYPE_SPEED           , validate_nonnegative },
+   { CONF_PART_SIZE            , CONFTYPE_INT64    , read_int64       , TAPETYPE_PART_SIZE       , validate_nonnegative },
+   { CONF_PART_CACHE_TYPE      , CONFTYPE_PART_CACHE_TYPE, read_part_cache_type, TAPETYPE_PART_CACHE_TYPE, NULL },
+   { CONF_PART_CACHE_DIR       , CONFTYPE_STR      , read_str         , TAPETYPE_PART_CACHE_DIR         , NULL },
+   { CONF_PART_CACHE_MAX_SIZE  , CONFTYPE_INT64    , read_int64       , TAPETYPE_PART_CACHE_MAX_SIZE, validate_nonnegative },
+   { CONF_UNKNOWN              , CONFTYPE_INT     , NULL              , TAPETYPE_TAPETYPE        , NULL }
 };
 
 conf_var_t dumptype_var [] = {
@@ -1241,8 +1268,10 @@ conf_var_t dumptype_var [] = {
    { CONF_SRV_DECRYPT_OPT   , CONFTYPE_STR      , read_str      , DUMPTYPE_SRV_DECRYPT_OPT   , NULL },
    { CONF_CLNT_DECRYPT_OPT  , CONFTYPE_STR      , read_str      , DUMPTYPE_CLNT_DECRYPT_OPT  , NULL },
    { CONF_APPLICATION       , CONFTYPE_STR      , read_dapplication, DUMPTYPE_APPLICATION    , NULL },
-   { CONF_SCRIPT            , CONFTYPE_STR      , read_dpp_script, DUMPTYPE_SCRIPTLIST    , NULL },
-   { CONF_DATA_PATH         , CONFTYPE_DATA_PATH, read_data_path, DUMPTYPE_DATA_PATH      , NULL },
+   { CONF_SCRIPT            , CONFTYPE_STR      , read_dpp_script, DUMPTYPE_SCRIPTLIST       , NULL },
+   { CONF_DATA_PATH         , CONFTYPE_DATA_PATH, read_data_path, DUMPTYPE_DATA_PATH         , NULL },
+   { CONF_ALLOW_SPLIT       , CONFTYPE_BOOLEAN  , read_bool    , DUMPTYPE_ALLOW_SPLIT       , NULL },
+   { CONF_RECOVERY_LIMIT    , CONFTYPE_RECOVERY_LIMIT, read_recovery_limit, DUMPTYPE_RECOVERY_LIMIT, NULL },
    { CONF_UNKNOWN           , CONFTYPE_INT      , NULL          , DUMPTYPE_DUMPTYPE          , NULL }
 };
 
@@ -1779,29 +1808,36 @@ read_confline(
 static void
 handle_deprecated_keyword(void)
 {
-    tok_t *dep;
     /* Procedure for deprecated keywords:
-     * 1) At time of deprecation, add to warning_deprecated below.
-     *    Note the date of deprecation.  The keyword will still be
-     *    parsed, and can still be used from other parts of Amanda,
-     *    during this time.
-     * 2) After two years, move the keyword (as a string) to
+     *
+     * 1) At time of deprecation, add to warning_deprecated below.  Note the
+     *    version in which deprecation will expire.  The keyword will still be
+     *    parsed, and can still be used from other parts of Amanda, during this
+     *    time.
+     * 2) After it has expired, move the keyword (as a string) to
      *    error_deprecated below. Remove the token (CONF_XXX) and
      *    config parameter (CNF_XXX) from the rest of the module.
      *    Note the date of the move.
      */
 
-    static tok_t warning_deprecated[] = {
-        CONF_TAPEBUFS,    /* 2007-10-15 */
-       CONF_FILE_PAD,    /* 2008-07-01 */
-       CONF_LABEL_NEW_TAPES,   /* 2010-02-05 */
-        0
-    };
-
-    for (dep = warning_deprecated; *dep; dep++) {
-       if (tok == *dep) {
-            conf_parswarn(_("warning: Keyword %s is deprecated."),
-                           tokenval.v.s);
+    static struct { tok_t tok; gboolean warned; }
+    warning_deprecated[] = {
+       { CONF_LABEL_NEW_TAPES, 0 },    /* exp in Amanda-3.2 */
+       { CONF_AMRECOVER_DO_FSF, 0 },   /* exp in Amanda-3.3 */
+       { CONF_AMRECOVER_CHECK_LABEL, 0 }, /* exp in Amanda-3.3 */
+       { CONF_TAPE_SPLITSIZE, 0 },     /* exp. in Amanda-3.3 */
+       { CONF_SPLIT_DISKBUFFER, 0 },   /* exp. in Amanda-3.3 */
+       { CONF_FALLBACK_SPLITSIZE, 0 }, /* exp. in Amanda-3.3 */
+       { 0, 0 },
+    }, *dep;
+
+    for (dep = warning_deprecated; dep->tok; dep++) {
+       if (tok == dep->tok) {
+           if (!dep->warned)
+               conf_parswarn(_("warning: Keyword %s is deprecated."),
+                              tokenval.v.s);
+           dep->warned = 1;
+           break;
        }
     }
 }
@@ -1812,17 +1848,29 @@ handle_invalid_keyword(
 {
     static const char * error_deprecated[] = {
        "rawtapedev",
+       "tapebufs", /* deprecated: 2007-10-15; invalid: 2010-04-14 */
+       "file-pad", /* deprecated: 2008-07-01; invalid: 2010-04-14 */
         NULL
     };
     const char ** s;
+    char *folded_token, *p;
+
+    /* convert '_' to '-' in TOKEN */
+    folded_token = g_strdup(token);
+    for (p = folded_token; *p; p++) {
+       if (*p == '_') *p = '-';
+    }
 
     for (s = error_deprecated; *s != NULL; s ++) {
-       if (g_ascii_strcasecmp(*s, token) == 0) {
+       if (g_ascii_strcasecmp(*s, folded_token) == 0) {
            conf_parserror(_("error: Keyword %s is deprecated."),
                           token);
+           g_free(folded_token);
            return;
        }
     }
+    g_free(folded_token);
+
     if (*s == NULL) {
         conf_parserror(_("configuration keyword expected"));
     }
@@ -1880,6 +1928,8 @@ read_block(
     do {
        current_line_num += 1;
        get_conftoken(CONF_ANY);
+       handle_deprecated_keyword();
+
        switch(tok) {
        case CONF_RBRACE:
            done = 1;
@@ -2220,6 +2270,8 @@ init_dumptype_defaults(void)
     conf_init_application(&dpcur.value[DUMPTYPE_APPLICATION]);
     conf_init_identlist(&dpcur.value[DUMPTYPE_SCRIPTLIST], NULL);
     conf_init_proplist(&dpcur.value[DUMPTYPE_PROPERTY]);
+    conf_init_bool     (&dpcur.value[DUMPTYPE_ALLOW_SPLIT]       , 1);
+    conf_init_recovery_limit(&dpcur.value[DUMPTYPE_RECOVERY_LIMIT]);
 }
 
 static void
@@ -2318,7 +2370,10 @@ init_tapetype_defaults(void)
     conf_init_int64 (&tpcur.value[TAPETYPE_LENGTH]       , ((gint64)2000));
     conf_init_int64 (&tpcur.value[TAPETYPE_FILEMARK]     , (gint64)1);
     conf_init_int   (&tpcur.value[TAPETYPE_SPEED]        , 200);
-    conf_init_bool  (&tpcur.value[TAPETYPE_FILE_PAD]     , 1);
+    conf_init_int64(&tpcur.value[TAPETYPE_PART_SIZE], 0);
+    conf_init_part_cache_type(&tpcur.value[TAPETYPE_PART_CACHE_TYPE], PART_CACHE_TYPE_NONE);
+    conf_init_str(&tpcur.value[TAPETYPE_PART_CACHE_DIR], "");
+    conf_init_int64(&tpcur.value[TAPETYPE_PART_CACHE_MAX_SIZE], 0);
 }
 
 static void
@@ -2337,6 +2392,7 @@ save_tapetype(void)
 
     tp = alloc(sizeof(tapetype_t));
     *tp = tpcur;
+
     /* add at end of list */
     if(!tapelist)
        tapelist = tp;
@@ -3029,6 +3085,15 @@ read_size(
     val_t__size(val) = get_size();
 }
 
+static void
+read_size_byte(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    ckseen(&val->seen);
+    val_t__size(val) = get_size_byte();
+}
+
 static void
 read_bool(
     conf_var_t *np G_GNUC_UNUSED,
@@ -3449,7 +3514,7 @@ read_property(
        conf_parserror(_("key expected"));
        return;
     }
-    key = g_ascii_strdown(tokenval.v.s, -1);
+    key = amandaify_property_name(tokenval.v.s);
 
     get_conftoken(CONF_ANY);
     if (tok == CONF_NL ||  tok == CONF_END) {
@@ -3669,7 +3734,7 @@ read_autolabel(
        else if (tok == CONF_EMPTY)
            val->v.autolabel.autolabel |= AL_EMPTY;
        else {
-           conf_parserror(_("ANY-VOLUME, NEW-VOLUME, OTHER-CONFIG, NON-AMANDA, VOLUME-ERROR or EMPTY is expected"));
+           conf_parserror(_("ANY, NEW-VOLUME, OTHER-CONFIG, NON-AMANDA, VOLUME-ERROR or EMPTY is expected"));
        }
        get_conftoken(CONF_ANY);
     }
@@ -3681,6 +3746,67 @@ read_autolabel(
     }
 }
 
+static void
+read_part_cache_type(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+   part_cache_type_t part_cache_type;
+
+   ckseen(&val->seen);
+
+   get_conftoken(CONF_ANY);
+   switch(tok) {
+   case CONF_NONE:
+     part_cache_type = PART_CACHE_TYPE_NONE;
+     break;
+
+   case CONF_DISK:
+     part_cache_type = PART_CACHE_TYPE_DISK;
+     break;
+
+   case CONF_MEMORY:
+     part_cache_type = PART_CACHE_TYPE_MEMORY;
+     break;
+
+   default:
+     conf_parserror(_("NONE, DISK or MEMORY expected"));
+     part_cache_type = PART_CACHE_TYPE_NONE;
+     break;
+   }
+
+   val_t__part_cache_type(val) = (int)part_cache_type;
+}
+
+static void
+read_recovery_limit(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    recovery_limit_t *rl = &val_t__recovery_limit(val);
+    ckseen(&val->seen);
+
+    while (1) {
+       get_conftoken(CONF_ANY);
+       switch(tok) {
+       case CONF_STRING:
+           rl->match_pats = g_slist_append(rl->match_pats, g_strdup(tokenval.v.s));
+           break;
+       case CONF_SAME_HOST:
+           rl->same_host = TRUE;
+           break;
+
+       case CONF_NL:
+       case CONF_END:
+           return;
+
+        default:
+           conf_parserror("SAME-HOST or a string expected");
+           break;
+       }
+    }
+}
+
 /* get_* functions */
 
 /* these functions use precompiler conditionals to skip useless size checks
@@ -3923,6 +4049,103 @@ get_size(void)
     return val;
 }
 
+static ssize_t
+get_size_byte(void)
+{
+    ssize_t val;
+    keytab_t *save_kt;
+
+    save_kt = keytable;
+    keytable = numb_keytable;
+
+    get_conftoken(CONF_ANY);
+
+    switch(tok) {
+    case CONF_SIZE:
+       val = tokenval.v.size;
+       break;
+
+    case CONF_INT:
+#if SIZEOF_SIZE_T < SIZEOF_INT
+       if ((gint64)tokenval.v.i > (gint64)SSIZE_MAX)
+           conf_parserror(_("value too large"));
+       if ((gint64)tokenval.v.i < (gint64)SSIZE_MIN)
+           conf_parserror(_("value too small"));
+#endif
+       val = (ssize_t)tokenval.v.i;
+       break;
+
+    case CONF_INT64:
+#if SIZEOF_SIZE_T < SIZEOF_GINT64
+       if (tokenval.v.int64 > (gint64)SSIZE_MAX)
+           conf_parserror(_("value too large"));
+       if (tokenval.v.int64 < (gint64)SSIZE_MIN)
+           conf_parserror(_("value too small"));
+#endif
+       val = (ssize_t)tokenval.v.int64;
+       break;
+
+    case CONF_AMINFINITY:
+       val = (ssize_t)SSIZE_MAX;
+       break;
+
+    default:
+       conf_parserror(_("an integer is expected"));
+       val = 0;
+       break;
+    }
+
+    /* get multiplier, if any */
+    get_conftoken(CONF_ANY);
+
+    switch(tok) {
+    case CONF_NL:                      /* multiply by one */
+    case CONF_MULT1:
+       break;
+    case CONF_MULT1K:
+       if (val > (ssize_t)(SSIZE_MAX / (ssize_t)1024))
+           conf_parserror(_("value too large"));
+       if (val < (ssize_t)(SSIZE_MIN / (ssize_t)1024))
+           conf_parserror(_("value too small"));
+       val *= (ssize_t)1024;
+
+    case CONF_MULT7:
+       if (val > (ssize_t)(SSIZE_MAX / 7))
+           conf_parserror(_("value too large"));
+       if (val < (ssize_t)(SSIZE_MIN / 7))
+           conf_parserror(_("value too small"));
+       val *= (ssize_t)7;
+       break;
+
+    case CONF_MULT1M:
+       if (val > (ssize_t)(SSIZE_MAX / (ssize_t)1024 * 1024))
+           conf_parserror(_("value too large"));
+       if (val < (ssize_t)(SSIZE_MIN / (ssize_t)1024 * 1024))
+           conf_parserror(_("value too small"));
+       val *= (ssize_t)(1024 * 1024);
+       break;
+
+    case CONF_MULT1G:
+       if (val > (ssize_t)(SSIZE_MAX / (1024 * 1024 * 1024)))
+           conf_parserror(_("value too large"));
+       if (val < (ssize_t)(SSIZE_MIN / (1024 * 1024 * 1024)))
+           conf_parserror(_("value too small"));
+       val *= (ssize_t)(1024 * 1024 * 1024);
+       break;
+
+    case CONF_MULT1T:
+       conf_parserror(_("value too large"));
+       break;
+
+    default:   /* it was not a multiplier */
+       unget_conftoken();
+       break;
+    }
+
+    keytable = save_kt;
+    return val;
+}
+
 static gint64
 get_int64(void)
 {
@@ -4093,6 +4316,33 @@ validate_nonnegative(
     }
 }
 
+static void
+validate_non_zero(
+    struct conf_var_s *np,
+    val_t        *val)
+{
+    switch(val->type) {
+    case CONFTYPE_INT:
+       if(val_t__int(val) == 0)
+           conf_parserror(_("%s must not be 0"), get_token_name(np->token));
+       break;
+    case CONFTYPE_INT64:
+       if(val_t__int64(val) == 0)
+           conf_parserror(_("%s must not be 0"), get_token_name(np->token));
+       break;
+    case CONFTYPE_TIME:
+       if(val_t__time(val) == 0)
+           conf_parserror(_("%s must not be 0"), get_token_name(np->token));
+       break;
+    case CONFTYPE_SIZE:
+       if(val_t__size(val) == 0)
+           conf_parserror(_("%s must not be 0"), get_token_name(np->token));
+       break;
+    default:
+       conf_parserror(_("validate_non_zero invalid type %d\n"), val->type);
+    }
+}
+
 static void
 validate_positive(
     struct conf_var_s *np,
@@ -4562,7 +4812,6 @@ init_defaults(
     conf_init_int      (&conf_data[CNF_ETIMEOUT]             , 300);
     conf_init_int      (&conf_data[CNF_DTIMEOUT]             , 1800);
     conf_init_int      (&conf_data[CNF_CTIMEOUT]             , 30);
-    conf_init_int      (&conf_data[CNF_TAPEBUFS]             , 20);
     conf_init_size     (&conf_data[CNF_DEVICE_OUTPUT_BUFFER_SIZE], 40*32768);
     conf_init_str   (&conf_data[CNF_PRINTER]              , "");
     conf_init_str   (&conf_data[CNF_MAILER]               , DEFAULT_MAILER);
@@ -4574,6 +4823,7 @@ init_defaults(
     conf_init_str   (&conf_data[CNF_AMRECOVER_CHANGER]    , "");
     conf_init_bool     (&conf_data[CNF_AMRECOVER_CHECK_LABEL], 1);
     conf_init_taperalgo(&conf_data[CNF_TAPERALGO]            , 0);
+    conf_init_int      (&conf_data[CNF_TAPER_PARALLEL_WRITE]     , 1);
     conf_init_int      (&conf_data[CNF_FLUSH_THRESHOLD_DUMPED]   , 0);
     conf_init_int      (&conf_data[CNF_FLUSH_THRESHOLD_SCHEDULED], 0);
     conf_init_int      (&conf_data[CNF_TAPERFLUSH]               , 0);
@@ -4620,6 +4870,7 @@ init_defaults(
 #endif
     conf_init_send_amreport (&conf_data[CNF_SEND_AMREPORT_ON], SEND_AMREPORT_ALL);
     conf_init_autolabel(&conf_data[CNF_AUTOLABEL]);
+    conf_init_recovery_limit(&conf_data[CNF_RECOVERY_LIMIT]);
 
     /* reset internal variables */
     config_clear_errors();
@@ -4796,7 +5047,7 @@ update_derived_values(
             getconf_seen(CNF_AUTOLABEL) > 0)  ||
            (getconf_seen(CNF_LABEL_NEW_TAPES) < 0 &&
             getconf_seen(CNF_AUTOLABEL) < 0)) {
-               conf_parserror(_("Can't specify both label_new_tapes and autolabel"));
+               conf_parserror(_("Can't specify both label-new-tapes and autolabel"));
        }
        if ((getconf_seen(CNF_LABEL_NEW_TAPES) != 0 &&
             getconf_seen(CNF_AUTOLABEL) == 0) ||
@@ -4989,6 +5240,28 @@ conf_init_encrypt(
     val_t__encrypt(val) = (int)i;
 }
 
+static void
+conf_init_part_cache_type(
+    val_t *val,
+    part_cache_type_t    i)
+{
+    val->seen.linenum = 0;
+    val->seen.filename = NULL;
+    val->type = CONFTYPE_PART_CACHE_TYPE;
+    val_t__part_cache_type(val) = (int)i;
+}
+
+static void
+conf_init_recovery_limit(
+    val_t *val)
+{
+    val->seen.linenum = 0;
+    val->seen.filename = NULL;
+    val->type = CONFTYPE_RECOVERY_LIMIT;
+    val_t__recovery_limit(val).match_pats = NULL;
+    val_t__recovery_limit(val).same_host = FALSE;
+}
+
 static void
 conf_init_data_path(
     val_t *val,
@@ -4997,7 +5270,7 @@ conf_init_data_path(
     val->seen.linenum = 0;
     val->seen.filename = NULL;
     val->type = CONFTYPE_DATA_PATH;
-    val_t__encrypt(val) = (int)i;
+    val_t__data_path(val) = (int)i;
 }
 
 static void
@@ -5122,7 +5395,8 @@ conf_init_proplist(
     val->seen.filename = NULL;
     val->type = CONFTYPE_PROPLIST;
     val_t__proplist(val) =
-        g_hash_table_new_full(g_str_hash, g_str_equal, &g_free, &free_property_t);
+        g_hash_table_new_full(g_str_amanda_hash, g_str_amanda_equal,
+                             &g_free, &free_property_t);
 }
 
 static void
@@ -5825,6 +6099,30 @@ val_t_to_encrypt(
     return val_t__encrypt(val);
 }
 
+part_cache_type_t
+val_t_to_part_cache_type(
+    val_t *val)
+{
+    assert(config_initialized);
+    if (val->type != CONFTYPE_PART_CACHE_TYPE) {
+       error(_("val_t_to_part_cache_type: val.type is not CONFTYPE_PART_CACHE_TYPE"));
+       /*NOTREACHED*/
+    }
+    return val_t__part_cache_type(val);
+}
+
+recovery_limit_t *
+val_t_to_recovery_limit(
+    val_t *val)
+{
+    assert(config_initialized);
+    if (val->type != CONFTYPE_RECOVERY_LIMIT) {
+       error(_("val_t_to_recovery_limit: val.type is not CONFTYPE_RECOVERY_LIMIT"));
+       /*NOTREACHED*/
+    }
+    return &val_t__recovery_limit(val);
+}
+
 dump_holdingdisk_t
 val_t_to_holding(
     val_t *val)
@@ -5978,8 +6276,8 @@ merge_val_t(
     if (valsrc->type == CONFTYPE_PROPLIST) {
        if (valsrc->v.proplist) {
            if (valdst->v.proplist == NULL) {
-               valdst->v.proplist = g_hash_table_new_full(g_str_hash,
-                                                          g_str_equal,
+               valdst->v.proplist = g_hash_table_new_full(g_str_amanda_hash,
+                                                          g_str_amanda_equal,
                                                           &g_free,
                                                           &free_property_t);
                g_hash_table_foreach(valsrc->v.proplist,
@@ -6028,6 +6326,7 @@ copy_val_t(
        case CONFTYPE_STRATEGY:
        case CONFTYPE_TAPERALGO:
        case CONFTYPE_PRIORITY:
+       case CONFTYPE_PART_CACHE_TYPE:
            valdst->v.i = valsrc->v.i;
            break;
 
@@ -6061,6 +6360,15 @@ copy_val_t(
            }
            break;
 
+       case CONFTYPE_RECOVERY_LIMIT:
+           valdst->v.recovery_limit = valsrc->v.recovery_limit;
+           valdst->v.recovery_limit.match_pats = NULL;
+           for (ia = valsrc->v.recovery_limit.match_pats; ia != NULL; ia = ia->next) {
+               valdst->v.recovery_limit.match_pats =
+                   g_slist_append(valdst->v.recovery_limit.match_pats, g_strdup(ia->data));
+           }
+           break;
+
        case CONFTYPE_TIME:
            valdst->v.t = valsrc->v.t;
            break;
@@ -6089,8 +6397,8 @@ copy_val_t(
 
         case CONFTYPE_PROPLIST:
            if (valsrc->v.proplist) {
-               valdst->v.proplist = g_hash_table_new_full(g_str_hash,
-                                                          g_str_equal,
+               valdst->v.proplist = g_hash_table_new_full(g_str_amanda_hash,
+                                                          g_str_amanda_equal,
                                                           &g_free,
                                                           &free_property_t);
 
@@ -6190,6 +6498,7 @@ free_val_t(
        case CONFTYPE_REAL:
        case CONFTYPE_RATE:
        case CONFTYPE_INTRANGE:
+       case CONFTYPE_PART_CACHE_TYPE:
            break;
 
        case CONFTYPE_IDENT:
@@ -6202,6 +6511,10 @@ free_val_t(
            g_slist_free_full(val->v.identlist);
            break;
 
+       case CONFTYPE_RECOVERY_LIMIT:
+           g_slist_free_full(val->v.recovery_limit.match_pats);
+           break;
+
        case CONFTYPE_TIME:
            break;
 
@@ -6784,6 +7097,38 @@ val_t_display_strs(
        }
        break;
 
+     case CONFTYPE_PART_CACHE_TYPE:
+       switch(val_t__part_cache_type(val)) {
+       case PART_CACHE_TYPE_NONE:
+           buf[0] = vstrallocf("NONE");
+           break;
+
+       case PART_CACHE_TYPE_DISK:
+           buf[0] = vstrallocf("DISK");
+           break;
+
+       case PART_CACHE_TYPE_MEMORY:
+           buf[0] = vstrallocf("MEMORY");
+           break;
+       }
+       break;
+
+     case CONFTYPE_RECOVERY_LIMIT: {
+       GSList *iter = val_t__recovery_limit(val).match_pats;
+
+       if(val_t__recovery_limit(val).same_host)
+           buf[0] = stralloc("SAME-HOST ");
+       else
+           buf[0] = stralloc("");
+
+       while (iter) {
+           strappend(buf[0], (char *)iter->data);
+           strappend(buf[0], " ");
+           iter = iter->next;
+       }
+       break;
+     }
+
      case CONFTYPE_HOLDING:
        switch(val_t__holding(val)) {
        case HOLD_NEVER:
@@ -7426,15 +7771,6 @@ char *get_config_filename(void)
     return config_filename;
 }
 
-void
-property_add_to_argv(
-    GPtrArray  *argv_ptr,
-    proplist_t proplist)
-{
-    g_hash_table_foreach(proplist, &proplist_add_to_argv, argv_ptr);
-    return;
-}
-
 char *
 anonymous_value(void)
 {
@@ -7462,7 +7798,7 @@ data_path_to_string(
        case DATA_PATH_AMANDA   : return "AMANDA";
        case DATA_PATH_DIRECTTCP: return "DIRECTTCP";
     }
-    error(_("data_path is not DATA_PATH_AMANDA or DATA_PATH_DIRECTTCP"));
+    error(_("datapath is not DATA_PATH_AMANDA or DATA_PATH_DIRECTTCP"));
     /* NOTREACHED */
 }
 
@@ -7474,7 +7810,7 @@ data_path_from_string(
        return DATA_PATH_AMANDA;
     if (strcmp(data, "DIRECTTCP") == 0)
        return DATA_PATH_DIRECTTCP;
-    error(_("data_path is not AMANDA or DIRECTTCP :%s:"), data);
+    error(_("datapath is not AMANDA or DIRECTTCP :%s:"), data);
     /* NOTREACHED */
 }
 
index 5e9ccbb663b1195e3d3bb100dc48e4083246cd4d..cedc4a7fcd8bb8cbe0ee3058fc21db317c68a466 100644 (file)
@@ -148,7 +148,9 @@ typedef enum {
     ALGO_LARGEST,
     ALGO_LARGESTFIT,
     ALGO_SMALLEST,
+    ALGO_SMALLESTFIT,  /* for internal use */
     ALGO_LAST,
+    ALGO_LASTFIT,      /* for internal use */
     ALGO_ALGO /* sentinel */
 } taperalgo_t;
 
@@ -202,6 +204,19 @@ typedef GHashTable* proplist_t;
 /* A GSlist where each element is a 'char*' */
 typedef GSList* identlist_t;
 
+/* part_cache_types */
+typedef enum {
+    PART_CACHE_TYPE_NONE,
+    PART_CACHE_TYPE_MEMORY,
+    PART_CACHE_TYPE_DISK,
+} part_cache_type_t;
+
+/* recovery_limit */
+typedef struct {
+    gboolean same_host;
+    GSList *match_pats;
+} recovery_limit_t;
+
 /* Names for the type of value in a val_t.  Mostly for internal use, but useful
  * for wrapping val_t's, too. */
 typedef enum {
@@ -231,6 +246,8 @@ typedef enum {
     CONFTYPE_IDENTLIST,
     CONFTYPE_DATA_PATH,
     CONFTYPE_AUTOLABEL,
+    CONFTYPE_PART_CACHE_TYPE,
+    CONFTYPE_RECOVERY_LIMIT,
 } conftype_t;
 
 /* A "seen" struct.  Rather than allocate strings all over the place, this
@@ -259,6 +276,7 @@ typedef struct val_s {
        estimatelist_t  estimatelist;
        identlist_t     identlist;
         autolabel_t     autolabel;
+       recovery_limit_t recovery_limit;
     } v;
     seen_t seen;
     conftype_t type;
@@ -293,6 +311,8 @@ execute_where_t       val_t_to_execute_where(val_t *);
 send_amreport_t       val_t_to_send_amreport(val_t *);
 data_path_t           val_t_to_data_path(val_t *);
 autolabel_t           val_t_to_autolabel(val_t *);
+part_cache_type_t     val_t_to_part_cache_type(val_t *);
+recovery_limit_t     *val_t_to_recovery_limit(val_t *);
 
 /* Has the given val_t been seen in a configuration file or config overwrite?
  *
@@ -342,6 +362,9 @@ autolabel_t           val_t_to_autolabel(val_t *);
 #define val_t__execute_where(val) ((val)->v.i)
 #define val_t__data_path(val)     ((val)->v.i)
 #define val_t__autolabel(val)     ((val)->v.autolabel)
+#define val_t__part_cache_type(val) ((val)->v.i)
+#define val_t__recovery_limit(val) ((val)->v.recovery_limit)
+
 /*
  * Parameters
  *
@@ -401,7 +424,6 @@ typedef enum {
     CNF_ETIMEOUT,
     CNF_DTIMEOUT,
     CNF_CTIMEOUT,
-    CNF_TAPEBUFS,
     CNF_DEVICE_OUTPUT_BUFFER_SIZE,
     CNF_PRINTER,
     CNF_MAILER,
@@ -448,6 +470,8 @@ typedef enum {
     CNF_HOLDINGDISK,
     CNF_AUTOLABEL,
     CNF_DEBUG_DAYS,
+    CNF_TAPER_PARALLEL_WRITE,
+    CNF_RECOVERY_LIMIT,
     CNF_CNF /* sentinel */
 } confparm_key;
 
@@ -497,6 +521,8 @@ val_t *getconf(confparm_key key);
 #define getconf_proplist(key)     (val_t_to_proplist(getconf((key))))
 #define getconf_send_amreport(key) (val_t_to_send_amreport(getconf((key))))
 #define getconf_autolabel(key)    (val_t_to_autolabel(getconf((key))))
+#define getconf_part_cache_type(key) (val_t_to_part_cache_type(getconf((key))))
+#define getconf_recovery_limit(key) (val_t_to_recovery_limit(getconf((key))))
 
 /* Get a list of names for subsections of the given type
  *
@@ -560,7 +586,10 @@ typedef enum {
     TAPETYPE_LENGTH,
     TAPETYPE_FILEMARK,
     TAPETYPE_SPEED,
-    TAPETYPE_FILE_PAD,
+    TAPETYPE_PART_SIZE,
+    TAPETYPE_PART_CACHE_TYPE,
+    TAPETYPE_PART_CACHE_DIR,
+    TAPETYPE_PART_CACHE_MAX_SIZE,
     TAPETYPE_TAPETYPE /* sentinel */
 } tapetype_key;
 
@@ -604,14 +633,17 @@ char *tapetype_name(tapetype_t *ttyp);
  * @param ttyp: the tapetype to examine
  * @returns: various
  */
-#define tapetype_get_comment(ttyp)         (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_COMMENT)))
-#define tapetype_get_lbl_templ(ttyp)       (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_LBL_TEMPL)))
-#define tapetype_get_blocksize(ttyp)       (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_BLOCKSIZE)))
-#define tapetype_get_readblocksize(ttyp)   (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_READBLOCKSIZE)))
-#define tapetype_get_length(ttyp)          (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_LENGTH)))
-#define tapetype_get_filemark(ttyp)        (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_FILEMARK)))
-#define tapetype_get_speed(ttyp)           (val_t_to_int(tapetype_getconf((ttyp), TAPETYPE_SPEED)))
-#define tapetype_get_file_pad(ttyp)        (val_t_to_boolean(tapetype_getconf((ttyp), TAPETYPE_FILE_PAD)))
+#define tapetype_get_comment(ttyp)             (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_COMMENT)))
+#define tapetype_get_lbl_templ(ttyp)           (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_LBL_TEMPL)))
+#define tapetype_get_blocksize(ttyp)           (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_BLOCKSIZE)))
+#define tapetype_get_readblocksize(ttyp)       (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_READBLOCKSIZE)))
+#define tapetype_get_length(ttyp)              (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_LENGTH)))
+#define tapetype_get_filemark(ttyp)            (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_FILEMARK)))
+#define tapetype_get_speed(ttyp)               (val_t_to_int(tapetype_getconf((ttyp), TAPETYPE_SPEED)))
+#define tapetype_get_part_size(ttyp)           (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_PART_SIZE)))
+#define tapetype_get_part_cache_type(ttyp)     (val_t_to_part_cache_type(tapetype_getconf((ttyp), TAPETYPE_PART_CACHE_TYPE)))
+#define tapetype_get_part_cache_dir(ttyp)      (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_PART_CACHE_DIR)))
+#define tapetype_get_part_cache_max_size(ttyp) (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_PART_CACHE_MAX_SIZE)))
 
 /*
  * Dumptype parameter access
@@ -663,6 +695,8 @@ typedef enum {
     DUMPTYPE_PROPERTY,
     DUMPTYPE_CLIENT_PORT,
     DUMPTYPE_DATA_PATH,
+    DUMPTYPE_ALLOW_SPLIT,
+    DUMPTYPE_RECOVERY_LIMIT,
     DUMPTYPE_DUMPTYPE /* sentinel */
 } dumptype_key;
 
@@ -751,6 +785,8 @@ char *dumptype_name(dumptype_t *dtyp);
 #define dumptype_get_property(dtyp)            (val_t_to_proplist(dumptype_getconf((dtyp), DUMPTYPE_PROPERTY)))
 #define dumptype_get_client_port(dtyp)             (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLIENT_PORT)))
 #define dumptype_get_data_path(dtyp)             (val_t_to_data_path(dumptype_getconf((dtyp), DUMPTYPE_DATA_PATH)))
+#define dumptype_get_allow_split(dtyp)         (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_ALLOW_SPLIT)))
+#define dumptype_get_recovery_limit(dtyp)      (val_t_to_recovery_limit(dumptype_getconf((dtyp), DUMPTYPE_RECOVERY_LIMIT)))
 
 /*
  * Interface parameter access
@@ -1097,11 +1133,11 @@ char *changer_config_name(changer_config_t *devconf);
  * @returns: various
  */
 
-#define changer_config_get_comment(devconf)   (val_t_to_str(changer_config_getconf((devconf), DEVICE_CONFIG_COMMENT)))
-#define changer_config_get_tapedev(devconf)   (val_t_to_str(changer_config_getconf((devconf), DEVICE_CONFIG_TAPEDEV)))
-#define changer_config_get_tpchanger(devconf)   (val_t_to_str(changer_config_getconf((devconf), DEVICE_CONFIG_TPCHANGER)))
-#define changer_config_get_changerdev(devconf)   (val_t_to_str(changer_config_getconf((devconf), DEVICE_CONFIG_CHANGERDEV)))
-#define changer_config_get_changerfile(devconf)   (val_t_to_str(changer_config_getconf((devconf), DEVICE_CONFIG_CHANGERFILE)))
+#define changer_config_get_comment(devconf)   (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_COMMENT)))
+#define changer_config_get_tapedev(devconf)   (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_TAPEDEV)))
+#define changer_config_get_tpchanger(devconf)   (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_TPCHANGER)))
+#define changer_config_get_changerdev(devconf)   (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_CHANGERDEV)))
+#define changer_config_get_changerfile(devconf)   (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_CHANGERFILE)))
 
 changer_config_t *read_changer_config(char *name, FILE *from, char *fname, int *linenum);
 changer_config_t *lookup_changer_config(char *identifier);
@@ -1388,13 +1424,6 @@ gint64 find_multiplier(char * casestr);
  */
 int string_to_boolean(const char *str);
 
-/* Add all properties to an ARGV
- *
- * @param argvchild: Pointer to the ARGV.
- * @param proplist: The property list
- */
-void property_add_to_argv(GPtrArray *argv_ptr, proplist_t proplist);
-
 /* Return a pointer to a static string for the data_path */
 char *data_path_to_string(data_path_t data_path);
 
index 775d97d74f07080b36cea561ce83cea58a4c7e25..97e7c29552c7e0c7a27bf15aee958020d82b0638 100644 (file)
@@ -180,6 +180,8 @@ event_register(
 
            /* But it doesn't give us the source directly.. */
            handle->source = g_main_context_find_source_by_id(NULL, handle->source_id);
+           /* EV_TIME must always be handled after EV_READ */
+           g_source_set_priority(handle->source, 10);
            break;
 
        case EV_WAIT:
index f2b26649ec28462450e895119793a355c806616e..c917e2a3ac0f42a6dd6eeb02f5ad95e3ea3684ab 100644 (file)
@@ -70,6 +70,10 @@ rt_partnum(dumpfile_t *hdr)
        hdr->partnum = 2;
        hdr->totalparts = -1;
        if (!PREV_RT(hdr)) return 0;
+    } else if (hdr->type == F_DUMPFILE) {
+       hdr->partnum = 1;
+       hdr->totalparts = 1;
+       if (!PREV_RT(hdr)) return 0;
     } else {
        hdr->partnum = 0;
        hdr->totalparts = 0;
index 60c8c16940bcf4407f399edbf213f4f1a51e1c06..32bce0d014412ab9642759390ffe3106b3faafbc 100644 (file)
@@ -37,7 +37,6 @@ static const char *   filetype2str(filetype_t);
 static filetype_t      str2filetype(const char *);
 static void            strange_header(dumpfile_t *, const char *,
                                size_t, const char *, const char *);
-static ssize_t                 hexdump(const char *buffer, size_t len);
 static char            *quote_heredoc(char *text, char *delimiter_prefix);
 static char            *parse_heredoc(char *line, char **saveptr);
 
@@ -63,11 +62,8 @@ strange_header(
     if (expected == NULL)
        expected = "<null>";
 
-    g_fprintf(stderr, _("%s: strange amanda header: \"%.*s\"\n"), get_pname(),
-               (int)buflen, buffer);
-
-    g_fprintf(stderr, _("%s: Expected: \"%s\"  Actual: \"%s\"\n"), get_pname(),
-               expected, actual);
+    g_debug("strange amanda header: \"%.*s\"", (int)buflen, buffer);
+    g_debug("Expected: \"%s\"  Actual: \"%s\"", expected, actual);
 
     file->type = F_WEIRD;
 }
@@ -136,10 +132,7 @@ parse_file_header(
 
     tok = strtok_r(line1, " ", &saveptr);
     if (tok == NULL) {
-        g_fprintf(stderr, _("%s: Empty amanda header: buflen=%zu lsize=%zu\n"), get_pname(),
-           buflen, 
-           lsize);
-       hexdump(buffer, lsize);
+        g_debug("Empty amanda header: buflen=%zu lsize=%zu", buflen, lsize);
        strange_header(file, buffer, buflen, _("<Non-empty line>"), tok);
        goto out;
     }
@@ -234,6 +227,13 @@ parse_file_header(
                strange_header(file, buffer, buflen, _("<total parts param>"), tok);
                goto out;
            }
+       } else if (file->type == F_DUMPFILE) {
+           /* only one part in this dump, so call it partnum 1 */
+           file->partnum = 1;
+           file->totalparts = 1;
+       } else {
+           file->partnum = 0;
+           file->totalparts = 0;
        }
 
        tok = strtok_r(NULL, " ", &saveptr);
@@ -756,12 +756,10 @@ build_header(const dumpfile_t * file, size_t *size, size_t max_size)
         g_string_append_printf(rval, "\n");
         
        if (file->cont_filename[0] != '\0') {
-           validate_no_space(file->cont_filename, "cont_filename");
             g_string_append_printf(rval, "CONT_FILENAME=%s\n",
                                    file->cont_filename);
        }
        if (file->application[0] != '\0') {
-           validate_no_space(file->application, "application");
             g_string_append_printf(rval, "APPLICATION=%s\n", file->application);
        }
        if (file->is_partial != 0) {
@@ -1051,25 +1049,6 @@ void dumpfile_free(dumpfile_t* info) {
     amfree(info);
 }
 
-static ssize_t
-hexdump(
-    const char *buffer,
-    size_t     len)
-{
-    ssize_t rc = -1;
-
-    FILE *stream = popen("od -c -x -", "w");
-       
-    if (stream != NULL) {
-       fflush(stdout);
-       rc = (ssize_t)fwrite(buffer, len, 1, stream);
-       if (ferror(stream))
-           rc = -1;
-       pclose(stream);
-    }
-    return rc;
-}
-
 static char *quote_heredoc(
     char  *text,
     char  *delimiter_prefix)
index 6320a1dea9e49549dcdb2850bae982e44b861f34..7ba6702259e4040867a5ff661d83c008610f3333 100644 (file)
@@ -130,6 +130,10 @@ void g_slist_free_full(GSList * list) {
     g_slist_free(list);
 }
 
+void g_slist_free_full_gpointer(gpointer list) {
+    g_slist_free_full((GSList *)list);
+}
+
 void g_queue_free_full(GQueue * queue) {
     while (!g_queue_is_empty(queue)) {
         gpointer data;
@@ -497,25 +501,36 @@ g_ptr_array_foreach (GPtrArray *array,
 #endif
 
 guint
-g_str_case_hash(
+g_str_amanda_hash(
        gconstpointer key)
 {
     /* modified version of glib's hash function, copyright
      * GLib Team and others 1997-2000. */
-    const char *p = key;
-    guint h = g_ascii_toupper(*p);
+    const char *p;
+    guint h = 0;
 
-    if (h)
-       for (p += 1; *p != '\0'; p++)
-           h = (h << 5) - h + g_ascii_toupper(*p);
+    for (p = key; *p != '\0'; p++)
+        h = (h << 5) - h + (('_' == *p) ? '-' : g_ascii_tolower(*p));
 
     return h;
 }
 
 gboolean
-g_str_case_equal(
+g_str_amanda_equal(
        gconstpointer v1,
        gconstpointer v2)
 {
-    return (0 == g_ascii_strcasecmp((char *)v1, (char *)v2));
+    const gchar *p1 = v1, *p2 = v2;
+    while (*p1) {
+        /* letting '-' == '_' */
+        if (!('-' == *p1 || '_' == *p1) || !('-' == *p2 || '_' == *p2))
+            if (g_ascii_tolower(*p1) != g_ascii_tolower(*p2))
+                return FALSE;
+
+        p1++;
+        p2++;
+    }
+
+    /* p1 is at '\0' is p2 too? */
+    return *p2? FALSE : TRUE;
 }
index 39341a9ed6a2d994abcc7d3711257ffc9cf21bb0..01f1331333dcb09157cc0b2c60d560af8cb2cb95 100644 (file)
@@ -66,6 +66,7 @@ GValue* g_value_unset_copy(const GValue* from, GValue * to);
  * pointers in the container before free()ing the container itself. */
 void g_list_free_full(GList * list);
 void g_slist_free_full(GSList * list);
+void g_slist_free_full_gpointer(gpointer list);
 void g_queue_free_full(GQueue * queue);
 void g_ptr_array_free_full(GPtrArray * array);
 
@@ -121,7 +122,7 @@ void g_ptr_array_foreach (GPtrArray *array,
 #endif
 
 /* functions for g_hash_table_new to hash and compare case-insensitive strings */
-guint g_str_case_hash(gconstpointer v);
-gboolean g_str_case_equal(gconstpointer v1, gconstpointer v2);
+guint g_str_amanda_hash(gconstpointer v);
+gboolean g_str_amanda_equal(gconstpointer v1, gconstpointer v2);
 
 #endif
index 8a11ad675ad0afc8821ac02a432b01eae4e052b7..c3075fa9bc2456d0aafd8afec557e4138f42d337 100644 (file)
@@ -166,6 +166,9 @@ static int k5_encrypt(void *cookie, void *buf, ssize_t buflen,
 static int k5_decrypt(void *cookie, void *buf, ssize_t buflen,
                      void **encbuf, ssize_t *encbuflen);
 
+static ssize_t krb5_tcpm_recv_token(struct tcp_conn *rc, int fd, int *handle,
+                                   char **errmsg, char **buf, ssize_t *size,
+                                   int timeout);
 /*
  * This is our interface to the outside world.
  */
@@ -173,6 +176,7 @@ const security_driver_t krb5_security_driver = {
     "KRB5",
     krb5_connect,
     krb5_accept,
+    sec_get_authenticated_peer_name_hostname,
     sec_close,
     stream_sendpkt,
     stream_recvpkt,
@@ -516,7 +520,8 @@ gss_client(
        if (maj_stat != (OM_uint32)GSS_S_CONTINUE_NEEDED)
            break;
 
-        rvalue = tcpm_recv_token(rc, rc->read, &rc->handle, &rc->errmsg,
+        rvalue = krb5_tcpm_recv_token(rc, rc->read, &rc->handle,
+                                &rc->errmsg,
                                 (void *)&recv_tok.value,
                                 (ssize_t *)&recv_tok.length, 60);
        if (rvalue <= 0) {
@@ -604,7 +609,8 @@ gss_server(
 
     for (recv_tok.length = 0;;) {
        recv_tok.value = NULL;
-        rvalue = tcpm_recv_token(rc, rc->read, &rc->handle, &rc->errmsg,
+        rvalue = krb5_tcpm_recv_token(rc, rc->read, &rc->handle,
+                                &rc->errmsg,
                                 /* (void *) is to avoid type-punning warning */
                                 (char **)(void *)&recv_tok.value,
                                 (ssize_t *)&recv_tok.length, 60);
@@ -1187,3 +1193,122 @@ common_exit:
     return(result);
 #endif /* AMANDA_PRINCIPAL */
 }
+
+/*
+ *  return -1 on error
+ *  return  0 on EOF:   *handle = H_EOF  && *size = 0    if socket closed
+ *  return  0 on EOF:   *handle = handle && *size = 0    if stream closed
+ *  return size     :   *handle = handle && *size = size for data read
+ */
+
+static ssize_t
+krb5_tcpm_recv_token(
+    struct tcp_conn    *rc,
+    int                fd,
+    int *      handle,
+    char **    errmsg,
+    char **    buf,
+    ssize_t *  size,
+    int                timeout)
+{
+    unsigned int netint[2];
+
+    assert(SIZEOF(netint) == 8);
+
+    switch (net_read(fd, &netint, SIZEOF(netint), timeout)) {
+    case -1:
+       if (errmsg)
+           *errmsg = newvstrallocf(*errmsg, _("recv error: %s"), strerror(errno));
+       auth_debug(1, _("krb5_tcpm_recv_token: A return(-1)\n"));
+       return (-1);
+    case 0:
+       *size = 0;
+       *handle = H_EOF;
+       *errmsg = newvstrallocf(*errmsg, _("SOCKET_EOF"));
+       auth_debug(1, _("krb5_tcpm_recv_token: A return(0)\n"));
+       return (0);
+    default:
+       break;
+    }
+
+    *size = (ssize_t)ntohl(netint[0]);
+    *handle = (int)ntohl(netint[1]);
+    /* amanda protocol packet can be above NETWORK_BLOCK_BYTES */
+    if (*size > 128*NETWORK_BLOCK_BYTES || *size < 0) {
+       if (isprint((int)(*size        ) & 0xFF) &&
+           isprint((int)(*size   >> 8 ) & 0xFF) &&
+           isprint((int)(*size   >> 16) & 0xFF) &&
+           isprint((int)(*size   >> 24) & 0xFF) &&
+           isprint((*handle      ) & 0xFF) &&
+           isprint((*handle >> 8 ) & 0xFF) &&
+           isprint((*handle >> 16) & 0xFF) &&
+           isprint((*handle >> 24) & 0xFF)) {
+           char s[101];
+           int i;
+           s[0] = ((int)(*size)  >> 24) & 0xFF;
+           s[1] = ((int)(*size)  >> 16) & 0xFF;
+           s[2] = ((int)(*size)  >>  8) & 0xFF;
+           s[3] = ((int)(*size)       ) & 0xFF;
+           s[4] = (*handle >> 24) & 0xFF;
+           s[5] = (*handle >> 16) & 0xFF;
+           s[6] = (*handle >> 8 ) & 0xFF;
+           s[7] = (*handle      ) & 0xFF;
+           i = 8; s[i] = ' ';
+           while(i<100 && isprint((int)s[i]) && s[i] != '\n') {
+               switch(net_read(fd, &s[i], 1, 0)) {
+               case -1: s[i] = '\0'; break;
+               case  0: s[i] = '\0'; break;
+               default:
+                        dbprintf(_("read: %c\n"), s[i]); i++; s[i]=' ';
+                        break;
+               }
+           }
+           s[i] = '\0';
+           *errmsg = newvstrallocf(*errmsg, _("krb5_tcpm_recv_token: invalid size: %s"), s);
+           dbprintf(_("krb5_tcpm_recv_token: invalid size %s\n"), s);
+       } else {
+           *errmsg = newvstrallocf(*errmsg, _("krb5_tcpm_recv_token: invalid size"));
+           dbprintf(_("krb5_tcpm_recv_token: invalid size %zd\n"), *size);
+       }
+       *size = -1;
+       return -1;
+    }
+    amfree(*buf);
+    *buf = alloc((size_t)*size);
+
+    if(*size == 0) {
+       auth_debug(1, _("krb5_tcpm_recv_token: read EOF from %d\n"), *handle);
+       *errmsg = newvstrallocf(*errmsg, _("EOF"));
+       return 0;
+    }
+    switch (net_read(fd, *buf, (size_t)*size, timeout)) {
+    case -1:
+       if (errmsg)
+           *errmsg = newvstrallocf(*errmsg, _("recv error: %s"), strerror(errno));
+       auth_debug(1, _("krb5_tcpm_recv_token: B return(-1)\n"));
+       return (-1);
+    case 0:
+       *size = 0;
+       *errmsg = newvstrallocf(*errmsg, _("SOCKET_EOF"));
+       auth_debug(1, _("krb5_tcpm_recv_token: B return(0)\n"));
+       return (0);
+    default:
+       break;
+    }
+
+    auth_debug(1, _("krb5_tcpm_recv_token: read %zd bytes from %d\n"), *size, *handle);
+
+    if (*size > 0 && rc->driver->data_decrypt != NULL) {
+       void *decbuf;
+       ssize_t decsize;
+       rc->driver->data_decrypt(rc, *buf, *size, &decbuf, &decsize);
+       if (*buf != (char *)decbuf) {
+           amfree(*buf);
+           *buf = (char *)decbuf;
+       }
+       *size = decsize;
+    }
+
+    return((*size));
+}
+
index 6a8b8a4da617eabf41e6299444afc4ec82349940..24016e7ed1efb7bc87780d0be09bcacdd866d357 100644 (file)
@@ -61,6 +61,7 @@ const security_driver_t local_security_driver = {
     "LOCAL",
     local_connect,
     sec_accept,
+    sec_get_authenticated_peer_name_localhost,
     sec_close,
     stream_sendpkt,
     stream_recvpkt,
@@ -110,7 +111,7 @@ local_connect(
 
     auth_debug(1, _("local: local_connect: %s\n"), hostname);
 
-    rh = alloc(SIZEOF(*rh));
+    rh = g_new0(struct sec_handle, 1);
     security_handleinit(&rh->sech, &local_security_driver);
     rh->hostname = NULL;
     rh->rs = NULL;
index 44c8d1e83011d6353cbf467905fa935e7d50dab7..63717385b68aef34bb19ec6b0931c6f9c5b3d325 100644 (file)
 #include "testutils.h"
 #include "match.h"
 
-/* NOTE: this is an incomplete set of tests for match.c */
-
 /*
  * Tests
  */
 
-/****
- * Test some host expressions
- */
 static int
-test_host_match(void)
+test_validate_regexp(void)
+{
+    gboolean ok = TRUE;
+    struct {
+       char *regexp;
+       gboolean should_validate;
+    } tests[] = {
+       { ".*", TRUE },
+       { "*", FALSE },
+       { "[abc", FALSE },
+       { "(abc", FALSE },
+       { "{1,}", FALSE },
+       { NULL, FALSE },
+    }, *t;
+
+    for (t = tests; t->regexp; t++) {
+       char *validated_err = validate_regexp(t->regexp);
+       if (!validated_err != !!t->should_validate) {
+           ok = FALSE;
+           if (t->should_validate) {
+               g_fprintf(stderr, "should have validated regular expr %s: %s\n",
+                       t->regexp, validated_err);
+           } else {
+               g_fprintf(stderr, "unexpectedly validated regular expr %s\n",
+                       t->regexp);
+           }
+       }
+    }
+
+    return ok;
+}
+
+static int
+test_match(void)
+{
+    gboolean ok = TRUE;
+    struct {
+       char *expr, *str;
+       gboolean should_match, should_match_no_newline;
+    } tests[] = {
+       /* literal, unanchored matching */
+       { "a", "a", TRUE, TRUE },
+       { "a", "A", FALSE, FALSE },
+       { "a", "ab", TRUE, TRUE },
+       { "a", "ba", TRUE, TRUE },
+       { "a", "bab", TRUE, TRUE },
+
+       /* dot */
+       { ".", "", FALSE, FALSE },
+       { ".", "a", TRUE, TRUE },
+       { "..", "a", FALSE, FALSE },
+       { "..", "bc", TRUE, TRUE },
+
+       /* brackets */
+       { "[abc]", "xbx", TRUE, TRUE },
+       { "[abc]", "xyz", FALSE, FALSE },
+       { "[^abc]", "cba", FALSE, FALSE },
+       { "[^abc]", "xyz", TRUE, TRUE },
+       { "[a-c]", "b", TRUE, TRUE },
+       { "[^a-c]", "-", TRUE, TRUE },
+       { "[1-9-]", "-", TRUE, TRUE },
+       { "[ab\\-cd]", "-", FALSE, FALSE }, /* NOTE! */
+
+       /* anchors */
+       { "^xy", "xyz", TRUE, TRUE },
+       { "^xy", "wxyz", FALSE, FALSE },
+       { "yz$", "xyz", TRUE, TRUE },
+       { "yz$", "yza", FALSE, FALSE },
+       { "^123$", "123", TRUE, TRUE },
+       { "^123$", "0123", FALSE, FALSE },
+       { "^123$", "1234", FALSE, FALSE },
+
+       /* capture groups */
+       { "([a-c])([x-y])", "pqaxyr", TRUE, TRUE },
+       { "([a-c])([x-y])", "paqrxy", FALSE, FALSE },
+       { "([a-c])/\\1", "a/b", FALSE, FALSE },
+       { "([a-c])/\\1", "c/c", TRUE, TRUE },
+
+       /* * */
+       { ">[0-9]*<", "><", TRUE, TRUE },
+       { ">[0-9]*<", ">3<", TRUE, TRUE },
+       { ">[0-9]*<", ">34<", TRUE, TRUE },
+       { ">[0-9]*<", ">345<", TRUE, TRUE },
+       { ">[0-9]*<", ">x<", FALSE, FALSE },
+
+       /* | */
+       { ":(abc|ABC);", ":abc;", TRUE, TRUE },
+       { ":(abc|ABC);", ":ABC;", TRUE, TRUE },
+       { ":(abc|ABC);", ":abcBC;", FALSE, FALSE },
+
+       /* + */
+       { ">[0-9]+<", "><", FALSE, FALSE },
+       { ">[0-9]+<", ">3<", TRUE, TRUE },
+       { ">[0-9]+<", ">34<", TRUE, TRUE },
+       { ">[0-9]+<", ">345<", TRUE, TRUE },
+       { ">[0-9]+<", ">x<", FALSE, FALSE },
+
+       /* { .. } */
+       { ">[0-9]{0,1}<", "><", TRUE, TRUE },
+       { ">[0-9]{0,1}<", ">9<", TRUE, TRUE },
+       { ">[0-9]{0,1}<", ">98<", FALSE, FALSE },
+       { ">[0-9]{2,3}<", "><", FALSE, FALSE },
+       { ">[0-9]{2,3}<", ">5<", FALSE, FALSE },
+       { ">[0-9]{2,3}<", ">55<", TRUE, TRUE },
+       { ">[0-9]{2,3}<", ">555<", TRUE, TRUE },
+       { ">[0-9]{2,3}<", ">5555<", FALSE, FALSE },
+
+       /* quoting metacharacters */
+       { "\\\\", "\\", TRUE, TRUE },
+       { "\\,", ",", TRUE, TRUE },
+       { "\\[", "[", TRUE, TRUE },
+       { "\\*", "*", TRUE, TRUE },
+       { "\\?", "?", TRUE, TRUE },
+       { "\\+", "+", TRUE, TRUE },
+       { "\\.", ".", TRUE, TRUE },
+       { "\\|", "|", TRUE, TRUE },
+       { "\\^", "^", TRUE, TRUE },
+       { "\\$", "$", TRUE, TRUE },
+
+       /* differences between match and match_no_newline */
+       { "x.y", "x\ny", FALSE, TRUE },
+       { "x[^yz]y", "x\ny", FALSE, TRUE },
+       { "^y", "x\ny", TRUE, FALSE },
+       { "x$", "x\ny", TRUE, FALSE },
+
+       { NULL, NULL, FALSE, FALSE },
+    }, *t;
+
+    for (t = tests; t->expr; t++) {
+       gboolean matched = match(t->expr, t->str);
+       if (!!matched != !!t->should_match) {
+           ok = FALSE;
+           if (t->should_match) {
+               g_fprintf(stderr, "%s should have matched regular expr %s\n",
+                       t->str, t->expr);
+           } else {
+               g_fprintf(stderr, "%s unexpectedly matched regular expr %s\n",
+                       t->str, t->expr);
+           }
+       }
+
+       matched = match_no_newline(t->expr, t->str);
+       if (!!matched != !!t->should_match_no_newline) {
+           ok = FALSE;
+           if (t->should_match) {
+               g_fprintf(stderr, "%s should have matched (no_newline) regular expr %s\n",
+                       t->str, t->expr);
+           } else {
+               g_fprintf(stderr, "%s unexpectedly matched (no_newline) regular expr %s\n",
+                       t->str, t->expr);
+           }
+       }
+    }
+
+    return ok;
+}
+
+static int
+test_validate_glob(void)
+{
+    gboolean ok = TRUE;
+    struct {
+       char *glob;
+       gboolean should_validate;
+    } tests[] = {
+       { "foo.*", TRUE },
+       { "*.txt", TRUE },
+       { "x[abc]y", TRUE },
+       { "x[!abc]y", TRUE },
+       { "[abc", FALSE },
+       { "[!abc", FALSE },
+       { "??*", TRUE },
+       { "**?", TRUE }, /* legal, but weird */
+       { "foo\\", FALSE }, /* un-escaped \ is illegal */
+       { "foo\\\\", TRUE }, /* but escaped is OK */
+       { "(){}+.^$|", TRUE }, /* funny characters OK */
+       { "/usr/bin/*", TRUE }, /* filename seps are OK */
+       { NULL, FALSE },
+    }, *t;
+
+    for (t = tests; t->glob; t++) {
+       char *validated_err = validate_glob(t->glob);
+       if (!validated_err != !!t->should_validate) {
+           ok = FALSE;
+           if (t->should_validate) {
+               g_fprintf(stderr, "should have validated glob %s: %s\n",
+                       t->glob, validated_err);
+           } else {
+               g_fprintf(stderr, "unexpectedly validated glob %s\n",
+                       t->glob);
+           }
+       }
+    }
+
+    return ok;
+}
+
+static int
+test_glob_to_regex(void)
+{
+    gboolean ok = TRUE;
+    struct { char *glob, *regex; } tests[] = {
+       { "abc", "^abc$" },
+       { "*.txt", "^[^/]*\\.txt$" },
+       { "?.txt", "^[^/]\\.txt$" },
+       { "?*.txt", "^[^/][^/]*\\.txt$" },
+       { "foo.[tT][xX][tT]", "^foo\\.[tT][xX][tT]$" },
+       { "foo.[tT][!yY][tT]", "^foo\\.[tT][^yY][tT]$" },
+       { "foo\\\\", "^foo\\\\$" },
+       { "(){}+.^$|", "^\\(\\)\\{\\}\\+\\.\\^\\$\\|$" },
+       { "/usr/bin/*", "^/usr/bin/[^/]*$" },
+       { NULL, NULL },
+    }, *t;
+
+    for (t = tests; t->glob; t++) {
+       char *regex = glob_to_regex(t->glob);
+       if (0 != strcmp(regex, t->regex)) {
+           ok = FALSE;
+           g_fprintf(stderr, "glob_to_regex(\"%s\") returned \"%s\"; expected \"%s\"\n",
+                   t->glob, regex, t->regex);
+       }
+    }
+
+    return ok;
+}
+
+static int
+test_match_glob(void)
+{
+    gboolean ok = TRUE;
+    struct {
+       char *expr, *str;
+       gboolean should_match;
+    } tests[] = {
+       /* literal, unanchored matching */
+       { "a", "a", TRUE },
+
+       { "abc", "abc", TRUE },
+       { "abc", "abcd", FALSE },
+       { "abc", "dabc", FALSE },
+       { "abc", "/usr/bin/abc", FALSE },
+
+       { "*.txt", "foo.txt", TRUE },
+       { "*.txt", ".txt", TRUE },
+       { "*.txt", "txt", FALSE },
+
+       { "?.txt", "X.txt", TRUE },
+       { "?.txt", ".txt", FALSE },
+       { "?.txt", "XY.txt", FALSE },
+
+       { "?*.txt", ".txt", FALSE },
+       { "?*.txt", "a.txt", TRUE },
+       { "?*.txt", "aa.txt", TRUE },
+       { "?*.txt", "aaa.txt", TRUE },
+
+       { "foo.[tT][xX][tT]", "foo.txt", TRUE },
+       { "foo.[tT][xX][tT]", "foo.TXt", TRUE },
+       { "foo.[tT][xX][tT]", "foo.TXT", TRUE },
+       { "foo.[tT][xX][tT]", "foo.TaT", FALSE },
+
+       { "foo.[tT][!yY][tT]", "foo.TXt", TRUE },
+       { "foo.[tT][!yY][tT]", "foo.TXT", TRUE },
+       { "foo.[tT][!yY][tT]", "foo.TyT", FALSE },
+
+       { "foo\\\\", "foo", FALSE },
+       { "foo\\\\", "foo\\", TRUE },
+       { "foo\\\\", "foo\\\\", FALSE },
+
+       { "(){}+.^$|", "(){}+.^$|", TRUE },
+
+       { "/usr/bin/*", "/usr/bin/tar", TRUE },
+       { "/usr/bin/*", "/usr/bin/local/tar", FALSE },
+       { "/usr/bin/*", "/usr/sbin/tar", FALSE },
+       { "/usr/bin/*", "/opt/usr/bin/tar", FALSE },
+
+       { "/usr?bin", "/usr/bin", FALSE },
+       { "/usr*bin", "/usr/bin", FALSE },
+
+       { NULL, NULL, FALSE },
+    }, *t;
+
+    for (t = tests; t->expr; t++) {
+       gboolean matched = match_glob(t->expr, t->str);
+       if (!!matched != !!t->should_match) {
+           ok = FALSE;
+           if (t->should_match) {
+               g_fprintf(stderr, "%s should have matched glob %s\n",
+                       t->str, t->expr);
+           } else {
+               g_fprintf(stderr, "%s unexpectedly matched glob %s\n",
+                       t->str, t->expr);
+           }
+       }
+    }
+
+    return ok;
+}
+
+static int
+test_match_tar(void)
+{
+    gboolean ok = TRUE;
+    struct {
+       char *expr, *str;
+       gboolean should_match;
+    } tests[] = {
+       /* literal, unanchored matching */
+       { "a", "a", TRUE },
+
+       { "abc", "abc", TRUE },
+       { "abc", "abcd", FALSE },
+       { "abc", "dabc", FALSE },
+       { "abc", "/usr/bin/abc", TRUE },
+
+       { "*.txt", "foo.txt", TRUE },
+       { "*.txt", ".txt", TRUE },
+       { "*.txt", "txt", FALSE },
+
+       { "?.txt", "X.txt", TRUE },
+       { "?.txt", ".txt", FALSE },
+       { "?.txt", "XY.txt", FALSE },
+
+       { "?*.txt", ".txt", FALSE },
+       { "?*.txt", "a.txt", TRUE },
+       { "?*.txt", "aa.txt", TRUE },
+       { "?*.txt", "aaa.txt", TRUE },
+
+       { "foo.[tT][xX][tT]", "foo.txt", TRUE },
+       { "foo.[tT][xX][tT]", "foo.TXt", TRUE },
+       { "foo.[tT][xX][tT]", "foo.TXT", TRUE },
+       { "foo.[tT][xX][tT]", "foo.TaT", FALSE },
+
+       { "foo.[tT][!yY][tT]", "foo.TXt", TRUE },
+       { "foo.[tT][!yY][tT]", "foo.TXT", TRUE },
+       { "foo.[tT][!yY][tT]", "foo.TyT", FALSE },
+
+       { "foo\\\\", "foo", FALSE },
+       { "foo\\\\", "foo\\", TRUE },
+       { "foo\\\\", "foo\\\\", FALSE },
+
+       { "(){}+.^$|", "(){}+.^$|", TRUE },
+
+       { "/usr/bin/*", "/usr/bin/tar", TRUE },
+       { "/usr/bin/*", "/usr/bin/local/tar", TRUE }, /* different from match_glob */
+       { "/usr/bin/*", "/usr/sbin/tar", FALSE },
+       { "/usr/bin/*", "/opt/usr/bin/tar", FALSE },
+
+       { "/usr?bin", "/usr/bin", FALSE },
+       { "/usr*bin", "/usr/bin", TRUE }, /* different from match_glob */
+
+       /* examples from the amgtar manpage */
+       { "./temp-files", "./temp-files", TRUE },
+       { "./temp-files", "./temp-files/foo", TRUE },
+       { "./temp-files", "./temp-files/foo/bar", TRUE },
+       { "./temp-files", "./temp-files.bak", FALSE },
+       { "./temp-files", "./backup/temp-files", FALSE },
+
+       { "./temp-files/", "./temp-files", FALSE },
+       { "./temp-files/", "./temp-files/", TRUE },
+       { "./temp-files/", "./temp-files/foo", FALSE },
+       { "./temp-files/", "./temp-files/foo/bar", FALSE },
+       { "./temp-files/", "./temp-files.bak", FALSE },
+
+       { "/temp-files/", "./temp-files", FALSE },
+       { "/temp-files/", "./temp-files/", FALSE },
+       { "/temp-files/", "./temp-files/foo", FALSE },
+       { "/temp-files/", "./temp-files/foo/bar", FALSE },
+       { "/temp-files/", "./temp-files.bak", FALSE },
+
+       { "./temp-files/*", "./temp-files", FALSE },
+       { "./temp-files/*", "./temp-files/", TRUE },
+       { "./temp-files/*", "./temp-files/foo", TRUE },
+       { "./temp-files/*", "./temp-files/foo/bar", TRUE },
+
+       { "temp-files", "./my/temp-files", TRUE },
+       { "temp-files", "./my/temp-files/bar", TRUE },
+       { "temp-files", "./temp-files", TRUE },
+       { "temp-files", "./her-temp-files", FALSE },
+       { "temp-files", "./her/old-temp-files", FALSE },
+       { "temp-files", "./her/old-temp-files/bar", FALSE },
+
+       { "generated-*", "./my/generated-xyz", TRUE },
+       { "generated-*", "./my/generated-xyz/bar", TRUE },
+       { "generated-*", "./generated-xyz", TRUE },
+       { "generated-*", "./her-generated-xyz", FALSE },
+       { "generated-*", "./her/old-generated-xyz", FALSE },
+       { "generated-*", "./her/old-generated-xyz/bar", FALSE },
+
+       { "*.iso", "./my/amanda.iso", TRUE },
+       { "*.iso", "./amanda.iso", TRUE },
+
+       { "proxy/local/cache", "./usr/proxy/local/cache", TRUE },
+       { "proxy/local/cache", "./proxy/local/cache", TRUE },
+       { "proxy/local/cache", "./proxy/local/cache/7a", TRUE },
+
+       { NULL, NULL, FALSE },
+    }, *t;
+
+    for (t = tests; t->expr; t++) {
+       gboolean matched = match_tar(t->expr, t->str);
+       if (!!matched != !!t->should_match) {
+           ok = FALSE;
+           if (t->should_match) {
+               g_fprintf(stderr, "%s should have matched tar %s\n",
+                       t->str, t->expr);
+           } else {
+               g_fprintf(stderr, "%s unexpectedly matched tar %s\n",
+                       t->str, t->expr);
+           }
+       }
+    }
+
+    return ok;
+}
+
+static int
+test_make_exact_host_expression(void)
 {
     gboolean ok = TRUE;
-    struct { char *expr, *str; gboolean should_match; } tests[] = {
-       /* examples from amanda(8) */
+    guint i, j;
+    const char *test_strs[] = {
+       "host",
+       "host.org",
+       "host.host.org",
+       /* note that these will inter-match: */
+       /*
+       ".host",
+       ".host.org",
+       ".host.host.org",
+       "host.",
+       "host.org.",
+       "host.host.org.",
+       */
+       "org",
+       "^host",
+       "host$",
+       "^host$",
+       "ho[s]t",
+       "ho[!s]t",
+       "ho\\st",
+       "ho/st",
+       "ho?t",
+       "h*t",
+       "h**t",
+    };
+
+    for (i = 0; i < G_N_ELEMENTS(test_strs); i++) {
+       for (j = 0; j < G_N_ELEMENTS(test_strs); j++) {
+           char *expr = make_exact_host_expression(test_strs[i]);
+           gboolean matched = match_host(expr, test_strs[j]);
+           if (!!matched != !!(i == j)) {
+               ok = FALSE;
+               if (matched) {
+                   g_fprintf(stderr, "expr %s for str %s unexpectedly matched %s\n",
+                           expr, test_strs[i], test_strs[j]);
+               } else {
+                   g_fprintf(stderr, "expr %s for str %s should have matched %s\n",
+                           expr, test_strs[i], test_strs[j]);
+               }
+           }
+       }
+    }
+
+    return ok;
+}
+
+static int
+test_match_host(void)
+{
+    gboolean ok = TRUE;
+    struct {
+       char *expr, *str;
+       gboolean should_match;
+    } tests[] = {
+       /* from the amanda(8) manpage */
        { "hosta", "hosta", TRUE },
        { "hosta", "foo.hosta.org", TRUE },
-       { "hosta", "hOsTA.domain.org", TRUE },
+       { "hosta", "hoSTA.dOMAIna.ORG", TRUE },
        { "hosta", "hostb", FALSE },
+       { "hOsta", "hosta", TRUE },
+       { "hOsta", "foo.hosta.org", TRUE },
+       { "hOsta", "hoSTA.dOMAIna.ORG", TRUE },
+       { "hOsta", "hostb", FALSE },
+
        { "host", "host", TRUE },
        { "host", "hosta", FALSE },
+
        { "host?", "hosta", TRUE },
+       { "host?", "hostb", TRUE },
        { "host?", "host", FALSE },
+       { "host?", "hostabc", FALSE },
+
+       { "ho*na", "hona", TRUE },
        { "ho*na", "hoina", TRUE },
+       { "ho*na", "hoina.org", TRUE },
+       { "ho*na", "ns.hoina.org", TRUE },
        { "ho*na", "ho.aina.org", FALSE },
+
+       { "ho**na", "hona", TRUE },
        { "ho**na", "hoina", TRUE },
+       { "ho**na", "hoina.org", TRUE },
+       { "ho**na", "ns.hoina.org", TRUE },
        { "ho**na", "ho.aina.org", TRUE },
+
        { "^hosta", "hosta", TRUE },
-       { "^hosta", "hosta.foo.org", TRUE },
-       { "^hosta", "foo.hosta.org", FALSE },
+       { "^hosta", "hosta.org", TRUE },
+       { "^hosta", "hostabc", FALSE },
+       { "^hosta", "www.hosta", FALSE },
+       { "^hosta", "www.hosta.org", FALSE },
+
+       { "/opt", "opt", FALSE },
 
        { ".hosta.", "hosta", TRUE },
        { ".hosta.", "foo.hosta", TRUE },
@@ -62,7 +548,12 @@ test_host_match(void)
        { "/hosta", "hosta.org", FALSE },
        { "/hosta", "foo.hosta.org", FALSE },
 
-       /* additional checks */
+       { ".opt.", "opt", TRUE },
+       { ".opt.", "www.opt", TRUE },
+       { ".opt.", "www.opt.com", TRUE },
+       { ".opt.", "opt.com", TRUE },
+
+       /* other examples */
        { "^hosta$", "hosta", TRUE },
        { "^hosta$", "foo.hosta", FALSE },
        { "^hosta$", "hosta.org", FALSE },
@@ -82,6 +573,18 @@ test_host_match(void)
        { "mo[!st]a", "moma", TRUE },
        { "mo[!st]a", "momma", FALSE },
 
+       { "host[acd]", "hosta", TRUE },
+       { "host[acd]", "hostb", FALSE },
+       { "host[acd]", "hostc", TRUE },
+       { "host[!acd]", "hosta", FALSE },
+       { "host[!acd]", "hostb", TRUE },
+       { "host[!acd]", "hostc", FALSE },
+
+       { "toast", "www.toast.com", TRUE },
+       { ".toast", "www.toast.com", TRUE },
+       { "toast.", "www.toast.com", TRUE },
+       { ".toast.", "www.toast.com", TRUE },
+
        { NULL, NULL, FALSE },
     }, *t;
 
@@ -102,47 +605,120 @@ test_host_match(void)
     return ok;
 }
 
-/****
- * Test some disk expressions
- */
 static int
-test_disk_match(void)
+test_make_exact_disk_expression(void)
+{
+    gboolean ok = TRUE;
+    guint i, j;
+    const char *test_strs[] = {
+       "/disk",
+       "/disk/disk",
+       "d[i]sk",
+       "d**k",
+       "d*k",
+       "d?sk",
+       "d.sk",
+       "d[!pqr]sk",
+       "^disk",
+       "disk$",
+       "^disk$",
+       /* these intermatch due to some special-casing */
+       /*
+       "//windows/share",
+       "\\\\windows\\share",
+       */
+    };
+
+    for (i = 0; i < G_N_ELEMENTS(test_strs); i++) {
+       for (j = 0; j < G_N_ELEMENTS(test_strs); j++) {
+           char *expr = make_exact_disk_expression(test_strs[i]);
+           gboolean matched = match_disk(expr, test_strs[j]);
+           if (!!matched != !!(i == j)) {
+               ok = FALSE;
+               if (matched) {
+                   g_fprintf(stderr, "expr %s for str %s unexpectedly matched %s\n",
+                           expr, test_strs[i], test_strs[j]);
+               } else {
+                   g_fprintf(stderr, "expr %s for str %s should have matched %s\n",
+                           expr, test_strs[i], test_strs[j]);
+               }
+           }
+       }
+    }
+
+    return ok;
+}
+
+static int
+test_match_disk(void)
 {
     gboolean ok = TRUE;
-    struct { char *expr, *str; gboolean should_match; } tests[] = {
-       /* examples from amanda(8) */
+    struct {
+       char *expr, *str;
+       gboolean should_match;
+    } tests[] = {
+       /* from the amanda(8) manpage */
        { "sda*", "/dev/sda1", TRUE },
-       { "sda*", "/dev/sda12", TRUE },
+       { "sda*", "/dev/sda2", TRUE },
+       { "sda*", "/dev/sdb2", FALSE },
+
        { "opt", "opt", TRUE },
        { "opt", "/opt", TRUE },
        { "opt", "/opt/foo", TRUE },
        { "opt", "opt/foo", TRUE },
+
+       { "/opt", "opt", TRUE },
+       { "/opt", "opt/", TRUE },
+       { "/opt", "/opt", TRUE },
+       { "/opt", "/opt/", TRUE },
+       { "/opt", "/local/opt/", TRUE },
+       { "/opt", "/opt/local/", TRUE },
+
+       { "opt/", "opt", TRUE },
+       { "opt/", "opt/", TRUE },
+       { "opt/", "/opt", TRUE },
+       { "opt/", "/opt/", TRUE },
+       { "opt/", "/local/opt/", TRUE },
+       { "opt/", "/opt/local/", TRUE },
+
        { "/", "/", TRUE },
-       { "/", "/opt", FALSE },
-       { "/", "/opt/var", FALSE },
-       { "/usr", "/", FALSE },
-       { "/usr", "/usr", TRUE },
-       { "/usr", "/usr/local", TRUE },
+       { "/", "/opt/local/", FALSE },
+
        { "/usr$", "/", FALSE },
        { "/usr$", "/usr", TRUE },
        { "/usr$", "/usr/local", FALSE },
-       { "share", "//windows1/share", TRUE },
-       { "share", "//windows2/share", TRUE },
+
        { "share", "\\\\windows1\\share", TRUE },
        { "share", "\\\\windows2\\share", TRUE },
-       { "share*", "//windows/share1", TRUE },
-       { "share*", "//windows/share2", TRUE },
+       { "share", "//windows1/share", TRUE },
+       { "share", "//windows2/share", TRUE },
+
        { "share*", "\\\\windows\\share1", TRUE },
        { "share*", "\\\\windows\\share2", TRUE },
+       { "share*", "//windows/share3", TRUE },
+       { "share*", "//windows/share4", TRUE },
+
        { "//windows/share", "//windows/share", TRUE },
        { "//windows/share", "\\\\windows\\share", TRUE },
-
-       /* and now things get murky */
        { "\\\\windows\\share", "//windows/share", FALSE },
        { "\\\\windows\\share", "\\\\windows\\share", FALSE },
        { "\\\\\\\\windows\\\\share", "//windows/share", FALSE },
        { "\\\\\\\\windows\\\\share", "\\\\windows\\share", TRUE },
 
+       /* other expressions */
+       { "^local", "/local", TRUE },
+       { "^local", "/local/vore", TRUE },
+       { "^local", "/usr/local", FALSE },
+
+       { "local/bin", "/local/bin", TRUE },
+       { "local/bin", "/opt/local/bin", TRUE },
+       { "local/bin", "/local/bin/git", TRUE },
+
+       { "//windows/share", "//windows/share/files", TRUE },
+       { "//windows/share", "\\\\windows\\share\\files", TRUE },
+       { "\\\\windows\\share", "//windows/share/files", FALSE },
+       { "\\\\windows\\share", "\\\\windows\\share\\files", FALSE },
+
        /* longer expressions */
        { "local/var", "/local/var", TRUE },
        { "local/var", "/opt/local/var", TRUE },
@@ -186,53 +762,83 @@ test_disk_match(void)
     return ok;
 }
 
-/****
- * Test make_exact_host_expression
- */
 static int
-test_make_exact_host_expression(void)
+test_match_datestamp(void)
 {
     gboolean ok = TRUE;
-    guint i, j;
-    const char *test_strs[] = {
-       "host",
-       "host.org",
-       "host.host.org",
-       /* note that these will inter-match: */
-       /*
-       ".host",
-       ".host.org",
-       ".host.host.org",
-       "host.",
-       "host.org.",
-       "host.host.org.",
-       */
-       "org",
-       "^host",
-       "host$",
-       "^host$",
-       "ho[s]t",
-       "ho[!s]t",
-       "ho\\st",
-       "ho/st",
-       "ho?t",
-       "h*t",
-       "h**t",
-    };
+    struct {
+       char *expr, *str;
+       gboolean should_match;
+    } tests[] = {
+       /* from the amanda(8) manpage */
+       { "20001212-14", "20001212", TRUE },
+       { "20001212-14", "20001212010203", TRUE },
+       { "20001212-14", "20001213", TRUE },
+       { "20001212-14", "20001213010203", TRUE },
+       { "20001212-14", "20001214", TRUE },
+       { "20001212-14", "20001215", FALSE },
 
-    for (i = 0; i < G_N_ELEMENTS(test_strs); i++) {
-       for (j = 0; j < G_N_ELEMENTS(test_strs); j++) {
-           char *expr = make_exact_host_expression(test_strs[i]);
-           gboolean matched = match_host(expr, test_strs[j]);
-           if (!!matched != !!(i == j)) {
-               ok = FALSE;
-               if (matched) {
-                   g_fprintf(stderr, "expr %s for str %s unexpectedly matched %s\n",
-                           expr, test_strs[i], test_strs[j]);
-               } else {
-                   g_fprintf(stderr, "expr %s for str %s should have matched %s\n",
-                           expr, test_strs[i], test_strs[j]);
-               }
+       { "20001212-4", "20001212", TRUE },
+       { "20001212-4", "20001212010203", TRUE },
+       { "20001212-4", "20001213", TRUE },
+       { "20001212-4", "20001213010203", TRUE },
+       { "20001212-4", "20001214", TRUE },
+       { "20001212-4", "20001215", FALSE },
+
+       { "20001212-214", "20001212", TRUE },
+       { "20001212-214", "20001212010203", TRUE },
+       { "20001212-214", "20001213", TRUE },
+       { "20001212-214", "20001213010203", TRUE },
+       { "20001212-214", "20001214", TRUE },
+       { "20001212-214", "20001215", FALSE },
+
+       { "20001212-24", "20001211", FALSE },
+       { "20001212-24", "20001214010203", TRUE },
+       { "20001212-24", "20001221010203", TRUE },
+       { "20001212-24", "20001224", TRUE },
+       { "20001212-24", "20001225", FALSE },
+
+       { "2000121", "20001209", FALSE },
+       { "2000121", "20001210", TRUE },
+       { "2000121", "20001210012345", TRUE },
+       { "2000121", "20001219", TRUE },
+       { "2000121", "20001219012345", TRUE },
+       { "2000121", "20001220", FALSE },
+
+       { "2", "19991231", FALSE },
+       { "2", "20000101", TRUE },
+       { "2", "20100419", TRUE },
+
+       { "^2", "19991231", FALSE },
+       { "^2", "20000101", TRUE },
+       { "^2", "20100419", TRUE },
+
+       { "2000-2010", "19991231235959", FALSE },
+       { "2000-2010", "20001010", TRUE },
+       { "2000-2010", "20101231", TRUE },
+       { "2000-2010", "20111010", FALSE },
+
+       { "200010$", "200010", TRUE }, /* but it's not a real datestamp */
+       { "200010$", "20001001", FALSE },
+       { "200010$", "20001001061500", FALSE },
+
+       { "20000615$", "20000615", TRUE },
+       { "20000615$", "20000615000000", FALSE },
+       { "20000615$", "20000615010306", FALSE },
+
+       { NULL, NULL, FALSE },
+    }, *t;
+
+    for (t = tests; t->expr; t++) {
+       gboolean matched = match_datestamp(t->expr, t->str);
+       if (!!matched != !!t->should_match) {
+           ok = FALSE;
+           if (t->should_match) {
+               g_fprintf(stderr, "%s should have matched datestamp expr %s\n",
+                       t->str, t->expr);
+           } else {
+               g_fprintf(stderr, "%s unexpectedly matched datestamp expr %s\n",
+                       t->str, t->expr);
            }
        }
     }
@@ -240,46 +846,80 @@ test_make_exact_host_expression(void)
     return ok;
 }
 
-/****
- * Test make_exact_disk_expression
- */
 static int
-test_make_exact_disk_expression(void)
+test_match_level(void)
 {
     gboolean ok = TRUE;
-    guint i, j;
-    const char *test_strs[] = {
-       "/disk",
-       "/disk/disk",
-       "d[i]sk",
-       "d**k",
-       "d*k",
-       "d?sk",
-       "d.sk",
-       "d[!pqr]sk",
-       "^disk",
-       "disk$",
-       "^disk$",
-       /* these intermatch due to some special-casing */
-       /*
-       "//windows/share",
-       "\\\\windows\\share",
-       */
-    };
+    struct {
+       char *expr, *str;
+       gboolean should_match;
+    } tests[] = {
+       /* exact matches, optionally ignoring "^" */
+       { "3$", "2", FALSE },
+       { "3$", "3", TRUE },
+       { "3$", "4", FALSE },
+       { "3$", "32", FALSE },
 
-    for (i = 0; i < G_N_ELEMENTS(test_strs); i++) {
-       for (j = 0; j < G_N_ELEMENTS(test_strs); j++) {
-           char *expr = make_exact_disk_expression(test_strs[i]);
-           gboolean matched = match_disk(expr, test_strs[j]);
-           if (!!matched != !!(i == j)) {
-               ok = FALSE;
-               if (matched) {
-                   g_fprintf(stderr, "expr %s for str %s unexpectedly matched %s\n",
-                           expr, test_strs[i], test_strs[j]);
-               } else {
-                   g_fprintf(stderr, "expr %s for str %s should have matched %s\n",
-                           expr, test_strs[i], test_strs[j]);
-               }
+       { "^3$", "2", FALSE },
+       { "^3$", "3", TRUE },
+       { "^3$", "4", FALSE },
+       { "^3$", "32", FALSE },
+
+       /* prefix matches */
+       { "3", "2", FALSE },
+       { "3", "3", TRUE },
+       { "3", "4", FALSE },
+       { "3", "32", TRUE },
+
+       /* ranges */
+       { "2-5", "1", FALSE },
+       { "2-5", "13", FALSE },
+       { "2-5", "23", FALSE },
+       { "2-5", "2", TRUE },
+       { "2-5", "4", TRUE },
+       { "2-5", "5", TRUE },
+       { "2-5", "53", FALSE },
+       { "2-5", "63", FALSE },
+       { "2-5", "6", FALSE },
+
+       { "9-15", "8", FALSE },
+       { "9-15", "19", FALSE },
+       { "9-15", "91", FALSE },
+       { "9-15", "9", TRUE },
+       { "9-15", "14", TRUE },
+       { "9-15", "15", TRUE },
+       { "9-15", "152", FALSE },
+       { "9-15", "16", FALSE },
+
+       { "19-21", "18", FALSE },
+       { "19-21", "19", TRUE },
+       { "19-21", "21", TRUE },
+       { "19-21", "22", FALSE },
+
+       /* single range is the same as an exact match */
+       { "99-99", "98", FALSE },
+       { "99-99", "99", TRUE },
+       { "99-99", "100", FALSE },
+
+       /* reversed range never matches */
+       { "21-19", "18", FALSE },
+       { "21-19", "19", FALSE },
+       { "21-19", "21", FALSE },
+       { "21-19", "22", FALSE },
+
+       { NULL, NULL, FALSE },
+    }, *t;
+
+    for (t = tests; t->expr; t++) {
+       gboolean matched = match_level(t->expr, t->str);
+       if (!!matched != !!t->should_match) {
+           ok = FALSE;
+           if (t->should_match) {
+               g_fprintf(stderr, "%s should have matched level expr %s\n",
+                       t->str, t->expr);
+           } else {
+               g_fprintf(stderr, "%s unexpectedly matched level expr %s\n",
+                       t->str, t->expr);
            }
        }
     }
@@ -287,6 +927,7 @@ test_make_exact_disk_expression(void)
     return ok;
 }
 
+
 /*
  * Main driver
  */
@@ -295,10 +936,18 @@ int
 main(int argc, char **argv)
 {
     static TestUtilsTest tests[] = {
-       TU_TEST(test_host_match, 90),
-       TU_TEST(test_disk_match, 90),
+       TU_TEST(test_validate_regexp, 90),
+       TU_TEST(test_match, 90),
+       TU_TEST(test_validate_glob, 90),
+       TU_TEST(test_glob_to_regex, 90),
+       TU_TEST(test_match_glob, 90),
+       TU_TEST(test_match_tar, 90),
        TU_TEST(test_make_exact_host_expression, 90),
+       TU_TEST(test_match_host, 90),
        TU_TEST(test_make_exact_disk_expression, 90),
+       TU_TEST(test_match_disk, 90),
+       TU_TEST(test_match_datestamp, 90),
+       TU_TEST(test_match_level, 90),
        TU_END()
     };
 
index acbc7a8d7ae247d04dd2edc34537d46dd66d0025..826a2867fafceb46bd2e9dbc2b65184e2350b21e 100644 (file)
@@ -280,6 +280,7 @@ glob_to_regex(
      *
      *  ?      -> [^/]
      *  *      -> [^/]*
+     *  [...] ->  [...]
      *  [!...] -> [^...]
      *
      * The following are given a leading backslash to protect them
@@ -381,13 +382,14 @@ tar_to_regex(
      * one expansion.
      */
     len = strlen(glob);
-    regex = alloc(1 + len * 5 + 1 + 1);
+    regex = alloc(1 + len * 5 + 5 + 5);
 
     /*
      * Do the conversion:
      *
      *  ?      -> [^/]
      *  *      -> .*
+     *  [...]  -> [...]
      *  [!...] -> [^...]
      *
      * The following are given a leading backslash to protect them
@@ -395,13 +397,19 @@ tar_to_regex(
      *
      *   ( ) { } + . ^ $ |
      *
-     * Put a leading ^ and trailing $ around the result.  If the last
-     * non-escaped character is \ leave the $ off to cause a syntax
+     * The expression must begin and end either at the beginning/end of the string or
+     * at at a pathname separator.
+     *
+     * If the last non-escaped character is \ leave the $ off to cause a syntax
      * error when the regex is compiled.
      */
 
     r = regex;
+    *r++ = '(';
     *r++ = '^';
+    *r++ = '|';
+    *r++ = '/';
+    *r++ = ')';
     last_ch = '\0';
     for (ch = *glob++; ch != '\0'; last_ch = ch, ch = *glob++) {
        if (last_ch == '\\') {
@@ -435,7 +443,11 @@ tar_to_regex(
        }
     }
     if (last_ch != '\\') {
+       *r++ = '(';
        *r++ = '$';
+       *r++ = '|';
+       *r++ = '/';
+       *r++ = ')';
     }
     *r = '\0';
 
@@ -782,9 +794,9 @@ match_level(
        mylevelexp[strlen(levelexp)] = '\0';
     }
 
-    if(mylevelexp[strlen(mylevelexp)] == '$') {
+    if(mylevelexp[strlen(mylevelexp)-1] == '$') {
        match_exact = 1;
-       mylevelexp[strlen(mylevelexp)] = '\0';
+       mylevelexp[strlen(mylevelexp)-1] = '\0';
     }
     else
        match_exact = 0;
index c5c284bf1bd427c64e973ef7ec04d020f4b9bf76..40b277cc5262989e38f3fa579457693fae0bb73a 100644 (file)
 
 #include <glib.h>
 
+/*
+ * Regular expressions
+ */
+
+/* The regular expressions used here are POSIX extended regular expressions;
+ * see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html
+ */
+
+/* validate that REGEX is a valid POSIX regular expression by calling regcomp.
+ * Returns a statically allocated error message on failure or NULL on success. */
 char * validate_regexp(const char *regex);
 
+/* Match STR against POSIX regular expression REGEX by calling regexec.  This uses
+ * the REG_NEWLINE flag, meaning that . does not match a newline and $ and ^ are
+ * relative to lines as well as the beginning and end of STR. */
+int    match(const char *regex, const char *str);
+
+/* Like match(), but without REG_NEWLINE, so a newline is treated like any other
+ * character */
+int    match_no_newline(const char *regex, const char *str);
+
 /* quote any non-alphanumeric characters in str, so that the result will only
  * match the original string.  If anchor is true, then add ^ and $ to make sure
- * that substrings will not match.  Note that the resulting regular expression
- * will not work with match_host, match_disk, etc., since those do not technically
- * support quoting metacharacters */
+ * that substrings will not match.  */
 char * clean_regex(const char *str, gboolean anchor);
 
-/* Make an Amanda host expression that will match the given string exactly. */
-char * make_exact_host_expression(const char *host);
-
-/* Make an Amanda disk expression that will match the given string exactly. */
-char * make_exact_disk_expression(const char *disk);
-
-int    match(const char *regex, const char *str);
+/*
+ * Globs
+ */
 
-int    match_no_newline(const char *regex, const char *str);
+/*
+ * A "glob expression" is similar to shell globs; it supports metacharacters
+ * "*" and "?", as well as character classes like "[...]" and "[!...]"
+ * (negated).  The "*" and "?" do not match filename separators ("/").  The
+ * entire expression is anchored, so it must match the string, not just a single
+ * filename component.
+ */
 
+/* Validate that GLOB is a legal GLOB expression.  Returns a statically
+ * allocated error message on failure, or NULL on success. */
 char * validate_glob(const char *glob);
 
+/* Convert a GLOB expression into a dynamically allocated regular expression */
 char * glob_to_regex(const char *glob);
 
+/* Like match(), but with a glob expression */
 int    match_glob(const char *glob, const char *str);
 
+/*
+ * Tar Patterns
+ */
+
+/* A "tar expression" is almost the same as a glob, except that "*" can match a
+ * filename separator ("?" cannot).  It is used by calcsize to emulate tar's exclude
+ * list patterns, which are actually significantly more complicated than this.
+ */
+
+/* Like match(), but with a tar expression */
 int    match_tar(const char *glob, const char *str);
 
+/*
+ * Host expressions
+ */
+
+/* Host expressions are described in amanda(8). */
+
+/* Make an Amanda host expression that will match the given string exactly.
+ * There is a little bit of fuzz here involving leading and trailing "."
+ * chararacters, (so "host.org", "host.org.", and ".host.org" will all match
+ * the same expressions) but DNS considers them equivalent, too. */
+char * make_exact_host_expression(const char *host);
+
+/* Like match(), but using a host expression */
 int    match_host(const char *glob, const char *host);
 
-int    match_datestamp(const char *dateexp, const char *datestamp);
+/*
+ * Disk expressions
+ */
 
-int    match_level(const char *levelexp, const char *level);
+/* Disk expressions are described in amanda(8) */
+
+/* Make an Amanda disk expression that will match the given string exactly. */
+char * make_exact_disk_expression(const char *disk);
 
+/* Like match(), but using a disk expression */
 int    match_disk(const char *glob, const char *disk);
 
+/*
+ * Datestamp expressions
+ */
+
+/* Datestamp expressions are described in amanda(8) */
+
+int    match_datestamp(const char *dateexp, const char *datestamp);
+
+/*
+ * Level expressions
+ */
+
+/* Level expressions are either prefix matches e.g., "1", which matches "1", "10", and "123",
+ * absolute matches e.g., "3$" which only matches "3", or a range e.g., "3-5" which only
+ * matches levels 3, 4, and 5. */
+
+/* Like match(), but using a level expression */
+int    match_level(const char *levelexp, const char *level);
+
 #endif /* MATCH_H */
 
diff --git a/common-src/queueing-test.c b/common-src/queueing-test.c
deleted file mode 100644 (file)
index d89a209..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- *
- * Author: Dustin J. Mitchell <dustin@zmanda.com>
- */
-
-#include "amanda.h"
-#include "testutils.h"
-#include "glib-util.h"
-#include "queueing.h"
-
-/****
- * Test a simple queue
- */
-
-struct test_queue_simple_data {
-    size_t bytes_to_produce;
-
-    /* The counters here are used to produce a slowly changing 
-     * bytesequence, which should not align with block or buffer
-     * boundaries. */
-    size_t bytes_produced;
-    guint32 producer_counter;
-
-    size_t bytes_consumed;
-    guint32 consumer_counter;
-};
-
-static producer_result_t
-test_queue_simple_producer(
-    gpointer data,
-    queue_buffer_t *buffer,
-    size_t hint_size)
-{
-    struct test_queue_simple_data *d = (struct test_queue_simple_data *)data;
-    size_t to_write = hint_size;
-    size_t i;
-
-    /* just for fun, write a little bit more sometimes */
-    to_write += d->producer_counter % 50;
-
-    /* but not too much */
-    if (to_write > d->bytes_to_produce - d->bytes_produced)
-       to_write = d->bytes_to_produce - d->bytes_produced;
-
-    /* make sure the buffer is big enough */
-    if (buffer->data == NULL) {
-       buffer->data = g_malloc(to_write);
-       buffer->alloc_size = to_write;
-    } else if (buffer->alloc_size < to_write) {
-       buffer->data = g_realloc(buffer->data, to_write);
-       buffer->alloc_size = to_write;
-    }
-    /* g_debug("Producing %zd bytes in %p (@%p)", to_write, buffer, buffer->data); */
-
-    /* fill in the data with some random junk */
-    for (i = 0; i < to_write; i++) {
-       buffer->data[i] = (char)(d->producer_counter / 7 + (d->producer_counter >> 10));
-       d->producer_counter++;
-    }
-
-    /* and call it a day */
-    buffer->offset = 0;
-    buffer->data_size = to_write;
-    d->bytes_produced += to_write;
-    return d->bytes_produced >= d->bytes_to_produce?
-        PRODUCER_FINISHED
-       : PRODUCER_MORE;
-}
-
-static ssize_t
-test_queue_simple_consumer(
-    gpointer data,
-    queue_buffer_t *buffer)
-{
-    struct test_queue_simple_data *d = (struct test_queue_simple_data *)data;
-    size_t to_read = buffer->data_size;
-    size_t i;
-
-    g_assert(buffer->data != NULL);
-    g_assert(buffer->data_size != 0);
-
-    /* let's not read it all, to make sure that we get called back with the
-     * remainder */
-    to_read = buffer->data_size;
-    if (to_read > 1000) to_read = 1000;
-
-    /* verify the contents of the buffer */
-    /* g_debug("Consuming %zd bytes starting at %d in %p (@%p)", to_read, buffer->offset, buffer, buffer->data); */
-    for (i = 0; i < to_read; i++) {
-       char expected = d->consumer_counter / 7 + (d->consumer_counter >> 10);
-       if (buffer->data[buffer->offset + i] != expected) {
-           tu_dbg("expected %d, but got %d at byte position %zd\n",
-               (int)expected, buffer->data[i], i);
-           return -1;
-       }
-       d->consumer_counter++;
-    }
-    d->bytes_consumed += to_read;
-
-    return to_read;
-}
-
-static int
-test_queue_simple(StreamingRequirement sr)
-{
-    queue_result_flags qr;
-    gboolean success = TRUE;
-
-    struct test_queue_simple_data d = {
-       10*1024*1024, /* bytes_to_produce */
-       0, /* bytes_produced */
-       0, /* producer_counter */
-       0, /* bytes_consumed */
-       0 /* consumer_counter */
-    };
-
-    qr = do_consumer_producer_queue_full(
-       test_queue_simple_producer, (gpointer)&d,
-       test_queue_simple_consumer, (gpointer)&d,
-       10230, /* almost 10k */
-       3*1024*1024, /* 3M */
-       sr);
-
-    if (qr != QUEUE_SUCCESS) {
-       tu_dbg("Expected result QUEUE_SUCCESS (%d); got %d\n",
-           QUEUE_SUCCESS, qr);
-       success = FALSE;
-    }
-
-    if (d.bytes_produced != d.bytes_to_produce) {
-       tu_dbg("Expected to produce %zd bytes; produced %zd\n",
-           d.bytes_to_produce, d.bytes_produced);
-       success = FALSE;
-    }
-
-    if (d.bytes_consumed != d.bytes_to_produce) {
-       tu_dbg("Expected to consume %zd bytes; consumed %zd\n",
-           d.bytes_to_produce, d.bytes_consumed);
-       success = FALSE;
-    }
-
-    return success;
-}
-
-static int
-test_queue_simple_STREAMING_REQUIREMENT_NONE(void)
-{
-    return test_queue_simple(STREAMING_REQUIREMENT_NONE);
-}
-
-static int
-test_queue_simple_STREAMING_REQUIREMENT_DESIRED(void)
-{
-    return test_queue_simple(STREAMING_REQUIREMENT_DESIRED);
-}
-
-static int
-test_queue_simple_STREAMING_REQUIREMENT_REQUIRED(void)
-{
-    return test_queue_simple(STREAMING_REQUIREMENT_REQUIRED);
-}
-
-/****
- * Test fd_reader and fd_writer
- */
-
-#define TEST_FD_CONSUMER_PRODUCER_BLOCKS (1024)
-
-static gpointer
-data_producer_thread(gpointer d)
-{
-    int fd = GPOINTER_TO_INT(d);
-    char buf[1024];
-    size_t i;
-    int block;
-
-    /* fill in the buffer with some stuff */
-    for (i = 0; i < (int)sizeof(buf); i++) {
-       buf[i] = (char)i;
-    }
-
-    /* and write it out in blocks */
-    for (block = 0; block < TEST_FD_CONSUMER_PRODUCER_BLOCKS; block++) {
-       size_t written = 0;
-       while (written < sizeof(buf)) {
-           int len = write(fd, buf + written, sizeof(buf) - written);
-           if (len < 0) {
-               perror("writing pipe to fd_read_producer");
-               close(fd);
-               return GINT_TO_POINTER(0);
-           }
-           written += len;
-       }
-    }
-
-    close(fd);
-    return GINT_TO_POINTER(1);
-}
-
-static gpointer
-data_consumer_thread(gpointer d)
-{
-    int fd = GPOINTER_TO_INT(d);
-    char buf[1024];
-    size_t i;
-    int block;
-
-    /* and read it in in blocks */
-    for (block = 0; block < TEST_FD_CONSUMER_PRODUCER_BLOCKS; block++) {
-       size_t bytes_read = 0;
-       while (bytes_read < sizeof(buf)) {
-           int len = read(fd, buf + bytes_read, sizeof(buf) - bytes_read);
-           if (len < 0) {
-               perror("reading pipe from fd_write_consumer");
-               return NULL;
-           }
-           bytes_read += len;
-       }
-
-       /* verify the block */
-       for (i = 0; i < (int)sizeof(buf); i++) {
-           if (buf[i] != (char)i) {
-               tu_dbg("result data does not match input; block %d byte %zd", block, i);
-               close(fd);
-               return GINT_TO_POINTER(0);
-           }
-       }
-    }
-
-    close(fd);
-    return GINT_TO_POINTER(1);
-}
-
-static int
-test_fd_consumer_producer(void)
-{
-    gboolean success;
-    GThread *rth, *wth;
-    int input_pipe[2];
-    int output_pipe[2];
-    queue_fd_t queue_read = {0, NULL};
-    queue_fd_t queue_write = {0, NULL};
-
-    /* create pipes and hook up threads to them */
-    if (pipe(input_pipe) < 0) {
-       perror("pipe(input_pipe)");
-       return FALSE;
-    }
-    if (pipe(output_pipe) < 0) {
-       perror("pipe(output_pipe)");
-       return FALSE;
-    }
-
-    wth = g_thread_create(data_producer_thread, GINT_TO_POINTER(input_pipe[1]), TRUE, NULL);
-    rth = g_thread_create(data_consumer_thread, GINT_TO_POINTER(output_pipe[0]), TRUE, NULL);
-
-    /* run the queue */
-    queue_read.fd = input_pipe[0];
-    queue_write.fd = output_pipe[1];
-    success = do_consumer_producer_queue(
-       fd_read_producer, &queue_read,
-       fd_write_consumer, &queue_write);
-    if (!success)
-       tu_dbg("do_consumer_producer_queue returned FALSE");
-
-    /* and examine the results */
-    success = GPOINTER_TO_INT(g_thread_join(wth)) && success;
-    success = GPOINTER_TO_INT(g_thread_join(rth)) && success;
-
-    /* close stuff up */
-    close(input_pipe[0]);
-    close(input_pipe[1]);
-    close(output_pipe[0]);
-    close(output_pipe[1]);
-
-    return success;
-}
-
-/*
- * Main driver
- */
-
-int
-main(int argc, char **argv)
-{
-    static TestUtilsTest tests[] = {
-       TU_TEST(test_queue_simple_STREAMING_REQUIREMENT_NONE, 90),
-       TU_TEST(test_queue_simple_STREAMING_REQUIREMENT_DESIRED, 90),
-       TU_TEST(test_queue_simple_STREAMING_REQUIREMENT_REQUIRED, 90),
-       TU_TEST(test_fd_consumer_producer, 120), /* runs slowly on old kernels */
-       TU_END()
-    };
-
-    glib_init();
-
-    return testutils_run_tests(argc, argv, tests);
-}
diff --git a/common-src/queueing.c b/common-src/queueing.c
deleted file mode 100644 (file)
index ac098a3..0000000
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-#include "queueing.h"
-#include "semaphore.h"
-#include "amanda.h"
-
-/* Queueing framework here. */
-typedef struct {
-    size_t block_size;
-    StreamingRequirement streaming_mode;
-
-    ProducerFunctor producer;
-    gpointer producer_user_data;
-
-    ConsumerFunctor consumer;
-    gpointer consumer_user_data;
-
-    GAsyncQueue *data_queue, *free_queue;
-    semaphore_t *free_memory;
-} queue_data_t;
-
-static queue_buffer_t *invent_buffer(void) {
-    queue_buffer_t *rval;
-    rval = g_new(queue_buffer_t, 1);
-
-    rval->data = NULL;
-    rval->alloc_size = 0;
-    rval->data_size = 0;
-    rval->offset = 0;
-
-    return rval;
-}
-
-void free_buffer(queue_buffer_t *buf) {
-    if (buf != NULL)
-        amfree(buf->data);
-    amfree(buf);
-}
-
-static queue_buffer_t * merge_buffers(queue_buffer_t *buf1,
-                                      queue_buffer_t *buf2) {
-    if (buf1 == NULL)
-        return buf2;
-    else if (buf2 == NULL)
-        return buf1;
-
-    if (buf2->offset >= buf1->data_size) {
-        /* We can fit buf1 at the beginning of buf2. */
-        memcpy(buf2->data + buf2->offset - buf1->data_size,
-               buf1->data + buf1->offset,
-               buf1->data_size);
-        buf2->offset -= buf1->data_size;
-        buf2->data_size += buf1->data_size;
-        free_buffer(buf1);
-        return buf2;
-    } else if (buf1->alloc_size - buf1->offset - buf1->data_size
-               >= buf2->data_size) {
-        /* We can fit buf2 at the end of buf1. */
-        memcpy(buf1->data + buf1->offset + buf1->data_size,
-               buf2->data + buf2->offset, buf2->data_size);
-        buf1->data_size += buf2->data_size;
-        free_buffer(buf2);
-        return buf1;
-    } else {
-        /* We can grow buf1 and put everything there. */
-        if (buf1->offset != 0) {
-            /* But first we have to fix up buf1. */
-            memmove(buf1->data, buf1->data + buf1->offset, buf1->data_size);
-            buf1->offset = 0;
-        }
-        buf1->alloc_size = buf1->data_size + buf2->data_size;
-        buf1->data = realloc(buf1->data, buf1->alloc_size);
-        memcpy(buf1->data + buf1->data_size, buf2->data + buf2->offset,
-               buf2->data_size);
-        buf1->data_size = buf1->alloc_size;
-        free_buffer(buf2);
-        return buf1;
-    }
-}
-
-/* Invalidate the first "bytes" bytes of the buffer, by adjusting the
-   offset and data size. */
-static void consume_buffer(queue_buffer_t* buf, ssize_t bytes) {
-    g_assert(bytes >= 0 && bytes <= (ssize_t)buf->data_size);
-    buf->offset += bytes;
-    buf->data_size -= bytes;
-}
-
-/* Looks at the buffer to see how much free space it has. If it has more than
- * twice the data size of unused space at the end, or more than four times
- * the data size of unused space at the beginning, then that space is
- * reclaimed. */
-static void heatshrink_buffer(queue_buffer_t *buf) {
-    if (buf == NULL)
-        return;
-
-    if (G_UNLIKELY(buf->offset > buf->data_size * 4)) {
-        /* Consolodate with memmove. We will reclaim the space in the next
-         * step. */
-        memmove(buf->data, buf->data + buf->offset, buf->data_size);
-        buf->offset = 0;
-    } 
-
-    if (buf->alloc_size > buf->data_size*2 + buf->offset) {
-        buf->alloc_size = buf->data_size + buf->offset;
-        buf->data = realloc(buf->data, buf->alloc_size);
-    }
-}
-
-static gpointer do_producer_thread(gpointer datap) {
-    queue_data_t* data = datap;
-
-    for (;;) {
-        queue_buffer_t *buf;
-        gboolean result;
-
-        semaphore_decrement(data->free_memory, 0);
-        buf = g_async_queue_try_pop(data->free_queue);
-        if (buf != NULL && buf->data == NULL) {
-            /* Consumer is finished, then so are we. */
-            amfree(buf);
-            return GINT_TO_POINTER(TRUE);
-        }
-
-        if (buf == NULL) {
-            buf = invent_buffer();
-        }
-        buf->offset = 0;
-        buf->data_size = 0;
-
-        result = data->producer(data->producer_user_data, buf,
-                                data->block_size);
-
-        // Producers can allocate way too much memory.
-        heatshrink_buffer(buf);
-
-        if (buf->data_size > 0) {
-            semaphore_force_adjust(data->free_memory, -buf->alloc_size);
-            
-            g_async_queue_push(data->data_queue, buf);
-            buf = NULL;
-        } else {
-            g_assert(result != PRODUCER_MORE);
-            free_buffer(buf);
-            buf = NULL;
-        }
-
-
-        if (result == PRODUCER_MORE) {
-            continue;
-        } else {
-            /* We are finished (and the first to do so). */
-            g_async_queue_push(data->data_queue, invent_buffer());
-            semaphore_force_set(data->free_memory, INT_MIN);
-
-            return GINT_TO_POINTER(result == PRODUCER_FINISHED);
-        }
-    }
-}
-
-static gpointer do_consumer_thread(gpointer datap) {
-    queue_data_t* data = datap;
-    gboolean got_eof = FALSE;
-    queue_buffer_t *buf = NULL;
-
-    if (data->streaming_mode != STREAMING_REQUIREMENT_NONE) {
-        semaphore_wait_empty(data->free_memory);
-    }
-
-    for (;;) {
-        gboolean result;
-
-       /* Pull in and merge buffers until we have at least data->block_size
-        * bytes, or there are no more buffers */
-        while (!got_eof && (buf == NULL || buf->data_size < data->block_size)) {
-            queue_buffer_t *next_buf;
-            if (data->streaming_mode == STREAMING_REQUIREMENT_DESIRED) {
-                do {
-                    next_buf = g_async_queue_try_pop(data->data_queue);
-                    if (next_buf == NULL) {
-                        semaphore_wait_empty(data->free_memory);
-                    }
-                } while (next_buf == NULL);
-            } else {
-                next_buf = g_async_queue_pop(data->data_queue);
-                g_assert(next_buf != NULL);
-            }
-
-            if (next_buf->data == NULL) {
-                /* A buffer with NULL data is an EOF from the producer */
-                free_buffer(next_buf);
-               got_eof = TRUE;
-               break;
-            }
-
-            semaphore_increment(data->free_memory, next_buf->alloc_size);
-
-            buf = merge_buffers(buf, next_buf);
-        }
-
-       /* If we're out of data, then we are done. */
-       if (buf == NULL)
-           break;
-
-        result = data->consumer(data->consumer_user_data, buf);
-
-        if (result > 0) {
-            consume_buffer(buf, result);
-            if (buf->data_size == 0) {
-                g_async_queue_push(data->free_queue, buf);
-                buf = NULL;
-            }
-            continue;
-        } else {
-            free_buffer(buf);
-            return GINT_TO_POINTER(FALSE);
-        }
-    }
-
-    /* We are so outta here. */
-    return GINT_TO_POINTER(TRUE);
-}
-
-/* Empties a buffer queue and frees all the buffers associated with it.
- *
- * If full_cleanup is TRUE, then we delete the queue itself.
- * If full_cleanup is FALSE, then we leave the queue around, with a
- *         signal element in it. */
-static void cleanup_buffer_queue(GAsyncQueue *Q, gboolean full_cleanup) {
-    g_async_queue_lock(Q);
-    for (;;) {
-        queue_buffer_t *buftmp;
-        buftmp = g_async_queue_try_pop_unlocked(Q);
-        if (buftmp == NULL)
-            break;
-
-        free_buffer(buftmp);
-    }
-    if (!full_cleanup)
-        g_async_queue_push_unlocked(Q, invent_buffer());
-
-    g_async_queue_unlock(Q);
-    
-    if (full_cleanup)
-        g_async_queue_unref(Q);
-}
-
-/* This function sacrifices performance, but will still work just
-   fine, on systems where threads are not supported. */
-static queue_result_flags
-do_unthreaded_consumer_producer_queue(size_t block_size,
-                                      ProducerFunctor producer,
-                                      gpointer producer_user_data,
-                                      ConsumerFunctor consumer,
-                                      gpointer consumer_user_data) {
-    queue_buffer_t *buf = NULL, *next_buf = NULL;
-    gboolean finished = FALSE;
-    queue_result_flags rval = 0;
-
-    /* The basic theory of operation here is to read until we have
-       enough data to write, then write until we don't.. */
-    while (!finished) {
-        producer_result_t result;
-        
-        while ((buf == NULL || buf->data_size < block_size) && !finished) {
-            if (next_buf == NULL)
-                next_buf = invent_buffer();
-
-            result = producer(producer_user_data, next_buf, block_size);
-
-            if (result != PRODUCER_MORE) {
-                finished = TRUE;
-                if (result != PRODUCER_FINISHED) {
-                    rval |= QUEUE_PRODUCER_ERROR;
-                }
-            }
-
-            buf = merge_buffers(buf, next_buf);
-            next_buf = NULL;
-        }
-
-        while (buf != NULL && buf->data_size > 0 &&
-               (buf->data_size >= block_size || finished)) {
-            result = consumer(consumer_user_data, buf);
-            
-            if (result > 0) {
-                consume_buffer(buf, result);
-                if (buf->data_size == 0) {
-                    next_buf = buf;
-                    buf = NULL;
-                }
-            } else {
-                finished = TRUE;
-                rval |= QUEUE_CONSUMER_ERROR;
-                break;
-            }
-        }
-    }
-
-    free_buffer(buf);
-    free_buffer(next_buf);
-    return rval;
-}
-
-gboolean do_consumer_producer_queue(ProducerFunctor producer,
-                                    gpointer producer_user_data,
-                                    ConsumerFunctor consumer,
-                                    gpointer consumer_user_data) {
-    return QUEUE_SUCCESS ==
-        do_consumer_producer_queue_full(producer, producer_user_data,
-                                        consumer, consumer_user_data,
-                                        0, DEFAULT_MAX_BUFFER_MEMORY,
-                                        STREAMING_REQUIREMENT_NONE);
-}
-
-queue_result_flags
-do_consumer_producer_queue_full(ProducerFunctor producer,
-                                gpointer producer_user_data,
-                                ConsumerFunctor consumer,
-                                gpointer consumer_user_data,
-                                size_t block_size,
-                                size_t max_memory,
-                                StreamingRequirement streaming_mode) {
-    GThread     * producer_thread;
-    GThread     * consumer_thread;
-    queue_data_t  queue_data;
-    gpointer      producer_result;
-    gpointer      consumer_result;
-    queue_result_flags rval;
-
-    if (block_size <= 0) {
-        block_size = DISK_BLOCK_BYTES;
-    }
-
-    g_return_val_if_fail(producer != NULL, FALSE);
-    g_return_val_if_fail(consumer != NULL, FALSE);
-
-    if (!g_thread_supported()) {
-        return do_unthreaded_consumer_producer_queue(block_size, producer,
-                                                     producer_user_data,
-                                                     consumer,
-                                                     consumer_user_data);
-    }
-
-    queue_data.block_size = block_size;
-    queue_data.producer = producer;
-    queue_data.producer_user_data = producer_user_data;
-    queue_data.consumer = consumer;
-    queue_data.consumer_user_data = consumer_user_data;
-    queue_data.streaming_mode = streaming_mode;
-
-    queue_data.data_queue = g_async_queue_new();
-    queue_data.free_queue = g_async_queue_new();
-
-    max_memory = MAX(1,MIN(max_memory, INT_MAX / 2));
-    queue_data.free_memory = semaphore_new_with_value(max_memory);
-
-    producer_thread = g_thread_create(do_producer_thread, &queue_data,
-                                      TRUE,
-                                      NULL /* FIXME: Should handle
-                                              errors. */);
-    consumer_thread = g_thread_create(do_consumer_thread, &queue_data,
-                                      TRUE,
-                                      NULL /* FIXME: Should handle
-                                              errors. */);
-    
-    /* The order of cleanup here is very important, to avoid deadlock. */
-    /* 1) Reap the consumer. */
-    consumer_result = g_thread_join(consumer_thread);
-    /* 2) Stop the producer. */
-    semaphore_force_set(queue_data.free_memory, -1);
-    /* 3) Cleanup the free queue; add a signal flag. */
-    cleanup_buffer_queue(queue_data.free_queue, FALSE);
-    /* 4) Restart the producer (so it can exit). */
-    semaphore_force_set(queue_data.free_memory, INT_MAX);
-    /* 5) Reap the producer. */
-    producer_result = g_thread_join(producer_thread);
-
-    cleanup_buffer_queue(queue_data.free_queue, TRUE);
-    cleanup_buffer_queue(queue_data.data_queue, TRUE);
-
-    semaphore_free(queue_data.free_memory);
-    
-    rval = 0;
-    if (!GPOINTER_TO_INT(producer_result)) {
-        rval |= QUEUE_PRODUCER_ERROR;
-    }
-    if (!GPOINTER_TO_INT(consumer_result)) {
-        rval |= QUEUE_CONSUMER_ERROR;
-    }
-    return rval;
-}
-
-/* Commonly-useful producers and consumers below. */
-
-queue_fd_t *
-queue_fd_new(
-    int fd,
-    char *errmsg)
-{
-    queue_fd_t *queue_fd;
-
-    queue_fd = malloc(sizeof(queue_fd_t));
-    queue_fd->fd = fd;
-    queue_fd->errmsg = errmsg;
-
-    return queue_fd;
-}
-
-int
-queue_fd_fd(
-    queue_fd_t *queue_fd)
-{
-    return queue_fd->fd;
-}
-
-char *queue_fd_errmsg(
-    queue_fd_t *queue_fd)
-{
-    return queue_fd->errmsg;
-}
-
-producer_result_t fd_read_producer(gpointer f_queue_fd, queue_buffer_t *buffer,
-                                   size_t hint_size) {
-    int fd;
-    queue_fd_t *queue_fd = (queue_fd_t *)f_queue_fd;
-    fd = queue_fd->fd;
-    g_assert(fd >= 0);
-    g_assert(buffer->data_size == 0);
-
-    buffer->offset = 0;
-
-    if (buffer->data == NULL) {
-        /* Set up the buffer. */
-        buffer->data = malloc(hint_size);
-        buffer->alloc_size = hint_size;
-    }
-
-    for (;;) {
-        ssize_t result;
-        result = read(fd, buffer->data, buffer->alloc_size);
-
-        if (result > 0) {
-            buffer->data_size = result;
-            return PRODUCER_MORE;
-        } else if (result == 0) {
-            /* End of file. */
-            return PRODUCER_FINISHED;
-        } else if (0
-#ifdef EAGAIN
-                || errno == EAGAIN
-#endif
-#ifdef EWOULDBLOCK
-                || errno == EWOULDBLOCK
-#endif
-#ifdef EINTR
-                || errno == EINTR
-#endif
-                ) {
-                /* Try again. */
-                continue;
-        } else {
-            /* Error occured. */
-           queue_fd->errmsg = newvstrallocf(queue_fd->errmsg,
-               "Error reading fd %d: %s\n", fd, strerror(errno));
-            return PRODUCER_ERROR;
-        }
-    }
-}
-
-ssize_t fd_write_consumer(gpointer f_queue_fd, queue_buffer_t *buffer) {
-    int fd;
-    queue_fd_t *queue_fd = (queue_fd_t *)f_queue_fd;
-    fd = queue_fd->fd;
-
-    g_assert(fd >= 0);
-
-    g_return_val_if_fail(buffer->data_size > 0, 0);
-
-    for (;;) {
-        ssize_t write_size;
-        write_size = write(fd, buffer->data + buffer->offset,
-                           buffer->data_size);
-        
-        if (write_size > 0) {
-            return write_size;
-        } else if (0
-#ifdef EAGAIN
-                || errno == EAGAIN
-#endif
-#ifdef EWOULDBLOCK
-                || errno == EWOULDBLOCK
-#endif
-#ifdef EINTR
-                || errno == EINTR
-#endif
-                ) {
-                /* Try again. */
-                continue;
-        } else {
-            /* Error occured. */
-           int save_errno = errno;
-           amfree(queue_fd->errmsg);
-           queue_fd->errmsg = g_strdup_printf("Error writing fd %d: %s", fd,
-                                              strerror(save_errno));
-           dbprintf("%s\n", queue_fd->errmsg);
-            return -1;
-        }        
-    }
-}
diff --git a/common-src/queueing.h b/common-src/queueing.h
deleted file mode 100644 (file)
index 4e46eaa..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-#ifndef QUEUEING_H
-#define QUEUEING_H
-
-/* This file contains the code for fast threaded reading and writing to/from
- * media, for devices that don't require any special handling. Some
- * devices (e.g., CD-ROM) may use a different method for bulk reads or
- * writes. */
-
-#include "amanda.h"
-#include <glib.h>
-
-#define DEFAULT_MAX_BUFFER_MEMORY (1*1024*1024)
-
-typedef enum {
-    STREAMING_REQUIREMENT_NONE,
-    STREAMING_REQUIREMENT_DESIRED,
-    STREAMING_REQUIREMENT_REQUIRED
-} StreamingRequirement;
-
-/* Valid data in this structure starts at data + offset, and has size
- * data_size. Allocation starts at data and has size alloc_size. */
-typedef struct {
-    char *data;
-    size_t alloc_size;
-    size_t data_size;
-    size_t offset;
-} queue_buffer_t;
-
-void free_buffer(queue_buffer_t*);
-
-typedef enum {
-    PRODUCER_MORE,     /* Means the producer should be run again. */
-    PRODUCER_FINISHED, /* Means that no error occured, but the
-                          producer should not be run again. */
-    PRODUCER_ERROR     /* Means an error occured, and the producer
-                          should not be run again. */
-} producer_result_t;
-
-typedef enum {
-    QUEUE_SUCCESS = 0,
-    QUEUE_PRODUCER_ERROR = 1 << 0,
-    QUEUE_CONSUMER_ERROR = 1 << 1,
-    QUEUE_INTERNAL_ERROR = 1 << 2
-} queue_result_flags;
-
-/* The producer takes the given buffer (which is not itself NULL, but may contain
- * a NULL data segment), and fills it with data. The producer can allocate or
- * reallocate the buffer's 'data' element as necessary; the queueing system will
- * free it when necessary. The result of the production operation is specified in
- * the return value, but if the buffer is left without data, then that is
- * interpreted as PRODUCER_ERROR. For optimal performance, the producer should
- * supply exactly hint_size bytes of data in each call, but this is not required.
- *
- * The consumer is given a buffer (which will not be NULL, nor contain a NULL data
- * segment), and is expected to process some or all of the data in that buffer. If
- * there is a problem consuming data (such that no further data can be consumed),
- * the consumer may return -1. Otherwise, the consumer should return the number of
- * bytes actually consumed.  If an error occurs, it should return -1, regardless
- * of the number of bytes consumed.  The queueing framework will ensure that all
- * blocks have at least hint_size bytes, except the last.  For optimal
- * performance, the consumer should consume the entire buffer at each call, but
- * this is not required.
- *
- * Note that the handling of the queue_buffer_t is different between the two
- * functions: The producer should update queue_buffer_t as necessary to corespond
- * to read data, while the consumer should leave the queue_buffer_t unadjusted:
- * The queueing framework will invalidate data in the buffer according to the
- * return value of the consumer.*/
-
-typedef producer_result_t (* ProducerFunctor)(gpointer user_data,
-                                              queue_buffer_t* buffer,
-                                              size_t hint_size);
-typedef ssize_t (* ConsumerFunctor)(gpointer user_data,
-                                queue_buffer_t* buffer);
-
-
-/* These functions make the magic happen. The first one assumes
-   reasonable defaults, the second one provides more options.
-   % producer           : A function that provides data to write.
-   % producer_user_data : A pointer to pass to that function.
-   % consumer           : A function that writes data out.
-   % consumer_user_data : A pointer to pass to that function.
-   % block_size         : Size of chunks to write out to consumer. If
-                          nonpositive, data will be written in
-                          variable-sized chunks.
-   % max_memory         : Amount of memory to be used for buffering.
-                          (default is DEFAULT_MAX_BUFFER_MEMORY).
-   % streaming_mode     : Describes streaming mode.
-         STREAMING_REQUIREMENT_NONE:     Data will be written as fast
-                                         as possible. No prebuffering
-                                         will be done.
-         STREAMING_REQUIREMENT_DESIRED:  max_memory bytes of data will
-                                         be prebuffered, and if the
-                                         buffer ever empties, no data
-                                         will be written until it
-                                         fills again.
-         STREAMING_REQUIREMENT_REQUIRED: max_memory bytes of data will
-                                         be prebuffered, and
-                                         thereafter data will be
-                                         written as fast as possible.
-*/
-gboolean
-do_consumer_producer_queue(ProducerFunctor producer,
-                           gpointer producer_user_data,
-                           ConsumerFunctor consumer,
-                           gpointer consumer_user_data);
-queue_result_flags
-do_consumer_producer_queue_full(ProducerFunctor producer,
-                                gpointer producer_user_data,
-                                ConsumerFunctor consumer,
-                                gpointer consumer_user_data,
-                                size_t block_size,
-                                size_t max_memory,
-                                StreamingRequirement streaming_mode);
-
-/* Some commonly-useful producers and consumers.*/
-
-/* These functions will call read() or write() respectively. The user
-   data should be a pointer to an queue_fd_t, with fd set to the device
-   descriptor and errmsg set to NULL. */
-
-typedef struct {
-    int fd;
-    char *errmsg;
-} queue_fd_t;
-
-queue_fd_t *queue_fd_new(int fd, char *errmsg);
-int queue_fd_fd(queue_fd_t *queue_fd);
-char *queue_fd_errmsg(queue_fd_t *queue_fd);
-
-producer_result_t fd_read_producer(gpointer queue_fd, queue_buffer_t *buffer,
-                                   size_t hint_size);
-ssize_t fd_write_consumer(gpointer queue_fd, queue_buffer_t *buffer);
-
-
-
-#endif /* QUEUEING_H */
index 3cd3664dcc8dd3ed8b20c448ad496eb80edb12ec..f1fa2a8076a68a9954457f3c0b91a4887e848cbe 100644 (file)
@@ -76,6 +76,7 @@ const security_driver_t rsh_security_driver = {
     "RSH",
     rsh_connect,
     sec_accept,
+    sec_get_authenticated_peer_name_hostname,
     sec_close,
     stream_sendpkt,
     stream_recvpkt,
index 4fa750d4e8c26826e9bb5b95cf073623a5f09ce8..bc108cdd0fbfcd4747579ce02ce4f933bdd728c9 100644 (file)
 #include "stream.h"
 #include "sockaddr-util.h"
 
-/*
- * Magic values for sec_conn->handle
- */
-#define        H_TAKEN -1              /* sec_conn->tok was already read */
-#define        H_EOF   -2              /* this connection has been shut down */
-
 /*
  * This is a queue of open connections
  */
@@ -108,7 +102,7 @@ sec_accept(
 {
     struct tcp_conn *rc;
 
-    rc = sec_tcp_conn_get("unknown",0);
+    rc = sec_tcp_conn_get("",0); /* no hostname yet */
     rc->read = in;
     rc->write = out;
     rc->accept_fn = fn;
@@ -432,11 +426,18 @@ tcpm_send_token(
     char               *encbuf;
     ssize_t            encsize;
     int                        save_errno;
+    time_t             logtime;
 
     assert(SIZEOF(netlength) == 4);
 
+    logtime = time(NULL);
+    if (rc && logtime > rc->logstamp + 10) {
+       g_debug("tcpm_send_token: data is still flowing");
+        rc->logstamp = logtime;
+    }
+
     auth_debug(1, "tcpm_send_token: write %zd bytes to handle %d\n",
-         len, handle);
+              len, handle);
     /*
      * Format is:
      *   32 bit length (network byte order)
@@ -487,6 +488,7 @@ tcpm_send_token(
 }
 
 /*
+ *  return -2 for incomplete packet
  *  return -1 on error
  *  return  0 on EOF:   *handle = H_EOF  && *size = 0    if socket closed
  *  return  0 on EOF:   *handle = handle && *size = 0    if stream closed
@@ -500,93 +502,118 @@ tcpm_recv_token(
     int *      handle,
     char **    errmsg,
     char **    buf,
-    ssize_t *  size,
-    int                timeout)
+    ssize_t *  size)
 {
-    unsigned int netint[2];
-
-    assert(SIZEOF(netint) == 8);
-
-    switch (net_read(fd, &netint, SIZEOF(netint), timeout)) {
-    case -1:
-       if (errmsg)
-           *errmsg = newvstrallocf(*errmsg, _("recv error: %s"), strerror(errno));
-       auth_debug(1, _("tcpm_recv_token: A return(-1)\n"));
-       return (-1);
-    case 0:
-       *size = 0;
-       *handle = H_EOF;
-       *errmsg = newvstrallocf(*errmsg, _("SOCKET_EOF"));
-       auth_debug(1, _("tcpm_recv_token: A return(0)\n"));
-       return (0);
-    default:
-       break;
-    }
-
-    *size = (ssize_t)ntohl(netint[0]);
-    *handle = (int)ntohl(netint[1]);
-    /* amanda protocol packet can be above NETWORK_BLOCK_BYTES */
-    if (*size > 128*NETWORK_BLOCK_BYTES || *size < 0) {
-       if (isprint((int)(*size        ) & 0xFF) &&
-           isprint((int)(*size   >> 8 ) & 0xFF) &&
-           isprint((int)(*size   >> 16) & 0xFF) &&
-           isprint((int)(*size   >> 24) & 0xFF) &&
-           isprint((*handle      ) & 0xFF) &&
-           isprint((*handle >> 8 ) & 0xFF) &&
-           isprint((*handle >> 16) & 0xFF) &&
-           isprint((*handle >> 24) & 0xFF)) {
-           char s[101];
-           int i;
-           s[0] = ((int)(*size)  >> 24) & 0xFF;
-           s[1] = ((int)(*size)  >> 16) & 0xFF;
-           s[2] = ((int)(*size)  >>  8) & 0xFF;
-           s[3] = ((int)(*size)       ) & 0xFF;
-           s[4] = (*handle >> 24) & 0xFF;
-           s[5] = (*handle >> 16) & 0xFF;
-           s[6] = (*handle >> 8 ) & 0xFF;
-           s[7] = (*handle      ) & 0xFF;
-           i = 8; s[i] = ' ';
-           while(i<100 && isprint((int)s[i]) && s[i] != '\n') {
-               switch(net_read(fd, &s[i], 1, 0)) {
-               case -1: s[i] = '\0'; break;
-               case  0: s[i] = '\0'; break;
-               default:
+    ssize_t     rval;
+
+    assert(SIZEOF(rc->netint) == 8);
+    if (rc->size_header_read < (ssize_t)SIZEOF(rc->netint)) {
+       rval = read(fd, ((char *)&rc->netint) + rc->size_header_read,
+                       SIZEOF(rc->netint) - rc->size_header_read);
+       if (rval == -1) {
+           if (errmsg)
+               *errmsg = newvstrallocf(*errmsg, _("recv error: %s"),
+                                       strerror(errno));
+           auth_debug(1, _("tcpm_recv_token: A return(-1)\n"));
+           return(-1);
+       } else if (rval == 0) {
+           *size = 0;
+           *handle = H_EOF;
+           *errmsg = newvstrallocf(*errmsg, _("SOCKET_EOF"));
+           auth_debug(1, _("tcpm_recv_token: A return(0)\n"));
+           return(0);
+       } else if (rval < (ssize_t)SIZEOF(rc->netint) - rc->size_header_read) {
+           rc->size_header_read += rval;
+           return(-2);
+       }
+       rc->size_header_read += rval;
+        amfree(rc->buffer);
+       *size = (ssize_t)ntohl(rc->netint[0]);
+       *handle = (int)ntohl(rc->netint[1]);
+        rc->buffer = NULL;
+       rc->size_buffer_read = 0;
+
+       /* amanda protocol packet can be above NETWORK_BLOCK_BYTES */
+       if (*size > 128*NETWORK_BLOCK_BYTES || *size < 0) {
+           if (isprint((int)(*size        ) & 0xFF) &&
+               isprint((int)(*size   >> 8 ) & 0xFF) &&
+               isprint((int)(*size   >> 16) & 0xFF) &&
+               isprint((int)(*size   >> 24) & 0xFF) &&
+               isprint((*handle      ) & 0xFF) &&
+               isprint((*handle >> 8 ) & 0xFF) &&
+               isprint((*handle >> 16) & 0xFF) &&
+               isprint((*handle >> 24) & 0xFF)) {
+               char s[201];
+               char *s1;
+               int i;
+               s[0] = ((int)(*size)  >> 24) & 0xFF;
+               s[1] = ((int)(*size)  >> 16) & 0xFF;
+               s[2] = ((int)(*size)  >>  8) & 0xFF;
+               s[3] = ((int)(*size)       ) & 0xFF;
+               s[4] = (*handle >> 24) & 0xFF;
+               s[5] = (*handle >> 16) & 0xFF;
+               s[6] = (*handle >> 8 ) & 0xFF;
+               s[7] = (*handle      ) & 0xFF;
+               i = 8; s[i] = ' ';
+               while(i<200 && isprint((int)s[i]) && s[i] != '\n') {
+                   switch(net_read(fd, &s[i], 1, 0)) {
+                   case -1: s[i] = '\0'; break;
+                   case  0: s[i] = '\0'; break;
+                   default:
                         dbprintf(_("read: %c\n"), s[i]); i++; s[i]=' ';
                         break;
+                   }
                }
+               s[i] = '\0';
+               s1 = quote_string(s);
+               *errmsg = newvstrallocf(*errmsg,
+                               _("tcpm_recv_token: invalid size: %s"), s1);
+               dbprintf(_("tcpm_recv_token: invalid size %s\n"), s1);
+               amfree(s1);
+           } else {
+               *errmsg = newvstrallocf(*errmsg,
+                                       _("tcpm_recv_token: invalid size"));
+               dbprintf(_("tcpm_recv_token: invalid size %zd\n"), *size);
            }
-           s[i] = '\0';
-           *errmsg = newvstrallocf(*errmsg, _("tcpm_recv_token: invalid size: %s"), s);
-           dbprintf(_("tcpm_recv_token: invalid size %s\n"), s);
-       } else {
-           *errmsg = newvstrallocf(*errmsg, _("tcpm_recv_token: invalid size"));
-           dbprintf(_("tcpm_recv_token: invalid size %zd\n"), *size);
+           *size = -1;
+           return -1;
        }
-       *size = -1;
-       return -1;
-    }
-    amfree(*buf);
-    *buf = alloc((size_t)*size);
+        rc->buffer = alloc((size_t)*size);
 
-    if(*size == 0) {
-       auth_debug(1, _("tcpm_recv_token: read EOF from %d\n"), *handle);
-       *errmsg = newvstrallocf(*errmsg, _("EOF"));
-       return 0;
+       if (*size == 0) {
+           auth_debug(1, _("tcpm_recv_token: read EOF from %d\n"), *handle);
+           *errmsg = newvstrallocf(*errmsg, _("EOF"));
+           rc->size_header_read = 0;
+           return 0;
+       }
     }
-    switch (net_read(fd, *buf, (size_t)*size, timeout)) {
-    case -1:
+
+    *size = (ssize_t)ntohl(rc->netint[0]);
+    *handle = (int)ntohl(rc->netint[1]);
+
+    rval = read(fd, rc->buffer + rc->size_buffer_read,
+                   (size_t)*size - rc->size_buffer_read);
+    if (rval == -1) {
        if (errmsg)
-           *errmsg = newvstrallocf(*errmsg, _("recv error: %s"), strerror(errno));
+           *errmsg = newvstrallocf(*errmsg, _("recv error: %s"),
+                                   strerror(errno));
        auth_debug(1, _("tcpm_recv_token: B return(-1)\n"));
        return (-1);
-    case 0:
+    } else if (rval == 0) {
        *size = 0;
        *errmsg = newvstrallocf(*errmsg, _("SOCKET_EOF"));
        auth_debug(1, _("tcpm_recv_token: B return(0)\n"));
        return (0);
-    default:
-       break;
+    } else if (rval < (ssize_t)*size - rc->size_buffer_read) {
+       rc->size_buffer_read += rval;
+       return (-2);
     }
+    rc->size_buffer_read += rval;
+    amfree(*buf);
+    *buf = rc->buffer;
+    rc->size_header_read = 0;
+    rc->size_buffer_read = 0;
+    rc->buffer = NULL;
 
     auth_debug(1, _("tcpm_recv_token: read %zd bytes from %d\n"), *size, *handle);
 
@@ -654,7 +681,7 @@ tcpma_stream_client(
        return (NULL);
     }
 
-    rs = alloc(SIZEOF(*rs));
+    rs = g_new0(struct sec_stream, 1);
     security_streaminit(&rs->secstr, rh->sech.driver);
     rs->handle = id;
     rs->ev_read = NULL;
@@ -688,7 +715,7 @@ tcpma_stream_server(
 
     assert(rh != NULL);
 
-    rs = alloc(SIZEOF(*rs));
+    rs = g_new0(struct sec_stream, 1);
     security_streaminit(&rs->secstr, rh->sech.driver);
     rs->closed_by_me = 0;
     rs->closed_by_network = 0;
@@ -740,6 +767,7 @@ tcpma_stream_close(
     security_stream_read_cancel(&rs->secstr);
     if(rs->closed_by_network == 0)
        sec_tcp_conn_put(rs->rc);
+    amfree(((security_stream_t *)rs)->error);
     amfree(rs);
 }
 
@@ -756,7 +784,7 @@ tcp1_stream_server(
 
     assert(rh != NULL);
 
-    rs = alloc(SIZEOF(*rs));
+    rs = g_new0(struct sec_stream, 1);
     security_streaminit(&rs->secstr, rh->sech.driver);
     rs->closed_by_me = 0;
     rs->closed_by_network = 0;
@@ -828,7 +856,7 @@ tcp1_stream_client(
 
     assert(rh != NULL);
 
-    rs = alloc(SIZEOF(*rs));
+    rs = g_new0(struct sec_stream, 1);
     security_streaminit(&rs->secstr, rh->sech.driver);
     rs->handle = id;
     rs->ev_read = NULL;
@@ -865,9 +893,16 @@ tcp_stream_write(
     size_t     size)
 {
     struct sec_stream *rs = s;
+    time_t             logtime;
 
     assert(rs != NULL);
 
+    logtime = time(NULL);
+    if (rs && rs->rc && logtime > rs->rc->logstamp + 10) {
+       g_debug("tcp_stream_write: data is still flowing");
+       rs->rc->logstamp = logtime;
+    }
+
     if (full_write(rs->fd, buf, size) < size) {
         security_stream_seterror(&rs->secstr,
             _("write error on stream %d: %s"), rs->port, strerror(errno));
@@ -1379,7 +1414,7 @@ udp_netfd_read_callback(
        return;
     }
 
-    rh = alloc(SIZEOF(*rh));
+    rh = g_new0(struct sec_handle, 1);
     rh->proto_handle=NULL;
     rh->udp = udp;
     rh->rc = NULL;
@@ -1460,7 +1495,7 @@ sec_tcp_conn_get(
     /*
      * We can't be creating a new handle if we are the client
      */
-    rc = alloc(SIZEOF(*rc));
+    rc = g_new0(struct tcp_conn, 1);
     rc->read = rc->write = -1;
     rc->driver = NULL;
     rc->pid = -1;
@@ -1673,8 +1708,15 @@ stream_read_callback(
     void *     arg)
 {
     struct sec_stream *rs = arg;
+    time_t             logtime;
+
     assert(rs != NULL);
 
+    logtime = time(NULL);
+    if (rs && rs->rc && logtime > rs->rc->logstamp + 10) {
+       g_debug("stream_read_callback: data is still flowing");
+       rs->rc->logstamp = logtime;
+    }
     auth_debug(1, _("sec: stream_read_callback: handle %d\n"), rs->handle);
 
     /*
@@ -1734,9 +1776,14 @@ sec_tcp_conn_read_callback(
 
     /* Read the data off the wire.  If we get errors, shut down. */
     rval = tcpm_recv_token(rc, rc->read, &rc->handle, &rc->errmsg, &rc->pkt,
-                               &rc->pktlen, 60);
+                               &rc->pktlen);
     auth_debug(1, _("sec: conn_read_callback: tcpm_recv_token returned %zd\n"),
                   rval);
+
+    if (rval == -2) {
+       return;
+    }
+
     if (rval < 0 || rc->handle == H_EOF) {
        rc->pktlen = rval;
        rc->handle = H_EOF;
@@ -1784,7 +1831,7 @@ sec_tcp_conn_read_callback(
        return;
     }
 
-    rh = alloc(SIZEOF(*rh));
+    rh = g_new0(struct sec_handle, 1);
     security_handleinit(&rh->sech, rc->driver);
     rh->hostname = stralloc(rc->hostname);
     rh->ev_timeout = NULL;
@@ -2572,7 +2619,7 @@ check_name_give_sockaddr(
        }
     }
 
-    dbprintf(_("%s doesn't resolve to %s"),
+    g_debug("%s doesn't resolve to %s",
            hostname, str_sockaddr((sockaddr_union *)addr));
     *errstr = newvstrallocf(*errstr,
                           "%s doesn't resolve to %s",
@@ -2612,3 +2659,20 @@ find_port_for_service(
 
     return port;
 }
+
+char *
+sec_get_authenticated_peer_name_localhost(
+    security_handle_t *hdl G_GNUC_UNUSED)
+{
+    return "localhost";
+}
+
+char *
+sec_get_authenticated_peer_name_hostname(
+    security_handle_t *hdl)
+{
+    char *hostname = ((struct sec_handle *)hdl)->hostname;
+    if (!hostname)
+       hostname = "";
+    return hostname;
+}
index 6c5c41f0e771f225871f09ab02712f71c46ee820..9fa67701a6a48d53d3fa5a6382de3787daa5153f 100644 (file)
 } while (0)
 
 
+/*
+ * Magic values for sec_conn->handle
+ */
+#define H_TAKEN -1             /* sec_conn->tok was already read */
+#define H_EOF   -2             /* this connection has been shut down */
+
 #ifdef KRB5_SECURITY
 #  define KRB5_DEPRECATED 1
 #  ifndef KRB5_HEIMDAL_INCLUDES
@@ -84,9 +90,14 @@ struct tcp_conn {
     int                        auth;
     char *              (*conf_fn)(char *, void *);
     void *              datap;
+    time_t              logstamp;
 #ifdef KRB5_SECURITY
     gss_ctx_id_t       gss_context;
 #endif
+    unsigned int       netint[2];
+    char *              buffer;
+    ssize_t             size_header_read;
+    ssize_t             size_buffer_read;
 };
 
 
@@ -211,7 +222,8 @@ void        tcpm_stream_read(void *, void (*)(void *, void *, ssize_t), void *);
 ssize_t        tcpm_stream_read_sync(void *, void **);
 void   tcpm_stream_read_cancel(void *);
 ssize_t        tcpm_send_token(struct tcp_conn *, int, int, char **, const void *, size_t);
-ssize_t        tcpm_recv_token(struct tcp_conn *, int, int *, char **, char **, ssize_t *, int);
+ssize_t        tcpm_recv_token_timeout(struct tcp_conn *, int, int *, char **, char **, ssize_t *, int);
+ssize_t        tcpm_recv_token(struct tcp_conn *, int, int *, char **, char **, ssize_t *);
 void   tcpm_close_connection(void *, char *);
 
 int    tcpma_stream_accept(void *);
@@ -262,6 +274,7 @@ void        show_stat_info(char *a, char *b);
 int     check_name_give_sockaddr(const char *hostname, struct sockaddr *addr,
                                 char **errstr);
 in_port_t find_port_for_service(char *service, char *proto);
-
+char   *sec_get_authenticated_peer_name_localhost(security_handle_t *);
+char   *sec_get_authenticated_peer_name_hostname(security_handle_t *);
 
 #endif /* _SECURITY_INFO_H */
index 630b08c4a259677da5c1ff6bd3948c2955b7c7de..3e9bfd1cab435069320cea13c96a4646902ca04a 100644 (file)
 
 struct security_handle;
 
+/*
+ * Overview
+ *
+ * The Security API consists of handles (also called connections), each of
+ * which represents a connection to a particular host.  A handle is implemented
+ * by a driver.  Each handle supports a packet-based communication protocol, as
+ * well as an arbitrary number of bidirectional tcp-like streams.
+ */
+
 /*
  * This is a type that gets passed to the security_recvpkt() and
- * security_connect() callbacks.
- * It details what the status of this callback is.
+ * security_connect() callbacks. It details what the status of this callback
+ * is.
+ */
+typedef enum {
+    S_OK,      /* the pkt_t was received fine */
+    S_TIMEOUT, /* no pkt_t was received within the time specified in the
+                * timeout argument to security_recvpkt() */
+    S_ERROR,   /* an error occurred during reception. Call security_geterror()
+                * for more information */
+} security_status_t;
+
+/*
+ * Drivers
  */
-typedef enum { S_OK, S_TIMEOUT, S_ERROR } security_status_t;
 
 /*
  * This structure defines a security driver.  This driver abstracts
@@ -48,32 +67,46 @@ typedef enum { S_OK, S_TIMEOUT, S_ERROR } security_status_t;
  * mask this.
  */
 typedef struct security_driver {
+
     /*
-     * The name of this driver, eg, "BSD", "BSDTCP", "KRB5", etc...
+     * The name of this driver, eg, "BSD", "BSDTCP", "KRB5", etc...  This is
+     * used by security_getdriver() to associate a name with a driver type.
      */
     const char *name;
 
     /*
-     * Connects a security handle, for this driver to a remote
-     * host.
+     * This is the implementation of security_connect(). It actually sets up
+     * the connection, and then returns a structure describing the connection.
+     * The first element of this structure MUST be a security_handle_t, because
+     * it will be cast to that after it is passed up to the caller.
+     *
+     * The first argument is the host to connect to. The second argument is a
+     * function to call when a connection is made. The third argument is passed
+     * to the callback.
+     *
+     * The callback takes three arguments. The first is the caller supplied
+     * void pointer. The second is a newly allocated security handle. The third
+     * is a security_status_t flag indicating the success or failure of the
+     * operation.
      */
-    void (*connect)(const char *,
-       char *(*)(char *, void *),
-       void (*)(void *, struct security_handle *, security_status_t),
-       void *, void *);
+    void (*connect)(const char *, char *(*)(char *, void *),
+           void (*)(void *, struct security_handle *, security_status_t),
+           void *, void *);
 
     /*
-     * This form sets up a callback that returns new handles as
-     * they are received.  It takes an input and output file descriptor.
+     * This form sets up a callback that returns new handles as they are
+     * received.  It is passed the input and output file descriptors and a
+     * callback. The callback takes a security handle argument and also an
+     * initial packet received for that handle.
      */
-    void (*accept)(const struct security_driver *,
-                       char *(*)(char *, void *),
-                       int, int,
-                       void (*)(struct security_handle *, pkt_t *),
-                       void *);
+    void (*accept)(const struct security_driver *, char *(*)(char *, void *),
+           int, int, void (*)(struct security_handle *, pkt_t *), void *);
+
+    /* get the remote hostname */
+    char *(*get_authenticated_peer_name)(struct security_handle *handle);
 
     /*
-     * Frees up handles allocated by the previous
+     * Frees up handles allocated by the previous methods
      */
     void (*close)(void *);
 
@@ -84,27 +117,32 @@ typedef struct security_driver {
     ssize_t (*sendpkt)(void *, pkt_t *);
 
     /*
-     * This creates an event in the event handler for receiving pkt_t's
-     * on a security_handle.  The given callback with the given arg
-     * will be called when the driver determines that it has data
-     * for that handle.  The last argument is a timeout, in seconds.
-     * This may be -1 to indicate no timeout.
+     * This creates an event in the event handler for receiving pkt_t's on a
+     * security_handle.  The given callback will be called with the given arg
+     * when the driver determines that it has data for that handle.  The last
+     * argument is a timeout, in seconds.  This may be -1 to indicate no
+     * timeout.  This method should assume that the caller will invoke
+     * event_loop
+     *
+     * If there was an error or timeout, this will be indicated in the status
+     * argument.
      *
-     * If there was an error or timeout, this will be indicated in
-     * the status argument.
-     * 
      * Only one recvpkt request can exist per handle.
      */
-    void (*recvpkt)(void *, void (*)(void *, pkt_t *,
-       security_status_t), void *, int);
+    void (*recvpkt)(void *, void (*)(void *, pkt_t *, security_status_t), void
+           *, int);
 
     /*
-     * Cancel an outstanding recvpkt request on a handle.
+     * Cancel an outstanding recvpkt request on a handle. Drivers should allow
+     * this to be run even if no recvpkt was scheduled, or if one was
+     * previously cancelled.
      */
     void (*recvpkt_cancel)(void *);
 
     /*
-     * Get a stream given a security handle
+     * Get a stream given a security handle. This function returns a object
+     * describing the stream. The first member of this object MUST be a
+     * security_stream_t, because it will be cast to that.
      */
     void *(*stream_server)(void *);
 
@@ -114,8 +152,10 @@ typedef struct security_driver {
     int (*stream_accept)(void *);
 
     /*
-     * Get a stream and connect it to a remote given a security handle
-     * and a stream id.
+     * Get a stream and connect it to a remote given a security handle and a
+     * stream id.  This function returns a object describing the stream. The
+     * first member of this object MUST be a security_stream_t, because it will
+     * be cast to that.
      */
     void *(*stream_client)(void *, int);
 
@@ -130,7 +170,8 @@ typedef struct security_driver {
     int (*stream_auth)(void *);
 
     /*
-     * Return a numeric id for a stream.
+     * Return a numeric id for a stream.  This is to be used by stream_client
+     * on the other end of the connection to connect to this stream.
      */
     int (*stream_id)(void *);
 
@@ -161,6 +202,14 @@ typedef struct security_driver {
     int (*data_decrypt)(void *, void *, ssize_t, void **, ssize_t *);
 } security_driver_t;
 
+/* Given a security type ("KRB4", "BSD", "SSH", etc), returns a pointer to that
+ * type's security_driver_t, or NULL if no driver exists.  */
+const security_driver_t *security_getdriver(const char *);
+
+/*
+ * Handles
+ */
+
 /*
  * This structure is a handle to a connection to a host for transmission
  * of protocol packets (pkt_t's).  The underlying security type defines
@@ -174,98 +223,237 @@ typedef struct security_handle {
     char *error;
 } security_handle_t;
 
-/*
- * This structure is a handle to a stream connection to a host for
- * transmission of random data such as dumps or index data.
+/* void security_connect(
+ *  const security_driver_t *driver,
+ *  const char *hostname,
+ *  char *(*conf_fn)(char *, void *),
+ *  void (*fn)(void *, security_handle_t *, security_status_t),
+ *  void *arg,
+ *  void *datap);
+ *
+ * Given a security driver, and a hostname, calls back with a security_handle_t
+ * that can be used to communicate with that host. The status arg to the
+ * callback is reflects the success of the request. Error messages can be had
+ * via security_geterror().  The conf_fn is used to determine configuration
+ * information, with its second argument being the datap. If conf_fn is NULL,
+ * no configuration information is available.
  */
-typedef struct security_stream {
-    const security_driver_t *driver;
-    char *error;
-} security_stream_t;
-
-
-const security_driver_t *security_getdriver(const char *);
-void security_handleinit(security_handle_t *, const security_driver_t *);
-void security_streaminit(security_stream_t *, const security_driver_t *);
-
-/* const char *security_geterror(security_handle_t *); */
-#define        security_geterror(handle)       ((handle)->error)
-void security_seterror(security_handle_t *, const char *, ...)
-     G_GNUC_PRINTF(2,3);
-
-
-/* void security_connect(const security_driver_t *, const char *, 
-    char *(*)(char *, void *),
-    void (*)(void *, security_handle_t *, security_status_t), 
-    void *, 
-    void *); */
 #define        security_connect(driver, hostname, conf_fn, fn, arg, datap)     \
     (*(driver)->connect)(hostname, conf_fn, fn, arg, datap)
 
-/* void security_accept(const security_driver_t *,
-    char *(*)(char *, void *), int, int,
-    void (*)(security_handle_t *, pkt_t *), void *); */
+/* void security_accept(
+ *  const security_driver_t *driver,
+ *  char *(*conf_fn)(char *, void *),
+ *  int in,
+ *  int out,
+ *  void (*fn)(security_handle_t *, pkt_t *),
+ *  void *datap);
+ *
+ * Given a security driver, an input file descriptor, and an output file
+ * descriptor, and a callback, when new connections are detected on the given
+ * file descriptors, the function is called with a newly created security
+ * handle and the initial packet received.  This is amandad's interface for
+ * accepting incoming connections from the Amanda server. The file descriptors
+ * are typically 0 and 1 (stdin/stdout).  This function uses the event
+ * interface, and only works properly when event_loop() is called later in the
+ * program.
+ */
 #define        security_accept(driver, conf_fn, in, out, fn, datap)    \
     (*(driver)->accept)(driver, conf_fn, in, out, fn, datap)
+
+/* char *security_get_authenticated_peer_name(
+ *  security_handle_t *handle);
+ *
+ * Returns the fully qualified, authenticated hostname of the peer, or
+ * "localhost" for a local system.  The string is statically allocated and need
+ * not be freed.  The string will never be NULL, but may be an empty string if
+ * the remote identity is not known, not defined, or could not be
+ * authenticated.
+ */
+#define        security_get_authenticated_peer_name(handle) \
+    (*(handle)->driver->get_authenticated_peer_name)(handle)
+
+/* Closes a security stream created by a security_connect() or
+ * security_accept() and frees up resources associated with it. */
 void security_close(security_handle_t *);
 
-/* ssize_t security_sendpkt(security_handle_t *, const pkt_t *); */
+/* ssize_t security_sendpkt(security_handle_t *, const pkt_t *);
+ *
+ * Transmits a pkt_t over a security handle. Returns 0 on success, or negative
+ * on error. A descriptive error message can be obtained via
+ * security_geterror(). */
 #define        security_sendpkt(handle, pkt)           \
     (*(handle)->driver->sendpkt)(handle, pkt)
 
-/* void security_recvpkt(security_handle_t *,
-    void (*)(void *, pkt_t *, security_status_t), void *, int); */
+/* void security_recvpkt(
+ *  security_handle_t *handle,
+ *  void (*fn)(void *, pkt_t *, security_status_t),
+ *  void *arg,
+ *  int timeout);
+ *
+ * Requests that when incoming packets arrive for this handle, the given
+ * function is called with the given argument, the received packet, and the
+ * status of the reception.  If a packet does not arrive within the number of
+ * seconds specified in the 'timeout' argument, RECV_TIMEOUT is passed in the
+ * status argument of the timeout.  On receive error, the callback's status
+ * argument will be set to RECV_ERROR. An error message can be retrieved via
+ * security_geterror().  On successful reception, RECV_OK will be passed in the
+ * status argument, and the pkt argument will point to a valid packet.  This
+ * function uses the event interface. Callbacks will only be generated when
+ * event_loop() is called. */
 #define        security_recvpkt(handle, fn, arg, timeout)      \
     (*(handle)->driver->recvpkt)(handle, fn, arg, timeout)
 
-/* void security_recvpkt_cancel(security_handle_t *); */
+/* void security_recvpkt_cancel(security_handle_t *);
+ *
+ * Cancels a previous recvpkt request for this handle. */
 #define        security_recvpkt_cancel(handle)         \
     (*(handle)->driver->recvpkt_cancel)(handle)
 
-/* const char *security_stream_geterror(security_stream_t *); */
+/* const char *security_geterror(security_handle_t *);
+ *
+ * Returns a descriptive error message for the last error condition on this
+ * handle. */
+#define        security_geterror(handle)       ((handle)->error)
+
+/* Sets the string that security_geterror() returns.  For use by security
+ * drivers. */
+void security_seterror(security_handle_t *, const char *, ...)
+     G_GNUC_PRINTF(2,3);
+
+/* Initializes a security_handle_t. This is meant to be called only by security
+ * drivers to initialize the common part of a newly allocated
+ * security_handle_t.  */
+void security_handleinit(security_handle_t *, const security_driver_t *);
+
+/*
+ * Streams
+ */
+
+/*
+ * This structure is a handle to a stream connection to a host for
+ * transmission of random data such as dumps or index data.
+ */
+typedef struct security_stream {
+    const security_driver_t *driver;
+    char *error;
+} security_stream_t;
+
+/* Initializes a security_stream_t. This is meant to be called only by security
+ * drivers to initialize the common part of a newly allocated
+ * security_stream_t. */
+void security_streaminit(security_stream_t *, const security_driver_t *);
+
+/* const char *security_stream_geterror(security_stream_t *);
+ *
+ * Returns a descriptive error message for the last error condition on this
+ * stream. */
 #define        security_stream_geterror(stream)        ((stream)->error)
+
+/* Sets the string that security_stream_geterror() returns. */
 void security_stream_seterror(security_stream_t *, const char *, ...)
      G_GNUC_PRINTF(2,3);
 
-/* security_stream_t *security_stream_server(security_handle_t *); */
+/* security_stream_t *security_stream_server(security_handle_t *);
+ *
+ * Creates the server end of a security stream, and will prepare to receive a
+ * connection from the host on the other end of the security handle passed.
+ * Returns a security_stream_t on success, and NULL on error. Error messages
+ * can be obtained by calling security_geterror() on the security handle
+ * associated with this stream. */
 #define        security_stream_server(handle)  \
     (*(handle)->driver->stream_server)(handle)
 
-/* int security_stream_accept(security_stream_t *); */
+/* int security_stream_accept(security_stream_t *);
+ *
+ * Given a security stream created by security_stream_server, blocks until a
+ * connection is made from the remote end.  After calling stream_server,
+ * stream_accept must be called on the stream before it is fully connected.
+ * Returns 0 on success, and -1 on error. Error messages can be obtained by
+ * calling security_stream_geterror().
+ */
 #define        security_stream_accept(stream)          \
     (*(stream)->driver->stream_accept)(stream)
 
-/* security_stream_t *security_stream_client(security_handle_t *, int); */
+/* security_stream_t *security_stream_client(security_handle_t *, int);
+ *
+ * Creates the client end of a security stream, and connects it to the machine
+ * on the other end of the security handle. The 'id' argument identifies which
+ * stream on the other end to connect to, and should have come from
+ * security_stream_id on the other end of the connection.  Returns a
+ * security_stream_t on success, and NULL on error. Error messages can be
+ * obtained by calling security_geterror() on the security handle associated
+ * with this stream. */
 #define        security_stream_client(handle, id)      \
     (*(handle)->driver->stream_client)(handle, id)
 
+/* Closes a security stream and frees up resources associated with it. */
 void security_stream_close(security_stream_t *);
 
-/* int security_stream_auth(security_stream_t *); */
+/* int security_stream_auth(security_stream_t *);
+ *
+ * Authenticate a connected security stream.  This should be called by the
+ * target after security_stream_accept returns successfully, and by the client
+ * after security_stream_connect returns successfullly. Returns 0 on success,
+ * and -1 on error. Error messages can be obtained by calling
+ * security_stream_geterror().
+ */
 #define        security_stream_auth(stream)            \
     (*(stream)->driver->stream_auth)(stream)
 
-/* int security_stream_id(security_stream_t *); */
+/* int security_stream_id(security_stream_t *);
+ *
+ * Returns an identifier which can be used to connect to this security stream
+ * with security_stream_client().  Typical usage is for one end of a connection
+ * to create a stream with security_stream_server(), and then transmit the id
+ * for that stream to the other side. The other side will then connect to that
+ * id with security_stream_client(). */
 #define        security_stream_id(stream)              \
     (*(stream)->driver->stream_id)(stream)
 
-/* int security_stream_write(security_stream_t *, const void *, size_t); */
+/* int security_stream_write(security_stream_t *, const void *, size_t);
+ *
+ * Writes a chunk of data to the security stream. Returns 0 on success, or
+ * negative on error. Error messages can be obtained by calling
+ * security_stream_geterror().
+ */
 #define        security_stream_write(stream, buf, size)        \
     (*(stream)->driver->stream_write)(stream, buf, size)
 
-/* void security_stream_read(security_stream_t *,
-    void (*)(void *, void *, size_t), void *); */
+/* void security_stream_read(
+ *  security_stream_t *stream,
+ *  void (*fn)(void *, void *, size_t),
+ *  void *arg);
+
+ * Requests that when data is ready to be read on this stream, the given
+ * function is called with the given arg, a buffer full of data, and the size
+ * of that buffer. On error, the bufsize will be negative. An error message can
+ * be retrieved by calling security_stream_geterror().  This function uses the
+ * event interface. Callbacks will only be generated while in event_loop(). */
 #define        security_stream_read(stream, fn, arg)           \
     (*(stream)->driver->stream_read)(stream, fn, arg)
 
-/* void security_stream_read_sync(security_stream_t *, void *); */
+/* void security_stream_read_sync(security_stream_t *, void **);
+ *
+ * Return a buffer of data read from the stream. This function will block until
+ * something can be read, but other event will be fired. A pointer to the data
+ * is returned in *buf and the size of the buffer is returned.  On error, the
+ * size will be negative. An error message can be retrieved by calling
+ * security_stream_geterror(). This function uses the event interface.  */
 #define        security_stream_read_sync(stream, buf)          \
     (*(stream)->driver->stream_read_sync)(stream, buf)
 
-/* void security_stream_read_cancel(security_stream_t *); */
+/* void security_stream_read_cancel(security_stream_t *);
+ *
+ * Cancels a previous read request. */
 #define        security_stream_read_cancel(stream)             \
     (*(stream)->driver->stream_read_cancel)(stream)
 
+/* void security_close_connection(security_handle_t *, hostname *);
+ *
+ * Close a security handle, freeing associated resources.  The hostname
+ * argument is ignored. */
 #define security_close_connection(handle, hostname) \
     (*(handle)->driver->close_connection)(handle, hostname)
+
 #endif /* SECURITY_H */
index c6d1e82319376e0a3e4fd83d356ea54d9b6b0f93..09547f582008c9ad48d044e7e6cb18c174b266a8 100644 (file)
@@ -18,9 +18,9 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
+#include "amanda.h"
 #include "semaphore.h"
 #include "testutils.h"
-#include "amanda.h"
 #include "util.h"
 
 /*
index 8d864b8d774ba4bcb116a6e01bf05edd03796e9f..d82baf4b91e8a62484f21200af2d6703661316e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -21,8 +21,8 @@
 /* GLib does not provide semaphores, which are useful in queue.c.
    So, we implement it here. */
 
-#include "semaphore.h"
 #include "amanda.h"
+#include "semaphore.h"
 
 semaphore_t* semaphore_new_with_value(int value) {
     semaphore_t *rval;
index 04e7a9f211b7463bb78e532d97d9ec488d2bdd57..46c636084fd80f530a47d5171f54b61c3bf6c3dc 100644 (file)
@@ -18,6 +18,7 @@
  * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
  */
 
+#include "amanda.h"
 #include "simpleprng.h"
 
 /* A *very* basic linear congruential generator; values are as cited in
index e58ffb39a8b65cd4ac1cc01380604aa6b5fc2906..ffbc32ecf18fc7b10fc1014b93631baa532f6418 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2008 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -23,6 +23,7 @@
  * Utility routines for handling sockaddrs
  */
 
+#include "amanda.h"
 #include "sockaddr-util.h"
 
 void
@@ -90,6 +91,28 @@ str_sockaddr(
     return mystr_sockaddr;
 }
 
+int
+str_to_sockaddr(
+       const char *src,
+       sockaddr_union *dst)
+{
+    int result;
+
+    g_debug("parsing %s", src);
+    /* try AF_INET first */
+    SU_INIT(dst, AF_INET);
+    if ((result = inet_pton(AF_INET, src, &dst->sin.sin_addr)) == 1)
+       return result;
+
+    /* otherwise try AF_INET6, if supported */
+#ifdef WORKING_IPV6
+    SU_INIT(dst, AF_INET6);
+    return inet_pton(AF_INET6, src, &dst->sin6.sin6_addr);
+#else
+    return result;
+#endif
+}
+
 /* Unmap a V4MAPPED IPv6 address into its equivalent IPv4 address.  The location
  * TMP is used to store the rewritten address, if necessary.  Returns a pointer
  * to the unmapped address.
index 868df2d2832dfa21c829b86c24f74bd44861d4b9..d5e68eef7393d99c7e434799fdc65daf973e3e75 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2008 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -55,6 +55,17 @@ int     cmp_sockaddr(sockaddr_union *su1,
                     sockaddr_union *su2,
                     int addr_only);
 
+/* Parse a string into a sockaddr.  This will try all available address
+ * families.
+ *
+ * @param src: the string representation of the address
+ * @param dst: the sockaddr_union in which to store the result
+ * @returns: 1 on success, -1 on error, or 0 if unparseable
+ */
+int    str_to_sockaddr(
+       const char *src,
+       sockaddr_union *dst);
+
 /* Copy a sockaddr object.
  *
  * @param dest: destination
index 19d60692792725905a82e3e4465555201db8fa1c..bed501be996151a31ca54560b8b1513b7de975e9 100644 (file)
@@ -39,6 +39,7 @@
 #include "packet.h"
 #include "security.h"
 #include "security-util.h"
+#include "sockaddr-util.h"
 #include "stream.h"
 
 /*
 static void    ssh_connect(const char *, char *(*)(char *, void *),
                        void (*)(void *, security_handle_t *, security_status_t),
                        void *, void *);
+static void ssh_accept(const security_driver_t *driver, char *(*conf_fn)(char *, void *),
+                       int in, int out,
+                       void (*fn)(security_handle_t *, pkt_t *),
+                       void *datap);
 
 /*
  * This is our interface to the outside world.
@@ -65,7 +70,8 @@ static void   ssh_connect(const char *, char *(*)(char *, void *),
 const security_driver_t ssh_security_driver = {
     "SSH",
     ssh_connect,
-    sec_accept,
+    ssh_accept,
+    sec_get_authenticated_peer_name_hostname,
     sec_close,
     stream_sendpkt,
     stream_recvpkt,
@@ -113,7 +119,7 @@ ssh_connect(
 
     auth_debug(1, "ssh_connect: %s\n", hostname);
 
-    rh = alloc(SIZEOF(*rh));
+    rh = g_new0(struct sec_handle, 1);
     security_handleinit(&rh->sech, &ssh_security_driver);
     rh->hostname = NULL;
     rh->rs = NULL;
@@ -180,6 +186,99 @@ error:
     (*fn)(arg, &rh->sech, S_ERROR);
 }
 
+/* like sec_accept, but first it gets the remote system's hostname */
+static void
+ssh_accept(
+    const security_driver_t *driver,
+    char       *(*conf_fn)(char *, void *),
+    int                in,
+    int                out,
+    void       (*fn)(security_handle_t *, pkt_t *),
+    void       *datap)
+{
+    struct sec_handle *rh;
+    struct tcp_conn *rc = sec_tcp_conn_get("", 0);
+    char *ssh_connection, *p;
+    char *errmsg = NULL;
+    sockaddr_union addr;
+    int result;
+
+    /* "Accepting" an SSH connection means that amandad was invoked via sshd, so
+     * we should have anSSH_CONNECTION env var.  If not, then this probably isn't
+     * a real SSH connection and we should bail out. */
+    ssh_connection = getenv("SSH_CONNECTION");
+    if (!ssh_connection) {
+       errmsg = g_strdup("$SSH_CONNECTION not set - was amandad started by sshd?");
+       goto error;
+    }
+
+    /* make a local copy, to munge */
+    ssh_connection = g_strdup(ssh_connection);
+
+    /* strip off the first component - the ASCII IP address */
+    if ((p = strchr(ssh_connection, ' ')) == NULL) {
+       errmsg = g_strdup("$SSH_CONNECTION malformed");
+       goto error;
+    }
+    *p = '\0';
+
+    /* ---- everything from here on is just a warning, leaving hostname at "" */
+
+    SU_INIT(&addr, AF_INET);
+
+    /* turn the string address into a sockaddr */
+    if ((result = str_to_sockaddr(ssh_connection, &addr)) != 1) {
+       if (result == 0) {
+           g_warning("Could not parse peer address %s", ssh_connection);
+       } else {
+           g_warning("Parsing peer address %s: %s", ssh_connection, gai_strerror(result));
+       }
+       goto done;
+    }
+
+    /* find the hostname */
+    result = getnameinfo((struct sockaddr *)&addr, SS_LEN(&addr),
+                rc->hostname, sizeof(rc->hostname), NULL, 0, 0);
+    if (result != 0) {
+       g_warning("Could not get hostname for SSH client %s: %s", ssh_connection,
+               gai_strerror(result));
+       goto done;
+    }
+
+    /* and verify it */
+    if (check_name_give_sockaddr(rc->hostname,
+                                (struct sockaddr *)&addr, &errmsg) < 0) {
+       rc->hostname[0] = '\0'; /* null out the bad hostname */
+       g_warning("Checking SSH client DNS: %s", errmsg);
+       amfree(errmsg);
+       goto done;
+    }
+
+done:
+    if (ssh_connection)
+       g_free(ssh_connection);
+
+    rc->read = in;
+    rc->write = out;
+    rc->accept_fn = fn;
+    rc->driver = driver;
+    rc->conf_fn = conf_fn;
+    rc->datap = datap;
+    sec_tcp_conn_read(rc);
+    return;
+
+error:
+    if (ssh_connection)
+       g_free(ssh_connection);
+
+    /* make up a fake handle for the error */
+    rh = g_new0(struct sec_handle, 1);
+    security_handleinit(&rh->sech, driver);
+    security_seterror((security_handle_t*)rh, "ssh_accept: %s", errmsg);
+    amfree(errmsg);
+    (*fn)(&rh->sech, NULL);
+}
+
 /*
  * Forks a ssh to the host listed in rc->hostname
  * Returns negative on error, with an errmsg in rc->errmsg.
index 96d3b6fdab00a0b24a1419c4f502a6e1d21906aa..9f93cceb8ac76fe404b30edb47f676980b659844 100644 (file)
@@ -315,6 +315,14 @@ stream_client(
 static sockaddr_union addr;
 static socklen_t_equiv addrlen;
 
+static gboolean
+stream_accept_prolong(
+    gpointer data)
+{
+    time_t *tp = data;
+    return time(NULL) <= *tp;
+}
+
 int
 stream_accept(
     int server_socket,
@@ -322,60 +330,31 @@ stream_accept(
     size_t sendsize,
     size_t recvsize)
 {
-    SELECT_ARG_TYPE readset;
-    struct timeval tv;
-    int nfound, connected_socket;
+    time_t timeout_time;
+    int connected_socket;
     int save_errno;
-    int ntries = 0;
     in_port_t port;
 
     assert(server_socket >= 0);
 
-    do {
-       ntries++;
-       memset(&tv, 0, SIZEOF(tv));
-       tv.tv_sec = timeout;
-       memset(&readset, 0, SIZEOF(readset));
-       FD_ZERO(&readset);
-       FD_SET(server_socket, &readset);
-       nfound = select(server_socket+1, &readset, NULL, NULL, &tv);
-       if(nfound <= 0 || !FD_ISSET(server_socket, &readset)) {
-           save_errno = errno;
-           if(nfound < 0) {
-               g_debug(_("stream_accept: select() failed: %s"),
-                     strerror(save_errno));
-           } else if(nfound == 0) {
-               g_debug(plural(_("stream_accept: timeout after %d second"),
-                               _("stream_accept: timeout after %d seconds"),
-                              timeout),
-                        timeout);
-               errno = ETIMEDOUT;
-               return -1;
-           } else if (!FD_ISSET(server_socket, &readset)) {
-               int i;
-
-               for(i = 0; i < server_socket + 1; i++) {
-                   if(FD_ISSET(i, &readset)) {
-                       g_debug(_("stream_accept: got fd %d instead of %d"),
-                             i,
-                             server_socket);
-                   }
-               }
-               save_errno = EBADF;
-           }
-           if (ntries > 5) {
-               errno = save_errno;
-               return -1;
-           }
-        }
-    } while (nfound <= 0);
+    /* set the time we want to stop accepting */
+    timeout_time = time(NULL) + timeout;
 
     while(1) {
        addrlen = (socklen_t_equiv)sizeof(sockaddr_union);
-       connected_socket = accept(server_socket,
+       connected_socket = interruptible_accept(server_socket,
                                  (struct sockaddr *)&addr,
-                                 &addrlen);
+                                 &addrlen, stream_accept_prolong,
+                                 &timeout_time);
        if(connected_socket < 0) {
+           if (errno == 0) {
+               g_debug(plural(_("stream_accept: timeout after %d second"),
+                              _("stream_accept: timeout after %d seconds"),
+                             timeout),
+                       timeout);
+               errno = ETIMEDOUT;
+               return -1;
+           }
            break;
        }
        g_debug(_("stream_accept: connection from %s"),
index dcb8b92a097d122df6489d030032b8dc815678a8..153d6c73141829dbc1b9aedc9f8c507e75d97708 100644 (file)
@@ -1,2 +1,2 @@
-#define BUILT_REV "3096"
-#define BUILT_BRANCH "3_1_0"
+#define BUILT_REV "3545"
+#define BUILT_BRANCH "3_2"
index bc24018b482557b766732ce1925d3bbb3066816d..30963555d25f80171edd43a99c1bd1446737bb76 100644 (file)
@@ -24,6 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 
+#include "amanda.h"
 #include "timestamp.h"
 #include "conffile.h"
 #include <glib.h>
index 1a812013b77dd2f3cb50d359b8369614bc29739b..9ca0b4db604d249ffdbd737e614b49c60cc706df 100644 (file)
@@ -322,6 +322,56 @@ bind_portrange(
     return -1;
 }
 
+int
+interruptible_accept(
+    int sock,
+    struct sockaddr *addr,
+    socklen_t *addrlen,
+    gboolean (*prolong)(gpointer data),
+    gpointer prolong_data)
+{
+    SELECT_ARG_TYPE readset;
+    struct timeval tv;
+    int nfound;
+
+    if (sock < 0 || sock >= FD_SETSIZE) {
+       g_debug("interruptible_accept: bad socket %d", sock);
+       return EBADF;
+    }
+
+    memset(&readset, 0, SIZEOF(readset));
+
+    while (1) {
+       if (!prolong(prolong_data)) {
+           errno = 0;
+           return -1;
+       }
+
+       FD_ZERO(&readset);
+       FD_SET(sock, &readset);
+
+       /* try accepting for 1s */
+       memset(&tv, 0, SIZEOF(tv));
+       tv.tv_sec = 1;
+
+       nfound = select(sock+1, &readset, NULL, NULL, &tv);
+       if (nfound < 0) {
+           return -1;
+       } else if (nfound == 0) {
+           continue;
+       } else if (!FD_ISSET(sock, &readset)) {
+           g_debug("interruptible_accept: select malfunction");
+           errno = EBADF;
+           return -1;
+       } else {
+           int rv = accept(sock, addr, addrlen);
+           if (rv < 0 && errno == EAGAIN)
+               continue;
+           return rv;
+       }
+    }
+}
+
 /*
  * Writes out the entire iovec
  */
@@ -539,7 +589,7 @@ split_quoted_strings(
     result = g_new0(char *, strs->len + 1);
     memmove(result, strs->pdata, sizeof(char *) * strs->len);
 
-    g_ptr_array_free(strs, FALSE); /* FALSE => don't free strings */
+    g_ptr_array_free(strs, TRUE); /* TRUE => free pdata, strings are not freed */
     g_free(local);
 
     return result;
@@ -699,6 +749,66 @@ cleanup:
     return ret;
 }
 
+/* Helper for parse_braced_component; this will turn a single element array
+ * matching /^\d+\.\.\d+$/ into a sequence of numbered array elements. */
+static GPtrArray *
+expand_braced_sequence(GPtrArray *arr)
+{
+    char *elt, *p;
+    char *l, *r;
+    int ldigits, rdigits, ndigits;
+    guint64 start, end;
+    gboolean leading_zero;
+
+    /* check whether the element matches the pattern */
+    /* expand last element of the array only */
+    elt = g_ptr_array_index(arr, arr->len-1);
+    ldigits = 0;
+    for (l = p = elt; *p && g_ascii_isdigit(*p); p++)
+       ldigits++;
+    if (ldigits == 0)
+       return arr;
+    if (*(p++) != '.')
+       return arr;
+    if (*(p++) != '.')
+       return arr;
+    rdigits = 0;
+    for (r = p; *p && g_ascii_isdigit(*p); p++)
+       rdigits++;
+    if (rdigits == 0)
+       return arr;
+    if (*p)
+       return arr;
+
+    /* we have a match, so extract start and end */
+    start = g_ascii_strtoull(l, NULL, 10);
+    end = g_ascii_strtoull(r, NULL, 10);
+    leading_zero = *l == '0';
+    ndigits = MAX(ldigits, rdigits);
+    if (start > end)
+       return arr;
+
+    /* sanity check.. */
+    if (end - start > 100000)
+       return arr;
+
+    /* remove last from the array */
+    g_ptr_array_remove_index(arr, arr->len - 1);
+
+    /* Add new elements */
+    while (start <= end) {
+       if (leading_zero) {
+           g_ptr_array_add(arr, g_strdup_printf("%0*ju",
+                       ndigits, (uintmax_t)start));
+       } else {
+           g_ptr_array_add(arr, g_strdup_printf("%ju", (uintmax_t)start));
+       }
+       start++;
+    }
+
+    return arr;
+}
+
 /* Helper for expand_braced_alternates; returns a list of un-escaped strings
  * for the first "component" of str, where a component is a plain string or a
  * brace-enclosed set of alternatives.  str is pointing to the first character
@@ -725,6 +835,7 @@ parse_braced_component(char **str)
            if (*p == '}' || *p == ',') {
                *c = '\0';
                g_ptr_array_add(result, g_strdup(current));
+               result = expand_braced_sequence(result);
                current = ++c;
 
                if (*p == '}')
@@ -1298,23 +1409,15 @@ base64_decode_alloc_string(
 }
 
 
-/* A GHFunc (callback for g_hash_table_foreach) */
-void count_proplist(
-    gpointer key_p G_GNUC_UNUSED,
-    gpointer value_p,
-    gpointer user_data_p)
-{
-    property_t *value_s = value_p;
-    int    *nb = user_data_p;
-    GSList  *value;
-
-    for(value=value_s->values; value != NULL; value = value->next) {
-       (*nb)++;
-    }
-}
-
-/* A GHFunc (callback for g_hash_table_foreach) */
-void proplist_add_to_argv(
+/* A GHFunc (callback for g_hash_table_foreach),
+ * Store a property and it's value in an ARGV.
+ *
+ * @param key_p: (char *) property name.
+ * @param value_p: (GSList *) property values list.
+ * @param user_data_p: (char ***) pointer to ARGV.
+ */
+static void
+proplist_add_to_argv(
     gpointer key_p,
     gpointer value_p,
     gpointer user_data_p)
@@ -1341,6 +1444,14 @@ void proplist_add_to_argv(
     amfree(qprop);
 }
 
+void
+property_add_to_argv(
+    GPtrArray  *argv_ptr,
+    GHashTable *proplist)
+{
+    g_hash_table_foreach(proplist, &proplist_add_to_argv, argv_ptr);
+}
+
 
 /*
  * Process parameters
index 53082b6708b63de1ac73c988bcfa26dc3500ee4a..8c7ea449a2866a39ba57d4e105bab3fa4a9211e9 100644 (file)
@@ -62,6 +62,15 @@ int  connect_portrange(sockaddr_union *, in_port_t, in_port_t, char *,
 int    bind_portrange(int, sockaddr_union *, in_port_t, in_port_t,
                       char *);
 
+/* just like an accept() call, but periodically calling PROLONG(PROLONG_DATA) and
+ * returning -1 with errno set to 0 if PROLONG returns false.  Note that the socket
+ * need not be configured as non-blocking.
+ *
+ * Other arguments are just like for accept(2).
+ */
+int    interruptible_accept(int sock, struct sockaddr *addr, socklen_t *addrlen,
+           gboolean (*prolong)(gpointer data), gpointer prolong_data);
+
 ssize_t        full_writev(int, struct iovec *, int);
 
 char * construct_datestamp(time_t *t);
@@ -119,17 +128,8 @@ char * hexdecode_string(const char *str, GError **err);
 int     copy_file(char *dst, char *src, char **errmsg);
 
 /* These two functions handle "braced alternates", which is a syntax borrowed,
- * partially, from shells.  Comma-separated strings enclosed in curly braces
- * expand into multiple alternatives for the entire string.
- * For example:
- *
- *   "{foo,bar,bat}" -> [ "foo", "bar", "bat" ]
- *   "foo{1,2}bar" -> [ "foo1bar", "foo2bar" ]
- *   "foo{1\,2,3}bar" -> [ "foo1,2bar", "foo3bar" ]
- *   "{a,b}-{1,2}" -> [ "a-1", "a-2", "b-1", "b-2" ]
- *
- * Note that nested braces are not processed.  Braces, commas, and backslashes
- * may be escaped with backslashes.  Returns NULL on invalid strings.
+ * partially, from shells.  See perl/Amanda/Util.pod for a full description of
+ * the syntax they support.
  */
 GPtrArray * expand_braced_alternates(char * source);
 char * collapse_braced_alternates(GPtrArray *source);
@@ -184,10 +184,10 @@ int compare_possibly_null_strings(const char * a, const char * b);
  * not NULL.
  *
  * @param hostname: the hostname to start with
+ * @param socktype: the socket type (SOCK_DGRAM or SOCK_STREAM)
  * @param res: (result) if not NULL, the results from getaddrinfo()
- * @param canonname: (result) if not NULL, the canonical name of the host
- * @returns: newly allocated canonical hostname, or NULL if no
- * canonical hostname was available.
+ * @param canonname: (result) if not NULL, the newly-allocated canonical name of the host
+ * @returns: 0 on success, otherwise a getaddrinfo result (for use with gai_strerror)
  */
 int resolve_hostname(const char *hostname, int socktype,
                     struct addrinfo **res, char **canonname);
@@ -358,29 +358,6 @@ void       add_history(const char *line);
 
 char *base64_decode_alloc_string(char *);
 
-/* A GHFunc (callback for g_hash_table_foreach),
- * Count the number of properties.
- *
- * @param key_p: (char *) property name.
- * @param value_p: (GSList *) property values list.
- * @param user_data_p: (int *) count are added to that value.
- */
-void count_proplist(gpointer key_p,
-                   gpointer value_p,
-                   gpointer user_data_p);
-
-/* A GHFunc (callback for g_hash_table_foreach),
- * Store a property and it's value in an ARGV.
- *
- * @param key_p: (char *) property name.
- * @param value_p: (GSList *) property values list.
- * @param user_data_p: (char ***) pointer to ARGV.
- */
-void proplist_add_to_argv(gpointer key_p,
-                         gpointer value_p,
-                         gpointer user_data_p);
-
-
 /* Inform the OpenBSD pthread library about the high-numbered file descriptors
  * that an amandad service inherits.  This won't be necessary once the new
  * threading library is availble (OpenBSD 5.0?), but won't hurt anyway.  See the
@@ -391,6 +368,13 @@ void openbsd_fd_inform(void);
 #define openbsd_fd_inform()
 #endif
 
+/* Add all properties to an ARGV
+ *
+ * @param argvchild: Pointer to the ARGV.
+ * @param proplist: The property list
+ */
+void property_add_to_argv(GPtrArray *argv_ptr, GHashTable *proplist);
+
 /* Print the argv_ptr with g_debug()
  *
  * @param argv_ptr: GPtrArray of an array to print.
index c9234b60a1e484f1863b4a68de7a2c9571068945..66fecb95d7fc695561f4107133a0e82bc8381cb5 100644 (file)
@@ -55,7 +55,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -83,7 +82,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -96,10 +94,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -113,7 +115,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -126,10 +130,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -141,21 +148,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -208,7 +219,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -228,10 +239,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -287,78 +295,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -369,12 +432,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -389,17 +481,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -408,60 +504,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -469,13 +624,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -484,9 +645,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -522,7 +686,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -531,7 +694,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -539,19 +701,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -577,47 +762,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -625,6 +866,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -647,19 +889,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -669,13 +913,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -719,6 +960,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -751,20 +993,20 @@ top_srcdir = @top_srcdir@
 EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \
        missing mkinstalldirs set_full_version amanda/amplot.m4 \
        amanda/bsd-security.m4 amanda/bsdtcp-security.m4 \
-       amanda/bsdudp-security.m4 amanda/changer.m4 \
-       amanda/components.m4 amanda/compress.m4 amanda/config.m4 \
-       amanda/debugging.m4 amanda/defaults.m4 amanda/devprefix.m4 \
-       amanda/dirs.m4 amanda/documentation.m4 amanda/dumpers.m4 \
+       amanda/bsdudp-security.m4 amanda/components.m4 \
+       amanda/compress.m4 amanda/config.m4 amanda/debugging.m4 \
+       amanda/defaults.m4 amanda/devprefix.m4 amanda/dirs.m4 \
+       amanda/documentation.m4 amanda/dumpers.m4 \
        amanda/dvdrw-device.m4 amanda/flags.m4 amanda/flock.m4 \
        amanda/funcs.m4 amanda/getfsent.m4 amanda/i18n.m4 \
        amanda/ipv6.m4 amanda/krb5-security.m4 amanda/lfs.m4 \
        amanda/libs.m4 amanda/ndmp-device.m4 amanda/net.m4 \
        amanda/progs.m4 amanda/ps.m4 amanda/readdir.m4 \
        amanda/readline.m4 amanda/rsh-security.m4 amanda/s3-device.m4 \
-       amanda/shmem.m4 amanda/socklen_t_equiv.m4 \
-       amanda/ssh-security.m4 amanda/summary.m4 amanda/swig.m4 \
-       amanda/syshacks.m4 amanda/tape.m4 amanda/types.m4 \
-       amanda/userid.m4 amanda/version.m4 gettext-macros/codeset.m4 \
+       amanda/socklen_t_equiv.m4 amanda/ssh-security.m4 \
+       amanda/summary.m4 amanda/swig.m4 amanda/syshacks.m4 \
+       amanda/tape.m4 amanda/types.m4 amanda/userid.m4 \
+       amanda/version.m4 gettext-macros/codeset.m4 \
        gettext-macros/gettext.m4 gettext-macros/glibc21.m4 \
        gettext-macros/glibc2.m4 gettext-macros/iconv.m4 \
        gettext-macros/intdiv0.m4 gettext-macros/intmax.m4 \
@@ -780,31 +1022,35 @@ EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \
        gettext-macros/ulonglong.m4 gettext-macros/wchar_t.m4 \
        gettext-macros/wint_t.m4 gettext-macros/xsize.m4 \
        gnulib/00gnulib.m4 gnulib/alloca.m4 gnulib/arpa_inet_h.m4 \
-       gnulib/base64.m4 gnulib/btowc.m4 gnulib/codeset.m4 \
-       gnulib/errno_h.m4 gnulib/extensions.m4 gnulib/float_h.m4 \
-       gnulib/fseeko.m4 gnulib/fsusage.m4 gnulib/ftello.m4 \
-       gnulib/ftruncate.m4 gnulib/getaddrinfo.m4 gnulib/getopt.m4 \
-       gnulib/gettimeofday.m4 gnulib/glibc21.m4 \
+       gnulib/asm-underscore.m4 gnulib/base64.m4 gnulib/btowc.m4 \
+       gnulib/codeset.m4 gnulib/dos.m4 gnulib/environ.m4 \
+       gnulib/errno_h.m4 gnulib/extensions.m4 gnulib/fcntl-o.m4 \
+       gnulib/float_h.m4 gnulib/fseeko.m4 gnulib/fsusage.m4 \
+       gnulib/ftello.m4 gnulib/ftruncate.m4 gnulib/getaddrinfo.m4 \
+       gnulib/getopt.m4 gnulib/gettimeofday.m4 gnulib/glibc21.m4 \
        gnulib/gnulib-cache.m4 gnulib/gnulib-common.m4 \
        gnulib/gnulib-comp.m4 gnulib/gnulib-tool.m4 gnulib/hostent.m4 \
-       gnulib/include_next.m4 gnulib/inet_ntop.m4 gnulib/intmax_t.m4 \
-       gnulib/inttypes_h.m4 gnulib/lib-ld.m4 gnulib/lib-link.m4 \
-       gnulib/lib-prefix.m4 gnulib/localcharset.m4 \
-       gnulib/locale-fr.m4 gnulib/locale-ja.m4 gnulib/locale-zh.m4 \
-       gnulib/lock.m4 gnulib/longlong.m4 gnulib/lseek.m4 \
-       gnulib/lstat.m4 gnulib/malloc.m4 gnulib/mbrtowc.m4 \
-       gnulib/mbsinit.m4 gnulib/mbstate_t.m4 gnulib/mkdtemp.m4 \
+       gnulib/include_next.m4 gnulib/inet_ntop.m4 gnulib/inet_pton.m4 \
+       gnulib/intmax_t.m4 gnulib/inttypes_h.m4 gnulib/langinfo_h.m4 \
+       gnulib/lib-ld.m4 gnulib/lib-link.m4 gnulib/lib-prefix.m4 \
+       gnulib/localcharset.m4 gnulib/locale-fr.m4 gnulib/locale-ja.m4 \
+       gnulib/locale-zh.m4 gnulib/lock.m4 gnulib/longlong.m4 \
+       gnulib/lseek.m4 gnulib/lstat.m4 gnulib/malloc.m4 \
+       gnulib/mbrtowc.m4 gnulib/mbsinit.m4 gnulib/mbstate_t.m4 \
+       gnulib/memchr.m4 gnulib/mkdtemp.m4 gnulib/mmap-anon.m4 \
        gnulib/multiarch.m4 gnulib/netdb_h.m4 gnulib/netinet_in_h.m4 \
-       gnulib/onceonly.m4 gnulib/physmem.m4 gnulib/printf.m4 \
-       gnulib/regex.m4 gnulib/safe-read.m4 gnulib/safe-write.m4 \
-       gnulib/servent.m4 gnulib/size_max.m4 gnulib/snprintf.m4 \
-       gnulib/socklen.m4 gnulib/sockpfaf.m4 gnulib/ssize_t.m4 \
-       gnulib/stdbool.m4 gnulib/stdint_h.m4 gnulib/stdint.m4 \
-       gnulib/stdio_h.m4 gnulib/stdlib_h.m4 gnulib/sys_socket_h.m4 \
-       gnulib/sys_stat_h.m4 gnulib/sys_time_h.m4 gnulib/tempname.m4 \
-       gnulib/threadlib.m4 gnulib/unistd_h.m4 gnulib/vasnprintf.m4 \
-       gnulib/visibility.m4 gnulib/wchar.m4 gnulib/wchar_t.m4 \
-       gnulib/wcrtomb.m4 gnulib/wctype.m4 gnulib/wint_t.m4 \
+       gnulib/nl_langinfo.m4 gnulib/onceonly.m4 gnulib/physmem.m4 \
+       gnulib/printf.m4 gnulib/regex.m4 gnulib/safe-read.m4 \
+       gnulib/safe-write.m4 gnulib/servent.m4 gnulib/size_max.m4 \
+       gnulib/snprintf.m4 gnulib/socklen.m4 gnulib/sockpfaf.m4 \
+       gnulib/ssize_t.m4 gnulib/stat.m4 gnulib/stdbool.m4 \
+       gnulib/stddef_h.m4 gnulib/stdint_h.m4 gnulib/stdint.m4 \
+       gnulib/stdio_h.m4 gnulib/stdlib_h.m4 gnulib/string_h.m4 \
+       gnulib/sys_socket_h.m4 gnulib/sys_stat_h.m4 \
+       gnulib/sys_time_h.m4 gnulib/tempname.m4 gnulib/threadlib.m4 \
+       gnulib/time_h.m4 gnulib/unistd_h.m4 gnulib/vasnprintf.m4 \
+       gnulib/warn-on-use.m4 gnulib/wchar_h.m4 gnulib/wchar_t.m4 \
+       gnulib/wcrtomb.m4 gnulib/wctype_h.m4 gnulib/wint_t.m4 \
        gnulib/write.m4 gnulib/xsize.m4 macro-archive/ac_define_dir.m4 \
        macro-archive/ac_perl_module_version.m4 \
        macro-archive/ac_prog_perl_version.m4 \
diff --git a/config/amanda/changer.m4 b/config/amanda/changer.m4
deleted file mode 100644 (file)
index 3d26325..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-# SYNOPSIS
-#
-#   AMANDA_SETUP_CHANGER
-#
-# OVERVIEW
-#
-#   Set up for changers.  This first checks the availability of several
-#   changer-related headers, then, based on those results, tries to 
-#   compile some test programs for each supported changer API.  It finishes
-#   by defining a series of AM_CONDITIONALS which are all used in
-#   changer-src/Makefile.am.
-#
-#   The macro also searches for chio, chs, mtx, and mcutil, which are used
-#   from various shell scripts in the changer-src/ directory.
-#
-AC_DEFUN([AMANDA_SETUP_CHANGER], [
-    AC_REQUIRE([AMANDA_PROG_CHIO])
-    AC_REQUIRE([AMANDA_PROG_CHS])
-    AC_REQUIRE([AMANDA_PROG_MTX])
-    AC_REQUIRE([AMANDA_PROG_MCUTIL])
-
-    AC_CHECK_HEADERS( \
-       camlib.h \
-       chio.h \
-       linux/chio.h \
-       scsi/sg.h \
-       scsi/scsi_ioctl.h \
-       sys/chio.h \
-       sys/dsreq.h \
-       sys/mtio.h \
-       sys/scarray.h \
-       sys/gscdds.h \
-       sys/scsi.h \
-       sys/scsiio.h \
-       sys/scsi/impl/uscsi.h \
-       sys/scsi/scsi/ioctl.h, \
-       [], [], [AC_INCLUDES_DEFAULT])
-
-    #
-    # chio support
-    #
-    if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
-       AC_CACHE_CHECK([for HP/UX-like scsi changer support],
-           amanda_cv_hpux_scsi_chio,
-           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/scsi.h>
-    ]], [[
-           static struct element_addresses changer_info;
-           int i = SIOC_ELEMENT_ADDRESSES;
-           int j = SIOC_ELEMENT_STATUS;
-           int k = SIOC_MOVE_MEDIUM;
-    ]])],[amanda_cv_hpux_scsi_chio=yes],[amanda_cv_hpux_scsi_chio=no])])
-       if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then
-           WANT_SCSI_HPUX=yes
-           WANT_CHG_SCSI=yes
-       fi
-    fi
-
-    #
-    # Linux SCSI based on ioctl
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then 
-           AC_CACHE_CHECK([for Linux like scsi support (ioctl)],
-           amanda_cv_linux_scsi,
-           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <scsi/scsi_ioctl.h>
-#include <sys/mtio.h>
-    ]], [[
-           int device;
-           char *Command;
-           ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command);
-    ]])],[amanda_cv_linux_scsi=yes],[amanda_cv_linux_scsi=no])])
-    fi
-
-    #
-    # Linux SCSI based on sg
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_scsi_sg_h" = x"yes"; then 
-           AC_CACHE_CHECK([for Linux like scsi support (sg)],
-           amanda_cv_linux_sg_scsi,
-           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <scsi/sg.h>
-#include <sys/mtio.h>
-    ]], [[
-           int device;
-           struct sg_header *psg_header;
-           char *buffer;
-           write(device, buffer, 1);
-    ]])],[amanda_cv_linux_sg_scsi=yes],[amanda_cv_linux_sg_scsi=no])])
-    fi
-
-    if test x"$amanda_cv_linux_scsi" = x"yes" ||
-     test x"$amanda_cv_linux_sg_scsi" = x"yes";then
-           WANT_SCSI_LINUX=yes
-           WANT_CHG_SCSI=yes
-    fi
-
-    #
-    # HP-UX SCSI
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_sys_scsi_h" = x"yes"; then 
-           AC_CACHE_CHECK([for HP-UX like scsi support],
-           amanda_cv_hpux_scsi,
-           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <sys/scsi.h>
-#include <sys/mtio.h>
-    ]], [[
-           int device;
-           char *Command;
-           ioctl(device, SIOC_IO, Command);
-    ]])],[amanda_cv_hpux_scsi=yes],[amanda_cv_hpux_scsi=no])])
-           if test x"$amanda_cv_hpux_scsi" = x"yes";then
-                   WANT_SCSI_HPUX_NEW=yes
-                   WANT_CHG_SCSI=yes
-                   WANT_CHG_SCSI_CHIO=yes
-           fi
-    fi
-
-    #
-    # IRIX SCSI
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then 
-           AC_CACHE_CHECK([for Irix like scsi support],
-           amanda_cv_irix_scsi,
-           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/dsreq.h>
-#include <sys/mtio.h>
-    ]], [[
-           int device=1;
-           char Command;
-           ioctl(device, DS_ENTER, &Command);
-    ]])],[amanda_cv_irix_scsi=yes],[amanda_cv_irix_scsi=no])])
-           if test x"$amanda_cv_irix_scsi" = x"yes";then
-                   WANT_SCSI_IRIX=yes
-                   WANT_CHG_SCSI=yes
-           fi
-    fi
-
-    #
-    # Solaris  SCSI
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then 
-           AC_CACHE_CHECK([for Solaris-like scsi support],
-           amanda_cv_solaris_scsi,
-           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/scsi/impl/uscsi.h>
-#include <sys/mtio.h>
-    ]], [[
-           int device;
-           char *Command;
-           ioctl(device, USCSICMD, Command);
-    ]])],[amanda_cv_solaris_scsi=yes],[amanda_cv_solaris_scsi=no])])
-           if test x"$amanda_cv_solaris_scsi" = x"yes";then
-                   WANT_SCSI_SOLARIS=yes
-                   WANT_CHG_SCSI=yes
-           fi
-    fi
-
-    #
-    # AIX SCSI
-    #
-    if test x"$ac_cv_header_sys_tape_h" = x"yes" &&
-       test x"$ac_cv_header_sys_scarray_h" = x"yes" &&
-       test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then 
-           AC_CACHE_CHECK([for AIX like scsi support],
-           amanda_cv_aix_scsi,
-           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/scarray.h>
-#include <sys/tape.h>
-    ]], [[
-           int device;
-           char *Command;
-           ioctl(device, STIOCMD, Command);
-    ]])],[amanda_cv_aix_scsi=yes],[amanda_cv_aix_scsi=no])])
-           if test x"$amanda_cv_aix_scsi" = x"yes";then
-                   WANT_SCSI_AIX=yes
-                   WANT_CHG_SCSI=yes
-           fi
-    fi
-    #
-    # BSD CAM SCSI
-    #
-    if test x"$ac_cv_header_cam_cam_h" = x"yes";then
-           AC_CACHE_CHECK([for CAM like scsi support],
-           amanda_cv_cam_scsi,
-           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-# include <fcntl.h>
-# include <cam/cam.h>
-# include <cam/cam_ccb.h>
-# include <cam/scsi/scsi_message.h>
-# include <cam/scsi/scsi_pass.h>
-# include <camlib.h>
-    ]], [[
-           struct cam_device *curdev;
-
-           curdev = cam_open_pass("", O_RDWR, NULL);
-    ]])],[amanda_cv_cam_scsi=yes],[amanda_cv_cam_scsi=no])])
-           if test x"$amanda_cv_cam_scsi" = x"yes";then
-                   WANT_SCSI_CAM=yes
-                   WANT_CHG_SCSI=yes
-                   AC_CHECK_LIB(cam,main)
-           fi
-    fi
-
-
-    #
-    # BSD SCSI
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then
-       AC_CACHE_CHECK([for BSD like scsi support],
-       amanda_cv_bsd_scsi,
-       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/scsiio.h>
-#include <sys/mtio.h>
-    ]], [[
-       int device=1;
-       char Command;
-       ioctl(device, SCIOCCOMMAND, &Command);
-    ]])],[amanda_cv_bsd_scsi=yes],[amanda_cv_bsd_scsi=no])])
-       if test x"$amanda_cv_bsd_scsi" = x"yes";then
-          WANT_SCSI_BSD=yes
-          WANT_CHG_SCSI=yes
-       fi
-    fi
-
-    # Do not build chg-scsi-chio if we cannot find the needed support
-    # include files for the SCSI interfaces
-    # chio.h and sys/chio.h are chio based systems
-    if test x"$ac_cv_header_chio_h" = x"yes" ||
-       test x"$ac_cv_header_linux_chio_h" = x"yes" ||
-       test x"$ac_cv_header_sys_chio_h" = x"yes"; then
-       # chg-scsi does not support FreeBSD 3.0's chio.h; it became backward
-       # incompatible with the introduction of camlib.h
-       if test x"$ac_cv_header_camlib_h" != x"yes"; then
-        WANT_SCSI_CHIO=yes
-        # prefer to use chg-scsi, unless we already have a driver for that,
-        # in which case set it up as chg-scsi-chio.
-        if test x"$WANT_CHG_SCSI" = x"no"; then
-          WANT_CHG_SCSI=yes
-        else
-          WANT_CHG_SCSI_CHIO=yes
-        fi
-       fi
-    fi
-
-    # scsi-based implementations
-    AM_CONDITIONAL(WANT_CHG_SCSI, test x"$WANT_CHG_SCSI" = x"yes")
-    AM_CONDITIONAL(WANT_SCSI_LINUX, test x"$WANT_SCSI_LINUX" = x"yes")
-    AM_CONDITIONAL(WANT_SCSI_HPUX_NEW, test x"$WANT_SCSI_HPUX_NEW" = x"yes")
-    AM_CONDITIONAL(WANT_SCSI_IRIX, test x"$WANT_SCSI_IRIX" = x"yes")
-    AM_CONDITIONAL(WANT_SCSI_SOLARIS, test x"$WANT_SCSI_SOLARIS" = x"yes")
-    AM_CONDITIONAL(WANT_SCSI_AIX, test x"$WANT_SCSI_AIX" = x"yes")
-    AM_CONDITIONAL(WANT_SCSI_CAM, test x"$WANT_SCSI_CAM" = x"yes")
-    AM_CONDITIONAL(WANT_SCSI_BSD, test x"$WANT_SCSI_BSD" = x"yes")
-
-    # scsi-chio-based implementations
-    AM_CONDITIONAL(WANT_CHG_SCSI_CHIO, test x"$WANT_CHG_SCSI_CHIO" = x"yes")
-    AM_CONDITIONAL(WANT_SCSI_HPUX, test x"$WANT_SCSI_HPUX" = x"yes")
-    AM_CONDITIONAL(WANT_SCSI_CHIO, test x"$WANT_SCSI_CHIO" = x"yes")
-])
index e51a25281fdeb25729b18b389b920dcc7274a9cf..2ec2258edc9d7e845ad0970eb1f1b9cf91efcbe7 100644 (file)
@@ -152,26 +152,30 @@ AC_DEFUN([AMANDA_WITH_TESTING],
 
 # SYNOPSIS
 #
-#   AMANDA_CHECK_SCRIPTS_AT_BUILD
+#   AMANDA_ENABLE_SYNTAX_CHECKS
 #
 # OVERVIEW
 #
-#   Handles the --disable-syntax-checks flag, which un-sets the
-#   CHECK_SCRIPTS_AT_BUILD automake conditional
+#   Handles the --enable-syntax-checks flag, which triggers syntax checks
+#   for most 'make' targets, but causes spurious errors in all but the most
+#   carefully-constructed build environments.
 
 AC_DEFUN([AMANDA_DISABLE_SYNTAX_CHECKS],
 [
     AC_ARG_ENABLE(syntax-checks,
-       AS_HELP_STRING([--disable-syntax-checks],
-           [Do not perform syntax checks when installing]),
+       AS_HELP_STRING([--enable-syntax-checks],
+           [Perform syntax checks when installing - developers only]),
        [
            case "$enableval" in
-               no) CHECK_SCRIPTS_AT_BUILD=false;;
-               *) CHECK_SCRIPTS_AT_BUILD=true;;
+               no) SYNTAX_CHECKS=false;;
+               *)
+                   SYNTAX_CHECKS=true
+                   AMANDA_MSG_WARN([--enable-syntax-checks can cause build failures and should only be used by developers])
+                   ;;
            esac
        ], [
-           CHECK_SCRIPTS_AT_BUILD=true
+           SYNTAX_CHECKS=false
        ])
 
-    AM_CONDITIONAL(CHECK_SCRIPTS_AT_BUILD, $CHECK_SCRIPTS_AT_BUILD)
+    AM_CONDITIONAL(SYNTAX_CHECKS, $SYNTAX_CHECKS)
 ])
index 01673b2b2e6f6389f406447cc0f670f2a87b66ab..cba7971d8feb1d6df66c02ad065fd3079198813c 100644 (file)
@@ -3,7 +3,6 @@ EXTRA_DIST += amanda/amplot.m4
 EXTRA_DIST += amanda/bsd-security.m4
 EXTRA_DIST += amanda/bsdtcp-security.m4
 EXTRA_DIST += amanda/bsdudp-security.m4
-EXTRA_DIST += amanda/changer.m4
 EXTRA_DIST += amanda/components.m4
 EXTRA_DIST += amanda/compress.m4
 EXTRA_DIST += amanda/config.m4
@@ -31,7 +30,6 @@ EXTRA_DIST += amanda/readdir.m4
 EXTRA_DIST += amanda/readline.m4
 EXTRA_DIST += amanda/rsh-security.m4
 EXTRA_DIST += amanda/s3-device.m4
-EXTRA_DIST += amanda/shmem.m4
 EXTRA_DIST += amanda/socklen_t_equiv.m4
 EXTRA_DIST += amanda/ssh-security.m4
 EXTRA_DIST += amanda/summary.m4
index 250a31be876affa7cb4f65173e55e94863504040..9d76979339fee75ad859a4bfcda035484e5b50fe 100644 (file)
@@ -102,11 +102,11 @@ main()
        if test "$amanda_cv_working_ipv6" = yes; then
            WORKING_IPV6=yes
            AC_DEFINE(WORKING_IPV6,1,
-               [Target system has functional IPv6 support])
+               [This system has functional IPv6 support (kernel and compiler)])
        else
            # error out only if the user specifically requested support
            if test x"$amanda_with_ipv6" = x"yes"; then
-               AC_MSG_ERROR([IPv6 support was requested, but it is not working.])
+               AC_MSG_ERROR([IPv6 support was requested, but opening an IPv6 socket failed])
            fi
        fi
     fi
index e22038f5eb94e288f8525568277340ca9a029de6..6e27add4cc9fa5e15e9a3a7f148210bdc284224f 100644 (file)
@@ -100,26 +100,45 @@ AC_DEFUN([AMANDA_CHECK_NET_LIBS], [
 #   "out of the box" on more boxes.
 #
 AC_DEFUN([AMANDA_CHECK_GLIB], [
-    # search for pkg-config, which the glib configuration uses, adding a few
-    # system-specific search paths.
-    AC_PATH_PROG(PKG_CONFIG, pkg-config, [], $LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin)
-
-    case "$host" in
-       sparc-sun-solaris2.8) # Solaris 8
-           # give the linker a runtime search path; pkg-config doesn't supply this.
-           # Users could also specify this with LD_LIBRARY_PATH to both ./configure
-           # and make.  Adding this support here makes straight './configure; make'
-           # "just work" on Solaris 8
-           if test -n "$PKG_CONFIG"; then
-               glib_R_flag=`$PKG_CONFIG glib-2.0 --libs-only-L 2>/dev/null | sed -e 's/-L/-R/g'`
-               LDFLAGS="$LDFLAGS $glib_R_flag"
-           fi
-           ;;
-    esac
+    AC_ARG_VAR(GLIB_CFLAGS, [CFLAGS to build with glib; disables use of pkg-config])
+    AC_ARG_VAR(GLIB_LIBS, [libraries to build with glib; disables use of pkg-config])
+    AC_ARG_VAR(GLIB_GENMARSHAL, [genmarshal binary to use with glib; disables use of pkg-config])
+    AC_ARG_VAR(GOBJECT_QUERY, [gobject_query binary to use with glib; disables use of pkg-config])
+    AC_ARG_VAR(GLIB_MKENUMS, [mkenums binary to use with glib; disables use of pkg-config])
+
+    # if any of the precious variables are set, disable the pkg-config run
+    explicit_glib=no
+    test x"$GLIB_CFLAGS" = x"" || explicit_glib=yes
+    test x"$GLIB_LIBS" = x"" || explicit_glib=yes
+    test x"$GLIB_GENMARSHAL" = x"" || explicit_glib=yes
+    test x"$GOBJECT_QUERY" = x"" || explicit_glib=yes
+    test x"$GLIB_MKENUMS" = x"" || explicit_glib=yes
+
+    if test x"$explicit_glib" = x"no"; then
+       # search for pkg-config, which the glib configuration uses, adding a few
+       # system-specific search paths.
+       AC_PATH_PROG(PKG_CONFIG, pkg-config, [], $LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin)
+
+       case "$host" in
+           sparc-sun-solaris2.8) # Solaris 8
+               # give the linker a runtime search path; pkg-config doesn't supply this.
+               # Users could also specify this with LD_LIBRARY_PATH to both ./configure
+               # and make.  Adding this support here makes straight './configure; make'
+               # "just work" on Solaris 8
+               if test -n "$PKG_CONFIG"; then
+                   glib_R_flag=`$PKG_CONFIG glib-2.0 --libs-only-L 2>/dev/null | sed -e 's/-L/-R/g'`
+                   LDFLAGS="$LDFLAGS $glib_R_flag"
+               fi
+               ;;
+       esac
+
+       AM_PATH_GLIB_2_0(2.2.0,,[
+           AC_MSG_ERROR(glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help)
+       ], gmodule gobject gthread)
+    else
+       AC_MSG_ERROR(explicit glib)
+    fi
 
-    AM_PATH_GLIB_2_0(2.2.0,,[
-       AC_MSG_ERROR(glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help)
-    ], gmodule gobject gthread)
     # GLIB_CPPFLAGS is not set by autoconf, yet GLIB_CFLAGS contains what GLIB_CPPFLAGS should contain.
     AMANDA_ADD_CPPFLAGS($GLIB_CFLAGS)
     AMANDA_ADD_LIBS($GLIB_LIBS)
index 917903b074cad82c48869ab914a0bab371f02ae8..a20cb5c373d3c9dc13770ee78ec86c8b9a5bf093 100644 (file)
@@ -64,8 +64,8 @@ AC_DEFUN([AMANDA_WITH_REUSEPORTS], [
 #
 AC_DEFUN([AMANDA_WITH_PORTRANGES], [
     AC_ARG_WITH(low-tcpportrange,
-       AS_HELP_STRING([--with-low-tcpportrange=low/high],
-           [bind reserved TCP server sockets to ports within this range (default: unlimited)]),
+[  --with-low-tcpportrange=low,high
+                          bind reserved TCP server sockets to ports within],
        [ LOW_TCPPORTRANGE="$withval" ],
        [ LOW_TCPPORTRANGE=unlimited ])
      
@@ -89,9 +89,10 @@ AC_DEFUN([AMANDA_WITH_PORTRANGES], [
  * reserved TCP port numbers sockets should be bound to. (mainly for amrecover) ])
     fi
 
+    dnl note that AS_HELP_STRING cannot handle commas in its argument..
     AC_ARG_WITH(tcpportrange,
-       AS_HELP_STRING([--with-tcpportrange=low/high],
-           [bind unreserved TCP server sockets to ports within this range (default: unlimited)]),
+[  --with-tcpportrange=low,high
+                          bind unreserved TCP server sockets to ports within],
        [ TCPPORTRANGE="$withval" ],
        [ TCPPORTRANGE="unlimited" ])
 
@@ -116,8 +117,8 @@ AC_DEFUN([AMANDA_WITH_PORTRANGES], [
     fi
 
     AC_ARG_WITH(udpportrange,
-       AS_HELP_STRING([--with-udpportrange=low/high],
-           [bind reserved UDP server sockets to ports within this range (default: unlimited)]),
+[  --with-udpportrange=low,high
+                          bind reserved UDP server sockets to ports within],
        [ UDPPORTRANGE="$withval" ],
        [ UDPPORTRANGE="unlimited" ])
     if test x"$UDPPORTRANGE" != x"unlimited"; then
index 695940c179f77c6ae79aee972103b775e3c5bea9..11f98924b06ee0cce9b04c876cb7b328f7bf1182 100644 (file)
@@ -20,7 +20,8 @@
 #
 #   SYSPATH is a list of likely system locations for a file, while
 #   LOCPATH is a list of likely local locations.  The two are combined
-#   in different orders in SYSLOCPATH and LOCSYSPATH.
+#   in different orders in SYSLOCPATH and LOCSYSPATH.  These path differences
+#   are known to affect Solaris 8.
 #
 AC_DEFUN([AMANDA_INIT_PROGS],
 [
@@ -120,36 +121,6 @@ AC_DEFUN([AMANDA_PROG_LINT],
     AC_SUBST(AMLINTFLAGS)
 ])
 
-# SYNOPSIS
-#
-#   AMANDA_PROG_GNUPLOT
-#
-# OVERVIEW
-#
-#   Search for a 'gnuplot' binary, placing the result in the precious 
-#   variable GNUPLOT.  Also accepts --with-gnuplot to indicate the location
-#   of the binary.
-#
-AC_DEFUN([AMANDA_PROG_GNUPLOT],
-[
-    AC_REQUIRE([AMANDA_INIT_PROGS])
-
-    AC_ARG_WITH(gnuplot,
-    AS_HELP_STRING([--with-gnuplot=PATH],
-                  [use gnuplot executable at PATH in amplot]),
-       [
-           case "$withval" in
-               y | ye | yes) : ;;
-               n | no) GNUPLOT= ;;
-               *) GNUPLOT="$withval" ;;
-           esac
-       ])
-    AC_PATH_PROG(GNUPLOT,gnuplot,,$LOCSYSPATH)
-
-    AC_ARG_VAR(GNUPLOT, [Location of the 'gnuplot' binary])
-    AC_SUBST(GNUPLOT)
-])
-
 # SYNOPSIS
 #
 #   AMANDA_PROG_LPR
@@ -306,7 +277,7 @@ AC_DEFUN([AMANDA_PROG_MAILER],
 AC_DEFUN([AMANDA_PROG_MT],
 [
     AC_REQUIRE([AMANDA_INIT_PROGS])
-    AC_PATH_PROG(MT,mt,mt,$LOCSYSPATH)
+    AC_PATH_PROG(MT,mt,mt,$SYSLOCPATH)
 
     case "$host" in
        *-hp-*) MT_FILE_FLAG="-t" ;;
@@ -320,30 +291,11 @@ AC_DEFUN([AMANDA_PROG_MT],
 ])
 
 
-AC_DEFUN([AMANDA_PROG_CHIO],
-[
-    AC_REQUIRE([AMANDA_INIT_PROGS])
-    AC_PATH_PROG(CHIO,chio,chio,$LOCSYSPATH)
-])
-
-
-AC_DEFUN([AMANDA_PROG_CHS],
-[
-    AC_REQUIRE([AMANDA_INIT_PROGS])
-    AC_PATH_PROG(CHS,chs,chs,$LOCSYSPATH)
-])
-
-
 AC_DEFUN([AMANDA_PROG_MTX],
 [
     AC_REQUIRE([AMANDA_INIT_PROGS])
     AC_PATH_PROG(MTX,mtx,mtx,$LOCSYSPATH)
-])
-
-AC_DEFUN([AMANDA_PROG_MCUTIL],
-[
-    AC_REQUIRE([AMANDA_INIT_PROGS])
-    AC_PATH_PROG(MCUTIL,mcutil,mcutil,$LOCSYSPATH)
+    AC_ARG_VAR([MTX], [Path to the 'mtx' binary])
 ])
 
 AC_DEFUN([AMANDA_PROG_PCAT],
@@ -369,7 +321,8 @@ AC_DEFUN([AMANDA_PROG_SWIG],
     AC_ARG_VAR([SWIG], [Path to the 'swig' binary (developers only)])
     # 1.3.32 introduces a change in the way empty strings are handled (old versions
     # returned undef in Perl, while new versions return an empty Perl string)
-    AC_PROG_SWIG([1.3.32])
+    # 1.3.39 is required for the %begin block
+    AC_PROG_SWIG([1.3.39])
 ])
 
 AC_DEFUN([AMANDA_PROG_AR],
@@ -401,8 +354,22 @@ AC_DEFUN([AMANDA_PROG_RPCGEN],
 [
     AC_REQUIRE([AMANDA_INIT_PROGS])
     AC_PATH_PROG(RPCGEN,rpcgen,,$LOCSYSPATH)
+])
 
-    # rpcgen rules (which only appear in ndmp-src) are disabled completely
-    # on systems where rpcgen is not available
-    AM_CONDITIONAL([HAVE_RPCGEN], [test "x$RPCGEN" != "x"])
+AC_DEFUN([AMANDA_PROG_LEX],
+[
+    AC_REQUIRE([AM_PROG_LEX])
+    AC_REQUIRE([AMANDA_PROG_GREP])
+    if test x"$LEX" != x""; then
+       AC_MSG_CHECKING([whether lex is broken Solaris (SGU) lex])
+       $LEX -V < /dev/null >/dev/null 2>conftest.out
+       if grep SGU conftest.out >/dev/null; then
+           AC_MSG_RESULT([yes - disabled (set LEX=/path/to/lex to use a specific binary)])
+           LEX='echo no lex equivalent available; false'
+       else
+           AC_MSG_RESULT([no])
+       fi
+       rm conftest.out
+    fi
 ])
+
diff --git a/config/amanda/shmem.m4 b/config/amanda/shmem.m4
deleted file mode 100644 (file)
index d620e5d..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-# SYNOPSIS
-#
-#   AMANDA_FUNC_SHM_ARG_TYPE
-#
-# OVERVIEW
-#
-#   Determine the type of the second argument to shmdt/shmat, defining
-#   that type (without the *) in SHM_ARG_TYPE.
-#
-AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE], [
-       AC_CHECK_HEADERS(
-           sys/types.h \
-           sys/ipc.h \
-           sys/shm.h \
-       )
-
-       AC_CACHE_CHECK(
-           [for shmdt() argument type],
-           amanda_cv_shmdt_arg_type,
-           [
-               if test "$ac_cv_func_shmget" = yes; then
-                   cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_IPC_H
-# include <sys/ipc.h>
-#endif
-#ifdef HAVE_SYS_SHM_H
-# include <sys/shm.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" void *shmat(int, void *, int);
-#else
-void *shmat();
-#endif
-
-int main()
-{
-    int i;
-    return 0;
-}
-EOF
-                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
-                   if test $? = 0; then
-                       amanda_cv_shmdt_arg_type=void
-                   else
-                       amanda_cv_shmdt_arg_type=char
-                   fi
-                   rm -f conftest*
-               else
-                   amanda_cv_shmdt_arg_type=nothing
-               fi
-           ]
-       )
-       AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type,
-           [Define to type of shmget() function argument. ])
-    ]
-)
-
-# SYNOPSIS
-#
-#   AMANDA_CHECK_SHMEM
-#
-# OVERVIEW
-#
-#   Check for shared memory support; checks for the --with-mmap option,
-#   and then ensures that the proper compilation infrastructure is in place
-#   for either mmap or shared memory support.
-#
-#   Defines several HAVE_*_DECL symbols via ICE_CHECK_DECL, as well as 
-#   HAVE_SYSVSHM if shared memory support is discovered.
-#
-AC_DEFUN([AMANDA_CHECK_SHMEM],
-[
-    AC_REQUIRE([AC_HEADER_STDC])
-    AC_ARG_WITH(mmap,
-       AS_HELP_STRING([--with-mmap],
-           [force use of mmap instead of shared memory support]),
-       [
-           case "$FORCE_MMAP" in
-               y | ye | yes | n | no) : ;;
-               *) AC_MSG_ERROR([*** You must not supply an argument to --with-mmap.]) ;;
-           esac
-           FORCE_MMAP=$withval
-       ],
-       [ : ${FORCE_MMAP=no} ]
-    )
-
-
-    AC_CHECK_HEADERS(\
-           sys/shm.h \
-           sys/mman.h \
-    )
-
-    AC_FUNC_MMAP
-
-    AC_CHECK_FUNCS(shmget,
-       [
-           AMANDA_FUNC_SHM_ARG_TYPE
-           case "$FORCE_MMAP" in
-           n | no)
-               AC_DEFINE(HAVE_SYSVSHM,1,
-                   [Define if SysV shared-memory functions are available. ])
-             ;;
-           esac
-       ]
-    )
-    ICE_CHECK_DECL(shmat,sys/types.h sys/ipc.h sys/shm.h)
-    ICE_CHECK_DECL(shmctl,sys/types.h sys/ipc.h sys/shm.h)
-    ICE_CHECK_DECL(shmdt,sys/types.h sys/ipc.h sys/shm.h)
-    ICE_CHECK_DECL(shmget,sys/types.h sys/ipc.h sys/shm.h)
-
-    if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
-       case "$FORCE_MMAP" in
-       n | no)
-           if test "x$ac_cv_func_shmget" != xyes; then
-               AMANDA_MSG_WARN([Neither shmget() nor mmap() found. This system will not support the Amanda server.])
-               NO_SERVER_MODE=true
-           fi
-         ;;
-       y | ye | yes)
-           AMANDA_MSG_WARN([--with-mmap used on a system with no mmap() support.  This system will not support the Amanda server.])
-           NO_SERVER_MODE=true
-         ;;
-       esac
-    fi
-])
index ee579753db5d4ec36d5d8d47f3caf4b5cf11a51f..cdc7f5d81bdbc11edb0cc9ee4e7a0c979f764851 100644 (file)
@@ -14,8 +14,8 @@ AC_DEFUN([AMANDA_SETUP_SWIG],
     AC_REQUIRE([AMANDA_PROG_SWIG])
     AC_REQUIRE([AMANDA_PROG_PERL])
 
-    # If we want cygwin to copy ddl to modules directory.
-    WANT_CYGWIN_COPY_PERL_DLL="false"
+    WANT_CYGWIN_COPY_PERL_DLL=false
+    WANT_MANDATORY_THREAD_CHECK=false
 
     # test for ExtUtils::Embed
     AC_PERL_MODULE_VERSION([ExtUtils::Embed 0.0], [], [
@@ -31,7 +31,7 @@ AC_DEFUN([AMANDA_SETUP_SWIG],
     fi
 
     case "$host" in
-       *freebsd@<:@123456@:>@*) # up to and including FreeBSD 6.*
+       *freebsd@<:@123456@:>@.*) # up to and including FreeBSD 6.*
            # Before 7.0, FreeBSD systems don't include a DT_NEEDS segment in
            # libgthread to automatically pull in the desired threading library.
            # Instead, they assume that any application linking against
@@ -58,15 +58,26 @@ AC_DEFUN([AMANDA_SETUP_SWIG],
            #   http://lists.freebsd.org/pipermail/freebsd-stable/2006-June/026229.html
 
            PERLEXTLIBS="-lpthread"
+           WANT_MANDATORY_THREAD_CHECK=true
            ;;
+
+       *freebsd*) # all FreeBSD not matched above
+           # for all FreeBSD (including 1.0-6.0, above), we want to run the
+           # thread-check rule in perl/Makefile.am to double-check that a Perl
+           # script can call a C extension that uses threads.
+           WANT_MANDATORY_THREAD_CHECK=true
+           ;;
+
        *-pc-cygwin)
            # When need -lperl and the '-L' where it is located,
            # we don't want the DynaLoader.a
            PERLEXTLIBS=`perl -MExtUtils::Embed -e ldopts | sed -e 's/^.*-L/-L/'`
+           # we want cygwin to copy ddl to modules directory.
            WANT_CYGWIN_COPY_PERL_DLL="true";
            ;;
     esac
     AM_CONDITIONAL(WANT_CYGWIN_COPY_PERL_DLL,$WANT_CYGWIN_COPY_PERL_DLL)
+    AM_CONDITIONAL(WANT_MANDATORY_THREAD_CHECK,$WANT_MANDATORY_THREAD_CHECK)
 
     AC_ARG_WITH(perlextlibs,
        AC_HELP_STRING([--with-perlextlibs=libs],[extra LIBS for Perl extensions]),
index e24ff7e65e4a3c9f3cde1396c93cef93db76ec70..e3cdaa17448f5b3a322b20fb081931f1e0b5d8a0 100644 (file)
@@ -95,6 +95,8 @@ AC_DEFUN([AMANDA_SYSHACKS], [
                    ;;
         *-apple-darwin9*) # MacOS X 10.5.* (Leopard)
                    ;;
+        *-apple-darwin10*) # MacOS X 10.6.* (Snow Leopard)
+                   ;;
       *)
                AMANDA_ADD_WARNING(
 [*****
index 896bfaf6ddbf4e556fdea981b2435eeaa8973896..7636c2eefac1f9360fff9e0a23ea8cc015cd6c87 100644 (file)
@@ -18,11 +18,8 @@ AC_DEFUN([AMANDA_WITH_MAXTAPEBLOCKSIZE], [
 #
 # OVERVIEW
 #
-#   Set up for the 'tape' device.  One of the conditionals WANT_TAPE_XENIX,
-#   WANT_TAPE_AIX, WANT_TAPE_UWARE, and WANT_TAPE_POSIX will be true; the
-#   corresponding symbols are also DEFINEd.  Finally, WANT_TAPE_DEVICE is
-#   defined nad AM_CONDITIONAL'd if the tape device should be supported (if
-#   at least one of the backends is available).
+#   Set up for the 'tape' device.  WANT_TAPE_DEVICE is defined and
+#   AM_CONDITIONAL'd if the tape device should be supported.
 #
 #   If 'struct mtget' fields mt_flags, mt_fileno, mt_blkno, mt_dsreg, and 
 #   mt_erreg, the corresponding HAVE_MT_* is DEFINEd.
@@ -55,42 +52,13 @@ AC_DEFUN([AMANDA_TAPE_DEVICE], [
        HAVE_MTIOCTOP=$amanda_cv_HAVE_MTIOCTOP
     )
 
-    # decide which tape device to compile (arranged in such a way that
-    # only one actually gets compiled)
-    case "$host" in
-      *-ibm-aix*) aix_tapeio=yes ;;
-      *-sysv4.2uw2*) uware_tapeio=yes ;;
-      *-sco3.2v5*) xenix_tapeio=yes ;;
-      i386-pc-isc4*) xenix_tapeio=yes ;;
-    esac
-
     # maybe we have no tape device at all (e.g., Mac OS X)?
-    if test -n "$xenix_tapeio" ||
-       test -n "$aix_tapeio" ||
-       test -n "$uware_tapeio" ||
-       test -n "$HAVE_MTIOCTOP"; then
+    if test x"$HAVE_MTIOCTOP" = x"yes"; then
        want_tape_device=yes
        AC_DEFINE(WANT_TAPE_DEVICE, 1, [Define if the tape-device will be built])
     fi
-
-    AM_CONDITIONAL(WANT_TAPE_XENIX, test -n "$xenix_tapeio")
-    AM_CONDITIONAL(WANT_TAPE_AIX, test -n "$aix_tapeio")
-    AM_CONDITIONAL(WANT_TAPE_UWARE, test -n "$uware_tapeio")
-    AM_CONDITIONAL(WANT_TAPE_POSIX, test -n "$HAVE_MTIOCTOP")
     AM_CONDITIONAL(WANT_TAPE_DEVICE, test -n "$want_tape_device")
 
-    if test -n "$xenix_tapeio"; then
-      AC_DEFINE(WANT_TAPE_XENIX,1,[Define on XENIX/ISC. ])
-    fi
-
-    if test -n "$aix_tapeio"; then
-      AC_DEFINE(WANT_TAPE_AIX,1,[Define on AIX. ])
-    fi
-
-    if test -n "$uware_tapeio"; then
-      AC_DEFINE(WANT_TAPE_UWARE,1,[Define on UnixWare. ])
-    fi
-
     #
     # Check for various "mt status" related structure elements.
     #
index 7fa2f1d9cdbf17f6242d3f52a9eba9cd137c580c..adb2ff01864b97a8ff83e154541dc77a0bd0a80c 100644 (file)
@@ -113,7 +113,7 @@ AC_DEFUN([AMANDA_WITH_GROUP],
             esac
         ], [
             AMANDA_MSG_WARN([[no group specified (--with-group) -- using 'backup']])
-           CLIENT_LOGIN=backup
+           SETUID_GROUP=backup
         ]
     )
     AC_SUBST(SETUID_GROUP)
diff --git a/config/arg-nonnull.h b/config/arg-nonnull.h
new file mode 100644 (file)
index 0000000..7e3e2db
--- /dev/null
@@ -0,0 +1,26 @@
+/* A C macro for declaring that specific arguments must not be NULL.
+   Copyright (C) 2009, 2010 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 3 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
+   that the values passed as arguments n, ..., m must be non-NULL pointers.
+   n = 1 stands for the first argument, n = 2 for the second argument etc.  */
+#ifndef _GL_ARG_NONNULL
+# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
+#  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
+# else
+#  define _GL_ARG_NONNULL(params)
+# endif
+#endif
index 586eb018578e68a2aa5b59b2347c0ca14a3db992..e69c1e6633b1ab30b3d654231f25cdf014f8f6df 100644 (file)
@@ -9,10 +9,12 @@
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -70,32 +72,28 @@ do_file=pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'
 DISTCLEANFILES += $(installperms_sh)
 endif
 
-installperms-exec:
-       @installperms="$(INSTALLPERMS_exec)"; \
-       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
+do_installperms=dest=; chown=; chmod=; \
        for cmd in $$installperms; do \
            case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
                dest=*|chown=*|chmod=*) \
                        echo "  ($$cmd)"; eval $$cmd;; \
                *) $(do_file) ;; \
            esac; \
        done
 
+installperms-exec:
+       @installperms="$(INSTALLPERMS_exec)"; \
+       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+       $(do_installperms)
+
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index 64edbc67fab90328d1375be5fd7a22f2806754d4..7d38cf3ea5b5f6eefc73af78e30101ed9bb8edf6 100644 (file)
 %: %.pl $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
-if CHECK_SCRIPTS_AT_BUILD
+if SYNTAX_CHECKS
        @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
                sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
                $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
                rm $@.nouselib; \
+       else \
+               echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
        fi
 endif
 
@@ -109,33 +111,24 @@ CLEANFILES += config.log
 # and we'll need to clean up our generated files for distclean
 DISTCLEANFILES += $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) $(SCRIPTS_INCLUDE)
 
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
 check-perl: $(SCRIPTS_PERL)
        @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
            test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-           if test -n "$(PERL)"; then \
-                   for perlobj in $$SCRIPTS_PERL; do \
-                           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
-                           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
-                           rm $$perlobj.nouselib; \
-                   done; \
-           fi \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
        fi
+if SYNTAX_CHECKS
 check-local: check-perl
+endif
 
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
-       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
-       if test x"$(SKIP_CHECKS)" = x"" && \
-           test -n "$(PERL)"; then \
-               for perlobj in $$SCRIPTS_PERL; do \
-                       $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
-               done; \
-       fi
-installcheck-local: installcheck-perl
-
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
 check-shell: $(SCRIPTS_SHELL)
        @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
@@ -153,7 +146,9 @@ check-shell: $(SCRIPTS_SHELL)
                        echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
        fi
+if SYNTAX_CHECKS
 check-local: check-shell
+endif
 
 # make sure that the sources for all shell and perl scripts get included
 # in the distribution
diff --git a/config/c++defs.h b/config/c++defs.h
new file mode 100644 (file)
index 0000000..0c2fad7
--- /dev/null
@@ -0,0 +1,271 @@
+/* C++ compatible function declaration macros.
+   Copyright (C) 2010 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 3 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _GL_CXXDEFS_H
+#define _GL_CXXDEFS_H
+
+/* The three most frequent use cases of these macros are:
+
+   * For providing a substitute for a function that is missing on some
+     platforms, but is declared and works fine on the platforms on which
+     it exists:
+
+       #if @GNULIB_FOO@
+       # if !@HAVE_FOO@
+       _GL_FUNCDECL_SYS (foo, ...);
+       # endif
+       _GL_CXXALIAS_SYS (foo, ...);
+       _GL_CXXALIASWARN (foo);
+       #elif defined GNULIB_POSIXCHECK
+       ...
+       #endif
+
+   * For providing a replacement for a function that exists on all platforms,
+     but is broken/insufficient and needs to be replaced on some platforms:
+
+       #if @GNULIB_FOO@
+       # if @REPLACE_FOO@
+       #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+       #   undef foo
+       #   define foo rpl_foo
+       #  endif
+       _GL_FUNCDECL_RPL (foo, ...);
+       _GL_CXXALIAS_RPL (foo, ...);
+       # else
+       _GL_CXXALIAS_SYS (foo, ...);
+       # endif
+       _GL_CXXALIASWARN (foo);
+       #elif defined GNULIB_POSIXCHECK
+       ...
+       #endif
+
+   * For providing a replacement for a function that exists on some platforms
+     but is broken/insufficient and needs to be replaced on some of them and
+     is additionally either missing or undeclared on some other platforms:
+
+       #if @GNULIB_FOO@
+       # if @REPLACE_FOO@
+       #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+       #   undef foo
+       #   define foo rpl_foo
+       #  endif
+       _GL_FUNCDECL_RPL (foo, ...);
+       _GL_CXXALIAS_RPL (foo, ...);
+       # else
+       #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
+       _GL_FUNCDECL_SYS (foo, ...);
+       #  endif
+       _GL_CXXALIAS_SYS (foo, ...);
+       # endif
+       _GL_CXXALIASWARN (foo);
+       #elif defined GNULIB_POSIXCHECK
+       ...
+       #endif
+*/
+
+/* _GL_EXTERN_C declaration;
+   performs the declaration with C linkage.  */
+#if defined __cplusplus
+# define _GL_EXTERN_C extern "C"
+#else
+# define _GL_EXTERN_C extern
+#endif
+
+/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
+   declares a replacement function, named rpl_func, with the given prototype,
+   consisting of return type, parameters, and attributes.
+   Example:
+     _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+                                  _GL_ARG_NONNULL ((1)));
+ */
+#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
+  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
+#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
+  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
+
+/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
+   declares the system function, named func, with the given prototype,
+   consisting of return type, parameters, and attributes.
+   Example:
+     _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
+                                  _GL_ARG_NONNULL ((1)));
+ */
+#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
+  _GL_EXTERN_C rettype func parameters_and_attributes
+
+/* _GL_CXXALIAS_RPL (func, rettype, parameters);
+   declares a C++ alias called GNULIB_NAMESPACE::func
+   that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
+   Example:
+     _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+ */
+#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
+  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                                \
+    {                                                         \
+      rettype (*const func) parameters = ::rpl_func;          \
+    }                                                         \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
+   is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
+   except that the C function rpl_func may have a slightly different
+   declaration.  A cast is used to silence the "invalid conversion" error
+   that would otherwise occur.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                                     \
+    {                                                              \
+      rettype (*const func) parameters =                           \
+        reinterpret_cast<rettype(*)parameters>(::rpl_func);        \
+    }                                                              \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS (func, rettype, parameters);
+   declares a C++ alias called GNULIB_NAMESPACE::func
+   that redirects to the system provided function func, if GNULIB_NAMESPACE
+   is defined.
+   Example:
+     _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+ */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+  /* If we were to write
+       rettype (*const func) parameters = ::func;
+     like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
+     better (remove an indirection through a 'static' pointer variable),
+     but then the _GL_CXXALIASWARN macro below would cause a warning not only
+     for uses of ::func but also for uses of GNULIB_NAMESPACE::func.  */
+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                     \
+    {                                              \
+      static rettype (*func) parameters = ::func;  \
+    }                                              \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
+   is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
+   except that the C function func may have a slightly different declaration.
+   A cast is used to silence the "invalid conversion" error that would
+   otherwise occur.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                          \
+    {                                                   \
+      static rettype (*func) parameters =               \
+        reinterpret_cast<rettype(*)parameters>(::func); \
+    }                                                   \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
+   is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
+   except that the C function is picked among a set of overloaded functions,
+   namely the one with rettype2 and parameters2.  Two consecutive casts
+   are used to silence the "cannot find a match" and "invalid conversion"
+   errors that would otherwise occur.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+  /* The outer cast must be a reinterpret_cast.
+     The inner cast: When the function is defined as a set of overloaded
+     functions, it works as a static_cast<>, choosing the designated variant.
+     When the function is defined as a single variant, it works as a
+     reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+    namespace GNULIB_NAMESPACE                                                \
+    {                                                                         \
+      static rettype (*func) parameters =                                     \
+        reinterpret_cast<rettype(*)parameters>(                               \
+          (rettype2(*)parameters2)(::func));                                  \
+    }                                                                         \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIASWARN (func);
+   causes a warning to be emitted when ::func is used but not when
+   GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
+   variants.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIASWARN(func) \
+   _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
+# define _GL_CXXALIASWARN_1(func,namespace) \
+   _GL_CXXALIASWARN_2 (func, namespace)
+/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+   we enable the warning only when not optimizing.  */
+# if !__OPTIMIZE__
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+    _GL_WARN_ON_USE (func, \
+                     "The symbol ::" #func " refers to the system function. " \
+                     "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+     extern __typeof__ (func) func
+# else
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+     _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
+#else
+# define _GL_CXXALIASWARN(func) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
+   causes a warning to be emitted when the given overloaded variant of ::func
+   is used but not when GNULIB_NAMESPACE::func is used.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+   _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
+                        GNULIB_NAMESPACE)
+# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
+   _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
+/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+   we enable the warning only when not optimizing.  */
+# if !__OPTIMIZE__
+#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+    _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
+                         "The symbol ::" #func " refers to the system function. " \
+                         "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+     extern __typeof__ (func) func
+# else
+#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+     _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
+#else
+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+#endif /* _GL_CXXDEFS_H */
index 1167681248e64883d749097fd3b8c38d1b0bdd15..84f417ee8583f47fe1fcc6c665e782fc27f77df1 100644 (file)
    language is requested. */
 #undef ENABLE_NLS
 
+/* Define on systems for which file names may have a so-called `drive letter'
+   prefix, define this to compute the length of that prefix, including the
+   colon. */
+#undef FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
+
+/* Define if the backslash character may also serve as a file name component
+   separator. */
+#undef FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
+
+/* Define if a drive letter prefix denotes a relative path if it is not
+   followed by a file name component separator. */
+#undef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+
+/* Define to 1 if the system's ftello function has the Solaris bug. */
+#undef FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE
+
 /* Define to 1 if the `getpgrp' function requires zero arguments. */
 #undef GETPGRP_VOID
 
 /* Define if gettimeofday clobbers the localtime buffer. */
 #undef GETTIMEOFDAY_CLOBBERS_LOCALTIME
 
-/* Define to indicate the 'malloc' module. */
+/* Define this to 'void' or 'struct timezone' to match the system's
+   declaration of the second argument to gettimeofday. */
+#undef GETTIMEOFDAY_TIMEZONE
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module malloc-gnu shall be considered present. */
 #undef GNULIB_MALLOC_GNU
 
-/* Define to 1 when using the gnulib module sys_socket. */
-#undef GNULIB_SYS_SOCKET
+/* Define to 1 when the gnulib module btowc should be tested. */
+#undef GNULIB_TEST_BTOWC
+
+/* Define to 1 when the gnulib module environ should be tested. */
+#undef GNULIB_TEST_ENVIRON
+
+/* Define to 1 when the gnulib module fseeko should be tested. */
+#undef GNULIB_TEST_FSEEKO
+
+/* Define to 1 when the gnulib module ftello should be tested. */
+#undef GNULIB_TEST_FTELLO
+
+/* Define to 1 when the gnulib module ftruncate should be tested. */
+#undef GNULIB_TEST_FTRUNCATE
+
+/* Define to 1 when the gnulib module getopt-gnu should be tested. */
+#undef GNULIB_TEST_GETOPT_GNU
+
+/* Define to 1 when the gnulib module gettimeofday should be tested. */
+#undef GNULIB_TEST_GETTIMEOFDAY
+
+/* Define to 1 when the gnulib module lseek should be tested. */
+#undef GNULIB_TEST_LSEEK
+
+/* Define to 1 when the gnulib module lstat should be tested. */
+#undef GNULIB_TEST_LSTAT
+
+/* Define to 1 when the gnulib module malloc-posix should be tested. */
+#undef GNULIB_TEST_MALLOC_POSIX
+
+/* Define to 1 when the gnulib module mbrtowc should be tested. */
+#undef GNULIB_TEST_MBRTOWC
+
+/* Define to 1 when the gnulib module mbsinit should be tested. */
+#undef GNULIB_TEST_MBSINIT
+
+/* Define to 1 when the gnulib module memchr should be tested. */
+#undef GNULIB_TEST_MEMCHR
+
+/* Define to 1 when the gnulib module mkdtemp should be tested. */
+#undef GNULIB_TEST_MKDTEMP
+
+/* Define to 1 when the gnulib module nl_langinfo should be tested. */
+#undef GNULIB_TEST_NL_LANGINFO
+
+/* Define to 1 when the gnulib module snprintf should be tested. */
+#undef GNULIB_TEST_SNPRINTF
+
+/* Define to 1 when the gnulib module stat should be tested. */
+#undef GNULIB_TEST_STAT
+
+/* Define to 1 when the gnulib module wcrtomb should be tested. */
+#undef GNULIB_TEST_WCRTOMB
+
+/* Define to 1 when the gnulib module write should be tested. */
+#undef GNULIB_TEST_WRITE
 
 /* Location of the GNU 'tar' binary */
 #undef GNUTAR
 /* Define if bind is declared. */
 #undef HAVE_BIND_DECL
 
+/* Define to 1 if you have the <bp-sym.h> header file. */
+#undef HAVE_BP_SYM_H
+
 /* Define to 1 if you have the `btowc' function. */
 #undef HAVE_BTOWC
 
 /* Define if bzero is declared. */
 #undef HAVE_BZERO_DECL
 
-/* Define to 1 if you have the <camlib.h> header file. */
-#undef HAVE_CAMLIB_H
-
 /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
    CoreFoundation framework. */
 #undef HAVE_CFLOCALECOPYCURRENT
    the CoreFoundation framework. */
 #undef HAVE_CFPREFERENCESCOPYAPPVALUE
 
-/* Define to 1 if you have the <chio.h> header file. */
-#undef HAVE_CHIO_H
-
 /* Define to 1 if you have the `chsize' function. */
 #undef HAVE_CHSIZE
 
    don't. */
 #undef HAVE_DECL_GETNAMEINFO
 
+/* Define to 1 if you have the declaration of `getopt_clip', and to 0 if you
+   don't. */
+#undef HAVE_DECL_GETOPT_CLIP
+
 /* Define to 1 if you have the declaration of `inet_ntop', and to 0 if you
    don't. */
 #undef HAVE_DECL_INET_NTOP
 
+/* Define to 1 if you have the declaration of `inet_pton', and to 0 if you
+   don't. */
+#undef HAVE_DECL_INET_PTON
+
 /* Define to 1 if you have the declaration of `isblank', and to 0 if you
    don't. */
 #undef HAVE_DECL_ISBLANK
 
+/* Define to 1 if you have the declaration of `iswblank', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ISWBLANK
+
+/* Define to 1 if you have the declaration of `optreset', and to 0 if you
+   don't. */
+#undef HAVE_DECL_OPTRESET
+
 /* Define to 1 if you have the declaration of `readdir', and to 0 if you
    don't. */
 #undef HAVE_DECL_READDIR
 /* Define to 1 if you have the `endmntent' function. */
 #undef HAVE_ENDMNTENT
 
+/* Define if you have the declaration of environ. */
+#undef HAVE_ENVIRON_DECL
+
 /* Define to 1 if you have the <errno.h> header file. */
 #undef HAVE_ERRNO_H
 
 /* Define to 1 if you have the `getopt_long_only' function. */
 #undef HAVE_GETOPT_LONG_ONLY
 
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
 /* Define to 1 if you have the `getpeername' function. */
 #undef HAVE_GETPEERNAME
 
 /* Define to 1 if you have the `inet_ntop' function. */
 #undef HAVE_INET_NTOP
 
+/* Define to 1 if you have the `inet_pton' function. */
+#undef HAVE_INET_PTON
+
 /* Define to 1 if you have the `initgroups' function. */
 #undef HAVE_INITGROUPS
 
 /* Define if isnormal is declared. */
 #undef HAVE_ISNORMAL_DECL
 
+/* Define to 1 if you have the `iswblank' function. */
+#undef HAVE_ISWBLANK
+
 /* Define to 1 if you have the `iswcntrl' function. */
 #undef HAVE_ISWCNTRL
 
 /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
 #undef HAVE_LANGINFO_CODESET
 
-/* Define to 1 if you have the `cam' library (-lcam). */
-#undef HAVE_LIBCAM
+/* Define to 1 if you have the <langinfo.h> header file. */
+#undef HAVE_LANGINFO_H
 
 /* Define to 1 if you have the `crypto' library (-lcrypto). */
 #undef HAVE_LIBCRYPTO
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
-/* Define to 1 if you have the <linux/chio.h> header file. */
-#undef HAVE_LINUX_CHIO_H
-
 /* Define to 1 if you have the <linux/zftape.h> header file. */
 #undef HAVE_LINUX_ZFTAPE_H
 
 /* Define if malloc is declared. */
 #undef HAVE_MALLOC_DECL
 
+/* Define to 1 if your system has a GNU libc compatible 'malloc' function, and
+   to 0 otherwise. */
+#undef HAVE_MALLOC_GNU
+
 /* Define if the 'malloc' function is POSIX compliant. */
 #undef HAVE_MALLOC_POSIX
 
+/* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
+   config.h and <sys/mman.h>. */
+#undef HAVE_MAP_ANONYMOUS
+
 /* Define to 1 if you have the <math.h> header file. */
 #undef HAVE_MATH_H
 
 /* Define to 1 if <wchar.h> declares mbstate_t. */
 #undef HAVE_MBSTATE_T
 
+/* Define to 1 if you have the `memchr' function. */
+#undef HAVE_MEMCHR
+
 /* Define to 1 if you have the `memmove' function. */
 #undef HAVE_MEMMOVE
 
 /* Define if mktime is declared. */
 #undef HAVE_MKTIME_DECL
 
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
 /* Define to 1 if you have the <mntent.h> header file. */
 #undef HAVE_MNTENT_H
 
 /* Define to 1 if you have the <mnttab.h> header file. */
 #undef HAVE_MNTTAB_H
 
+/* Define to 1 if you have the `mprotect' function. */
+#undef HAVE_MPROTECT
+
 /* Define if the mtget structure has an mt_blkno field */
 #undef HAVE_MT_BLKNO
 
 /* Define to 1 if you have the <netinet/in.h> header file. */
 #undef HAVE_NETINET_IN_H
 
+/* Define to 1 if you have the `nl_langinfo' function. */
+#undef HAVE_NL_LANGINFO
+
 /* Define to 1 if you have the `on_exit' function. */
 #undef HAVE_ON_EXIT
 
 /* Define to 1 if you have the <random.h> header file. */
 #undef HAVE_RANDOM_H
 
+/* Define to 1 if accept is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ACCEPT
+
+/* Define to 1 if accept4 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ACCEPT4
+
+/* Define to 1 if atoll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ATOLL
+
+/* Define to 1 if bind is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_BIND
+
+/* Define to 1 if btowc is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_BTOWC
+
+/* Define to 1 if canonicalize_file_name is declared even after undefining
+   macros. */
+#undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
+
+/* Define to 1 if chown is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CHOWN
+
+/* Define to 1 if connect is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CONNECT
+
+/* Define to 1 if dprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DPRINTF
+
+/* Define to 1 if dup2 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DUP2
+
+/* Define to 1 if dup3 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DUP3
+
+/* Define to 1 if endusershell is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ENDUSERSHELL
+
+/* Define to 1 if environ is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ENVIRON
+
+/* Define to 1 if euidaccess is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EUIDACCESS
+
+/* Define to 1 if faccessat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FACCESSAT
+
+/* Define to 1 if fchdir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCHDIR
+
+/* Define to 1 if fchmodat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCHMODAT
+
+/* Define to 1 if fchownat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCHOWNAT
+
+/* Define to 1 if fpurge is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FPURGE
+
+/* Define to 1 if freeaddrinfo is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FREEADDRINFO
+
+/* Define to 1 if fseeko is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSEEKO
+
+/* Define to 1 if fstatat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSTATAT
+
+/* Define to 1 if fsync is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSYNC
+
+/* Define to 1 if ftello is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FTELLO
+
+/* Define to 1 if ftruncate is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FTRUNCATE
+
+/* Define to 1 if futimens is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FUTIMENS
+
+/* Define to 1 if gai_strerror is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GAI_STRERROR
+
+/* Define to 1 if getaddrinfo is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETADDRINFO
+
+/* Define to 1 if getcwd is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETCWD
+
+/* Define to 1 if getdelim is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETDELIM
+
+/* Define to 1 if getdomainname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETDOMAINNAME
+
+/* Define to 1 if getdtablesize is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETDTABLESIZE
+
+/* Define to 1 if getgroups is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETGROUPS
+
+/* Define to 1 if gethostname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETHOSTNAME
+
+/* Define to 1 if getline is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLINE
+
+/* Define to 1 if getloadavg is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLOADAVG
+
+/* Define to 1 if getlogin is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLOGIN
+
+/* Define to 1 if getlogin_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLOGIN_R
+
+/* Define to 1 if getnameinfo is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETNAMEINFO
+
+/* Define to 1 if getpagesize is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETPAGESIZE
+
+/* Define to 1 if getpeername is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETPEERNAME
+
+/* Define to 1 if getsockname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETSOCKNAME
+
+/* Define to 1 if getsockopt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETSOCKOPT
+
+/* Define to 1 if getsubopt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETSUBOPT
+
+/* Define to 1 if gettimeofday is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETTIMEOFDAY
+
+/* Define to 1 if getusershell is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETUSERSHELL
+
+/* Define to 1 if grantpt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GRANTPT
+
+/* Define to 1 if inet_ntop is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INET_NTOP
+
+/* Define to 1 if inet_pton is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INET_PTON
+
+/* Define to 1 if initstat_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INITSTAT_R
+
+/* Define to 1 if lchmod is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LCHMOD
+
+/* Define to 1 if lchown is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LCHOWN
+
+/* Define to 1 if link is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LINK
+
+/* Define to 1 if linkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LINKAT
+
+/* Define to 1 if listen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LISTEN
+
+/* Define to 1 if lseek is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LSEEK
+
+/* Define to 1 if lstat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LSTAT
+
+/* Define to 1 if mbrlen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBRLEN
+
+/* Define to 1 if mbrtowc is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBRTOWC
+
+/* Define to 1 if mbsinit is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBSINIT
+
+/* Define to 1 if mbsnrtowcs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBSNRTOWCS
+
+/* Define to 1 if mbsrtowcs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBSRTOWCS
+
+/* Define to 1 if memmem is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MEMMEM
+
+/* Define to 1 if mempcpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MEMPCPY
+
+/* Define to 1 if memrchr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MEMRCHR
+
+/* Define to 1 if mkdirat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKDIRAT
+
+/* Define to 1 if mkdtemp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKDTEMP
+
+/* Define to 1 if mkfifo is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKFIFO
+
+/* Define to 1 if mkfifoat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKFIFOAT
+
+/* Define to 1 if mknod is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKNOD
+
+/* Define to 1 if mknodat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKNODAT
+
+/* Define to 1 if mkostemp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKOSTEMP
+
+/* Define to 1 if mkostemps is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKOSTEMPS
+
+/* Define to 1 if mkstemp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKSTEMP
+
+/* Define to 1 if mkstemps is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKSTEMPS
+
+/* Define to 1 if nl_langinfo is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_NL_LANGINFO
+
+/* Define to 1 if pipe2 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PIPE2
+
+/* Define to 1 if popen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_POPEN
+
+/* Define to 1 if pread is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PREAD
+
+/* Define to 1 if ptsname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PTSNAME
+
+/* Define to 1 if pwrite is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PWRITE
+
+/* Define to 1 if random_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RANDOM_R
+
+/* Define to 1 if rawmemchr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RAWMEMCHR
+
+/* Define to 1 if readlink is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_READLINK
+
+/* Define to 1 if readlinkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_READLINKAT
+
+/* Define to 1 if realpath is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_REALPATH
+
+/* Define to 1 if recv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RECV
+
+/* Define to 1 if recvfrom is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RECVFROM
+
+/* Define to 1 if renameat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RENAMEAT
+
+/* Define to 1 if rmdir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RMDIR
+
+/* Define to 1 if rpmatch is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RPMATCH
+
+/* Define to 1 if send is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SEND
+
+/* Define to 1 if sendto is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SENDTO
+
+/* Define to 1 if setenv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETENV
+
+/* Define to 1 if setsockopt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETSOCKOPT
+
+/* Define to 1 if setstate_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETSTATE_R
+
+/* Define to 1 if setusershell is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETUSERSHELL
+
+/* Define to 1 if shutdown is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SHUTDOWN
+
+/* Define to 1 if sleep is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SLEEP
+
+/* Define to 1 if snprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SNPRINTF
+
+/* Define to 1 if socket is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SOCKET
+
+/* Define to 1 if srandom_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SRANDOM_R
+
+/* Define to 1 if stat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STAT
+
+/* Define to 1 if stpcpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STPCPY
+
+/* Define to 1 if stpncpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STPNCPY
+
+/* Define to 1 if strcasestr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRCASESTR
+
+/* Define to 1 if strchrnul is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRCHRNUL
+
+/* Define to 1 if strdup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRDUP
+
+/* Define to 1 if strncat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRNCAT
+
+/* Define to 1 if strndup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRNDUP
+
+/* Define to 1 if strnlen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRNLEN
+
+/* Define to 1 if strpbrk is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRPBRK
+
+/* Define to 1 if strsep is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRSEP
+
+/* Define to 1 if strsignal is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRSIGNAL
+
+/* Define to 1 if strtod is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOD
+
+/* Define to 1 if strtok_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOK_R
+
+/* Define to 1 if strtoll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOLL
+
+/* Define to 1 if strtoull is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOULL
+
+/* Define to 1 if strverscmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRVERSCMP
+
+/* Define to 1 if symlink is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SYMLINK
+
+/* Define to 1 if symlinkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SYMLINKAT
+
+/* Define to 1 if tmpfile is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TMPFILE
+
+/* Define to 1 if ttyname_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TTYNAME_R
+
+/* Define to 1 if unlink is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNLINK
+
+/* Define to 1 if unlinkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNLINKAT
+
+/* Define to 1 if unlockpt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNLOCKPT
+
+/* Define to 1 if unsetenv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNSETENV
+
+/* Define to 1 if usleep is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_USLEEP
+
+/* Define to 1 if utimensat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UTIMENSAT
+
+/* Define to 1 if vdprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_VDPRINTF
+
+/* Define to 1 if vsnprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_VSNPRINTF
+
+/* Define to 1 if wcrtomb is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCRTOMB
+
+/* Define to 1 if wcsnrtombs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNRTOMBS
+
+/* Define to 1 if wcsrtombs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSRTOMBS
+
+/* Define to 1 if wctob is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCTOB
+
+/* Define to 1 if wcwidth is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCWIDTH
+
+/* Define to 1 if _Exit is declared even after undefining macros. */
+#undef HAVE_RAW_DECL__EXIT
+
 /* System has readline support (headers and libraries) */
 #undef HAVE_READLINE
 
 /* Define if ruserok is declared. */
 #undef HAVE_RUSEROK_DECL
 
-/* Define to 1 if you have the <scsi/scsi_ioctl.h> header file. */
-#undef HAVE_SCSI_SCSI_IOCTL_H
-
-/* Define to 1 if you have the <scsi/sg.h> header file. */
-#undef HAVE_SCSI_SG_H
+/* Define to 1 if the system has the type `sa_family_t'. */
+#undef HAVE_SA_FAMILY_T
 
 /* Define to 1 if you have the `select' function. */
 #undef HAVE_SELECT
 /* Define if setsockopt is declared. */
 #undef HAVE_SETSOCKOPT_DECL
 
-/* Define to 1 if you have the `shmat' function. */
-#undef HAVE_SHMAT
-
-/* Define if shmat is declared. */
-#undef HAVE_SHMAT_DECL
-
-/* Define to 1 if you have the `shmctl' function. */
-#undef HAVE_SHMCTL
-
-/* Define if shmctl is declared. */
-#undef HAVE_SHMCTL_DECL
-
-/* Define to 1 if you have the `shmdt' function. */
-#undef HAVE_SHMDT
-
-/* Define if shmdt is declared. */
-#undef HAVE_SHMDT_DECL
-
-/* Define to 1 if you have the `shmget' function. */
-#undef HAVE_SHMGET
-
-/* Define if shmget is declared. */
-#undef HAVE_SHMGET_DECL
-
 /* Define to 1 if you have the `shutdown' function. */
 #undef HAVE_SHUTDOWN
 
 /* Define if snprintf is declared. */
 #undef HAVE_SNPRINTF_DECL
 
+/* Define if the return value of the snprintf function is the number of of
+   bytes (excluding the terminating NUL) that would have been produced if the
+   buffer had been large enough. */
+#undef HAVE_SNPRINTF_RETVAL_C99
+
 /* struct sockaddr_storage exists */
 #undef HAVE_SOCKADDR_STORAGE
 
 /* Define to 1 if stdbool.h conforms to C99. */
 #undef HAVE_STDBOOL_H
 
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
 /* Define to 1 if `sa_len' is member of `struct sockaddr'. */
 #undef HAVE_STRUCT_SOCKADDR_SA_LEN
 
+/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE
+
 /* Define to 1 if you have the `sysctl' function. */
 #undef HAVE_SYSCTL
 
 /* Define if system is declared. */
 #undef HAVE_SYSTEM_DECL
 
-/* Define if SysV shared-memory functions are available. */
-#undef HAVE_SYSVSHM
-
 /* Define to 1 if you have the <sys/bitypes.h> header file. */
 #undef HAVE_SYS_BITYPES_H
 
-/* Define to 1 if you have the <sys/chio.h> header file. */
-#undef HAVE_SYS_CHIO_H
-
 /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
    */
 #undef HAVE_SYS_DIR_H
 
-/* Define to 1 if you have the <sys/dsreq.h> header file. */
-#undef HAVE_SYS_DSREQ_H
-
 /* Define to 1 if you have the <sys/fcntl.h> header file. */
 #undef HAVE_SYS_FCNTL_H
 
 /* Define to 1 if you have the <sys/fs_types.h> header file. */
 #undef HAVE_SYS_FS_TYPES_H
 
-/* Define to 1 if you have the <sys/gscdds.h> header file. */
-#undef HAVE_SYS_GSCDDS_H
-
 /* Define to 1 if you have the <sys/inttypes.h> header file. */
 #undef HAVE_SYS_INTTYPES_H
 
 /* Define to 1 if you have the <sys/pstat.h> header file. */
 #undef HAVE_SYS_PSTAT_H
 
-/* Define to 1 if you have the <sys/scarray.h> header file. */
-#undef HAVE_SYS_SCARRAY_H
-
-/* Define to 1 if you have the <sys/scsiio.h> header file. */
-#undef HAVE_SYS_SCSIIO_H
-
-/* Define to 1 if you have the <sys/scsi.h> header file. */
-#undef HAVE_SYS_SCSI_H
-
-/* Define to 1 if you have the <sys/scsi/impl/uscsi.h> header file. */
-#undef HAVE_SYS_SCSI_IMPL_USCSI_H
-
-/* Define to 1 if you have the <sys/scsi/scsi/ioctl.h> header file. */
-#undef HAVE_SYS_SCSI_SCSI_IOCTL_H
-
 /* Define to 1 if you have the <sys/select.h> header file. */
 #undef HAVE_SYS_SELECT_H
 
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
+
 /* Define to 1 if the system has the type `unsigned long long int'. */
 #undef HAVE_UNSIGNED_LONG_LONG_INT
 
 /* Define if vfprintf is declared. */
 #undef HAVE_VFPRINTF_DECL
 
-/* Define to 1 or 0, depending whether the compiler supports simple visibility
-   declarations. */
-#undef HAVE_VISIBILITY
-
 /* Define to 1 if you have the `vprintf' function. */
 #undef HAVE_VPRINTF
 
 /* Define if you have the 'wint_t' type. */
 #undef HAVE_WINT_T
 
+/* Define to 1 if O_NOATIME works. */
+#undef HAVE_WORKING_O_NOATIME
+
+/* Define to 1 if O_NOFOLLOW works. */
+#undef HAVE_WORKING_O_NOFOLLOW
+
 /* Define to 1 if you have the `writev' function. */
 #undef HAVE_WRITEV
 
 /* Define on Cygwin. */
 #undef IGNORE_TAR_ERRORS
 
+#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#else
+# define ISSLASH(C) ((C) == '/')
+#endif
+
 /* The name for the Kerberized Amanda service. */
 #undef KAMANDA_SERVICE_NAME
 
    */
 #undef LT_OBJDIR
 
+/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */
+#undef MAP_ANONYMOUS
+
 /* Define if the mbrtowc function has the NULL string argument bug. */
 #undef MBRTOWC_NULL_ARG_BUG
 
 /* Define as the prefix for raw disk devices, commonly /dev/r or /dev/rdsk/ */
 #undef RDEV_PREFIX
 
+/* Define to 1 if stat needs help when passed a directory name with a trailing
+   slash */
+#undef REPLACE_FUNC_STAT_DIR
+
+/* Define to 1 if stat needs help when passed a file name with a trailing
+   slash */
+#undef REPLACE_FUNC_STAT_FILE
+
+/* Define if nl_langinfo exists but is overridden by gnulib. */
+#undef REPLACE_NL_LANGINFO
+
 /* Define if vasnprintf exists but is overridden by gnulib. */
 #undef REPLACE_VASNPRINTF
 
 /* Define to 1 if the `setpgrp' function takes no argument. */
 #undef SETPGRP_VOID
 
-/* Define to type of shmget() function argument. */
-#undef SHM_ARG_TYPE
-
 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
    'sig_atomic_t'. */
 #undef SIG_ATOMIC_T_SUFFIX
 /* Define if statfs takes 3 args. (DEC Alpha running OSF/1) */
 #undef STAT_STATFS3_OSF1
 
-/* Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin) */
+/* Define if statfs takes 4 args. (SVR3, Dynix, old Irix, old AIX, Dolphin) */
 #undef STAT_STATFS4
 
 /* Define if there is a function named statvfs. (SVR4) */
 /* Define as the exact path to the gzip or compress command. */
 #undef UNCOMPRESS_PATH
 
+/* Define to the prefix of C symbols at the assembler and linker level, either
+   an underscore or empty. */
+#undef USER_LABEL_PREFIX
+
 /* Define if you want to use the ".amandahosts" for BSD security. */
 #undef USE_AMANDAHOSTS
 
 /* Define if clients should be built setuid-root */
 #undef WANT_SETUID_CLIENT
 
-/* Define on AIX. */
-#undef WANT_TAPE_AIX
-
 /* Define if the tape-device will be built */
 #undef WANT_TAPE_DEVICE
 
-/* Define on UnixWare. */
-#undef WANT_TAPE_UWARE
-
-/* Define on XENIX/ISC. */
-#undef WANT_TAPE_XENIX
-
 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
    'wchar_t'. */
 #undef WCHAR_T_SUFFIX
 # endif
 #endif
 
-/* Target system has functional IPv6 support */
+/* This system has functional IPv6 support (kernel and compiler) */
 #undef WORKING_IPV6
 
 /* Define the location of the xfsdump program on Irix hosts. */
 /* Define to rpl_localtime if the replacement function should be used. */
 #undef localtime
 
-/* Define to rpl_malloc if the replacement function should be used. */
-#undef malloc
-
 /* Directory in which man-pages should be installed */
 #undef mandir
 
 /* Define to `int' if <sys/types.h> doesn't define. */
 #undef uid_t
 
-/* Define as a marker that can be attached to function parameter declarations
-   for parameters that are not used.  This helps to reduce warnings, such as
-   from GCC -Wunused-parameter.  */
+/* Define as a marker that can be attached to declarations that might not
+    be used.  This helps to reduce warnings, such as from
+    GCC -Wunused-parameter.  */
 #if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _UNUSED_PARAMETER_ __attribute__ ((__unused__))
+# define _GL_UNUSED __attribute__ ((__unused__))
 #else
-# define _UNUSED_PARAMETER_
+# define _GL_UNUSED
 #endif
+/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
+   is a misnomer outside of parameter lists.  */
+#define _UNUSED_PARAMETER_ _GL_UNUSED
 
index 85c2f209beb72edebf886ca1de25f29f02c09aec..17298f2348bf0c5ce90917bf19abfb75a92ae179 100755 (executable)
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2008 Free Software Foundation, Inc.
+#   Copyright 1996-2010 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
index d4d04d1530a27c0921a542c6978da037107b9ee0..301469b31cef0ba55efc7c41e701ae5fa715834d 100644 (file)
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 2
-dnl Copyright (C) 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 4b978e137cbe7c2d9f76baa6546764f6e2f7a0a6..f3ee34380cda13d5463e465bdb2c6d691169d449 100644 (file)
@@ -1,5 +1,6 @@
 # alloca.m4 serial 9
-dnl Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index a6e63df01c376b124467f906268131fcc3e05573..15a30e2bcab5f97f6b19692a58ec737ad620d329 100644 (file)
@@ -1,5 +1,5 @@
-# arpa_inet_h.m4 serial 5
-dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 8
+dnl Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -16,27 +16,35 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
   if test $ac_cv_header_arpa_inet_h = yes; then
     HAVE_ARPA_INET_H=1
   else
-    ARPA_INET_H='arpa/inet.h'
     HAVE_ARPA_INET_H=0
   fi
   AC_SUBST([HAVE_ARPA_INET_H])
-  dnl Execute this unconditionally, because ARPA_INET_H may be set by other
-  dnl modules, after this code is executed.
+  dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([arpa/inet.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* On some systems, this header is not self-consistent.  */
+#ifndef __GLIBC__
+# include <sys/socket.h>
+#endif
+#include <arpa/inet.h>
+    ]], [inet_ntop inet_pton])
 ])
 
 dnl Unconditionally enables the replacement of <arpa/inet.h>.
 AC_DEFUN([gl_REPLACE_ARPA_INET_H],
 [
-  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
-  ARPA_INET_H='arpa/inet.h'
+  dnl This is a no-op, because <arpa/inet.h> is always overridden.
+  :
 ])
 
 AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
 ])
 
 AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
@@ -46,5 +54,4 @@ AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_INET_NTOP=1;  AC_SUBST([HAVE_DECL_INET_NTOP])
   HAVE_DECL_INET_PTON=1;  AC_SUBST([HAVE_DECL_INET_PTON])
-  ARPA_INET_H='';         AC_SUBST([ARPA_INET_H])
 ])
diff --git a/config/gnulib/asm-underscore.m4 b/config/gnulib/asm-underscore.m4
new file mode 100644 (file)
index 0000000..1736cc4
--- /dev/null
@@ -0,0 +1,48 @@
+# asm-underscore.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
+
+# gl_ASM_SYMBOL_PREFIX
+# Tests for the prefix of C symbols at the assembly language level and the
+# linker level. This prefix is either an underscore or empty. Defines the
+# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
+# a stringified variant of this prefix.
+
+AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
+[
+  dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
+  dnl 1. It works only for GCC.
+  dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
+  AC_CACHE_CHECK(
+    [whether C symbols are prefixed with underscore at the linker level],
+    [gl_cv_prog_as_underscore],
+    [cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" int foo (void);
+#endif
+int foo(void) { return 0; }
+EOF
+     # Look for the assembly language name in the .s file.
+     AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c) >/dev/null 2>&1
+     if grep _foo conftest.s >/dev/null ; then
+       gl_cv_prog_as_underscore=yes
+     else
+       gl_cv_prog_as_underscore=no
+     fi
+     rm -f conftest*
+    ])
+  if test $gl_cv_prog_as_underscore = yes; then
+    USER_LABEL_PREFIX=_
+  else
+    USER_LABEL_PREFIX=
+  fi
+  AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
+    [Define to the prefix of C symbols at the assembler and linker level,
+     either an underscore or empty.])
+  ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
+  AC_SUBST([ASM_SYMBOL_PREFIX])
+])
index 24801efa334635bca9765be3187e773acd18740b..d1e1352211ae7280c90926691517a26da23b4541 100644 (file)
@@ -1,5 +1,5 @@
 # base64.m4 serial 3
-dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 64ff82906155bcfbf1cfdaaa4258c3221bbcebfa..b16b1f020a94bef677777b9de347853952144cb8 100644 (file)
@@ -1,5 +1,5 @@
-# btowc.m4 serial 3
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# btowc.m4 serial 7
+dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,15 +8,50 @@ AC_DEFUN([gl_FUNC_BTOWC],
 [
   AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
 
+  dnl Check whether <wchar.h> is usable at all, first. Otherwise the test
+  dnl program below may lead to an endless loop. See
+  dnl <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
+  AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
+
   AC_CHECK_FUNCS_ONCE([btowc])
   if test $ac_cv_func_btowc = no; then
     HAVE_BTOWC=0
   else
 
-    dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF.
     AC_REQUIRE([AC_PROG_CC])
     AC_REQUIRE([gt_LOCALE_FR])
     AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+    dnl Cygwin 1.7.2 btowc('\0') is WEOF, not 0.
+    AC_CACHE_CHECK([whether btowc(0) is correct],
+      [gl_cv_func_btowc_nul],
+      [
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (btowc ('\0') != 0)
+    return 1;
+  return 0;
+}]])],
+          [gl_cv_func_btowc_nul=yes],
+          [gl_cv_func_btowc_nul=no],
+          [
+changequote(,)dnl
+           case "$host_os" in
+                      # Guess no on Cygwin.
+             cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+                      # Guess yes otherwise.
+             *)       gl_cv_func_btowc_nul="guessing yes" ;;
+           esac
+changequote([,])dnl
+          ])
+      ])
+
+    dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF.
     AC_CACHE_CHECK([whether btowc(EOF) is correct],
       [gl_cv_func_btowc_eof],
       [
@@ -31,7 +66,8 @@ changequote(,)dnl
         esac
 changequote([,])dnl
         if test $LOCALE_FR != none; then
-          AC_TRY_RUN([
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <stdio.h>
 #include <string.h>
@@ -44,12 +80,17 @@ int main ()
         return 1;
     }
   return 0;
-}],
+}]])],
             [gl_cv_func_btowc_eof=yes],
             [gl_cv_func_btowc_eof=no],
-            [])
+            [:])
         fi
       ])
+
+    case "$gl_cv_func_btowc_nul" in
+      *yes) ;;
+      *) REPLACE_BTOWC=1 ;;
+    esac
     case "$gl_cv_func_btowc_eof" in
       *yes) ;;
       *) REPLACE_BTOWC=1 ;;
index 413217bd4a5f9ebb295528989c6e4e906c9438eb..f722b2e86aad75915eccd7d30f7a4cfbe7975167 100644 (file)
@@ -1,5 +1,5 @@
-# codeset.m4 serial 4 (gettext-0.18)
-dnl Copyright (C) 2000-2002, 2006, 2008, 2009 Free Software Foundation, Inc.
+# codeset.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,10 +9,12 @@ dnl From Bruno Haible.
 AC_DEFUN([AM_LANGINFO_CODESET],
 [
   AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
-    [AC_TRY_LINK([#include <langinfo.h>],
-      [char* cs = nl_langinfo(CODESET); return !cs;],
-      [am_cv_langinfo_codeset=yes],
-      [am_cv_langinfo_codeset=no])
+    [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <langinfo.h>]],
+          [[char* cs = nl_langinfo(CODESET); return !cs;]])],
+       [am_cv_langinfo_codeset=yes],
+       [am_cv_langinfo_codeset=no])
     ])
   if test $am_cv_langinfo_codeset = yes; then
     AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
diff --git a/config/gnulib/dos.m4 b/config/gnulib/dos.m4
new file mode 100644 (file)
index 0000000..5660542
--- /dev/null
@@ -0,0 +1,71 @@
+#serial 11   -*- autoconf -*-
+
+# Define some macros required for proper operation of code in lib/*.c
+# on MSDOS/Windows systems.
+
+# Copyright (C) 2000-2001, 2004-2006, 2009-2010 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# From Jim Meyering.
+
+AC_DEFUN([gl_AC_DOS],
+  [
+    AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
+      [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
+#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
+neither MSDOS nor Windows
+#endif]])],
+        [ac_cv_win_or_dos=yes],
+        [ac_cv_win_or_dos=no])
+      ])
+
+    if test x"$ac_cv_win_or_dos" = xyes; then
+      ac_fs_accepts_drive_letter_prefix=1
+      ac_fs_backslash_is_file_name_separator=1
+      AC_CACHE_CHECK([whether drive letter can start relative path],
+                     [ac_cv_drive_letter_can_be_relative],
+        [
+          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
+#if defined __CYGWIN__
+drive letters are always absolute
+#endif]])],
+          [ac_cv_drive_letter_can_be_relative=yes],
+          [ac_cv_drive_letter_can_be_relative=no])
+        ])
+      if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
+        ac_fs_drive_letter_can_be_relative=1
+      else
+        ac_fs_drive_letter_can_be_relative=0
+      fi
+    else
+      ac_fs_accepts_drive_letter_prefix=0
+      ac_fs_backslash_is_file_name_separator=0
+      ac_fs_drive_letter_can_be_relative=0
+    fi
+
+    AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
+      $ac_fs_accepts_drive_letter_prefix,
+      [Define on systems for which file names may have a so-called
+       `drive letter' prefix, define this to compute the length of that
+       prefix, including the colon.])
+
+    AH_VERBATIM(ISSLASH,
+    [#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#else
+# define ISSLASH(C) ((C) == '/')
+#endif])
+
+    AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
+      $ac_fs_backslash_is_file_name_separator,
+      [Define if the backslash character may also serve as a file name
+       component separator.])
+
+    AC_DEFINE_UNQUOTED([FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE],
+      $ac_fs_drive_letter_can_be_relative,
+      [Define if a drive letter prefix denotes a relative path if it is
+       not followed by a file name component separator.])
+  ])
diff --git a/config/gnulib/environ.m4 b/config/gnulib/environ.m4
new file mode 100644 (file)
index 0000000..b9dc2ef
--- /dev/null
@@ -0,0 +1,38 @@
+# environ.m4 serial 5
+dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_ENVIRON],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  dnl Persuade glibc <unistd.h> to declare environ.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
+  if test $gt_cv_var_environ_declaration != yes; then
+    HAVE_DECL_ENVIRON=0
+  fi
+])
+
+# Check if a variable is properly declared.
+# gt_CHECK_VAR_DECL(includes,variable)
+AC_DEFUN([gt_CHECK_VAR_DECL],
+[
+  define([gt_cv_var], [gt_cv_var_]$2[_declaration])
+  AC_MSG_CHECKING([if $2 is properly declared])
+  AC_CACHE_VAL([gt_cv_var], [
+    AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[$1
+           extern struct { int foo; } $2;]],
+         [[$2.foo = 1;]])],
+      [gt_cv_var=no],
+      [gt_cv_var=yes])])
+  AC_MSG_RESULT([$gt_cv_var])
+  if test $gt_cv_var = yes; then
+    AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
+              [Define if you have the declaration of $2.])
+  fi
+  undefine([gt_cv_var])
+])
index 4d77672cb70e7190bd36a09fe84c272d9c9c0766..d02a039363dda9dbd4eaf43d40e9cdbccb699446 100644 (file)
@@ -1,10 +1,9 @@
-# errno_h.m4 serial 4
-dnl Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+# errno_h.m4 serial 6
+dnl Copyright (C) 2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl This macro must pass through AC_REQUIRE (never directly invoke it).
 AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
 [
   AC_REQUIRE([AC_PROG_CC])
@@ -35,6 +34,9 @@ booboo
 #if !defined ENOTSUP
 booboo
 #endif
+#if !defined ESTALE
+booboo
+#endif
 #if !defined ECANCELED
 booboo
 #endif
index ba6d5e190f9f2df6ae1b080fc8f2d16490b5e3b2..7d9458a8d65a0b085d93b695beaaa6685b824c18 100644 (file)
@@ -1,7 +1,7 @@
-# serial 8  -*- Autoconf -*-
+# serial 9  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 # enough in this area it's likely we'll need to redefine
 # AC_USE_SYSTEM_EXTENSIONS for quite some time.
 
+# If autoconf reports a warning
+#     warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# or  warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# the fix is
+#   1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
+#      but always AC_REQUIREd,
+#   2) to ensure that for each occurrence of
+#        AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+#      or
+#        AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+#      the corresponding gnulib module description has 'extensions' among
+#      its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
+#      invocation occurs in gl_EARLY, not in gl_INIT.
+
 # AC_USE_SYSTEM_EXTENSIONS
 # ------------------------
 # Enable extensions on systems that normally disable them,
@@ -74,8 +88,8 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
     [ac_cv_safe_to_define___extensions__],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[
-#        define __EXTENSIONS__ 1
-         ]AC_INCLUDES_DEFAULT])],
+#         define __EXTENSIONS__ 1
+          ]AC_INCLUDES_DEFAULT])],
        [ac_cv_safe_to_define___extensions__=yes],
        [ac_cv_safe_to_define___extensions__=no])])
   test $ac_cv_safe_to_define___extensions__ = yes &&
diff --git a/config/gnulib/fcntl-o.m4 b/config/gnulib/fcntl-o.m4
new file mode 100644 (file)
index 0000000..1adacc8
--- /dev/null
@@ -0,0 +1,85 @@
+# fcntl-o.m4 serial 2
+dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
+# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
+# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
+AC_DEFUN([gl_FCNTL_O_FLAGS],
+[
+  dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
+  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
+  dnl AC_GNU_SOURCE.
+  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+    [AC_REQUIRE([AC_GNU_SOURCE])])
+  AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
+    [AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <sys/types.h>
+           #include <sys/stat.h>
+           #include <unistd.h>
+           #include <fcntl.h>
+           #ifndef O_NOATIME
+            #define O_NOATIME 0
+           #endif
+           #ifndef O_NOFOLLOW
+            #define O_NOFOLLOW 0
+           #endif
+           static int const constants[] =
+            {
+              O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
+              O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
+            };
+          ]],
+          [[
+            int status = !constants;
+            {
+              static char const sym[] = "conftest.sym";
+              if (symlink (".", sym) != 0
+                  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
+                status |= 32;
+              unlink (sym);
+            }
+            {
+              static char const file[] = "confdefs.h";
+              int fd = open (file, O_RDONLY | O_NOATIME);
+              char c;
+              struct stat st0, st1;
+              if (fd < 0
+                  || fstat (fd, &st0) != 0
+                  || sleep (1) != 0
+                  || read (fd, &c, 1) != 1
+                  || close (fd) != 0
+                  || stat (file, &st1) != 0
+                  || st0.st_atime != st1.st_atime)
+                status |= 64;
+            }
+            return status;]])],
+       [gl_cv_header_working_fcntl_h=yes],
+       [case $? in #(
+        32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+        64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
+        96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+         *) gl_cv_header_working_fcntl_h='no';;
+        esac],
+       [gl_cv_header_working_fcntl_h=cross-compiling])])
+
+  case $gl_cv_header_working_fcntl_h in #(
+  *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+  *) ac_val=1;;
+  esac
+  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
+    [Define to 1 if O_NOATIME works.])
+
+  case $gl_cv_header_working_fcntl_h in #(
+  *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+  *) ac_val=1;;
+  esac
+  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
+    [Define to 1 if O_NOFOLLOW works.])
+])
index 8ee84aa1483047c0fc2716ca947ed73fe61ba6df..bb4a0b9cf8de547ae9aa440135fbb5d12704c50c 100644 (file)
@@ -2,11 +2,15 @@
 EXTRA_DIST += gnulib/00gnulib.m4
 EXTRA_DIST += gnulib/alloca.m4
 EXTRA_DIST += gnulib/arpa_inet_h.m4
+EXTRA_DIST += gnulib/asm-underscore.m4
 EXTRA_DIST += gnulib/base64.m4
 EXTRA_DIST += gnulib/btowc.m4
 EXTRA_DIST += gnulib/codeset.m4
+EXTRA_DIST += gnulib/dos.m4
+EXTRA_DIST += gnulib/environ.m4
 EXTRA_DIST += gnulib/errno_h.m4
 EXTRA_DIST += gnulib/extensions.m4
+EXTRA_DIST += gnulib/fcntl-o.m4
 EXTRA_DIST += gnulib/float_h.m4
 EXTRA_DIST += gnulib/fseeko.m4
 EXTRA_DIST += gnulib/fsusage.m4
@@ -23,8 +27,10 @@ EXTRA_DIST += gnulib/gnulib-tool.m4
 EXTRA_DIST += gnulib/hostent.m4
 EXTRA_DIST += gnulib/include_next.m4
 EXTRA_DIST += gnulib/inet_ntop.m4
+EXTRA_DIST += gnulib/inet_pton.m4
 EXTRA_DIST += gnulib/intmax_t.m4
 EXTRA_DIST += gnulib/inttypes_h.m4
+EXTRA_DIST += gnulib/langinfo_h.m4
 EXTRA_DIST += gnulib/lib-ld.m4
 EXTRA_DIST += gnulib/lib-link.m4
 EXTRA_DIST += gnulib/lib-prefix.m4
@@ -40,10 +46,13 @@ EXTRA_DIST += gnulib/malloc.m4
 EXTRA_DIST += gnulib/mbrtowc.m4
 EXTRA_DIST += gnulib/mbsinit.m4
 EXTRA_DIST += gnulib/mbstate_t.m4
+EXTRA_DIST += gnulib/memchr.m4
 EXTRA_DIST += gnulib/mkdtemp.m4
+EXTRA_DIST += gnulib/mmap-anon.m4
 EXTRA_DIST += gnulib/multiarch.m4
 EXTRA_DIST += gnulib/netdb_h.m4
 EXTRA_DIST += gnulib/netinet_in_h.m4
+EXTRA_DIST += gnulib/nl_langinfo.m4
 EXTRA_DIST += gnulib/onceonly.m4
 EXTRA_DIST += gnulib/physmem.m4
 EXTRA_DIST += gnulib/printf.m4
@@ -56,23 +65,27 @@ EXTRA_DIST += gnulib/snprintf.m4
 EXTRA_DIST += gnulib/socklen.m4
 EXTRA_DIST += gnulib/sockpfaf.m4
 EXTRA_DIST += gnulib/ssize_t.m4
+EXTRA_DIST += gnulib/stat.m4
 EXTRA_DIST += gnulib/stdbool.m4
+EXTRA_DIST += gnulib/stddef_h.m4
 EXTRA_DIST += gnulib/stdint_h.m4
 EXTRA_DIST += gnulib/stdint.m4
 EXTRA_DIST += gnulib/stdio_h.m4
 EXTRA_DIST += gnulib/stdlib_h.m4
+EXTRA_DIST += gnulib/string_h.m4
 EXTRA_DIST += gnulib/sys_socket_h.m4
 EXTRA_DIST += gnulib/sys_stat_h.m4
 EXTRA_DIST += gnulib/sys_time_h.m4
 EXTRA_DIST += gnulib/tempname.m4
 EXTRA_DIST += gnulib/threadlib.m4
+EXTRA_DIST += gnulib/time_h.m4
 EXTRA_DIST += gnulib/unistd_h.m4
 EXTRA_DIST += gnulib/vasnprintf.m4
-EXTRA_DIST += gnulib/visibility.m4
-EXTRA_DIST += gnulib/wchar.m4
+EXTRA_DIST += gnulib/warn-on-use.m4
+EXTRA_DIST += gnulib/wchar_h.m4
 EXTRA_DIST += gnulib/wchar_t.m4
 EXTRA_DIST += gnulib/wcrtomb.m4
-EXTRA_DIST += gnulib/wctype.m4
+EXTRA_DIST += gnulib/wctype_h.m4
 EXTRA_DIST += gnulib/wint_t.m4
 EXTRA_DIST += gnulib/write.m4
 EXTRA_DIST += gnulib/xsize.m4
index d36e3a46caef916dfd5d0c4dd26182d70850b3ae..a74a0d957f2ea89a010102dba7da48add2fccbfe 100644 (file)
@@ -1,5 +1,5 @@
 # float_h.m4 serial 3
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 3d773656886d4f9811ee80be0fe07a37f347a9c9..b97df53377bdee9e5849be768222607db77d21d2 100644 (file)
@@ -1,5 +1,5 @@
-# fseeko.m4 serial 4
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# fseeko.m4 serial 9
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,28 +7,44 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_FSEEKO],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([gl_HAVE_FSEEKO])
   AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
 
+  if test $gl_cv_func_fseeko = no; then
+    HAVE_FSEEKO=0
+    gl_REPLACE_FSEEKO
+  else
+    if test $gl_cv_var_stdin_large_offset = no; then
+      gl_REPLACE_FSEEKO
+    fi
+  fi
+])
+
+dnl Tests whether fseeko is available.
+dnl Result is gl_cv_func_fseeko.
+AC_DEFUN([gl_HAVE_FSEEKO],
+[
+  AC_REQUIRE([AC_PROG_CC])
+
   dnl Persuade glibc <stdio.h> to declare fseeko().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
   AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
     [
-      AC_TRY_LINK([#include <stdio.h>], [fseeko (stdin, 0, 0);],
-       [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+]], [fseeko (stdin, 0, 0);])],
+        [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
     ])
-  if test $gl_cv_func_fseeko = no; then
-    HAVE_FSEEKO=0
-    gl_REPLACE_FSEEKO
-  elif test $gl_cv_var_stdin_large_offset = no; then
-    gl_REPLACE_FSEEKO
-  fi
 ])
 
 AC_DEFUN([gl_REPLACE_FSEEKO],
 [
-  AC_LIBOBJ([fseeko])
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  REPLACE_FSEEKO=1
+  AC_REQUIRE([gl_HAVE_FSEEKO])
+  if test $gl_cv_func_fseeko = yes; then
+    REPLACE_FSEEKO=1
+  fi
+  AC_LIBOBJ([fseeko])
+  dnl If we are also using the fseek module, then fseek needs replacing, too.
+  m4_ifdef([gl_REPLACE_FSEEK], [gl_REPLACE_FSEEK])
 ])
index 8b8cbf72c788a70c4fbf7090f9e0f911d5457b6a..68684c274dbf17ca78eb7686201acb9fe744970a 100644 (file)
@@ -1,7 +1,7 @@
-# serial 24
+# serial 26
 # Obtaining file system usage information.
 
-# Copyright (C) 1997-1998, 2000-2001, 2003-2009 Free Software Foundation, Inc.
+# Copyright (C) 1997-1998, 2000-2001, 2003-2010 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -44,9 +44,10 @@ ac_fsusage_space=no
 # systems.  That system is reported to work fine with STAT_STATFS4 which
 # is what it gets when this test fails.
 if test $ac_fsusage_space = no; then
-  # SVR4
+  # glibc/{Hurd,kFreeBSD}, MacOS X >= 10.4, FreeBSD >= 5.0, NetBSD >= 3.0,
+  # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS.
   AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs],
-                [AC_TRY_LINK([#include <sys/types.h>
+                 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 #if defined __GLIBC__ && defined __linux__
 Do not use statvfs on systems with GNU libc on Linux, because that function
 stats all preceding entries in /proc/mounts, and that makes df hang if even
@@ -59,14 +60,14 @@ a system call.
 "Do not use Tru64's statvfs implementation"
 #endif
 
-#include <sys/statvfs.h>],
-                             [struct statvfs fsd; statvfs (0, &fsd);],
-                             fu_cv_sys_stat_statvfs=yes,
-                             fu_cv_sys_stat_statvfs=no)])
+#include <sys/statvfs.h>]],
+                                    [[struct statvfs fsd; statvfs (0, &fsd);]])],
+                                 [fu_cv_sys_stat_statvfs=yes],
+                                 [fu_cv_sys_stat_statvfs=no])])
   if test $fu_cv_sys_stat_statvfs = yes; then
     ac_fsusage_space=yes
     AC_DEFINE([STAT_STATVFS], [1],
-             [  Define if there is a function named statvfs.  (SVR4)])
+              [  Define if there is a function named statvfs.  (SVR4)])
   fi
 fi
 
@@ -74,7 +75,7 @@ if test $ac_fsusage_space = no; then
   # DEC Alpha running OSF/1
   AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
   AC_CACHE_VAL([fu_cv_sys_stat_statfs3_osf1],
-  [AC_TRY_RUN([
+  [AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/mount.h>
@@ -84,24 +85,29 @@ if test $ac_fsusage_space = no; then
     struct statfs fsd;
     fsd.f_fsize = 0;
     return statfs (".", &fsd, sizeof (struct statfs)) != 0;
-  }],
-  fu_cv_sys_stat_statfs3_osf1=yes,
-  fu_cv_sys_stat_statfs3_osf1=no,
-  fu_cv_sys_stat_statfs3_osf1=no)])
+  }]])],
+    [fu_cv_sys_stat_statfs3_osf1=yes],
+    [fu_cv_sys_stat_statfs3_osf1=no],
+    [fu_cv_sys_stat_statfs3_osf1=no])])
   AC_MSG_RESULT([$fu_cv_sys_stat_statfs3_osf1])
   if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
     ac_fsusage_space=yes
     AC_DEFINE([STAT_STATFS3_OSF1], [1],
-             [   Define if  statfs takes 3 args.  (DEC Alpha running OSF/1)])
+              [   Define if  statfs takes 3 args.  (DEC Alpha running OSF/1)])
   fi
 fi
 
 if test $ac_fsusage_space = no; then
-# AIX
-  AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
+  # glibc/Linux, MacOS X < 10.4, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4.
+  # (glibc/{Hurd,kFreeBSD}, MacOS X >= 10.4, FreeBSD >= 5.0, NetBSD >= 3.0,
+  # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.)
+  # (On IRIX you need to include <sys/statfs.h>, not only <sys/mount.h> and
+  # <sys/vfs.h>.)
+  # (On Solaris, statfs has 4 arguments.)
+  AC_MSG_CHECKING([for two-argument statfs with statfs.f_bsize dnl
 member (AIX, 4.3BSD)])
   AC_CACHE_VAL([fu_cv_sys_stat_statfs2_bsize],
-  [AC_TRY_RUN([
+  [AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
@@ -117,10 +123,10 @@ member (AIX, 4.3BSD)])
   struct statfs fsd;
   fsd.f_bsize = 0;
   return statfs (".", &fsd) != 0;
-  }],
-  fu_cv_sys_stat_statfs2_bsize=yes,
-  fu_cv_sys_stat_statfs2_bsize=no,
-  fu_cv_sys_stat_statfs2_bsize=no)])
+  }]])],
+    [fu_cv_sys_stat_statfs2_bsize=yes],
+    [fu_cv_sys_stat_statfs2_bsize=no],
+    [fu_cv_sys_stat_statfs2_bsize=no])])
   AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_bsize])
   if test $fu_cv_sys_stat_statfs2_bsize = yes; then
     ac_fsusage_space=yes
@@ -131,34 +137,41 @@ member (AIX, 4.3BSD)])
 fi
 
 if test $ac_fsusage_space = no; then
-# SVR3
+  # SVR3
+  # (Solaris already handled above.)
   AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
   AC_CACHE_VAL([fu_cv_sys_stat_statfs4],
-  [AC_TRY_RUN([#include <sys/types.h>
+  [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
 #include <sys/statfs.h>
   int
   main ()
   {
   struct statfs fsd;
   return statfs (".", &fsd, sizeof fsd, 0) != 0;
-  }],
-    fu_cv_sys_stat_statfs4=yes,
-    fu_cv_sys_stat_statfs4=no,
-    fu_cv_sys_stat_statfs4=no)])
+  }]])],
+    [fu_cv_sys_stat_statfs4=yes],
+    [fu_cv_sys_stat_statfs4=no],
+    [fu_cv_sys_stat_statfs4=no])])
   AC_MSG_RESULT([$fu_cv_sys_stat_statfs4])
   if test $fu_cv_sys_stat_statfs4 = yes; then
     ac_fsusage_space=yes
     AC_DEFINE([STAT_STATFS4], [1],
-             [  Define if statfs takes 4 args.  (SVR3, Dynix, Irix, Dolphin)])
+      [  Define if statfs takes 4 args.  (SVR3, Dynix, old Irix, old AIX, Dolphin)])
   fi
 fi
 
 if test $ac_fsusage_space = no; then
-# 4.4BSD and NetBSD
-  AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
+  # 4.4BSD and older NetBSD
+  # (OSF/1 already handled above.)
+  # (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.)
+  # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in
+  # <sys/mount.h>.)
+  AC_MSG_CHECKING([for two-argument statfs with statfs.f_fsize dnl
 member (4.4BSD and NetBSD)])
   AC_CACHE_VAL([fu_cv_sys_stat_statfs2_fsize],
-  [AC_TRY_RUN([#include <sys/types.h>
+  [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
@@ -171,10 +184,10 @@ member (4.4BSD and NetBSD)])
   struct statfs fsd;
   fsd.f_fsize = 0;
   return statfs (".", &fsd) != 0;
-  }],
-  fu_cv_sys_stat_statfs2_fsize=yes,
-  fu_cv_sys_stat_statfs2_fsize=no,
-  fu_cv_sys_stat_statfs2_fsize=no)])
+  }]])],
+    [fu_cv_sys_stat_statfs2_fsize=yes],
+    [fu_cv_sys_stat_statfs2_fsize=no],
+    [fu_cv_sys_stat_statfs2_fsize=no])])
   AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize])
   if test $fu_cv_sys_stat_statfs2_fsize = yes; then
     ac_fsusage_space=yes
@@ -188,7 +201,8 @@ if test $ac_fsusage_space = no; then
   # Ultrix
   AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
   AC_CACHE_VAL([fu_cv_sys_stat_fs_data],
-  [AC_TRY_RUN([#include <sys/types.h>
+  [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
@@ -205,10 +219,10 @@ if test $ac_fsusage_space = no; then
   /* Ultrix's statfs returns 1 for success,
      0 for not mounted, -1 for failure.  */
   return statfs (".", &fsd) != 1;
-  }],
-  fu_cv_sys_stat_fs_data=yes,
-  fu_cv_sys_stat_fs_data=no,
-  fu_cv_sys_stat_fs_data=no)])
+  }]])],
+    [fu_cv_sys_stat_fs_data=yes],
+    [fu_cv_sys_stat_fs_data=no],
+    [fu_cv_sys_stat_fs_data=no])])
   AC_MSG_RESULT([$fu_cv_sys_stat_fs_data])
   if test $fu_cv_sys_stat_fs_data = yes; then
     ac_fsusage_space=yes
@@ -220,12 +234,13 @@ fi
 
 if test $ac_fsusage_space = no; then
   # SVR2
-  AC_TRY_CPP([#include <sys/filsys.h>
-    ],
-    AC_DEFINE([STAT_READ_FILSYS], [1],
+  # (AIX, HP-UX, OSF/1 already handled above.)
+  AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/filsys.h>
+        ]])],
+    [AC_DEFINE([STAT_READ_FILSYS], [1],
       [Define if there is no specific function for reading file systems usage
        information and you have the <sys/filsys.h> header file.  (SVR2)])
-    ac_fsusage_space=yes)
+     ac_fsusage_space=yes])
 fi
 
 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
@@ -246,8 +261,8 @@ choke -- this is a workaround for a Sun-specific problem
 #endif
 #include <sys/types.h>
 #include <sys/vfs.h>]],
-    [[struct statfs t; long c = *(t.f_spare);
-      if (c) return 0;]])],
+      [[struct statfs t; long c = *(t.f_spare);
+        if (c) return 0;]])],
     [fu_cv_sys_truncating_statfs=yes],
     [fu_cv_sys_truncating_statfs=no])])
   if test $fu_cv_sys_truncating_statfs = yes; then
index 51308ef53bcea2f3e418ef2e69c02d934e374787..33201a0107c97112d74df42abab668c00ca203ed 100644 (file)
@@ -1,5 +1,5 @@
-# ftello.m4 serial 4
-dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+# ftello.m4 serial 8
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,18 +10,116 @@ AC_DEFUN([gl_FUNC_FTELLO],
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
 
-  dnl Persuade glibc <stdio.h> to declare fseeko().
+  dnl Persuade glibc <stdio.h> to declare ftello().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
   AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello],
     [
-      AC_TRY_LINK([#include <stdio.h>], [ftello (stdin);],
-       [gl_cv_func_ftello=yes], [gl_cv_func_ftello=no])
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <stdio.h>]],
+           [[ftello (stdin);]])],
+        [gl_cv_func_ftello=yes],
+        [gl_cv_func_ftello=no])
     ])
   if test $gl_cv_func_ftello = no; then
     HAVE_FTELLO=0
-    gl_REPLACE_FTELLO
-  elif test $gl_cv_var_stdin_large_offset = no; then
+  else
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FTELLO=1
+    else
+      dnl Detect bug on Solaris.
+      dnl ftell and ftello produce incorrect results after putc that followed a
+      dnl getc call that reached EOF on Solaris. This is because the _IOREAD
+      dnl flag does not get cleared in this case, even though _IOWRT gets set,
+      dnl and ftell and ftello look whether the _IOREAD flag is set.
+      AC_REQUIRE([AC_CANONICAL_HOST])
+      AC_CACHE_CHECK([whether ftello works],
+        [gl_cv_func_ftello_works],
+        [
+          dnl Initial guess, used when cross-compiling or when /dev/tty cannot
+          dnl be opened.
+changequote(,)dnl
+          case "$host_os" in
+                      # Guess no on Solaris.
+            solaris*) gl_cv_func_ftello_works="guessing no" ;;
+                      # Guess yes otherwise.
+            *)        gl_cv_func_ftello_works="guessing yes" ;;
+          esac
+changequote([,])dnl
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define TESTFILE "conftest.tmp"
+int
+main (void)
+{
+  FILE *fp;
+
+  /* Create a file with some contents.  */
+  fp = fopen (TESTFILE, "w");
+  if (fp == NULL)
+    return 70;
+  if (fwrite ("foogarsh", 1, 8, fp) < 8)
+    return 71;
+  if (fclose (fp))
+    return 72;
+
+  /* The file's contents is now "foogarsh".  */
+
+  /* Try writing after reading to EOF.  */
+  fp = fopen (TESTFILE, "r+");
+  if (fp == NULL)
+    return 73;
+  if (fseek (fp, -1, SEEK_END))
+    return 74;
+  if (!(getc (fp) == 'h'))
+    return 1;
+  if (!(getc (fp) == EOF))
+    return 2;
+  if (!(ftell (fp) == 8))
+    return 3;
+  if (!(ftell (fp) == 8))
+    return 4;
+  if (!(putc ('!', fp) == '!'))
+    return 5;
+  if (!(ftell (fp) == 9))
+    return 6;
+  if (!(fclose (fp) == 0))
+    return 7;
+  fp = fopen (TESTFILE, "r");
+  if (fp == NULL)
+    return 75;
+  {
+    char buf[10];
+    if (!(fread (buf, 1, 10, fp) == 9))
+      return 10;
+    if (!(memcmp (buf, "foogarsh!", 9) == 0))
+      return 11;
+  }
+  if (!(fclose (fp) == 0))
+    return 12;
+
+  /* The file's contents is now "foogarsh!".  */
+
+  return 0;
+}]])],
+            [gl_cv_func_ftello_works=yes],
+            [gl_cv_func_ftello_works=no], [:])
+        ])
+      case "$gl_cv_func_ftello_works" in
+        *yes) ;;
+        *)
+          REPLACE_FTELLO=1
+          AC_DEFINE([FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE], [1],
+            [Define to 1 if the system's ftello function has the Solaris bug.])
+          ;;
+      esac
+    fi
+  fi
+  if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
     gl_REPLACE_FTELLO
   fi
 ])
@@ -29,6 +127,4 @@ AC_DEFUN([gl_FUNC_FTELLO],
 AC_DEFUN([gl_REPLACE_FTELLO],
 [
   AC_LIBOBJ([ftello])
-  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  REPLACE_FTELLO=1
 ])
index e43c15f2a52a7e929d88db418cc00c9d6d9f7039..50e8678a1901b0cc69b5a6c467317c2991250f4e 100644 (file)
@@ -1,16 +1,18 @@
-# serial 14
+# serial 15
 
 # See if we need to emulate a missing ftruncate function using fcntl or chsize.
 
-# Copyright (C) 2000, 2001, 2003-2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# FIXME: remove this macro, along with all uses of HAVE_FTRUNCATE in 2010,
+# FIXME: remove this macro, along with all uses of HAVE_FTRUNCATE in 2012,
 # if the check below provokes no more reports.  So far, the only report
 # arose from a test build of this gnulib module, cross-compiling to mingw:
 # <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/9203>
+# Now (in 2010), MSVC has been raised as a possible target:
+# <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/21394/focus=21396>
 
 AC_DEFUN([gl_FUNC_FTRUNCATE],
 [
@@ -30,10 +32,10 @@ AC_DEFUN([gl_FUNC_FTRUNCATE],
         # a bug report to inform us about it.
         if test x"$SKIP_FTRUNCATE_CHECK" != xyes; then
           AC_MSG_FAILURE([Your system lacks the ftruncate function.
-             Please report this, along with the output of "uname -a", to the
-             bug-coreutils@gnu.org mailing list.  To continue past this point,
-             rerun configure with SKIP_FTRUNCATE_CHECK=yes.
-             E.g., ./configure SKIP_FTRUNCATE_CHECK=yes])
+              Please report this, along with the output of "uname -a", to the
+              bug-coreutils@gnu.org mailing list.  To continue past this point,
+              rerun configure with SKIP_FTRUNCATE_CHECK=yes.
+              E.g., ./configure SKIP_FTRUNCATE_CHECK=yes])
         fi
     esac
   fi
index 4088671987ade01fe1e50ca0e21dd269c6856306..bc3066db188ad0976801996f4382709459032311 100644 (file)
@@ -1,5 +1,5 @@
-# getaddrinfo.m4 serial 20
-dnl Copyright (C) 2004-2009 Free Software Foundation, Inc.
+# getaddrinfo.m4 serial 23
+dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -25,7 +25,7 @@ AC_DEFUN([gl_GETADDRINFO],
   LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
 
   AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
-    AC_TRY_LINK([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
@@ -34,21 +34,21 @@ AC_DEFUN([gl_GETADDRINFO],
 #include <netdb.h>
 #endif
 #include <stddef.h>
-], [getaddrinfo("", "", NULL, NULL);],
+]], [[getaddrinfo("", "", NULL, NULL);]])],
       [gl_cv_func_getaddrinfo=yes],
       [gl_cv_func_getaddrinfo=no])])
   if test $gl_cv_func_getaddrinfo = no; then
     AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32],
-                  gl_cv_w32_getaddrinfo, [
+                   gl_cv_w32_getaddrinfo, [
       gl_cv_w32_getaddrinfo=no
       am_save_LIBS="$LIBS"
       LIBS="$LIBS -lws2_32"
-      AC_TRY_LINK([
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #ifdef HAVE_WS2TCPIP_H
 #include <ws2tcpip.h>
 #endif
 #include <stddef.h>
-], [getaddrinfo(NULL, NULL, NULL, NULL);], gl_cv_w32_getaddrinfo=yes)
+]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], [gl_cv_w32_getaddrinfo=yes])
       LIBS="$am_save_LIBS"
     ])
     if test "$gl_cv_w32_getaddrinfo" = "yes"; then
@@ -64,7 +64,7 @@ AC_DEFUN([gl_GETADDRINFO],
   # header included somehow.
   AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)],
     gl_cv_func_gai_strerror, [
-      AC_TRY_LINK([
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
@@ -76,7 +76,7 @@ AC_DEFUN([gl_GETADDRINFO],
 #include <ws2tcpip.h>
 #endif
 #include <stddef.h>
-], [gai_strerror (NULL);],
+]], [[gai_strerror (NULL);]])],
         [gl_cv_func_gai_strerror=yes],
         [gl_cv_func_gai_strerror=no])])
   if test $gl_cv_func_gai_strerror = no; then
@@ -96,6 +96,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
   AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
   AC_REQUIRE([gl_HOSTENT]) dnl for HOSTENT_LIB
   AC_REQUIRE([gl_SERVENT]) dnl for SERVENT_LIB
+  AC_REQUIRE([gl_FUNC_INET_NTOP]) dnl for INET_NTOP_LIB
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_SOCKET_FAMILIES])
   AC_REQUIRE([gl_HEADER_SYS_SOCKET])
@@ -163,4 +164,10 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
     *" $SERVENT_LIB "*) ;;
     *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;;
   esac
+
+  dnl Append $INET_NTOP_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
+  case " $GETADDRINFO_LIB " in
+    *" $INET_NTOP_LIB "*) ;;
+    *) GETADDRINFO_LIB="$GETADDRINFO_LIB $INET_NTOP_LIB" ;;
+  esac
 ])
index 9b683c2febbd599f6a8351105b01ff4633996b33..d05e9d9143c70b3f3afd3caf0eb30f17fb9c1b4a 100644 (file)
-# getopt.m4 serial 14
-dnl Copyright (C) 2002-2006, 2008 Free Software Foundation, Inc.
+# getopt.m4 serial 31
+dnl Copyright (C) 2002-2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-# The getopt module assume you want GNU getopt, with getopt_long etc,
-# rather than vanilla POSIX getopt.  This means your code should
-# always include <getopt.h> for the getopt prototypes.
+# Request a POSIX compliant getopt function.
+AC_DEFUN([gl_FUNC_GETOPT_POSIX],
+[
+  m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  gl_GETOPT_IFELSE([
+    gl_REPLACE_GETOPT
+  ],
+  [])
+])
+
+# Request a POSIX compliant getopt function with GNU extensions (such as
+# options with optional arguments) and the functions getopt_long,
+# getopt_long_only.
+AC_DEFUN([gl_FUNC_GETOPT_GNU],
+[
+  m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU])
+
+  AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
+])
 
-AC_DEFUN([gl_GETOPT_SUBSTITUTE],
+# Request the gnulib implementation of the getopt functions unconditionally.
+# argp.m4 uses this.
+AC_DEFUN([gl_REPLACE_GETOPT],
 [
+  dnl Arrange for getopt.h to be created.
+  gl_GETOPT_SUBSTITUTE_HEADER
+  dnl Arrange for unistd.h to include getopt.h.
+  GNULIB_UNISTD_H_GETOPT=1
+  dnl Arrange to compile the getopt implementation.
   AC_LIBOBJ([getopt])
   AC_LIBOBJ([getopt1])
-  gl_GETOPT_SUBSTITUTE_HEADER
   gl_PREREQ_GETOPT
 ])
 
-AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
+# emacs' configure.in uses this.
+AC_DEFUN([gl_GETOPT_IFELSE],
 [
-  GETOPT_H=getopt.h
-  AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
-    [Define to rpl_ if the getopt replacement functions and variables
-     should be used.])
-  AC_SUBST([GETOPT_H])
+  AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
+  AS_IF([test -n "$gl_replace_getopt"], [$1], [$2])
 ])
 
+# Determine whether to replace the entire getopt facility.
 AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 [
-  if test -z "$GETOPT_H"; then
-    AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON
+
+  dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt.
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  gl_CHECK_NEXT_HEADERS([getopt.h])
+  AC_CHECK_HEADERS_ONCE([getopt.h])
+  if test $ac_cv_header_getopt_h = yes; then
+    HAVE_GETOPT_H=1
+  else
+    HAVE_GETOPT_H=0
+  fi
+  AC_SUBST([HAVE_GETOPT_H])
+
+  gl_replace_getopt=
+
+  dnl Test whether <getopt.h> is available.
+  if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+    AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes])
+  fi
+
+  dnl Test whether the function getopt_long is available.
+  if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+    AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
   fi
 
-  if test -z "$GETOPT_H"; then
-    AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
+  dnl BSD getopt_long uses an incompatible method to reset option processing.
+  dnl Existence of the variable, in and of itself, is not a reason to replace
+  dnl getopt, but knowledge of the variable is needed to determine how to
+  dnl reset and whether a reset reparses the environment.
+  dnl Solaris supports neither optreset nor optind=0, but keeps no state that
+  dnl needs a reset beyond setting optind=1; detect Solaris by getopt_clip.
+  if test -z "$gl_replace_getopt"; then
+    AC_CHECK_DECLS([optreset], [],
+      [AC_CHECK_DECLS([getopt_clip], [], [],
+        [[#include <getopt.h>]])
+      ],
+      [[#include <getopt.h>]])
   fi
 
-  dnl BSD getopt_long uses an incompatible method to reset option processing,
-  dnl and (as of 2004-10-15) mishandles optional option-arguments.
-  if test -z "$GETOPT_H"; then
-    AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
+  dnl mingw's getopt (in libmingwex.a) does weird things when the options
+  dnl strings starts with '+' and it's not the first call.  Some internal state
+  dnl is left over from earlier calls, and neither setting optind = 0 nor
+  dnl setting optreset = 1 get rid of this internal state.
+  dnl POSIX is silent on optind vs. optreset, so we allow either behavior.
+  dnl POSIX 2008 does not specify leading '+' behavior, but see
+  dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
+  dnl the next version of POSIX.  For now, we only guarantee leading '+'
+  dnl behavior with getopt-gnu.
+  if test -z "$gl_replace_getopt"; then
+    AC_CACHE_CHECK([whether getopt is POSIX compatible],
+      [gl_cv_func_getopt_posix],
+      [
+        dnl This test fails on mingw and succeeds on many other platforms.
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if !HAVE_DECL_OPTRESET && !HAVE_DECL_GETOPT_CLIP
+# define OPTIND_MIN 0
+#else
+# define OPTIND_MIN 1
+#endif
+
+int
+main ()
+{
+  {
+    int argc = 0;
+    char *argv[10];
+    int c;
+
+    argv[argc++] = "program";
+    argv[argc++] = "-a";
+    argv[argc++] = "foo";
+    argv[argc++] = "bar";
+    argv[argc] = NULL;
+    optind = OPTIND_MIN;
+    opterr = 0;
+
+    c = getopt (argc, argv, "ab");
+    if (!(c == 'a'))
+      return 1;
+    c = getopt (argc, argv, "ab");
+    if (!(c == -1))
+      return 2;
+    if (!(optind == 2))
+      return 3;
+  }
+  /* Some internal state exists at this point.  */
+  {
+    int argc = 0;
+    char *argv[10];
+    int c;
+
+    argv[argc++] = "program";
+    argv[argc++] = "donald";
+    argv[argc++] = "-p";
+    argv[argc++] = "billy";
+    argv[argc++] = "duck";
+    argv[argc++] = "-a";
+    argv[argc++] = "bar";
+    argv[argc] = NULL;
+    optind = OPTIND_MIN;
+    opterr = 0;
+
+    c = getopt (argc, argv, "+abp:q:");
+    if (!(c == -1))
+      return 4;
+    if (!(strcmp (argv[0], "program") == 0))
+      return 5;
+    if (!(strcmp (argv[1], "donald") == 0))
+      return 6;
+    if (!(strcmp (argv[2], "-p") == 0))
+      return 7;
+    if (!(strcmp (argv[3], "billy") == 0))
+      return 8;
+    if (!(strcmp (argv[4], "duck") == 0))
+      return 9;
+    if (!(strcmp (argv[5], "-a") == 0))
+      return 10;
+    if (!(strcmp (argv[6], "bar") == 0))
+      return 11;
+    if (!(optind == 1))
+      return 12;
+  }
+  /* Detect MacOS 10.5, AIX 7.1 bug.  */
+  {
+    char *argv[3] = { "program", "-ab", NULL };
+    optind = OPTIND_MIN;
+    opterr = 0;
+    if (getopt (2, argv, "ab:") != 'a')
+      return 13;
+    if (getopt (2, argv, "ab:") != '?')
+      return 14;
+    if (optopt != 'b')
+      return 15;
+    if (optind != 2)
+      return 16;
+  }
+
+  return 0;
+}
+]])],
+          [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
+          [case "$host_os" in
+             mingw*)         gl_cv_func_getopt_posix="guessing no";;
+             darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
+             *)              gl_cv_func_getopt_posix="guessing yes";;
+           esac
+          ])
+      ])
+    case "$gl_cv_func_getopt_posix" in
+      *no) gl_replace_getopt=yes ;;
+    esac
   fi
 
-  dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
-  dnl option string (as of 2005-05-05).
-  if test -z "$GETOPT_H"; then
-    AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt],
-      [AC_RUN_IFELSE(
-       [AC_LANG_PROGRAM([[#include <getopt.h>]],
-          [[
-            char *myargv[3];
-            myargv[0] = "conftest";
-            myargv[1] = "-+";
-            myargv[2] = 0;
-            return getopt (2, myargv, "+a") != '?';
-          ]])],
-       [gl_cv_func_gnu_getopt=yes],
-       [gl_cv_func_gnu_getopt=no],
-       [dnl cross compiling - pessimistically guess based on decls
-        dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
-        dnl option string (as of 2005-05-05).
-        AC_CHECK_DECL([getopt_clip],
-          [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes],
-          [#include <getopt.h>])])])
-    if test "$gl_cv_func_gnu_getopt" = "no"; then
-      GETOPT_H=getopt.h
+  if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+    AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu],
+      [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
+       # optstring is necessary for programs like m4 that have POSIX-mandated
+       # semantics for supporting options interspersed with files.
+       # Also, since getopt_long is a GNU extension, we require optind=0.
+       # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
+       # so take care to revert to the correct (non-)export state.
+dnl GNU Coding Standards currently allow awk but not env; besides, env
+dnl is ambiguous with environment values that contain newlines.
+       gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
+       case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
+         xx) gl_had_POSIXLY_CORRECT=exported ;;
+         x)  gl_had_POSIXLY_CORRECT=yes      ;;
+         *)  gl_had_POSIXLY_CORRECT=         ;;
+       esac
+       POSIXLY_CORRECT=1
+       export POSIXLY_CORRECT
+       AC_RUN_IFELSE(
+        [AC_LANG_PROGRAM([[#include <getopt.h>
+                           #include <stddef.h>
+                           #include <string.h>
+           ]], [[
+             /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
+                and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+                OSF/1 5.1, Solaris 10.  */
+             {
+               char *myargv[3];
+               myargv[0] = "conftest";
+               myargv[1] = "-+";
+               myargv[2] = 0;
+               opterr = 0;
+               if (getopt (2, myargv, "+a") != '?')
+                 return 1;
+             }
+             /* This code succeeds on glibc 2.8, mingw,
+                and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+                IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
+             {
+               char *argv[] = { "program", "-p", "foo", "bar", NULL };
+
+               optind = 1;
+               if (getopt (4, argv, "p::") != 'p')
+                 return 2;
+               if (optarg != NULL)
+                 return 3;
+               if (getopt (4, argv, "p::") != -1)
+                 return 4;
+               if (optind != 2)
+                 return 5;
+             }
+             /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
+             {
+               char *argv[] = { "program", "foo", "-p", NULL };
+               optind = 0;
+               if (getopt (3, argv, "-p") != 1)
+                 return 6;
+               if (getopt (3, argv, "-p") != 'p')
+                 return 7;
+             }
+             /* This code fails on glibc 2.11.  */
+             {
+               char *argv[] = { "program", "-b", "-a", NULL };
+               optind = opterr = 0;
+               if (getopt (3, argv, "+:a:b") != 'b')
+                 return 8;
+               if (getopt (3, argv, "+:a:b") != ':')
+                 return 9;
+             }
+             return 0;
+           ]])],
+        [gl_cv_func_getopt_gnu=yes],
+        [gl_cv_func_getopt_gnu=no],
+        [dnl Cross compiling. Guess based on host and declarations.
+         case $host_os:$ac_cv_have_decl_optreset in
+           *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
+           *:yes)               gl_cv_func_getopt_gnu=no;;
+           *)                   gl_cv_func_getopt_gnu=yes;;
+         esac
+        ])
+       case $gl_had_POSIXLY_CORRECT in
+         exported) ;;
+         yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;;
+         *) AS_UNSET([POSIXLY_CORRECT]) ;;
+       esac
+      ])
+    if test "$gl_cv_func_getopt_gnu" = "no"; then
+      gl_replace_getopt=yes
     fi
   fi
 ])
 
-AC_DEFUN([gl_GETOPT_IFELSE],
+# emacs' configure.in uses this.
+AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 [
-  AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
-  AS_IF([test -n "$GETOPT_H"], [$1], [$2])
+  GETOPT_H=getopt.h
+  AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
+    [Define to rpl_ if the getopt replacement functions and variables
+     should be used.])
+  AC_SUBST([GETOPT_H])
 ])
 
-AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
-
 # Prerequisites of lib/getopt*.
+# emacs' configure.in uses this.
 AC_DEFUN([gl_PREREQ_GETOPT],
 [
   AC_CHECK_DECLS_ONCE([getenv])
index 0fec7d42b7c7dfcca7f73e679b849b351d2b8315..709a4d4fb4723c132082ced5fdbc454945985743 100644 (file)
@@ -1,6 +1,6 @@
-# serial 12
+# serial 15
 
-# Copyright (C) 2001-2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -11,33 +11,53 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
   AC_CHECK_FUNCS_ONCE([gettimeofday])
 
-  AC_CACHE_CHECK([for gettimeofday with POSIX signature],
-    [gl_cv_func_gettimeofday_posix_signature],
-    [AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-         [[#include <sys/time.h>
-           struct timeval c;
-         ]],
-         [[
-           int (*f) (struct timeval *restrict, void *restrict) = gettimeofday;
-           int x = f (&c, 0);
-           return !(x | c.tv_sec | c.tv_usec);
-         ]])],
-       [gl_cv_func_gettimeofday_posix_signature=yes],
-       [gl_cv_func_gettimeofday_posix_signature=no])])
-
-  gl_FUNC_GETTIMEOFDAY_CLOBBER
-
-  if test $gl_cv_func_gettimeofday_posix_signature != yes; then
-    REPLACE_GETTIMEOFDAY=1
-    SYS_TIME_H=sys/time.h
-    if test $gl_cv_func_gettimeofday_clobber != yes; then
+  gl_gettimeofday_timezone=void
+  if test $ac_cv_func_gettimeofday != yes; then
+    HAVE_GETTIMEOFDAY=0
+    AC_LIBOBJ([gettimeofday])
+    gl_PREREQ_GETTIMEOFDAY
+  else
+    gl_FUNC_GETTIMEOFDAY_CLOBBER
+    AC_CACHE_CHECK([for gettimeofday with POSIX signature],
+      [gl_cv_func_gettimeofday_posix_signature],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#include <sys/time.h>
+              struct timeval c;
+              int gettimeofday (struct timeval *restrict, void *restrict);
+            ]],
+            [[/* glibc uses struct timezone * rather than the POSIX void *
+                 if _GNU_SOURCE is defined.  However, since the only portable
+                 use of gettimeofday uses NULL as the second parameter, and
+                 since the glibc definition is actually more typesafe, it is
+                 not worth wrapping this to get a compliant signature.  */
+              int (*f) (struct timeval *restrict, void *restrict)
+                = gettimeofday;
+              int x = f (&c, 0);
+              return !(x | c.tv_sec | c.tv_usec);
+            ]])],
+          [gl_cv_func_gettimeofday_posix_signature=yes],
+          [AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM(
+              [[#include <sys/time.h>
+int gettimeofday (struct timeval *restrict, struct timezone *restrict);
+              ]])],
+            [gl_cv_func_gettimeofday_posix_signature=almost],
+            [gl_cv_func_gettimeofday_posix_signature=no])])])
+    if test $gl_cv_func_gettimeofday_posix_signature = almost; then
+      gl_gettimeofday_timezone='struct timezone'
+    elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
+      REPLACE_GETTIMEOFDAY=1
       AC_LIBOBJ([gettimeofday])
       gl_PREREQ_GETTIMEOFDAY
     fi
   fi
+  AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
+    [Define this to 'void' or 'struct timezone' to match the system's
+     declaration of the second argument to gettimeofday.])
 ])
 
 
@@ -56,21 +76,21 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
   [gl_cv_func_gettimeofday_clobber],
   [AC_RUN_IFELSE(
      [AC_LANG_PROGRAM(
-       [[#include <string.h>
-         #include <sys/time.h>
-         #include <time.h>
-         #include <stdlib.h>
-       ]],
-       [[
-         time_t t = 0;
-         struct tm *lt;
-         struct tm saved_lt;
-         struct timeval tv;
-         lt = localtime (&t);
-         saved_lt = *lt;
-         gettimeofday (&tv, NULL);
-         return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
-       ]])],
+        [[#include <string.h>
+          #include <sys/time.h>
+          #include <time.h>
+          #include <stdlib.h>
+        ]],
+        [[
+          time_t t = 0;
+          struct tm *lt;
+          struct tm saved_lt;
+          struct timeval tv;
+          lt = localtime (&t);
+          saved_lt = *lt;
+          gettimeofday (&tv, NULL);
+          return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
+        ]])],
      [gl_cv_func_gettimeofday_clobber=no],
      [gl_cv_func_gettimeofday_clobber=yes],
      dnl When crosscompiling, assume it is broken.
@@ -78,7 +98,6 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
 
  if test $gl_cv_func_gettimeofday_clobber = yes; then
    REPLACE_GETTIMEOFDAY=1
-   SYS_TIME_H=sys/time.h
    gl_GETTIMEOFDAY_REPLACE_LOCALTIME
    AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
      [Define if gettimeofday clobbers the localtime buffer.])
index 93fbf4745922719a47db7f0300eb1f202310eaf6..68ada9d4d5b844e3ff5be076ec1156c542f6630e 100644 (file)
@@ -1,5 +1,5 @@
 # glibc21.m4 serial 4
-dnl Copyright (C) 2000-2002, 2004, 2008 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,16 +12,16 @@ AC_DEFUN([gl_GLIBC21],
     AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
       [ac_cv_gnu_library_2_1],
       [AC_EGREP_CPP([Lucky GNU user],
-       [
+        [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
   Lucky GNU user
  #endif
 #endif
-       ],
-       [ac_cv_gnu_library_2_1=yes],
-       [ac_cv_gnu_library_2_1=no])
+        ],
+        [ac_cv_gnu_library_2_1=yes],
+        [ac_cv_gnu_library_2_1=no])
       ]
     )
     AC_SUBST([GLIBC21])
index 3b9306379767cef27dbaa34d068cb3a52116d6d4..085441c066b27c1623519520848359f208d5224a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2009 Free Software Foundation, Inc.
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
 #
 # This file represents the specification of how gnulib-tool is used.
 # It acts as a cache: It is written and read by gnulib-tool.
-# In projects using CVS, this file is meant to be stored in CVS,
-# like the configure.ac and various Makefile.am files.
+# In projects that use version control, this file is meant to be put under
+# version control, like the configure.ac and various Makefile.am files.
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --tests-base=tests --aux-dir=config --libtool --macro-prefix=gl base64 fseeko fsusage ftello ftruncate full-read full-write getaddrinfo getopt lock lseek mkdtemp physmem regex visibility
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --tests-base=tests --aux-dir=config --libtool --macro-prefix=gl base64 environ fseeko fsusage ftello ftruncate full-read full-write getaddrinfo getopt-gnu inet_pton lock lseek mkdtemp physmem regex
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
 gl_MODULES([
   base64
+  environ
   fseeko
   fsusage
   ftello
@@ -28,13 +29,13 @@ gl_MODULES([
   full-read
   full-write
   getaddrinfo
-  getopt
+  getopt-gnu
+  inet_pton
   lock
   lseek
   mkdtemp
   physmem
   regex
-  visibility
 ])
 gl_AVOID([])
 gl_SOURCE_BASE([gnulib])
index c8fda2033045d38975415f240bd9a72a14a2c949..4c7ac30d0fac314cfa28fc9788ef33917d234ad7 100644 (file)
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 11
-dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 20
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -23,23 +23,83 @@ AC_DEFUN([gl_COMMON_BODY], [
 # define __GNUC_STDC_INLINE__ 1
 #endif])
   AH_VERBATIM([unused_parameter],
-[/* Define as a marker that can be attached to function parameter declarations
-   for parameters that are not used.  This helps to reduce warnings, such as
-   from GCC -Wunused-parameter.  */
+[/* Define as a marker that can be attached to declarations that might not
+    be used.  This helps to reduce warnings, such as from
+    GCC -Wunused-parameter.  */
 #if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _UNUSED_PARAMETER_ __attribute__ ((__unused__))
+# define _GL_UNUSED __attribute__ ((__unused__))
 #else
-# define _UNUSED_PARAMETER_
+# define _GL_UNUSED
 #endif
+/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
+   is a misnomer outside of parameter lists.  */
+#define _UNUSED_PARAMETER_ _GL_UNUSED
 ])
+  dnl Preparation for running test programs:
+  dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+  dnl to /dev/tty, so they can be redirected to log files.  Such diagnostics
+  dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+  LIBC_FATAL_STDERR_=1
+  export LIBC_FATAL_STDERR_
+])
+
+# gl_MODULE_INDICATOR_CONDITION
+# expands to a C preprocessor expression that evaluates to 1 or 0, depending
+# whether a gnulib module that has been requested shall be considered present
+# or not.
+AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
+# sets the shell variable that indicates the presence of the given module to
+# a C preprocessor expression that will evaluate to 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
+[
+  GNULIB_[]m4_translit([[$1]],
+    [abcdefghijklmnopqrstuvwxyz./-],
+    [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
 ])
 
 # gl_MODULE_INDICATOR([modulename])
-# defines a C macro indicating the presence of the given module.
+# defines a C macro indicating the presence of the given module
+# in a location where it can be used.
+#                                             |  Value  |   Value   |
+#                                             | in lib/ | in tests/ |
+# --------------------------------------------+---------+-----------+
+# Module present among main modules:          |    1    |     1     |
+# --------------------------------------------+---------+-----------+
+# Module present among tests-related modules: |    0    |     1     |
+# --------------------------------------------+---------+-----------+
+# Module not present at all:                  |    0    |     0     |
+# --------------------------------------------+---------+-----------+
 AC_DEFUN([gl_MODULE_INDICATOR],
 [
-  AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
-    [Define to 1 when using the gnulib module ]$1[.])
+  AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]],
+      [abcdefghijklmnopqrstuvwxyz./-],
+      [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
+    [gl_MODULE_INDICATOR_CONDITION],
+    [Define to a C preprocessor expression that evaluates to 1 or 0,
+     depending whether the gnulib module $1 shall be considered present.])
+])
+
+# gl_MODULE_INDICATOR_FOR_TESTS([modulename])
+# defines a C macro indicating the presence of the given module
+# in lib or tests. This is useful to determine whether the module
+# should be tested.
+#                                             |  Value  |   Value   |
+#                                             | in lib/ | in tests/ |
+# --------------------------------------------+---------+-----------+
+# Module present among main modules:          |    1    |     1     |
+# --------------------------------------------+---------+-----------+
+# Module present among tests-related modules: |    1    |     1     |
+# --------------------------------------------+---------+-----------+
+# Module not present at all:                  |    0    |     0     |
+# --------------------------------------------+---------+-----------+
+AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
+[
+  AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]],
+      [abcdefghijklmnopqrstuvwxyz./-],
+      [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
+    [Define to 1 when the gnulib module $1 should be tested.])
 ])
 
 # m4_foreach_w
@@ -49,10 +109,25 @@ m4_ifndef([m4_foreach_w],
   [m4_define([m4_foreach_w],
     [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
 
+# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
+# ----------------------------------------------------
+# Backport of autoconf-2.63b's macro.
+# Remove this macro when we can assume autoconf >= 2.64.
+m4_ifndef([AS_VAR_IF],
+[m4_define([AS_VAR_IF],
+[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
+
 # AC_PROG_MKDIR_P
-# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
-# Remove this macro when we can assume autoconf >= 2.60.
-m4_ifdef([AC_PROG_MKDIR_P], [], [
+# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
+# for interoperability with automake-1.9.6 from autoconf-2.62.
+# Remove this macro when we can assume autoconf >= 2.62 or
+# autoconf >= 2.60 && automake >= 1.10.
+m4_ifdef([AC_PROG_MKDIR_P], [
+  dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
+  m4_define([AC_PROG_MKDIR_P],
+    m4_defn([AC_PROG_MKDIR_P])[
+    AC_SUBST([MKDIR_P])])], [
+  dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
   AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
     [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
      MKDIR_P='$(mkdir_p)'
@@ -63,6 +138,7 @@ m4_ifdef([AC_PROG_MKDIR_P], [], [
 # so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
 # works.
 # This definition can be removed once autoconf >= 2.62 can be assumed.
+m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.62]),[-1],[
 AC_DEFUN([AC_C_RESTRICT],
 [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
   [ac_cv_c_restrict=no
@@ -70,13 +146,13 @@ AC_DEFUN([AC_C_RESTRICT],
    for ac_kw in __restrict __restrict__ _Restrict restrict; do
      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
       [[typedef int * int_ptr;
-       int foo (int_ptr $ac_kw ip) {
-       return ip[0];
+        int foo (int_ptr $ac_kw ip) {
+        return ip[0];
        }]],
       [[int s[1];
-       int * $ac_kw t = s;
-       t[0] = 0;
-       return foo(t)]])],
+        int * $ac_kw t = s;
+        t[0] = 0;
+        return foo(t)]])],
       [ac_cv_c_restrict=$ac_kw])
      test "$ac_cv_c_restrict" != no && break
    done
@@ -100,6 +176,7 @@ AC_DEFUN([AC_C_RESTRICT],
    *)  AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
  esac
 ])
+])
 
 # gl_BIGENDIAN
 # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
index d88cfc62a677d042f8db7e4c169aaebef0f3c9df..01604ee194d2571ade6073ae35399eb08e4e5bb9 100644 (file)
@@ -1,5 +1,5 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2009 Free Software Foundation, Inc.
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
@@ -12,7 +12,8 @@
 # This file represents the compiled summary of the specification in
 # gnulib-cache.m4. It lists the computed macro invocations that need
 # to be invoked from configure.ac.
-# In projects using CVS, this file can be treated like other built files.
+# In projects that use version control, this file can be treated like
+# other built files.
 
 
 # This macro should be invoked from ./configure.in, in the section
@@ -26,10 +27,86 @@ AC_DEFUN([gl_EARLY],
   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
   AC_REQUIRE([AC_PROG_RANLIB])
   AC_REQUIRE([AM_PROG_CC_C_O])
+  # Code from module alignof:
+  # Code from module alloca-opt:
+  # Code from module arg-nonnull:
+  # Code from module arpa_inet:
+  # Code from module base64:
+  # Code from module btowc:
+  # Code from module c++defs:
+  # Code from module c-ctype:
+  # Code from module configmake:
+  # Code from module environ:
+  # Code from module errno:
+  # Code from module extensions:
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  # Code from module float:
+  # Code from module fseeko:
   AC_REQUIRE([AC_FUNC_FSEEKO])
+  # Code from module fsusage:
+  # Code from module ftello:
   AC_REQUIRE([AC_FUNC_FSEEKO])
+  # Code from module ftruncate:
+  # Code from module full-read:
+  # Code from module full-write:
+  # Code from module getaddrinfo:
+  # Code from module getopt-gnu:
+  # Code from module getopt-posix:
+  # Code from module gettext-h:
+  # Code from module gettimeofday:
+  # Code from module havelib:
+  # Code from module hostent:
+  # Code from module include_next:
+  # Code from module inet_ntop:
+  # Code from module inet_pton:
+  # Code from module langinfo:
+  # Code from module localcharset:
+  # Code from module lock:
+  # Code from module lseek:
+  # Code from module lstat:
+  # Code from module malloc-gnu:
+  # Code from module malloc-posix:
+  # Code from module mbrtowc:
+  # Code from module mbsinit:
+  # Code from module memchr:
+  # Code from module mkdtemp:
+  # Code from module multiarch:
+  # Code from module netdb:
+  # Code from module netinet_in:
+  # Code from module nl_langinfo:
+  # Code from module physmem:
+  # Code from module regex:
+  # Code from module safe-read:
+  # Code from module safe-write:
+  # Code from module servent:
+  # Code from module size_max:
+  # Code from module snprintf:
+  # Code from module socklen:
+  # Code from module ssize_t:
+  # Code from module stat:
+  # Code from module stdbool:
+  # Code from module stddef:
+  # Code from module stdint:
+  # Code from module stdio:
+  # Code from module stdlib:
+  # Code from module streq:
+  # Code from module string:
+  # Code from module sys_socket:
+  # Code from module sys_stat:
+  # Code from module sys_time:
+  # Code from module tempname:
+  # Code from module threadlib:
   gl_THREADLIB_EARLY
+  # Code from module time:
+  # Code from module unistd:
+  # Code from module vasnprintf:
+  # Code from module verify:
+  # Code from module warn-on-use:
+  # Code from module wchar:
+  # Code from module wcrtomb:
+  # Code from module wctype:
+  # Code from module write:
+  # Code from module xsize:
 ])
 
 # This macro should be invoked from ./configure.in, in the section
@@ -38,6 +115,7 @@ AC_DEFUN([gl_INIT],
 [
   AM_CONDITIONAL([GL_COND_LIBTOOL], [true])
   gl_cond_libtool=true
+  gl_m4_base='config/gnulib'
   m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
   m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
@@ -45,89 +123,177 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([gl_LIBSOURCES_DIR], [])
   gl_COMMON
   gl_source_base='gnulib'
-changequote(,)dnl
-LTALLOCA=`echo "$ALLOCA" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
-changequote([, ])dnl
-AC_SUBST([LTALLOCA])
+  # Code from module alignof:
+  # Code from module alloca-opt:
   gl_FUNC_ALLOCA
+  # Code from module arg-nonnull:
+  # Code from module arpa_inet:
   gl_HEADER_ARPA_INET
   AC_PROG_MKDIR_P
+  # Code from module base64:
   gl_FUNC_BASE64
+  # Code from module btowc:
   gl_FUNC_BTOWC
   gl_WCHAR_MODULE_INDICATOR([btowc])
-  AC_REQUIRE([gl_HEADER_ERRNO_H])
+  # Code from module c++defs:
+  # Code from module c-ctype:
+  # Code from module configmake:
+  # Code from module environ:
+  gl_ENVIRON
+  gl_UNISTD_MODULE_INDICATOR([environ])
+  # Code from module errno:
+  gl_HEADER_ERRNO_H
+  # Code from module extensions:
+  # Code from module float:
   gl_FLOAT_H
+  # Code from module fseeko:
   gl_FUNC_FSEEKO
   gl_STDIO_MODULE_INDICATOR([fseeko])
+  # Code from module fsusage:
   gl_FSUSAGE
+  # Code from module ftello:
   gl_FUNC_FTELLO
   gl_STDIO_MODULE_INDICATOR([ftello])
+  # Code from module ftruncate:
   gl_FUNC_FTRUNCATE
   gl_UNISTD_MODULE_INDICATOR([ftruncate])
+  # Code from module full-read:
+  # Code from module full-write:
+  # Code from module getaddrinfo:
   gl_GETADDRINFO
   gl_NETDB_MODULE_INDICATOR([getaddrinfo])
-  gl_GETOPT
+  # Code from module getopt-gnu:
+  gl_FUNC_GETOPT_GNU
+  gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
+  # Code from module getopt-posix:
+  gl_FUNC_GETOPT_POSIX
+  # Code from module gettext-h:
   AC_SUBST([LIBINTL])
   AC_SUBST([LTLIBINTL])
+  # Code from module gettimeofday:
   gl_FUNC_GETTIMEOFDAY
+  gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
+  # Code from module havelib:
+  # Code from module hostent:
   gl_HOSTENT
-  gl_INET_NTOP
+  # Code from module include_next:
+  # Code from module inet_ntop:
+  gl_FUNC_INET_NTOP
   gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
+  # Code from module inet_pton:
+  gl_FUNC_INET_PTON
+  gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
+  # Code from module langinfo:
+  gl_LANGINFO_H
+  # Code from module localcharset:
   gl_LOCALCHARSET
   LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
   AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
+  # Code from module lock:
   gl_LOCK
+  # Code from module lseek:
   gl_FUNC_LSEEK
   gl_UNISTD_MODULE_INDICATOR([lseek])
+  # Code from module lstat:
   gl_FUNC_LSTAT
   gl_SYS_STAT_MODULE_INDICATOR([lstat])
-  AC_FUNC_MALLOC
-  AC_DEFINE([GNULIB_MALLOC_GNU], 1, [Define to indicate the 'malloc' module.])
+  # Code from module malloc-gnu:
+  gl_FUNC_MALLOC_GNU
+  gl_MODULE_INDICATOR([malloc-gnu])
+  # Code from module malloc-posix:
   gl_FUNC_MALLOC_POSIX
   gl_STDLIB_MODULE_INDICATOR([malloc-posix])
+  # Code from module mbrtowc:
   gl_FUNC_MBRTOWC
   gl_WCHAR_MODULE_INDICATOR([mbrtowc])
+  # Code from module mbsinit:
   gl_FUNC_MBSINIT
   gl_WCHAR_MODULE_INDICATOR([mbsinit])
+  # Code from module memchr:
+  gl_FUNC_MEMCHR
+  gl_STRING_MODULE_INDICATOR([memchr])
+  # Code from module mkdtemp:
   gt_FUNC_MKDTEMP
   gl_STDLIB_MODULE_INDICATOR([mkdtemp])
-  AC_REQUIRE([gl_MULTIARCH])
+  # Code from module multiarch:
+  gl_MULTIARCH
+  # Code from module netdb:
   gl_HEADER_NETDB
+  # Code from module netinet_in:
   gl_HEADER_NETINET_IN
   AC_PROG_MKDIR_P
+  # Code from module nl_langinfo:
+  gl_FUNC_NL_LANGINFO
+  gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
+  # Code from module physmem:
   gl_PHYSMEM
+  # Code from module regex:
   gl_REGEX
+  # Code from module safe-read:
   gl_SAFE_READ
+  # Code from module safe-write:
   gl_SAFE_WRITE
+  # Code from module servent:
   gl_SERVENT
+  # Code from module size_max:
   gl_SIZE_MAX
+  # Code from module snprintf:
   gl_FUNC_SNPRINTF
   gl_STDIO_MODULE_INDICATOR([snprintf])
+  # Code from module socklen:
   gl_TYPE_SOCKLEN_T
+  # Code from module ssize_t:
   gt_TYPE_SSIZE_T
+  # Code from module stat:
+  gl_FUNC_STAT
+  gl_SYS_STAT_MODULE_INDICATOR([stat])
+  # Code from module stdbool:
   AM_STDBOOL_H
+  # Code from module stddef:
+  gl_STDDEF_H
+  # Code from module stdint:
   gl_STDINT_H
+  # Code from module stdio:
   gl_STDIO_H
+  # Code from module stdlib:
   gl_STDLIB_H
+  # Code from module streq:
+  # Code from module string:
+  gl_HEADER_STRING_H
+  # Code from module sys_socket:
   gl_HEADER_SYS_SOCKET
-  gl_MODULE_INDICATOR([sys_socket])
   AC_PROG_MKDIR_P
+  # Code from module sys_stat:
   gl_HEADER_SYS_STAT_H
   AC_PROG_MKDIR_P
+  # Code from module sys_time:
   gl_HEADER_SYS_TIME_H
   AC_PROG_MKDIR_P
+  # Code from module tempname:
   gl_FUNC_GEN_TEMPNAME
+  # Code from module threadlib:
   gl_THREADLIB
+  # Code from module time:
+  gl_HEADER_TIME_H
+  # Code from module unistd:
   gl_UNISTD_H
+  # Code from module vasnprintf:
   gl_FUNC_VASNPRINTF
-  gl_VISIBILITY
+  # Code from module verify:
+  # Code from module warn-on-use:
+  # Code from module wchar:
   gl_WCHAR_H
+  # Code from module wcrtomb:
   gl_FUNC_WCRTOMB
   gl_WCHAR_MODULE_INDICATOR([wcrtomb])
+  # Code from module wctype:
   gl_WCTYPE_H
+  # Code from module write:
   gl_FUNC_WRITE
   gl_UNISTD_MODULE_INDICATOR([write])
+  # Code from module xsize:
   gl_XSIZE
+  # End of code from modules
   m4_ifval(gl_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
       for gl_file in ]gl_LIBSOURCES_LIST[ ; do
@@ -150,7 +316,7 @@ AC_SUBST([LTALLOCA])
     if test -n "$gl_LIBOBJS"; then
       # Remove the extension.
       sed_drop_objext='s/\.o$//;s/\.obj$//'
-      for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
+      for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
         gl_libobjs="$gl_libobjs $i.$ac_objext"
         gl_ltlibobjs="$gl_ltlibobjs $i.lo"
       done
@@ -167,6 +333,13 @@ AC_SUBST([LTALLOCA])
   m4_pushdef([gltests_LIBSOURCES_DIR], [])
   gl_COMMON
   gl_source_base='tests'
+changequote(,)dnl
+  gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
+changequote([, ])dnl
+  AC_SUBST([gltests_WITNESS])
+  gl_module_indicator_condition=$gltests_WITNESS
+  m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+  m4_popdef([gl_MODULE_INDICATOR_CONDITION])
   m4_ifval(gltests_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
       for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
@@ -189,7 +362,7 @@ AC_SUBST([LTALLOCA])
     if test -n "$gltests_LIBOBJS"; then
       # Remove the extension.
       sed_drop_objext='s/\.o$//;s/\.obj$//'
-      for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
+      for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
         gltests_libobjs="$gltests_libobjs $i.$ac_objext"
         gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
       done
@@ -256,15 +429,19 @@ AC_DEFUN([gltests_LIBSOURCES], [
 # This macro records the list of files which have been installed by
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([gl_FILE_LIST], [
+  build-aux/arg-nonnull.h
+  build-aux/c++defs.h
   build-aux/config.rpath
-  build-aux/link-warning.h
-  lib/alloca.c
+  build-aux/warn-on-use.h
+  lib/alignof.h
   lib/alloca.in.h
   lib/arpa_inet.in.h
   lib/asnprintf.c
   lib/base64.c
   lib/base64.h
   lib/btowc.c
+  lib/c-ctype.c
+  lib/c-ctype.h
   lib/config.charset
   lib/errno.in.h
   lib/float+.h
@@ -290,6 +467,8 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/glthread/lock.h
   lib/glthread/threadlib.c
   lib/inet_ntop.c
+  lib/inet_pton.c
+  lib/langinfo.in.h
   lib/localcharset.c
   lib/localcharset.h
   lib/lseek.c
@@ -297,9 +476,12 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/malloc.c
   lib/mbrtowc.c
   lib/mbsinit.c
+  lib/memchr.c
+  lib/memchr.valgrind
   lib/mkdtemp.c
   lib/netdb.in.h
   lib/netinet_in.in.h
+  lib/nl_langinfo.c
   lib/physmem.c
   lib/physmem.h
   lib/printf-args.c
@@ -320,18 +502,22 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/safe-write.h
   lib/size_max.h
   lib/snprintf.c
+  lib/stat.c
   lib/stdbool.in.h
+  lib/stddef.in.h
   lib/stdint.in.h
   lib/stdio-impl.h
   lib/stdio-write.c
   lib/stdio.in.h
   lib/stdlib.in.h
   lib/streq.h
+  lib/string.in.h
   lib/sys_socket.in.h
   lib/sys_stat.in.h
   lib/sys_time.in.h
   lib/tempname.c
   lib/tempname.h
+  lib/time.in.h
   lib/unistd.in.h
   lib/vasnprintf.c
   lib/vasnprintf.h
@@ -344,11 +530,15 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/00gnulib.m4
   m4/alloca.m4
   m4/arpa_inet_h.m4
+  m4/asm-underscore.m4
   m4/base64.m4
   m4/btowc.m4
   m4/codeset.m4
+  m4/dos.m4
+  m4/environ.m4
   m4/errno_h.m4
   m4/extensions.m4
+  m4/fcntl-o.m4
   m4/float_h.m4
   m4/fseeko.m4
   m4/fsusage.m4
@@ -362,8 +552,10 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/hostent.m4
   m4/include_next.m4
   m4/inet_ntop.m4
+  m4/inet_pton.m4
   m4/intmax_t.m4
   m4/inttypes_h.m4
+  m4/langinfo_h.m4
   m4/lib-ld.m4
   m4/lib-link.m4
   m4/lib-prefix.m4
@@ -379,10 +571,13 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/mbrtowc.m4
   m4/mbsinit.m4
   m4/mbstate_t.m4
+  m4/memchr.m4
   m4/mkdtemp.m4
+  m4/mmap-anon.m4
   m4/multiarch.m4
   m4/netdb_h.m4
   m4/netinet_in_h.m4
+  m4/nl_langinfo.m4
   m4/onceonly.m4
   m4/physmem.m4
   m4/printf.m4
@@ -395,23 +590,27 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/socklen.m4
   m4/sockpfaf.m4
   m4/ssize_t.m4
+  m4/stat.m4
   m4/stdbool.m4
+  m4/stddef_h.m4
   m4/stdint.m4
   m4/stdint_h.m4
   m4/stdio_h.m4
   m4/stdlib_h.m4
+  m4/string_h.m4
   m4/sys_socket_h.m4
   m4/sys_stat_h.m4
   m4/sys_time_h.m4
   m4/tempname.m4
   m4/threadlib.m4
+  m4/time_h.m4
   m4/unistd_h.m4
   m4/vasnprintf.m4
-  m4/visibility.m4
-  m4/wchar.m4
+  m4/warn-on-use.m4
+  m4/wchar_h.m4
   m4/wchar_t.m4
   m4/wcrtomb.m4
-  m4/wctype.m4
+  m4/wctype_h.m4
   m4/wint_t.m4
   m4/write.m4
   m4/xsize.m4
index 4438d488698b2e25a911a6741d8903cb9fd35ebf..69e7733b990a0aac8afb62c14813b417bb371891 100644 (file)
@@ -1,5 +1,5 @@
 # gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 4a96af7a53f877b60479b58a49f15079c98a99cd..7104b3089a270bb80f01d82b08b8d73e3fd45935 100644 (file)
@@ -1,5 +1,5 @@
-# hostent.m4 serial 1
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# hostent.m4 serial 2
+dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -28,12 +28,16 @@ AC_DEFUN([gl_HOSTENT],
         [gl_cv_w32_gethostbyname=no
          gl_save_LIBS="$LIBS"
          LIBS="$LIBS -lws2_32"
-         AC_TRY_LINK([
+         AC_LINK_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
 #endif
 #include <stddef.h>
-], [gethostbyname(NULL);], [gl_cv_w32_gethostbyname=yes])
+              ]],
+              [[gethostbyname(NULL);]])],
+           [gl_cv_w32_gethostbyname=yes])
          LIBS="$gl_save_LIBS"
         ])
       if test "$gl_cv_w32_gethostbyname" = "yes"; then
index d6101fe328370e91f7cab9c937a634ec17d31d6b..51a719b0a897c3f96e8b635080ef8d9ed4b8ba2c 100644 (file)
@@ -1,5 +1,5 @@
-# include_next.m4 serial 12
-dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
+# include_next.m4 serial 15
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -68,10 +68,11 @@ EOF
 EOF
      gl_save_CPPFLAGS="$CPPFLAGS"
      CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
-     AC_COMPILE_IFELSE([#include <conftest.h>],
+dnl We intentionally avoid using AC_LANG_SOURCE here.
+     AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
        [gl_cv_have_include_next=yes],
        [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
-        AC_COMPILE_IFELSE([#include <conftest.h>],
+        AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
           [gl_cv_have_include_next=buggy],
           [gl_cv_have_include_next=no])
        ])
@@ -104,10 +105,16 @@ EOF
 # For each arg foo.h, if #include_next works, define NEXT_FOO_H to be
 # '<foo.h>'; otherwise define it to be
 # '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
+# Also, if #include_next works as first preprocessing directive in a file,
+# define NEXT_AS_FIRST_DIRECTIVE_FOO_H to be '<foo.h>'; otherwise define it to
+# be
+# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
 # That way, a header file with the following line:
-#      #@INCLUDE_NEXT@ @NEXT_FOO_H@
+#       #@INCLUDE_NEXT@ @NEXT_FOO_H@
+# or
+#       #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
 # behaves (after sed substitution) as if it contained
-#      #include_next <foo.h>
+#       #include_next <foo.h>
 # even if the compiler does not support include_next.
 # The three "///" are to pacify Sun C 5.8, which otherwise would say
 # "warning: #include of /usr/include/... may be non-portable".
@@ -123,49 +130,63 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
 
   m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
-                   [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME])))
+                    [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
      if test $gl_cv_have_include_next = yes; then
        AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
      else
        AC_CACHE_CHECK(
-        [absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
-        m4_quote(m4_defn([gl_next_header])),
-        [AS_VAR_PUSHDEF([gl_header_exists],
-                        [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))
-         if test AS_VAR_GET(gl_header_exists) = yes; then
-           AC_LANG_CONFTEST(
-             [AC_LANG_SOURCE(
-                [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
-              )])
-           dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
-           dnl that contain only a #include of other header files and no
-           dnl non-comment tokens of their own. This leads to a failure to
-           dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
-           dnl and others. The workaround is to force preservation of comments
-           dnl through option -C. This ensures all necessary #line directives
-           dnl are present. GCC supports option -C as well.
-           case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-           dnl eval is necessary to expand gl_absname_cpp.
-           dnl Ultrix and Pyramid sh refuse to redirect output of eval,
-           dnl so use subshell.
-           AS_VAR_SET([gl_next_header],
-             ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
-              sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
-                s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'])
-         else
-           AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
-         fi
-         AS_VAR_POPDEF([gl_header_exists])])
+         [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+         m4_defn([gl_next_header]),
+         [AS_VAR_PUSHDEF([gl_header_exists],
+                         [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
+          if test AS_VAR_GET(gl_header_exists) = yes; then
+            AC_LANG_CONFTEST(
+              [AC_LANG_SOURCE(
+                 [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
+               )])
+            dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
+            dnl that contain only a #include of other header files and no
+            dnl non-comment tokens of their own. This leads to a failure to
+            dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
+            dnl and others. The workaround is to force preservation of comments
+            dnl through option -C. This ensures all necessary #line directives
+            dnl are present. GCC supports option -C as well.
+            case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+            dnl eval is necessary to expand gl_absname_cpp.
+            dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+            dnl so use subshell.
+            AS_VAR_SET([gl_next_header],
+              ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+               sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
+                 s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'])
+          else
+            AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+          fi
+          AS_VAR_POPDEF([gl_header_exists])])
      fi
      AC_SUBST(
-       AS_TR_CPP([NEXT_]m4_quote(m4_defn([gl_HEADER_NAME]))),
+       AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
        [AS_VAR_GET([gl_next_header])])
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'gl_HEADER_NAME'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
+     fi
+     AC_SUBST(
+       AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
+       [$gl_next_as_first_directive])
      AS_VAR_POPDEF([gl_next_header])])
 ])
+
+# Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE;
+# this fallback is safe for all earlier autoconf versions.
+m4_define_default([AC_LANG_DEFINES_PROVIDED])
index 42bfc5e417796dc0da8c6d270b06a7165dde6a04..a6d219c208e7b74b3acad9d7f3156c93ba3f7693 100644 (file)
@@ -1,17 +1,29 @@
-# inet_ntop.m4 serial 8
-dnl Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# inet_ntop.m4 serial 12
+dnl Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_INET_NTOP],
+AC_DEFUN([gl_FUNC_INET_NTOP],
 [
   dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
   gl_REPLACE_ARPA_INET_H
 
-  AC_REPLACE_FUNCS([inet_ntop])
+  dnl Most platforms that provide inet_ntop define it in libc.
+  dnl Solaris 8..10 provide inet_ntop in libnsl instead.
+  gl_save_LIBS=$LIBS
+  AC_SEARCH_LIBS([inet_ntop], [nsl], [],
+    [AC_REPLACE_FUNCS([inet_ntop])])
+  LIBS=$gl_save_LIBS
+  INET_NTOP_LIB=
+  if test "$ac_cv_search_inet_ntop" != "no" &&
+     test "$ac_cv_search_inet_ntop" != "none required"; then
+    INET_NTOP_LIB="$ac_cv_search_inet_ntop"
+  fi
+  AC_SUBST([INET_NTOP_LIB])
+
   gl_PREREQ_INET_NTOP
 ])
 
diff --git a/config/gnulib/inet_pton.m4 b/config/gnulib/inet_pton.m4
new file mode 100644 (file)
index 0000000..193f17d
--- /dev/null
@@ -0,0 +1,38 @@
+# inet_pton.m4 serial 10
+dnl Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_INET_PTON],
+[
+  dnl Persuade Solaris <arpa/inet.h> to declare inet_pton.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  gl_REPLACE_ARPA_INET_H
+
+  dnl Most platforms that provide inet_pton define it in libc.
+  dnl Solaris 8..10 provide inet_pton in libnsl instead.
+  gl_save_LIBS=$LIBS
+  AC_SEARCH_LIBS([inet_pton], [nsl], [],
+    [AC_REPLACE_FUNCS([inet_pton])])
+  LIBS=$gl_save_LIBS
+  INET_PTON_LIB=
+  if test "$ac_cv_search_inet_pton" != "no" &&
+     test "$ac_cv_search_inet_pton" != "none required"; then
+    INET_PTON_LIB="$ac_cv_search_inet_pton"
+  fi
+  AC_SUBST([INET_PTON_LIB])
+
+  gl_PREREQ_INET_PTON
+])
+
+# Prerequisites of lib/inet_pton.c.
+AC_DEFUN([gl_PREREQ_INET_PTON], [
+  AC_CHECK_DECLS([inet_pton],,,[#include <arpa/inet.h>])
+  if test $ac_cv_have_decl_inet_pton = no; then
+    HAVE_DECL_INET_PTON=0
+  fi
+  AC_REQUIRE([gl_SOCKET_FAMILIES])
+  AC_REQUIRE([AC_C_RESTRICT])
+])
index 264cb57184dc384c67591764196eecb59f859f4c..493e4a93281814caf7edc3917887eeec68eb86ce 100644 (file)
@@ -1,12 +1,13 @@
-# intmax_t.m4 serial 7
-dnl Copyright (C) 1997-2004, 2006-2007, 2009 Free Software Foundation, Inc.
+# intmax_t.m4 serial 8
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Paul Eggert.
 
-AC_PREREQ([2.13])
+AC_PREREQ([2.53])
 
 # Define intmax_t to 'long' or 'long long'
 # if it is not already defined in <stdint.h> or <inttypes.h>.
@@ -37,7 +38,9 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
   AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
   AC_REQUIRE([gl_AC_HEADER_STDINT_H])
   AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
-    [AC_TRY_COMPILE([
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[
 #include <stddef.h>
 #include <stdlib.h>
 #if HAVE_STDINT_H_WITH_UINTMAX
@@ -46,7 +49,10 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
 #if HAVE_INTTYPES_H_WITH_UINTMAX
 #include <inttypes.h>
 #endif
-], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
+          ]],
+          [[intmax_t x = -1; return !x;]])],
+       [gt_cv_c_intmax_t=yes],
+       [gt_cv_c_intmax_t=no])])
   if test $gt_cv_c_intmax_t = yes; then
     AC_DEFINE([HAVE_INTMAX_T], [1],
       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
index f4ca16021cf78da48bb7541c86d43ded2b4352c3..9d8f926926e55b4a89dff55f8f7b38a465d1e678 100644 (file)
@@ -1,5 +1,5 @@
-# inttypes_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+# inttypes_h.m4 serial 10
+dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,12 +12,15 @@ dnl From Paul Eggert.
 AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
 [
   AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
-#include <inttypes.h>],
-    [uintmax_t i = (uintmax_t) -1; return !i;],
-    [gl_cv_header_inttypes_h=yes],
-    [gl_cv_header_inttypes_h=no])])
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[
+#include <sys/types.h>
+#include <inttypes.h>
+          ]],
+          [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+       [gl_cv_header_inttypes_h=yes],
+       [gl_cv_header_inttypes_h=no])])
   if test $gl_cv_header_inttypes_h = yes; then
     AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
       [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
diff --git a/config/gnulib/langinfo_h.m4 b/config/gnulib/langinfo_h.m4
new file mode 100644 (file)
index 0000000..11a5698
--- /dev/null
@@ -0,0 +1,77 @@
+# langinfo_h.m4 serial 6
+dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_LANGINFO_H],
+[
+  AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+
+  dnl Persuade glibc-2.0.6 <langinfo.h> to define CODESET.
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  dnl <langinfo.h> is always overridden, because of GNULIB_POSIXCHECK.
+  gl_CHECK_NEXT_HEADERS([langinfo.h])
+
+  dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
+  HAVE_LANGINFO_CODESET=0
+  HAVE_LANGINFO_ERA=0
+  AC_CHECK_HEADERS_ONCE([langinfo.h])
+  if test $ac_cv_header_langinfo_h = yes; then
+    HAVE_LANGINFO_H=1
+    dnl Determine what <langinfo.h> defines. CODESET and ERA etc. are missing
+    dnl on OpenBSD 3.8.
+    AC_CACHE_CHECK([whether langinfo.h defines CODESET],
+      [gl_cv_header_langinfo_codeset],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = CODESET;
+]])],
+         [gl_cv_header_langinfo_codeset=yes],
+         [gl_cv_header_langinfo_codeset=no])
+      ])
+    if test $gl_cv_header_langinfo_codeset = yes; then
+      HAVE_LANGINFO_CODESET=1
+    fi
+    AC_CACHE_CHECK([whether langinfo.h defines ERA],
+      [gl_cv_header_langinfo_era],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = ERA;
+]])],
+         [gl_cv_header_langinfo_era=yes],
+         [gl_cv_header_langinfo_era=no])
+      ])
+    if test $gl_cv_header_langinfo_era = yes; then
+      HAVE_LANGINFO_ERA=1
+    fi
+  else
+    HAVE_LANGINFO_H=0
+  fi
+  AC_SUBST([HAVE_LANGINFO_H])
+  AC_SUBST([HAVE_LANGINFO_CODESET])
+  AC_SUBST([HAVE_LANGINFO_ERA])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <langinfo.h>
+    ]], [nl_langinfo])
+])
+
+AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_LANGINFO_H_DEFAULTS],
+[
+  GNULIB_NL_LANGINFO=0;  AC_SUBST([GNULIB_NL_LANGINFO])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_NL_LANGINFO=1;    AC_SUBST([HAVE_NL_LANGINFO])
+  REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO])
+])
index e4863f2c9b76a6cc8a3979bb41244a615d194c84..294db72e13d1f91e59faa00122d93da2d0d6159e 100644 (file)
@@ -1,5 +1,5 @@
-# lib-ld.m4 serial 4 (gettext-0.18)
-dnl Copyright (C) 1996-2003, 2009 Free Software Foundation, Inc.
+# lib-ld.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -31,15 +31,14 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
 ac_prog=ld
 if test "$GCC" = yes; then
@@ -59,7 +58,7 @@ if test "$GCC" = yes; then
       # Canonicalize the path of ld
       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
       done
       test -z "$LD" && LD="$ac_prog"
       ;;
@@ -89,9 +88,9 @@ AC_CACHE_VAL([acl_cv_path_LD],
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
       *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break ;;
+        test "$with_gnu_ld" != no && break ;;
       *)
-       test "$with_gnu_ld" != yes && break ;;
+        test "$with_gnu_ld" != yes && break ;;
       esac
     fi
   done
index fcd3391bbcef44773f3fa8568a1aa2f87a8b0708..2ea9d6d073c84b7f876a24930dc2d849c1293992 100644 (file)
@@ -1,5 +1,5 @@
-# lib-link.m4 serial 18 (gettext-0.18)
-dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
+# lib-link.m4 serial 25 (gettext-0.18.2)
+dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -18,9 +18,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
 [
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
   AC_REQUIRE([AC_LIB_RPATH])
-  pushdef([Name],[translit([$1],[./-], [___])])
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([Name],[m4_translit([$1],[./+-], [____])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
     AC_LIB_LINKFLAGS_BODY([$1], [$2])
     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
@@ -43,12 +43,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
   popdef([Name])
 ])
 
-dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
 dnl searches for libname and the libraries corresponding to explicit and
 dnl implicit dependencies, together with the specified include files and
-dnl the ability to compile and link the specified testcode. If found, it
-dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
-dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl the ability to compile and link the specified testcode. The missing-message
+dnl defaults to 'no' and may contain additional hints for the user.
+dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
+dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
@@ -57,9 +58,9 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 [
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
   AC_REQUIRE([AC_LIB_RPATH])
-  pushdef([Name],[translit([$1],[./-], [___])])
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([Name],[m4_translit([$1],[./+-], [____])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
 
   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
   dnl accordingly.
@@ -73,13 +74,26 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 
   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
     ac_save_LIBS="$LIBS"
-    LIBS="$LIBS $LIB[]NAME"
-    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
+    dnl because these -l options might require -L options that are present in
+    dnl LIBS. -l options benefit only from the -L options listed before it.
+    dnl Otherwise, add it to the front of LIBS, because it may be a static
+    dnl library that depends on another static library that is present in LIBS.
+    dnl Static libraries benefit only from the static libraries listed after
+    dnl it.
+    case " $LIB[]NAME" in
+      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
+      *)       LIBS="$LIB[]NAME $LIBS" ;;
+    esac
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM([[$3]], [[$4]])],
+      [ac_cv_lib[]Name=yes],
+      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
     LIBS="$ac_save_LIBS"
   ])
   if test "$ac_cv_lib[]Name" = yes; then
     HAVE_LIB[]NAME=yes
-    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
     AC_MSG_CHECKING([how to link with lib[]$1])
     AC_MSG_RESULT([$LIB[]NAME])
   else
@@ -144,15 +158,15 @@ dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
 dnl macro call that searches for libname.
 AC_DEFUN([AC_LIB_FROMPACKAGE],
 [
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   define([acl_frompackage_]NAME, [$2])
   popdef([NAME])
   pushdef([PACK],[$2])
-  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
-                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   define([acl_libsinpackage_]PACKUP,
-    m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
+    m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
   popdef([PACKUP])
   popdef([PACK])
 ])
@@ -165,14 +179,14 @@ dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 [
   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
-  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
-                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
   dnl Autoconf >= 2.61 supports dots in --with options.
-  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
+  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
   dnl By default, look in $includedir and $libdir.
   use_additional=yes
   AC_LIB_WITH_FINAL_PREFIX([
@@ -207,6 +221,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
   LTLIB[]NAME=
   INC[]NAME=
   LIB[]NAME[]_PREFIX=
+  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
+  dnl computed. So it has to be reset here.
+  HAVE_LIB[]NAME=
   rpathdirs=
   ltrpathdirs=
   names_already_handled=
@@ -226,7 +243,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
         names_already_handled="$names_already_handled $name"
         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
         dnl or AC_LIB_HAVE_LINKFLAGS call.
-        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
         eval value=\"\$HAVE_LIB$uppername\"
         if test -n "$value"; then
           if test "$value" = yes; then
index 3bdc0fc574abd05e85a4f380131fb0f5bb363d80..1601ceaefd3c2b447b569f991813be12b0e06e2d 100644 (file)
@@ -1,5 +1,5 @@
-# lib-prefix.m4 serial 6 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008 Free Software Foundation, Inc.
+# lib-prefix.m4 serial 7 (gettext-0.18)
+dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -206,6 +206,9 @@ sixtyfour bits
           if test -d "$searchdir"; then
             case "$searchdir" in
               */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+              */../ | */.. )
+                # Better ignore directories of this form. They are misleading.
+                ;;
               *) searchdir=`cd "$searchdir" && pwd`
                  case "$searchdir" in
                    */lib64 ) acl_libdirstem=lib64 ;;
index e9601041c5b079fc71944de859f3af6f1fe293e0..ee2e801bdd9a32ab89c007e1a128a174523cbe73 100644 (file)
@@ -1,5 +1,5 @@
-# localcharset.m4 serial 6
-dnl Copyright (C) 2002, 2004, 2006, 2009 Free Software Foundation, Inc.
+# localcharset.m4 serial 7
+dnl Copyright (C) 2002, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,6 +8,7 @@ AC_DEFUN([gl_LOCALCHARSET],
 [
   dnl Prerequisites of lib/localcharset.c.
   AC_REQUIRE([AM_LANGINFO_CODESET])
+  AC_REQUIRE([gl_FCNTL_O_FLAGS])
   AC_CHECK_DECLS_ONCE([getc_unlocked])
 
   dnl Prerequisites of the lib/Makefile.am snippet.
index 653a5bc2bd841615fc12fa7663e7b8e5e622cbcf..001f53906f5e1464ac84e7679704ad210a36b456 100644 (file)
@@ -1,5 +1,5 @@
 # locale-fr.m4 serial 11
-dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 936057647cf5ace3df97fac9134706e18cc9afd4..0eedaf149aab11a18940ce2cfe63398b6a895f01 100644 (file)
@@ -1,5 +1,5 @@
 # locale-ja.m4 serial 7
-dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 36a5f1dfb0bd4ea6727eebace8d34ec48fc0dbee..777fd1418eddfeff2087d1509723d7ffac40452d 100644 (file)
@@ -1,5 +1,5 @@
 # locale-zh.m4 serial 6
-dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index b416e31a35e02e1bc284200ff92c16fda3d09dd0..f71c66459ebfd5a93c19f37c1a2d818a2084f334 100644 (file)
@@ -1,5 +1,5 @@
-# lock.m4 serial 10 (gettext-0.18)
-dnl Copyright (C) 2005-2009 Free Software Foundation, Inc.
+# lock.m4 serial 11 (gettext-0.18.2)
+dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -18,13 +18,17 @@ AC_DEFUN([gl_LOCK],
       [],
       [#include <pthread.h>])
     # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
-    AC_TRY_COMPILE([#include <pthread.h>],
-      [#if __FreeBSD__ == 4
+    AC_COMPILE_IFELSE([
+      AC_LANG_PROGRAM(
+        [[#include <pthread.h>]],
+        [[
+#if __FreeBSD__ == 4
 error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
 #else
 int x = (int)PTHREAD_MUTEX_RECURSIVE;
 return !x;
-#endif],
+#endif
+        ]])],
       [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
          [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
   fi
index eedc8d56826218e41849ce337e63964a968b7a1a..cca3c1a90fa9d399493c7a7b9a885b4ca5270971 100644 (file)
@@ -1,5 +1,5 @@
 # longlong.m4 serial 14
-dnl Copyright (C) 1999-2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -20,30 +20,30 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
     [AC_LINK_IFELSE(
        [_AC_TYPE_LONG_LONG_SNIPPET],
        [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
-       dnl If cross compiling, assume the bug isn't important, since
-       dnl nobody cross compiles for this platform as far as we know.
-       AC_RUN_IFELSE(
-         [AC_LANG_PROGRAM(
-            [[@%:@include <limits.h>
-              @%:@ifndef LLONG_MAX
-              @%:@ define HALF \
-                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-              @%:@ define LLONG_MAX (HALF - 1 + HALF)
-              @%:@endif]],
-            [[long long int n = 1;
-              int i;
-              for (i = 0; ; i++)
-                {
-                  long long int m = n << i;
-                  if (m >> i != n)
-                    return 1;
-                  if (LLONG_MAX / 2 < m)
-                    break;
-                }
-              return 0;]])],
-         [ac_cv_type_long_long_int=yes],
-         [ac_cv_type_long_long_int=no],
-         [ac_cv_type_long_long_int=yes])],
+        dnl If cross compiling, assume the bug isn't important, since
+        dnl nobody cross compiles for this platform as far as we know.
+        AC_RUN_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[@%:@include <limits.h>
+               @%:@ifndef LLONG_MAX
+               @%:@ define HALF \
+                        (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+               @%:@ define LLONG_MAX (HALF - 1 + HALF)
+               @%:@endif]],
+             [[long long int n = 1;
+               int i;
+               for (i = 0; ; i++)
+                 {
+                   long long int m = n << i;
+                   if (m >> i != n)
+                     return 1;
+                   if (LLONG_MAX / 2 < m)
+                     break;
+                 }
+               return 0;]])],
+          [ac_cv_type_long_long_int=yes],
+          [ac_cv_type_long_long_int=no],
+          [ac_cv_type_long_long_int=yes])],
        [ac_cv_type_long_long_int=no])])
   if test $ac_cv_type_long_long_int = yes; then
     AC_DEFINE([HAVE_LONG_LONG_INT], [1],
@@ -83,24 +83,24 @@ AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
 [
   AC_LANG_PROGRAM(
     [[/* For now, do not test the preprocessor; as of 2007 there are too many
-        implementations with broken preprocessors.  Perhaps this can
-        be revisited in 2012.  In the meantime, code should not expect
-        #if to work with literals wider than 32 bits.  */
+         implementations with broken preprocessors.  Perhaps this can
+         be revisited in 2012.  In the meantime, code should not expect
+         #if to work with literals wider than 32 bits.  */
       /* Test literals.  */
       long long int ll = 9223372036854775807ll;
       long long int nll = -9223372036854775807LL;
       unsigned long long int ull = 18446744073709551615ULL;
       /* Test constant expressions.   */
       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                    ? 1 : -1)];
+                     ? 1 : -1)];
       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                    ? 1 : -1)];
+                     ? 1 : -1)];
       int i = 63;]],
     [[/* Test availability of runtime routines for shift and division.  */
       long long int llmax = 9223372036854775807ll;
       unsigned long long int ullmax = 18446744073709551615ull;
       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-             | (llmax / ll) | (llmax % ll)
-             | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-             | (ullmax / ull) | (ullmax % ull));]])
+              | (llmax / ll) | (llmax % ll)
+              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+              | (ullmax / ull) | (ullmax % ull));]])
 ])
index f336990709c2636072aacfd763a764da1d12db4a..b0612c7e1791a2adbb051ff7d2cb06e786967663 100644 (file)
@@ -1,5 +1,5 @@
-# lseek.m4 serial 4
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# lseek.m4 serial 6
+dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,30 +10,29 @@ AC_DEFUN([gl_FUNC_LSEEK],
   AC_REQUIRE([AC_PROG_CC])
   AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe],
     [if test $cross_compiling = no; then
-       AC_LINK_IFELSE([
+       AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h> /* for off_t */
 #include <stdio.h> /* for SEEK_CUR */
-#include <unistd.h>
-int main ()
-{
+#include <unistd.h>]], [[
   /* Exit with success only if stdin is seekable.  */
   return lseek (0, (off_t)0, SEEK_CUR) < 0;
-}],
-        [if test -s conftest$ac_exeext \
-            && ./conftest$ac_exeext < conftest.$ac_ext \
-            && { echo hi | ./conftest$ac_exeext; test $? = 1; }; then
-           gl_cv_func_lseek_pipe=yes
-         else
-           gl_cv_func_lseek_pipe=no
-         fi],
-        [gl_cv_func_lseek_pipe=no])
+]])],
+         [if test -s conftest$ac_exeext \
+             && ./conftest$ac_exeext < conftest.$ac_ext \
+             && test 1 = "`echo hi \
+               | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
+            gl_cv_func_lseek_pipe=yes
+          else
+            gl_cv_func_lseek_pipe=no
+          fi],
+         [gl_cv_func_lseek_pipe=no])
      else
-       AC_COMPILE_IFELSE([
+       AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__
 /* mingw and BeOS mistakenly return 0 when trying to seek on pipes.  */
   Choke me.
-#endif],
-        [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
+#endif]])],
+         [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
      fi])
   if test $gl_cv_func_lseek_pipe = no; then
     gl_REPLACE_LSEEK
@@ -46,5 +45,5 @@ AC_DEFUN([gl_REPLACE_LSEEK],
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   REPLACE_LSEEK=1
   AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
-           [Define to 1 if lseek does not detect pipes.])
+            [Define to 1 if lseek does not detect pipes.])
 ])
index 74c78fe48a72f7852cb1ab9ad99954ca68483a60..5dbd16e28ffe875a46d4696df5a4a164b32b929f 100644 (file)
@@ -1,6 +1,6 @@
-# serial 19
+# serial 20
 
-# Copyright (C) 1997-2001, 2003-2009 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2010 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -12,15 +12,17 @@ AC_DEFUN([gl_FUNC_LSTAT],
 [
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
   dnl If lstat does not exist, the replacement <sys/stat.h> does
-  dnl "#define lstat stat", and lstat.c does not need to be compiled.
+  dnl "#define lstat stat", and lstat.c is a no-op.
   AC_CHECK_FUNCS_ONCE([lstat])
   if test $ac_cv_func_lstat = yes; then
-    AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
-    dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]).
+    AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
     if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
+      dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]).
       REPLACE_LSTAT=1
     fi
     # Prerequisites of lib/lstat.c.
     AC_REQUIRE([AC_C_INLINE])
+  else
+    HAVE_LSTAT=0
   fi
 ])
index 807017166ba35812585f8e41667b8181f4f20afa..7a749254a1f9c3cd21f873592cc0b3a3a49c579d 100644 (file)
@@ -1,25 +1,40 @@
-# malloc.m4 serial 9
-dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+# malloc.m4 serial 12
+dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+# gl_FUNC_MALLOC_GNU
+# ------------------
+# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if
+# it is not.
+AC_DEFUN([gl_FUNC_MALLOC_GNU],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  dnl _AC_FUNC_MALLOC_IF is defined in Autoconf.
+  _AC_FUNC_MALLOC_IF(
+    [AC_DEFINE([HAVE_MALLOC_GNU], [1],
+               [Define to 1 if your system has a GNU libc compatible 'malloc'
+                function, and to 0 otherwise.])],
+    [AC_DEFINE([HAVE_MALLOC_GNU], [0])
+     gl_REPLACE_MALLOC
+    ])
+])
+
 # gl_FUNC_MALLOC_POSIX
 # --------------------
 # Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
 # fails), and replace malloc if it is not.
 AC_DEFUN([gl_FUNC_MALLOC_POSIX],
 [
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
   if test $gl_cv_func_malloc_posix = yes; then
-    HAVE_MALLOC_POSIX=1
     AC_DEFINE([HAVE_MALLOC_POSIX], [1],
       [Define if the 'malloc' function is POSIX compliant.])
   else
-    AC_LIBOBJ([malloc])
-    HAVE_MALLOC_POSIX=0
+    gl_REPLACE_MALLOC
   fi
-  AC_SUBST([HAVE_MALLOC_POSIX])
 ])
 
 # Test whether malloc, realloc, calloc are POSIX compliant,
@@ -32,10 +47,20 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
       dnl It is too dangerous to try to allocate a large amount of memory:
       dnl some systems go to their knees when you do that. So assume that
       dnl all Unix implementations of the function are POSIX compliant.
-      AC_TRY_COMPILE([],
-        [#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-         choke me
-         #endif
-        ], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no])
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[]],
+           [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+             choke me
+             #endif
+            ]])],
+        [gl_cv_func_malloc_posix=yes],
+        [gl_cv_func_malloc_posix=no])
     ])
 ])
+
+AC_DEFUN([gl_REPLACE_MALLOC],
+[
+  AC_LIBOBJ([malloc])
+  REPLACE_MALLOC=1
+])
index b6276b279f245ba9453b47fcb955cb575dd538f4..28b9c43bfa6390a72c85a94a22b4d167ab369d89 100644 (file)
@@ -1,5 +1,6 @@
-# mbrtowc.m4 serial 14
-dnl Copyright (C) 2001-2002, 2004-2005, 2008, 2009 Free Software Foundation, Inc.
+# mbrtowc.m4 serial 18
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,38 +11,39 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
 
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   gl_MBSTATE_T_BROKEN
-  if test $REPLACE_MBSTATE_T = 1; then
-    REPLACE_MBRTOWC=1
-  fi
+
   AC_CHECK_FUNCS_ONCE([mbrtowc])
   if test $ac_cv_func_mbrtowc = no; then
     HAVE_MBRTOWC=0
-  fi
-  if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then
-    gl_MBRTOWC_NULL_ARG
-    gl_MBRTOWC_RETVAL
-    gl_MBRTOWC_NUL_RETVAL
-    case "$gl_cv_func_mbrtowc_null_arg" in
-      *yes) ;;
-      *) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1],
-           [Define if the mbrtowc function has the NULL string argument bug.])
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
-    case "$gl_cv_func_mbrtowc_retval" in
-      *yes) ;;
-      *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1],
-           [Define if the mbrtowc function returns a wrong return value.])
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
-    case "$gl_cv_func_mbrtowc_nul_retval" in
-      *yes) ;;
-      *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1],
-           [Define if the mbrtowc function does not return 0 for a NUL character.])
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_MBRTOWC=1
+    else
+      gl_MBRTOWC_NULL_ARG
+      gl_MBRTOWC_RETVAL
+      gl_MBRTOWC_NUL_RETVAL
+      case "$gl_cv_func_mbrtowc_null_arg" in
+        *yes) ;;
+        *) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1],
+             [Define if the mbrtowc function has the NULL string argument bug.])
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_retval" in
+        *yes) ;;
+        *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1],
+             [Define if the mbrtowc function returns a wrong return value.])
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_nul_retval" in
+        *yes) ;;
+        *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1],
+             [Define if the mbrtowc function does not return 0 for a NUL character.])
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+    fi
   fi
   if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
     gl_REPLACE_WCHAR_H
@@ -99,14 +101,15 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
       dnl is present.
 changequote(,)dnl
       case "$host_os" in
-              # Guess no on AIX and OSF/1.
-        osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-              # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+                     # Guess no on AIX and OSF/1.
+        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+                     # Guess yes otherwise.
+        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
       esac
 changequote([,])dnl
       if test $LOCALE_JA != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -124,10 +127,10 @@ int main ()
           return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_incomplete_state=yes],
           [gl_cv_func_mbrtowc_incomplete_state=no],
-          [])
+          [:])
       fi
     ])
 ])
@@ -154,8 +157,10 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_ZH_CN != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <locale.h>
+#include <stdlib.h>
 #include <string.h>
 #include <wchar.h>
 int main ()
@@ -175,10 +180,10 @@ int main ()
         return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_sanitycheck=yes],
           [gl_cv_func_mbrtowc_sanitycheck=no],
-          [])
+          [:])
       fi
     ])
 ])
@@ -205,7 +210,8 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_FR_UTF8 != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -225,7 +231,10 @@ int main ()
         return 1;
     }
   return 0;
-}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [])
+}]])],
+          [gl_cv_func_mbrtowc_null_arg=yes],
+          [gl_cv_func_mbrtowc_null_arg=no],
+          [:])
       fi
     ])
 ])
@@ -255,7 +264,8 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -292,10 +302,10 @@ int main ()
         }
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_retval=yes],
           [gl_cv_func_mbrtowc_retval=no],
-          [])
+          [:])
       fi
     ])
 ])
@@ -322,7 +332,8 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_ZH_CN != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -339,10 +350,10 @@ int main ()
         return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_nul_retval=yes],
           [gl_cv_func_mbrtowc_nul_retval=no],
-          [])
+          [:])
       fi
     ])
 ])
index 03b055cd80fda5fd3d22d0a70534fc7493ec3a33..46c106fc492ee63d678282a8a61bdf5b03f3ecd2 100644 (file)
@@ -1,5 +1,5 @@
-# mbsinit.m4 serial 3
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# mbsinit.m4 serial 4
+dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,12 +10,14 @@ AC_DEFUN([gl_FUNC_MBSINIT],
 
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   gl_MBSTATE_T_BROKEN
-  if test $REPLACE_MBSTATE_T = 1; then
-    REPLACE_MBSINIT=1
-  fi
+
   AC_CHECK_FUNCS_ONCE([mbsinit])
   if test $ac_cv_func_mbsinit = no; then
     HAVE_MBSINIT=0
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_MBSINIT=1
+    fi
   fi
   if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
     gl_REPLACE_WCHAR_H
index d4ec6f0fc7107449a362452387e0ed1963799ee4..3e2df29f8aa13b71eb4038480ce3c85d25fdbb3c 100644 (file)
@@ -1,5 +1,5 @@
 # mbstate_t.m4 serial 12
-dnl Copyright (C) 2000-2002, 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -18,17 +18,17 @@ AC_DEFUN([AC_TYPE_MBSTATE_T],
 
    AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t],
      [AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-          [AC_INCLUDES_DEFAULT[
-#          include <wchar.h>]],
-          [[mbstate_t x; return sizeof x;]])],
-       [ac_cv_type_mbstate_t=yes],
-       [ac_cv_type_mbstate_t=no])])
+        [AC_LANG_PROGRAM(
+           [AC_INCLUDES_DEFAULT[
+#           include <wchar.h>]],
+           [[mbstate_t x; return sizeof x;]])],
+        [ac_cv_type_mbstate_t=yes],
+        [ac_cv_type_mbstate_t=no])])
    if test $ac_cv_type_mbstate_t = yes; then
      AC_DEFINE([HAVE_MBSTATE_T], [1],
-              [Define to 1 if <wchar.h> declares mbstate_t.])
+               [Define to 1 if <wchar.h> declares mbstate_t.])
    else
      AC_DEFINE([mbstate_t], [int],
-              [Define to a type if <wchar.h> does not define.])
+               [Define to a type if <wchar.h> does not define.])
    fi
 ])
diff --git a/config/gnulib/memchr.m4 b/config/gnulib/memchr.m4
new file mode 100644 (file)
index 0000000..ab773b8
--- /dev/null
@@ -0,0 +1,85 @@
+# memchr.m4 serial 8
+dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
+[
+  dnl Check for prerequisites for memory fence checks.
+  gl_FUNC_MMAP_ANON
+  AC_CHECK_HEADERS_ONCE([sys/mman.h])
+  AC_CHECK_FUNCS_ONCE([mprotect])
+
+  dnl These days, we assume memchr is present.  But just in case...
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([memchr])
+  if test $ac_cv_func_memchr = yes; then
+    # Detect platform-specific bugs in some versions of glibc:
+    # memchr should not dereference anything with length 0
+    #   http://bugzilla.redhat.com/499689
+    # memchr should not dereference overestimated length after a match
+    #   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+    #   http://sourceware.org/bugzilla/show_bug.cgi?id=10162
+    # Assume that memchr works on platforms that lack mprotect.
+    AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
+      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <string.h>
+#if HAVE_SYS_MMAN_H
+# include <fcntl.h>
+# include <unistd.h>
+# include <sys/types.h>
+# include <sys/mman.h>
+# ifndef MAP_FILE
+#  define MAP_FILE 0
+# endif
+#endif
+]], [[
+  char *fence = NULL;
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+# if HAVE_MAP_ANONYMOUS
+  const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
+  const int fd = -1;
+# else /* !HAVE_MAP_ANONYMOUS */
+  const int flags = MAP_FILE | MAP_PRIVATE;
+  int fd = open ("/dev/zero", O_RDONLY, 0666);
+  if (fd >= 0)
+# endif
+    {
+      int pagesize = getpagesize ();
+      char *two_pages =
+        (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
+                       flags, fd, 0);
+      if (two_pages != (char *)(-1)
+          && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
+        fence = two_pages + pagesize;
+    }
+#endif
+  if (fence)
+    {
+      if (memchr (fence, 0, 0))
+        return 1;
+      strcpy (fence - 9, "12345678");
+      if (memchr (fence - 9, 0, 79) != fence - 1)
+        return 2;
+    }
+  return 0;
+]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
+      [dnl Be pessimistic for now.
+       gl_cv_func_memchr_works="guessing no"])])
+    if test "$gl_cv_func_memchr_works" != yes; then
+      REPLACE_MEMCHR=1
+    fi
+  else
+    HAVE_MEMCHR=0
+  fi
+  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+    AC_LIBOBJ([memchr])
+    gl_PREREQ_MEMCHR
+  fi
+])
+
+# Prerequisites of lib/memchr.c.
+AC_DEFUN([gl_PREREQ_MEMCHR], [
+  AC_CHECK_HEADERS([bp-sym.h])
+])
index 444b61837cd640edd50b084c085e56559f17903f..6a07e0294c1c0e4f6e4acb20f8267bffbfa0f7f0 100644 (file)
@@ -1,5 +1,6 @@
 # mkdtemp.m4 serial 6
-dnl Copyright (C) 2001-2003, 2006-2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/config/gnulib/mmap-anon.m4 b/config/gnulib/mmap-anon.m4
new file mode 100644 (file)
index 0000000..a6b7b9a
--- /dev/null
@@ -0,0 +1,59 @@
+# mmap-anon.m4 serial 8
+dnl Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Detect how mmap can be used to create anonymous (not file-backed) memory
+# mappings.
+# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
+#   and MAP_ANON exist and have the same value.
+# - On HP-UX, only MAP_ANONYMOUS exists.
+# - On MacOS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
+# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
+#   used.
+
+AC_DEFUN([gl_FUNC_MMAP_ANON],
+[
+  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
+  AC_REQUIRE([AC_PROG_CPP])
+  AC_REQUIRE([AC_PROG_EGREP])
+
+  dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
+  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
+  # irrelevant for anonymous mappings.
+  AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no])
+
+  # Try to allow MAP_ANONYMOUS.
+  gl_have_mmap_anonymous=no
+  if test $gl_have_mmap = yes; then
+    AC_MSG_CHECKING([for MAP_ANONYMOUS])
+    AC_EGREP_CPP([I cant identify this map.], [
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+    I cant identify this map.
+#endif
+],
+      [gl_have_mmap_anonymous=yes])
+    if test $gl_have_mmap_anonymous != yes; then
+      AC_EGREP_CPP([I cant identify this map.], [
+#include <sys/mman.h>
+#ifdef MAP_ANON
+    I cant identify this map.
+#endif
+],
+        [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON],
+          [Define to a substitute value for mmap()'s MAP_ANONYMOUS flag.])
+         gl_have_mmap_anonymous=yes])
+    fi
+    AC_MSG_RESULT([$gl_have_mmap_anonymous])
+    if test $gl_have_mmap_anonymous = yes; then
+      AC_DEFINE([HAVE_MAP_ANONYMOUS], [1],
+        [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
+         config.h and <sys/mman.h>.])
+    fi
+  fi
+])
index 3948e6e0dba4d5962e23537dca014cc43d1183f0..389bd2bbaa6e73bbccc10e73f88c2ab079a24e0b 100644 (file)
@@ -1,5 +1,5 @@
-# multiarch.m4 serial 4
-dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+# multiarch.m4 serial 5
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -19,7 +19,6 @@ dnl with or without modifications, as long as this notice is preserved.
 # Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
 # beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
 
-dnl This macro must pass through AC_REQUIRE (never directly invoke it).
 AC_DEFUN_ONCE([gl_MULTIARCH],
 [
   dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
index 5a12251f9a1cdb1dcd9333fb4957654867af1bbc..c870fb61b9e6b45c86ba5c4a240a5da5c29b3c9f 100644 (file)
@@ -1,5 +1,5 @@
-# netdb_h.m4 serial 5
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# netdb_h.m4 serial 9
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,30 +7,26 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_HEADER_NETDB],
 [
   AC_REQUIRE([gl_NETDB_H_DEFAULTS])
+  AC_CHECK_HEADERS_ONCE([netdb.h])
   gl_CHECK_NEXT_HEADERS([netdb.h])
   if test $ac_cv_header_netdb_h = yes; then
-    AC_COMPILE_IFELSE(
-      [AC_LANG_PROGRAM([[
-         #include <netdb.h>
-         struct addrinfo a;
-         int b = EAI_OVERFLOW;
-         int c = AI_NUMERICSERV;
-       ]])],
-      [NETDB_H=''], [NETDB_H='netdb.h'])
     HAVE_NETDB_H=1
   else
-    NETDB_H='netdb.h'
     HAVE_NETDB_H=0
   fi
   AC_SUBST([HAVE_NETDB_H])
-  AC_SUBST([NETDB_H])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <netdb.h>]],
+    [getaddrinfo freeaddrinfo gai_strerror getnameinfo])
 ])
 
 AC_DEFUN([gl_NETDB_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_NETDB_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
 ])
 
 AC_DEFUN([gl_NETDB_H_DEFAULTS],
index 47fd9cc3175099f4e5479ac17f1ea8d44bb3da40..cc7a44cc21b85d2364efd168cca9bed77b3f42e4 100644 (file)
@@ -1,5 +1,5 @@
 # netinet_in_h.m4 serial 4
-dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/config/gnulib/nl_langinfo.m4 b/config/gnulib/nl_langinfo.m4
new file mode 100644 (file)
index 0000000..ad456a2
--- /dev/null
@@ -0,0 +1,25 @@
+# nl_langinfo.m4 serial 3
+dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_NL_LANGINFO],
+[
+  AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+  AC_REQUIRE([gl_LANGINFO_H])
+  AC_CHECK_FUNCS_ONCE([nl_langinfo])
+  if test $ac_cv_func_nl_langinfo = yes; then
+    if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1; then
+      :
+    else
+      REPLACE_NL_LANGINFO=1
+      AC_DEFINE([REPLACE_NL_LANGINFO], [1],
+        [Define if nl_langinfo exists but is overridden by gnulib.])
+      AC_LIBOBJ([nl_langinfo])
+    fi
+  else
+    HAVE_NL_LANGINFO=0
+    AC_LIBOBJ([nl_langinfo])
+  fi
+])
index 108cd6c1a5fceaaccfdec6681e24a13285fc5881..6a9c87b720f4c54749b9f3fe9b393777d0dfb47e 100644 (file)
@@ -1,5 +1,6 @@
-# onceonly.m4 serial 6
-dnl Copyright (C) 2002-2003, 2005-2006, 2008 Free Software Foundation, Inc.
+# onceonly.m4 serial 7
+dnl Copyright (C) 2002-2003, 2005-2006, 2008-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
@@ -38,16 +39,16 @@ AC_PREREQ([2.59])
 AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
   :
   m4_foreach_w([gl_HEADER_NAME], [$1], [
-    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
-                                                 [./-], [___])), [
+    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(m4_translit(gl_HEADER_NAME,
+                                                    [./-], [___])), [
       m4_divert_text([INIT_PREPARE],
         [gl_header_list="$gl_header_list gl_HEADER_NAME"])
       gl_HEADERS_EXPANSION
       AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])),
         [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.])
     ])
-    AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
-                                                   [./-], [___])))
+    AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(m4_translit(gl_HEADER_NAME,
+                                                      [./-], [___])))
   ])
 ])
 m4_define([gl_HEADERS_EXPANSION], [
index 2d79a699723cfbac3b029b203fb7dff92338fa91..042a335756f4e85c69c89b826625872566e6fcca 100644 (file)
@@ -1,5 +1,6 @@
-# physmem.m4 serial 9
-dnl Copyright (C) 2002-2003, 2005-2006, 2008-2009 Free Software Foundation, Inc.
+# physmem.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2006, 2008-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,19 +9,19 @@ dnl with or without modifications, as long as this notice is preserved.
 # a struct with member `physmem'.
 AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION],
   [AC_CACHE_CHECK([for external symbol _system_configuration],
-                 gl_cv_var__system_configuration,
+                  gl_cv_var__system_configuration,
     [AC_LINK_IFELSE([AC_LANG_PROGRAM(
-                     [[#include <sys/systemcfg.h>
-                     ]],
-                     [[double x = _system_configuration.physmem;
-                       if (x > 0.0) return 0;]])],
+                      [[#include <sys/systemcfg.h>
+                      ]],
+                      [[double x = _system_configuration.physmem;
+                        if (x > 0.0) return 0;]])],
       [gl_cv_var__system_configuration=yes],
       [gl_cv_var__system_configuration=no])])
 
     if test $gl_cv_var__system_configuration = yes; then
       AC_DEFINE([HAVE__SYSTEM_CONFIGURATION], [1],
-               [Define to 1 if you have the external variable,
-               _system_configuration with a member named physmem.])
+                [Define to 1 if you have the external variable,
+                _system_configuration with a member named physmem.])
     fi
   ]
 )
@@ -31,8 +32,15 @@ AC_DEFUN([gl_PHYSMEM],
 
   # Prerequisites of lib/physmem.c.
   AC_CHECK_HEADERS([sys/pstat.h sys/sysmp.h sys/sysinfo.h \
-    machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
-    sys/systemcfg.h],,, [AC_INCLUDES_DEFAULT])
+    machine/hal_sysinfo.h sys/table.h sys/param.h sys/systemcfg.h],,,
+    [AC_INCLUDES_DEFAULT])
+  dnl <sys/sysctl.h> requires <sys/param.h> on OpenBSD 4.0.
+  AC_CHECK_HEADERS([sys/sysctl.h],,,
+    [AC_INCLUDES_DEFAULT
+     #if HAVE_SYS_PARAM_H
+     # include <sys/param.h>
+     #endif
+    ])
 
   AC_CHECK_FUNCS([pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table])
   AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION])
index 87aa45c5e7e5eceed46e249708235f78285425b7..e850862c0197425876a56074463edf5921f8e61c 100644 (file)
@@ -1,5 +1,5 @@
-# printf.m4 serial 33
-dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc.
+# printf.m4 serial 35
+dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -17,7 +17,8 @@ AC_DEFUN([gl_PRINTF_SIZES_C99],
   AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
     [gl_cv_func_printf_sizes_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
@@ -50,34 +51,36 @@ int main ()
       || strcmp (buf, "1.5 33") != 0)
     return 1;
   return 0;
-}], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
-      [
+}]])],
+        [gl_cv_func_printf_sizes_c99=yes],
+        [gl_cv_func_printf_sizes_c99=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_printf_sizes_c99="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
-         darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on OpenBSD >= 3.9.
-         openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
-                               gl_cv_func_printf_sizes_c99="guessing no";;
-         openbsd*)             gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on Solaris >= 2.10.
-         solaris2.[0-9]*)      gl_cv_func_printf_sizes_c99="guessing no";;
-         solaris*)             gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_printf_sizes_c99="guessing no";;
-         netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_sizes_c99="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_printf_sizes_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
+           darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_printf_sizes_c99="guessing no";;
+           openbsd*)             gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[0-9]*)      gl_cv_func_printf_sizes_c99="guessing no";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_printf_sizes_c99="guessing no";;
+           netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_sizes_c99="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -92,7 +95,8 @@ AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
   AC_CACHE_CHECK([whether printf supports 'long double' arguments],
     [gl_cv_func_printf_long_double],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[10000];
@@ -111,16 +115,18 @@ int main ()
       || strcmp (buf, "1.75 33") != 0)
     return 1;
   return 0;
-}], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no],
-      [
+}]])],
+        [gl_cv_func_printf_long_double=yes],
+        [gl_cv_func_printf_long_double=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         beos*)        gl_cv_func_printf_long_double="guessing no";;
-         mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
-         *)            gl_cv_func_printf_long_double="guessing yes";;
-       esac
+         case "$host_os" in
+           beos*)        gl_cv_func_printf_long_double="guessing no";;
+           mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
+           *)            gl_cv_func_printf_long_double="guessing yes";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -136,7 +142,8 @@ AC_DEFUN([gl_PRINTF_INFINITE],
   AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
     [gl_cv_func_printf_infinite],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static int
@@ -201,32 +208,34 @@ int main ()
         || strcmp (buf, "-0") != 0)
     return 1;
   return 0;
-}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no],
-      [
+}]])],
+        [gl_cv_func_printf_infinite=yes],
+        [gl_cv_func_printf_infinite=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on FreeBSD >= 6.
-         freebsd[1-5]*)        gl_cv_func_printf_infinite="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
-         darwin*)              gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on HP-UX >= 11.
-         hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
-         hpux*)                gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_printf_infinite="guessing no";;
-         netbsd*)              gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_printf_infinite="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_infinite="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on FreeBSD >= 6.
+           freebsd[1-5]*)        gl_cv_func_printf_infinite="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
+           darwin*)              gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on HP-UX >= 11.
+           hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
+           hpux*)                gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_printf_infinite="guessing no";;
+           netbsd*)              gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_printf_infinite="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_infinite="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -252,7 +261,8 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
       AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
         [gl_cv_func_printf_infinite_long_double],
         [
-          AC_TRY_RUN([
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
 ]GL_NOCRASH[
 #include <float.h>
 #include <stdio.h>
@@ -414,38 +424,38 @@ int main ()
   }
 #endif
   return 0;
-}],
-          [gl_cv_func_printf_infinite_long_double=yes],
-          [gl_cv_func_printf_infinite_long_double=no],
-          [
+}]])],
+            [gl_cv_func_printf_infinite_long_double=yes],
+            [gl_cv_func_printf_infinite_long_double=no],
+            [
 changequote(,)dnl
-           case "$host_cpu" in
-                                   # Guess no on ia64, x86_64, i386.
-             ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
-             *)
-               case "$host_os" in
-                                       # Guess yes on glibc systems.
-                 *-gnu*)               gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on FreeBSD >= 6.
-                 freebsd[1-5]*)        gl_cv_func_printf_infinite_long_double="guessing no";;
-                 freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on MacOS X >= 10.3.
-                 darwin[1-6].*)        gl_cv_func_printf_infinite_long_double="guessing no";;
-                 darwin*)              gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on HP-UX >= 11.
-                 hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
-                 hpux*)                gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on NetBSD >= 3.
-                 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                                       gl_cv_func_printf_infinite_long_double="guessing no";;
-                 netbsd*)              gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # If we don't know, assume the worst.
-                 *)                    gl_cv_func_printf_infinite_long_double="guessing no";;
-               esac
-               ;;
-           esac
+             case "$host_cpu" in
+                                     # Guess no on ia64, x86_64, i386.
+               ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
+               *)
+                 case "$host_os" in
+                                         # Guess yes on glibc systems.
+                   *-gnu*)               gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on FreeBSD >= 6.
+                   freebsd[1-5]*)        gl_cv_func_printf_infinite_long_double="guessing no";;
+                   freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on MacOS X >= 10.3.
+                   darwin[1-6].*)        gl_cv_func_printf_infinite_long_double="guessing no";;
+                   darwin*)              gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on HP-UX >= 11.
+                   hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
+                   hpux*)                gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on NetBSD >= 3.
+                   netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                         gl_cv_func_printf_infinite_long_double="guessing no";;
+                   netbsd*)              gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # If we don't know, assume the worst.
+                   *)                    gl_cv_func_printf_infinite_long_double="guessing no";;
+                 esac
+                 ;;
+             esac
 changequote([,])dnl
-          ])
+            ])
         ])
       ;;
     *)
@@ -466,7 +476,8 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
   AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
     [gl_cv_func_printf_directive_a],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -512,26 +523,28 @@ int main ()
           && strcmp (buf, "0x8.0p-2") != 0))
     return 1;
   return 0;
-}], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
-      [
-       case "$host_os" in
-                               # Guess yes on glibc >= 2.5 systems.
-         *-gnu*)
-           AC_EGREP_CPP([BZ2908], [
-             #include <features.h>
-             #ifdef __GNU_LIBRARY__
-              #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
-               BZ2908
-              #endif
-             #endif
-             ],
-             [gl_cv_func_printf_directive_a="guessing yes"],
-             [gl_cv_func_printf_directive_a="guessing no"])
-           ;;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_directive_a="guessing no";;
-       esac
-      ])
+}]])],
+        [gl_cv_func_printf_directive_a=yes],
+        [gl_cv_func_printf_directive_a=no],
+        [
+         case "$host_os" in
+                                 # Guess yes on glibc >= 2.5 systems.
+           *-gnu*)
+             AC_EGREP_CPP([BZ2908], [
+               #include <features.h>
+               #ifdef __GNU_LIBRARY__
+                #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
+                 BZ2908
+                #endif
+               #endif
+               ],
+               [gl_cv_func_printf_directive_a="guessing yes"],
+               [gl_cv_func_printf_directive_a="guessing no"])
+             ;;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_directive_a="guessing no";;
+         esac
+        ])
     ])
 ])
 
@@ -546,7 +559,8 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
   AC_CACHE_CHECK([whether printf supports the 'F' directive],
     [gl_cv_func_printf_directive_f],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -563,26 +577,28 @@ int main ()
       || strcmp (buf, "1234") != 0)
     return 1;
   return 0;
-}], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no],
-      [
+}]])],
+        [gl_cv_func_printf_directive_f=yes],
+        [gl_cv_func_printf_directive_f=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_printf_directive_f="guessing yes";;
-                               # Guess yes on FreeBSD >= 6.
-         freebsd[1-5]*)        gl_cv_func_printf_directive_f="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
-         darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
-                               # Guess yes on Solaris >= 2.10.
-         solaris2.[0-9]*)      gl_cv_func_printf_directive_f="guessing no";;
-         solaris*)             gl_cv_func_printf_directive_f="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_directive_f="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on FreeBSD >= 6.
+           freebsd[1-5]*)        gl_cv_func_printf_directive_f="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
+           darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[0-9]*)      gl_cv_func_printf_directive_f="guessing no";;
+           solaris*)             gl_cv_func_printf_directive_f="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_directive_f="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -597,7 +613,8 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
   AC_CACHE_CHECK([whether printf supports the 'n' directive],
     [gl_cv_func_printf_directive_n],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char fmtstring[10];
@@ -614,14 +631,16 @@ int main ()
       || count != 4)
     return 1;
   return 0;
-}], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no],
-      [
+}]])],
+        [gl_cv_func_printf_directive_n=yes],
+        [gl_cv_func_printf_directive_n=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         *)     gl_cv_func_printf_directive_n="guessing yes";;
-       esac
+         case "$host_os" in
+           *)     gl_cv_func_printf_directive_n="guessing yes";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -639,7 +658,8 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
   AC_CACHE_CHECK([whether printf supports the 'ls' directive],
     [gl_cv_func_printf_directive_ls],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
@@ -687,19 +707,21 @@ int main ()
       return 1;
   }
   return 0;
-}], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no],
-      [
+}]])],
+        [gl_cv_func_printf_directive_ls=yes],
+        [gl_cv_func_printf_directive_ls=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         openbsd*)        gl_cv_func_printf_directive_ls="guessing no";;
-         irix*)           gl_cv_func_printf_directive_ls="guessing no";;
-         solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
-         cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
-         beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
-         *)               gl_cv_func_printf_directive_ls="guessing yes";;
-       esac
+         case "$host_os" in
+           openbsd*)        gl_cv_func_printf_directive_ls="guessing no";;
+           irix*)           gl_cv_func_printf_directive_ls="guessing no";;
+           solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
+           cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
+           beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
+           *)               gl_cv_func_printf_directive_ls="guessing yes";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -714,7 +736,8 @@ AC_DEFUN([gl_PRINTF_POSITIONS],
   AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
     [gl_cv_func_printf_positions],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 /* The string "%2$d %1$d", with dollar characters protected from the shell's
@@ -725,18 +748,20 @@ int main ()
 {
   sprintf (buf, format, 33, 55);
   return (strcmp (buf, "55 33") != 0);
-}], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no],
-      [
+}]])],
+        [gl_cv_func_printf_positions=yes],
+        [gl_cv_func_printf_positions=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
-                       gl_cv_func_printf_positions="guessing no";;
-         beos*)        gl_cv_func_printf_positions="guessing no";;
-         mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
-         *)            gl_cv_func_printf_positions="guessing yes";;
-       esac
+         case "$host_os" in
+           netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
+                         gl_cv_func_printf_positions="guessing no";;
+           beos*)        gl_cv_func_printf_positions="guessing no";;
+           mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
+           *)            gl_cv_func_printf_positions="guessing yes";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -751,7 +776,8 @@ AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
   AC_CACHE_CHECK([whether printf supports the grouping flag],
     [gl_cv_func_printf_flag_grouping],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -761,17 +787,19 @@ int main ()
       || buf[strlen (buf) - 1] != '9')
     return 1;
   return 0;
-}], [gl_cv_func_printf_flag_grouping=yes], [gl_cv_func_printf_flag_grouping=no],
-      [
+}]])],
+        [gl_cv_func_printf_flag_grouping=yes],
+        [gl_cv_func_printf_flag_grouping=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         cygwin*)      gl_cv_func_printf_flag_grouping="guessing no";;
-         netbsd*)      gl_cv_func_printf_flag_grouping="guessing no";;
-         mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
-         *)            gl_cv_func_printf_flag_grouping="guessing yes";;
-       esac
+         case "$host_os" in
+           cygwin*)      gl_cv_func_printf_flag_grouping="guessing no";;
+           netbsd*)      gl_cv_func_printf_flag_grouping="guessing no";;
+           mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
+           *)            gl_cv_func_printf_flag_grouping="guessing yes";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -787,7 +815,8 @@ AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
   AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
     [gl_cv_func_printf_flag_leftadjust],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -798,7 +827,7 @@ int main ()
       || strcmp (buf, "ab  c") != 0)
     return 1;
   return 0;
-}],
+}]])],
         [gl_cv_func_printf_flag_leftadjust=yes],
         [gl_cv_func_printf_flag_leftadjust=no],
         [
@@ -828,7 +857,8 @@ AC_DEFUN([gl_PRINTF_FLAG_ZERO],
   AC_CACHE_CHECK([whether printf supports the zero flag correctly],
     [gl_cv_func_printf_flag_zero],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -839,19 +869,21 @@ int main ()
           && strcmp (buf, "  infinity") != 0))
     return 1;
   return 0;
-}], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no],
-      [
+}]])],
+        [gl_cv_func_printf_flag_zero=yes],
+        [gl_cv_func_printf_flag_zero=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
-                 # Guess yes on BeOS.
-         beos*)  gl_cv_func_printf_flag_zero="guessing yes";;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_printf_flag_zero="guessing no";;
-       esac
+         case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
+                   # Guess yes on BeOS.
+           beos*)  gl_cv_func_printf_flag_zero="guessing yes";;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_printf_flag_zero="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -868,7 +900,8 @@ AC_DEFUN([gl_PRINTF_PRECISION],
   AC_CACHE_CHECK([whether printf supports large precisions],
     [gl_cv_func_printf_precision],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[5000];
@@ -881,17 +914,19 @@ int main ()
   if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
     return 1;
   return 0;
-}], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no],
-      [
+}]])],
+        [gl_cv_func_printf_precision=yes],
+        [gl_cv_func_printf_precision=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         # Guess no only on native Win32 and BeOS systems.
-         mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
-         beos*)        gl_cv_func_printf_precision="guessing no" ;;
-         *)            gl_cv_func_printf_precision="guessing yes" ;;
-       esac
+         case "$host_os" in
+           # Guess no only on native Win32 and BeOS systems.
+           mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
+           beos*)        gl_cv_func_printf_precision="guessing no" ;;
+           *)            gl_cv_func_printf_precision="guessing yes" ;;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -1031,7 +1066,8 @@ AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
   AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
     [gl_cv_func_snprintf_truncation_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -1042,47 +1078,49 @@ int main ()
   if (memcmp (buf, "45\0DEF", 6) != 0)
     return 1;
   return 0;
-}], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no],
-      [
+}]])],
+        [gl_cv_func_snprintf_truncation_c99=yes],
+        [gl_cv_func_snprintf_truncation_c99=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
-         darwin*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on OpenBSD >= 3.9.
-         openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
-                               gl_cv_func_snprintf_truncation_c99="guessing no";;
-         openbsd*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on Solaris >= 2.6.
-         solaris2.[0-5]*)      gl_cv_func_snprintf_truncation_c99="guessing no";;
-         solaris*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on AIX >= 4.
-         aix[1-3]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
-         aix*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on HP-UX >= 11.
-         hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
-         hpux*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on IRIX >= 6.5.
-         irix6.5)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on OSF/1 >= 5.
-         osf[3-4]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
-         osf*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_snprintf_truncation_c99="guessing no";;
-         netbsd*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_snprintf_truncation_c99="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
+           darwin*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_snprintf_truncation_c99="guessing no";;
+           openbsd*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.6.
+           solaris2.[0-5]*)      gl_cv_func_snprintf_truncation_c99="guessing no";;
+           solaris*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
+           aix*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on HP-UX >= 11.
+           hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+           hpux*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on IRIX >= 6.5.
+           irix6.5)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on OSF/1 >= 5.
+           osf[3-4]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
+           osf*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_snprintf_truncation_c99="guessing no";;
+           netbsd*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_snprintf_truncation_c99="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -1101,14 +1139,15 @@ dnl     }
 dnl     ---------------------------------------------------------------------
 dnl Result is gl_cv_func_snprintf_retval_c99.
 
-AC_DEFUN([gl_SNPRINTF_RETVAL_C99],
+AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
     [gl_cv_func_snprintf_retval_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -1118,39 +1157,41 @@ int main ()
   if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
     return 1;
   return 0;
-}], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no],
-      [
+}]])],
+        [gl_cv_func_snprintf_retval_c99=yes],
+        [gl_cv_func_snprintf_retval_c99=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
-         darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on OpenBSD >= 3.9.
-         openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
-                               gl_cv_func_snprintf_retval_c99="guessing no";;
-         openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on Solaris >= 2.6.
-         solaris2.[0-5]*)      gl_cv_func_snprintf_retval_c99="guessing no";;
-         solaris*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on AIX >= 4.
-         aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
-         aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_snprintf_retval_c99="guessing no";;
-         netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
+           darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_snprintf_retval_c99="guessing no";;
+           openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.6.
+           solaris2.[0-5]*)      gl_cv_func_snprintf_retval_c99="guessing no";;
+           solaris*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
+           aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_snprintf_retval_c99="guessing no";;
+           netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -1165,7 +1206,8 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
   AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
     [gl_cv_func_snprintf_directive_n],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char fmtstring[10];
@@ -1181,40 +1223,42 @@ int main ()
   if (count != 6)
     return 1;
   return 0;
-}], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no],
-      [
+}]])],
+        [gl_cv_func_snprintf_directive_n=yes],
+        [gl_cv_func_snprintf_directive_n=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_snprintf_directive_n="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_snprintf_directive_n="guessing no";;
-         darwin*)              gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on Solaris >= 2.6.
-         solaris2.[0-5]*)      gl_cv_func_snprintf_directive_n="guessing no";;
-         solaris*)             gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on AIX >= 4.
-         aix[1-3]*)            gl_cv_func_snprintf_directive_n="guessing no";;
-         aix*)                 gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on IRIX >= 6.5.
-         irix6.5)              gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on OSF/1 >= 5.
-         osf[3-4]*)            gl_cv_func_snprintf_directive_n="guessing no";;
-         osf*)                 gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_snprintf_directive_n="guessing no";;
-         netbsd*)              gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_snprintf_directive_n="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_snprintf_directive_n="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_snprintf_directive_n="guessing no";;
+           darwin*)              gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on Solaris >= 2.6.
+           solaris2.[0-5]*)      gl_cv_func_snprintf_directive_n="guessing no";;
+           solaris*)             gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_snprintf_directive_n="guessing no";;
+           aix*)                 gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on IRIX >= 6.5.
+           irix6.5)              gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on OSF/1 >= 5.
+           osf[3-4]*)            gl_cv_func_snprintf_directive_n="guessing no";;
+           osf*)                 gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_snprintf_directive_n="guessing no";;
+           netbsd*)              gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_snprintf_directive_n="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -1229,17 +1273,18 @@ AC_DEFUN([gl_SNPRINTF_SIZE1],
   AC_CACHE_CHECK([whether snprintf respects a size of 1],
     [gl_cv_func_snprintf_size1],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 int main()
 {
   static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
   snprintf (buf, 1, "%d", 12345);
   return buf[1] != 'E';
-}],
-      [gl_cv_func_snprintf_size1=yes],
-      [gl_cv_func_snprintf_size1=no],
-      [gl_cv_func_snprintf_size1="guessing yes"])
+}]])],
+        [gl_cv_func_snprintf_size1=yes],
+        [gl_cv_func_snprintf_size1=no],
+        [gl_cv_func_snprintf_size1="guessing yes"])
     ])
 ])
 
@@ -1286,7 +1331,8 @@ AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
   AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
     [gl_cv_func_vsnprintf_zerosize_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdarg.h>
 #include <stdio.h>
 static int my_snprintf (char *buf, int size, const char *format, ...)
@@ -1303,43 +1349,43 @@ int main()
   static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
   my_snprintf (buf, 0, "%d", 12345);
   return buf[0] != 'D';
-}],
-      [gl_cv_func_vsnprintf_zerosize_c99=yes],
-      [gl_cv_func_vsnprintf_zerosize_c99=no],
-      [
+}]])],
+        [gl_cv_func_vsnprintf_zerosize_c99=yes],
+        [gl_cv_func_vsnprintf_zerosize_c99=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-         darwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on Cygwin.
-         cygwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on Solaris >= 2.6.
-         solaris2.[0-5]*)      gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-         solaris*)             gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on AIX >= 4.
-         aix[1-3]*)            gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-         aix*)                 gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on IRIX >= 6.5.
-         irix6.5)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-         netbsd*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on mingw.
-         mingw* | pw*)         gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           darwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on Cygwin.
+           cygwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.6.
+           solaris2.[0-5]*)      gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           solaris*)             gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           aix*)                 gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on IRIX >= 6.5.
+           irix6.5)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           netbsd*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on mingw.
+           mingw* | pw*)         gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -1401,7 +1447,7 @@ dnl   Cygwin 1.5.19 (2006)           #  .  .  #  #  #  .  #  .  #  .  #  #  #  .
 dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 2.6 ... 9              #  .  #  #  #  #  .  #  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 2.5.1                  #  .  #  #  #  #  .  #  .  .  .  #  .  .  #  #  #  #  #  #
-dnl   AIX 5.2                        .  .  #  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   AIX 5.2, 7.1                   .  .  #  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   AIX 4.3.2, 5.1                 #  .  #  #  #  #  .  .  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   HP-UX 11.31                    .  .  .  .  #  .  .  .  .  .  .  #  .  .  .  .  #  #  .  .
 dnl   HP-UX 11.{00,11,23}            #  .  .  .  #  #  .  .  .  .  .  #  .  .  .  .  #  #  .  #
index 43b04638c2ebcbdf9a5c5ab207e07b5c59570ccd..95784e4b5840af636b15cd8bc3a0b46976210021 100644 (file)
@@ -1,7 +1,7 @@
-# serial 53
+# serial 56
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -18,149 +18,154 @@ AC_DEFUN([gl_REGEX],
 
   AC_ARG_WITH([included-regex],
     [AS_HELP_STRING([--without-included-regex],
-                   [don't compile regex; this is the default on 32-bit
-                    systems with recent-enough versions of the GNU C
-                    Library (use with caution on other systems).
-                    On systems with 64-bit ptrdiff_t and 32-bit int,
-                    --with-included-regex is the default, in case
-                    regex functions operate on very long strings (>2GB)])])
+                    [don't compile regex; this is the default on systems
+                     with recent-enough versions of the GNU C Library
+                     (use with caution on other systems).])])
 
   case $with_included_regex in #(
   yes|no) ac_use_included_regex=$with_included_regex
-       ;;
+        ;;
   '')
     # If the system regex support is good enough that it passes the
     # following run test, then default to *not* using the included regex.c.
     # If cross compiling, assume the test would fail and use the included
     # regex.c.
     AC_CACHE_CHECK([for working re_compile_pattern],
-                  [gl_cv_func_re_compile_pattern_working],
+                   [gl_cv_func_re_compile_pattern_working],
       [AC_RUN_IFELSE(
-       [AC_LANG_PROGRAM(
-         [AC_INCLUDES_DEFAULT[
-          #if HAVE_LOCALE_H
-           #include <locale.h>
-          #endif
-          #include <limits.h>
-          #include <regex.h>
-          ]],
-         [[static struct re_pattern_buffer regex;
-           unsigned char folded_chars[UCHAR_MAX + 1];
-           int i;
-           const char *s;
-           struct re_registers regs;
-
-           #if HAVE_LOCALE_H
-             /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
-                This test needs valgrind to catch the bug on Debian
-                GNU/Linux 3.1 x86, but it might catch the bug better
-                on other platforms and it shouldn't hurt to try the
-                test here.  */
-             if (setlocale (LC_ALL, "en_US.UTF-8"))
-               {
-                 static char const pat[] = "insert into";
-                 static char const data[] =
-                   "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
-                 re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
-                                | RE_ICASE);
-                 memset (&regex, 0, sizeof regex);
-                 s = re_compile_pattern (pat, sizeof pat - 1, &regex);
-                 if (s)
-                   return 1;
-                 if (re_search (&regex, data, sizeof data - 1,
-                                0, sizeof data - 1, &regs)
-                     != -1)
-                   return 1;
-                 if (! setlocale (LC_ALL, "C"))
-                   return 1;
-               }
-           #endif
-
-           /* This test is from glibc bug 3957, reported by Andrew Mackey.  */
-           re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE);
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("a[^x]b", 6, &regex);
-           if (s)
-             return 1;
-
-           /* This should fail, but succeeds for glibc-2.5.  */
-           if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
-             return 1;
-
-           /* This regular expression is from Spencer ere test number 75
-              in grep-2.3.  */
-           re_set_syntax (RE_SYNTAX_POSIX_EGREP);
-           memset (&regex, 0, sizeof regex);
-           for (i = 0; i <= UCHAR_MAX; i++)
-             folded_chars[i] = i;
-           regex.translate = folded_chars;
-           s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
-           /* This should fail with _Invalid character class name_ error.  */
-           if (!s)
-             return 1;
-
-           /* This should succeed, but does not for glibc-2.1.3.  */
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("{1", 2, &regex);
-
-           if (s)
-             return 1;
-
-           /* The following example is derived from a problem report
-              against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>.  */
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("[an\371]*n", 7, &regex);
-           if (s)
-             return 1;
-
-           /* This should match, but does not for glibc-2.2.1.  */
-           if (re_match (&regex, "an", 2, 0, &regs) != 2)
-             return 1;
-
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("x", 1, &regex);
-           if (s)
-             return 1;
-
-           /* glibc-2.2.93 does not work with a negative RANGE argument.  */
-           if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
-             return 1;
-
-           /* The version of regex.c in older versions of gnulib
-              ignored RE_ICASE.  Detect that problem too.  */
-           re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("x", 1, &regex);
-           if (s)
-             return 1;
-
-           if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
-             return 1;
-
-           /* Catch a bug reported by Vin Shelton in
-              http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html
-              */
-           re_set_syntax (RE_SYNTAX_POSIX_BASIC
-                          & ~RE_CONTEXT_INVALID_DUP
-                          & ~RE_NO_EMPTY_RANGES);
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
-           if (s)
-             return 1;
-
-           /* REG_STARTEND was added to glibc on 2004-01-15.
-              Reject older versions.  */
-           if (! REG_STARTEND)
-             return 1;
-
-           /* Reject hosts whose regoff_t values are too narrow.
-              These include glibc 2.3.5 on hosts with 64-bit ptrdiff_t
-              and 32-bit int.  */
-           if (sizeof (regoff_t) < sizeof (ptrdiff_t)
-               || sizeof (regoff_t) < sizeof (ssize_t))
-             return 1;
-
-           return 0;]])],
+        [AC_LANG_PROGRAM(
+          [AC_INCLUDES_DEFAULT[
+           #if HAVE_LOCALE_H
+            #include <locale.h>
+           #endif
+           #include <limits.h>
+           #include <regex.h>
+           ]],
+          [[static struct re_pattern_buffer regex;
+            unsigned char folded_chars[UCHAR_MAX + 1];
+            int i;
+            const char *s;
+            struct re_registers regs;
+
+            #if HAVE_LOCALE_H
+              /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
+                 This test needs valgrind to catch the bug on Debian
+                 GNU/Linux 3.1 x86, but it might catch the bug better
+                 on other platforms and it shouldn't hurt to try the
+                 test here.  */
+              if (setlocale (LC_ALL, "en_US.UTF-8"))
+                {
+                  static char const pat[] = "insert into";
+                  static char const data[] =
+                    "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
+                  re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
+                                 | RE_ICASE);
+                  memset (&regex, 0, sizeof regex);
+                  s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+                  if (s)
+                    return 1;
+                  if (re_search (&regex, data, sizeof data - 1,
+                                 0, sizeof data - 1, &regs)
+                      != -1)
+                    return 1;
+                  if (! setlocale (LC_ALL, "C"))
+                    return 1;
+                }
+            #endif
+
+            /* This test is from glibc bug 3957, reported by Andrew Mackey.  */
+            re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("a[^x]b", 6, &regex);
+            if (s)
+              return 1;
+
+            /* This should fail, but succeeds for glibc-2.5.  */
+            if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+              return 1;
+
+            /* This regular expression is from Spencer ere test number 75
+               in grep-2.3.  */
+            re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+            memset (&regex, 0, sizeof regex);
+            for (i = 0; i <= UCHAR_MAX; i++)
+              folded_chars[i] = i;
+            regex.translate = folded_chars;
+            s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
+            /* This should fail with _Invalid character class name_ error.  */
+            if (!s)
+              return 1;
+
+            /* Ensure that [b-a] is diagnosed as invalid, when
+               using RE_NO_EMPTY_RANGES. */
+            re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("a[b-a]", 6, &regex);
+            if (s == 0)
+              return 1;
+
+            /* This should succeed, but does not for glibc-2.1.3.  */
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("{1", 2, &regex);
+
+            if (s)
+              return 1;
+
+            /* The following example is derived from a problem report
+               against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>.  */
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("[an\371]*n", 7, &regex);
+            if (s)
+              return 1;
+
+            /* This should match, but does not for glibc-2.2.1.  */
+            if (re_match (&regex, "an", 2, 0, &regs) != 2)
+              return 1;
+
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("x", 1, &regex);
+            if (s)
+              return 1;
+
+            /* glibc-2.2.93 does not work with a negative RANGE argument.  */
+            if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+              return 1;
+
+            /* The version of regex.c in older versions of gnulib
+               ignored RE_ICASE.  Detect that problem too.  */
+            re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("x", 1, &regex);
+            if (s)
+              return 1;
+
+            if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+              return 1;
+
+            /* Catch a bug reported by Vin Shelton in
+               http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html
+               */
+            re_set_syntax (RE_SYNTAX_POSIX_BASIC
+                           & ~RE_CONTEXT_INVALID_DUP
+                           & ~RE_NO_EMPTY_RANGES);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
+            if (s)
+              return 1;
+
+            /* REG_STARTEND was added to glibc on 2004-01-15.
+               Reject older versions.  */
+            if (! REG_STARTEND)
+              return 1;
+
+            /* Reject hosts whose regoff_t values are too narrow.
+               These include glibc 2.3.5 on hosts with 64-bit ptrdiff_t
+               and 32-bit int.  */
+            if (sizeof (regoff_t) < sizeof (ptrdiff_t)
+                || sizeof (regoff_t) < sizeof (ssize_t))
+              return 1;
+
+            return 0;]])],
        [gl_cv_func_re_compile_pattern_working=yes],
        [gl_cv_func_re_compile_pattern_working=no],
        dnl When crosscompiling, assume it is not working.
@@ -216,6 +221,7 @@ AC_DEFUN([gl_REGEX],
 AC_DEFUN([gl_PREREQ_REGEX],
 [
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+  AC_REQUIRE([AC_C_INLINE])
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   AC_CHECK_HEADERS([libintl.h])
index 7a89d0a6c16012f9a7f19165175e5c0b6bf18419..d087bd30fdd8f4f2c3545daad7c1e651c758bc8e 100644 (file)
@@ -1,5 +1,6 @@
 # safe-read.m4 serial 5
-dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index db119ffa59b5c710b0999c90a61ab1d98bd45ec6..2ff11d27a2dd1622c5a95387cb0063d6f9417eac 100644 (file)
@@ -1,5 +1,5 @@
 # safe-write.m4 serial 3
-dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2006, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 242f9e3602991d4a58dfc40068312d7c8cc24498..2486511aadbe14cf27428a0e70745ff4d3974111 100644 (file)
@@ -1,5 +1,5 @@
-# servent.m4 serial 1
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# servent.m4 serial 2
+dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -30,12 +30,16 @@ AC_DEFUN([gl_SERVENT],
         [gl_cv_w32_getservbyname=no
          gl_save_LIBS="$LIBS"
          LIBS="$LIBS -lws2_32"
-         AC_TRY_LINK([
+         AC_LINK_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
 #endif
 #include <stddef.h>
-], [getservbyname(NULL,NULL);], [gl_cv_w32_getservbyname=yes])
+              ]],
+              [[getservbyname(NULL,NULL);]])],
+           [gl_cv_w32_getservbyname=yes])
          LIBS="$gl_save_LIBS"
         ])
       if test "$gl_cv_w32_getservbyname" = "yes"; then
index e0e7b3ff9542839b454870968c510e67d52c5913..f3b1a9dfb2074f1cb667ef70f15c3c32456541ef 100644 (file)
@@ -1,5 +1,5 @@
-# size_max.m4 serial 7
-dnl Copyright (C) 2003, 2005-2006, 2008 Free Software Foundation, Inc.
+# size_max.m4 serial 10
+dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,8 +10,7 @@ AC_DEFUN([gl_SIZE_MAX],
 [
   AC_CHECK_HEADERS([stdint.h])
   dnl First test whether the system already has SIZE_MAX.
-  AC_MSG_CHECKING([for SIZE_MAX])
-  AC_CACHE_VAL([gl_cv_size_max], [
+  AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
     gl_cv_size_max=
     AC_EGREP_CPP([Found it], [
 #include <limits.h>
@@ -35,10 +34,14 @@ Found it
         if test $fits_in_uint = 1; then
           dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
           dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
-          AC_TRY_COMPILE([#include <stddef.h>
-            extern size_t foo;
-            extern unsigned long foo;
-            ], [], [fits_in_uint=0])
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[#include <stddef.h>
+                 extern size_t foo;
+                 extern unsigned long foo;
+               ]],
+               [[]])],
+            [fits_in_uint=0])
         fi
         dnl We cannot use 'expr' to simplify this expression, because 'expr'
         dnl works only with 'long' integers in the host environment, while we
@@ -54,11 +57,19 @@ Found it
       fi
     fi
   ])
-  AC_MSG_RESULT([$gl_cv_size_max])
   if test "$gl_cv_size_max" != yes; then
     AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
       [Define as the maximum value of type 'size_t', if the system doesn't define it.])
   fi
+  dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
+  dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
+  dnl #define by AC_DEFINE_UNQUOTED.
+  AH_VERBATIM([SIZE_MAX],
+[/* Define as the maximum value of type 'size_t', if the system doesn't define
+   it. */
+#ifndef SIZE_MAX
+# undef SIZE_MAX
+#endif])
 ])
 
 dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
index 6021786ee146ea02ca697a1a90360dc95c6043d4..522b107b12679079050a1459d80b74c067d04743 100644 (file)
@@ -1,5 +1,5 @@
 # snprintf.m4 serial 5
-dnl Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index b755757be43c91d0b48c6e0027c829466e6c6a34..d0d6baab5515280fd053517dc7731668332ce325 100644 (file)
@@ -1,5 +1,5 @@
-# socklen.m4 serial 6
-dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+# socklen.m4 serial 8
+dnl Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,8 +8,9 @@ dnl From Albert Chin, Windows fixes from Simon Josefsson.
 
 dnl Check for socklen_t: historically on BSD it is an int, and in
 dnl POSIX 1g it is a type of its own, but some platforms use different
-dnl types for the argument to getsockopt, getpeername, etc.  So we
-dnl have to test to find something that will work.
+dnl types for the argument to getsockopt, getpeername, etc.:
+dnl HP-UX 10.20, IRIX 6.5, Interix 3.5, BeOS.
+dnl So we have to test to find something that will work.
 
 dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
 dnl it there first.  That file is included by gnulib's sys_socket.in.h, which
@@ -20,30 +21,30 @@ AC_DEFUN([gl_TYPE_SOCKLEN_T],
    AC_CHECK_TYPE([socklen_t], ,
      [AC_MSG_CHECKING([for socklen_t equivalent])
       AC_CACHE_VAL([gl_cv_socklen_t_equiv],
-       [# Systems have either "struct sockaddr *" or
-        # "void *" as the second argument to getpeername
-        gl_cv_socklen_t_equiv=
-        for arg2 in "struct sockaddr" void; do
-          for t in int size_t "unsigned int" "long int" "unsigned long int"; do
-            AC_TRY_COMPILE(
-              [#include <sys/types.h>
-               #include <sys/socket.h>
+        [# Systems have either "struct sockaddr *" or
+         # "void *" as the second argument to getpeername
+         gl_cv_socklen_t_equiv=
+         for arg2 in "struct sockaddr" void; do
+           for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+             AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+                 [[#include <sys/types.h>
+                   #include <sys/socket.h>
 
-               int getpeername (int, $arg2 *, $t *);],
-              [$t len;
-               getpeername (0, 0, &len);],
-              [gl_cv_socklen_t_equiv="$t"])
-            test "$gl_cv_socklen_t_equiv" != "" && break
-          done
-          test "$gl_cv_socklen_t_equiv" != "" && break
-        done
+                   int getpeername (int, $arg2 *, $t *);]],
+                 [[$t len;
+                  getpeername (0, 0, &len);]])],
+               [gl_cv_socklen_t_equiv="$t"])
+             test "$gl_cv_socklen_t_equiv" != "" && break
+           done
+           test "$gl_cv_socklen_t_equiv" != "" && break
+         done
       ])
       if test "$gl_cv_socklen_t_equiv" = ""; then
-       AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+        AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
       fi
       AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
       AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
-       [type to use in place of socklen_t if not defined])],
+        [type to use in place of socklen_t if not defined])],
      [#include <sys/types.h>
       #if HAVE_SYS_SOCKET_H
       # include <sys/socket.h>
index 99ea06f96f83fb77d40f5d1db4048d12dfb4ff37..8806705ae227ffb0272a0ee02265e5ea618e1b6e 100644 (file)
@@ -1,5 +1,5 @@
-# sockpfaf.m4 serial 6
-dnl Copyright (C) 2004, 2006, 2009 Free Software Foundation, Inc.
+# sockpfaf.m4 serial 7
+dnl Copyright (C) 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -18,7 +18,7 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
 
   AC_MSG_CHECKING([for IPv4 sockets])
   AC_CACHE_VAL([gl_cv_socket_ipv4],
-    [AC_TRY_COMPILE([#include <sys/types.h>
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
@@ -27,9 +27,9 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
 #endif
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
-#endif],
-[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
- if (&x && &y && &z) return 0;],
+#endif]],
+[[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
+ if (&x && &y && &z) return 0;]])],
        gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
   AC_MSG_RESULT([$gl_cv_socket_ipv4])
   if test $gl_cv_socket_ipv4 = yes; then
@@ -38,7 +38,7 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
 
   AC_MSG_CHECKING([for IPv6 sockets])
   AC_CACHE_VAL([gl_cv_socket_ipv6],
-    [AC_TRY_COMPILE([#include <sys/types.h>
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
@@ -47,9 +47,12 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
 #endif
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
-#endif],
-[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
- if (&x && &y && &z) return 0;],
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif]],
+[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
+ if (&x && &y && &z) return 0;]])],
        gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
   AC_MSG_RESULT([$gl_cv_socket_ipv6])
   if test $gl_cv_socket_ipv6 = yes; then
index 4eaef93ce37ece14d9ba6b26b2e28ec3016b4d17..e4c160b50d99c96aee5557ff0809c58f7a822594 100644 (file)
@@ -1,5 +1,5 @@
-# ssize_t.m4 serial 4 (gettext-0.15)
-dnl Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc.
+# ssize_t.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2001-2003, 2006, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,9 +10,11 @@ dnl Test whether ssize_t is defined.
 AC_DEFUN([gt_TYPE_SSIZE_T],
 [
   AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t],
-    [AC_TRY_COMPILE([#include <sys/types.h>],
-       [int x = sizeof (ssize_t *) + sizeof (ssize_t);
-        return !x;],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <sys/types.h>]],
+          [[int x = sizeof (ssize_t *) + sizeof (ssize_t);
+            return !x;]])],
        [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
   if test $gt_cv_ssize_t = no; then
     AC_DEFINE([ssize_t], [int],
diff --git a/config/gnulib/stat.m4 b/config/gnulib/stat.m4
new file mode 100644 (file)
index 0000000..75e1d94
--- /dev/null
@@ -0,0 +1,63 @@
+# serial 5
+
+# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STAT],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_AC_DOS])
+  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([lstat])
+  dnl mingw is the only known platform where stat(".") and stat("./") differ
+  AC_CACHE_CHECK([whether stat handles trailing slashes on directories],
+      [gl_cv_func_stat_dir_slash],
+      [AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(
+           [[#include <sys/stat.h>
+]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])],
+         [gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no],
+         [case $host_os in
+            mingw*) gl_cv_func_stat_dir_slash="guessing no";;
+            *) gl_cv_func_stat_dir_slash="guessing yes";;
+          esac])])
+  dnl AIX 7.1, Solaris 9 mistakenly succeed on stat("file/")
+  dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/")
+  AC_CACHE_CHECK([whether stat handles trailing slashes on files],
+      [gl_cv_func_stat_file_slash],
+      [touch conftest.tmp
+       # Assume that if we have lstat, we can also check symlinks.
+       if test $ac_cv_func_lstat = yes; then
+         ln -s conftest.tmp conftest.lnk
+       fi
+       AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(
+           [[#include <sys/stat.h>
+]], [[struct stat st;
+      if (!stat ("conftest.tmp/", &st)) return 1;
+#if HAVE_LSTAT
+      if (!stat ("conftest.lnk/", &st)) return 2;
+#endif
+           ]])],
+         [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
+         [gl_cv_func_stat_file_slash="guessing no"])
+       rm -f conftest.tmp conftest.lnk])
+  case $gl_cv_func_stat_dir_slash in
+    *no) REPLACE_STAT=1
+      AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs
+        help when passed a directory name with a trailing slash]);;
+  esac
+  case $gl_cv_func_stat_file_slash in
+    *no) REPLACE_STAT=1
+      AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
+        help when passed a file name with a trailing slash]);;
+  esac
+  if test $REPLACE_STAT = 1; then
+    AC_LIBOBJ([stat])
+    dnl Prerequisites of lib/stat.c.
+    AC_REQUIRE([AC_C_INLINE])
+  fi
+])
index 57c804a80ff7da006714ce54b11da37c58557faa..1efe59ea1ca778630d7fda8ad62cf203669cfaf1 100644 (file)
@@ -1,10 +1,12 @@
 # Check for stdbool.h that conforms to C99.
 
-dnl Copyright (C) 2002-2006, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+#serial 3
+
 # Prepare for substituting <stdbool.h> if it is not supported.
 
 AC_DEFUN([AM_STDBOOL_H],
@@ -31,84 +33,70 @@ AC_DEFUN([AM_STDBOOL_H],
 # AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
 AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
 
-# This macro is only needed in autoconf <= 2.59.  Newer versions of autoconf
-# have this macro built-in.
+# This version of the macro is needed in autoconf <= 2.67.  Autoconf has
+# it built in since 2.60, but we want the tweaks from the 2.68 version
+# to avoid rejecting xlc and clang due to relying on extensions.
 
 AC_DEFUN([AC_HEADER_STDBOOL],
   [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
      [ac_cv_header_stdbool_h],
-     [AC_TRY_COMPILE(
-       [
-         #include <stdbool.h>
-         #ifndef bool
-          "error: bool is not defined"
-         #endif
-         #ifndef false
-          "error: false is not defined"
-         #endif
-         #if false
-          "error: false is not 0"
-         #endif
-         #ifndef true
-          "error: true is not defined"
-         #endif
-         #if true != 1
-          "error: true is not 1"
-         #endif
-         #ifndef __bool_true_false_are_defined
-          "error: __bool_true_false_are_defined is not defined"
-         #endif
+     [AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
+             #include <stdbool.h>
+             #ifndef bool
+              "error: bool is not defined"
+             #endif
+             #ifndef false
+              "error: false is not defined"
+             #endif
+             #if false
+              "error: false is not 0"
+             #endif
+             #ifndef true
+              "error: true is not defined"
+             #endif
+             #if true != 1
+              "error: true is not 1"
+             #endif
+             #ifndef __bool_true_false_are_defined
+              "error: __bool_true_false_are_defined is not defined"
+             #endif
 
-         struct s { _Bool s: 1; _Bool t; } s;
+             struct s { _Bool s: 1; _Bool t; } s;
 
-         char a[true == 1 ? 1 : -1];
-         char b[false == 0 ? 1 : -1];
-         char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-         char d[(bool) 0.5 == true ? 1 : -1];
-         bool e = &s;
-         char f[(_Bool) 0.0 == false ? 1 : -1];
-         char g[true];
-         char h[sizeof (_Bool)];
-         char i[sizeof s.t];
-         enum { j = false, k = true, l = false * true, m = true * 256 };
-         _Bool n[m];
-         char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-         char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-         #if defined __xlc__ || defined __GNUC__
-          /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-             reported by James Lemley on 2005-10-05; see
-             http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-             This test is not quite right, since xlc is allowed to
-             reject this program, as the initializer for xlcbug is
-             not one of the forms that C requires support for.
-             However, doing the test right would require a run-time
-             test, and that would make cross-compilation harder.
-             Let us hope that IBM fixes the xlc bug, and also adds
-             support for this kind of constant expression.  In the
-             meantime, this test will reject xlc, which is OK, since
-             our stdbool.h substitute should suffice.  We also test
-             this with GCC, where it should work, to detect more
-             quickly whether someone messes up the test in the
-             future.  */
-          char digs[] = "0123456789";
-          int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-         #endif
-         /* Catch a bug in an HP-UX C compiler.  See
-            http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-            http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-          */
-         _Bool q = true;
-         _Bool *pq = &q;
-       ],
-       [
-         *pq |= q;
-         *pq |= ! q;
-         /* Refer to every declared value, to avoid compiler optimizations.  */
-         return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-                 + !m + !n + !o + !p + !q + !pq);
-       ],
-       [ac_cv_header_stdbool_h=yes],
-       [ac_cv_header_stdbool_h=no])])
+             char a[true == 1 ? 1 : -1];
+             char b[false == 0 ? 1 : -1];
+             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+             char d[(bool) 0.5 == true ? 1 : -1];
+             /* See body of main program for 'e'.  */
+             char f[(_Bool) 0.0 == false ? 1 : -1];
+             char g[true];
+             char h[sizeof (_Bool)];
+             char i[sizeof s.t];
+             enum { j = false, k = true, l = false * true, m = true * 256 };
+             /* The following fails for
+                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+             _Bool n[m];
+             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+             /* Catch a bug in an HP-UX C compiler.  See
+                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+              */
+             _Bool q = true;
+             _Bool *pq = &q;
+           ]],
+           [[
+             bool e = &s;
+             *pq |= q;
+             *pq |= ! q;
+             /* Refer to every declared value, to avoid compiler optimizations.  */
+             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                     + !m + !n + !o + !p + !q + !pq);
+           ]])],
+        [ac_cv_header_stdbool_h=yes],
+        [ac_cv_header_stdbool_h=no])])
    AC_CHECK_TYPES([_Bool])
    if test $ac_cv_header_stdbool_h = yes; then
      AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.])
diff --git a/config/gnulib/stddef_h.m4 b/config/gnulib/stddef_h.m4
new file mode 100644 (file)
index 0000000..c3ae569
--- /dev/null
@@ -0,0 +1,45 @@
+dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
+# stddef_h.m4 serial 2
+dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_STDDEF_H],
+[
+  AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
+  AC_REQUIRE([gt_TYPE_WCHAR_T])
+  if test $gt_cv_c_wchar_t = no; then
+    HAVE_WCHAR_T=0
+    STDDEF_H=stddef.h
+  fi
+  AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
+    [gl_cv_decl_null_works],
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
+      int test[2 * (sizeof NULL == sizeof (void *)) -1];
+]])],
+      [gl_cv_decl_null_works=yes],
+      [gl_cv_decl_null_works=no])])
+  if test $gl_cv_decl_null_works = no; then
+    REPLACE_NULL=1
+    STDDEF_H=stddef.h
+  fi
+  if test -n "$STDDEF_H"; then
+    gl_CHECK_NEXT_HEADERS([stddef.h])
+  fi
+])
+
+AC_DEFUN([gl_STDDEF_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_STDDEF_H_DEFAULTS],
+[
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  REPLACE_NULL=0;                AC_SUBST([REPLACE_NULL])
+  HAVE_WCHAR_T=1;                AC_SUBST([HAVE_WCHAR_T])
+  STDDEF_H='';                   AC_SUBST([STDDEF_H])
+])
index a2e8bdd62814a97e7be2875fd8f3cbf3b4c4ba8f..c5e813a96d00639cbfcc98f8a83e2804efee0602 100644 (file)
@@ -1,5 +1,5 @@
-# stdint.m4 serial 34
-dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
+# stdint.m4 serial 35
+dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -309,7 +309,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
   m4_foreach_w([gltype], [$1],
-    [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+    [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
        [Define to the number of bits in type ']gltype['.])])
   for gltype in $1 ; do
     AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
@@ -334,7 +334,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
     eval BITSIZEOF_${GLTYPE}=\$result
   done
   m4_foreach_w([gltype], [$1],
-    [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+    [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
 ])
 
 dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
@@ -347,7 +347,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
   m4_foreach_w([gltype], [$1],
-    [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+    [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
        [Define to 1 if ']gltype[' is a signed integer type.])])
   for gltype in $1 ; do
     AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
@@ -367,7 +367,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
     fi
   done
   m4_foreach_w([gltype], [$1],
-    [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+    [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
 ])
 
 dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
@@ -380,7 +380,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
   m4_foreach_w([gltype], [$1],
-    [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
+    [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
        [Define to l, ll, u, ul, ull, etc., as suitable for
         constants of type ']gltype['.])])
   for gltype in $1 ; do
@@ -396,12 +396,12 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
        for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
          case $glsuf in
            '')  gltype1='int';;
-           l)  gltype1='long int';;
-           ll) gltype1='long long int';;
-           i64)        gltype1='__int64';;
-           u)  gltype1='unsigned int';;
-           ul) gltype1='unsigned long int';;
-           ull)        gltype1='unsigned long long int';;
+           l)   gltype1='long int';;
+           ll)  gltype1='long long int';;
+           i64) gltype1='__int64';;
+           u)   gltype1='unsigned int';;
+           ul)  gltype1='unsigned long int';;
+           ull) gltype1='unsigned long long int';;
            ui64)gltype1='unsigned __int64';;
          esac
          AC_COMPILE_IFELSE(
@@ -419,7 +419,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
     AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
   done
   m4_foreach_w([gltype], [$1],
-    [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
+    [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
 ])
 
 dnl gl_STDINT_INCLUDES
index 82f0c244c8ee0c7a34de7b75fead88478e5bd08e..670c0cc2bff9c1edbab5da3ebb53bc9ee90749f8 100644 (file)
@@ -1,5 +1,5 @@
-# stdint_h.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+# stdint_h.m4 serial 9
+dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,12 +12,13 @@ dnl From Paul Eggert.
 AC_DEFUN([gl_AC_HEADER_STDINT_H],
 [
   AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
-#include <stdint.h>],
-    [uintmax_t i = (uintmax_t) -1; return !i;],
-    [gl_cv_header_stdint_h=yes],
-    [gl_cv_header_stdint_h=no])])
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <sys/types.h>
+            #include <stdint.h>]],
+          [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+       [gl_cv_header_stdint_h=yes],
+       [gl_cv_header_stdint_h=no])])
   if test $gl_cv_header_stdint_h = yes; then
     AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
       [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
index 846b65d302cbe5197c136ab96f019c88f6392d00..f5650cdeabc6a2f4dcabfe515c4077c398aa587a 100644 (file)
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 15
-dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
+# stdio_h.m4 serial 31
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,8 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_STDIO_H],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  AC_REQUIRE([AC_C_INLINE])
+  AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
   gl_CHECK_NEXT_HEADERS([stdio.h])
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
@@ -30,86 +32,110 @@ AC_DEFUN([gl_STDIO_H],
       AC_LIBOBJ([stdio-write])
     fi
   ])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, and which is not
+  dnl guaranteed by C89.
+  gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
+    ]], [dprintf fpurge fseeko ftello getdelim getline popen renameat
+    snprintf tmpfile vdprintf vsnprintf])
 ])
 
 AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_STDIO_H_DEFAULTS],
 [
-  GNULIB_FPRINTF=0;              AC_SUBST([GNULIB_FPRINTF])
-  GNULIB_FPRINTF_POSIX=0;        AC_SUBST([GNULIB_FPRINTF_POSIX])
-  GNULIB_PRINTF=0;               AC_SUBST([GNULIB_PRINTF])
-  GNULIB_PRINTF_POSIX=0;         AC_SUBST([GNULIB_PRINTF_POSIX])
-  GNULIB_SNPRINTF=0;             AC_SUBST([GNULIB_SNPRINTF])
-  GNULIB_SPRINTF_POSIX=0;        AC_SUBST([GNULIB_SPRINTF_POSIX])
-  GNULIB_VFPRINTF=0;             AC_SUBST([GNULIB_VFPRINTF])
-  GNULIB_VFPRINTF_POSIX=0;       AC_SUBST([GNULIB_VFPRINTF_POSIX])
-  GNULIB_VPRINTF=0;              AC_SUBST([GNULIB_VPRINTF])
-  GNULIB_VPRINTF_POSIX=0;        AC_SUBST([GNULIB_VPRINTF_POSIX])
-  GNULIB_VSNPRINTF=0;            AC_SUBST([GNULIB_VSNPRINTF])
-  GNULIB_VSPRINTF_POSIX=0;       AC_SUBST([GNULIB_VSPRINTF_POSIX])
   GNULIB_DPRINTF=0;              AC_SUBST([GNULIB_DPRINTF])
-  GNULIB_VDPRINTF=0;             AC_SUBST([GNULIB_VDPRINTF])
-  GNULIB_VASPRINTF=0;            AC_SUBST([GNULIB_VASPRINTF])
-  GNULIB_OBSTACK_PRINTF=0;       AC_SUBST([GNULIB_OBSTACK_PRINTF])
-  GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
+  GNULIB_FCLOSE=0;               AC_SUBST([GNULIB_FCLOSE])
+  GNULIB_FFLUSH=0;               AC_SUBST([GNULIB_FFLUSH])
   GNULIB_FOPEN=0;                AC_SUBST([GNULIB_FOPEN])
+  GNULIB_FPRINTF=0;              AC_SUBST([GNULIB_FPRINTF])
+  GNULIB_FPRINTF_POSIX=0;        AC_SUBST([GNULIB_FPRINTF_POSIX])
+  GNULIB_FPURGE=0;               AC_SUBST([GNULIB_FPURGE])
+  GNULIB_FPUTC=0;                AC_SUBST([GNULIB_FPUTC])
+  GNULIB_FPUTS=0;                AC_SUBST([GNULIB_FPUTS])
   GNULIB_FREOPEN=0;              AC_SUBST([GNULIB_FREOPEN])
   GNULIB_FSEEK=0;                AC_SUBST([GNULIB_FSEEK])
   GNULIB_FSEEKO=0;               AC_SUBST([GNULIB_FSEEKO])
   GNULIB_FTELL=0;                AC_SUBST([GNULIB_FTELL])
   GNULIB_FTELLO=0;               AC_SUBST([GNULIB_FTELLO])
-  GNULIB_FFLUSH=0;               AC_SUBST([GNULIB_FFLUSH])
-  GNULIB_FCLOSE=0;               AC_SUBST([GNULIB_FCLOSE])
-  GNULIB_FPUTC=0;                AC_SUBST([GNULIB_FPUTC])
-  GNULIB_PUTC=0;                 AC_SUBST([GNULIB_PUTC])
-  GNULIB_PUTCHAR=0;              AC_SUBST([GNULIB_PUTCHAR])
-  GNULIB_FPUTS=0;                AC_SUBST([GNULIB_FPUTS])
-  GNULIB_PUTS=0;                 AC_SUBST([GNULIB_PUTS])
   GNULIB_FWRITE=0;               AC_SUBST([GNULIB_FWRITE])
   GNULIB_GETDELIM=0;             AC_SUBST([GNULIB_GETDELIM])
   GNULIB_GETLINE=0;              AC_SUBST([GNULIB_GETLINE])
+  GNULIB_OBSTACK_PRINTF=0;       AC_SUBST([GNULIB_OBSTACK_PRINTF])
+  GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
   GNULIB_PERROR=0;               AC_SUBST([GNULIB_PERROR])
+  GNULIB_POPEN=0;                AC_SUBST([GNULIB_POPEN])
+  GNULIB_PRINTF=0;               AC_SUBST([GNULIB_PRINTF])
+  GNULIB_PRINTF_POSIX=0;         AC_SUBST([GNULIB_PRINTF_POSIX])
+  GNULIB_PUTC=0;                 AC_SUBST([GNULIB_PUTC])
+  GNULIB_PUTCHAR=0;              AC_SUBST([GNULIB_PUTCHAR])
+  GNULIB_PUTS=0;                 AC_SUBST([GNULIB_PUTS])
+  GNULIB_REMOVE=0;               AC_SUBST([GNULIB_REMOVE])
+  GNULIB_RENAME=0;               AC_SUBST([GNULIB_RENAME])
+  GNULIB_RENAMEAT=0;             AC_SUBST([GNULIB_RENAMEAT])
+  GNULIB_SNPRINTF=0;             AC_SUBST([GNULIB_SNPRINTF])
+  GNULIB_SPRINTF_POSIX=0;        AC_SUBST([GNULIB_SPRINTF_POSIX])
   GNULIB_STDIO_H_SIGPIPE=0;      AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
+  GNULIB_TMPFILE=0;              AC_SUBST([GNULIB_TMPFILE])
+  GNULIB_VASPRINTF=0;            AC_SUBST([GNULIB_VASPRINTF])
+  GNULIB_VDPRINTF=0;             AC_SUBST([GNULIB_VDPRINTF])
+  GNULIB_VFPRINTF=0;             AC_SUBST([GNULIB_VFPRINTF])
+  GNULIB_VFPRINTF_POSIX=0;       AC_SUBST([GNULIB_VFPRINTF_POSIX])
+  GNULIB_VPRINTF=0;              AC_SUBST([GNULIB_VPRINTF])
+  GNULIB_VPRINTF_POSIX=0;        AC_SUBST([GNULIB_VPRINTF_POSIX])
+  GNULIB_VSNPRINTF=0;            AC_SUBST([GNULIB_VSNPRINTF])
+  GNULIB_VSPRINTF_POSIX=0;       AC_SUBST([GNULIB_VSPRINTF_POSIX])
   dnl Assume proper GNU behavior unless another module says otherwise.
-  REPLACE_STDIO_WRITE_FUNCS=0;   AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
-  REPLACE_FPRINTF=0;             AC_SUBST([REPLACE_FPRINTF])
-  REPLACE_VFPRINTF=0;            AC_SUBST([REPLACE_VFPRINTF])
-  REPLACE_PRINTF=0;              AC_SUBST([REPLACE_PRINTF])
-  REPLACE_VPRINTF=0;             AC_SUBST([REPLACE_VPRINTF])
-  REPLACE_SNPRINTF=0;            AC_SUBST([REPLACE_SNPRINTF])
+  HAVE_DECL_FPURGE=1;            AC_SUBST([HAVE_DECL_FPURGE])
+  HAVE_DECL_GETDELIM=1;          AC_SUBST([HAVE_DECL_GETDELIM])
+  HAVE_DECL_GETLINE=1;           AC_SUBST([HAVE_DECL_GETLINE])
+  HAVE_DECL_OBSTACK_PRINTF=1;    AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
   HAVE_DECL_SNPRINTF=1;          AC_SUBST([HAVE_DECL_SNPRINTF])
-  REPLACE_VSNPRINTF=0;           AC_SUBST([REPLACE_VSNPRINTF])
   HAVE_DECL_VSNPRINTF=1;         AC_SUBST([HAVE_DECL_VSNPRINTF])
-  REPLACE_SPRINTF=0;             AC_SUBST([REPLACE_SPRINTF])
-  REPLACE_VSPRINTF=0;            AC_SUBST([REPLACE_VSPRINTF])
   HAVE_DPRINTF=1;                AC_SUBST([HAVE_DPRINTF])
-  REPLACE_DPRINTF=0;             AC_SUBST([REPLACE_DPRINTF])
-  HAVE_VDPRINTF=1;               AC_SUBST([HAVE_VDPRINTF])
-  REPLACE_VDPRINTF=0;            AC_SUBST([REPLACE_VDPRINTF])
+  HAVE_FSEEKO=1;                 AC_SUBST([HAVE_FSEEKO])
+  HAVE_FTELLO=1;                 AC_SUBST([HAVE_FTELLO])
+  HAVE_RENAMEAT=1;               AC_SUBST([HAVE_RENAMEAT])
   HAVE_VASPRINTF=1;              AC_SUBST([HAVE_VASPRINTF])
-  REPLACE_VASPRINTF=0;           AC_SUBST([REPLACE_VASPRINTF])
-  HAVE_DECL_OBSTACK_PRINTF=1;    AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
-  REPLACE_OBSTACK_PRINTF=0;      AC_SUBST([REPLACE_OBSTACK_PRINTF])
+  HAVE_VDPRINTF=1;               AC_SUBST([HAVE_VDPRINTF])
+  REPLACE_DPRINTF=0;             AC_SUBST([REPLACE_DPRINTF])
+  REPLACE_FCLOSE=0;              AC_SUBST([REPLACE_FCLOSE])
+  REPLACE_FFLUSH=0;              AC_SUBST([REPLACE_FFLUSH])
   REPLACE_FOPEN=0;               AC_SUBST([REPLACE_FOPEN])
+  REPLACE_FPRINTF=0;             AC_SUBST([REPLACE_FPRINTF])
+  REPLACE_FPURGE=0;              AC_SUBST([REPLACE_FPURGE])
   REPLACE_FREOPEN=0;             AC_SUBST([REPLACE_FREOPEN])
-  HAVE_FSEEKO=1;                 AC_SUBST([HAVE_FSEEKO])
-  REPLACE_FSEEKO=0;              AC_SUBST([REPLACE_FSEEKO])
   REPLACE_FSEEK=0;               AC_SUBST([REPLACE_FSEEK])
-  HAVE_FTELLO=1;                 AC_SUBST([HAVE_FTELLO])
-  REPLACE_FTELLO=0;              AC_SUBST([REPLACE_FTELLO])
+  REPLACE_FSEEKO=0;              AC_SUBST([REPLACE_FSEEKO])
   REPLACE_FTELL=0;               AC_SUBST([REPLACE_FTELL])
-  REPLACE_FFLUSH=0;              AC_SUBST([REPLACE_FFLUSH])
-  REPLACE_FCLOSE=0;              AC_SUBST([REPLACE_FCLOSE])
-  HAVE_DECL_GETDELIM=1;          AC_SUBST([HAVE_DECL_GETDELIM])
-  HAVE_DECL_GETLINE=1;           AC_SUBST([HAVE_DECL_GETLINE])
+  REPLACE_FTELLO=0;              AC_SUBST([REPLACE_FTELLO])
+  REPLACE_GETDELIM=0;            AC_SUBST([REPLACE_GETDELIM])
   REPLACE_GETLINE=0;             AC_SUBST([REPLACE_GETLINE])
+  REPLACE_OBSTACK_PRINTF=0;      AC_SUBST([REPLACE_OBSTACK_PRINTF])
   REPLACE_PERROR=0;              AC_SUBST([REPLACE_PERROR])
+  REPLACE_POPEN=0;               AC_SUBST([REPLACE_POPEN])
+  REPLACE_PRINTF=0;              AC_SUBST([REPLACE_PRINTF])
+  REPLACE_REMOVE=0;              AC_SUBST([REPLACE_REMOVE])
+  REPLACE_RENAME=0;              AC_SUBST([REPLACE_RENAME])
+  REPLACE_RENAMEAT=0;            AC_SUBST([REPLACE_RENAMEAT])
+  REPLACE_SNPRINTF=0;            AC_SUBST([REPLACE_SNPRINTF])
+  REPLACE_SPRINTF=0;             AC_SUBST([REPLACE_SPRINTF])
+  REPLACE_STDIO_WRITE_FUNCS=0;   AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
+  REPLACE_TMPFILE=0;             AC_SUBST([REPLACE_TMPFILE])
+  REPLACE_VASPRINTF=0;           AC_SUBST([REPLACE_VASPRINTF])
+  REPLACE_VDPRINTF=0;            AC_SUBST([REPLACE_VDPRINTF])
+  REPLACE_VFPRINTF=0;            AC_SUBST([REPLACE_VFPRINTF])
+  REPLACE_VPRINTF=0;             AC_SUBST([REPLACE_VPRINTF])
+  REPLACE_VSNPRINTF=0;           AC_SUBST([REPLACE_VSNPRINTF])
+  REPLACE_VSPRINTF=0;            AC_SUBST([REPLACE_VSPRINTF])
 ])
 
 dnl Code shared by fseeko and ftello.  Determine if large files are supported,
@@ -128,6 +154,6 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
   choke me
 # endif
 #endif]])],
-       [gl_cv_var_stdin_large_offset=yes],
-       [gl_cv_var_stdin_large_offset=no])])
+        [gl_cv_var_stdin_large_offset=yes],
+        [gl_cv_var_stdin_large_offset=no])])
 ])
index b295f16b2797a03bdd21abd9dbd0d25fc57c0ffa..fc150197b1303d17fc76669732f2f924585963c4 100644 (file)
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 15
-dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 30
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -22,41 +22,74 @@ AC_DEFUN([gl_STDLIB_H],
       # include <random.h>
       #endif
     ]])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, and which is not
+  dnl guaranteed by C89.
+  gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
+#if HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+#endif
+#if HAVE_RANDOM_H
+# include <random.h>
+#endif
+    ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt mkdtemp
+    mkostemp mkostemps mkstemp mkstemps ptsname random_r initstat_r srandom_r
+    setstate_r realpath rpmatch setenv strtod strtoll strtoull unlockpt
+    unsetenv])
 ])
 
 AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_STDLIB_H_DEFAULTS],
 [
-  GNULIB_MALLOC_POSIX=0;  AC_SUBST([GNULIB_MALLOC_POSIX])
-  GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
-  GNULIB_CALLOC_POSIX=0;  AC_SUBST([GNULIB_CALLOC_POSIX])
+  GNULIB__EXIT=0;         AC_SUBST([GNULIB__EXIT])
   GNULIB_ATOLL=0;         AC_SUBST([GNULIB_ATOLL])
+  GNULIB_CALLOC_POSIX=0;  AC_SUBST([GNULIB_CALLOC_POSIX])
+  GNULIB_CANONICALIZE_FILE_NAME=0;  AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME])
   GNULIB_GETLOADAVG=0;    AC_SUBST([GNULIB_GETLOADAVG])
   GNULIB_GETSUBOPT=0;     AC_SUBST([GNULIB_GETSUBOPT])
+  GNULIB_GRANTPT=0;       AC_SUBST([GNULIB_GRANTPT])
+  GNULIB_MALLOC_POSIX=0;  AC_SUBST([GNULIB_MALLOC_POSIX])
   GNULIB_MKDTEMP=0;       AC_SUBST([GNULIB_MKDTEMP])
+  GNULIB_MKOSTEMP=0;      AC_SUBST([GNULIB_MKOSTEMP])
+  GNULIB_MKOSTEMPS=0;     AC_SUBST([GNULIB_MKOSTEMPS])
   GNULIB_MKSTEMP=0;       AC_SUBST([GNULIB_MKSTEMP])
+  GNULIB_MKSTEMPS=0;      AC_SUBST([GNULIB_MKSTEMPS])
+  GNULIB_PTSNAME=0;       AC_SUBST([GNULIB_PTSNAME])
   GNULIB_PUTENV=0;        AC_SUBST([GNULIB_PUTENV])
   GNULIB_RANDOM_R=0;      AC_SUBST([GNULIB_RANDOM_R])
+  GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
+  GNULIB_REALPATH=0;      AC_SUBST([GNULIB_REALPATH])
   GNULIB_RPMATCH=0;       AC_SUBST([GNULIB_RPMATCH])
   GNULIB_SETENV=0;        AC_SUBST([GNULIB_SETENV])
   GNULIB_STRTOD=0;        AC_SUBST([GNULIB_STRTOD])
   GNULIB_STRTOLL=0;       AC_SUBST([GNULIB_STRTOLL])
   GNULIB_STRTOULL=0;      AC_SUBST([GNULIB_STRTOULL])
+  GNULIB_UNLOCKPT=0;      AC_SUBST([GNULIB_UNLOCKPT])
   GNULIB_UNSETENV=0;      AC_SUBST([GNULIB_UNSETENV])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE__EXIT=1;              AC_SUBST([HAVE__EXIT])
   HAVE_ATOLL=1;              AC_SUBST([HAVE_ATOLL])
-  HAVE_CALLOC_POSIX=1;       AC_SUBST([HAVE_CALLOC_POSIX])
+  HAVE_CANONICALIZE_FILE_NAME=1;  AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
+  HAVE_DECL_GETLOADAVG=1;    AC_SUBST([HAVE_DECL_GETLOADAVG])
   HAVE_GETSUBOPT=1;          AC_SUBST([HAVE_GETSUBOPT])
-  HAVE_MALLOC_POSIX=1;       AC_SUBST([HAVE_MALLOC_POSIX])
+  HAVE_GRANTPT=1;            AC_SUBST([HAVE_GRANTPT])
   HAVE_MKDTEMP=1;            AC_SUBST([HAVE_MKDTEMP])
-  HAVE_REALLOC_POSIX=1;      AC_SUBST([HAVE_REALLOC_POSIX])
+  HAVE_MKOSTEMP=1;           AC_SUBST([HAVE_MKOSTEMP])
+  HAVE_MKOSTEMPS=1;          AC_SUBST([HAVE_MKOSTEMPS])
+  HAVE_MKSTEMP=1;            AC_SUBST([HAVE_MKSTEMP])
+  HAVE_MKSTEMPS=1;           AC_SUBST([HAVE_MKSTEMPS])
+  HAVE_PTSNAME=1;            AC_SUBST([HAVE_PTSNAME])
   HAVE_RANDOM_R=1;           AC_SUBST([HAVE_RANDOM_R])
+  HAVE_REALPATH=1;           AC_SUBST([HAVE_REALPATH])
   HAVE_RPMATCH=1;            AC_SUBST([HAVE_RPMATCH])
   HAVE_SETENV=1;             AC_SUBST([HAVE_SETENV])
   HAVE_STRTOD=1;             AC_SUBST([HAVE_STRTOD])
@@ -64,10 +97,16 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   HAVE_STRTOULL=1;           AC_SUBST([HAVE_STRTOULL])
   HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
   HAVE_SYS_LOADAVG_H=0;      AC_SUBST([HAVE_SYS_LOADAVG_H])
+  HAVE_UNLOCKPT=1;           AC_SUBST([HAVE_UNLOCKPT])
   HAVE_UNSETENV=1;           AC_SUBST([HAVE_UNSETENV])
-  HAVE_DECL_GETLOADAVG=1;    AC_SUBST([HAVE_DECL_GETLOADAVG])
+  REPLACE_CALLOC=0;          AC_SUBST([REPLACE_CALLOC])
+  REPLACE_CANONICALIZE_FILE_NAME=0;  AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
+  REPLACE_MALLOC=0;          AC_SUBST([REPLACE_MALLOC])
   REPLACE_MKSTEMP=0;         AC_SUBST([REPLACE_MKSTEMP])
   REPLACE_PUTENV=0;          AC_SUBST([REPLACE_PUTENV])
+  REPLACE_REALLOC=0;         AC_SUBST([REPLACE_REALLOC])
+  REPLACE_REALPATH=0;        AC_SUBST([REPLACE_REALPATH])
+  REPLACE_SETENV=0;          AC_SUBST([REPLACE_SETENV])
   REPLACE_STRTOD=0;          AC_SUBST([REPLACE_STRTOD])
-  VOID_UNSETENV=0;           AC_SUBST([VOID_UNSETENV])
+  REPLACE_UNSETENV=0;        AC_SUBST([REPLACE_UNSETENV])
 ])
diff --git a/config/gnulib/string_h.m4 b/config/gnulib/string_h.m4
new file mode 100644 (file)
index 0000000..1977aec
--- /dev/null
@@ -0,0 +1,112 @@
+# Configure a GNU-like replacement for <string.h>.
+
+# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 17
+
+# Written by Paul Eggert.
+
+AC_DEFUN([gl_HEADER_STRING_H],
+[
+  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+  dnl once only, before all statements that occur in other macros.
+  AC_REQUIRE([gl_HEADER_STRING_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_STRING_H_BODY],
+[
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  gl_CHECK_NEXT_HEADERS([string.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, and which is not
+  dnl guaranteed by C89.
+  gl_WARN_ON_USE_PREPARE([[#include <string.h>
+    ]],
+    [memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup
+     strncat strndup strnlen strpbrk strsep strcasestr strtok_r strsignal
+     strverscmp])
+])
+
+AC_DEFUN([gl_STRING_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
+[
+  GNULIB_MEMCHR=0;      AC_SUBST([GNULIB_MEMCHR])
+  GNULIB_MEMMEM=0;      AC_SUBST([GNULIB_MEMMEM])
+  GNULIB_MEMPCPY=0;     AC_SUBST([GNULIB_MEMPCPY])
+  GNULIB_MEMRCHR=0;     AC_SUBST([GNULIB_MEMRCHR])
+  GNULIB_RAWMEMCHR=0;   AC_SUBST([GNULIB_RAWMEMCHR])
+  GNULIB_STPCPY=0;      AC_SUBST([GNULIB_STPCPY])
+  GNULIB_STPNCPY=0;     AC_SUBST([GNULIB_STPNCPY])
+  GNULIB_STRCHRNUL=0;   AC_SUBST([GNULIB_STRCHRNUL])
+  GNULIB_STRDUP=0;      AC_SUBST([GNULIB_STRDUP])
+  GNULIB_STRNCAT=0;     AC_SUBST([GNULIB_STRNCAT])
+  GNULIB_STRNDUP=0;     AC_SUBST([GNULIB_STRNDUP])
+  GNULIB_STRNLEN=0;     AC_SUBST([GNULIB_STRNLEN])
+  GNULIB_STRPBRK=0;     AC_SUBST([GNULIB_STRPBRK])
+  GNULIB_STRSEP=0;      AC_SUBST([GNULIB_STRSEP])
+  GNULIB_STRSTR=0;      AC_SUBST([GNULIB_STRSTR])
+  GNULIB_STRCASESTR=0;  AC_SUBST([GNULIB_STRCASESTR])
+  GNULIB_STRTOK_R=0;    AC_SUBST([GNULIB_STRTOK_R])
+  GNULIB_MBSLEN=0;      AC_SUBST([GNULIB_MBSLEN])
+  GNULIB_MBSNLEN=0;     AC_SUBST([GNULIB_MBSNLEN])
+  GNULIB_MBSCHR=0;      AC_SUBST([GNULIB_MBSCHR])
+  GNULIB_MBSRCHR=0;     AC_SUBST([GNULIB_MBSRCHR])
+  GNULIB_MBSSTR=0;      AC_SUBST([GNULIB_MBSSTR])
+  GNULIB_MBSCASECMP=0;  AC_SUBST([GNULIB_MBSCASECMP])
+  GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP])
+  GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP])
+  GNULIB_MBSCASESTR=0;  AC_SUBST([GNULIB_MBSCASESTR])
+  GNULIB_MBSCSPN=0;     AC_SUBST([GNULIB_MBSCSPN])
+  GNULIB_MBSPBRK=0;     AC_SUBST([GNULIB_MBSPBRK])
+  GNULIB_MBSSPN=0;      AC_SUBST([GNULIB_MBSSPN])
+  GNULIB_MBSSEP=0;      AC_SUBST([GNULIB_MBSSEP])
+  GNULIB_MBSTOK_R=0;    AC_SUBST([GNULIB_MBSTOK_R])
+  GNULIB_STRERROR=0;    AC_SUBST([GNULIB_STRERROR])
+  GNULIB_STRSIGNAL=0;   AC_SUBST([GNULIB_STRSIGNAL])
+  GNULIB_STRVERSCMP=0;  AC_SUBST([GNULIB_STRVERSCMP])
+  HAVE_MBSLEN=0;        AC_SUBST([HAVE_MBSLEN])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_MEMCHR=1;                AC_SUBST([HAVE_MEMCHR])
+  HAVE_DECL_MEMMEM=1;           AC_SUBST([HAVE_DECL_MEMMEM])
+  HAVE_MEMPCPY=1;               AC_SUBST([HAVE_MEMPCPY])
+  HAVE_DECL_MEMRCHR=1;          AC_SUBST([HAVE_DECL_MEMRCHR])
+  HAVE_RAWMEMCHR=1;             AC_SUBST([HAVE_RAWMEMCHR])
+  HAVE_STPCPY=1;                AC_SUBST([HAVE_STPCPY])
+  HAVE_STPNCPY=1;               AC_SUBST([HAVE_STPNCPY])
+  HAVE_STRCHRNUL=1;             AC_SUBST([HAVE_STRCHRNUL])
+  HAVE_DECL_STRDUP=1;           AC_SUBST([HAVE_DECL_STRDUP])
+  HAVE_DECL_STRNDUP=1;          AC_SUBST([HAVE_DECL_STRNDUP])
+  HAVE_DECL_STRNLEN=1;          AC_SUBST([HAVE_DECL_STRNLEN])
+  HAVE_STRPBRK=1;               AC_SUBST([HAVE_STRPBRK])
+  HAVE_STRSEP=1;                AC_SUBST([HAVE_STRSEP])
+  HAVE_STRCASESTR=1;            AC_SUBST([HAVE_STRCASESTR])
+  HAVE_DECL_STRTOK_R=1;         AC_SUBST([HAVE_DECL_STRTOK_R])
+  HAVE_DECL_STRSIGNAL=1;        AC_SUBST([HAVE_DECL_STRSIGNAL])
+  HAVE_STRVERSCMP=1;            AC_SUBST([HAVE_STRVERSCMP])
+  REPLACE_MEMCHR=0;             AC_SUBST([REPLACE_MEMCHR])
+  REPLACE_MEMMEM=0;             AC_SUBST([REPLACE_MEMMEM])
+  REPLACE_STPNCPY=0;            AC_SUBST([REPLACE_STPNCPY])
+  REPLACE_STRDUP=0;             AC_SUBST([REPLACE_STRDUP])
+  REPLACE_STRSTR=0;             AC_SUBST([REPLACE_STRSTR])
+  REPLACE_STRCASESTR=0;         AC_SUBST([REPLACE_STRCASESTR])
+  REPLACE_STRERROR=0;           AC_SUBST([REPLACE_STRERROR])
+  REPLACE_STRNCAT=0;            AC_SUBST([REPLACE_STRNCAT])
+  REPLACE_STRNDUP=0;            AC_SUBST([REPLACE_STRNDUP])
+  REPLACE_STRNLEN=0;            AC_SUBST([REPLACE_STRNLEN])
+  REPLACE_STRSIGNAL=0;          AC_SUBST([REPLACE_STRSIGNAL])
+  REPLACE_STRTOK_R=0;           AC_SUBST([REPLACE_STRTOK_R])
+  UNDEFINE_STRTOK_R=0;          AC_SUBST([UNDEFINE_STRTOK_R])
+])
index 85a0ace8ad9f3700c9ef98f1b9ddfe7466bf3659..9f4db562302b59da3f5593fbf15c3886fed54e65 100644 (file)
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 12
-dnl Copyright (C) 2005-2008 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 17
+dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -19,7 +19,6 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
         [gl_cv_header_sys_socket_h_selfcontained=no])
     ])
   if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
-    SYS_SOCKET_H=''
     dnl If the shutdown function exists, <sys/socket.h> should define
     dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
     AC_CHECK_FUNCS([shutdown])
@@ -37,36 +36,67 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
         SYS_SOCKET_H='sys/socket.h'
       fi
     fi
-  else
-    SYS_SOCKET_H='sys/socket.h'
   fi
-  if test -n "$SYS_SOCKET_H"; then
-    dnl Check prerequisites of the <sys/socket.h> replacement.
-    gl_CHECK_NEXT_HEADERS([sys/socket.h])
-    if test $ac_cv_header_sys_socket_h = yes; then
-      HAVE_SYS_SOCKET_H=1
-      HAVE_WS2TCPIP_H=0
+  # We need to check for ws2tcpip.h now.
+  gl_PREREQ_SYS_H_SOCKET
+  AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+  if test $ac_cv_type_struct_sockaddr_storage = no; then
+    HAVE_STRUCT_SOCKADDR_STORAGE=0
+  fi
+  if test $ac_cv_type_sa_family_t = no; then
+    HAVE_SA_FAMILY_T=0
+  fi
+  gl_PREREQ_SYS_H_WINSOCK2
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* Some systems require prerequisite headers.  */
+#include <sys/types.h>
+#if !defined __GLIBC__ && HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <sys/select.h>
+    ]], [socket connect accept bind getpeername getsockname getsockopt
+    listen recv send recvfrom sendto setsockopt shutdown accept4])
+])
+
+AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
+[
+  dnl Check prerequisites of the <sys/socket.h> replacement.
+  gl_CHECK_NEXT_HEADERS([sys/socket.h])
+  if test $ac_cv_header_sys_socket_h = yes; then
+    HAVE_SYS_SOCKET_H=1
+    HAVE_WS2TCPIP_H=0
+  else
+    HAVE_SYS_SOCKET_H=0
+    dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+    dnl the check for those headers unconditional; yet cygwin reports
+    dnl that the headers are present but cannot be compiled (since on
+    dnl cygwin, all socket information should come from sys/socket.h).
+    AC_CHECK_HEADERS([ws2tcpip.h])
+    if test $ac_cv_header_ws2tcpip_h = yes; then
+      HAVE_WS2TCPIP_H=1
     else
-      HAVE_SYS_SOCKET_H=0
-      dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
-      dnl the check for those headers unconditional; yet cygwin reports
-      dnl that the headers are present but cannot be compiled (since on
-      dnl cygwin, all socket information should come from sys/socket.h).
-      AC_CHECK_HEADERS([ws2tcpip.h])
-      if test $ac_cv_header_ws2tcpip_h = yes; then
-        HAVE_WS2TCPIP_H=1
-      else
-        HAVE_WS2TCPIP_H=0
-      fi
+      HAVE_WS2TCPIP_H=0
     fi
-    gl_PREREQ_SYS_H_WINSOCK2
-    AC_SUBST([HAVE_SYS_SOCKET_H])
-    AC_SUBST([HAVE_WS2TCPIP_H])
   fi
-  AC_SUBST([SYS_SOCKET_H])
+  AC_SUBST([HAVE_SYS_SOCKET_H])
+  AC_SUBST([HAVE_WS2TCPIP_H])
 ])
 
-# Common prerequisites of of the <sys/socket.h> replacement and of the
+# Common prerequisites of the <sys/socket.h> replacement and of the
 # <sys/select.h> replacement.
 # Sets and substitutes HAVE_WINSOCK2_H.
 AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
@@ -95,7 +125,9 @@ AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
@@ -114,4 +146,8 @@ AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
   GNULIB_SENDTO=0;      AC_SUBST([GNULIB_SENDTO])
   GNULIB_SETSOCKOPT=0;  AC_SUBST([GNULIB_SETSOCKOPT])
   GNULIB_SHUTDOWN=0;    AC_SUBST([GNULIB_SHUTDOWN])
+  GNULIB_ACCEPT4=0;     AC_SUBST([GNULIB_ACCEPT4])
+  HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
+  HAVE_SA_FAMILY_T=1;   AC_SUBST([HAVE_SA_FAMILY_T])
+  HAVE_ACCEPT4=1;       AC_SUBST([HAVE_ACCEPT4])
 ])
index 20c82edf931d700ee16f6cca4b66ef74cb318be6..7181c253b966229a96c8e033669eb60583266441 100644 (file)
@@ -1,26 +1,16 @@
-# sys_stat_h.m4 serial 10   -*- Autoconf -*-
-dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 24   -*- Autoconf -*-
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Eric Blake.
-dnl Test whether <sys/stat.h> contains lstat and mkdir or must be substituted.
+dnl Provide a GNU-like <sys/stat.h>.
 
 AC_DEFUN([gl_HEADER_SYS_STAT_H],
 [
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
 
-  dnl Check for lstat.  Systems that lack it (mingw) also lack symlinks, so
-  dnl stat is a good replacement.
-  AC_CHECK_FUNCS_ONCE([lstat])
-  if test $ac_cv_func_lstat = yes; then
-    HAVE_LSTAT=1
-  else
-    HAVE_LSTAT=0
-  fi
-  AC_SUBST([HAVE_LSTAT])
-
   dnl For the mkdir substitute.
   AC_REQUIRE([AC_C_INLINE])
 
@@ -28,8 +18,6 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
   AC_REQUIRE([AC_HEADER_STAT])
 
   gl_CHECK_NEXT_HEADERS([sys/stat.h])
-  SYS_STAT_H='sys/stat.h'
-  AC_SUBST([SYS_STAT_H])
 
   dnl Define types that are supposed to be defined in <sys/types.h> or
   dnl <sys/stat.h>.
@@ -39,21 +27,56 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
     [#include <sys/types.h>
      #include <sys/stat.h>])
 
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
+    ]], [fchmodat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
+    mknod mknodat stat utimensat])
 ]) # gl_HEADER_SYS_STAT_H
 
 AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
 [
-  GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD])
-  GNULIB_LSTAT=0;  AC_SUBST([GNULIB_LSTAT])
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
+  GNULIB_FCHMODAT=0;    AC_SUBST([GNULIB_FCHMODAT])
+  GNULIB_FSTATAT=0;     AC_SUBST([GNULIB_FSTATAT])
+  GNULIB_FUTIMENS=0;    AC_SUBST([GNULIB_FUTIMENS])
+  GNULIB_LCHMOD=0;      AC_SUBST([GNULIB_LCHMOD])
+  GNULIB_LSTAT=0;       AC_SUBST([GNULIB_LSTAT])
+  GNULIB_MKDIRAT=0;     AC_SUBST([GNULIB_MKDIRAT])
+  GNULIB_MKFIFO=0;      AC_SUBST([GNULIB_MKFIFO])
+  GNULIB_MKFIFOAT=0;    AC_SUBST([GNULIB_MKFIFOAT])
+  GNULIB_MKNOD=0;       AC_SUBST([GNULIB_MKNOD])
+  GNULIB_MKNODAT=0;     AC_SUBST([GNULIB_MKNODAT])
+  GNULIB_STAT=0;        AC_SUBST([GNULIB_STAT])
+  GNULIB_UTIMENSAT=0;   AC_SUBST([GNULIB_UTIMENSAT])
   dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_LCHMOD=1;   AC_SUBST([HAVE_LCHMOD])
-  REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT])
-  REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR])
+  HAVE_FCHMODAT=1;      AC_SUBST([HAVE_FCHMODAT])
+  HAVE_FSTATAT=1;       AC_SUBST([HAVE_FSTATAT])
+  HAVE_FUTIMENS=1;      AC_SUBST([HAVE_FUTIMENS])
+  HAVE_LCHMOD=1;        AC_SUBST([HAVE_LCHMOD])
+  HAVE_LSTAT=1;         AC_SUBST([HAVE_LSTAT])
+  HAVE_MKDIRAT=1;       AC_SUBST([HAVE_MKDIRAT])
+  HAVE_MKFIFO=1;        AC_SUBST([HAVE_MKFIFO])
+  HAVE_MKFIFOAT=1;      AC_SUBST([HAVE_MKFIFOAT])
+  HAVE_MKNOD=1;         AC_SUBST([HAVE_MKNOD])
+  HAVE_MKNODAT=1;       AC_SUBST([HAVE_MKNODAT])
+  HAVE_UTIMENSAT=1;     AC_SUBST([HAVE_UTIMENSAT])
+  REPLACE_FSTAT=0;      AC_SUBST([REPLACE_FSTAT])
+  REPLACE_FSTATAT=0;    AC_SUBST([REPLACE_FSTATAT])
+  REPLACE_FUTIMENS=0;   AC_SUBST([REPLACE_FUTIMENS])
+  REPLACE_LSTAT=0;      AC_SUBST([REPLACE_LSTAT])
+  REPLACE_MKDIR=0;      AC_SUBST([REPLACE_MKDIR])
+  REPLACE_MKFIFO=0;     AC_SUBST([REPLACE_MKFIFO])
+  REPLACE_MKNOD=0;      AC_SUBST([REPLACE_MKNOD])
+  REPLACE_STAT=0;       AC_SUBST([REPLACE_STAT])
+  REPLACE_UTIMENSAT=0;  AC_SUBST([REPLACE_UTIMENSAT])
 ])
index 13ac5763b3d5c76a26c6d5e5d0740f3b63f77cfb..da5752716344679a9343b7c14b62a5e771a6d582 100644 (file)
@@ -1,6 +1,7 @@
 # Configure a replacement for <sys/time.h>.
+# serial 6
 
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -18,40 +19,54 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H],
 AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+  AC_CHECK_HEADERS_ONCE([sys/time.h])
   gl_CHECK_NEXT_HEADERS([sys/time.h])
 
-  if test $ac_cv_header_sys_time_h = yes; then
-    HAVE_SYS_TIME_H=1
-  else
+  if test $ac_cv_header_sys_time_h != yes; then
     HAVE_SYS_TIME_H=0
   fi
-  AC_SUBST([HAVE_SYS_TIME_H])
 
   AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
-         [[#if HAVE_SYS_TIME_H
-            #include <sys/time.h>
-           #endif
-           #include <time.h>
-         ]],
-         [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
+          [[#if HAVE_SYS_TIME_H
+             #include <sys/time.h>
+            #endif
+            #include <time.h>
+          ]],
+          [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
        [gl_cv_sys_struct_timeval=yes],
        [gl_cv_sys_struct_timeval=no])])
-  if test $gl_cv_sys_struct_timeval = yes; then
-    HAVE_STRUCT_TIMEVAL=1
-  else
+  if test $gl_cv_sys_struct_timeval != yes; then
     HAVE_STRUCT_TIMEVAL=0
   fi
-  AC_SUBST([HAVE_STRUCT_TIMEVAL])
 
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <time.h>
+    ]], [gettimeofday])
+])
+
+AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
+[
+  GNULIB_GETTIMEOFDAY=0;     AC_SUBST([GNULIB_GETTIMEOFDAY])
   dnl Assume POSIX behavior unless another module says otherwise.
-  REPLACE_GETTIMEOFDAY=0
-  AC_SUBST([REPLACE_GETTIMEOFDAY])
-  if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then
-    SYS_TIME_H=sys/time.h
-  else
-    SYS_TIME_H=
-  fi
-  AC_SUBST([SYS_TIME_H])
+  HAVE_GETTIMEOFDAY=1;       AC_SUBST([HAVE_GETTIMEOFDAY])
+  HAVE_STRUCT_TIMEVAL=1;     AC_SUBST([HAVE_STRUCT_TIMEVAL])
+  HAVE_SYS_TIME_H=1;         AC_SUBST([HAVE_SYS_TIME_H])
+  REPLACE_GETTIMEOFDAY=0;    AC_SUBST([REPLACE_GETTIMEOFDAY])
 ])
index 4c44d37da9418d487b6fe6ceac518f445062784c..bf83f1957f97fa809f90d1063b8c78e1c1e1da22 100644 (file)
@@ -1,6 +1,6 @@
 #serial 3
 
-# Copyright (C) 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007, 2009-2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
index 3dd38aa8778bac1c0de189311b2ff4988542c3a1..bff01bc5eeaf13070806f0a04dff6e8162a4f6e0 100644 (file)
@@ -1,5 +1,5 @@
-# threadlib.m4 serial 3 (gettext-0.18)
-dnl Copyright (C) 2005-2009 Free Software Foundation, Inc.
+# threadlib.m4 serial 6 (gettext-0.18.2)
+dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -52,13 +52,24 @@ AC_HELP_STRING([--disable-threads], [build without multithread safety]),
     [if test -n "$gl_use_threads_default"; then
        gl_use_threads="$gl_use_threads_default"
      else
+changequote(,)dnl
        case "$host_os" in
          dnl Disable multithreading by default on OSF/1, because it interferes
          dnl with fork()/exec(): When msgexec is linked with -lpthread, its
          dnl child process gets an endless segmentation fault inside execvp().
+         dnl Disable multithreading by default on Cygwin 1.5.x, because it has
+         dnl bugs that lead to endless loops or crashes. See
+         dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
          osf*) gl_use_threads=no ;;
+         cygwin*)
+               case `uname -r` in
+                 1.[0-5].*) gl_use_threads=no ;;
+                 *)         gl_use_threads=yes ;;
+               esac
+               ;;
          *)    gl_use_threads=yes ;;
        esac
+changequote([,])dnl
      fi
     ])
   if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
@@ -69,7 +80,7 @@ AC_HELP_STRING([--disable-threads], [build without multithread safety]),
         # groks <pthread.h>. cc also understands the flag -pthread, but
         # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
         # 2. putting a flag into CPPFLAGS that has an effect on the linker
-        # causes the AC_TRY_LINK test below to succeed unexpectedly,
+        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
         # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
         CPPFLAGS="$CPPFLAGS -D_REENTRANT"
         ;;
@@ -96,11 +107,41 @@ AC_DEFUN([gl_THREADLIB_BODY],
   LTLIBMULTITHREAD=
   if test "$gl_use_threads" != no; then
     dnl Check whether the compiler and linker support weak declarations.
-    AC_MSG_CHECKING([whether imported symbols can be declared weak])
-    gl_have_weak=no
-    AC_TRY_LINK([extern void xyzzy ();
-#pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes])
-    AC_MSG_RESULT([$gl_have_weak])
+    AC_CACHE_CHECK([whether imported symbols can be declared weak],
+      [gl_cv_have_weak],
+      [gl_cv_have_weak=no
+       dnl First, test whether the compiler accepts it syntactically.
+       AC_LINK_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[extern void xyzzy ();
+#pragma weak xyzzy]],
+            [[xyzzy();]])],
+         [gl_cv_have_weak=maybe])
+       if test $gl_cv_have_weak = maybe; then
+         dnl Second, test whether it actually works. On Cygwin 1.7.2, with
+         dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
+         AC_RUN_IFELSE(
+           [AC_LANG_SOURCE([[
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+  return (fputs == NULL);
+}]])],
+           [gl_cv_have_weak=yes],
+           [gl_cv_have_weak=no],
+           [dnl When cross-compiling, assume that only ELF platforms support
+            dnl weak symbols.
+            AC_EGREP_CPP([Extensible Linking Format],
+              [#ifdef __ELF__
+               Extensible Linking Format
+               #endif
+              ],
+              [gl_cv_have_weak="guessing yes"],
+              [gl_cv_have_weak="guessing no"])
+           ])
+       fi
+      ])
     if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
       # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
       # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
@@ -114,9 +155,11 @@ AC_DEFUN([gl_THREADLIB_BODY],
         # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
         # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
         # the second one only in libpthread, and lock.c needs it.
-        AC_TRY_LINK([#include <pthread.h>],
-          [pthread_mutex_lock((pthread_mutex_t*)0);
-           pthread_mutexattr_init((pthread_mutexattr_t*)0);],
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[#include <pthread.h>]],
+             [[pthread_mutex_lock((pthread_mutex_t*)0);
+               pthread_mutexattr_init((pthread_mutexattr_t*)0);]])],
           [gl_have_pthread=yes])
         # Test for libpthread by looking for pthread_kill. (Not pthread_self,
         # since it is defined as a macro on OSF/1.)
@@ -154,7 +197,7 @@ AC_DEFUN([gl_THREADLIB_BODY],
           AC_DEFINE([USE_POSIX_THREADS], [1],
             [Define if the POSIX multithreading library can be used.])
           if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
-            if test $gl_have_weak = yes; then
+            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
               AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
                 [Define if references to the POSIX multithreading library should be made weak.])
               LIBTHREAD=
@@ -169,9 +212,13 @@ AC_DEFUN([gl_THREADLIB_BODY],
         gl_have_solaristhread=
         gl_save_LIBS="$LIBS"
         LIBS="$LIBS -lthread"
-        AC_TRY_LINK([#include <thread.h>
-#include <synch.h>],
-          [thr_self();],
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[
+#include <thread.h>
+#include <synch.h>
+             ]],
+             [[thr_self();]])],
           [gl_have_solaristhread=yes])
         LIBS="$gl_save_LIBS"
         if test -n "$gl_have_solaristhread"; then
@@ -182,7 +229,7 @@ AC_DEFUN([gl_THREADLIB_BODY],
           LTLIBMULTITHREAD="$LTLIBTHREAD"
           AC_DEFINE([USE_SOLARIS_THREADS], [1],
             [Define if the old Solaris multithreading library can be used.])
-          if test $gl_have_weak = yes; then
+          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
             AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
               [Define if references to the old Solaris multithreading library should be made weak.])
             LIBTHREAD=
@@ -197,7 +244,9 @@ AC_DEFUN([gl_THREADLIB_BODY],
       gl_have_pth=
       gl_save_LIBS="$LIBS"
       LIBS="$LIBS -lpth"
-      AC_TRY_LINK([#include <pth.h>], [pth_self();], [gl_have_pth=yes])
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
+        [gl_have_pth=yes])
       LIBS="$gl_save_LIBS"
       if test -n "$gl_have_pth"; then
         gl_threads_api=pth
@@ -208,7 +257,7 @@ AC_DEFUN([gl_THREADLIB_BODY],
         AC_DEFINE([USE_PTH_THREADS], [1],
           [Define if the GNU Pth multithreading library can be used.])
         if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
-          if test $gl_have_weak = yes; then
+          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
             AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
               [Define if references to the GNU Pth multithreading library should be made weak.])
             LIBTHREAD=
diff --git a/config/gnulib/time_h.m4 b/config/gnulib/time_h.m4
new file mode 100644 (file)
index 0000000..a45a10a
--- /dev/null
@@ -0,0 +1,109 @@
+# Configure a more-standard replacement for <time.h>.
+
+# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
+
+# serial 2
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Paul Eggert and Jim Meyering.
+
+AC_DEFUN([gl_HEADER_TIME_H],
+[
+  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+  dnl once only, before all statements that occur in other macros.
+  AC_REQUIRE([gl_HEADER_TIME_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_TIME_H_BODY],
+[
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+  gl_CHECK_NEXT_HEADERS([time.h])
+  AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
+])
+
+dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
+dnl in time.h, sys/time.h, or pthread.h.
+
+AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
+[
+  AC_CHECK_HEADERS_ONCE([sys/time.h])
+  AC_CACHE_CHECK([for struct timespec in <time.h>],
+    [gl_cv_sys_struct_timespec_in_time_h],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <time.h>
+          ]],
+          [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+       [gl_cv_sys_struct_timespec_in_time_h=yes],
+       [gl_cv_sys_struct_timespec_in_time_h=no])])
+
+  TIME_H_DEFINES_STRUCT_TIMESPEC=0
+  SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+  PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
+  if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
+    TIME_H_DEFINES_STRUCT_TIMESPEC=1
+  else
+    AC_CACHE_CHECK([for struct timespec in <sys/time.h>],
+      [gl_cv_sys_struct_timespec_in_sys_time_h],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#include <sys/time.h>
+            ]],
+            [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+         [gl_cv_sys_struct_timespec_in_sys_time_h=yes],
+         [gl_cv_sys_struct_timespec_in_sys_time_h=no])])
+    if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
+      SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+    else
+      AC_CACHE_CHECK([for struct timespec in <pthread.h>],
+        [gl_cv_sys_struct_timespec_in_pthread_h],
+        [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <pthread.h>
+              ]],
+              [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+           [gl_cv_sys_struct_timespec_in_pthread_h=yes],
+           [gl_cv_sys_struct_timespec_in_pthread_h=no])])
+      if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+        PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+      fi
+    fi
+  fi
+  AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC])
+  AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
+  AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC])
+])
+
+AC_DEFUN([gl_TIME_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
+[
+  GNULIB_MKTIME=0;                       AC_SUBST([GNULIB_MKTIME])
+  GNULIB_NANOSLEEP=0;                    AC_SUBST([GNULIB_NANOSLEEP])
+  GNULIB_STRPTIME=0;                     AC_SUBST([GNULIB_STRPTIME])
+  GNULIB_TIMEGM=0;                       AC_SUBST([GNULIB_TIMEGM])
+  GNULIB_TIME_R=0;                       AC_SUBST([GNULIB_TIME_R])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_LOCALTIME_R=1;                    AC_SUBST([HAVE_LOCALTIME_R])
+  HAVE_NANOSLEEP=1;                      AC_SUBST([HAVE_NANOSLEEP])
+  HAVE_STRPTIME=1;                       AC_SUBST([HAVE_STRPTIME])
+  HAVE_TIMEGM=1;                         AC_SUBST([HAVE_TIMEGM])
+  dnl If another module says to replace or to not replace, do that.
+  dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
+  dnl this lets maintainers check for portability.
+  REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;  AC_SUBST([REPLACE_LOCALTIME_R])
+  REPLACE_MKTIME=GNULIB_PORTCHECK;       AC_SUBST([REPLACE_MKTIME])
+  REPLACE_NANOSLEEP=GNULIB_PORTCHECK;    AC_SUBST([REPLACE_NANOSLEEP])
+  REPLACE_TIMEGM=GNULIB_PORTCHECK;       AC_SUBST([REPLACE_TIMEGM])
+])
index ff9a4ea0a59f3c43d7c06bbc973fa5918c7bf11c..48d06c7426aa7b455d2ac001f6f8d66ffb287565 100644 (file)
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 17
-dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
+# unistd_h.m4 serial 46
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,6 +11,7 @@ AC_DEFUN([gl_UNISTD_H],
   dnl Use AC_REQUIRE here, so that the default behavior below is expanded
   dnl once only, before all statements that occur in other macros.
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([AC_C_INLINE])
 
   gl_CHECK_NEXT_HEADERS([unistd.h])
 
@@ -21,13 +22,34 @@ AC_DEFUN([gl_UNISTD_H],
     HAVE_UNISTD_H=0
   fi
   AC_SUBST([HAVE_UNISTD_H])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <unistd.h>
+/* Some systems declare various items in the wrong headers.  */
+#ifndef __GLIBC__
+# include <fcntl.h>
+# include <stdio.h>
+# include <stdlib.h>
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+    ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
+    fsync ftruncate getcwd getdomainname getdtablesize getgroups
+    gethostname getlogin getlogin_r getpagesize getusershell setusershell
+    endusershell lchown link linkat lseek pipe2 pread pwrite readlink
+    readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
+    usleep])
 ])
 
 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_UNISTD_H_DEFAULTS],
@@ -35,49 +57,103 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_CHOWN=0;            AC_SUBST([GNULIB_CHOWN])
   GNULIB_CLOSE=0;            AC_SUBST([GNULIB_CLOSE])
   GNULIB_DUP2=0;             AC_SUBST([GNULIB_DUP2])
+  GNULIB_DUP3=0;             AC_SUBST([GNULIB_DUP3])
   GNULIB_ENVIRON=0;          AC_SUBST([GNULIB_ENVIRON])
   GNULIB_EUIDACCESS=0;       AC_SUBST([GNULIB_EUIDACCESS])
+  GNULIB_FACCESSAT=0;        AC_SUBST([GNULIB_FACCESSAT])
   GNULIB_FCHDIR=0;           AC_SUBST([GNULIB_FCHDIR])
+  GNULIB_FCHOWNAT=0;         AC_SUBST([GNULIB_FCHOWNAT])
   GNULIB_FSYNC=0;            AC_SUBST([GNULIB_FSYNC])
   GNULIB_FTRUNCATE=0;        AC_SUBST([GNULIB_FTRUNCATE])
   GNULIB_GETCWD=0;           AC_SUBST([GNULIB_GETCWD])
   GNULIB_GETDOMAINNAME=0;    AC_SUBST([GNULIB_GETDOMAINNAME])
   GNULIB_GETDTABLESIZE=0;    AC_SUBST([GNULIB_GETDTABLESIZE])
+  GNULIB_GETGROUPS=0;        AC_SUBST([GNULIB_GETGROUPS])
   GNULIB_GETHOSTNAME=0;      AC_SUBST([GNULIB_GETHOSTNAME])
+  GNULIB_GETLOGIN=0;         AC_SUBST([GNULIB_GETLOGIN])
   GNULIB_GETLOGIN_R=0;       AC_SUBST([GNULIB_GETLOGIN_R])
   GNULIB_GETPAGESIZE=0;      AC_SUBST([GNULIB_GETPAGESIZE])
   GNULIB_GETUSERSHELL=0;     AC_SUBST([GNULIB_GETUSERSHELL])
   GNULIB_LCHOWN=0;           AC_SUBST([GNULIB_LCHOWN])
   GNULIB_LINK=0;             AC_SUBST([GNULIB_LINK])
+  GNULIB_LINKAT=0;           AC_SUBST([GNULIB_LINKAT])
   GNULIB_LSEEK=0;            AC_SUBST([GNULIB_LSEEK])
+  GNULIB_PIPE2=0;            AC_SUBST([GNULIB_PIPE2])
+  GNULIB_PREAD=0;            AC_SUBST([GNULIB_PREAD])
+  GNULIB_PWRITE=0;           AC_SUBST([GNULIB_PWRITE])
   GNULIB_READLINK=0;         AC_SUBST([GNULIB_READLINK])
+  GNULIB_READLINKAT=0;       AC_SUBST([GNULIB_READLINKAT])
+  GNULIB_RMDIR=0;            AC_SUBST([GNULIB_RMDIR])
   GNULIB_SLEEP=0;            AC_SUBST([GNULIB_SLEEP])
+  GNULIB_SYMLINK=0;          AC_SUBST([GNULIB_SYMLINK])
+  GNULIB_SYMLINKAT=0;        AC_SUBST([GNULIB_SYMLINKAT])
+  GNULIB_TTYNAME_R=0;        AC_SUBST([GNULIB_TTYNAME_R])
+  GNULIB_UNISTD_H_GETOPT=0;  AC_SUBST([GNULIB_UNISTD_H_GETOPT])
   GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
+  GNULIB_UNLINK=0;           AC_SUBST([GNULIB_UNLINK])
+  GNULIB_UNLINKAT=0;         AC_SUBST([GNULIB_UNLINKAT])
+  GNULIB_USLEEP=0;           AC_SUBST([GNULIB_USLEEP])
   GNULIB_WRITE=0;            AC_SUBST([GNULIB_WRITE])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_CHOWN=1;           AC_SUBST([HAVE_CHOWN])
   HAVE_DUP2=1;            AC_SUBST([HAVE_DUP2])
+  HAVE_DUP3=1;            AC_SUBST([HAVE_DUP3])
   HAVE_EUIDACCESS=1;      AC_SUBST([HAVE_EUIDACCESS])
+  HAVE_FACCESSAT=1;       AC_SUBST([HAVE_FACCESSAT])
+  HAVE_FCHDIR=1;          AC_SUBST([HAVE_FCHDIR])
+  HAVE_FCHOWNAT=1;        AC_SUBST([HAVE_FCHOWNAT])
   HAVE_FSYNC=1;           AC_SUBST([HAVE_FSYNC])
   HAVE_FTRUNCATE=1;       AC_SUBST([HAVE_FTRUNCATE])
   HAVE_GETDOMAINNAME=1;   AC_SUBST([HAVE_GETDOMAINNAME])
   HAVE_GETDTABLESIZE=1;   AC_SUBST([HAVE_GETDTABLESIZE])
+  HAVE_GETGROUPS=1;       AC_SUBST([HAVE_GETGROUPS])
   HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
+  HAVE_GETLOGIN=1;        AC_SUBST([HAVE_GETLOGIN])
   HAVE_GETPAGESIZE=1;     AC_SUBST([HAVE_GETPAGESIZE])
-  HAVE_GETUSERSHELL=1;    AC_SUBST([HAVE_GETUSERSHELL])
+  HAVE_LCHOWN=1;          AC_SUBST([HAVE_LCHOWN])
   HAVE_LINK=1;            AC_SUBST([HAVE_LINK])
+  HAVE_LINKAT=1;          AC_SUBST([HAVE_LINKAT])
+  HAVE_PIPE2=1;           AC_SUBST([HAVE_PIPE2])
+  HAVE_PREAD=1;           AC_SUBST([HAVE_PREAD])
+  HAVE_PWRITE=1;          AC_SUBST([HAVE_PWRITE])
   HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
+  HAVE_READLINKAT=1;      AC_SUBST([HAVE_READLINKAT])
   HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
+  HAVE_SYMLINK=1;         AC_SUBST([HAVE_SYMLINK])
+  HAVE_SYMLINKAT=1;       AC_SUBST([HAVE_SYMLINKAT])
+  HAVE_TTYNAME_R=1;       AC_SUBST([HAVE_TTYNAME_R])
+  HAVE_UNLINKAT=1;        AC_SUBST([HAVE_UNLINKAT])
+  HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
   HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
   HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
+  HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
+  HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
   HAVE_OS_H=0;            AC_SUBST([HAVE_OS_H])
   HAVE_SYS_PARAM_H=0;     AC_SUBST([HAVE_SYS_PARAM_H])
   REPLACE_CHOWN=0;        AC_SUBST([REPLACE_CHOWN])
   REPLACE_CLOSE=0;        AC_SUBST([REPLACE_CLOSE])
-  REPLACE_FCHDIR=0;       AC_SUBST([REPLACE_FCHDIR])
+  REPLACE_DUP=0;          AC_SUBST([REPLACE_DUP])
+  REPLACE_DUP2=0;         AC_SUBST([REPLACE_DUP2])
+  REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
+  REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
+  REPLACE_LINK=0;         AC_SUBST([REPLACE_LINK])
+  REPLACE_LINKAT=0;       AC_SUBST([REPLACE_LINKAT])
   REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
+  REPLACE_PREAD=0;        AC_SUBST([REPLACE_PREAD])
+  REPLACE_PWRITE=0;       AC_SUBST([REPLACE_PWRITE])
+  REPLACE_READLINK=0;     AC_SUBST([REPLACE_READLINK])
+  REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
+  REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
+  REPLACE_SYMLINK=0;      AC_SUBST([REPLACE_SYMLINK])
+  REPLACE_TTYNAME_R=0;    AC_SUBST([REPLACE_TTYNAME_R])
+  REPLACE_UNLINK=0;       AC_SUBST([REPLACE_UNLINK])
+  REPLACE_UNLINKAT=0;     AC_SUBST([REPLACE_UNLINKAT])
+  REPLACE_USLEEP=0;       AC_SUBST([REPLACE_USLEEP])
   REPLACE_WRITE=0;        AC_SUBST([REPLACE_WRITE])
   UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
+  UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+                           AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
 ])
index 01e8772f11c086dd435aed60b65d930d48875826..ebe3c52cde6f5b745f77da016e967642620d2fa0 100644 (file)
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 28
-dnl Copyright (C) 2002-2004, 2006-2009 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 31
+dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -52,8 +52,9 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
 ])
 
 # Prerequisites of lib/vasnprintf.c.
-AC_DEFUN([gl_PREREQ_VASNPRINTF],
+AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
 [
+  AC_REQUIRE([AC_C_INLINE])
   AC_REQUIRE([AC_FUNC_ALLOCA])
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
@@ -62,11 +63,22 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF],
   dnl Use the _snprintf function only if it is declared (because on NetBSD it
   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
   AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
+  dnl We can avoid a lot of code by assuming that snprintf's return value
+  dnl conforms to ISO C99. So check that.
+  AC_REQUIRE([gl_SNPRINTF_RETVAL_C99])
+  case "$gl_cv_func_snprintf_retval_c99" in
+    *yes)
+      AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1],
+        [Define if the return value of the snprintf function is the number of
+         of bytes (excluding the terminating NUL) that would have been produced
+         if the buffer had been large enough.])
+      ;;
+  esac
 ])
 
 # Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
 # arguments.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
+AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
 [
   AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
   case "$gl_cv_func_printf_long_double" in
diff --git a/config/gnulib/visibility.m4 b/config/gnulib/visibility.m4
deleted file mode 100644 (file)
index 70bca56..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# visibility.m4 serial 2 (gettext-0.18)
-dnl Copyright (C) 2005, 2008 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-dnl Tests whether the compiler supports the command-line option
-dnl -fvisibility=hidden and the function and variable attributes
-dnl __attribute__((__visibility__("hidden"))) and
-dnl __attribute__((__visibility__("default"))).
-dnl Does *not* test for __visibility__("protected") - which has tricky
-dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
-dnl MacOS X.
-dnl Does *not* test for __visibility__("internal") - which has processor
-dnl dependent semantics.
-dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
-dnl "really only recommended for legacy code".
-dnl Set the variable CFLAG_VISIBILITY.
-dnl Defines and sets the variable HAVE_VISIBILITY.
-
-AC_DEFUN([gl_VISIBILITY],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  CFLAG_VISIBILITY=
-  HAVE_VISIBILITY=0
-  if test -n "$GCC"; then
-    AC_MSG_CHECKING([for simple visibility declarations])
-    AC_CACHE_VAL([gl_cv_cc_visibility], [
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -fvisibility=hidden"
-      AC_TRY_COMPILE(
-        [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
-         extern __attribute__((__visibility__("default"))) int exportedvar;
-         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
-         extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
-        [],
-        [gl_cv_cc_visibility=yes],
-        [gl_cv_cc_visibility=no])
-      CFLAGS="$gl_save_CFLAGS"])
-    AC_MSG_RESULT([$gl_cv_cc_visibility])
-    if test $gl_cv_cc_visibility = yes; then
-      CFLAG_VISIBILITY="-fvisibility=hidden"
-      HAVE_VISIBILITY=1
-    fi
-  fi
-  AC_SUBST([CFLAG_VISIBILITY])
-  AC_SUBST([HAVE_VISIBILITY])
-  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
-    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
-])
diff --git a/config/gnulib/warn-on-use.m4 b/config/gnulib/warn-on-use.m4
new file mode 100644 (file)
index 0000000..42daae8
--- /dev/null
@@ -0,0 +1,45 @@
+# warn-on-use.m4 serial 2
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES)
+# ---------------------------------------
+# For each whitespace-separated element in the list of NAMES, define
+# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES
+# even after being undefined as a macro.
+#
+# See warn-on-use.h for some hints on how to poison function names, as
+# well as ideas on poisoning global variables and macros.  NAMES may
+# include global variables, but remember that only functions work with
+# _GL_WARN_ON_USE.  Typically, INCLUDES only needs to list a single
+# header, but if the replacement header pulls in other headers because
+# some systems declare functions in the wrong header, then INCLUDES
+# should do likewise.
+#
+# If you assume C89, then it is generally safe to assume declarations
+# for functions declared in that standard (such as gets) without
+# needing gl_WARN_ON_USE_PREPARE.
+AC_DEFUN([gl_WARN_ON_USE_PREPARE],
+[
+  m4_foreach_w([gl_decl], [$2],
+    [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
+      [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
+       undefining macros.])])dnl
+  for gl_func in m4_flatten([$2]); do
+    AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
+    AC_CACHE_CHECK([whether $gl_func is declared without a macro],
+      gl_Symbol,
+      [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
+[@%:@undef $gl_func
+  (void) $gl_func;])],
+        [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
+     AS_VAR_IF(gl_Symbol, [yes],
+       [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
+       dnl shortcut - if the raw declaration exists, then set a cache
+       dnl variable to allow skipping any later AC_CHECK_DECL efforts
+       eval ac_cv_have_decl_$gl_func=yes])
+    AS_VAR_POPDEF([gl_Symbol])dnl
+  done
+])
diff --git a/config/gnulib/wchar.m4 b/config/gnulib/wchar.m4
deleted file mode 100644 (file)
index ba8ee6a..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Written by Eric Blake.
-
-# wchar.m4 serial 22
-
-AC_DEFUN([gl_WCHAR_H],
-[
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
-  AC_CACHE_CHECK([whether <wchar.h> is standalone],
-    [gl_cv_header_wchar_h_standalone],
-    [AC_COMPILE_IFELSE([[#include <wchar.h>
-wchar_t w;]],
-      [gl_cv_header_wchar_h_standalone=yes],
-      [gl_cv_header_wchar_h_standalone=no])])
-
-  AC_REQUIRE([gt_TYPE_WINT_T])
-  if test $gt_cv_c_wint_t = yes; then
-    HAVE_WINT_T=1
-  else
-    HAVE_WINT_T=0
-  fi
-  AC_SUBST([HAVE_WINT_T])
-
-  if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then
-    WCHAR_H=wchar.h
-  fi
-
-  dnl Prepare for creating substitute <wchar.h>.
-  dnl Do it always: WCHAR_H may be empty here but can be set later.
-  dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
-  dnl character support).
-  AC_CHECK_HEADERS_ONCE([wchar.h])
-  if test $ac_cv_header_wchar_h = yes; then
-    HAVE_WCHAR_H=1
-  else
-    HAVE_WCHAR_H=0
-  fi
-  AC_SUBST([HAVE_WCHAR_H])
-  gl_CHECK_NEXT_HEADERS([wchar.h])
-])
-
-dnl Unconditionally enables the replacement of <wchar.h>.
-AC_DEFUN([gl_REPLACE_WCHAR_H],
-[
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
-  WCHAR_H=wchar.h
-])
-
-AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
-[
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
-])
-
-AC_DEFUN([gl_WCHAR_H_DEFAULTS],
-[
-  GNULIB_BTOWC=0;      AC_SUBST([GNULIB_BTOWC])
-  GNULIB_WCTOB=0;      AC_SUBST([GNULIB_WCTOB])
-  GNULIB_MBSINIT=0;    AC_SUBST([GNULIB_MBSINIT])
-  GNULIB_MBRTOWC=0;    AC_SUBST([GNULIB_MBRTOWC])
-  GNULIB_MBRLEN=0;     AC_SUBST([GNULIB_MBRLEN])
-  GNULIB_MBSRTOWCS=0;  AC_SUBST([GNULIB_MBSRTOWCS])
-  GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
-  GNULIB_WCRTOMB=0;    AC_SUBST([GNULIB_WCRTOMB])
-  GNULIB_WCSRTOMBS=0;  AC_SUBST([GNULIB_WCSRTOMBS])
-  GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
-  GNULIB_WCWIDTH=0;    AC_SUBST([GNULIB_WCWIDTH])
-  dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_BTOWC=1;        AC_SUBST([HAVE_BTOWC])
-  HAVE_MBSINIT=1;      AC_SUBST([HAVE_MBSINIT])
-  HAVE_MBRTOWC=1;      AC_SUBST([HAVE_MBRTOWC])
-  HAVE_MBRLEN=1;       AC_SUBST([HAVE_MBRLEN])
-  HAVE_MBSRTOWCS=1;    AC_SUBST([HAVE_MBSRTOWCS])
-  HAVE_MBSNRTOWCS=1;   AC_SUBST([HAVE_MBSNRTOWCS])
-  HAVE_WCRTOMB=1;      AC_SUBST([HAVE_WCRTOMB])
-  HAVE_WCSRTOMBS=1;    AC_SUBST([HAVE_WCSRTOMBS])
-  HAVE_WCSNRTOMBS=1;   AC_SUBST([HAVE_WCSNRTOMBS])
-  HAVE_DECL_WCTOB=1;   AC_SUBST([HAVE_DECL_WCTOB])
-  HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
-  REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
-  REPLACE_BTOWC=0;     AC_SUBST([REPLACE_BTOWC])
-  REPLACE_WCTOB=0;     AC_SUBST([REPLACE_WCTOB])
-  REPLACE_MBSINIT=0;   AC_SUBST([REPLACE_MBSINIT])
-  REPLACE_MBRTOWC=0;   AC_SUBST([REPLACE_MBRTOWC])
-  REPLACE_MBRLEN=0;    AC_SUBST([REPLACE_MBRLEN])
-  REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
-  REPLACE_MBSNRTOWCS=0;AC_SUBST([REPLACE_MBSNRTOWCS])
-  REPLACE_WCRTOMB=0;   AC_SUBST([REPLACE_WCRTOMB])
-  REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
-  REPLACE_WCWIDTH=0;   AC_SUBST([REPLACE_WCWIDTH])
-  WCHAR_H='';          AC_SUBST([WCHAR_H])
-])
diff --git a/config/gnulib/wchar_h.m4 b/config/gnulib/wchar_h.m4
new file mode 100644 (file)
index 0000000..8cae82d
--- /dev/null
@@ -0,0 +1,152 @@
+dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
+
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Eric Blake.
+
+# wchar_h.m4 serial 33
+
+AC_DEFUN([gl_WCHAR_H],
+[
+  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
+  dnl Prepare for creating substitute <wchar.h>.
+  dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
+  dnl character support).
+  dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
+  AC_CHECK_HEADERS_ONCE([wchar.h])
+  gl_CHECK_NEXT_HEADERS([wchar.h])
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
+  else
+    HAVE_WCHAR_H=0
+  fi
+  AC_SUBST([HAVE_WCHAR_H])
+
+  AC_REQUIRE([gt_TYPE_WINT_T])
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
+  fi
+  AC_SUBST([HAVE_WINT_T])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* Some systems require additional headers.  */
+#ifndef __GLIBC__
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
+#include <wchar.h>
+    ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
+    wcsrtombs wcsnrtombs wcwidth])
+])
+
+dnl Check whether <wchar.h> is usable at all.
+AC_DEFUN([gl_WCHAR_H_INLINE_OK],
+[
+  dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
+  dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022>
+  dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
+  dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
+  dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
+  AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
+    [gl_cv_header_wchar_h_correct_inline],
+    [gl_cv_header_wchar_h_correct_inline=yes
+     AC_LANG_CONFTEST([
+       AC_LANG_SOURCE([[#define wcstod renamed_wcstod
+#include <wchar.h>
+extern int zero (void);
+int main () { return zero(); }
+]])])
+     if AC_TRY_EVAL([ac_compile]); then
+       mv conftest.$ac_objext conftest1.$ac_objext
+       AC_LANG_CONFTEST([
+         AC_LANG_SOURCE([[#define wcstod renamed_wcstod
+#include <wchar.h>
+int zero (void) { return 0; }
+]])])
+       if AC_TRY_EVAL([ac_compile]); then
+         mv conftest.$ac_objext conftest2.$ac_objext
+         if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
+           :
+         else
+           gl_cv_header_wchar_h_correct_inline=no
+         fi
+       fi
+     fi
+     rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+    ])
+  if test $gl_cv_header_wchar_h_correct_inline = no; then
+    AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
+This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
+C99 mode. You have four options:
+  - Add the flag -fgnu89-inline to CC and reconfigure, or
+  - Fix your include files, using parts of
+    <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
+  - Use a gcc version older than 4.3, or
+  - Don't use the flags -std=c99 or -std=gnu99.
+Configuration aborted.])
+  fi
+])
+
+dnl Unconditionally enables the replacement of <wchar.h>.
+AC_DEFUN([gl_REPLACE_WCHAR_H],
+[
+  dnl This is a no-op, because <wchar.h> is always overridden.
+  :
+])
+
+AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_WCHAR_H_DEFAULTS],
+[
+  GNULIB_BTOWC=0;      AC_SUBST([GNULIB_BTOWC])
+  GNULIB_WCTOB=0;      AC_SUBST([GNULIB_WCTOB])
+  GNULIB_MBSINIT=0;    AC_SUBST([GNULIB_MBSINIT])
+  GNULIB_MBRTOWC=0;    AC_SUBST([GNULIB_MBRTOWC])
+  GNULIB_MBRLEN=0;     AC_SUBST([GNULIB_MBRLEN])
+  GNULIB_MBSRTOWCS=0;  AC_SUBST([GNULIB_MBSRTOWCS])
+  GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
+  GNULIB_WCRTOMB=0;    AC_SUBST([GNULIB_WCRTOMB])
+  GNULIB_WCSRTOMBS=0;  AC_SUBST([GNULIB_WCSRTOMBS])
+  GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
+  GNULIB_WCWIDTH=0;    AC_SUBST([GNULIB_WCWIDTH])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_BTOWC=1;         AC_SUBST([HAVE_BTOWC])
+  HAVE_MBSINIT=1;       AC_SUBST([HAVE_MBSINIT])
+  HAVE_MBRTOWC=1;       AC_SUBST([HAVE_MBRTOWC])
+  HAVE_MBRLEN=1;        AC_SUBST([HAVE_MBRLEN])
+  HAVE_MBSRTOWCS=1;     AC_SUBST([HAVE_MBSRTOWCS])
+  HAVE_MBSNRTOWCS=1;    AC_SUBST([HAVE_MBSNRTOWCS])
+  HAVE_WCRTOMB=1;       AC_SUBST([HAVE_WCRTOMB])
+  HAVE_WCSRTOMBS=1;     AC_SUBST([HAVE_WCSRTOMBS])
+  HAVE_WCSNRTOMBS=1;    AC_SUBST([HAVE_WCSNRTOMBS])
+  HAVE_DECL_WCTOB=1;    AC_SUBST([HAVE_DECL_WCTOB])
+  HAVE_DECL_WCWIDTH=1;  AC_SUBST([HAVE_DECL_WCWIDTH])
+  REPLACE_MBSTATE_T=0;  AC_SUBST([REPLACE_MBSTATE_T])
+  REPLACE_BTOWC=0;      AC_SUBST([REPLACE_BTOWC])
+  REPLACE_WCTOB=0;      AC_SUBST([REPLACE_WCTOB])
+  REPLACE_MBSINIT=0;    AC_SUBST([REPLACE_MBSINIT])
+  REPLACE_MBRTOWC=0;    AC_SUBST([REPLACE_MBRTOWC])
+  REPLACE_MBRLEN=0;     AC_SUBST([REPLACE_MBRLEN])
+  REPLACE_MBSRTOWCS=0;  AC_SUBST([REPLACE_MBSRTOWCS])
+  REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS])
+  REPLACE_WCRTOMB=0;    AC_SUBST([REPLACE_WCRTOMB])
+  REPLACE_WCSRTOMBS=0;  AC_SUBST([REPLACE_WCSRTOMBS])
+  REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
+  REPLACE_WCWIDTH=0;    AC_SUBST([REPLACE_WCWIDTH])
+])
index fb27a7f65f46e0f23b883d01e9e74f84e13595b5..a133e6ad5868f04247375563e72273e8e43512ab 100644 (file)
@@ -1,5 +1,5 @@
-# wchar_t.m4 serial 3 (gettext-0.18)
-dnl Copyright (C) 2002-2003, 2008, 2009 Free Software Foundation, Inc.
+# wchar_t.m4 serial 4 (gettext-0.18.2)
+dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,9 +11,13 @@ dnl Prerequisite: AC_PROG_CC
 AC_DEFUN([gt_TYPE_WCHAR_T],
 [
   AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
-    [AC_TRY_COMPILE([#include <stddef.h>
-       wchar_t foo = (wchar_t)'\0';], ,
-       [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])])
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stddef.h>
+            wchar_t foo = (wchar_t)'\0';]],
+          [[]])],
+       [gt_cv_c_wchar_t=yes],
+       [gt_cv_c_wchar_t=no])])
   if test $gt_cv_c_wchar_t = yes; then
     AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
   fi
index 22d94336716898f66e8381197b050c29b772bf14..0de262e61200903d6c166b7c82c91b8c2037307f 100644 (file)
@@ -1,5 +1,5 @@
-# wcrtomb.m4 serial 2
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# wcrtomb.m4 serial 6
+dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,34 +9,39 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
   AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
 
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
+  gl_MBSTATE_T_BROKEN
+
   AC_CHECK_FUNCS_ONCE([wcrtomb])
   if test $ac_cv_func_wcrtomb = no; then
     HAVE_WCRTOMB=0
   else
-
-    dnl On OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes
-    dnl returns 0 instead of 1.
-    AC_REQUIRE([AC_PROG_CC])
-    AC_REQUIRE([gt_LOCALE_FR])
-    AC_REQUIRE([gt_LOCALE_FR_UTF8])
-    AC_REQUIRE([gt_LOCALE_JA])
-    AC_REQUIRE([gt_LOCALE_ZH_CN])
-    AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-    AC_CACHE_CHECK([whether wcrtomb return value is correct],
-      [gl_cv_func_wcrtomb_retval],
-      [
-        dnl Initial guess, used when cross-compiling or when no suitable locale
-        dnl is present.
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_WCRTOMB=1
+    else
+      dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes
+      dnl returns 0 instead of 1.
+      AC_REQUIRE([AC_PROG_CC])
+      AC_REQUIRE([gt_LOCALE_FR])
+      AC_REQUIRE([gt_LOCALE_FR_UTF8])
+      AC_REQUIRE([gt_LOCALE_JA])
+      AC_REQUIRE([gt_LOCALE_ZH_CN])
+      AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+      AC_CACHE_CHECK([whether wcrtomb return value is correct],
+        [gl_cv_func_wcrtomb_retval],
+        [
+          dnl Initial guess, used when cross-compiling or when no suitable locale
+          dnl is present.
 changequote(,)dnl
-        case "$host_os" in
-                           # Guess no on OSF/1 and Solaris.
-          osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
-                           # Guess yes otherwise.
-          *)               gl_cv_func_wcrtomb_retval="guessing yes" ;;
-        esac
+          case "$host_os" in
+                                     # Guess no on AIX 4, OSF/1 and Solaris.
+            aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
+                                     # Guess yes otherwise.
+            *)                       gl_cv_func_wcrtomb_retval="guessing yes" ;;
+          esac
 changequote([,])dnl
-        if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
-          AC_TRY_RUN([
+          if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
+            AC_RUN_IFELSE(
+              [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <stdio.h>
 #include <string.h>
@@ -64,16 +69,17 @@ int main ()
         return 1;
     }
   return 0;
-}],
-            [gl_cv_func_wcrtomb_retval=yes],
-            [gl_cv_func_wcrtomb_retval=no],
-            [])
-        fi
-      ])
-    case "$gl_cv_func_wcrtomb_retval" in
-      *yes) ;;
-      *) REPLACE_WCRTOMB=1 ;;
-    esac
+}]])],
+              [gl_cv_func_wcrtomb_retval=yes],
+              [gl_cv_func_wcrtomb_retval=no],
+              [:])
+          fi
+        ])
+      case "$gl_cv_func_wcrtomb_retval" in
+        *yes) ;;
+        *) REPLACE_WCRTOMB=1 ;;
+      esac
+    fi
   fi
   if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
     gl_REPLACE_WCHAR_H
diff --git a/config/gnulib/wctype.m4 b/config/gnulib/wctype.m4
deleted file mode 100644 (file)
index 6a1b6f0..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-# wctype.m4 serial 2
-
-dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
-
-dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Written by Paul Eggert.
-
-AC_DEFUN([gl_WCTYPE_H],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_CHECK_FUNCS_ONCE([iswcntrl])
-  if test $ac_cv_func_iswcntrl = yes; then
-    HAVE_ISWCNTRL=1
-  else
-    HAVE_ISWCNTRL=0
-  fi
-  AC_SUBST([HAVE_ISWCNTRL])
-  AC_CHECK_HEADERS_ONCE([wctype.h])
-  AC_REQUIRE([AC_C_INLINE])
-
-  AC_REQUIRE([gt_TYPE_WINT_T])
-  if test $gt_cv_c_wint_t = yes; then
-    HAVE_WINT_T=1
-  else
-    HAVE_WINT_T=0
-  fi
-  AC_SUBST([HAVE_WINT_T])
-
-  WCTYPE_H=wctype.h
-  if test $ac_cv_header_wctype_h = yes; then
-    if test $ac_cv_func_iswcntrl = yes; then
-      dnl Linux libc5 has an iswprint function that returns 0 for all arguments.
-      dnl The other functions are likely broken in the same way.
-      AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works],
-        [
-          AC_TRY_RUN([#include <stddef.h>
-                      #include <stdio.h>
-                      #include <time.h>
-                      #include <wchar.h>
-                      #include <wctype.h>
-                      int main () { return iswprint ('x') == 0; }],
-            [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
-            [AC_TRY_COMPILE([#include <stdlib.h>
-                          #if __GNU_LIBRARY__ == 1
-                          Linux libc5 i18n is broken.
-                          #endif], [],
-              [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
-            ])
-        ])
-      if test $gl_cv_func_iswcntrl_works = yes; then
-        WCTYPE_H=
-      fi
-    fi
-    dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty,
-    dnl for the benefit of builds from non-distclean directories.
-    gl_CHECK_NEXT_HEADERS([wctype.h])
-    HAVE_WCTYPE_H=1
-  else
-    HAVE_WCTYPE_H=0
-  fi
-  AC_SUBST([HAVE_WCTYPE_H])
-  AC_SUBST([WCTYPE_H])
-
-  if test "$gl_cv_func_iswcntrl_works" = no; then
-    REPLACE_ISWCNTRL=1
-  else
-    REPLACE_ISWCNTRL=0
-  fi
-  AC_SUBST([REPLACE_ISWCNTRL])
-])
diff --git a/config/gnulib/wctype_h.m4 b/config/gnulib/wctype_h.m4
new file mode 100644 (file)
index 0000000..bc6b6e7
--- /dev/null
@@ -0,0 +1,85 @@
+# wctype_h.m4 serial 8
+
+dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
+
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl_WCTYPE_H],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CHECK_FUNCS_ONCE([iswcntrl])
+  if test $ac_cv_func_iswcntrl = yes; then
+    HAVE_ISWCNTRL=1
+  else
+    HAVE_ISWCNTRL=0
+  fi
+  AC_SUBST([HAVE_ISWCNTRL])
+  AC_CHECK_FUNCS_ONCE([iswblank])
+  AC_CHECK_DECLS_ONCE([iswblank])
+  if test $ac_cv_func_iswblank = yes; then
+    HAVE_ISWBLANK=1
+    REPLACE_ISWBLANK=0
+  else
+    HAVE_ISWBLANK=0
+    if test $ac_cv_have_decl_iswblank = yes; then
+      REPLACE_ISWBLANK=1
+    else
+      REPLACE_ISWBLANK=0
+    fi
+  fi
+  AC_SUBST([HAVE_ISWBLANK])
+  AC_SUBST([REPLACE_ISWBLANK])
+
+  AC_CHECK_HEADERS_ONCE([wctype.h])
+  AC_REQUIRE([AC_C_INLINE])
+
+  AC_REQUIRE([gt_TYPE_WINT_T])
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
+  fi
+  AC_SUBST([HAVE_WINT_T])
+
+  if test $ac_cv_header_wctype_h = yes; then
+    if test $ac_cv_func_iswcntrl = yes; then
+      dnl Linux libc5 has an iswprint function that returns 0 for all arguments.
+      dnl The other functions are likely broken in the same way.
+      AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works],
+        [
+          AC_RUN_IFELSE([AC_LANG_SOURCE([[
+                            #include <stddef.h>
+                            #include <stdio.h>
+                            #include <time.h>
+                            #include <wchar.h>
+                            #include <wctype.h>
+                            int main () { return iswprint ('x') == 0; }]])],
+            [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
+            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+                          #if __GNU_LIBRARY__ == 1
+                          Linux libc5 i18n is broken.
+                          #endif]], [])],
+              [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
+            ])
+        ])
+    fi
+    gl_CHECK_NEXT_HEADERS([wctype.h])
+    HAVE_WCTYPE_H=1
+  else
+    HAVE_WCTYPE_H=0
+  fi
+  AC_SUBST([HAVE_WCTYPE_H])
+
+  if test "$gl_cv_func_iswcntrl_works" = no; then
+    REPLACE_ISWCNTRL=1
+  else
+    REPLACE_ISWCNTRL=0
+  fi
+  AC_SUBST([REPLACE_ISWCNTRL])
+])
index 47a4363d79041b6481ed781bcbe798dc1b171ec9..58ef865565f09db7ccc09ddeaf69568d03755b0d 100644 (file)
@@ -1,5 +1,5 @@
-# wint_t.m4 serial 4 (gettext-0.18)
-dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc.
+# wint_t.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,7 +11,9 @@ dnl Prerequisite: AC_PROG_CC
 AC_DEFUN([gt_TYPE_WINT_T],
 [
   AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
-    [AC_TRY_COMPILE([
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
@@ -20,8 +22,10 @@ AC_DEFUN([gt_TYPE_WINT_T],
 #include <stdio.h>
 #include <time.h>
 #include <wchar.h>
-       wint_t foo = (wchar_t)'\0';], ,
-       [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])])
+            wint_t foo = (wchar_t)'\0';]],
+          [[]])],
+       [gt_cv_c_wint_t=yes],
+       [gt_cv_c_wint_t=no])])
   if test $gt_cv_c_wint_t = yes; then
     AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
   fi
index 812b19b3b07ee5889766974cb733fccaacf325f5..56325aba9fa84c233a0d99eccf13ffba7ae2fdc2 100644 (file)
@@ -1,5 +1,5 @@
 # write.m4 serial 1
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 631893cf59f8a73fe279f39908d421f5dbd8a2e5..b653693a3029cb835e98c0d02be9683926e26e00 100644 (file)
@@ -1,5 +1,5 @@
 # xsize.m4 serial 4
-dnl Copyright (C) 2003-2004, 2008 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/config/link-warning.h b/config/link-warning.h
deleted file mode 100644 (file)
index fda0194..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* GL_LINK_WARNING("literal string") arranges to emit the literal string as
-   a linker warning on most glibc systems.
-   We use a linker warning rather than a preprocessor warning, because
-   #warning cannot be used inside macros.  */
-#ifndef GL_LINK_WARNING
-  /* This works on platforms with GNU ld and ELF object format.
-     Testing __GLIBC__ is sufficient for asserting that GNU ld is in use.
-     Testing __ELF__ guarantees the ELF object format.
-     Testing __GNUC__ is necessary for the compound expression syntax.  */
-# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__
-#  define GL_LINK_WARNING(message) \
-     GL_LINK_WARNING1 (__FILE__, __LINE__, message)
-#  define GL_LINK_WARNING1(file, line, message) \
-     GL_LINK_WARNING2 (file, line, message)  /* macroexpand file and line */
-#  define GL_LINK_WARNING2(file, line, message) \
-     GL_LINK_WARNING3 (file ":" #line ": warning: " message)
-#  define GL_LINK_WARNING3(message) \
-     ({ static const char warning[sizeof (message)]            \
-          __attribute__ ((__unused__,                          \
-                          __section__ (".gnu.warning"),                \
-                          __aligned__ (1)))                    \
-          = message "\n";                                      \
-        (void)0;                                               \
-     })
-# else
-#  define GL_LINK_WARNING(message) ((void) 0)
-# endif
-#endif
index 20520b2392e7c884cb795b8beb5bf232c10def63..8f92e891e472bf2eafcd0cb2d724c375e6513a98 100644 (file)
@@ -29,7 +29,7 @@
 #
 # LAST MODIFICATION
 #
-#   2006-10-22
+#   2007-07-15
 #
 # COPYLEFT
 #
@@ -77,45 +77,13 @@ AC_DEFUN([AC_PROG_SWIG],[
                 [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
                 AC_MSG_RESULT([$swig_version])
                 if test -n "$swig_version" ; then
-                        # Calculate the required version number components
-                        [required=$1]
-                        [required_major=`echo $required | sed 's/[^0-9].*//'`]
-                        if test -z "$required_major" ; then
-                                [required_major=0]
-                        fi
-                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
-                        [required_minor=`echo $required | sed 's/[^0-9].*//'`]
-                        if test -z "$required_minor" ; then
-                                [required_minor=0]
-                        fi
-                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
-                        [required_patch=`echo $required | sed 's/[^0-9].*//'`]
-                        if test -z "$required_patch" ; then
-                                [required_patch=0]
-                        fi
-                        # Calculate the available version number components
-                        [available=$swig_version]
-                        [available_major=`echo $available | sed 's/[^0-9].*//'`]
-                        if test -z "$available_major" ; then
-                                [available_major=0]
-                        fi
-                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
-                        [available_minor=`echo $available | sed 's/[^0-9].*//'`]
-                        if test -z "$available_minor" ; then
-                                [available_minor=0]
-                        fi
-                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
-                        [available_patch=`echo $available | sed 's/[^0-9].*//'`]
-                        if test -z "$available_patch" ; then
-                                [available_patch=0]
-                        fi
-                        if test $available_major -ne $required_major \
-                                -o $available_minor -ne $required_minor \
-                                -o $available_patch -lt $required_patch ; then
-                                SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
-                        else
-                                SWIG_LIB=`$SWIG -swiglib`
-                        fi
+                       AX_COMPARE_VERSION($swig_version, ge, $1, [
+                           dnl action-if-true
+                           SWIG_LIB=`$SWIG -swiglib`
+                       ], [
+                           dnl action-if-false
+                           SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+                       ])
                 else
                         SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
                 fi
index abafa8461df43d4c38f6a138313f09e91d77d1e4..f3fc3fea5ee1e97b18f3be5219720163897730ba 100755 (executable)
@@ -1,5 +1,18 @@
 #!/bin/bash
-
+#
+# This script is run by autogen to create the FULL_VERSION file.
+#
+# If run from a git branch, it append '.git.' + git sha1 to the VERSION file.
+# If run from a svn branch, it append '.svn.' + svn number to the VERSION file.
+# If run from a svn tag that match /rc/ it use only the tag name to set the
+#  VERSION, this is done specifically for zmanda rc build.
+# If run from a svn tag that doesn't match /rc/ it use only the VERSION file.
+#
+# It is important to update the VERSION file before creating a tag.
+#
+# ./autogen run config/set_full_version, it create the FULL_VERSION file.
+# ./configure use the FULL_VERSION file.
+#
 srcdir=$1
 
 if test -d .svn; then
diff --git a/config/warn-on-use.h b/config/warn-on-use.h
new file mode 100644 (file)
index 0000000..171e599
--- /dev/null
@@ -0,0 +1,109 @@
+/* A C macro for emitting warnings if a function is used.
+   Copyright (C) 2010 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 3 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
+   for FUNCTION which will then trigger a compiler warning containing
+   the text of "literal string" anywhere that function is called, if
+   supported by the compiler.  If the compiler does not support this
+   feature, the macro expands to an unused extern declaration.
+
+   This macro is useful for marking a function as a potential
+   portability trap, with the intent that "literal string" include
+   instructions on the replacement function that should be used
+   instead.  However, one of the reasons that a function is a
+   portability trap is if it has the wrong signature.  Declaring
+   FUNCTION with a different signature in C is a compilation error, so
+   this macro must use the same type as any existing declaration so
+   that programs that avoid the problematic FUNCTION do not fail to
+   compile merely because they included a header that poisoned the
+   function.  But this implies that _GL_WARN_ON_USE is only safe to
+   use if FUNCTION is known to already have a declaration.  Use of
+   this macro implies that there must not be any other macro hiding
+   the declaration of FUNCTION; but undefining FUNCTION first is part
+   of the poisoning process anyway (although for symbols that are
+   provided only via a macro, the result is a compilation error rather
+   than a warning containing "literal string").  Also note that in
+   C++, it is only safe to use if FUNCTION has no overloads.
+
+   For an example, it is possible to poison 'getline' by:
+   - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
+     [getline]) in configure.ac, which potentially defines
+     HAVE_RAW_DECL_GETLINE
+   - adding this code to a header that wraps the system <stdio.h>:
+     #undef getline
+     #if HAVE_RAW_DECL_GETLINE
+     _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
+       "not universally present; use the gnulib module getline");
+     #endif
+
+   It is not possible to directly poison global variables.  But it is
+   possible to write a wrapper accessor function, and poison that
+   (less common usage, like &environ, will cause a compilation error
+   rather than issue the nice warning, but the end result of informing
+   the developer about their portability problem is still achieved):
+   #if HAVE_RAW_DECL_ENVIRON
+   static inline char ***rpl_environ (void) { return &environ; }
+   _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
+   # undef environ
+   # define environ (*rpl_environ ())
+   #endif
+   */
+#ifndef _GL_WARN_ON_USE
+
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function
+# else /* Unsupported.  */
+#  define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+# endif
+#endif
+
+/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
+   is like _GL_WARN_ON_USE (function, "string"), except that the function is
+   declared with the given prototype, consisting of return type, parameters,
+   and attributes.
+   This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
+   not work in this case.  */
+#ifndef _GL_WARN_ON_USE_CXX
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+extern rettype function parameters_and_attributes \
+     __attribute__ ((__warning__ (msg)))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function.  */
+#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+extern rettype function parameters_and_attributes
+# else /* Unsupported.  */
+#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+# endif
+#endif
+
+/* _GL_WARN_EXTERN_C declaration;
+   performs the declaration with C linkage.  */
+#ifndef _GL_WARN_EXTERN_C
+# if defined __cplusplus
+#  define _GL_WARN_EXTERN_C extern "C"
+# else
+#  define _GL_WARN_EXTERN_C extern
+# endif
+#endif
index 6db8a8625b28ea5c2765ad1a163ec1f096e5e1f4..ad35f813ceebbec8d05a8a5468efcb8e2b1ba62d 100755 (executable)
--- a/configure
+++ b/configure
@@ -787,6 +787,8 @@ ac_includes_default="\
 gl_use_threads_default=
 gl_header_list=
 gl_func_list=
+gl_getopt_required=POSIX
+gl_getopt_required=POSIX
 ac_subst_vars='gltests_LTLIBOBJS
 gltests_LIBOBJS
 gl_LTLIBOBJS
@@ -796,12 +798,12 @@ am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
 READLINE_LIBS
+PKG_CONFIG
 GLIB_MKENUMS
 GOBJECT_QUERY
 GLIB_GENMARSHAL
 GLIB_LIBS
 GLIB_CFLAGS
-PKG_CONFIG
 AMANDA_STATIC_LDFLAGS
 LIBTOOL_DEPS
 OTOOL64
@@ -821,14 +823,13 @@ LIBTOOL
 AMANDA_SWIG_PERL_CFLAGS
 GCC_COMPILER_FALSE
 GCC_COMPILER_TRUE
-HAVE_RPCGEN_FALSE
-HAVE_RPCGEN_TRUE
 RPCGEN
 PS_ARGUMENT_ARGS
 PS_ARGUMENT
 PS
 LPRFLAG
 LPR
+MTX
 MT_FILE_FLAG
 MT
 DEFAULT_MAILER
@@ -886,14 +887,6 @@ WANT_DVDRW_DEVICE_FALSE
 WANT_DVDRW_DEVICE_TRUE
 WANT_TAPE_DEVICE_FALSE
 WANT_TAPE_DEVICE_TRUE
-WANT_TAPE_POSIX_FALSE
-WANT_TAPE_POSIX_TRUE
-WANT_TAPE_UWARE_FALSE
-WANT_TAPE_UWARE_TRUE
-WANT_TAPE_AIX_FALSE
-WANT_TAPE_AIX_TRUE
-WANT_TAPE_XENIX_FALSE
-WANT_TAPE_XENIX_TRUE
 WANT_S3_DEVICE_FALSE
 WANT_S3_DEVICE_TRUE
 LIBCURL
@@ -930,6 +923,8 @@ COMPRESS_SUFFIX
 COMPRESS_PATH
 CAT
 PERLEXTLIBS
+WANT_MANDATORY_THREAD_CHECK_FALSE
+WANT_MANDATORY_THREAD_CHECK_TRUE
 WANT_CYGWIN_COPY_PERL_DLL_FALSE
 WANT_CYGWIN_COPY_PERL_DLL_TRUE
 PERL_INC
@@ -945,32 +940,6 @@ WANT_AMFLOCK_FLOCK_FALSE
 WANT_AMFLOCK_FLOCK_TRUE
 WANT_AMFLOCK_POSIX_FALSE
 WANT_AMFLOCK_POSIX_TRUE
-WANT_SCSI_CHIO_FALSE
-WANT_SCSI_CHIO_TRUE
-WANT_SCSI_HPUX_FALSE
-WANT_SCSI_HPUX_TRUE
-WANT_CHG_SCSI_CHIO_FALSE
-WANT_CHG_SCSI_CHIO_TRUE
-WANT_SCSI_BSD_FALSE
-WANT_SCSI_BSD_TRUE
-WANT_SCSI_CAM_FALSE
-WANT_SCSI_CAM_TRUE
-WANT_SCSI_AIX_FALSE
-WANT_SCSI_AIX_TRUE
-WANT_SCSI_SOLARIS_FALSE
-WANT_SCSI_SOLARIS_TRUE
-WANT_SCSI_IRIX_FALSE
-WANT_SCSI_IRIX_TRUE
-WANT_SCSI_HPUX_NEW_FALSE
-WANT_SCSI_HPUX_NEW_TRUE
-WANT_SCSI_LINUX_FALSE
-WANT_SCSI_LINUX_TRUE
-WANT_CHG_SCSI_FALSE
-WANT_CHG_SCSI_TRUE
-MCUTIL
-MTX
-CHS
-CHIO
 GETCONF
 DEFAULT_AMANDATES_FILE
 EXAMPLE_TAPEDEV
@@ -1008,8 +977,8 @@ WANT_RESTORE_FALSE
 WANT_RESTORE_TRUE
 WANT_CLIENT_FALSE
 WANT_CLIENT_TRUE
-CHECK_SCRIPTS_AT_BUILD_FALSE
-CHECK_SCRIPTS_AT_BUILD_TRUE
+SYNTAX_CHECKS_FALSE
+SYNTAX_CHECKS_TRUE
 WANT_INSTALLPERMS_FALSE
 WANT_INSTALLPERMS_TRUE
 WANT_SETUID_CLIENT_FALSE
@@ -1031,24 +1000,49 @@ CONFIG_DIR
 SETUID_GROUP
 CLIENT_LOGIN
 AMANDA_WARNING_CFLAGS
+gltests_WITNESS
 REPLACE_ISWCNTRL
-WCTYPE_H
 HAVE_WCTYPE_H
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
 NEXT_WCTYPE_H
+REPLACE_ISWBLANK
+HAVE_ISWBLANK
 HAVE_ISWCNTRL
-NEXT_WCHAR_H
-HAVE_WCHAR_H
 HAVE_WINT_T
-HAVE_VISIBILITY
-CFLAG_VISIBILITY
+HAVE_WCHAR_H
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H
+NEXT_WCHAR_H
 HAVE_UNISTD_H
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
 NEXT_UNISTD_H
-SYS_STAT_H
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
+TIME_H_DEFINES_STRUCT_TIMESPEC
+NEXT_AS_FIRST_DIRECTIVE_TIME_H
+NEXT_TIME_H
+REPLACE_TIMEGM
+REPLACE_NANOSLEEP
+REPLACE_MKTIME
+REPLACE_LOCALTIME_R
+HAVE_TIMEGM
+HAVE_STRPTIME
+HAVE_NANOSLEEP
+HAVE_LOCALTIME_R
+GNULIB_TIME_R
+GNULIB_TIMEGM
+GNULIB_STRPTIME
+GNULIB_NANOSLEEP
+GNULIB_MKTIME
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
 NEXT_SYS_STAT_H
-HAVE_LSTAT
+NEXT_AS_FIRST_DIRECTIVE_STRING_H
+NEXT_STRING_H
 HAVE_RANDOM_H
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
 NEXT_STDLIB_H
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H
 NEXT_STDIO_H
+ASM_SYMBOL_PREFIX
 STDINT_H
 WINT_T_SUFFIX
 WCHAR_T_SUFFIX
@@ -1066,26 +1060,104 @@ BITSIZEOF_PTRDIFF_T
 HAVE_SYS_BITYPES_H
 HAVE_SYS_INTTYPES_H
 HAVE_STDINT_H
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H
 NEXT_STDINT_H
 HAVE_SYS_TYPES_H
 HAVE_INTTYPES_H
 HAVE_UNSIGNED_LONG_LONG_INT
 HAVE_LONG_LONG_INT
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
+NEXT_STDDEF_H
+STDDEF_H
+HAVE_WCHAR_T
+REPLACE_NULL
 HAVE__BOOL
 STDBOOL_H
 NETINET_IN_H
 HAVE_NETINET_IN_H
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
 NEXT_NETINET_IN_H
 APPLE_UNIVERSAL_BUILD
+UNDEFINE_STRTOK_R
+REPLACE_STRTOK_R
+REPLACE_STRSIGNAL
+REPLACE_STRNLEN
+REPLACE_STRNDUP
+REPLACE_STRNCAT
+REPLACE_STRERROR
+REPLACE_STRCASESTR
+REPLACE_STRSTR
+REPLACE_STRDUP
+REPLACE_STPNCPY
+REPLACE_MEMMEM
+REPLACE_MEMCHR
+HAVE_STRVERSCMP
+HAVE_DECL_STRSIGNAL
+HAVE_DECL_STRTOK_R
+HAVE_STRCASESTR
+HAVE_STRSEP
+HAVE_STRPBRK
+HAVE_DECL_STRNLEN
+HAVE_DECL_STRNDUP
+HAVE_DECL_STRDUP
+HAVE_STRCHRNUL
+HAVE_STPNCPY
+HAVE_STPCPY
+HAVE_RAWMEMCHR
+HAVE_DECL_MEMRCHR
+HAVE_MEMPCPY
+HAVE_DECL_MEMMEM
+HAVE_MEMCHR
+HAVE_MBSLEN
+GNULIB_STRVERSCMP
+GNULIB_STRSIGNAL
+GNULIB_STRERROR
+GNULIB_MBSTOK_R
+GNULIB_MBSSEP
+GNULIB_MBSSPN
+GNULIB_MBSPBRK
+GNULIB_MBSCSPN
+GNULIB_MBSCASESTR
+GNULIB_MBSPCASECMP
+GNULIB_MBSNCASECMP
+GNULIB_MBSCASECMP
+GNULIB_MBSSTR
+GNULIB_MBSRCHR
+GNULIB_MBSCHR
+GNULIB_MBSNLEN
+GNULIB_MBSLEN
+GNULIB_STRTOK_R
+GNULIB_STRCASESTR
+GNULIB_STRSTR
+GNULIB_STRSEP
+GNULIB_STRPBRK
+GNULIB_STRNLEN
+GNULIB_STRNDUP
+GNULIB_STRNCAT
+GNULIB_STRDUP
+GNULIB_STRCHRNUL
+GNULIB_STPNCPY
+GNULIB_STPCPY
+GNULIB_RAWMEMCHR
+GNULIB_MEMRCHR
+GNULIB_MEMPCPY
+GNULIB_MEMMEM
+GNULIB_MEMCHR
 LOCALE_FR_UTF8
 LOCALE_ZH_CN
 LOCALE_JA
-VOID_UNSETENV
+REPLACE_UNSETENV
 REPLACE_STRTOD
+REPLACE_SETENV
+REPLACE_REALPATH
+REPLACE_REALLOC
 REPLACE_PUTENV
 REPLACE_MKSTEMP
-HAVE_DECL_GETLOADAVG
+REPLACE_MALLOC
+REPLACE_CANONICALIZE_FILE_NAME
+REPLACE_CALLOC
 HAVE_UNSETENV
+HAVE_UNLOCKPT
 HAVE_SYS_LOADAVG_H
 HAVE_STRUCT_RANDOM_DATA
 HAVE_STRTOULL
@@ -1093,34 +1165,77 @@ HAVE_STRTOLL
 HAVE_STRTOD
 HAVE_SETENV
 HAVE_RPMATCH
+HAVE_REALPATH
 HAVE_RANDOM_R
-HAVE_REALLOC_POSIX
+HAVE_PTSNAME
+HAVE_MKSTEMPS
+HAVE_MKSTEMP
+HAVE_MKOSTEMPS
+HAVE_MKOSTEMP
 HAVE_MKDTEMP
+HAVE_GRANTPT
 HAVE_GETSUBOPT
-HAVE_CALLOC_POSIX
+HAVE_DECL_GETLOADAVG
+HAVE_CANONICALIZE_FILE_NAME
 HAVE_ATOLL
+HAVE__EXIT
 GNULIB_UNSETENV
+GNULIB_UNLOCKPT
 GNULIB_STRTOULL
 GNULIB_STRTOLL
 GNULIB_STRTOD
 GNULIB_SETENV
 GNULIB_RPMATCH
+GNULIB_REALPATH
+GNULIB_REALLOC_POSIX
 GNULIB_RANDOM_R
 GNULIB_PUTENV
+GNULIB_PTSNAME
+GNULIB_MKSTEMPS
 GNULIB_MKSTEMP
+GNULIB_MKOSTEMPS
+GNULIB_MKOSTEMP
 GNULIB_MKDTEMP
+GNULIB_MALLOC_POSIX
+GNULIB_GRANTPT
 GNULIB_GETSUBOPT
 GNULIB_GETLOADAVG
-GNULIB_ATOLL
+GNULIB_CANONICALIZE_FILE_NAME
 GNULIB_CALLOC_POSIX
-GNULIB_REALLOC_POSIX
-GNULIB_MALLOC_POSIX
-HAVE_MALLOC_POSIX
+GNULIB_ATOLL
+GNULIB__EXIT
+REPLACE_UTIMENSAT
+REPLACE_STAT
+REPLACE_MKNOD
+REPLACE_MKFIFO
 REPLACE_MKDIR
 REPLACE_LSTAT
+REPLACE_FUTIMENS
+REPLACE_FSTATAT
+REPLACE_FSTAT
+HAVE_UTIMENSAT
+HAVE_MKNODAT
+HAVE_MKNOD
+HAVE_MKFIFOAT
+HAVE_MKFIFO
+HAVE_MKDIRAT
+HAVE_LSTAT
 HAVE_LCHMOD
+HAVE_FUTIMENS
+HAVE_FSTATAT
+HAVE_FCHMODAT
+GNULIB_UTIMENSAT
+GNULIB_STAT
+GNULIB_MKNODAT
+GNULIB_MKNOD
+GNULIB_MKFIFOAT
+GNULIB_MKFIFO
+GNULIB_MKDIRAT
 GNULIB_LSTAT
 GNULIB_LCHMOD
+GNULIB_FUTIMENS
+GNULIB_FSTATAT
+GNULIB_FCHMODAT
 LTLIBMULTITHREAD
 LIBMULTITHREAD
 LTLIBTHREAD
@@ -1129,19 +1244,34 @@ LTLIBPTH
 LIBPTH
 LOCALCHARSET_TESTS_ENVIRONMENT
 GLIBC21
-SYS_TIME_H
+HAVE_LANGINFO_ERA
+HAVE_LANGINFO_CODESET
+HAVE_LANGINFO_H
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H
+NEXT_LANGINFO_H
+REPLACE_NL_LANGINFO
+HAVE_NL_LANGINFO
+GNULIB_NL_LANGINFO
+INET_PTON_LIB
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
+NEXT_SYS_TIME_H
 REPLACE_GETTIMEOFDAY
-HAVE_STRUCT_TIMEVAL
 HAVE_SYS_TIME_H
-NEXT_SYS_TIME_H
+HAVE_STRUCT_TIMEVAL
+HAVE_GETTIMEOFDAY
+GNULIB_GETTIMEOFDAY
 LTLIBINTL
 LIBINTL
 GETOPT_H
+HAVE_GETOPT_H
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H
+NEXT_GETOPT_H
 GETADDRINFO_LIB
+INET_NTOP_LIB
 SERVENT_LIB
 HOSTENT_LIB
-NETDB_H
 HAVE_NETDB_H
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H
 NEXT_NETDB_H
 HAVE_DECL_GETNAMEINFO
 HAVE_DECL_GETADDRINFO
@@ -1149,11 +1279,15 @@ HAVE_DECL_GAI_STRERROR
 HAVE_DECL_FREEADDRINFO
 HAVE_STRUCT_ADDRINFO
 GNULIB_GETADDRINFO
-SYS_SOCKET_H
+HAVE_WINSOCK2_H
 HAVE_WS2TCPIP_H
 HAVE_SYS_SOCKET_H
-HAVE_WINSOCK2_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
 NEXT_SYS_SOCKET_H
+HAVE_ACCEPT4
+HAVE_SA_FAMILY_T
+HAVE_STRUCT_SOCKADDR_STORAGE
+GNULIB_ACCEPT4
 GNULIB_SHUTDOWN
 GNULIB_SETSOCKOPT
 GNULIB_SENDTO
@@ -1168,134 +1302,204 @@ GNULIB_BIND
 GNULIB_ACCEPT
 GNULIB_CONNECT
 GNULIB_SOCKET
+REPLACE_VSPRINTF
+REPLACE_VSNPRINTF
+REPLACE_VPRINTF
+REPLACE_VFPRINTF
+REPLACE_VDPRINTF
+REPLACE_VASPRINTF
+REPLACE_TMPFILE
+REPLACE_STDIO_WRITE_FUNCS
+REPLACE_SPRINTF
+REPLACE_SNPRINTF
+REPLACE_RENAMEAT
+REPLACE_RENAME
+REPLACE_REMOVE
+REPLACE_PRINTF
+REPLACE_POPEN
+REPLACE_PERROR
+REPLACE_OBSTACK_PRINTF
+REPLACE_GETLINE
+REPLACE_GETDELIM
+REPLACE_FTELLO
+REPLACE_FTELL
+REPLACE_FSEEKO
+REPLACE_FSEEK
+REPLACE_FREOPEN
+REPLACE_FPURGE
+REPLACE_FPRINTF
+REPLACE_FOPEN
+REPLACE_FFLUSH
+REPLACE_FCLOSE
+REPLACE_DPRINTF
+HAVE_VDPRINTF
+HAVE_VASPRINTF
+HAVE_RENAMEAT
+HAVE_FTELLO
+HAVE_FSEEKO
+HAVE_DPRINTF
+HAVE_DECL_VSNPRINTF
+HAVE_DECL_SNPRINTF
+HAVE_DECL_OBSTACK_PRINTF
+HAVE_DECL_GETLINE
+HAVE_DECL_GETDELIM
+HAVE_DECL_FPURGE
+GNULIB_VSPRINTF_POSIX
+GNULIB_VSNPRINTF
+GNULIB_VPRINTF_POSIX
+GNULIB_VPRINTF
+GNULIB_VFPRINTF_POSIX
+GNULIB_VFPRINTF
+GNULIB_VDPRINTF
+GNULIB_VASPRINTF
+GNULIB_TMPFILE
+GNULIB_STDIO_H_SIGPIPE
+GNULIB_SPRINTF_POSIX
+GNULIB_SNPRINTF
+GNULIB_RENAMEAT
+GNULIB_RENAME
+GNULIB_REMOVE
+GNULIB_PUTS
+GNULIB_PUTCHAR
+GNULIB_PUTC
+GNULIB_PRINTF_POSIX
+GNULIB_PRINTF
+GNULIB_POPEN
+GNULIB_PERROR
+GNULIB_OBSTACK_PRINTF_POSIX
+GNULIB_OBSTACK_PRINTF
+GNULIB_GETLINE
+GNULIB_GETDELIM
+GNULIB_FWRITE
+GNULIB_FTELLO
+GNULIB_FTELL
+GNULIB_FSEEKO
+GNULIB_FSEEK
+GNULIB_FREOPEN
+GNULIB_FPUTS
+GNULIB_FPUTC
+GNULIB_FPURGE
+GNULIB_FPRINTF_POSIX
+GNULIB_FPRINTF
+GNULIB_FOPEN
+GNULIB_FFLUSH
+GNULIB_FCLOSE
+GNULIB_DPRINTF
+FLOAT_H
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
+NEXT_FLOAT_H
+EOVERFLOW_VALUE
+EOVERFLOW_HIDDEN
+ENOLINK_VALUE
+ENOLINK_HIDDEN
+EMULTIHOP_VALUE
+EMULTIHOP_HIDDEN
+ERRNO_H
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
+NEXT_ERRNO_H
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
 UNISTD_H_HAVE_WINSOCK2_H
 REPLACE_WRITE
+REPLACE_USLEEP
+REPLACE_UNLINKAT
+REPLACE_UNLINK
+REPLACE_TTYNAME_R
+REPLACE_SYMLINK
+REPLACE_SLEEP
+REPLACE_RMDIR
+REPLACE_READLINK
+REPLACE_PWRITE
+REPLACE_PREAD
 REPLACE_LSEEK
+REPLACE_LINKAT
+REPLACE_LINK
 REPLACE_LCHOWN
 REPLACE_GETPAGESIZE
+REPLACE_GETGROUPS
 REPLACE_GETCWD
-REPLACE_FCHDIR
+REPLACE_FCHOWNAT
+REPLACE_DUP2
+REPLACE_DUP
 REPLACE_CLOSE
 REPLACE_CHOWN
 HAVE_SYS_PARAM_H
 HAVE_OS_H
+HAVE_DECL_GETUSERSHELL
+HAVE_DECL_GETPAGESIZE
 HAVE_DECL_GETLOGIN_R
 HAVE_DECL_ENVIRON
+HAVE_USLEEP
+HAVE_UNLINKAT
+HAVE_TTYNAME_R
+HAVE_SYMLINKAT
+HAVE_SYMLINK
 HAVE_SLEEP
+HAVE_READLINKAT
 HAVE_READLINK
+HAVE_PWRITE
+HAVE_PREAD
+HAVE_PIPE2
+HAVE_LINKAT
 HAVE_LINK
-HAVE_GETUSERSHELL
+HAVE_LCHOWN
 HAVE_GETPAGESIZE
+HAVE_GETLOGIN
 HAVE_GETHOSTNAME
+HAVE_GETGROUPS
 HAVE_GETDTABLESIZE
 HAVE_GETDOMAINNAME
 HAVE_FTRUNCATE
 HAVE_FSYNC
+HAVE_FCHOWNAT
+HAVE_FCHDIR
+HAVE_FACCESSAT
 HAVE_EUIDACCESS
+HAVE_DUP3
 HAVE_DUP2
+HAVE_CHOWN
 GNULIB_WRITE
+GNULIB_USLEEP
+GNULIB_UNLINKAT
+GNULIB_UNLINK
 GNULIB_UNISTD_H_SIGPIPE
+GNULIB_UNISTD_H_GETOPT
+GNULIB_TTYNAME_R
+GNULIB_SYMLINKAT
+GNULIB_SYMLINK
 GNULIB_SLEEP
+GNULIB_RMDIR
+GNULIB_READLINKAT
 GNULIB_READLINK
+GNULIB_PWRITE
+GNULIB_PREAD
+GNULIB_PIPE2
 GNULIB_LSEEK
+GNULIB_LINKAT
 GNULIB_LINK
 GNULIB_LCHOWN
 GNULIB_GETUSERSHELL
 GNULIB_GETPAGESIZE
 GNULIB_GETLOGIN_R
+GNULIB_GETLOGIN
 GNULIB_GETHOSTNAME
+GNULIB_GETGROUPS
 GNULIB_GETDTABLESIZE
 GNULIB_GETDOMAINNAME
 GNULIB_GETCWD
 GNULIB_FTRUNCATE
 GNULIB_FSYNC
+GNULIB_FCHOWNAT
 GNULIB_FCHDIR
+GNULIB_FACCESSAT
 GNULIB_EUIDACCESS
 GNULIB_ENVIRON
+GNULIB_DUP3
 GNULIB_DUP2
 GNULIB_CLOSE
 GNULIB_CHOWN
-REPLACE_PERROR
-REPLACE_GETLINE
-HAVE_DECL_GETLINE
-HAVE_DECL_GETDELIM
-REPLACE_FCLOSE
-REPLACE_FFLUSH
-REPLACE_FTELL
-REPLACE_FTELLO
-HAVE_FTELLO
-REPLACE_FSEEK
-REPLACE_FSEEKO
-HAVE_FSEEKO
-REPLACE_FREOPEN
-REPLACE_FOPEN
-REPLACE_OBSTACK_PRINTF
-HAVE_DECL_OBSTACK_PRINTF
-REPLACE_VASPRINTF
-HAVE_VASPRINTF
-REPLACE_VDPRINTF
-HAVE_VDPRINTF
-REPLACE_DPRINTF
-HAVE_DPRINTF
-REPLACE_VSPRINTF
-REPLACE_SPRINTF
-HAVE_DECL_VSNPRINTF
-REPLACE_VSNPRINTF
-HAVE_DECL_SNPRINTF
-REPLACE_SNPRINTF
-REPLACE_VPRINTF
-REPLACE_PRINTF
-REPLACE_VFPRINTF
-REPLACE_FPRINTF
-REPLACE_STDIO_WRITE_FUNCS
-GNULIB_STDIO_H_SIGPIPE
-GNULIB_PERROR
-GNULIB_GETLINE
-GNULIB_GETDELIM
-GNULIB_FWRITE
-GNULIB_PUTS
-GNULIB_FPUTS
-GNULIB_PUTCHAR
-GNULIB_PUTC
-GNULIB_FPUTC
-GNULIB_FCLOSE
-GNULIB_FFLUSH
-GNULIB_FTELLO
-GNULIB_FTELL
-GNULIB_FSEEKO
-GNULIB_FSEEK
-GNULIB_FREOPEN
-GNULIB_FOPEN
-GNULIB_OBSTACK_PRINTF_POSIX
-GNULIB_OBSTACK_PRINTF
-GNULIB_VASPRINTF
-GNULIB_VDPRINTF
-GNULIB_DPRINTF
-GNULIB_VSPRINTF_POSIX
-GNULIB_VSNPRINTF
-GNULIB_VPRINTF_POSIX
-GNULIB_VPRINTF
-GNULIB_VFPRINTF_POSIX
-GNULIB_VFPRINTF
-GNULIB_SPRINTF_POSIX
-GNULIB_SNPRINTF
-GNULIB_PRINTF_POSIX
-GNULIB_PRINTF
-GNULIB_FPRINTF_POSIX
-GNULIB_FPRINTF
-FLOAT_H
-NEXT_FLOAT_H
-EOVERFLOW_VALUE
-EOVERFLOW_HIDDEN
-ENOLINK_VALUE
-ENOLINK_HIDDEN
-EMULTIHOP_VALUE
-EMULTIHOP_HIDDEN
-ERRNO_H
-NEXT_ERRNO_H
 LOCALE_FR
-WCHAR_H
 REPLACE_WCWIDTH
+REPLACE_WCSNRTOMBS
 REPLACE_WCSRTOMBS
 REPLACE_WCRTOMB
 REPLACE_MBSNRTOWCS
@@ -1328,19 +1532,18 @@ GNULIB_MBRTOWC
 GNULIB_MBSINIT
 GNULIB_WCTOB
 GNULIB_BTOWC
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H
 NEXT_ARPA_INET_H
 PRAGMA_SYSTEM_HEADER
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE
 INCLUDE_NEXT
 HAVE_ARPA_INET_H
-ARPA_INET_H
 HAVE_DECL_INET_PTON
 HAVE_DECL_INET_NTOP
 GNULIB_INET_PTON
 GNULIB_INET_NTOP
 ALLOCA_H
 ALLOCA
-LTALLOCA
 GL_COND_LIBTOOL_FALSE
 GL_COND_LIBTOOL_TRUE
 EGREP
@@ -1497,7 +1700,6 @@ with_changer_device
 with_amandates
 with_perlextlibs
 with_ipv6
-with_mmap
 with_amlibdir
 with_amlibexecdir
 with_amperldir
@@ -1550,6 +1752,12 @@ GNUTAR
 STAR
 YACC
 YFLAGS
+MTX
+GLIB_CFLAGS
+GLIB_LIBS
+GLIB_GENMARSHAL
+GOBJECT_QUERY
+GLIB_MKENUMS
 PKG_CONFIG'
 
 
@@ -2188,7 +2396,8 @@ Optional Features:
   --disable-largefile     omit support for large files
   --disable-installperms  do not modify ownership and permissions on installed
                           files
-  --disable-syntax-checks Do not perform syntax checks when installing
+  --enable-syntax-checks  Perform syntax checks when installing - developers
+                          only
   --enable-manpage-build  Build the manpages from their XML source (shipped
                           manpages are usually sufficient)
   --disable-nls           do not use Native Language Support
@@ -2212,12 +2421,9 @@ Optional Packages:
   --with-libpth-prefix[=DIR]  search for libpth in DIR/include and DIR/lib
   --without-libpth-prefix     don't search for libpth in includedir and libdir
   --without-included-regex
-                          don't compile regex; this is the default on 32-bit
-                          systems with recent-enough versions of the GNU C
-                          Library (use with caution on other systems). On
-                          systems with 64-bit ptrdiff_t and 32-bit int,
-                          --with-included-regex is the default, in case regex
-                          functions operate on very long strings (>2GB)
+                          don't compile regex; this is the default on systems
+                          with recent-enough versions of the GNU C Library
+                          (use with caution on other systems).
   --with-cflags=FLAGS     deprecated; use ./configure CFLAGS=...
   --with-includes=INCLUDE-DIRS
                           deprecated; use ./configure CPPFLAGS='-I.. -I..'
@@ -2247,15 +2453,12 @@ Optional Packages:
   --with-fqdn             use FQDN's to backup multiple networks
   --without-reuseaddr     Don't reuse network connections until full timeout
                           period
-  --with-low-tcpportrange=low/high
+  --with-low-tcpportrange=low,high
                           bind reserved TCP server sockets to ports within
-                          this range (default: unlimited)
-  --with-tcpportrange=low/high
+  --with-tcpportrange=low,high
                           bind unreserved TCP server sockets to ports within
-                          this range (default: unlimited)
-  --with-udpportrange=low/high
+  --with-udpportrange=low,high
                           bind reserved UDP server sockets to ports within
-                          this range (default: unlimited)
   --with-buffered-dump    buffer the dumping sockets on the server for speed
 (deprecated)
   --with-assertions       compile assertions into code
@@ -2294,7 +2497,6 @@ Optional Packages:
   --with-perlextlibs=libs extra LIBS for Perl extensions
   --with-ipv6             enable IPv6 support (default if IPv6 is found)
          --without-ipv6          disable IPv6
-  --with-mmap             force use of mmap instead of shared memory support
   --with-amlibdir[[[=PATH]]]
                           Where library are installed, default: $libdir/amanda
          --without-amlibdir      Library are installed in $libdir
@@ -2358,6 +2560,16 @@ Some influential environment variables:
   YFLAGS      The list of arguments that will be passed by default to $YACC.
               This script will default YFLAGS to the empty string to avoid a
               default value of `-d' given by some make applications.
+  MTX         Path to the 'mtx' binary
+  GLIB_CFLAGS CFLAGS to build with glib; disables use of pkg-config
+  GLIB_LIBS   libraries to build with glib; disables use of pkg-config
+  GLIB_GENMARSHAL
+              genmarshal binary to use with glib; disables use of pkg-config
+  GOBJECT_QUERY
+              gobject_query binary to use with glib; disables use of
+              pkg-config
+  GLIB_MKENUMS
+              mkenums binary to use with glib; disables use of pkg-config
   PKG_CONFIG  path to pkg-config utility
 
 Use these variables to override the choices made by `configure' or to help
@@ -2727,24 +2939,35 @@ gl_func_list="$gl_func_list ftruncate"
 gl_header_list="$gl_header_list sys/socket.h"
 gl_header_list="$gl_header_list netdb.h"
 gl_header_list="$gl_header_list netinet/in.h"
+gl_getopt_required=GNU
+gl_header_list="$gl_header_list getopt.h"
 gl_header_list="$gl_header_list sys/time.h"
 gl_func_list="$gl_func_list gettimeofday"
+gl_header_list="$gl_header_list langinfo.h"
 gl_func_list="$gl_func_list lstat"
 gl_func_list="$gl_func_list mbsinit"
 gl_func_list="$gl_func_list mbrtowc"
+gl_header_list="$gl_header_list sys/mman.h"
+gl_func_list="$gl_func_list mprotect"
+gl_func_list="$gl_func_list memchr"
+gl_func_list="$gl_func_list nl_langinfo"
 gl_header_list="$gl_header_list locale.h"
 gl_func_list="$gl_func_list isblank"
 gl_func_list="$gl_func_list iswctype"
 gl_func_list="$gl_func_list wcscoll"
+gl_header_list="$gl_header_list stddef.h"
 gl_header_list="$gl_header_list stdint.h"
 gl_header_list="$gl_header_list wchar.h"
 gl_header_list="$gl_header_list stdio.h"
 gl_header_list="$gl_header_list stdlib.h"
+gl_header_list="$gl_header_list string.h"
 gl_header_list="$gl_header_list sys/stat.h"
+gl_header_list="$gl_header_list time.h"
 gl_header_list="$gl_header_list unistd.h"
 gl_func_list="$gl_func_list vasnprintf"
 gl_func_list="$gl_func_list wcrtomb"
 gl_func_list="$gl_func_list iswcntrl"
+gl_func_list="$gl_func_list iswblank"
 gl_header_list="$gl_header_list wctype.h"
 # Check that the precious variables saved in the cache have kept the same
 # value.
@@ -3496,6 +3719,7 @@ fi
 { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
 $as_echo "$MKDIR_P" >&6; }
 
+
 mkdir_p="$MKDIR_P"
 case $mkdir_p in
   [\\/$]* | ?:[\\/]*) ;;
@@ -5878,8 +6102,8 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#        define __EXTENSIONS__ 1
-         $ac_includes_default
+#         define __EXTENSIONS__ 1
+          $ac_includes_default
 int
 main ()
 {
@@ -6092,7 +6316,13 @@ else
        gl_use_threads="$gl_use_threads_default"
      else
        case "$host_os" in
-                                    osf*) gl_use_threads=no ;;
+                                                               osf*) gl_use_threads=no ;;
+         cygwin*)
+               case `uname -r` in
+                 1.[0-5].*) gl_use_threads=no ;;
+                 *)         gl_use_threads=yes ;;
+               esac
+               ;;
          *)    gl_use_threads=yes ;;
        esac
      fi
@@ -6107,7 +6337,7 @@ fi
         # groks <pthread.h>. cc also understands the flag -pthread, but
         # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
         # 2. putting a flag into CPPFLAGS that has an effect on the linker
-        # causes the AC_TRY_LINK test below to succeed unexpectedly,
+        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
         # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
         CPPFLAGS="$CPPFLAGS -D_REENTRANT"
         ;;
@@ -6124,19 +6354,97 @@ fi
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
+  # Code from module alignof:
+  # Code from module alloca-opt:
+  # Code from module arg-nonnull:
+  # Code from module arpa_inet:
+  # Code from module base64:
+  # Code from module btowc:
+  # Code from module c++defs:
+  # Code from module c-ctype:
+  # Code from module configmake:
+  # Code from module environ:
+  # Code from module errno:
+  # Code from module extensions:
+
+  # Code from module float:
+  # Code from module fseeko:
+
+  # Code from module fsusage:
+  # Code from module ftello:
+
+  # Code from module ftruncate:
+  # Code from module full-read:
+  # Code from module full-write:
+  # Code from module getaddrinfo:
+  # Code from module getopt-gnu:
+  # Code from module getopt-posix:
+  # Code from module gettext-h:
+  # Code from module gettimeofday:
+  # Code from module havelib:
+  # Code from module hostent:
+  # Code from module include_next:
+  # Code from module inet_ntop:
+  # Code from module inet_pton:
+  # Code from module langinfo:
+  # Code from module localcharset:
+  # Code from module lock:
+  # Code from module lseek:
+  # Code from module lstat:
+  # Code from module malloc-gnu:
+  # Code from module malloc-posix:
+  # Code from module mbrtowc:
+  # Code from module mbsinit:
+  # Code from module memchr:
+  # Code from module mkdtemp:
+  # Code from module multiarch:
+  # Code from module netdb:
+  # Code from module netinet_in:
+  # Code from module nl_langinfo:
+  # Code from module physmem:
+  # Code from module regex:
+  # Code from module safe-read:
+  # Code from module safe-write:
+  # Code from module servent:
+  # Code from module size_max:
+  # Code from module snprintf:
+  # Code from module socklen:
+  # Code from module ssize_t:
+  # Code from module stat:
+  # Code from module stdbool:
+  # Code from module stddef:
+  # Code from module stdint:
+  # Code from module stdio:
+  # Code from module stdlib:
+  # Code from module streq:
+  # Code from module string:
+  # Code from module sys_socket:
+  # Code from module sys_stat:
+  # Code from module sys_time:
+  # Code from module tempname:
+  # Code from module threadlib:
+
+
+
+  # Code from module time:
+  # Code from module unistd:
+  # Code from module vasnprintf:
+  # Code from module verify:
+  # Code from module warn-on-use:
+  # Code from module wchar:
+  # Code from module wcrtomb:
+  # Code from module wctype:
+  # Code from module write:
+  # Code from module xsize:
+
+
+
+
+
+
+
+          LIBC_FATAL_STDERR_=1
+  export LIBC_FATAL_STDERR_
 
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
@@ -6524,7 +6832,6 @@ fi
   GNULIB_INET_PTON=0;
     HAVE_DECL_INET_NTOP=1;
   HAVE_DECL_INET_PTON=1;
-  ARPA_INET_H='';
 
 
 
@@ -6983,8 +7290,86 @@ _ACEOF
   REPLACE_MBSNRTOWCS=0;
   REPLACE_WCRTOMB=0;
   REPLACE_WCSRTOMBS=0;
+  REPLACE_WCSNRTOMBS=0;
   REPLACE_WCWIDTH=0;
-  WCHAR_H='';
+
+
+            { $as_echo "$as_me:$LINENO: checking whether <wchar.h> uses 'inline' correctly" >&5
+$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
+if test "${gl_cv_header_wchar_h_correct_inline+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  gl_cv_header_wchar_h_correct_inline=yes
+     cat >conftest.$ac_ext <<_ACEOF
+
+       /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#define wcstod renamed_wcstod
+#include <wchar.h>
+extern int zero (void);
+int main () { return zero(); }
+
+_ACEOF
+     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+       mv conftest.$ac_objext conftest1.$ac_objext
+       cat >conftest.$ac_ext <<_ACEOF
+
+         /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#define wcstod renamed_wcstod
+#include <wchar.h>
+int zero (void) { return 0; }
+
+_ACEOF
+       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+         mv conftest.$ac_objext conftest2.$ac_objext
+         if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
+           :
+         else
+           gl_cv_header_wchar_h_correct_inline=no
+         fi
+       fi
+     fi
+     rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_correct_inline" >&5
+$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
+  if test $gl_cv_header_wchar_h_correct_inline = no; then
+    { { $as_echo "$as_me:$LINENO: error: <wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
+This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
+C99 mode. You have four options:
+  - Add the flag -fgnu89-inline to CC and reconfigure, or
+  - Fix your include files, using parts of
+    <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
+  - Use a gcc version older than 4.3, or
+  - Don't use the flags -std=c99 or -std=gnu99.
+Configuration aborted." >&5
+$as_echo "$as_me: error: <wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
+This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
+C99 mode. You have four options:
+  - Add the flag -fgnu89-inline to CC and reconfigure, or
+  - Fix your include files, using parts of
+    <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
+  - Use a gcc version older than 4.3, or
+  - Don't use the flags -std=c99 or -std=gnu99.
+Configuration aborted." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
 
 
 
@@ -7267,6 +7652,180 @@ $as_echo "$gt_cv_locale_fr" >&6; }
 
 
 
+  GNULIB_CHOWN=0;
+  GNULIB_CLOSE=0;
+  GNULIB_DUP2=0;
+  GNULIB_DUP3=0;
+  GNULIB_ENVIRON=0;
+  GNULIB_EUIDACCESS=0;
+  GNULIB_FACCESSAT=0;
+  GNULIB_FCHDIR=0;
+  GNULIB_FCHOWNAT=0;
+  GNULIB_FSYNC=0;
+  GNULIB_FTRUNCATE=0;
+  GNULIB_GETCWD=0;
+  GNULIB_GETDOMAINNAME=0;
+  GNULIB_GETDTABLESIZE=0;
+  GNULIB_GETGROUPS=0;
+  GNULIB_GETHOSTNAME=0;
+  GNULIB_GETLOGIN=0;
+  GNULIB_GETLOGIN_R=0;
+  GNULIB_GETPAGESIZE=0;
+  GNULIB_GETUSERSHELL=0;
+  GNULIB_LCHOWN=0;
+  GNULIB_LINK=0;
+  GNULIB_LINKAT=0;
+  GNULIB_LSEEK=0;
+  GNULIB_PIPE2=0;
+  GNULIB_PREAD=0;
+  GNULIB_PWRITE=0;
+  GNULIB_READLINK=0;
+  GNULIB_READLINKAT=0;
+  GNULIB_RMDIR=0;
+  GNULIB_SLEEP=0;
+  GNULIB_SYMLINK=0;
+  GNULIB_SYMLINKAT=0;
+  GNULIB_TTYNAME_R=0;
+  GNULIB_UNISTD_H_GETOPT=0;
+  GNULIB_UNISTD_H_SIGPIPE=0;
+  GNULIB_UNLINK=0;
+  GNULIB_UNLINKAT=0;
+  GNULIB_USLEEP=0;
+  GNULIB_WRITE=0;
+    HAVE_CHOWN=1;
+  HAVE_DUP2=1;
+  HAVE_DUP3=1;
+  HAVE_EUIDACCESS=1;
+  HAVE_FACCESSAT=1;
+  HAVE_FCHDIR=1;
+  HAVE_FCHOWNAT=1;
+  HAVE_FSYNC=1;
+  HAVE_FTRUNCATE=1;
+  HAVE_GETDOMAINNAME=1;
+  HAVE_GETDTABLESIZE=1;
+  HAVE_GETGROUPS=1;
+  HAVE_GETHOSTNAME=1;
+  HAVE_GETLOGIN=1;
+  HAVE_GETPAGESIZE=1;
+  HAVE_LCHOWN=1;
+  HAVE_LINK=1;
+  HAVE_LINKAT=1;
+  HAVE_PIPE2=1;
+  HAVE_PREAD=1;
+  HAVE_PWRITE=1;
+  HAVE_READLINK=1;
+  HAVE_READLINKAT=1;
+  HAVE_SLEEP=1;
+  HAVE_SYMLINK=1;
+  HAVE_SYMLINKAT=1;
+  HAVE_TTYNAME_R=1;
+  HAVE_UNLINKAT=1;
+  HAVE_USLEEP=1;
+  HAVE_DECL_ENVIRON=1;
+  HAVE_DECL_GETLOGIN_R=1;
+  HAVE_DECL_GETPAGESIZE=1;
+  HAVE_DECL_GETUSERSHELL=1;
+  HAVE_OS_H=0;
+  HAVE_SYS_PARAM_H=0;
+  REPLACE_CHOWN=0;
+  REPLACE_CLOSE=0;
+  REPLACE_DUP=0;
+  REPLACE_DUP2=0;
+  REPLACE_FCHOWNAT=0;
+  REPLACE_GETCWD=0;
+  REPLACE_GETGROUPS=0;
+  REPLACE_GETPAGESIZE=0;
+  REPLACE_LCHOWN=0;
+  REPLACE_LINK=0;
+  REPLACE_LINKAT=0;
+  REPLACE_LSEEK=0;
+  REPLACE_PREAD=0;
+  REPLACE_PWRITE=0;
+  REPLACE_READLINK=0;
+  REPLACE_RMDIR=0;
+  REPLACE_SLEEP=0;
+  REPLACE_SYMLINK=0;
+  REPLACE_TTYNAME_R=0;
+  REPLACE_UNLINK=0;
+  REPLACE_UNLINKAT=0;
+  REPLACE_USLEEP=0;
+  REPLACE_WRITE=0;
+  UNISTD_H_HAVE_WINSOCK2_H=0;
+  UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking if environ is properly declared" >&5
+$as_echo_n "checking if environ is properly declared... " >&6; }
+  if test "${gt_cv_var_environ_declaration+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <unistd.h>
+           extern struct { int foo; } environ;
+int
+main ()
+{
+environ.foo = 1;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gt_cv_var_environ_declaration=no
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gt_cv_var_environ_declaration=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+  { $as_echo "$as_me:$LINENO: result: $gt_cv_var_environ_declaration" >&5
+$as_echo "$gt_cv_var_environ_declaration" >&6; }
+  if test $gt_cv_var_environ_declaration = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ENVIRON_DECL 1
+_ACEOF
+
+  fi
+
+
+  if test $gt_cv_var_environ_declaration != yes; then
+    HAVE_DECL_ENVIRON=0
+  fi
+
+
 
 
 
@@ -7312,6 +7871,9 @@ booboo
 #if !defined ENOTSUP
 booboo
 #endif
+#if !defined ESTALE
+booboo
+#endif
 #if !defined ECANCELED
 booboo
 #endif
@@ -7353,8 +7915,8 @@ if test "${gl_cv_next_errno_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_errno_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_errno_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7363,20 +7925,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <errno.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/errno.h#{
-                s#.*"\(.*/errno.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_errno_h='<'errno.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/errno.h#{
+                 s#.*"\(.*/errno.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_errno_h='<'errno.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_errno_h" >&5
@@ -7384,6 +7946,15 @@ $as_echo "$gl_cv_next_errno_h" >&6; }
      fi
      NEXT_ERRNO_H=$gl_cv_next_errno_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'errno.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_errno_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
+
 
 
     ERRNO_H='errno.h'
@@ -8663,101 +9234,113 @@ $as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
 
 
 
-
-  GNULIB_FPRINTF=0;
-  GNULIB_FPRINTF_POSIX=0;
-  GNULIB_PRINTF=0;
-  GNULIB_PRINTF_POSIX=0;
-  GNULIB_SNPRINTF=0;
-  GNULIB_SPRINTF_POSIX=0;
-  GNULIB_VFPRINTF=0;
-  GNULIB_VFPRINTF_POSIX=0;
-  GNULIB_VPRINTF=0;
-  GNULIB_VPRINTF_POSIX=0;
-  GNULIB_VSNPRINTF=0;
-  GNULIB_VSPRINTF_POSIX=0;
   GNULIB_DPRINTF=0;
-  GNULIB_VDPRINTF=0;
-  GNULIB_VASPRINTF=0;
-  GNULIB_OBSTACK_PRINTF=0;
-  GNULIB_OBSTACK_PRINTF_POSIX=0;
+  GNULIB_FCLOSE=0;
+  GNULIB_FFLUSH=0;
   GNULIB_FOPEN=0;
+  GNULIB_FPRINTF=0;
+  GNULIB_FPRINTF_POSIX=0;
+  GNULIB_FPURGE=0;
+  GNULIB_FPUTC=0;
+  GNULIB_FPUTS=0;
   GNULIB_FREOPEN=0;
   GNULIB_FSEEK=0;
   GNULIB_FSEEKO=0;
   GNULIB_FTELL=0;
   GNULIB_FTELLO=0;
-  GNULIB_FFLUSH=0;
-  GNULIB_FCLOSE=0;
-  GNULIB_FPUTC=0;
-  GNULIB_PUTC=0;
-  GNULIB_PUTCHAR=0;
-  GNULIB_FPUTS=0;
-  GNULIB_PUTS=0;
   GNULIB_FWRITE=0;
   GNULIB_GETDELIM=0;
   GNULIB_GETLINE=0;
+  GNULIB_OBSTACK_PRINTF=0;
+  GNULIB_OBSTACK_PRINTF_POSIX=0;
   GNULIB_PERROR=0;
+  GNULIB_POPEN=0;
+  GNULIB_PRINTF=0;
+  GNULIB_PRINTF_POSIX=0;
+  GNULIB_PUTC=0;
+  GNULIB_PUTCHAR=0;
+  GNULIB_PUTS=0;
+  GNULIB_REMOVE=0;
+  GNULIB_RENAME=0;
+  GNULIB_RENAMEAT=0;
+  GNULIB_SNPRINTF=0;
+  GNULIB_SPRINTF_POSIX=0;
   GNULIB_STDIO_H_SIGPIPE=0;
-    REPLACE_STDIO_WRITE_FUNCS=0;
-  REPLACE_FPRINTF=0;
-  REPLACE_VFPRINTF=0;
-  REPLACE_PRINTF=0;
-  REPLACE_VPRINTF=0;
-  REPLACE_SNPRINTF=0;
+  GNULIB_TMPFILE=0;
+  GNULIB_VASPRINTF=0;
+  GNULIB_VDPRINTF=0;
+  GNULIB_VFPRINTF=0;
+  GNULIB_VFPRINTF_POSIX=0;
+  GNULIB_VPRINTF=0;
+  GNULIB_VPRINTF_POSIX=0;
+  GNULIB_VSNPRINTF=0;
+  GNULIB_VSPRINTF_POSIX=0;
+    HAVE_DECL_FPURGE=1;
+  HAVE_DECL_GETDELIM=1;
+  HAVE_DECL_GETLINE=1;
+  HAVE_DECL_OBSTACK_PRINTF=1;
   HAVE_DECL_SNPRINTF=1;
-  REPLACE_VSNPRINTF=0;
   HAVE_DECL_VSNPRINTF=1;
-  REPLACE_SPRINTF=0;
-  REPLACE_VSPRINTF=0;
   HAVE_DPRINTF=1;
-  REPLACE_DPRINTF=0;
-  HAVE_VDPRINTF=1;
-  REPLACE_VDPRINTF=0;
+  HAVE_FSEEKO=1;
+  HAVE_FTELLO=1;
+  HAVE_RENAMEAT=1;
   HAVE_VASPRINTF=1;
-  REPLACE_VASPRINTF=0;
-  HAVE_DECL_OBSTACK_PRINTF=1;
-  REPLACE_OBSTACK_PRINTF=0;
+  HAVE_VDPRINTF=1;
+  REPLACE_DPRINTF=0;
+  REPLACE_FCLOSE=0;
+  REPLACE_FFLUSH=0;
   REPLACE_FOPEN=0;
+  REPLACE_FPRINTF=0;
+  REPLACE_FPURGE=0;
   REPLACE_FREOPEN=0;
-  HAVE_FSEEKO=1;
-  REPLACE_FSEEKO=0;
   REPLACE_FSEEK=0;
-  HAVE_FTELLO=1;
-  REPLACE_FTELLO=0;
+  REPLACE_FSEEKO=0;
   REPLACE_FTELL=0;
-  REPLACE_FFLUSH=0;
-  REPLACE_FCLOSE=0;
-  HAVE_DECL_GETDELIM=1;
-  HAVE_DECL_GETLINE=1;
+  REPLACE_FTELLO=0;
+  REPLACE_GETDELIM=0;
   REPLACE_GETLINE=0;
+  REPLACE_OBSTACK_PRINTF=0;
   REPLACE_PERROR=0;
+  REPLACE_POPEN=0;
+  REPLACE_PRINTF=0;
+  REPLACE_REMOVE=0;
+  REPLACE_RENAME=0;
+  REPLACE_RENAMEAT=0;
+  REPLACE_SNPRINTF=0;
+  REPLACE_SPRINTF=0;
+  REPLACE_STDIO_WRITE_FUNCS=0;
+  REPLACE_TMPFILE=0;
+  REPLACE_VASPRINTF=0;
+  REPLACE_VDPRINTF=0;
+  REPLACE_VFPRINTF=0;
+  REPLACE_VPRINTF=0;
+  REPLACE_VSNPRINTF=0;
+  REPLACE_VSPRINTF=0;
 
 
-    { $as_echo "$as_me:$LINENO: checking whether stdin defaults to large file offsets" >&5
-$as_echo_n "checking whether stdin defaults to large file offsets... " >&6; }
-if test "${gl_cv_var_stdin_large_offset+set}" = set; then
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking for fseeko" >&5
+$as_echo_n "checking for fseeko... " >&6; }
+if test "${gl_cv_func_fseeko+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <stdio.h>
+
 int
 main ()
 {
-#if defined __SL64 && defined __SCLE /* cygwin */
-  /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
-     fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, and
-     it is easier to do a version check than building a runtime test.  */
-# include <cygwin/version.h>
-# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
-  choke me
-# endif
-#endif
+fseeko (stdin, 0, 0);
   ;
   return 0;
 }
@@ -8783,181 +9366,26 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  gl_cv_var_stdin_large_offset=yes
+  gl_cv_func_fseeko=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       gl_cv_var_stdin_large_offset=no
+       gl_cv_func_fseeko=no
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_var_stdin_large_offset" >&5
-$as_echo "$gl_cv_var_stdin_large_offset" >&6; }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  GNULIB_CHOWN=0;
-  GNULIB_CLOSE=0;
-  GNULIB_DUP2=0;
-  GNULIB_ENVIRON=0;
-  GNULIB_EUIDACCESS=0;
-  GNULIB_FCHDIR=0;
-  GNULIB_FSYNC=0;
-  GNULIB_FTRUNCATE=0;
-  GNULIB_GETCWD=0;
-  GNULIB_GETDOMAINNAME=0;
-  GNULIB_GETDTABLESIZE=0;
-  GNULIB_GETHOSTNAME=0;
-  GNULIB_GETLOGIN_R=0;
-  GNULIB_GETPAGESIZE=0;
-  GNULIB_GETUSERSHELL=0;
-  GNULIB_LCHOWN=0;
-  GNULIB_LINK=0;
-  GNULIB_LSEEK=0;
-  GNULIB_READLINK=0;
-  GNULIB_SLEEP=0;
-  GNULIB_UNISTD_H_SIGPIPE=0;
-  GNULIB_WRITE=0;
-    HAVE_DUP2=1;
-  HAVE_EUIDACCESS=1;
-  HAVE_FSYNC=1;
-  HAVE_FTRUNCATE=1;
-  HAVE_GETDOMAINNAME=1;
-  HAVE_GETDTABLESIZE=1;
-  HAVE_GETHOSTNAME=1;
-  HAVE_GETPAGESIZE=1;
-  HAVE_GETUSERSHELL=1;
-  HAVE_LINK=1;
-  HAVE_READLINK=1;
-  HAVE_SLEEP=1;
-  HAVE_DECL_ENVIRON=1;
-  HAVE_DECL_GETLOGIN_R=1;
-  HAVE_OS_H=0;
-  HAVE_SYS_PARAM_H=0;
-  REPLACE_CHOWN=0;
-  REPLACE_CLOSE=0;
-  REPLACE_FCHDIR=0;
-  REPLACE_GETCWD=0;
-  REPLACE_GETPAGESIZE=0;
-  REPLACE_LCHOWN=0;
-  REPLACE_LSEEK=0;
-  REPLACE_WRITE=0;
-  UNISTD_H_HAVE_WINSOCK2_H=0;
-
-
-
-
-
-
-
-
-  GNULIB_SOCKET=0;
-  GNULIB_CONNECT=0;
-  GNULIB_ACCEPT=0;
-  GNULIB_BIND=0;
-  GNULIB_GETPEERNAME=0;
-  GNULIB_GETSOCKNAME=0;
-  GNULIB_GETSOCKOPT=0;
-  GNULIB_LISTEN=0;
-  GNULIB_RECV=0;
-  GNULIB_SEND=0;
-  GNULIB_RECVFROM=0;
-  GNULIB_SENDTO=0;
-  GNULIB_SETSOCKOPT=0;
-  GNULIB_SHUTDOWN=0;
-
-
-
-
-
-
-
-
-
-
 
-  { $as_echo "$as_me:$LINENO: checking whether <sys/socket.h> is self-contained" >&5
-$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
-if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/socket.h>
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  gl_cv_header_sys_socket_h_selfcontained=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       gl_cv_header_sys_socket_h_selfcontained=no
 fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_fseeko" >&5
+$as_echo "$gl_cv_func_fseeko" >&6; }
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
-$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
-  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
-    SYS_SOCKET_H=''
 
-for ac_func in shutdown
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+    { $as_echo "$as_me:$LINENO: checking whether stdin defaults to large file offsets" >&5
+$as_echo_n "checking whether stdin defaults to large file offsets... " >&6; }
+if test "${gl_cv_var_stdin_large_offset+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -8966,41 +9394,216 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
+#include <stdio.h>
 int
 main ()
 {
-return $ac_func ();
+#if defined __SL64 && defined __SCLE /* cygwin */
+  /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
+     fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, and
+     it is easier to do a version check than building a runtime test.  */
+# include <cygwin/version.h>
+# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
+  choke me
+# endif
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  gl_cv_var_stdin_large_offset=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_var_stdin_large_offset=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_var_stdin_large_offset" >&5
+$as_echo "$gl_cv_var_stdin_large_offset" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  GNULIB_SOCKET=0;
+  GNULIB_CONNECT=0;
+  GNULIB_ACCEPT=0;
+  GNULIB_BIND=0;
+  GNULIB_GETPEERNAME=0;
+  GNULIB_GETSOCKNAME=0;
+  GNULIB_GETSOCKOPT=0;
+  GNULIB_LISTEN=0;
+  GNULIB_RECV=0;
+  GNULIB_SEND=0;
+  GNULIB_RECVFROM=0;
+  GNULIB_SENDTO=0;
+  GNULIB_SETSOCKOPT=0;
+  GNULIB_SHUTDOWN=0;
+  GNULIB_ACCEPT4=0;
+  HAVE_STRUCT_SOCKADDR_STORAGE=1;
+  HAVE_SA_FAMILY_T=1;
+  HAVE_ACCEPT4=1;
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether <sys/socket.h> is self-contained" >&5
+$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
+if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/socket.h>
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_header_sys_socket_h_selfcontained=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_header_sys_socket_h_selfcontained=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
+$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
+  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+
+for ac_func in shutdown
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
   ;
   return 0;
 }
@@ -9109,10 +9712,9 @@ $as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
         SYS_SOCKET_H='sys/socket.h'
       fi
     fi
-  else
-    SYS_SOCKET_H='sys/socket.h'
   fi
-  if test -n "$SYS_SOCKET_H"; then
+  # We need to check for ws2tcpip.h now.
+
 
 
 
@@ -9134,8 +9736,8 @@ if test "${gl_cv_next_sys_socket_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_sys_socket_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_sys_socket_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9144,20 +9746,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <sys/socket.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_sys_socket_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/sys/socket.h#{
-                s#.*"\(.*/sys/socket.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_sys_socket_h='<'sys/socket.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_sys_socket_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/sys/socket.h#{
+                 s#.*"\(.*/sys/socket.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_socket_h" >&5
@@ -9165,13 +9767,22 @@ $as_echo "$gl_cv_next_sys_socket_h" >&6; }
      fi
      NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'sys/socket.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_socket_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
+
 
 
-    if test $ac_cv_header_sys_socket_h = yes; then
-      HAVE_SYS_SOCKET_H=1
-      HAVE_WS2TCPIP_H=0
-    else
-      HAVE_SYS_SOCKET_H=0
+  if test $ac_cv_header_sys_socket_h = yes; then
+    HAVE_SYS_SOCKET_H=1
+    HAVE_WS2TCPIP_H=0
+  else
+    HAVE_SYS_SOCKET_H=0
 
 for ac_header in ws2tcpip.h
 do
 
 done
 
-      if test $ac_cv_header_ws2tcpip_h = yes; then
-        HAVE_WS2TCPIP_H=1
-      else
-        HAVE_WS2TCPIP_H=0
-      fi
+    if test $ac_cv_header_ws2tcpip_h = yes; then
+      HAVE_WS2TCPIP_H=1
+    else
+      HAVE_WS2TCPIP_H=0
     fi
+  fi
+
+
+
+  { $as_echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5
+$as_echo_n "checking for struct sockaddr_storage... " >&6; }
+if test "${ac_cv_type_struct_sockaddr_storage+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_struct_sockaddr_storage=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+if (sizeof (struct sockaddr_storage))
+       return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+if (sizeof ((struct sockaddr_storage)))
+         return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_struct_sockaddr_storage=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_storage" >&5
+$as_echo "$ac_cv_type_struct_sockaddr_storage" >&6; }
+if test "x$ac_cv_type_struct_sockaddr_storage" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+_ACEOF
+
+
+fi
+{ $as_echo "$as_me:$LINENO: checking for sa_family_t" >&5
+$as_echo_n "checking for sa_family_t... " >&6; }
+if test "${ac_cv_type_sa_family_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_sa_family_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+if (sizeof (sa_family_t))
+       return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+if (sizeof ((sa_family_t)))
+         return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_sa_family_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5
+$as_echo "$ac_cv_type_sa_family_t" >&6; }
+if test "x$ac_cv_type_sa_family_t" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SA_FAMILY_T 1
+_ACEOF
+
+
+fi
+
+  if test $ac_cv_type_struct_sockaddr_storage = no; then
+    HAVE_STRUCT_SOCKADDR_STORAGE=0
+  fi
+  if test $ac_cv_type_sa_family_t = no; then
+    HAVE_SA_FAMILY_T=0
+  fi
 
 
 
@@ -9493,20 +10366,6 @@ done
 
 
 
-  fi
-
-
-
-  GNULIB_GETADDRINFO=0;
-    HAVE_STRUCT_ADDRINFO=1;
-  HAVE_DECL_FREEADDRINFO=1;
-  HAVE_DECL_GAI_STRERROR=1;
-  HAVE_DECL_GETADDRINFO=1;
-  HAVE_DECL_GETNAMEINFO=1;
-
-
-
-
 
 
 
@@ -9516,73 +10375,38 @@ done
 
 
 
-  :
-
 
 
 
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_netdb_h='<'netdb.h'>'
-     else
-       { $as_echo "$as_me:$LINENO: checking absolute name of <netdb.h>" >&5
-$as_echo_n "checking absolute name of <netdb.h>... " >&6; }
-if test "${gl_cv_next_netdb_h+set}" = set; then
+  for gl_func in socket connect accept bind getpeername getsockname getsockopt     listen recv send recvfrom sendto setsockopt shutdown accept4; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-
-         if test $ac_cv_header_netdb_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <netdb.h>
-
-_ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_netdb_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/netdb.h#{
-                s#.*"\(.*/netdb.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_netdb_h='<'netdb.h'>'
-         fi
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_netdb_h" >&5
-$as_echo "$gl_cv_next_netdb_h" >&6; }
-     fi
-     NEXT_NETDB_H=$gl_cv_next_netdb_h
-
-
-
-  if test $ac_cv_header_netdb_h = yes; then
-    cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-         #include <netdb.h>
-         struct addrinfo a;
-         int b = EAI_OVERFLOW;
-         int c = AI_NUMERICSERV;
+/* Some systems require prerequisite headers.  */
+#include <sys/types.h>
+#if !defined __GLIBC__ && HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <sys/select.h>
 
 int
 main ()
 {
-
+#undef $gl_func
+  (void) $gl_func;
   ;
   return 0;
 }
@@ -9605,24 +10429,200 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  NETDB_H=''
+  eval "$as_gl_Symbol=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       NETDB_H='netdb.h'
+       eval "$as_gl_Symbol=no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    HAVE_NETDB_H=1
-  else
-    NETDB_H='netdb.h'
-    HAVE_NETDB_H=0
-  fi
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
+
+
+
+  GNULIB_GETADDRINFO=0;
+    HAVE_STRUCT_ADDRINFO=1;
+  HAVE_DECL_FREEADDRINFO=1;
+  HAVE_DECL_GAI_STRERROR=1;
+  HAVE_DECL_GETADDRINFO=1;
+  HAVE_DECL_GETNAMEINFO=1;
+
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_netdb_h='<'netdb.h'>'
+     else
+       { $as_echo "$as_me:$LINENO: checking absolute name of <netdb.h>" >&5
+$as_echo_n "checking absolute name of <netdb.h>... " >&6; }
+if test "${gl_cv_next_netdb_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+          if test $ac_cv_header_netdb_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <netdb.h>
+
+_ACEOF
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_netdb_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/netdb.h#{
+                 s#.*"\(.*/netdb.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_netdb_h='<'netdb.h'>'
+          fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_netdb_h" >&5
+$as_echo "$gl_cv_next_netdb_h" >&6; }
+     fi
+     NEXT_NETDB_H=$gl_cv_next_netdb_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'netdb.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_netdb_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_NETDB_H=$gl_next_as_first_directive
+
+
+
+  if test $ac_cv_header_netdb_h = yes; then
+    HAVE_NETDB_H=1
+  else
+    HAVE_NETDB_H=0
+  fi
+
 
 
 
 
+
+
+  for gl_func in getaddrinfo freeaddrinfo gai_strerror getnameinfo; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <netdb.h>
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_gl_Symbol=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
+
+
+
                   HOSTENT_LIB=
   gl_saved_libs="$LIBS"
   { $as_echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
@@ -10266,6 +11266,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
 #endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
 int
 main ()
 {
@@ -10315,43 +11318,57 @@ _ACEOF
   fi
 
 
-  if test -z "$GETOPT_H"; then
 
-for ac_header in getopt.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+
+
+    :
+
+
+      gl_save_LIBS=$LIBS
+  { $as_echo "$as_me:$LINENO: checking for library containing inet_ntop" >&5
+$as_echo_n "checking for library containing inet_ntop... " >&6; }
+if test "${ac_cv_search_inet_ntop+set}" = set; then
   $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
+  ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntop ();
+int
+main ()
+{
+return inet_ntop ();
+  ;
+  return 0;
+}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+for ac_lib in '' nsl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -10360,115 +11377,50 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_search_inet_ntop=$ac_res
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_header_compiler=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+fi
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_inet_ntop+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_inet_ntop+set}" = set; then
+  :
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+  ac_cv_search_inet_ntop=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
 fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_inet_ntop" >&5
+$as_echo "$ac_cv_search_inet_ntop" >&6; }
+ac_res=$ac_cv_search_inet_ntop
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
+else
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-else
-  GETOPT_H=getopt.h
-fi
 
-done
 
-  fi
 
-  if test -z "$GETOPT_H"; then
 
-for ac_func in getopt_long_only
+
+for ac_func in inet_ntop
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -10566,16 +11518,27 @@ as_val=`eval 'as_val=${'$as_ac_var'}
 _ACEOF
 
 else
-  GETOPT_H=getopt.h
+
+    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
+
 fi
 done
 
+
+fi
+
+  LIBS=$gl_save_LIBS
+  INET_NTOP_LIB=
+  if test "$ac_cv_search_inet_ntop" != "no" &&
+     test "$ac_cv_search_inet_ntop" != "none required"; then
+    INET_NTOP_LIB="$ac_cv_search_inet_ntop"
   fi
 
-      if test -z "$GETOPT_H"; then
-    { $as_echo "$as_me:$LINENO: checking whether optreset is declared" >&5
-$as_echo_n "checking whether optreset is declared... " >&6; }
-if test "${ac_cv_have_decl_optreset+set}" = set; then
+
+
+  { $as_echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5
+$as_echo_n "checking whether inet_ntop is declared... " >&6; }
+if test "${ac_cv_have_decl_inet_ntop+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10584,13 +11547,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <getopt.h>
+#include <arpa/inet.h>
 
 int
 main ()
 {
-#ifndef optreset
-  (void) optreset;
+#ifndef inet_ntop
+  (void) inet_ntop;
 #endif
 
   ;
@@ -10615,37 +11578,74 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_optreset=yes
+  ac_cv_have_decl_inet_ntop=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_have_decl_optreset=no
+       ac_cv_have_decl_inet_ntop=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5
-$as_echo "$ac_cv_have_decl_optreset" >&6; }
-if test "x$ac_cv_have_decl_optreset" = x""yes; then
-  GETOPT_H=getopt.h
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_inet_ntop" >&5
+$as_echo "$ac_cv_have_decl_inet_ntop" >&6; }
+if test "x$ac_cv_have_decl_inet_ntop" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_NTOP 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_NTOP 0
+_ACEOF
+
+
 fi
 
+
+  if test $ac_cv_have_decl_inet_ntop = no; then
+    HAVE_DECL_INET_NTOP=0
   fi
 
-      if test -z "$GETOPT_H"; then
-    { $as_echo "$as_me:$LINENO: checking for working GNU getopt function" >&5
-$as_echo_n "checking for working GNU getopt function... " >&6; }
-if test "${gl_cv_func_gnu_getopt+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
-                        { $as_echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5
-$as_echo_n "checking whether getopt_clip is declared... " >&6; }
-if test "${ac_cv_have_decl_getopt_clip+set}" = set; then
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_getopt_h='<'getopt.h'>'
+     else
+       { $as_echo "$as_me:$LINENO: checking absolute name of <getopt.h>" >&5
+$as_echo_n "checking absolute name of <getopt.h>... " >&6; }
+if test "${gl_cv_next_getopt_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+          if test $ac_cv_header_getopt_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10653,16 +11653,82 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <getopt.h>
 
-int
-main ()
-{
-#ifndef getopt_clip
-  (void) getopt_clip;
-#endif
+_ACEOF
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_getopt_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/getopt.h#{
+                 s#.*"\(.*/getopt.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_getopt_h='<'getopt.h'>'
+          fi
 
-  ;
-  return 0;
-}
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_getopt_h" >&5
+$as_echo "$gl_cv_next_getopt_h" >&6; }
+     fi
+     NEXT_GETOPT_H=$gl_cv_next_getopt_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'getopt.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_getopt_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive
+
+
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_header_getopt_h = yes; then
+    HAVE_GETOPT_H=1
+  else
+    HAVE_GETOPT_H=0
+  fi
+
+
+  gl_replace_getopt=
+
+    if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+
+for ac_header in getopt.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -10682,94 +11748,119 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_getopt_clip=yes
+  ac_header_compiler=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_have_decl_getopt_clip=no
+       ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5
-$as_echo "$ac_cv_have_decl_getopt_clip" >&6; }
-if test "x$ac_cv_have_decl_getopt_clip" = x""yes; then
-  gl_cv_func_gnu_getopt=no
-else
-  gl_cv_func_gnu_getopt=yes
-fi
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
-else
-  cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <getopt.h>
-int
-main ()
-{
-
-            char *myargv[3];
-            myargv[0] = "conftest";
-            myargv[1] = "-+";
-            myargv[2] = 0;
-            return getopt (2, myargv, "+a") != '?';
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gl_cv_func_gnu_getopt=yes
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-gl_cv_func_gnu_getopt=no
+  ac_header_preproc=no
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
+else
+  gl_replace_getopt=yes
 fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5
-$as_echo "$gl_cv_func_gnu_getopt" >&6; }
-    if test "$gl_cv_func_gnu_getopt" = "no"; then
-      GETOPT_H=getopt.h
-    fi
+
+done
+
   fi
 
+    if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
 
-      { $as_echo "$as_me:$LINENO: checking whether getenv is declared" >&5
-$as_echo_n "checking whether getenv is declared... " >&6; }
-if test "${ac_cv_have_decl_getenv+set}" = set; then
+for ac_func in getopt_long_only
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10778,27 +11869,54 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-#ifndef getenv
-  (void) getenv;
-#endif
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -10807,109 +11925,44 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_getenv=yes
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_have_decl_getenv=no
+       eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5
-$as_echo "$ac_cv_have_decl_getenv" >&6; }
-if test "x$ac_cv_have_decl_getenv" = x""yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETENV 1
-_ACEOF
-
-
-else
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETENV 0
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  :
-
-
-
-
-
-
-
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_sys_time_h='<'sys/time.h'>'
-     else
-       { $as_echo "$as_me:$LINENO: checking absolute name of <sys/time.h>" >&5
-$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
-if test "${gl_cv_next_sys_time_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
 else
-
-         if test $ac_cv_header_sys_time_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/time.h>
-
-_ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/sys/time.h#{
-                s#.*"\(.*/sys/time.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_sys_time_h='<'sys/time.h'>'
-         fi
-
+  gl_replace_getopt=yes
 fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_time_h" >&5
-$as_echo "$gl_cv_next_sys_time_h" >&6; }
-     fi
-     NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
-
-
-
+done
 
-  if test $ac_cv_header_sys_time_h = yes; then
-    HAVE_SYS_TIME_H=1
-  else
-    HAVE_SYS_TIME_H=0
   fi
 
-
-  { $as_echo "$as_me:$LINENO: checking for struct timeval" >&5
-$as_echo_n "checking for struct timeval... " >&6; }
-if test "${gl_cv_sys_struct_timeval+set}" = set; then
+              if test -z "$gl_replace_getopt"; then
+    { $as_echo "$as_me:$LINENO: checking whether optreset is declared" >&5
+$as_echo_n "checking whether optreset is declared... " >&6; }
+if test "${ac_cv_have_decl_optreset+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10918,15 +11971,15 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#if HAVE_SYS_TIME_H
-            #include <sys/time.h>
-           #endif
-           #include <time.h>
+#include <getopt.h>
 
 int
 main ()
 {
-static struct timeval x; x.tv_sec = x.tv_usec;
+#ifndef optreset
+  (void) optreset;
+#endif
+
   ;
   return 0;
 }
@@ -10949,47 +12002,33 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  gl_cv_sys_struct_timeval=yes
+  ac_cv_have_decl_optreset=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       gl_cv_sys_struct_timeval=no
+       ac_cv_have_decl_optreset=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timeval" >&5
-$as_echo "$gl_cv_sys_struct_timeval" >&6; }
-  if test $gl_cv_sys_struct_timeval = yes; then
-    HAVE_STRUCT_TIMEVAL=1
-  else
-    HAVE_STRUCT_TIMEVAL=0
-  fi
-
-
-    REPLACE_GETTIMEOFDAY=0
-
-  if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then
-    SYS_TIME_H=sys/time.h
-  else
-    SYS_TIME_H=
-  fi
-
-
-
-
-
-
-
-
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5
+$as_echo "$ac_cv_have_decl_optreset" >&6; }
+if test "x$ac_cv_have_decl_optreset" = x""yes; then
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_OPTRESET 1
+_ACEOF
 
 
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_OPTRESET 0
+_ACEOF
 
-      { $as_echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5
-$as_echo_n "checking whether getc_unlocked is declared... " >&6; }
-if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5
+$as_echo_n "checking whether getopt_clip is declared... " >&6; }
+if test "${ac_cv_have_decl_getopt_clip+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10998,12 +12037,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+#include <getopt.h>
+
 int
 main ()
 {
-#ifndef getc_unlocked
-  (void) getc_unlocked;
+#ifndef getopt_clip
+  (void) getopt_clip;
 #endif
 
   ;
@@ -11028,28 +12068,28 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_getc_unlocked=yes
+  ac_cv_have_decl_getopt_clip=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_have_decl_getc_unlocked=no
+       ac_cv_have_decl_getopt_clip=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5
-$as_echo "$ac_cv_have_decl_getc_unlocked" >&6; }
-if test "x$ac_cv_have_decl_getc_unlocked" = x""yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5
+$as_echo "$ac_cv_have_decl_getopt_clip" >&6; }
+if test "x$ac_cv_have_decl_getopt_clip" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETC_UNLOCKED 1
+#define HAVE_DECL_GETOPT_CLIP 1
 _ACEOF
 
 
 else
   cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETC_UNLOCKED 0
+#define HAVE_DECL_GETOPT_CLIP 0
 _ACEOF
 
 
 
 
 
+fi
 
-    { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5
-$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; }
-if test "${ac_cv_gnu_library_2_1+set}" = set; then
+
+  fi
+
+                    if test -z "$gl_replace_getopt"; then
+    { $as_echo "$as_me:$LINENO: checking whether getopt is POSIX compatible" >&5
+$as_echo_n "checking whether getopt is POSIX compatible... " >&6; }
+if test "${gl_cv_func_getopt_posix+set}" = set; then
   $as_echo_n "(cached) " >&6
+else
+
+                if test "$cross_compiling" = yes; then
+  case "$host_os" in
+             mingw*)         gl_cv_func_getopt_posix="guessing no";;
+             darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
+             *)              gl_cv_func_getopt_posix="guessing yes";;
+           esac
+
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -11070,249 +12124,319 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-  Lucky GNU user
- #endif
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky GNU user" >/dev/null 2>&1; then
-  ac_cv_gnu_library_2_1=yes
-else
-  ac_cv_gnu_library_2_1=no
-fi
-rm -f conftest*
-
-
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5
-$as_echo "$ac_cv_gnu_library_2_1" >&6; }
+#if !HAVE_DECL_OPTRESET && !HAVE_DECL_GETOPT_CLIP
+# define OPTIND_MIN 0
+#else
+# define OPTIND_MIN 1
+#endif
 
-    GLIBC21="$ac_cv_gnu_library_2_1"
+int
+main ()
+{
+  {
+    int argc = 0;
+    char *argv[10];
+    int c;
+
+    argv[argc++] = "program";
+    argv[argc++] = "-a";
+    argv[argc++] = "foo";
+    argv[argc++] = "bar";
+    argv[argc] = NULL;
+    optind = OPTIND_MIN;
+    opterr = 0;
+
+    c = getopt (argc, argv, "ab");
+    if (!(c == 'a'))
+      return 1;
+    c = getopt (argc, argv, "ab");
+    if (!(c == -1))
+      return 2;
+    if (!(optind == 2))
+      return 3;
+  }
+  /* Some internal state exists at this point.  */
+  {
+    int argc = 0;
+    char *argv[10];
+    int c;
+
+    argv[argc++] = "program";
+    argv[argc++] = "donald";
+    argv[argc++] = "-p";
+    argv[argc++] = "billy";
+    argv[argc++] = "duck";
+    argv[argc++] = "-a";
+    argv[argc++] = "bar";
+    argv[argc] = NULL;
+    optind = OPTIND_MIN;
+    opterr = 0;
+
+    c = getopt (argc, argv, "+abp:q:");
+    if (!(c == -1))
+      return 4;
+    if (!(strcmp (argv[0], "program") == 0))
+      return 5;
+    if (!(strcmp (argv[1], "donald") == 0))
+      return 6;
+    if (!(strcmp (argv[2], "-p") == 0))
+      return 7;
+    if (!(strcmp (argv[3], "billy") == 0))
+      return 8;
+    if (!(strcmp (argv[4], "duck") == 0))
+      return 9;
+    if (!(strcmp (argv[5], "-a") == 0))
+      return 10;
+    if (!(strcmp (argv[6], "bar") == 0))
+      return 11;
+    if (!(optind == 1))
+      return 12;
+  }
+  /* Detect MacOS 10.5, AIX 7.1 bug.  */
+  {
+    char *argv[3] = { "program", "-ab", NULL };
+    optind = OPTIND_MIN;
+    opterr = 0;
+    if (getopt (2, argv, "ab:") != 'a')
+      return 13;
+    if (getopt (2, argv, "ab:") != '?')
+      return 14;
+    if (optopt != 'b')
+      return 15;
+    if (optind != 2)
+      return 16;
+  }
 
+  return 0;
+}
 
-
-      if test "X$prefix" = "XNONE"; then
-    acl_final_prefix="$ac_default_prefix"
-  else
-    acl_final_prefix="$prefix"
-  fi
-  if test "X$exec_prefix" = "XNONE"; then
-    acl_final_exec_prefix='${prefix}'
-  else
-    acl_final_exec_prefix="$exec_prefix"
-  fi
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
-  prefix="$acl_save_prefix"
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_getopt_posix=yes
 else
-  with_gnu_ld=no
-fi
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:$LINENO: checking for ld used by GCC" >&5
-$as_echo_n "checking for ld used by GCC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | [A-Za-z]:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if test "${acl_cv_path_LD+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
-      *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break ;;
-      *)
-       test "$with_gnu_ld" != yes && break ;;
-      esac
-    fi
-  done
-  IFS="$ac_save_ifs"
-else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+( exit $ac_status )
+gl_cv_func_getopt_posix=no
 fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:$LINENO: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if test "${acl_cv_prog_gnu_ld+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  acl_cv_prog_gnu_ld=yes ;;
-*)
-  acl_cv_prog_gnu_ld=no ;;
-esac
-fi
-{ $as_echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5
-$as_echo "$acl_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$acl_cv_prog_gnu_ld
 
 
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_getopt_posix" >&5
+$as_echo "$gl_cv_func_getopt_posix" >&6; }
+    case "$gl_cv_func_getopt_posix" in
+      *no) gl_replace_getopt=yes ;;
+    esac
+  fi
 
+  if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+    { $as_echo "$as_me:$LINENO: checking for working GNU getopt function" >&5
+$as_echo_n "checking for working GNU getopt function... " >&6; }
+if test "${gl_cv_func_getopt_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
+       # optstring is necessary for programs like m4 that have POSIX-mandated
+       # semantics for supporting options interspersed with files.
+       # Also, since getopt_long is a GNU extension, we require optind=0.
+       # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
+       # so take care to revert to the correct (non-)export state.
+       gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
+       case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
+         xx) gl_had_POSIXLY_CORRECT=exported ;;
+         x)  gl_had_POSIXLY_CORRECT=yes      ;;
+         *)  gl_had_POSIXLY_CORRECT=         ;;
+       esac
+       POSIXLY_CORRECT=1
+       export POSIXLY_CORRECT
+       if test "$cross_compiling" = yes; then
+           case $host_os:$ac_cv_have_decl_optreset in
+           *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
+           *:yes)               gl_cv_func_getopt_gnu=no;;
+           *)                   gl_cv_func_getopt_gnu=yes;;
+         esac
 
-                                                { $as_echo "$as_me:$LINENO: checking for shared library run path origin" >&5
-$as_echo_n "checking for shared library run path origin... " >&6; }
-if test "${acl_cv_rpath+set}" = set; then
-  $as_echo_n "(cached) " >&6
 else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <getopt.h>
+                           #include <stddef.h>
+                           #include <string.h>
 
-    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
-    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-    . ./conftest.sh
-    rm -f ./conftest.sh
-    acl_cv_rpath=done
+int
+main ()
+{
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5
-$as_echo "$acl_cv_rpath" >&6; }
-  wl="$acl_cv_wl"
-  libext="$acl_cv_libext"
-  shlibext="$acl_cv_shlibext"
-  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-  hardcode_direct="$acl_cv_hardcode_direct"
-  hardcode_minus_L="$acl_cv_hardcode_minus_L"
-    # Check whether --enable-rpath was given.
-if test "${enable_rpath+set}" = set; then
-  enableval=$enable_rpath; :
+             /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
+                and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+                OSF/1 5.1, Solaris 10.  */
+             {
+               char *myargv[3];
+               myargv[0] = "conftest";
+               myargv[1] = "-+";
+               myargv[2] = 0;
+               opterr = 0;
+               if (getopt (2, myargv, "+a") != '?')
+                 return 1;
+             }
+             /* This code succeeds on glibc 2.8, mingw,
+                and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+                IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
+             {
+               char *argv[] = { "program", "-p", "foo", "bar", NULL };
+
+               optind = 1;
+               if (getopt (4, argv, "p::") != 'p')
+                 return 2;
+               if (optarg != NULL)
+                 return 3;
+               if (getopt (4, argv, "p::") != -1)
+                 return 4;
+               if (optind != 2)
+                 return 5;
+             }
+             /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
+             {
+               char *argv[] = { "program", "foo", "-p", NULL };
+               optind = 0;
+               if (getopt (3, argv, "-p") != 1)
+                 return 6;
+               if (getopt (3, argv, "-p") != 'p')
+                 return 7;
+             }
+             /* This code fails on glibc 2.11.  */
+             {
+               char *argv[] = { "program", "-b", "-a", NULL };
+               optind = opterr = 0;
+               if (getopt (3, argv, "+:a:b") != 'b')
+                 return 8;
+               if (getopt (3, argv, "+:a:b") != ':')
+                 return 9;
+             }
+             return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_getopt_gnu=yes
 else
-  enable_rpath=yes
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_getopt_gnu=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
+       case $gl_had_POSIXLY_CORRECT in
+         exported) ;;
+         yes) $as_unset POSIXLY_CORRECT || test "${POSIXLY_CORRECT+set}" != set || { POSIXLY_CORRECT=; export POSIXLY_CORRECT; }; POSIXLY_CORRECT=1 ;;
+         *) $as_unset POSIXLY_CORRECT || test "${POSIXLY_CORRECT+set}" != set || { POSIXLY_CORRECT=; export POSIXLY_CORRECT; } ;;
+       esac
 
-                  acl_libdirstem=lib
-  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
-  if test -n "$searchpath"; then
-    acl_save_IFS="${IFS=       }"; IFS=":"
-    for searchdir in $searchpath; do
-      if test -d "$searchdir"; then
-        case "$searchdir" in
-          */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
-          *) searchdir=`cd "$searchdir" && pwd`
-             case "$searchdir" in
-               */lib64 ) acl_libdirstem=lib64 ;;
-             esac ;;
-        esac
-      fi
-    done
-    IFS="$acl_save_IFS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_getopt_gnu" >&5
+$as_echo "$gl_cv_func_getopt_gnu" >&6; }
+    if test "$gl_cv_func_getopt_gnu" = "no"; then
+      gl_replace_getopt=yes
+    fi
   fi
 
 
-
-  gl_threads_api=none
-  LIBTHREAD=
-  LTLIBTHREAD=
-  LIBMULTITHREAD=
-  LTLIBMULTITHREAD=
-  if test "$gl_use_threads" != no; then
-        { $as_echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5
-$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
-    gl_have_weak=no
-    cat >conftest.$ac_ext <<_ACEOF
+      { $as_echo "$as_me:$LINENO: checking whether getenv is declared" >&5
+$as_echo_n "checking whether getenv is declared... " >&6; }
+if test "${ac_cv_have_decl_getenv+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-extern void xyzzy ();
-#pragma weak xyzzy
+$ac_includes_default
 int
 main ()
 {
-xyzzy();
+#ifndef getenv
+  (void) getenv;
+#endif
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -11321,46 +12445,203 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  gl_have_weak=yes
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_getenv=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_have_decl_getenv=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5
+$as_echo "$ac_cv_have_decl_getenv" >&6; }
+if test "x$ac_cv_have_decl_getenv" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETENV 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETENV 0
+_ACEOF
+
 
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-    { $as_echo "$as_me:$LINENO: result: $gl_have_weak" >&5
-$as_echo "$gl_have_weak" >&6; }
-    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
-      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
-      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
-      if test "${ac_cv_header_pthread_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for pthread.h" >&5
-$as_echo_n "checking for pthread.h... " >&6; }
-if test "${ac_cv_header_pthread_h+set}" = set; then
+
+
+
+
+
+
+
+  if test -n "$gl_replace_getopt"; then
+
+
+
+  GETOPT_H=getopt.h
+
+cat >>confdefs.h <<\_ACEOF
+#define __GETOPT_PREFIX rpl_
+_ACEOF
+
+
+
+    GNULIB_UNISTD_H_GETOPT=1
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
+
+
+
+  :
+
+
+
+
+
+
+
+
+fi
+
+
+
+
+  GNULIB_GETTIMEOFDAY=0;
+    HAVE_GETTIMEOFDAY=1;
+  HAVE_STRUCT_TIMEVAL=1;
+  HAVE_SYS_TIME_H=1;
+  REPLACE_GETTIMEOFDAY=0;
+
+
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_time_h='<'sys/time.h'>'
+     else
+       { $as_echo "$as_me:$LINENO: checking absolute name of <sys/time.h>" >&5
+$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
+if test "${gl_cv_next_sys_time_h+set}" = set; then
   $as_echo_n "(cached) " >&6
+else
+
+          if test $ac_cv_header_sys_time_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/time.h>
+
+_ACEOF
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/sys/time.h#{
+                 s#.*"\(.*/sys/time.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_sys_time_h='<'sys/time.h'>'
+          fi
+
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
-$as_echo "$ac_cv_header_pthread_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_time_h" >&5
+$as_echo "$gl_cv_next_sys_time_h" >&6; }
+     fi
+     NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'sys/time.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_time_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
+
+
+
+
+  if test $ac_cv_header_sys_time_h != yes; then
+    HAVE_SYS_TIME_H=0
+  fi
+
+  { $as_echo "$as_me:$LINENO: checking for struct timeval" >&5
+$as_echo_n "checking for struct timeval... " >&6; }
+if test "${gl_cv_sys_struct_timeval+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking pthread.h usability" >&5
-$as_echo_n "checking pthread.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <pthread.h>
+#if HAVE_SYS_TIME_H
+             #include <sys/time.h>
+            #endif
+            #include <time.h>
+
+int
+main ()
+{
+static struct timeval x; x.tv_sec = x.tv_usec;
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -11380,126 +12661,181 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  gl_cv_sys_struct_timeval=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_header_compiler=no
+       gl_cv_sys_struct_timeval=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timeval" >&5
+$as_echo "$gl_cv_sys_struct_timeval" >&6; }
+  if test $gl_cv_sys_struct_timeval != yes; then
+    HAVE_STRUCT_TIMEVAL=0
+  fi
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking pthread.h presence" >&5
-$as_echo_n "checking pthread.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+
+
+  for gl_func in gettimeofday; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <pthread.h>
+
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <time.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+       eval "$as_gl_Symbol=no"
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: pthread.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: pthread.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for pthread.h" >&5
-$as_echo_n "checking for pthread.h... " >&6; }
-if test "${ac_cv_header_pthread_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_pthread_h=$ac_header_preproc
+                     eval ac_cv_have_decl_$gl_func=yes
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
-$as_echo "$ac_cv_header_pthread_h" >&6; }
 
-fi
-if test "x$ac_cv_header_pthread_h" = x""yes; then
-  gl_have_pthread_h=yes
-else
-  gl_have_pthread_h=no
-fi
+      done
 
 
-      if test "$gl_have_pthread_h" = yes; then
-        # Other possible tests:
-        #   -lpthreads (FSU threads, PCthreads)
-        #   -lgthreads
-        gl_have_pthread=
-        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
-        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
-        # the second one only in libpthread, and lock.c needs it.
-        cat >conftest.$ac_ext <<_ACEOF
+
+
+
+
+
+
+
+
+
+
+  GNULIB_NL_LANGINFO=0;
+    HAVE_NL_LANGINFO=1;
+  REPLACE_NL_LANGINFO=0;
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking for working fcntl.h" >&5
+$as_echo_n "checking for working fcntl.h... " >&6; }
+if test "${gl_cv_header_working_fcntl_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+  gl_cv_header_working_fcntl_h=cross-compiling
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <pthread.h>
+#include <sys/types.h>
+           #include <sys/stat.h>
+           #include <unistd.h>
+           #include <fcntl.h>
+           #ifndef O_NOATIME
+            #define O_NOATIME 0
+           #endif
+           #ifndef O_NOFOLLOW
+            #define O_NOFOLLOW 0
+           #endif
+           static int const constants[] =
+            {
+              O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
+              O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
+            };
+
 int
 main ()
 {
-pthread_mutex_lock((pthread_mutex_t*)0);
-           pthread_mutexattr_init((pthread_mutexattr_t*)0);
+
+            int status = !constants;
+            {
+              static char const sym[] = "conftest.sym";
+              if (symlink (".", sym) != 0
+                  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
+                status |= 32;
+              unlink (sym);
+            }
+            {
+              static char const file[] = "confdefs.h";
+              int fd = open (file, O_RDONLY | O_NOATIME);
+              char c;
+              struct stat st0, st1;
+              if (fd < 0
+                  || fstat (fd, &st0) != 0
+                  || sleep (1) != 0
+                  || read (fd, &c, 1) != 1
+                  || close (fd) != 0
+                  || stat (file, &st1) != 0
+                  || st0.st_atime != st1.st_atime)
+                status |= 64;
+            }
+            return status;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f conftest$ac_exeext
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -11507,73 +12843,96 @@ case "(($ac_try" in
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  gl_have_pthread=yes
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_header_working_fcntl_h=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+case $? in #(
+        32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+        64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
+        96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+         *) gl_cv_header_working_fcntl_h='no';;
+        esac
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
 
 fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_working_fcntl_h" >&5
+$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
-        # since it is defined as a macro on OSF/1.)
-        if test -n "$gl_have_pthread"; then
-          # The program links fine without libpthread. But it may actually
-          # need to link with libpthread in order to create multiple threads.
-          { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5
-$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
-if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then
+  case $gl_cv_header_working_fcntl_h in #(
+  *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+  *) ac_val=1;;
+  esac
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WORKING_O_NOATIME $ac_val
+_ACEOF
+
+
+  case $gl_cv_header_working_fcntl_h in #(
+  *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+  *) ac_val=1;;
+  esac
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WORKING_O_NOFOLLOW $ac_val
+_ACEOF
+
+
+
+      { $as_echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5
+$as_echo_n "checking whether getc_unlocked is declared... " >&6; }
+if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_kill ();
+$ac_includes_default
 int
 main ()
 {
-return pthread_kill ();
+#ifndef getc_unlocked
+  (void) getc_unlocked;
+#endif
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -11582,69 +12941,282 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_pthread_pthread_kill=yes
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_getc_unlocked=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_pthread_pthread_kill=no
+       ac_cv_have_decl_getc_unlocked=no
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5
-$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then
-  LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
-             # On Solaris and HP-UX, most pthread functions exist also in libc.
-             # Therefore pthread_in_use() needs to actually try to create a
-             # thread: pthread_create from libc will fail, whereas
-             # pthread_create will actually create a thread.
-             case "$host_os" in
-               solaris* | hpux*)
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5
+$as_echo "$ac_cv_have_decl_getc_unlocked" >&6; }
+if test "x$ac_cv_have_decl_getc_unlocked" = x""yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define PTHREAD_IN_USE_DETECTION_HARD 1
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETC_UNLOCKED 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETC_UNLOCKED 0
 _ACEOF
 
-             esac
 
 fi
 
-        else
-          # Some library is needed. Try libpthread and libc_r.
-          { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5
-$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
-if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then
+
+
+
+    { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5
+$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; }
+if test "${ac_cv_gnu_library_2_1+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+  Lucky GNU user
+ #endif
 #endif
-char pthread_kill ();
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Lucky GNU user" >/dev/null 2>&1; then
+  ac_cv_gnu_library_2_1=yes
+else
+  ac_cv_gnu_library_2_1=no
+fi
+rm -f conftest*
+
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5
+$as_echo "$ac_cv_gnu_library_2_1" >&6; }
+
+    GLIBC21="$ac_cv_gnu_library_2_1"
+
+
+
+      if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+$as_echo_n "checking for ld used by GCC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${acl_cv_path_LD+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      acl_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break ;;
+      *)
+       test "$with_gnu_ld" != yes && break ;;
+      esac
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${acl_cv_prog_gnu_ld+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  acl_cv_prog_gnu_ld=yes ;;
+*)
+  acl_cv_prog_gnu_ld=no ;;
+esac
+fi
+{ $as_echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5
+$as_echo "$acl_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$acl_cv_prog_gnu_ld
+
+
+
+
+                                                { $as_echo "$as_me:$LINENO: checking for shared library run path origin" >&5
+$as_echo_n "checking for shared library run path origin... " >&6; }
+if test "${acl_cv_rpath+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+    . ./conftest.sh
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5
+$as_echo "$acl_cv_rpath" >&6; }
+  wl="$acl_cv_wl"
+  libext="$acl_cv_libext"
+  shlibext="$acl_cv_shlibext"
+  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  hardcode_direct="$acl_cv_hardcode_direct"
+  hardcode_minus_L="$acl_cv_hardcode_minus_L"
+    # Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then
+  enableval=$enable_rpath; :
+else
+  enable_rpath=yes
+fi
+
+
+
+                  acl_libdirstem=lib
+  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+  if test -n "$searchpath"; then
+    acl_save_IFS="${IFS=       }"; IFS=":"
+    for searchdir in $searchpath; do
+      if test -d "$searchdir"; then
+        case "$searchdir" in
+          */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+          *) searchdir=`cd "$searchdir" && pwd`
+             case "$searchdir" in
+               */lib64 ) acl_libdirstem=lib64 ;;
+             esac ;;
+        esac
+      fi
+    done
+    IFS="$acl_save_IFS"
+  fi
+
+
+
+  gl_threads_api=none
+  LIBTHREAD=
+  LTLIBTHREAD=
+  LIBMULTITHREAD=
+  LTLIBMULTITHREAD=
+  if test "$gl_use_threads" != no; then
+        { $as_echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5
+$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
+if test "${gl_cv_have_weak+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  gl_cv_have_weak=no
+              cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+extern void xyzzy ();
+#pragma weak xyzzy
 int
 main ()
 {
-return pthread_kill ();
+xyzzy();
   ;
   return 0;
 }
@@ -11670,59 +13242,55 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_pthread_pthread_kill=yes
+  gl_cv_have_weak=maybe
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_pthread_pthread_kill=no
+
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5
-$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then
-  gl_have_pthread=yes
-             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
-             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+       if test $gl_cv_have_weak = maybe; then
+                           if test "$cross_compiling" = yes; then
+                          cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __ELF__
+               Extensible Linking Format
+               #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Extensible Linking Format" >/dev/null 2>&1; then
+  gl_cv_have_weak="guessing yes"
+else
+  gl_cv_have_weak="guessing no"
 fi
+rm -f conftest*
+
 
-          if test -z "$gl_have_pthread"; then
-            # For FreeBSD 4.
-            { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5
-$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
-if test "${ac_cv_lib_c_r_pthread_kill+set}" = set; then
-  $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc_r  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_kill ();
-int
-main ()
+#include <stdio.h>
+#pragma weak fputs
+int main ()
 {
-return pthread_kill ();
-  ;
-  return 0;
+  return (fputs == NULL);
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f conftest$ac_exeext
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -11730,23 +13298,448 @@ case "(($ac_try" in
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_c_r_pthread_kill=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_have_weak=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_have_weak=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+       fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_have_weak" >&5
+$as_echo "$gl_cv_have_weak" >&6; }
+    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
+      if test "${ac_cv_header_pthread_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for pthread.h" >&5
+$as_echo_n "checking for pthread.h... " >&6; }
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+$as_echo "$ac_cv_header_pthread_h" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking pthread.h usability" >&5
+$as_echo_n "checking pthread.h usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <pthread.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking pthread.h presence" >&5
+$as_echo_n "checking pthread.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: pthread.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: pthread.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for pthread.h" >&5
+$as_echo_n "checking for pthread.h... " >&6; }
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_header_pthread_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+$as_echo "$ac_cv_header_pthread_h" >&6; }
+
+fi
+if test "x$ac_cv_header_pthread_h" = x""yes; then
+  gl_have_pthread_h=yes
+else
+  gl_have_pthread_h=no
+fi
+
+
+      if test "$gl_have_pthread_h" = yes; then
+        # Other possible tests:
+        #   -lpthreads (FSU threads, PCthreads)
+        #   -lgthreads
+        gl_have_pthread=
+        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+        # the second one only in libpthread, and lock.c needs it.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+pthread_mutex_lock((pthread_mutex_t*)0);
+               pthread_mutexattr_init((pthread_mutexattr_t*)0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  gl_have_pthread=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+        # since it is defined as a macro on OSF/1.)
+        if test -n "$gl_have_pthread"; then
+          # The program links fine without libpthread. But it may actually
+          # need to link with libpthread in order to create multiple threads.
+          { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_pthread_pthread_kill=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_pthread_pthread_kill=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then
+  LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+             # On Solaris and HP-UX, most pthread functions exist also in libc.
+             # Therefore pthread_in_use() needs to actually try to create a
+             # thread: pthread_create from libc will fail, whereas
+             # pthread_create will actually create a thread.
+             case "$host_os" in
+               solaris* | hpux*)
+
+cat >>confdefs.h <<\_ACEOF
+#define PTHREAD_IN_USE_DETECTION_HARD 1
+_ACEOF
+
+             esac
+
+fi
+
+        else
+          # Some library is needed. Try libpthread and libc_r.
+          { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_pthread_pthread_kill=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_pthread_pthread_kill=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then
+  gl_have_pthread=yes
+             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
+             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+fi
+
+          if test -z "$gl_have_pthread"; then
+            # For FreeBSD 4.
+            { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5
+$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
+if test "${ac_cv_lib_c_r_pthread_kill+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_c_r_pthread_kill=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
        ac_cv_lib_c_r_pthread_kill=no
 fi
@@ -11774,7 +13767,7 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
           if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
-            if test $gl_have_weak = yes; then
+            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
 
 cat >>confdefs.h <<\_ACEOF
 #define USE_POSIX_THREADS_WEAK 1
@@ -11798,8 +13791,10 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+
 #include <thread.h>
 #include <synch.h>
+
 int
 main ()
 {
@@ -11852,7 +13847,7 @@ cat >>confdefs.h <<\_ACEOF
 #define USE_SOLARIS_THREADS 1
 _ACEOF
 
-          if test $gl_have_weak = yes; then
+          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
 
 cat >>confdefs.h <<\_ACEOF
 #define USE_SOLARIS_THREADS_WEAK 1
@@ -12358,7 +14353,7 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
         if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
-          if test $gl_have_weak = yes; then
+          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
 
 cat >>confdefs.h <<\_ACEOF
 #define USE_PTH_THREADS_WEAK 1
@@ -12403,11 +14398,38 @@ $as_echo "$gl_threads_api" >&6; }
 
 
 
+     GNULIB_FCHMODAT=0;
+  GNULIB_FSTATAT=0;
+  GNULIB_FUTIMENS=0;
   GNULIB_LCHMOD=0;
   GNULIB_LSTAT=0;
-    HAVE_LCHMOD=1;
+  GNULIB_MKDIRAT=0;
+  GNULIB_MKFIFO=0;
+  GNULIB_MKFIFOAT=0;
+  GNULIB_MKNOD=0;
+  GNULIB_MKNODAT=0;
+  GNULIB_STAT=0;
+  GNULIB_UTIMENSAT=0;
+    HAVE_FCHMODAT=1;
+  HAVE_FSTATAT=1;
+  HAVE_FUTIMENS=1;
+  HAVE_LCHMOD=1;
+  HAVE_LSTAT=1;
+  HAVE_MKDIRAT=1;
+  HAVE_MKFIFO=1;
+  HAVE_MKFIFOAT=1;
+  HAVE_MKNOD=1;
+  HAVE_MKNODAT=1;
+  HAVE_UTIMENSAT=1;
+  REPLACE_FSTAT=0;
+  REPLACE_FSTATAT=0;
+  REPLACE_FUTIMENS=0;
   REPLACE_LSTAT=0;
   REPLACE_MKDIR=0;
+  REPLACE_MKFIFO=0;
+  REPLACE_MKNOD=0;
+  REPLACE_STAT=0;
+  REPLACE_UTIMENSAT=0;
 
 
 
@@ -12415,87 +14437,143 @@ $as_echo "$gl_threads_api" >&6; }
 
 
 
-
-  { $as_echo "$as_me:$LINENO: checking whether malloc, realloc, calloc are POSIX compliant" >&5
-$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
-if test "${gl_cv_func_malloc_posix+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
+$as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; }
+if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-
-                        cat >conftest.$ac_ext <<_ACEOF
+  rm -f conftest.sym conftest.file
+echo >conftest.file
+if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_lstat_dereferences_slashed_symlink=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+$ac_includes_default
 int
 main ()
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-         choke me
-         #endif
-
+struct stat sbuf;
+     /* Linux will dereference the symlink and fail.
+       That is better in the sense that it means we will not
+       have to compile and use the lstat wrapper.  */
+     return lstat ("conftest.sym/", &sbuf) == 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  gl_cv_func_malloc_posix=yes
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_lstat_dereferences_slashed_symlink=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       gl_cv_func_malloc_posix=no
+( exit $ac_status )
+ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+else
+  # If the `ln -s' command failed, then we probably don't even
+  # have an lstat function.
+  ac_cv_func_lstat_dereferences_slashed_symlink=no
 fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_malloc_posix" >&5
-$as_echo "$gl_cv_func_malloc_posix" >&6; }
+rm -f conftest.sym conftest.file
 
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
+$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
 
-  GNULIB_MALLOC_POSIX=0;
-  GNULIB_REALLOC_POSIX=0;
-  GNULIB_CALLOC_POSIX=0;
-  GNULIB_ATOLL=0;
-  GNULIB_GETLOADAVG=0;
-  GNULIB_GETSUBOPT=0;
+test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+
+cat >>confdefs.h <<_ACEOF
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+_ACEOF
+
+
+if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
+
+fi
+
+
+  GNULIB__EXIT=0;
+  GNULIB_ATOLL=0;
+  GNULIB_CALLOC_POSIX=0;
+  GNULIB_CANONICALIZE_FILE_NAME=0;
+  GNULIB_GETLOADAVG=0;
+  GNULIB_GETSUBOPT=0;
+  GNULIB_GRANTPT=0;
+  GNULIB_MALLOC_POSIX=0;
   GNULIB_MKDTEMP=0;
+  GNULIB_MKOSTEMP=0;
+  GNULIB_MKOSTEMPS=0;
   GNULIB_MKSTEMP=0;
+  GNULIB_MKSTEMPS=0;
+  GNULIB_PTSNAME=0;
   GNULIB_PUTENV=0;
   GNULIB_RANDOM_R=0;
+  GNULIB_REALLOC_POSIX=0;
+  GNULIB_REALPATH=0;
   GNULIB_RPMATCH=0;
   GNULIB_SETENV=0;
   GNULIB_STRTOD=0;
   GNULIB_STRTOLL=0;
   GNULIB_STRTOULL=0;
+  GNULIB_UNLOCKPT=0;
   GNULIB_UNSETENV=0;
-    HAVE_ATOLL=1;
-  HAVE_CALLOC_POSIX=1;
+    HAVE__EXIT=1;
+  HAVE_ATOLL=1;
+  HAVE_CANONICALIZE_FILE_NAME=1;
+  HAVE_DECL_GETLOADAVG=1;
   HAVE_GETSUBOPT=1;
-  HAVE_MALLOC_POSIX=1;
+  HAVE_GRANTPT=1;
   HAVE_MKDTEMP=1;
-  HAVE_REALLOC_POSIX=1;
+  HAVE_MKOSTEMP=1;
+  HAVE_MKOSTEMPS=1;
+  HAVE_MKSTEMP=1;
+  HAVE_MKSTEMPS=1;
+  HAVE_PTSNAME=1;
   HAVE_RANDOM_R=1;
+  HAVE_REALPATH=1;
   HAVE_RPMATCH=1;
   HAVE_SETENV=1;
   HAVE_STRTOD=1;
@@ -12503,12 +14581,75 @@ $as_echo "$gl_cv_func_malloc_posix" >&6; }
   HAVE_STRTOULL=1;
   HAVE_STRUCT_RANDOM_DATA=1;
   HAVE_SYS_LOADAVG_H=0;
+  HAVE_UNLOCKPT=1;
   HAVE_UNSETENV=1;
-  HAVE_DECL_GETLOADAVG=1;
+  REPLACE_CALLOC=0;
+  REPLACE_CANONICALIZE_FILE_NAME=0;
+  REPLACE_MALLOC=0;
   REPLACE_MKSTEMP=0;
   REPLACE_PUTENV=0;
+  REPLACE_REALLOC=0;
+  REPLACE_REALPATH=0;
+  REPLACE_SETENV=0;
   REPLACE_STRTOD=0;
-  VOID_UNSETENV=0;
+  REPLACE_UNSETENV=0;
+
+
+  { $as_echo "$as_me:$LINENO: checking whether malloc, realloc, calloc are POSIX compliant" >&5
+$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
+if test "${gl_cv_func_malloc_posix+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+                        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+             choke me
+             #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_func_malloc_posix=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_func_malloc_posix=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_malloc_posix" >&5
+$as_echo "$gl_cv_func_malloc_posix" >&6; }
 
 
 
@@ -12524,7 +14665,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#          include <wchar.h>
+#           include <wchar.h>
 int
 main ()
 {
@@ -12904,6 +15045,555 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+  GNULIB_MEMCHR=0;
+  GNULIB_MEMMEM=0;
+  GNULIB_MEMPCPY=0;
+  GNULIB_MEMRCHR=0;
+  GNULIB_RAWMEMCHR=0;
+  GNULIB_STPCPY=0;
+  GNULIB_STPNCPY=0;
+  GNULIB_STRCHRNUL=0;
+  GNULIB_STRDUP=0;
+  GNULIB_STRNCAT=0;
+  GNULIB_STRNDUP=0;
+  GNULIB_STRNLEN=0;
+  GNULIB_STRPBRK=0;
+  GNULIB_STRSEP=0;
+  GNULIB_STRSTR=0;
+  GNULIB_STRCASESTR=0;
+  GNULIB_STRTOK_R=0;
+  GNULIB_MBSLEN=0;
+  GNULIB_MBSNLEN=0;
+  GNULIB_MBSCHR=0;
+  GNULIB_MBSRCHR=0;
+  GNULIB_MBSSTR=0;
+  GNULIB_MBSCASECMP=0;
+  GNULIB_MBSNCASECMP=0;
+  GNULIB_MBSPCASECMP=0;
+  GNULIB_MBSCASESTR=0;
+  GNULIB_MBSCSPN=0;
+  GNULIB_MBSPBRK=0;
+  GNULIB_MBSSPN=0;
+  GNULIB_MBSSEP=0;
+  GNULIB_MBSTOK_R=0;
+  GNULIB_STRERROR=0;
+  GNULIB_STRSIGNAL=0;
+  GNULIB_STRVERSCMP=0;
+  HAVE_MBSLEN=0;
+    HAVE_MEMCHR=1;
+  HAVE_DECL_MEMMEM=1;
+  HAVE_MEMPCPY=1;
+  HAVE_DECL_MEMRCHR=1;
+  HAVE_RAWMEMCHR=1;
+  HAVE_STPCPY=1;
+  HAVE_STPNCPY=1;
+  HAVE_STRCHRNUL=1;
+  HAVE_DECL_STRDUP=1;
+  HAVE_DECL_STRNDUP=1;
+  HAVE_DECL_STRNLEN=1;
+  HAVE_STRPBRK=1;
+  HAVE_STRSEP=1;
+  HAVE_STRCASESTR=1;
+  HAVE_DECL_STRTOK_R=1;
+  HAVE_DECL_STRSIGNAL=1;
+  HAVE_STRVERSCMP=1;
+  REPLACE_MEMCHR=0;
+  REPLACE_MEMMEM=0;
+  REPLACE_STPNCPY=0;
+  REPLACE_STRDUP=0;
+  REPLACE_STRSTR=0;
+  REPLACE_STRCASESTR=0;
+  REPLACE_STRERROR=0;
+  REPLACE_STRNCAT=0;
+  REPLACE_STRNDUP=0;
+  REPLACE_STRNLEN=0;
+  REPLACE_STRSIGNAL=0;
+  REPLACE_STRTOK_R=0;
+  UNDEFINE_STRTOK_R=0;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
+  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
+  # irrelevant for anonymous mappings.
+  { $as_echo "$as_me:$LINENO: checking for mmap" >&5
+$as_echo_n "checking for mmap... " >&6; }
+if test "${ac_cv_func_mmap+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define mmap to an innocuous variant, in case <limits.h> declares mmap.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define mmap innocuous_mmap
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char mmap (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef mmap
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char mmap ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_mmap || defined __stub___mmap
+choke me
+#endif
+
+int
+main ()
+{
+return mmap ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_mmap=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_mmap=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap" >&5
+$as_echo "$ac_cv_func_mmap" >&6; }
+if test "x$ac_cv_func_mmap" = x""yes; then
+  gl_have_mmap=yes
+else
+  gl_have_mmap=no
+fi
+
+
+  # Try to allow MAP_ANONYMOUS.
+  gl_have_mmap_anonymous=no
+  if test $gl_have_mmap = yes; then
+    { $as_echo "$as_me:$LINENO: checking for MAP_ANONYMOUS" >&5
+$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+    I cant identify this map.
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "I cant identify this map." >/dev/null 2>&1; then
+  gl_have_mmap_anonymous=yes
+fi
+rm -f conftest*
+
+    if test $gl_have_mmap_anonymous != yes; then
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <sys/mman.h>
+#ifdef MAP_ANON
+    I cant identify this map.
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "I cant identify this map." >/dev/null 2>&1; then
+
+cat >>confdefs.h <<\_ACEOF
+#define MAP_ANONYMOUS MAP_ANON
+_ACEOF
+
+         gl_have_mmap_anonymous=yes
+fi
+rm -f conftest*
+
+    fi
+    { $as_echo "$as_me:$LINENO: result: $gl_have_mmap_anonymous" >&5
+$as_echo "$gl_have_mmap_anonymous" >&6; }
+    if test $gl_have_mmap_anonymous = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MAP_ANONYMOUS 1
+_ACEOF
+
+    fi
+  fi
+
+
+  :
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_func_memchr = yes; then
+    # Detect platform-specific bugs in some versions of glibc:
+    # memchr should not dereference anything with length 0
+    #   http://bugzilla.redhat.com/499689
+    # memchr should not dereference overestimated length after a match
+    #   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+    #   http://sourceware.org/bugzilla/show_bug.cgi?id=10162
+    # Assume that memchr works on platforms that lack mprotect.
+    { $as_echo "$as_me:$LINENO: checking whether memchr works" >&5
+$as_echo_n "checking whether memchr works... " >&6; }
+if test "${gl_cv_func_memchr_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+         gl_cv_func_memchr_works="guessing no"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <string.h>
+#if HAVE_SYS_MMAN_H
+# include <fcntl.h>
+# include <unistd.h>
+# include <sys/types.h>
+# include <sys/mman.h>
+# ifndef MAP_FILE
+#  define MAP_FILE 0
+# endif
+#endif
+
+int
+main ()
+{
+
+  char *fence = NULL;
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+# if HAVE_MAP_ANONYMOUS
+  const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
+  const int fd = -1;
+# else /* !HAVE_MAP_ANONYMOUS */
+  const int flags = MAP_FILE | MAP_PRIVATE;
+  int fd = open ("/dev/zero", O_RDONLY, 0666);
+  if (fd >= 0)
+# endif
+    {
+      int pagesize = getpagesize ();
+      char *two_pages =
+        (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
+                       flags, fd, 0);
+      if (two_pages != (char *)(-1)
+          && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
+        fence = two_pages + pagesize;
+    }
+#endif
+  if (fence)
+    {
+      if (memchr (fence, 0, 0))
+        return 1;
+      strcpy (fence - 9, "12345678");
+      if (memchr (fence - 9, 0, 79) != fence - 1)
+        return 2;
+    }
+  return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_memchr_works=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_memchr_works=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_memchr_works" >&5
+$as_echo "$gl_cv_func_memchr_works" >&6; }
+    if test "$gl_cv_func_memchr_works" != yes; then
+      REPLACE_MEMCHR=1
+    fi
+  else
+    HAVE_MEMCHR=0
+  fi
+  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
+
+
+
+for ac_header in bp-sym.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+  fi
+
+
     gl_cv_c_multiarch=no
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -12978,6 +15668,11 @@ _ACEOF
 
 
 
+
+
+
+
+
 { $as_echo "$as_me:$LINENO: checking for external symbol _system_configuration" >&5
 $as_echo_n "checking for external symbol _system_configuration... " >&6; }
 if test "${gl_cv_var__system_configuration+set}" = set; then
@@ -12995,7 +15690,7 @@ int
 main ()
 {
 double x = _system_configuration.physmem;
-                       if (x > 0.0) return 0;
+                        if (x > 0.0) return 0;
   ;
   return 0;
 }
@@ -13086,7 +15781,7 @@ int
 main ()
 {
 int x = sizeof (ssize_t *) + sizeof (ssize_t);
-        return !x;
+            return !x;
   ;
   return 0;
 }
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
-$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if test "${ac_cv_header_stdbool_h+set}" = set; then
+
+    { $as_echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5
+$as_echo_n "checking whether system is Windows or MSDOS... " >&6; }
+if test "${ac_cv_win_or_dos+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-         #include <stdbool.h>
-         #ifndef bool
-          "error: bool is not defined"
-         #endif
-         #ifndef false
-          "error: false is not defined"
-         #endif
-         #if false
-          "error: false is not 0"
-         #endif
-         #ifndef true
-          "error: true is not defined"
-         #endif
-         #if true != 1
-          "error: true is not 1"
-         #endif
-         #ifndef __bool_true_false_are_defined
-          "error: __bool_true_false_are_defined is not defined"
-         #endif
-
-         struct s { _Bool s: 1; _Bool t; } s;
-
-         char a[true == 1 ? 1 : -1];
-         char b[false == 0 ? 1 : -1];
-         char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-         char d[(bool) 0.5 == true ? 1 : -1];
-         bool e = &s;
-         char f[(_Bool) 0.0 == false ? 1 : -1];
-         char g[true];
-         char h[sizeof (_Bool)];
-         char i[sizeof s.t];
-         enum { j = false, k = true, l = false * true, m = true * 256 };
-         _Bool n[m];
-         char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-         char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-         #if defined __xlc__ || defined __GNUC__
-          /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-             reported by James Lemley on 2005-10-05; see
-             http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-             This test is not quite right, since xlc is allowed to
-             reject this program, as the initializer for xlcbug is
-             not one of the forms that C requires support for.
-             However, doing the test right would require a run-time
-             test, and that would make cross-compilation harder.
-             Let us hope that IBM fixes the xlc bug, and also adds
-             support for this kind of constant expression.  In the
-             meantime, this test will reject xlc, which is OK, since
-             our stdbool.h substitute should suffice.  We also test
-             this with GCC, where it should work, to detect more
-             quickly whether someone messes up the test in the
-             future.  */
-          char digs[] = "0123456789";
-          int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-         #endif
-         /* Catch a bug in an HP-UX C compiler.  See
-            http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-            http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-          */
-         _Bool q = true;
-         _Bool *pq = &q;
-
 int
 main ()
 {
 
-         *pq |= q;
-         *pq |= ! q;
-         /* Refer to every declared value, to avoid compiler optimizations.  */
-         return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-                 + !m + !n + !o + !p + !q + !pq);
-
+#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
+neither MSDOS nor Windows
+#endif
   ;
   return 0;
 }
@@ -13305,31 +15938,224 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_header_stdbool_h=yes
+  ac_cv_win_or_dos=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_header_stdbool_h=no
+       ac_cv_win_or_dos=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
-$as_echo "$ac_cv_header_stdbool_h" >&6; }
-   { $as_echo "$as_me:$LINENO: checking for _Bool" >&5
-$as_echo_n "checking for _Bool... " >&6; }
-if test "${ac_cv_type__Bool+set}" = set; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5
+$as_echo "$ac_cv_win_or_dos" >&6; }
+
+    if test x"$ac_cv_win_or_dos" = xyes; then
+      ac_fs_accepts_drive_letter_prefix=1
+      ac_fs_backslash_is_file_name_separator=1
+      { $as_echo "$as_me:$LINENO: checking whether drive letter can start relative path" >&5
+$as_echo_n "checking whether drive letter can start relative path... " >&6; }
+if test "${ac_cv_drive_letter_can_be_relative+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_type__Bool=no
-cat >conftest.$ac_ext <<_ACEOF
+
+          cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+int
+main ()
+{
+
+#if defined __CYGWIN__
+drive letters are always absolute
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_drive_letter_can_be_relative=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_drive_letter_can_be_relative=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_drive_letter_can_be_relative" >&5
+$as_echo "$ac_cv_drive_letter_can_be_relative" >&6; }
+      if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
+        ac_fs_drive_letter_can_be_relative=1
+      else
+        ac_fs_drive_letter_can_be_relative=0
+      fi
+    else
+      ac_fs_accepts_drive_letter_prefix=0
+      ac_fs_backslash_is_file_name_separator=0
+      ac_fs_drive_letter_can_be_relative=0
+    fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix
+_ACEOF
+
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE $ac_fs_drive_letter_can_be_relative
+_ACEOF
+
+
+{ $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if test "${ac_cv_header_stdbool_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+             #include <stdbool.h>
+             #ifndef bool
+              "error: bool is not defined"
+             #endif
+             #ifndef false
+              "error: false is not defined"
+             #endif
+             #if false
+              "error: false is not 0"
+             #endif
+             #ifndef true
+              "error: true is not defined"
+             #endif
+             #if true != 1
+              "error: true is not 1"
+             #endif
+             #ifndef __bool_true_false_are_defined
+              "error: __bool_true_false_are_defined is not defined"
+             #endif
+
+             struct s { _Bool s: 1; _Bool t; } s;
+
+             char a[true == 1 ? 1 : -1];
+             char b[false == 0 ? 1 : -1];
+             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+             char d[(bool) 0.5 == true ? 1 : -1];
+             /* See body of main program for 'e'.  */
+             char f[(_Bool) 0.0 == false ? 1 : -1];
+             char g[true];
+             char h[sizeof (_Bool)];
+             char i[sizeof s.t];
+             enum { j = false, k = true, l = false * true, m = true * 256 };
+             /* The following fails for
+                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+             _Bool n[m];
+             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+             /* Catch a bug in an HP-UX C compiler.  See
+                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+              */
+             _Bool q = true;
+             _Bool *pq = &q;
+
+int
+main ()
+{
+
+             bool e = &s;
+             *pq |= q;
+             *pq |= ! q;
+             /* Refer to every declared value, to avoid compiler optimizations.  */
+             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                     + !m + !n + !o + !p + !q + !pq);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdbool_h=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdbool_h=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+   { $as_echo "$as_me:$LINENO: checking for _Bool" >&5
+$as_echo_n "checking for _Bool... " >&6; }
+if test "${ac_cv_type__Bool+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type__Bool=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
 int
 main ()
 {
@@ -13428,6 +16254,77 @@ _ACEOF
 
    fi
 
+    REPLACE_NULL=0;
+  HAVE_WCHAR_T=1;
+  STDDEF_H='';
+
+
+  { $as_echo "$as_me:$LINENO: checking for wchar_t" >&5
+$as_echo_n "checking for wchar_t... " >&6; }
+if test "${gt_cv_c_wchar_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+       wchar_t foo = (wchar_t)'\0';
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gt_cv_c_wchar_t=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gt_cv_c_wchar_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5
+$as_echo "$gt_cv_c_wchar_t" >&6; }
+  if test $gt_cv_c_wchar_t = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WCHAR_T 1
+_ACEOF
+
+  fi
+
+
+
+
+
+
+
+
   { $as_echo "$as_me:$LINENO: checking for long long int" >&5
 $as_echo_n "checking for long long int... " >&6; }
 if test "${ac_cv_type_long_long_int+set}" = set; then
@@ -13441,18 +16338,18 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 /* For now, do not test the preprocessor; as of 2007 there are too many
-        implementations with broken preprocessors.  Perhaps this can
-        be revisited in 2012.  In the meantime, code should not expect
-        #if to work with literals wider than 32 bits.  */
+         implementations with broken preprocessors.  Perhaps this can
+         be revisited in 2012.  In the meantime, code should not expect
+         #if to work with literals wider than 32 bits.  */
       /* Test literals.  */
       long long int ll = 9223372036854775807ll;
       long long int nll = -9223372036854775807LL;
       unsigned long long int ull = 18446744073709551615ULL;
       /* Test constant expressions.   */
       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                    ? 1 : -1)];
+                     ? 1 : -1)];
       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                    ? 1 : -1)];
+                     ? 1 : -1)];
       int i = 63;
 int
 main ()
@@ -13461,9 +16358,9 @@ main ()
       long long int llmax = 9223372036854775807ll;
       unsigned long long int ullmax = 18446744073709551615ull;
       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-             | (llmax / ll) | (llmax % ll)
-             | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-             | (ullmax / ull) | (ullmax % ull));
+              | (llmax / ll) | (llmax % ll)
+              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+              | (ullmax / ull) | (ullmax % ull));
   ;
   return 0;
 }
@@ -13490,7 +16387,7 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-                       if test "$cross_compiling" = yes; then
+                          if test "$cross_compiling" = yes; then
   ac_cv_type_long_long_int=yes
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13500,25 +16397,25 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <limits.h>
-              #ifndef LLONG_MAX
-              # define HALF \
-                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-              # define LLONG_MAX (HALF - 1 + HALF)
-              #endif
+               #ifndef LLONG_MAX
+               # define HALF \
+                        (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+               # define LLONG_MAX (HALF - 1 + HALF)
+               #endif
 int
 main ()
 {
 long long int n = 1;
-              int i;
-              for (i = 0; ; i++)
-                {
-                  long long int m = n << i;
-                  if (m >> i != n)
-                    return 1;
-                  if (LLONG_MAX / 2 < m)
-                    break;
-                }
-              return 0;
+               int i;
+               for (i = 0; ; i++)
+                 {
+                   long long int m = n << i;
+                   if (m >> i != n)
+                     return 1;
+                   if (LLONG_MAX / 2 < m)
+                     break;
+                 }
+               return 0;
   ;
   return 0;
 }
@@ -13594,18 +16491,18 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 /* For now, do not test the preprocessor; as of 2007 there are too many
-        implementations with broken preprocessors.  Perhaps this can
-        be revisited in 2012.  In the meantime, code should not expect
-        #if to work with literals wider than 32 bits.  */
+         implementations with broken preprocessors.  Perhaps this can
+         be revisited in 2012.  In the meantime, code should not expect
+         #if to work with literals wider than 32 bits.  */
       /* Test literals.  */
       long long int ll = 9223372036854775807ll;
       long long int nll = -9223372036854775807LL;
       unsigned long long int ull = 18446744073709551615ULL;
       /* Test constant expressions.   */
       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                    ? 1 : -1)];
+                     ? 1 : -1)];
       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                    ? 1 : -1)];
+                     ? 1 : -1)];
       int i = 63;
 int
 main ()
@@ -13614,9 +16511,9 @@ main ()
       long long int llmax = 9223372036854775807ll;
       unsigned long long int ullmax = 18446744073709551615ull;
       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-             | (llmax / ll) | (llmax % ll)
-             | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-             | (ullmax / ull) | (ullmax % ull));
+              | (llmax / ll) | (llmax % ll)
+              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+              | (ullmax / ull) | (ullmax % ull));
   ;
   return 0;
 }
@@ -13678,8 +16575,73 @@ _ACEOF
 
 
 
+        { $as_echo "$as_me:$LINENO: checking whether C symbols are prefixed with underscore at the linker level" >&5
+$as_echo_n "checking whether C symbols are prefixed with underscore at the linker level... " >&6; }
+if test "${gl_cv_prog_as_underscore+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" int foo (void);
+#endif
+int foo(void) { return 0; }
+EOF
+     # Look for the assembly language name in the .s file.
+     { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null 2>&1
+     if grep _foo conftest.s >/dev/null ; then
+       gl_cv_prog_as_underscore=yes
+     else
+       gl_cv_prog_as_underscore=no
+     fi
+     rm -f conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_prog_as_underscore" >&5
+$as_echo "$gl_cv_prog_as_underscore" >&6; }
+  if test $gl_cv_prog_as_underscore = yes; then
+    USER_LABEL_PREFIX=_
+  else
+    USER_LABEL_PREFIX=
+  fi
+
+cat >>confdefs.h <<_ACEOF
+#define USER_LABEL_PREFIX $USER_LABEL_PREFIX
+_ACEOF
+
+  ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
+
+
+
+
+
+  :
 
 
 
@@ -13687,6 +16649,143 @@ _ACEOF
 
 
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_string_h='<'string.h'>'
+     else
+       { $as_echo "$as_me:$LINENO: checking absolute name of <string.h>" >&5
+$as_echo_n "checking absolute name of <string.h>... " >&6; }
+if test "${gl_cv_next_string_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+          if test $ac_cv_header_string_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/string.h#{
+                 s#.*"\(.*/string.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_string_h='<'string.h'>'
+          fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_string_h" >&5
+$as_echo "$gl_cv_next_string_h" >&6; }
+     fi
+     NEXT_STRING_H=$gl_cv_next_string_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'string.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_string_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  for gl_func in memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup      strncat strndup strnlen strpbrk strsep strcasestr strtok_r strsignal      strverscmp; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_gl_Symbol=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
 
 
 { $as_echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
@@ -14121,6 +17220,19 @@ rm -rf conftest*
 fi
 
 
+  GNULIB_MKTIME=0;
+  GNULIB_NANOSLEEP=0;
+  GNULIB_STRPTIME=0;
+  GNULIB_TIMEGM=0;
+  GNULIB_TIME_R=0;
+    HAVE_LOCALTIME_R=1;
+  HAVE_NANOSLEEP=1;
+  HAVE_STRPTIME=1;
+  HAVE_TIMEGM=1;
+        REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
+  REPLACE_MKTIME=GNULIB_PORTCHECK;
+  REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
+  REPLACE_TIMEGM=GNULIB_PORTCHECK;
 
 
 
 
 
 
+  :
 
 
 
-  { $as_echo "$as_me:$LINENO: checking for wchar_t" >&5
-$as_echo_n "checking for wchar_t... " >&6; }
-if test "${gt_cv_c_wchar_t+set}" = set; then
+
+
+  { $as_echo "$as_me:$LINENO: checking for struct timespec in <time.h>" >&5
+$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
+if test "${gl_cv_sys_struct_timespec_in_time_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -14144,12 +17259,70 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stddef.h>
-       wchar_t foo = (wchar_t)'\0';
+#include <time.h>
+
 int
 main ()
 {
+static struct timespec x; x.tv_sec = x.tv_nsec;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_sys_struct_timespec_in_time_h=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_sys_struct_timespec_in_time_h=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
+
+  TIME_H_DEFINES_STRUCT_TIMESPEC=0
+  SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+  PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
+  if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
+    TIME_H_DEFINES_STRUCT_TIMESPEC=1
+  else
+    { $as_echo "$as_me:$LINENO: checking for struct timespec in <sys/time.h>" >&5
+$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
+if test "${gl_cv_sys_struct_timespec_in_sys_time_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/time.h>
 
+int
+main ()
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
   ;
   return 0;
 }
@@ -14172,27 +17345,162 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  gt_cv_c_wchar_t=yes
+  gl_cv_sys_struct_timespec_in_sys_time_h=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       gt_cv_c_wchar_t=no
+       gl_cv_sys_struct_timespec_in_sys_time_h=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5
-$as_echo "$gt_cv_c_wchar_t" >&6; }
-  if test $gt_cv_c_wchar_t = yes; then
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
+    if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
+      SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+    else
+      { $as_echo "$as_me:$LINENO: checking for struct timespec in <pthread.h>" >&5
+$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
+if test "${gl_cv_sys_struct_timespec_in_pthread_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WCHAR_T 1
+int
+main ()
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_sys_struct_timespec_in_pthread_h=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_sys_struct_timespec_in_pthread_h=no
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
+      if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+        PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+      fi
+    fi
   fi
 
 
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_time_h='<'time.h'>'
+     else
+       { $as_echo "$as_me:$LINENO: checking absolute name of <time.h>" >&5
+$as_echo_n "checking absolute name of <time.h>... " >&6; }
+if test "${gl_cv_next_time_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+          if test $ac_cv_header_time_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <time.h>
+
+_ACEOF
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/time.h#{
+                 s#.*"\(.*/time.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_time_h='<'time.h'>'
+          fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_time_h" >&5
+$as_echo "$gl_cv_next_time_h" >&6; }
+     fi
+     NEXT_TIME_H=$gl_cv_next_time_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'time.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_time_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
   { $as_echo "$as_me:$LINENO: checking for wint_t" >&5
 $as_echo_n "checking for wint_t... " >&6; }
 if test "${gt_cv_c_wint_t+set}" = set; then
@@ -14558,13 +17866,383 @@ _ACEOF
 
 
 
+     { $as_echo "$as_me:$LINENO: checking whether snprintf returns a byte count as in C99" >&5
+$as_echo_n "checking whether snprintf returns a byte count as in C99... " >&6; }
+if test "${gl_cv_func_snprintf_retval_c99+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+      if test "$cross_compiling" = yes; then
+
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
+           darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_snprintf_retval_c99="guessing no";;
+           openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.6.
+           solaris2.[0-5]*)      gl_cv_func_snprintf_retval_c99="guessing no";;
+           solaris*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
+           aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_snprintf_retval_c99="guessing no";;
+           netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
+         esac
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+int main ()
+{
+  strcpy (buf, "ABCDEF");
+  if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+    return 1;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_snprintf_retval_c99=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_snprintf_retval_c99=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_snprintf_retval_c99" >&5
+$as_echo "$gl_cv_func_snprintf_retval_c99" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+      { $as_echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5
+$as_echo_n "checking whether _snprintf is declared... " >&6; }
+if test "${ac_cv_have_decl__snprintf+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdio.h>
+
+int
+main ()
+{
+#ifndef _snprintf
+  (void) _snprintf;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl__snprintf=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl__snprintf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5
+$as_echo "$ac_cv_have_decl__snprintf" >&6; }
+if test "x$ac_cv_have_decl__snprintf" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__SNPRINTF 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__SNPRINTF 0
+_ACEOF
+
+
+fi
+
+
+
+  case "$gl_cv_func_snprintf_retval_c99" in
+    *yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SNPRINTF_RETVAL_C99 1
+_ACEOF
+
+      ;;
+  esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+      { $as_echo "$as_me:$LINENO: checking whether iswblank is declared" >&5
+$as_echo_n "checking whether iswblank is declared... " >&6; }
+if test "${ac_cv_have_decl_iswblank+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef iswblank
+  (void) iswblank;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_iswblank=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_have_decl_iswblank=no
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_iswblank" >&5
+$as_echo "$ac_cv_have_decl_iswblank" >&6; }
+if test "x$ac_cv_have_decl_iswblank" = x""yes; then
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISWBLANK 1
+_ACEOF
 
 
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISWBLANK 0
+_ACEOF
 
 
+fi
 
 
 
@@ -14584,6 +18262,7 @@ else
 fi
 
   gl_cond_libtool=true
+  gl_m4_base='config/gnulib'
 
 
 
@@ -14594,8 +18273,8 @@ fi
 
 
   gl_source_base='gnulib'
-LTALLOCA=`echo "$ALLOCA" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
-
+  # Code from module alignof:
+  # Code from module alloca-opt:
 
 
 
@@ -14652,6 +18331,8 @@ _ACEOF
   fi
 
 
+  # Code from module arg-nonnull:
+  # Code from module arpa_inet:
 
 
 
@@ -14665,7 +18346,6 @@ _ACEOF
   if test $ac_cv_header_arpa_inet_h = yes; then
     HAVE_ARPA_INET_H=1
   else
-    ARPA_INET_H='arpa/inet.h'
     HAVE_ARPA_INET_H=0
   fi
 
@@ -14690,8 +18370,8 @@ if test "${gl_cv_next_arpa_inet_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_arpa_inet_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_arpa_inet_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14700,20 +18380,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <arpa/inet.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_arpa_inet_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/arpa/inet.h#{
-                s#.*"\(.*/arpa/inet.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_arpa_inet_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/arpa/inet.h#{
+                 s#.*"\(.*/arpa/inet.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_arpa_inet_h" >&5
@@ -14721,30 +18401,116 @@ $as_echo "$gl_cv_next_arpa_inet_h" >&6; }
      fi
      NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'arpa/inet.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
+
 
 
 
-  { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
-  if test "${ac_cv_path_mkdir+set}" = set; then
+
+
+
+  for gl_func in inet_ntop inet_pton; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_prog in mkdir gmkdir; do
-        for ac_exec_ext in '' $ac_executable_extensions; do
-          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
-          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
-            'mkdir (GNU coreutils) '* | \
-            'mkdir (coreutils) '* | \
-            'mkdir (fileutils) '4.1*)
-              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
-              break 3;;
-          esac
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* On some systems, this header is not self-consistent.  */
+#ifndef __GLIBC__
+# include <sys/socket.h>
+#endif
+#include <arpa/inet.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_gl_Symbol=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
+
+
+  { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
         done
        done
 done
 $as_echo "$MKDIR_P" >&6; }
 
 
+  # Code from module base64:
 
 
 
 
 
 
+  # Code from module btowc:
+
+
+
 
 
 
@@ -14788,7 +18559,82 @@ $as_echo "$MKDIR_P" >&6; }
 
 
 
-         { $as_echo "$as_me:$LINENO: checking whether btowc(EOF) is correct" >&5
+
+        { $as_echo "$as_me:$LINENO: checking whether btowc(0) is correct" >&5
+$as_echo_n "checking whether btowc(0) is correct... " >&6; }
+if test "${gl_cv_func_btowc_nul+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+        if test "$cross_compiling" = yes; then
+
+           case "$host_os" in
+                      # Guess no on Cygwin.
+             cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+                      # Guess yes otherwise.
+             *)       gl_cv_func_btowc_nul="guessing yes" ;;
+           esac
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (btowc ('\0') != 0)
+    return 1;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_btowc_nul=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_btowc_nul=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_btowc_nul" >&5
+$as_echo "$gl_cv_func_btowc_nul" >&6; }
+
+        { $as_echo "$as_me:$LINENO: checking whether btowc(EOF) is correct" >&5
 $as_echo_n "checking whether btowc(EOF) is correct... " >&6; }
 if test "${gl_cv_func_btowc_eof+set}" = set; then
   $as_echo_n "(cached) " >&6
@@ -14802,13 +18648,7 @@ else
         esac
         if test $LOCALE_FR != none; then
           if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+  :
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_func_btowc_eof" >&5
 $as_echo "$gl_cv_func_btowc_eof" >&6; }
+
+    case "$gl_cv_func_btowc_nul" in
+      *yes) ;;
+      *) REPLACE_BTOWC=1 ;;
+    esac
     case "$gl_cv_func_btowc_eof" in
       *yes) ;;
       *) REPLACE_BTOWC=1 ;;
@@ -14879,8 +18724,7 @@ $as_echo "$gl_cv_func_btowc_eof" >&6; }
   fi
   if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
 
-
-  WCHAR_H=wchar.h
+    :
 
 
 
@@ -14899,10 +18743,40 @@ $as_echo "$gl_cv_func_btowc_eof" >&6; }
 
 
 
+
   GNULIB_BTOWC=1
 
 
 
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_BTOWC 1
+_ACEOF
+
+
+
+  # Code from module c++defs:
+  # Code from module c-ctype:
+  # Code from module configmake:
+  # Code from module environ:
+
+
+
+
+  GNULIB_ENVIRON=1
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_ENVIRON 1
+_ACEOF
+
+
+
+  # Code from module errno:
+
+  # Code from module extensions:
+  # Code from module float:
+
 
 
   FLOAT_H=
@@ -14930,8 +18804,8 @@ if test "${gl_cv_next_float_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_float_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_float_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14940,20 +18814,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <float.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/float.h#{
-                s#.*"\(.*/float.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_float_h='<'float.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/float.h#{
+                 s#.*"\(.*/float.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_float_h='<'float.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_float_h" >&5
@@ -14961,78 +18835,36 @@ $as_echo "$gl_cv_next_float_h" >&6; }
      fi
      NEXT_FLOAT_H=$gl_cv_next_float_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'float.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_float_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
+
 
 
       ;;
   esac
 
 
+  # Code from module fseeko:
 
 
 
 
 
+  if test $gl_cv_func_fseeko = no; then
+    HAVE_FSEEKO=0
 
 
-  { $as_echo "$as_me:$LINENO: checking for fseeko" >&5
-$as_echo_n "checking for fseeko... " >&6; }
-if test "${gl_cv_func_fseeko+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-fseeko (stdin, 0, 0);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  gl_cv_func_fseeko=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       gl_cv_func_fseeko=no
-fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  if test $gl_cv_func_fseeko = yes; then
+    REPLACE_FSEEKO=1
+  fi
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_fseeko" >&5
-$as_echo "$gl_cv_func_fseeko" >&6; }
-  if test $gl_cv_func_fseeko = no; then
-    HAVE_FSEEKO=0
 
 
 
@@ -15040,15 +18872,18 @@ $as_echo "$gl_cv_func_fseeko" >&6; }
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS fseeko.$ac_objext"
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fseeko.$ac_objext"
 
+  else
+    if test $gl_cv_var_stdin_large_offset = no; then
 
-  REPLACE_FSEEKO=1
 
-  elif test $gl_cv_var_stdin_large_offset = no; then
 
+  if test $gl_cv_func_fseeko = yes; then
+    REPLACE_FSEEKO=1
+  fi
 
 
 
@@ -15060,16 +18895,26 @@ $as_echo "$gl_cv_func_fseeko" >&6; }
   gl_LIBOBJS="$gl_LIBOBJS fseeko.$ac_objext"
 
 
-  REPLACE_FSEEKO=1
 
+    fi
   fi
 
 
 
+
   GNULIB_FSEEKO=1
 
 
 
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_FSEEKO 1
+_ACEOF
+
+
+
+  # Code from module fsusage:
+
+
   :
 
 
@@ -15164,7 +19009,8 @@ ac_fsusage_space=no
 # systems.  That system is reported to work fine with STAT_STATFS4 which
 # is what it gets when this test fails.
 if test $ac_fsusage_space = no; then
-  # SVR4
+  # glibc/{Hurd,kFreeBSD}, MacOS X >= 10.4, FreeBSD >= 5.0, NetBSD >= 3.0,
+  # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS.
   { $as_echo "$as_me:$LINENO: checking for statvfs function (SVR4)" >&5
 $as_echo_n "checking for statvfs function (SVR4)... " >&6; }
 if test "${fu_cv_sys_stat_statvfs+set}" = set; then
@@ -15322,9 +19168,14 @@ _ACEOF
 fi
 
 if test $ac_fsusage_space = no; then
-# AIX
-  { $as_echo "$as_me:$LINENO: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5
-$as_echo_n "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)... " >&6; }
+  # glibc/Linux, MacOS X < 10.4, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4.
+  # (glibc/{Hurd,kFreeBSD}, MacOS X >= 10.4, FreeBSD >= 5.0, NetBSD >= 3.0,
+  # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.)
+  # (On IRIX you need to include <sys/statfs.h>, not only <sys/mount.h> and
+  # <sys/vfs.h>.)
+  # (On Solaris, statfs has 4 arguments.)
+  { $as_echo "$as_me:$LINENO: checking for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)" >&5
+$as_echo_n "checking for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)... " >&6; }
   if test "${fu_cv_sys_stat_statfs2_bsize+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
@@ -15406,7 +19257,8 @@ _ACEOF
 fi
 
 if test $ac_fsusage_space = no; then
-# SVR3
+  # SVR3
+  # (Solaris already handled above.)
   { $as_echo "$as_me:$LINENO: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5
 $as_echo_n "checking for four-argument statfs (AIX-3.2.5, SVR3)... " >&6; }
   if test "${fu_cv_sys_stat_statfs4+set}" = set; then
@@ -15421,6 +19273,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+
 #include <sys/types.h>
 #include <sys/statfs.h>
   int
@@ -15481,9 +19334,13 @@ _ACEOF
 fi
 
 if test $ac_fsusage_space = no; then
-# 4.4BSD and NetBSD
-  { $as_echo "$as_me:$LINENO: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5
-$as_echo_n "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)... " >&6; }
+  # 4.4BSD and older NetBSD
+  # (OSF/1 already handled above.)
+  # (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.)
+  # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in
+  # <sys/mount.h>.)
+  { $as_echo "$as_me:$LINENO: checking for two-argument statfs with statfs.f_fsize member (4.4BSD and NetBSD)" >&5
+$as_echo_n "checking for two-argument statfs with statfs.f_fsize member (4.4BSD and NetBSD)... " >&6; }
   if test "${fu_cv_sys_stat_statfs2_fsize+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
@@ -15496,6 +19353,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
@@ -15577,6 +19435,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
@@ -15648,6 +19507,7 @@ fi
 
 if test $ac_fsusage_space = no; then
   # SVR2
+  # (AIX, HP-UX, OSF/1 already handled above.)
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -15679,7 +19539,7 @@ cat >>confdefs.h <<\_ACEOF
 #define STAT_READ_FILSYS 1
 _ACEOF
 
-    ac_fsusage_space=yes
+     ac_fsusage_space=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -15881,7 +19741,7 @@ int
 main ()
 {
 struct statfs t; long c = *(t.f_spare);
-      if (c) return 0;
+        if (c) return 0;
   ;
   return 0;
 }
@@ -15928,6 +19788,7 @@ $as_echo "$fu_cv_sys_truncating_statfs" >&6; }
 
   fi
 
+  # Code from module ftello:
 
 
 
 $as_echo "$gl_cv_func_ftello" >&6; }
   if test $gl_cv_func_ftello = no; then
     HAVE_FTELLO=0
+  else
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FTELLO=1
+    else
 
+      { $as_echo "$as_me:$LINENO: checking whether ftello works" >&5
+$as_echo_n "checking whether ftello works... " >&6; }
+if test "${gl_cv_func_ftello_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
 
+                              case "$host_os" in
+                      # Guess no on Solaris.
+            solaris*) gl_cv_func_ftello_works="guessing no" ;;
+                      # Guess yes otherwise.
+            *)        gl_cv_func_ftello_works="guessing yes" ;;
+          esac
+          if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define TESTFILE "conftest.tmp"
+int
+main (void)
+{
+  FILE *fp;
+
+  /* Create a file with some contents.  */
+  fp = fopen (TESTFILE, "w");
+  if (fp == NULL)
+    return 70;
+  if (fwrite ("foogarsh", 1, 8, fp) < 8)
+    return 71;
+  if (fclose (fp))
+    return 72;
+
+  /* The file's contents is now "foogarsh".  */
+
+  /* Try writing after reading to EOF.  */
+  fp = fopen (TESTFILE, "r+");
+  if (fp == NULL)
+    return 73;
+  if (fseek (fp, -1, SEEK_END))
+    return 74;
+  if (!(getc (fp) == 'h'))
+    return 1;
+  if (!(getc (fp) == EOF))
+    return 2;
+  if (!(ftell (fp) == 8))
+    return 3;
+  if (!(ftell (fp) == 8))
+    return 4;
+  if (!(putc ('!', fp) == '!'))
+    return 5;
+  if (!(ftell (fp) == 9))
+    return 6;
+  if (!(fclose (fp) == 0))
+    return 7;
+  fp = fopen (TESTFILE, "r");
+  if (fp == NULL)
+    return 75;
+  {
+    char buf[10];
+    if (!(fread (buf, 1, 10, fp) == 9))
+      return 10;
+    if (!(memcmp (buf, "foogarsh!", 9) == 0))
+      return 11;
+  }
+  if (!(fclose (fp) == 0))
+    return 12;
 
+  /* The file's contents is now "foogarsh!".  */
 
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_ftello_works=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+gl_cv_func_ftello_works=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS ftello.$ac_objext"
-
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_ftello_works" >&5
+$as_echo "$gl_cv_func_ftello_works" >&6; }
+      case "$gl_cv_func_ftello_works" in
+        *yes) ;;
+        *)
+          REPLACE_FTELLO=1
 
-  REPLACE_FTELLO=1
+cat >>confdefs.h <<\_ACEOF
+#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1
+_ACEOF
 
-  elif test $gl_cv_var_stdin_large_offset = no; then
+          ;;
+      esac
+    fi
+  fi
+  if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
 
 
 
@@ -16021,16 +20006,24 @@ $as_echo "$gl_cv_func_ftello" >&6; }
   gl_LIBOBJS="$gl_LIBOBJS ftello.$ac_objext"
 
 
-  REPLACE_FTELLO=1
-
   fi
 
 
 
+
   GNULIB_FTELLO=1
 
 
 
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_FTELLO 1
+_ACEOF
+
+
+
+  # Code from module ftruncate:
+
+
 
 
   :
@@ -16165,16 +20158,16 @@ done
           { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { $as_echo "$as_me:$LINENO: error: Your system lacks the ftruncate function.
-             Please report this, along with the output of \"uname -a\", to the
-             bug-coreutils@gnu.org mailing list.  To continue past this point,
-             rerun configure with SKIP_FTRUNCATE_CHECK=yes.
-             E.g., ./configure SKIP_FTRUNCATE_CHECK=yes
+              Please report this, along with the output of \"uname -a\", to the
+              bug-coreutils@gnu.org mailing list.  To continue past this point,
+              rerun configure with SKIP_FTRUNCATE_CHECK=yes.
+              E.g., ./configure SKIP_FTRUNCATE_CHECK=yes
 See \`config.log' for more details." >&5
 $as_echo "$as_me: error: Your system lacks the ftruncate function.
-             Please report this, along with the output of \"uname -a\", to the
-             bug-coreutils@gnu.org mailing list.  To continue past this point,
-             rerun configure with SKIP_FTRUNCATE_CHECK=yes.
-             E.g., ./configure SKIP_FTRUNCATE_CHECK=yes
+              Please report this, along with the output of \"uname -a\", to the
+              bug-coreutils@gnu.org mailing list.  To continue past this point,
+              rerun configure with SKIP_FTRUNCATE_CHECK=yes.
+              E.g., ./configure SKIP_FTRUNCATE_CHECK=yes
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }; }
         fi
@@ -16183,9 +20176,21 @@ See \`config.log' for more details." >&2;}
 
 
 
+
   GNULIB_FTRUNCATE=1
 
 
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_FTRUNCATE 1
+_ACEOF
+
+
+
+  # Code from module full-read:
+  # Code from module full-write:
+  # Code from module getaddrinfo:
+
       { $as_echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5
 $as_echo "$as_me: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&6;}
   GETADDRINFO_LIB=
     *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;;
   esac
 
+    case " $GETADDRINFO_LIB " in
+    *" $INET_NTOP_LIB "*) ;;
+    *) GETADDRINFO_LIB="$GETADDRINFO_LIB $INET_NTOP_LIB" ;;
+  esac
 
 
 
 
 
-  GNULIB_GETADDRINFO=1
-
-
 
-  if test -n "$GETOPT_H"; then
 
+  GNULIB_GETADDRINFO=1
 
 
+  # Code from module getopt-gnu:
 
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
 
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_GETOPT_GNU 1
+_ACEOF
 
 
+  # Code from module getopt-posix:
 
 
 
 
 
+  if test -n "$gl_replace_getopt"; then
 
-  gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
 
 
   GETOPT_H=getopt.h
@@ -17164,17 +21174,17 @@ _ACEOF
 
 
 
+    GNULIB_UNISTD_H_GETOPT=1
 
 
-  :
 
 
 
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
 
-fi
 
 
 
 
 
 
-  :
+  gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
 
 
 
+  :
 
 
 
-  { $as_echo "$as_me:$LINENO: checking for gettimeofday with POSIX signature" >&5
-$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
-if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/time.h>
-           struct timeval c;
 
-int
-main ()
-{
 
-           int (*f) (struct timeval *restrict, void *restrict) = gettimeofday;
-           int x = f (&c, 0);
-           return !(x | c.tv_sec | c.tv_usec);
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  gl_cv_func_gettimeofday_posix_signature=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       gl_cv_func_gettimeofday_posix_signature=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_posix_signature" >&5
-$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
 
 
 
+  # Code from module gettext-h:
 
- { $as_echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5
-$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
-if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
-       gl_cv_func_gettimeofday_clobber=yes
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
-         #include <sys/time.h>
-         #include <time.h>
-         #include <stdlib.h>
 
-int
-main ()
-{
+  # Code from module gettimeofday:
 
-         time_t t = 0;
-         struct tm *lt;
-         struct tm saved_lt;
-         struct timeval tv;
-         lt = localtime (&t);
-         saved_lt = *lt;
-         gettimeofday (&tv, NULL);
-         return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gl_cv_func_gettimeofday_clobber=no
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-gl_cv_func_gettimeofday_clobber=yes
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_clobber" >&5
-$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
+  :
+
+
+
 
- if test $gl_cv_func_gettimeofday_clobber = yes; then
-   REPLACE_GETTIMEOFDAY=1
-   SYS_TIME_H=sys/time.h
 
 
+  gl_gettimeofday_timezone=void
+  if test $ac_cv_func_gettimeofday != yes; then
+    HAVE_GETTIMEOFDAY=0
+
 
 
 
 done
 
 
+  else
 
-cat >>confdefs.h <<\_ACEOF
-#define gmtime rpl_gmtime
-_ACEOF
 
 
-cat >>confdefs.h <<\_ACEOF
-#define localtime rpl_localtime
+ { $as_echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5
+$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
+if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+       gl_cv_func_gettimeofday_clobber=yes
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+          #include <sys/time.h>
+          #include <time.h>
+          #include <stdlib.h>
 
+int
+main ()
+{
 
+          time_t t = 0;
+          struct tm *lt;
+          struct tm saved_lt;
+          struct timeval tv;
+          lt = localtime (&t);
+          saved_lt = *lt;
+          gettimeofday (&tv, NULL);
+          return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
 
-cat >>confdefs.h <<\_ACEOF
-#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_gettimeofday_clobber=no
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
- fi
+( exit $ac_status )
+gl_cv_func_gettimeofday_clobber=yes
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_clobber" >&5
+$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
 
+ if test $gl_cv_func_gettimeofday_clobber = yes; then
+   REPLACE_GETTIMEOFDAY=1
 
-  if test $gl_cv_func_gettimeofday_posix_signature != yes; then
-    REPLACE_GETTIMEOFDAY=1
-    SYS_TIME_H=sys/time.h
-    if test $gl_cv_func_gettimeofday_clobber != yes; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
+
+
+
+for ac_header in sys/timeb.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_func in _ftime
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define gmtime rpl_gmtime
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define localtime rpl_localtime
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1
+_ACEOF
+
+ fi
+
+    { $as_echo "$as_me:$LINENO: checking for gettimeofday with POSIX signature" >&5
+$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
+if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/time.h>
+              struct timeval c;
+              int gettimeofday (struct timeval *restrict, void *restrict);
+
+int
+main ()
+{
+/* glibc uses struct timezone * rather than the POSIX void *
+                 if _GNU_SOURCE is defined.  However, since the only portable
+                 use of gettimeofday uses NULL as the second parameter, and
+                 since the glibc definition is actually more typesafe, it is
+                 not worth wrapping this to get a compliant signature.  */
+              int (*f) (struct timeval *restrict, void *restrict)
+                = gettimeofday;
+              int x = f (&c, 0);
+              return !(x | c.tv_sec | c.tv_usec);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_func_gettimeofday_posix_signature=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/time.h>
+int gettimeofday (struct timeval *restrict, struct timezone *restrict);
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_func_gettimeofday_posix_signature=almost
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_func_gettimeofday_posix_signature=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_posix_signature" >&5
+$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
+    if test $gl_cv_func_gettimeofday_posix_signature = almost; then
+      gl_gettimeofday_timezone='struct timezone'
+    elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
+      REPLACE_GETTIMEOFDAY=1
 
 
 
@@ -17874,6 +22219,26 @@ done
     fi
   fi
 
+cat >>confdefs.h <<_ACEOF
+#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
+_ACEOF
+
+
+
+
+
+  GNULIB_GETTIMEOFDAY=1
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_GETTIMEOFDAY 1
+_ACEOF
+
+
+
+  # Code from module havelib:
+  # Code from module hostent:
 
                   HOSTENT_LIB=
   gl_saved_libs="$LIBS"
@@ -18143,14 +22508,102 @@ done
   fi
 
 
+  # Code from module include_next:
+  # Code from module inet_ntop:
+
 
 
 
+    :
+
+
+      gl_save_LIBS=$LIBS
+  { $as_echo "$as_me:$LINENO: checking for library containing inet_ntop" >&5
+$as_echo_n "checking for library containing inet_ntop... " >&6; }
+if test "${ac_cv_search_inet_ntop+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntop ();
+int
+main ()
+{
+return inet_ntop ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_search_inet_ntop=$ac_res
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
 
-  ARPA_INET_H='arpa/inet.h'
+fi
 
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_inet_ntop+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_inet_ntop+set}" = set; then
+  :
+else
+  ac_cv_search_inet_ntop=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_inet_ntop" >&5
+$as_echo "$ac_cv_search_inet_ntop" >&6; }
+ac_res=$ac_cv_search_inet_ntop
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
+else
 
 
 
 done
 
 
+fi
+
+  LIBS=$gl_save_LIBS
+  INET_NTOP_LIB=
+  if test "$ac_cv_search_inet_ntop" != "no" &&
+     test "$ac_cv_search_inet_ntop" != "none required"; then
+    INET_NTOP_LIB="$ac_cv_search_inet_ntop"
+  fi
+
+
 
   { $as_echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5
 $as_echo_n "checking whether inet_ntop is declared... " >&6; }
 
 
 
-  GNULIB_INET_NTOP=1
-
-
-
-
-  :
-
-
-
 
+  GNULIB_INET_NTOP=1
 
 
+  # Code from module inet_pton:
 
 
 
-  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
 
+    :
 
 
-  if test "$gl_threads_api" = posix; then
-    # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
-    # pthread_rwlock_* functions.
-    { $as_echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5
-$as_echo_n "checking for pthread_rwlock_t... " >&6; }
-if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then
+      gl_save_LIBS=$LIBS
+  { $as_echo "$as_me:$LINENO: checking for library containing inet_pton" >&5
+$as_echo_n "checking for library containing inet_pton... " >&6; }
+if test "${ac_cv_search_inet_pton+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_type_pthread_rwlock_t=no
+  ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <pthread.h>
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_pton ();
 int
 main ()
 {
-if (sizeof (pthread_rwlock_t))
-       return 0;
+return inet_pton ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+for ac_lib in '' nsl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -18407,33 +22873,111 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <pthread.h>
-
-int
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_search_inet_pton=$ac_res
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_inet_pton+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_inet_pton+set}" = set; then
+  :
+else
+  ac_cv_search_inet_pton=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_inet_pton" >&5
+$as_echo "$ac_cv_search_inet_pton" >&6; }
+ac_res=$ac_cv_search_inet_pton
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+
+
+
+
+
+
+
+
+
+for ac_func in inet_pton
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
 main ()
 {
-if (sizeof ((pthread_rwlock_t)))
-         return 0;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -18442,52 +22986,72 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_pthread_rwlock_t=yes
+       eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
+    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
 
 fi
+done
+
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5
-$as_echo "$ac_cv_type_pthread_rwlock_t" >&6; }
-if test "x$ac_cv_type_pthread_rwlock_t" = x""yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PTHREAD_RWLOCK 1
-_ACEOF
+  LIBS=$gl_save_LIBS
+  INET_PTON_LIB=
+  if test "$ac_cv_search_inet_pton" != "no" &&
+     test "$ac_cv_search_inet_pton" != "none required"; then
+    INET_PTON_LIB="$ac_cv_search_inet_pton"
+  fi
 
-fi
 
-    # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
-    cat >conftest.$ac_ext <<_ACEOF
+
+  { $as_echo "$as_me:$LINENO: checking whether inet_pton is declared" >&5
+$as_echo_n "checking whether inet_pton is declared... " >&6; }
+if test "${ac_cv_have_decl_inet_pton+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <pthread.h>
+#include <arpa/inet.h>
+
 int
 main ()
 {
-#if __FreeBSD__ == 4
-error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
-#else
-int x = (int)PTHREAD_MUTEX_RECURSIVE;
-return !x;
+#ifndef inet_pton
+  (void) inet_pton;
 #endif
+
   ;
   return 0;
 }
@@ -18510,19 +23074,36 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_inet_pton=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PTHREAD_MUTEX_RECURSIVE 1
+       ac_cv_have_decl_inet_pton=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_inet_pton" >&5
+$as_echo "$ac_cv_have_decl_inet_pton" >&6; }
+if test "x$ac_cv_have_decl_inet_pton" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_PTON 1
 _ACEOF
 
+
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_PTON 0
+_ACEOF
 
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  if test $ac_cv_have_decl_inet_pton = no; then
+    HAVE_DECL_INET_PTON=0
   fi
 
 
@@ -18531,32 +23112,121 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 
-  { $as_echo "$as_me:$LINENO: checking whether lseek detects pipes" >&5
-$as_echo_n "checking whether lseek detects pipes... " >&6; }
-if test "${gl_cv_func_lseek_pipe+set}" = set; then
+  GNULIB_INET_PTON=1
+
+
+  # Code from module langinfo:
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_langinfo_h='<'langinfo.h'>'
+     else
+       { $as_echo "$as_me:$LINENO: checking absolute name of <langinfo.h>" >&5
+$as_echo_n "checking absolute name of <langinfo.h>... " >&6; }
+if test "${gl_cv_next_langinfo_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if test $cross_compiling = no; then
-       cat >conftest.$ac_ext <<_ACEOF
 
-#include <sys/types.h> /* for off_t */
-#include <stdio.h> /* for SEEK_CUR */
-#include <unistd.h>
-int main ()
+          if test $ac_cv_header_langinfo_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <langinfo.h>
+
+_ACEOF
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_langinfo_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/langinfo.h#{
+                 s#.*"\(.*/langinfo.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_langinfo_h='<'langinfo.h'>'
+          fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_langinfo_h" >&5
+$as_echo "$gl_cv_next_langinfo_h" >&6; }
+     fi
+     NEXT_LANGINFO_H=$gl_cv_next_langinfo_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'langinfo.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_langinfo_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive
+
+
+
+
+    HAVE_LANGINFO_CODESET=0
+  HAVE_LANGINFO_ERA=0
+
+  :
+
+
+
+
+
+  if test $ac_cv_header_langinfo_h = yes; then
+    HAVE_LANGINFO_H=1
+            { $as_echo "$as_me:$LINENO: checking whether langinfo.h defines CODESET" >&5
+$as_echo_n "checking whether langinfo.h defines CODESET... " >&6; }
+if test "${gl_cv_header_langinfo_codeset+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <langinfo.h>
+int a = CODESET;
+
+int
+main ()
 {
-  /* Exit with success only if stdin is seekable.  */
-  return lseek (0, (off_t)0, SEEK_CUR) < 0;
+
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -18565,34 +23235,44 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  if test -s conftest$ac_exeext \
-            && ./conftest$ac_exeext < conftest.$ac_ext \
-            && { echo hi | ./conftest$ac_exeext; test $? = 1; }; then
-           gl_cv_func_lseek_pipe=yes
-         else
-           gl_cv_func_lseek_pipe=no
-         fi
+       } && test -s conftest.$ac_objext; then
+  gl_cv_header_langinfo_codeset=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       gl_cv_func_lseek_pipe=no
+       gl_cv_header_langinfo_codeset=no
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-     else
-       cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__
-/* mingw and BeOS mistakenly return 0 when trying to seek on pipes.  */
-  Choke me.
-#endif
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_langinfo_codeset" >&5
+$as_echo "$gl_cv_header_langinfo_codeset" >&6; }
+    if test $gl_cv_header_langinfo_codeset = yes; then
+      HAVE_LANGINFO_CODESET=1
+    fi
+    { $as_echo "$as_me:$LINENO: checking whether langinfo.h defines ERA" >&5
+$as_echo_n "checking whether langinfo.h defines ERA... " >&6; }
+if test "${gl_cv_header_langinfo_era+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <langinfo.h>
+int a = ERA;
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -18612,65 +23292,37 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  gl_cv_func_lseek_pipe=yes
+  gl_cv_header_langinfo_era=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       gl_cv_func_lseek_pipe=no
+       gl_cv_header_langinfo_era=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-     fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_lseek_pipe" >&5
-$as_echo "$gl_cv_func_lseek_pipe" >&6; }
-  if test $gl_cv_func_lseek_pipe = no; then
-
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS lseek.$ac_objext"
-
-
-  REPLACE_LSEEK=1
-
-cat >>confdefs.h <<\_ACEOF
-#define LSEEK_PIPE_BROKEN 1
-_ACEOF
-
 
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_langinfo_era" >&5
+$as_echo "$gl_cv_header_langinfo_era" >&6; }
+    if test $gl_cv_header_langinfo_era = yes; then
+      HAVE_LANGINFO_ERA=1
+    fi
+  else
+    HAVE_LANGINFO_H=0
   fi
 
 
 
-  GNULIB_LSEEK=1
-
-
-
-
-  :
-
-
 
 
 
-  if test $ac_cv_func_lstat = yes; then
-    { $as_echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
-$as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; }
-if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
+  for gl_func in nl_langinfo; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
-else
-  rm -f conftest.sym conftest.file
-echo >conftest.file
-if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18678,123 +23330,107 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+#include <langinfo.h>
+
 int
 main ()
 {
-struct stat sbuf;
-     /* Linux will dereference the symlink and fail.
-       That is better in the sense that it means we will not
-       have to compile and use the lstat wrapper.  */
-     return lstat ("conftest.sym/", &sbuf) == 0;
+#undef $gl_func
+  (void) $gl_func;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_lstat_dereferences_slashed_symlink=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_func_lstat_dereferences_slashed_symlink=no
+       eval "$as_gl_Symbol=no"
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
 
-else
-  # If the `ln -s' command failed, then we probably don't even
-  # have an lstat function.
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.sym conftest.file
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
+                     eval ac_cv_have_decl_$gl_func=yes
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
-
-test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
 
-cat >>confdefs.h <<_ACEOF
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
-_ACEOF
+      done
 
 
-if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
+  # Code from module localcharset:
 
 
 
 
+  :
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
 
-fi
 
-        if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
-      REPLACE_LSTAT=1
-    fi
-    # Prerequisites of lib/lstat.c.
 
-  fi
 
 
+  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
 
-  GNULIB_LSTAT=1
+  # Code from module lock:
 
 
-for ac_header in stdlib.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  if test "$gl_threads_api" = posix; then
+    # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
+    # pthread_rwlock_* functions.
+    { $as_echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5
+$as_echo_n "checking for pthread_rwlock_t... " >&6; }
+if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then
   $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
+  ac_cv_type_pthread_rwlock_t=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
+#include <pthread.h>
+
+int
+main ()
+{
+if (sizeof (pthread_rwlock_t))
+       return 0;
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -18814,89 +23450,443 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include <pthread.h>
+
+int
+main ()
+{
+if (sizeof ((pthread_rwlock_t)))
+         return 0;
+  ;
+  return 0;
+}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+       } && test -s conftest.$ac_objext; then
+  :
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+       ac_cv_type_pthread_rwlock_t=yes
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5
+$as_echo "$ac_cv_type_pthread_rwlock_t" >&6; }
+if test "x$ac_cv_type_pthread_rwlock_t" = x""yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD_RWLOCK 1
+_ACEOF
+
+fi
+
+    # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
+    cat >conftest.$ac_ext <<_ACEOF
+
+      /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+
+#if __FreeBSD__ == 4
+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#else
+int x = (int)PTHREAD_MUTEX_RECURSIVE;
+return !x;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD_MUTEX_RECURSIVE 1
+_ACEOF
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  fi
+
+
+
+
+  # Code from module lseek:
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether lseek detects pipes" >&5
+$as_echo_n "checking whether lseek detects pipes... " >&6; }
+if test "${gl_cv_func_lseek_pipe+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test $cross_compiling = no; then
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <sys/types.h> /* for off_t */
+#include <stdio.h> /* for SEEK_CUR */
+#include <unistd.h>
+int
+main ()
+{
+
+  /* Exit with success only if stdin is seekable.  */
+  return lseek (0, (off_t)0, SEEK_CUR) < 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  if test -s conftest$ac_exeext \
+             && ./conftest$ac_exeext < conftest.$ac_ext \
+             && test 1 = "`echo hi \
+               | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
+            gl_cv_func_lseek_pipe=yes
+          else
+            gl_cv_func_lseek_pipe=no
+          fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_func_lseek_pipe=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     else
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__
+/* mingw and BeOS mistakenly return 0 when trying to seek on pipes.  */
+  Choke me.
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_func_lseek_pipe=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_func_lseek_pipe=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_lseek_pipe" >&5
+$as_echo "$gl_cv_func_lseek_pipe" >&6; }
+  if test $gl_cv_func_lseek_pipe = no; then
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS lseek.$ac_objext"
+
+
+  REPLACE_LSEEK=1
+
+cat >>confdefs.h <<\_ACEOF
+#define LSEEK_PIPE_BROKEN 1
+_ACEOF
+
+
+  fi
+
+
+
+
+  GNULIB_LSEEK=1
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_LSEEK 1
+_ACEOF
+
+
+
+  # Code from module lstat:
+
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_func_lstat = yes; then
+
+    if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
+            REPLACE_LSTAT=1
+    fi
+    # Prerequisites of lib/lstat.c.
+
+  else
+    HAVE_LSTAT=0
+  fi
+
+
+
+
+  GNULIB_LSTAT=1
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_LSTAT 1
+_ACEOF
+
+
+
+  # Code from module malloc-gnu:
+
+
+
+for ac_header in stdlib.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 ac_res=`eval 'as_val=${'$as_ac_Header'}
                 $as_echo "$as_val"'`
@@ -18985,12 +23975,12 @@ $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
 if test $ac_cv_func_malloc_0_nonnull = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 1
+#define HAVE_MALLOC_GNU 1
 _ACEOF
 
 else
   cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 0
+#define HAVE_MALLOC_GNU 0
 _ACEOF
 
 
@@ -19001,26 +23991,28 @@ _ACEOF
 
 
 
+
   gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
 
+  REPLACE_MALLOC=1
 
-cat >>confdefs.h <<\_ACEOF
-#define malloc rpl_malloc
-_ACEOF
 
 fi
 
 
 
 
-cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<_ACEOF
 #define GNULIB_MALLOC_GNU 1
 _ACEOF
 
 
+  # Code from module malloc-posix:
+
+
 
   if test $gl_cv_func_malloc_posix = yes; then
-    HAVE_MALLOC_POSIX=1
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_MALLOC_POSIX 1
@@ -19035,9 +24027,11 @@ _ACEOF
 
 
 
+
   gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
 
-    HAVE_MALLOC_POSIX=0
+  REPLACE_MALLOC=1
+
   fi
 
 
@@ -19047,6 +24041,15 @@ _ACEOF
 
 
 
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_MALLOC_POSIX 1
+_ACEOF
+
+
+
+  # Code from module mbrtowc:
+
+
 
 
 
@@ -19078,20 +24081,14 @@ if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then
 else
 
                   case "$host_os" in
-              # Guess no on AIX and OSF/1.
-        osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-              # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+                     # Guess no on AIX and OSF/1.
+        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+                     # Guess yes otherwise.
+        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
       esac
       if test $LOCALE_JA != none; then
         if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+  :
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19178,13 +24175,7 @@ else
       esac
       if test $LOCALE_ZH_CN != none; then
         if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+  :
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19194,6 +24185,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <locale.h>
+#include <stdlib.h>
 #include <string.h>
 #include <wchar.h>
 int main ()
@@ -19271,14 +24263,11 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
   fi
   if test $REPLACE_MBSTATE_T = 1; then
 
-
-  WCHAR_H=wchar.h
+    :
 
   fi
 
-  if test $REPLACE_MBSTATE_T = 1; then
-    REPLACE_MBRTOWC=1
-  fi
+
 
   :
 
@@ -19288,8 +24277,10 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
   if test $ac_cv_func_mbrtowc = no; then
     HAVE_MBRTOWC=0
-  fi
-  if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_MBRTOWC=1
+    else
 
 
 
@@ -19307,13 +24298,7 @@ else
       esac
       if test $LOCALE_FR_UTF8 != none; then
         if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+  :
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19403,13 +24388,7 @@ else
       esac
       if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
         if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+  :
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19515,13 +24494,7 @@ else
       esac
       if test $LOCALE_ZH_CN != none; then
         if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+  :
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 { $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_nul_retval" >&5
 $as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
 
-    case "$gl_cv_func_mbrtowc_null_arg" in
-      *yes) ;;
-      *)
+      case "$gl_cv_func_mbrtowc_null_arg" in
+        *yes) ;;
+        *)
 cat >>confdefs.h <<\_ACEOF
 #define MBRTOWC_NULL_ARG_BUG 1
 _ACEOF
 
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
-    case "$gl_cv_func_mbrtowc_retval" in
-      *yes) ;;
-      *)
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_retval" in
+        *yes) ;;
+        *)
 cat >>confdefs.h <<\_ACEOF
 #define MBRTOWC_RETVAL_BUG 1
 _ACEOF
 
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
-    case "$gl_cv_func_mbrtowc_nul_retval" in
-      *yes) ;;
-      *)
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_nul_retval" in
+        *yes) ;;
+        *)
 cat >>confdefs.h <<\_ACEOF
 #define MBRTOWC_NUL_RETVAL_BUG 1
 _ACEOF
 
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+    fi
   fi
   if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
 
-
-  WCHAR_H=wchar.h
+    :
 
 
 
@@ -19643,10 +24616,20 @@ _ACEOF
 
 
 
+
   GNULIB_MBRTOWC=1
 
 
 
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_MBRTOWC 1
+_ACEOF
+
+
+
+  # Code from module mbsinit:
+
+
 
 
 
@@ -19678,20 +24661,14 @@ if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then
 else
 
                   case "$host_os" in
-              # Guess no on AIX and OSF/1.
-        osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-              # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+                     # Guess no on AIX and OSF/1.
+        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+                     # Guess yes otherwise.
+        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
       esac
       if test $LOCALE_JA != none; then
         if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+  :
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19778,13 +24755,7 @@ else
       esac
       if test $LOCALE_ZH_CN != none; then
         if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+  :
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19794,6 +24765,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <locale.h>
+#include <stdlib.h>
 #include <string.h>
 #include <wchar.h>
 int main ()
@@ -19871,14 +24843,11 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
   fi
   if test $REPLACE_MBSTATE_T = 1; then
 
-
-  WCHAR_H=wchar.h
+    :
 
   fi
 
-  if test $REPLACE_MBSTATE_T = 1; then
-    REPLACE_MBSINIT=1
-  fi
+
 
   :
 
@@ -19888,11 +24857,14 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
   if test $ac_cv_func_mbsinit = no; then
     HAVE_MBSINIT=0
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_MBSINIT=1
+    fi
   fi
   if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
 
-
-  WCHAR_H=wchar.h
+    :
 
 
 
@@ -19911,10 +24883,35 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
 
 
+
   GNULIB_MBSINIT=1
 
 
 
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_MBSINIT 1
+_ACEOF
+
+
+
+  # Code from module memchr:
+
+
+
+
+  GNULIB_MEMCHR=1
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_MEMCHR 1
+_ACEOF
+
+
+
+  # Code from module mkdtemp:
+
+
 
 
 
@@ -20037,10 +25034,28 @@ done
 
 
 
+
   GNULIB_MKDTEMP=1
 
 
 
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_MKDTEMP 1
+_ACEOF
+
+
+
+  # Code from module multiarch:
+
+  # Code from module netdb:
+
+
+
+  :
+
+
+
+
 
 
 
@@ -20063,8 +25078,8 @@ if test "${gl_cv_next_netdb_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_netdb_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_netdb_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -20073,20 +25088,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <netdb.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_netdb_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/netdb.h#{
-                s#.*"\(.*/netdb.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_netdb_h='<'netdb.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_netdb_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/netdb.h#{
+                 s#.*"\(.*/netdb.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_netdb_h='<'netdb.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_netdb_h" >&5
@@ -20094,25 +25109,48 @@ $as_echo "$gl_cv_next_netdb_h" >&6; }
      fi
      NEXT_NETDB_H=$gl_cv_next_netdb_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'netdb.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_netdb_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_NETDB_H=$gl_next_as_first_directive
+
 
 
   if test $ac_cv_header_netdb_h = yes; then
-    cat >conftest.$ac_ext <<_ACEOF
+    HAVE_NETDB_H=1
+  else
+    HAVE_NETDB_H=0
+  fi
+
+
+
+
+
+
+
+  for gl_func in getaddrinfo freeaddrinfo gai_strerror getnameinfo; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-         #include <netdb.h>
-         struct addrinfo a;
-         int b = EAI_OVERFLOW;
-         int c = AI_NUMERICSERV;
-
+#include <netdb.h>
 int
 main ()
 {
-
+#undef $gl_func
+  (void) $gl_func;
   ;
   return 0;
 }
@@ -20135,23 +25173,34 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  NETDB_H=''
+  eval "$as_gl_Symbol=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       NETDB_H='netdb.h'
+       eval "$as_gl_Symbol=no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    HAVE_NETDB_H=1
-  else
-    NETDB_H='netdb.h'
-    HAVE_NETDB_H=0
-  fi
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
 
 
+  # Code from module netinet_in:
 
   { $as_echo "$as_me:$LINENO: checking whether <netinet/in.h> is self-contained" >&5
 $as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
@@ -20376,8 +25425,8 @@ if test "${gl_cv_next_netinet_in_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_netinet_in_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_netinet_in_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -20386,20 +25435,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <netinet/in.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_netinet_in_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/netinet/in.h#{
-                s#.*"\(.*/netinet/in.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_netinet_in_h='<'netinet/in.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_netinet_in_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/netinet/in.h#{
+                 s#.*"\(.*/netinet/in.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_netinet_in_h='<'netinet/in.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_netinet_in_h" >&5
@@ -20407,6 +25456,15 @@ $as_echo "$gl_cv_next_netinet_in_h" >&6; }
      fi
      NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'netinet/in.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_netinet_in_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
+
 
 
     if test $ac_cv_header_netinet_in_h = yes; then
 $as_echo "$MKDIR_P" >&6; }
 
 
+  # Code from module nl_langinfo:
+
+
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_func_nl_langinfo = yes; then
+    if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1; then
+      :
+    else
+      REPLACE_NL_LANGINFO=1
+
+cat >>confdefs.h <<\_ACEOF
+#define REPLACE_NL_LANGINFO 1
+_ACEOF
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext"
+
+    fi
+  else
+    HAVE_NL_LANGINFO=0
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext"
+
+  fi
+
+
+
+
+  GNULIB_NL_LANGINFO=1
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_NL_LANGINFO 1
+_ACEOF
+
+
+
+  # Code from module physmem:
+
 
 
 
@@ -20480,10 +25599,70 @@ $as_echo "$MKDIR_P" >&6; }
 
 
 
-
 for ac_header in sys/pstat.h sys/sysmp.h sys/sysinfo.h \
-    machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
-    sys/systemcfg.h
+    machine/hal_sysinfo.h sys/table.h sys/param.h sys/systemcfg.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/sysctl.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
@@ -20498,6 +25677,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+     #if HAVE_SYS_PARAM_H
+     # include <sys/param.h>
+     #endif
+
 
 #include <$ac_header>
 _ACEOF
@@ -20653,6 +25836,7 @@ done
 
 
 
+  # Code from module regex:
 
 
   :
@@ -20671,7 +25855,7 @@ fi
 
   case $with_included_regex in #(
   yes|no) ac_use_included_regex=$with_included_regex
-       ;;
+        ;;
   '')
     # If the system regex support is good enough that it passes the
     # following run test, then default to *not* using the included regex.c.
@@ -20692,132 +25876,140 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-          #if HAVE_LOCALE_H
-           #include <locale.h>
-          #endif
-          #include <limits.h>
-          #include <regex.h>
+           #if HAVE_LOCALE_H
+            #include <locale.h>
+           #endif
+           #include <limits.h>
+           #include <regex.h>
 
 int
 main ()
 {
 static struct re_pattern_buffer regex;
-           unsigned char folded_chars[UCHAR_MAX + 1];
-           int i;
-           const char *s;
-           struct re_registers regs;
-
-           #if HAVE_LOCALE_H
-             /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
-                This test needs valgrind to catch the bug on Debian
-                GNU/Linux 3.1 x86, but it might catch the bug better
-                on other platforms and it shouldn't hurt to try the
-                test here.  */
-             if (setlocale (LC_ALL, "en_US.UTF-8"))
-               {
-                 static char const pat[] = "insert into";
-                 static char const data[] =
-                   "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
-                 re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
-                                | RE_ICASE);
-                 memset (&regex, 0, sizeof regex);
-                 s = re_compile_pattern (pat, sizeof pat - 1, &regex);
-                 if (s)
-                   return 1;
-                 if (re_search (&regex, data, sizeof data - 1,
-                                0, sizeof data - 1, &regs)
-                     != -1)
-                   return 1;
-                 if (! setlocale (LC_ALL, "C"))
-                   return 1;
-               }
-           #endif
-
-           /* This test is from glibc bug 3957, reported by Andrew Mackey.  */
-           re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE);
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("a[^x]b", 6, &regex);
-           if (s)
-             return 1;
-
-           /* This should fail, but succeeds for glibc-2.5.  */
-           if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
-             return 1;
-
-           /* This regular expression is from Spencer ere test number 75
-              in grep-2.3.  */
-           re_set_syntax (RE_SYNTAX_POSIX_EGREP);
-           memset (&regex, 0, sizeof regex);
-           for (i = 0; i <= UCHAR_MAX; i++)
-             folded_chars[i] = i;
-           regex.translate = folded_chars;
-           s = re_compile_pattern ("a[[:]:]]b\n", 11, &regex);
-           /* This should fail with _Invalid character class name_ error.  */
-           if (!s)
-             return 1;
-
-           /* This should succeed, but does not for glibc-2.1.3.  */
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("{1", 2, &regex);
-
-           if (s)
-             return 1;
-
-           /* The following example is derived from a problem report
-              against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>.  */
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("[an\371]*n", 7, &regex);
-           if (s)
-             return 1;
-
-           /* This should match, but does not for glibc-2.2.1.  */
-           if (re_match (&regex, "an", 2, 0, &regs) != 2)
-             return 1;
-
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("x", 1, &regex);
-           if (s)
-             return 1;
-
-           /* glibc-2.2.93 does not work with a negative RANGE argument.  */
-           if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
-             return 1;
-
-           /* The version of regex.c in older versions of gnulib
-              ignored RE_ICASE.  Detect that problem too.  */
-           re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("x", 1, &regex);
-           if (s)
-             return 1;
-
-           if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
-             return 1;
-
-           /* Catch a bug reported by Vin Shelton in
-              http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html
-              */
-           re_set_syntax (RE_SYNTAX_POSIX_BASIC
-                          & ~RE_CONTEXT_INVALID_DUP
-                          & ~RE_NO_EMPTY_RANGES);
-           memset (&regex, 0, sizeof regex);
-           s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
-           if (s)
-             return 1;
-
-           /* REG_STARTEND was added to glibc on 2004-01-15.
-              Reject older versions.  */
-           if (! REG_STARTEND)
-             return 1;
-
-           /* Reject hosts whose regoff_t values are too narrow.
-              These include glibc 2.3.5 on hosts with 64-bit ptrdiff_t
-              and 32-bit int.  */
-           if (sizeof (regoff_t) < sizeof (ptrdiff_t)
-               || sizeof (regoff_t) < sizeof (ssize_t))
-             return 1;
-
-           return 0;
+            unsigned char folded_chars[UCHAR_MAX + 1];
+            int i;
+            const char *s;
+            struct re_registers regs;
+
+            #if HAVE_LOCALE_H
+              /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
+                 This test needs valgrind to catch the bug on Debian
+                 GNU/Linux 3.1 x86, but it might catch the bug better
+                 on other platforms and it shouldn't hurt to try the
+                 test here.  */
+              if (setlocale (LC_ALL, "en_US.UTF-8"))
+                {
+                  static char const pat[] = "insert into";
+                  static char const data[] =
+                    "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
+                  re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
+                                 | RE_ICASE);
+                  memset (&regex, 0, sizeof regex);
+                  s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+                  if (s)
+                    return 1;
+                  if (re_search (&regex, data, sizeof data - 1,
+                                 0, sizeof data - 1, &regs)
+                      != -1)
+                    return 1;
+                  if (! setlocale (LC_ALL, "C"))
+                    return 1;
+                }
+            #endif
+
+            /* This test is from glibc bug 3957, reported by Andrew Mackey.  */
+            re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("a[^x]b", 6, &regex);
+            if (s)
+              return 1;
+
+            /* This should fail, but succeeds for glibc-2.5.  */
+            if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+              return 1;
+
+            /* This regular expression is from Spencer ere test number 75
+               in grep-2.3.  */
+            re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+            memset (&regex, 0, sizeof regex);
+            for (i = 0; i <= UCHAR_MAX; i++)
+              folded_chars[i] = i;
+            regex.translate = folded_chars;
+            s = re_compile_pattern ("a[[:]:]]b\n", 11, &regex);
+            /* This should fail with _Invalid character class name_ error.  */
+            if (!s)
+              return 1;
+
+            /* Ensure that [b-a] is diagnosed as invalid, when
+               using RE_NO_EMPTY_RANGES. */
+            re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("a[b-a]", 6, &regex);
+            if (s == 0)
+              return 1;
+
+            /* This should succeed, but does not for glibc-2.1.3.  */
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("{1", 2, &regex);
+
+            if (s)
+              return 1;
+
+            /* The following example is derived from a problem report
+               against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>.  */
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("[an\371]*n", 7, &regex);
+            if (s)
+              return 1;
+
+            /* This should match, but does not for glibc-2.2.1.  */
+            if (re_match (&regex, "an", 2, 0, &regs) != 2)
+              return 1;
+
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("x", 1, &regex);
+            if (s)
+              return 1;
+
+            /* glibc-2.2.93 does not work with a negative RANGE argument.  */
+            if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+              return 1;
+
+            /* The version of regex.c in older versions of gnulib
+               ignored RE_ICASE.  Detect that problem too.  */
+            re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("x", 1, &regex);
+            if (s)
+              return 1;
+
+            if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+              return 1;
+
+            /* Catch a bug reported by Vin Shelton in
+               http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html
+               */
+            re_set_syntax (RE_SYNTAX_POSIX_BASIC
+                           & ~RE_CONTEXT_INVALID_DUP
+                           & ~RE_NO_EMPTY_RANGES);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
+            if (s)
+              return 1;
+
+            /* REG_STARTEND was added to glibc on 2004-01-15.
+               Reject older versions.  */
+            if (! REG_STARTEND)
+              return 1;
+
+            /* Reject hosts whose regoff_t values are too narrow.
+               These include glibc 2.3.5 on hosts with 64-bit ptrdiff_t
+               and 32-bit int.  */
+            if (sizeof (regoff_t) < sizeof (ptrdiff_t)
+                || sizeof (regoff_t) < sizeof (ssize_t))
+              return 1;
+
+            return 0;
   ;
   return 0;
 }
@@ -20968,6 +26160,7 @@ _ACEOF
 
 
 
+
 for ac_header in libintl.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -21199,6 +26392,7 @@ fi
 
   fi
 
+  # Code from module safe-read:
 
 
 
@@ -21215,6 +26409,7 @@ fi
 
 
 
+  # Code from module safe-write:
 
 
 
@@ -21233,6 +26428,7 @@ fi
 
 
 
+  # Code from module servent:
 
                       SERVENT_LIB=
   gl_saved_libs="$LIBS"
@@ -21502,6 +26698,7 @@ done
   fi
 
 
+  # Code from module size_max:
 
 
 for ac_header in stdint.h
@@ -22388,6 +27585,7 @@ _ACEOF
 
   fi
 
+  # Code from module snprintf:
 
 
   gl_cv_func_snprintf_usable=no
@@ -22598,8 +27796,18 @@ $as_echo "$gl_cv_func_snprintf_size1" >&6; }
 
 
 
+
   GNULIB_SNPRINTF=1
 
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_SNPRINTF 1
+_ACEOF
+
+
+
+  # Code from module socklen:
      { $as_echo "$as_me:$LINENO: checking for socklen_t" >&5
 $as_echo_n "checking for socklen_t... " >&6; }
 if test "${ac_cv_type_socklen_t+set}" = set; then
@@ -22715,25 +27923,25 @@ $as_echo_n "checking for socklen_t equivalent... " >&6; }
   $as_echo_n "(cached) " >&6
 else
   # Systems have either "struct sockaddr *" or
-        # "void *" as the second argument to getpeername
-        gl_cv_socklen_t_equiv=
-        for arg2 in "struct sockaddr" void; do
-          for t in int size_t "unsigned int" "long int" "unsigned long int"; do
-            cat >conftest.$ac_ext <<_ACEOF
+         # "void *" as the second argument to getpeername
+         gl_cv_socklen_t_equiv=
+         for arg2 in "struct sockaddr" void; do
+           for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+             cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/types.h>
-               #include <sys/socket.h>
+                   #include <sys/socket.h>
 
-               int getpeername (int, $arg2 *, $t *);
+                   int getpeername (int, $arg2 *, $t *);
 int
 main ()
 {
 $t len;
-               getpeername (0, 0, &len);
+                  getpeername (0, 0, &len);
   ;
   return 0;
 }
@@ -22765,15 +27973,15 @@ sed 's/^/| /' conftest.$ac_ext >&5
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            test "$gl_cv_socklen_t_equiv" != "" && break
-          done
-          test "$gl_cv_socklen_t_equiv" != "" && break
-        done
+             test "$gl_cv_socklen_t_equiv" != "" && break
+           done
+           test "$gl_cv_socklen_t_equiv" != "" && break
+         done
 
 fi
 
       if test "$gl_cv_socklen_t_equiv" = ""; then
-       { { $as_echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5
+        { { $as_echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5
 $as_echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;}
    { (exit 1); exit 1; }; }
       fi
@@ -22786,6 +27994,7 @@ _ACEOF
 
 fi
 
+  # Code from module ssize_t:
 
   { $as_echo "$as_me:$LINENO: checking for ssize_t" >&5
 $as_echo_n "checking for ssize_t... " >&6; }
@@ -22803,7 +28012,7 @@ int
 main ()
 {
 int x = sizeof (ssize_t *) + sizeof (ssize_t);
-        return !x;
+            return !x;
   ;
   return 0;
 }
@@ -22846,6 +28055,201 @@ _ACEOF
 
   fi
 
+  # Code from module stat:
+
+
+
+
+  :
+
+
+
+
+
+    { $as_echo "$as_me:$LINENO: checking whether stat handles trailing slashes on directories" >&5
+$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; }
+if test "${gl_cv_func_stat_dir_slash+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+  case $host_os in
+            mingw*) gl_cv_func_stat_dir_slash="guessing no";;
+            *) gl_cv_func_stat_dir_slash="guessing yes";;
+          esac
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/stat.h>
+
+int
+main ()
+{
+struct stat st; return stat (".", &st) != stat ("./", &st);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_stat_dir_slash=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_stat_dir_slash=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_stat_dir_slash" >&5
+$as_echo "$gl_cv_func_stat_dir_slash" >&6; }
+      { $as_echo "$as_me:$LINENO: checking whether stat handles trailing slashes on files" >&5
+$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
+if test "${gl_cv_func_stat_file_slash+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  touch conftest.tmp
+       # Assume that if we have lstat, we can also check symlinks.
+       if test $ac_cv_func_lstat = yes; then
+         ln -s conftest.tmp conftest.lnk
+       fi
+       if test "$cross_compiling" = yes; then
+  gl_cv_func_stat_file_slash="guessing no"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/stat.h>
+
+int
+main ()
+{
+struct stat st;
+      if (!stat ("conftest.tmp/", &st)) return 1;
+#if HAVE_LSTAT
+      if (!stat ("conftest.lnk/", &st)) return 2;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_stat_file_slash=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_stat_file_slash=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+       rm -f conftest.tmp conftest.lnk
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_stat_file_slash" >&5
+$as_echo "$gl_cv_func_stat_file_slash" >&6; }
+  case $gl_cv_func_stat_dir_slash in
+    *no) REPLACE_STAT=1
+
+cat >>confdefs.h <<\_ACEOF
+#define REPLACE_FUNC_STAT_DIR 1
+_ACEOF
+;;
+  esac
+  case $gl_cv_func_stat_file_slash in
+    *no) REPLACE_STAT=1
+
+cat >>confdefs.h <<\_ACEOF
+#define REPLACE_FUNC_STAT_FILE 1
+_ACEOF
+;;
+  esac
+  if test $REPLACE_STAT = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
+
+
+  fi
+
+
+
+
+  GNULIB_STAT=1
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_STAT 1
+_ACEOF
+
+
+
+  # Code from module stdbool:
 
 
 
@@ -22865,6 +28269,137 @@ _ACEOF
   fi
 
 
+  # Code from module stddef:
+
+
+
+  if test $gt_cv_c_wchar_t = no; then
+    HAVE_WCHAR_T=0
+    STDDEF_H=stddef.h
+  fi
+  { $as_echo "$as_me:$LINENO: checking whether NULL can be used in arbitrary expressions" >&5
+$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
+if test "${gl_cv_decl_null_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+      int test[2 * (sizeof NULL == sizeof (void *)) -1];
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_decl_null_works=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_decl_null_works=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_decl_null_works" >&5
+$as_echo "$gl_cv_decl_null_works" >&6; }
+  if test $gl_cv_decl_null_works = no; then
+    REPLACE_NULL=1
+    STDDEF_H=stddef.h
+  fi
+  if test -n "$STDDEF_H"; then
+
+
+
+
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_stddef_h='<'stddef.h'>'
+     else
+       { $as_echo "$as_me:$LINENO: checking absolute name of <stddef.h>" >&5
+$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
+if test "${gl_cv_next_stddef_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+          if test $ac_cv_header_stddef_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+
+_ACEOF
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/stddef.h#{
+                 s#.*"\(.*/stddef.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_stddef_h='<'stddef.h'>'
+          fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_stddef_h" >&5
+$as_echo "$gl_cv_next_stddef_h" >&6; }
+     fi
+     NEXT_STDDEF_H=$gl_cv_next_stddef_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'stddef.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_stddef_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
+
+
+
+  fi
+
+  # Code from module stdint:
 
 
 
@@ -22917,8 +28452,8 @@ if test "${gl_cv_next_stdint_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_stdint_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_stdint_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -22927,20 +28462,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdint.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/stdint.h#{
-                s#.*"\(.*/stdint.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_stdint_h='<'stdint.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/stdint.h#{
+                 s#.*"\(.*/stdint.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_stdint_h='<'stdint.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdint_h" >&5
@@ -22948,6 +28483,15 @@ $as_echo "$gl_cv_next_stdint_h" >&6; }
      fi
      NEXT_STDINT_H=$gl_cv_next_stdint_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'stdint.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_stdint_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
+
 
 
   if test $ac_cv_header_stdint_h = yes; then
@@ -24396,12 +29940,12 @@ else
        for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
          case $glsuf in
            '')  gltype1='int';;
-           l)  gltype1='long int';;
-           ll) gltype1='long long int';;
-           i64)        gltype1='__int64';;
-           u)  gltype1='unsigned int';;
-           ul) gltype1='unsigned long int';;
-           ull)        gltype1='unsigned long long int';;
+           l)   gltype1='long int';;
+           ll)  gltype1='long long int';;
+           i64) gltype1='__int64';;
+           u)   gltype1='unsigned int';;
+           ul)  gltype1='unsigned long int';;
+           ull) gltype1='unsigned long long int';;
            ui64)gltype1='unsigned __int64';;
          esac
          cat >conftest.$ac_ext <<_ACEOF
@@ -24499,12 +30043,12 @@ else
        for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
          case $glsuf in
            '')  gltype1='int';;
-           l)  gltype1='long int';;
-           ll) gltype1='long long int';;
-           i64)        gltype1='__int64';;
-           u)  gltype1='unsigned int';;
-           ul) gltype1='unsigned long int';;
-           ull)        gltype1='unsigned long long int';;
+           l)   gltype1='long int';;
+           ll)  gltype1='long long int';;
+           i64) gltype1='__int64';;
+           u)   gltype1='unsigned int';;
+           ul)  gltype1='unsigned long int';;
+           ull) gltype1='unsigned long long int';;
            ui64)gltype1='unsigned __int64';;
          esac
          cat >conftest.$ac_ext <<_ACEOF
@@ -24585,6 +30129,9 @@ _ACEOF
   fi
 
 
+  # Code from module stdio:
+
+
 
 
 
@@ -24608,8 +30155,8 @@ if test "${gl_cv_next_stdio_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_stdio_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_stdio_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -24618,20 +30165,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdio.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/stdio.h#{
-                s#.*"\(.*/stdio.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_stdio_h='<'stdio.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/stdio.h#{
+                 s#.*"\(.*/stdio.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_stdio_h='<'stdio.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdio_h" >&5
@@ -24639,6 +30186,15 @@ $as_echo "$gl_cv_next_stdio_h" >&6; }
      fi
      NEXT_STDIO_H=$gl_cv_next_stdio_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'stdio.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_stdio_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
+
 
 
       GNULIB_FPRINTF=1
@@ -24659,6 +30215,89 @@ $as_echo "$gl_cv_next_stdio_h" >&6; }
 
 
 
+
+
+
+
+
+
+
+  for gl_func in dprintf fpurge fseeko ftello getdelim getline popen renameat     snprintf tmpfile vdprintf vsnprintf; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdio.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_gl_Symbol=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
+
+
+  # Code from module stdlib:
+
+
+
+
+
+
   :
 
 
@@ -24676,8 +30315,8 @@ if test "${gl_cv_next_stdlib_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_stdlib_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_stdlib_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -24686,20 +30325,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdlib.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/stdlib.h#{
-                s#.*"\(.*/stdlib.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_stdlib_h='<'stdlib.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/stdlib.h#{
+                 s#.*"\(.*/stdlib.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_stdlib_h='<'stdlib.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdlib_h" >&5
@@ -24707,6 +30346,15 @@ $as_echo "$gl_cv_next_stdlib_h" >&6; }
      fi
      NEXT_STDLIB_H=$gl_cv_next_stdlib_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'stdlib.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_stdlib_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
+
 
 
 
 
 
 
-  { $as_echo "$as_me:$LINENO: checking whether <sys/socket.h> is self-contained" >&5
-$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
-if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
 
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/socket.h>
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  gl_cv_header_sys_socket_h_selfcontained=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       gl_cv_header_sys_socket_h_selfcontained=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
-$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
-  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
-    SYS_SOCKET_H=''
 
-for ac_func in shutdown
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef $ac_func
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
 
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
-fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
-fi
-done
 
-    if test $ac_cv_func_shutdown = yes; then
-      { $as_echo "$as_me:$LINENO: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
-$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
-if test "${gl_cv_header_sys_socket_h_shut+set}" = set; then
+
+
+
+
+
+
+  for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt mkdtemp     mkostemp mkostemps mkstemp mkstemps ptsname random_r initstat_r srandom_r     setstate_r realpath rpmatch setenv strtod strtoll strtoull unlockpt     unsetenv; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-
-          cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/socket.h>
+#include <stdlib.h>
+#if HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+#endif
+#if HAVE_RANDOM_H
+# include <random.h>
+#endif
+
 int
 main ()
 {
-int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_gl_Symbol=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
+
+
+  # Code from module streq:
+  # Code from module string:
+
+
+
+  # Code from module sys_socket:
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether <sys/socket.h> is self-contained" >&5
+$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
+if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/socket.h>
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_header_sys_socket_h_selfcontained=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_header_sys_socket_h_selfcontained=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
+$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
+  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+
+for ac_func in shutdown
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+    if test $ac_cv_func_shutdown = yes; then
+      { $as_echo "$as_me:$LINENO: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
+$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
+if test "${gl_cv_header_sys_socket_h_shut+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+          cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/socket.h>
+int
+main ()
+{
+int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
   ;
   return 0;
 }
@@ -25109,10 +30862,9 @@ $as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
         SYS_SOCKET_H='sys/socket.h'
       fi
     fi
-  else
-    SYS_SOCKET_H='sys/socket.h'
   fi
-  if test -n "$SYS_SOCKET_H"; then
+  # We need to check for ws2tcpip.h now.
+
 
 
 
@@ -25134,8 +30886,8 @@ if test "${gl_cv_next_sys_socket_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_sys_socket_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_sys_socket_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -25144,20 +30896,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <sys/socket.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_sys_socket_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/sys/socket.h#{
-                s#.*"\(.*/sys/socket.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_sys_socket_h='<'sys/socket.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_sys_socket_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/sys/socket.h#{
+                 s#.*"\(.*/sys/socket.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_socket_h" >&5
@@ -25165,13 +30917,22 @@ $as_echo "$gl_cv_next_sys_socket_h" >&6; }
      fi
      NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'sys/socket.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_socket_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
+
 
 
-    if test $ac_cv_header_sys_socket_h = yes; then
-      HAVE_SYS_SOCKET_H=1
-      HAVE_WS2TCPIP_H=0
-    else
-      HAVE_SYS_SOCKET_H=0
+  if test $ac_cv_header_sys_socket_h = yes; then
+    HAVE_SYS_SOCKET_H=1
+    HAVE_WS2TCPIP_H=0
+  else
+    HAVE_SYS_SOCKET_H=0
 
 for ac_header in ws2tcpip.h
 do
 
 done
 
-      if test $ac_cv_header_ws2tcpip_h = yes; then
-        HAVE_WS2TCPIP_H=1
-      else
-        HAVE_WS2TCPIP_H=0
-      fi
+    if test $ac_cv_header_ws2tcpip_h = yes; then
+      HAVE_WS2TCPIP_H=1
+    else
+      HAVE_WS2TCPIP_H=0
     fi
+  fi
+
+
+
+  { $as_echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5
+$as_echo_n "checking for struct sockaddr_storage... " >&6; }
+if test "${ac_cv_type_struct_sockaddr_storage+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_struct_sockaddr_storage=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+if (sizeof (struct sockaddr_storage))
+       return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+if (sizeof ((struct sockaddr_storage)))
+         return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_struct_sockaddr_storage=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_storage" >&5
+$as_echo "$ac_cv_type_struct_sockaddr_storage" >&6; }
+if test "x$ac_cv_type_struct_sockaddr_storage" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+_ACEOF
+
+
+fi
+{ $as_echo "$as_me:$LINENO: checking for sa_family_t" >&5
+$as_echo_n "checking for sa_family_t... " >&6; }
+if test "${ac_cv_type_sa_family_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_sa_family_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+if (sizeof (sa_family_t))
+       return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+if (sizeof ((sa_family_t)))
+         return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_sa_family_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5
+$as_echo "$ac_cv_type_sa_family_t" >&6; }
+if test "x$ac_cv_type_sa_family_t" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SA_FAMILY_T 1
+_ACEOF
+
+
+fi
+
+  if test $ac_cv_type_struct_sockaddr_storage = no; then
+    HAVE_STRUCT_SOCKADDR_STORAGE=0
+  fi
+  if test $ac_cv_type_sa_family_t = no; then
+    HAVE_SA_FAMILY_T=0
+  fi
 
 
 
@@ -25493,31 +31516,111 @@ done
 
 
 
-  fi
 
 
 
 
-cat >>confdefs.h <<\_ACEOF
-#define GNULIB_SYS_SOCKET 1
-_ACEOF
 
 
-  { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
-  if test "${ac_cv_path_mkdir+set}" = set; then
+
+
+
+
+
+
+
+
+
+  for gl_func in socket connect accept bind getpeername getsockname getsockopt     listen recv send recvfrom sendto setsockopt shutdown accept4; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_prog in mkdir gmkdir; do
-        for ac_exec_ext in '' $ac_executable_extensions; do
-          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
-          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Some systems require prerequisite headers.  */
+#include <sys/types.h>
+#if !defined __GLIBC__ && HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <sys/select.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_gl_Symbol=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
+
+
+  { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
             'mkdir (GNU coreutils) '* | \
             'mkdir (coreutils) '* | \
             'mkdir (fileutils) '4.1*)
 $as_echo "$MKDIR_P" >&6; }
 
 
+  # Code from module sys_stat:
 
 
 
-  :
-
-
-
-
-
-  if test $ac_cv_func_lstat = yes; then
-    HAVE_LSTAT=1
-  else
-    HAVE_LSTAT=0
-  fi
-
-
 
 
 
@@ -25587,8 +31678,8 @@ if test "${gl_cv_next_sys_stat_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_sys_stat_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_sys_stat_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -25597,20 +31688,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <sys/stat.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/sys/stat.h#{
-                s#.*"\(.*/sys/stat.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_sys_stat_h='<'sys/stat.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/sys/stat.h#{
+                 s#.*"\(.*/sys/stat.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_stat_h" >&5
@@ -25618,9 +31709,16 @@ $as_echo "$gl_cv_next_sys_stat_h" >&6; }
      fi
      NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'sys/stat.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_stat_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
 
 
-  SYS_STAT_H='sys/stat.h'
 
 
       { $as_echo "$as_me:$LINENO: checking for nlink_t" >&5
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+  for gl_func in fchmodat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat     mknod mknodat stat utimensat; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/stat.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_gl_Symbol=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
+
+
   { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
@@ -25776,6 +31955,8 @@ fi
 $as_echo "$MKDIR_P" >&6; }
 
 
+  # Code from module sys_time:
+
 
 
   { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
@@ -25821,6 +32002,8 @@ fi
 $as_echo "$MKDIR_P" >&6; }
 
 
+  # Code from module tempname:
+
 
 
 
@@ -25837,10 +32020,17 @@ $as_echo "$MKDIR_P" >&6; }
   :
 
 
+  # Code from module threadlib:
 
 
 
 
+  # Code from module time:
+
+
+
+  # Code from module unistd:
+
 
 
 
@@ -25865,8 +32055,8 @@ if test "${gl_cv_next_unistd_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_unistd_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_unistd_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -25875,20 +32065,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <unistd.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/unistd.h#{
-                s#.*"\(.*/unistd.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_unistd_h='<'unistd.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/unistd.h#{
+                 s#.*"\(.*/unistd.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_unistd_h='<'unistd.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_unistd_h" >&5
@@ -25896,6 +32086,15 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
      fi
      NEXT_UNISTD_H=$gl_cv_next_unistd_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'unistd.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_unistd_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
+
 
 
 
@@ -25915,20 +32114,6 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
 
 
 
-  :
-
-
-
-
-
-  if test $ac_cv_func_vasnprintf = no; then
-
-
-  :
-
-
-
-
 
 
 
@@ -25938,7 +32123,6 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext"
 
 
 
@@ -25948,7 +32132,6 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
 
 
 
@@ -25958,7 +32141,6 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
 
 
 
@@ -25968,77 +32150,36 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
 
-  if test $ac_cv_func_vasnprintf = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define REPLACE_VASNPRINTF 1
-_ACEOF
-
-  fi
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:$LINENO: checking for ptrdiff_t" >&5
-$as_echo_n "checking for ptrdiff_t... " >&6; }
-if test "${ac_cv_type_ptrdiff_t+set}" = set; then
+  for gl_func in chown dup2 dup3 environ euidaccess faccessat fchdir fchownat     fsync ftruncate getcwd getdomainname getdtablesize getgroups     gethostname getlogin getlogin_r getpagesize getusershell setusershell     endusershell lchown link linkat lseek pipe2 pread pwrite readlink     readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat     usleep; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_type_ptrdiff_t=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if (sizeof (ptrdiff_t))
-       return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+#include <unistd.h>
+/* Some systems declare various items in the wrong headers.  */
+#ifndef __GLIBC__
+# include <fcntl.h>
+# include <stdio.h>
+# include <stdlib.h>
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+
 int
 main ()
 {
-if (sizeof ((ptrdiff_t)))
-         return 0;
+#undef $gl_func
+  (void) $gl_func;
   ;
   return 0;
 }
@@ -26061,40 +32202,46 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  :
+  eval "$as_gl_Symbol=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_ptrdiff_t=yes
+       eval "$as_gl_Symbol=no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+                     eval ac_cv_have_decl_$gl_func=yes
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5
-$as_echo "$ac_cv_type_ptrdiff_t" >&6; }
-if test "x$ac_cv_type_ptrdiff_t" = x""yes; then
+
+      done
+
+
+  # Code from module vasnprintf:
+
+
   :
-else
 
-cat >>confdefs.h <<\_ACEOF
-#define ptrdiff_t long
-_ACEOF
 
 
-fi
 
 
+  if test $ac_cv_func_vasnprintf = no; then
 
 
+  :
 
 
 
 
 
 
-for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef $ac_func
+  gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext"
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
 
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
-fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
+
+  if test $ac_cv_func_vasnprintf = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define REPLACE_VASNPRINTF 1
 _ACEOF
 
-fi
-done
+  fi
 
-      { $as_echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5
-$as_echo_n "checking whether _snprintf is declared... " >&6; }
-if test "${ac_cv_have_decl__snprintf+set}" = set; then
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking for ptrdiff_t" >&5
+$as_echo_n "checking for ptrdiff_t... " >&6; }
+if test "${ac_cv_type_ptrdiff_t+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_ptrdiff_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdio.h>
-
+$ac_includes_default
 int
 main ()
 {
-#ifndef _snprintf
-  (void) _snprintf;
-#endif
-
+if (sizeof (ptrdiff_t))
+       return 0;
   ;
   return 0;
 }
@@ -26247,67 +32344,18 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl__snprintf=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_have_decl__snprintf=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5
-$as_echo "$ac_cv_have_decl__snprintf" >&6; }
-if test "x$ac_cv_have_decl__snprintf" = x""yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL__SNPRINTF 1
-_ACEOF
-
-
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL__SNPRINTF 0
-_ACEOF
-
-
-fi
-
-
-
-
-
-
-  fi
-
-
-
-  CFLAG_VISIBILITY=
-  HAVE_VISIBILITY=0
-  if test -n "$GCC"; then
-    { $as_echo "$as_me:$LINENO: checking for simple visibility declarations" >&5
-$as_echo_n "checking for simple visibility declarations... " >&6; }
-    if test "${gl_cv_cc_visibility+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -fvisibility=hidden"
-      cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-extern __attribute__((__visibility__("hidden"))) int hiddenvar;
-         extern __attribute__((__visibility__("default"))) int exportedvar;
-         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
-         extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+$ac_includes_default
 int
 main ()
 {
-
+if (sizeof ((ptrdiff_t)))
+         return 0;
   ;
   return 0;
 }
@@ -26330,99 +32378,57 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  gl_cv_cc_visibility=yes
+  :
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       gl_cv_cc_visibility=no
+       ac_cv_type_ptrdiff_t=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-      CFLAGS="$gl_save_CFLAGS"
-fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    { $as_echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5
-$as_echo "$gl_cv_cc_visibility" >&6; }
-    if test $gl_cv_cc_visibility = yes; then
-      CFLAG_VISIBILITY="-fvisibility=hidden"
-      HAVE_VISIBILITY=1
-    fi
-  fi
 
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5
+$as_echo "$ac_cv_type_ptrdiff_t" >&6; }
+if test "x$ac_cv_type_ptrdiff_t" = x""yes; then
+  :
+else
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_VISIBILITY $HAVE_VISIBILITY
+cat >>confdefs.h <<\_ACEOF
+#define ptrdiff_t long
 _ACEOF
 
 
+fi
+
 
 
-  { $as_echo "$as_me:$LINENO: checking whether <wchar.h> is standalone" >&5
-$as_echo_n "checking whether <wchar.h> is standalone... " >&6; }
-if test "${gl_cv_header_wchar_h_standalone+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#include <wchar.h>
-wchar_t w;
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  gl_cv_header_wchar_h_standalone=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       gl_cv_header_wchar_h_standalone=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_standalone" >&5
-$as_echo "$gl_cv_header_wchar_h_standalone" >&6; }
 
 
-  if test $gt_cv_c_wint_t = yes; then
-    HAVE_WINT_T=1
-  else
-    HAVE_WINT_T=0
   fi
 
+  # Code from module verify:
+  # Code from module warn-on-use:
+  # Code from module wchar:
 
-  if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then
-    WCHAR_H=wchar.h
-  fi
 
 
-  :
 
+  :
 
 
 
 
-  if test $ac_cv_header_wchar_h = yes; then
-    HAVE_WCHAR_H=1
-  else
-    HAVE_WCHAR_H=0
-  fi
 
 
 
@@ -26445,8 +32451,8 @@ if test "${gl_cv_next_wchar_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_wchar_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_wchar_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -26455,20 +32461,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <wchar.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/wchar.h#{
-                s#.*"\(.*/wchar.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_wchar_h='<'wchar.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/wchar.h#{
+                 s#.*"\(.*/wchar.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_wchar_h='<'wchar.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_wchar_h" >&5
@@ -26476,50 +32482,50 @@ $as_echo "$gl_cv_next_wchar_h" >&6; }
      fi
      NEXT_WCHAR_H=$gl_cv_next_wchar_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'wchar.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_wchar_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
 
 
 
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
+  else
+    HAVE_WCHAR_H=0
+  fi
 
 
 
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
+  fi
 
 
-  :
 
 
 
 
 
-  if test $ac_cv_func_wcrtomb = no; then
-    HAVE_WCRTOMB=0
-  else
 
 
 
 
 
 
-         { $as_echo "$as_me:$LINENO: checking whether wcrtomb return value is correct" >&5
-$as_echo_n "checking whether wcrtomb return value is correct... " >&6; }
-if test "${gl_cv_func_wcrtomb_retval+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
 
-                        case "$host_os" in
-                           # Guess no on OSF/1 and Solaris.
-          osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
-                           # Guess yes otherwise.
-          *)               gl_cv_func_wcrtomb_retval="guessing yes" ;;
-        esac
-        if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
-          if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+  for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb     wcsrtombs wcsnrtombs wcwidth; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26528,104 +32534,74 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include <locale.h>
-#include <stdio.h>
-#include <string.h>
+/* Some systems require additional headers.  */
+#ifndef __GLIBC__
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
 #include <wchar.h>
-int main ()
+
+int
+main ()
 {
-  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
-    {
-      if (wcrtomb (NULL, 0, NULL) != 1)
-        return 1;
-    }
-  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
-    {
-      if (wcrtomb (NULL, 0, NULL) != 1)
-        return 1;
-    }
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      if (wcrtomb (NULL, 0, NULL) != 1)
-        return 1;
-    }
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
-    {
-      if (wcrtomb (NULL, 0, NULL) != 1)
-        return 1;
-    }
+#undef $gl_func
+  (void) $gl_func;
+  ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gl_cv_func_wcrtomb_retval=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-gl_cv_func_wcrtomb_retval=no
+       eval "$as_gl_Symbol=no"
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-        fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_wcrtomb_retval" >&5
-$as_echo "$gl_cv_func_wcrtomb_retval" >&6; }
-    case "$gl_cv_func_wcrtomb_retval" in
-      *yes) ;;
-      *) REPLACE_WCRTOMB=1 ;;
-    esac
-  fi
-  if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
-
-
-  WCHAR_H=wchar.h
-
-
-
-
-
-
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
 
+      done
 
-  gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext"
 
+  # Code from module wcrtomb:
 
-  :
 
-  fi
 
 
 
-  GNULIB_WCRTOMB=1
 
 
 
@@ -26636,12 +32612,6 @@ $as_echo "$gl_cv_func_wcrtomb_retval" >&6; }
 
 
 
-  if test $ac_cv_func_iswcntrl = yes; then
-    HAVE_ISWCNTRL=1
-  else
-    HAVE_ISWCNTRL=0
-  fi
-
 
   :
 
@@ -26649,86 +32619,52 @@ $as_echo "$gl_cv_func_wcrtomb_retval" >&6; }
 
 
 
+  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
 
 
 
-  if test $gt_cv_c_wint_t = yes; then
-    HAVE_WINT_T=1
-  else
-    HAVE_WINT_T=0
-  fi
-
-
-  WCTYPE_H=wctype.h
-  if test $ac_cv_header_wctype_h = yes; then
-    if test $ac_cv_func_iswcntrl = yes; then
-                  { $as_echo "$as_me:$LINENO: checking whether iswcntrl works" >&5
-$as_echo_n "checking whether iswcntrl works... " >&6; }
-if test "${gl_cv_func_iswcntrl_works+set}" = set; then
+     { $as_echo "$as_me:$LINENO: checking whether mbrtowc handles incomplete characters" >&5
+$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
+if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test "$cross_compiling" = yes; then
+                  case "$host_os" in
+                     # Guess no on AIX and OSF/1.
+        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+                     # Guess yes otherwise.
+        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+      esac
+      if test $LOCALE_JA != none; then
+        if test "$cross_compiling" = yes; then
+  :
+else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdlib.h>
-                          #if __GNU_LIBRARY__ == 1
-                          Linux libc5 i18n is broken.
-                          #endif
-int
-main ()
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
 {
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
-  ;
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        if (mbsinit (&state))
+          return 1;
+    }
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  gl_cv_func_iswcntrl_works=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       gl_cv_func_iswcntrl_works=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stddef.h>
-                      #include <stdio.h>
-                      #include <time.h>
-                      #include <wchar.h>
-                      #include <wctype.h>
-                      int main () { return iswprint ('x') == 0; }
-_ACEOF
 rm -f conftest$ac_exeext
 if { (ac_try="$ac_link"
 case "(($ac_try" in
@@ -26751,27 +32687,457 @@ $as_echo "$ac_try_echo") >&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  gl_cv_func_iswcntrl_works=yes
+  gl_cv_func_mbrtowc_incomplete_state=yes
 else
   $as_echo "$as_me: program exited with status $ac_status" >&5
 $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-gl_cv_func_iswcntrl_works=no
+gl_cv_func_mbrtowc_incomplete_state=no
 fi
 rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
+      fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_iswcntrl_works" >&5
-$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
-      if test $gl_cv_func_iswcntrl_works = yes; then
-        WCTYPE_H=
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
+
+
+
+
+     { $as_echo "$as_me:$LINENO: checking whether mbrtowc works as well as mbtowc" >&5
+$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+                  case "$host_os" in
+                    # Guess no on Solaris 8.
+        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
+                    # Guess yes otherwise.
+        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
+      esac
+      if test $LOCALE_ZH_CN != none; then
+        if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  /* This fails on Solaris 8:
+     mbrtowc returns 2, and sets wc to 0x00F0.
+     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 6, &state) != 4
+          && mbtowc (&wc, input + 3, 6) == 4)
+        return 1;
+    }
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_mbrtowc_sanitycheck=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
       fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
+
+    REPLACE_MBSTATE_T=0
+    case "$gl_cv_func_mbrtowc_incomplete_state" in
+      *yes) ;;
+      *) REPLACE_MBSTATE_T=1 ;;
+    esac
+    case "$gl_cv_func_mbrtowc_sanitycheck" in
+      *yes) ;;
+      *) REPLACE_MBSTATE_T=1 ;;
+    esac
+  else
+    REPLACE_MBSTATE_T=1
+  fi
+  if test $REPLACE_MBSTATE_T = 1; then
+
+    :
+
+  fi
+
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_func_wcrtomb = no; then
+    HAVE_WCRTOMB=0
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_WCRTOMB=1
+    else
+
+
+
+
+
+             { $as_echo "$as_me:$LINENO: checking whether wcrtomb return value is correct" >&5
+$as_echo_n "checking whether wcrtomb return value is correct... " >&6; }
+if test "${gl_cv_func_wcrtomb_retval+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+                              case "$host_os" in
+                                     # Guess no on AIX 4, OSF/1 and Solaris.
+            aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
+                                     # Guess yes otherwise.
+            *)                       gl_cv_func_wcrtomb_retval="guessing yes" ;;
+          esac
+          if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
+            if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+    {
+      if (wcrtomb (NULL, 0, NULL) != 1)
+        return 1;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      if (wcrtomb (NULL, 0, NULL) != 1)
+        return 1;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      if (wcrtomb (NULL, 0, NULL) != 1)
+        return 1;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      if (wcrtomb (NULL, 0, NULL) != 1)
+        return 1;
+    }
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_wcrtomb_retval=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_wcrtomb_retval=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+          fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_wcrtomb_retval" >&5
+$as_echo "$gl_cv_func_wcrtomb_retval" >&6; }
+      case "$gl_cv_func_wcrtomb_retval" in
+        *yes) ;;
+        *) REPLACE_WCRTOMB=1 ;;
+      esac
+    fi
+  fi
+  if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
+
+    :
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext"
+
+
+  :
+
+  fi
+
+
+
+
+  GNULIB_WCRTOMB=1
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_WCRTOMB 1
+_ACEOF
+
+
+
+  # Code from module wctype:
+
+
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_func_iswcntrl = yes; then
+    HAVE_ISWCNTRL=1
+  else
+    HAVE_ISWCNTRL=0
+  fi
+
+
+  :
+
+
+
+
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_func_iswblank = yes; then
+    HAVE_ISWBLANK=1
+    REPLACE_ISWBLANK=0
+  else
+    HAVE_ISWBLANK=0
+    if test $ac_cv_have_decl_iswblank = yes; then
+      REPLACE_ISWBLANK=1
+    else
+      REPLACE_ISWBLANK=0
+    fi
+  fi
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
+  fi
+
+
+  if test $ac_cv_header_wctype_h = yes; then
+    if test $ac_cv_func_iswcntrl = yes; then
+                  { $as_echo "$as_me:$LINENO: checking whether iswcntrl works" >&5
+$as_echo_n "checking whether iswcntrl works... " >&6; }
+if test "${gl_cv_func_iswcntrl_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+          if test "$cross_compiling" = yes; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+                          #if __GNU_LIBRARY__ == 1
+                          Linux libc5 i18n is broken.
+                          #endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_func_iswcntrl_works=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_func_iswcntrl_works=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+                            #include <stddef.h>
+                            #include <stdio.h>
+                            #include <time.h>
+                            #include <wchar.h>
+                            #include <wctype.h>
+                            int main () { return iswprint ('x') == 0; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_iswcntrl_works=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_iswcntrl_works=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_iswcntrl_works" >&5
+$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
     fi
 
 
@@ -26794,8 +33160,8 @@ if test "${gl_cv_next_wctype_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-         if test $ac_cv_header_wctype_h = yes; then
-           cat >conftest.$ac_ext <<_ACEOF
+          if test $ac_cv_header_wctype_h = yes; then
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -26804,20 +33170,20 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <wctype.h>
 
 _ACEOF
-                                                                   case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-                                   gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-              sed -n '\#/wctype.h#{
-                s#.*"\(.*/wctype.h\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'
-         else
-           gl_cv_next_wctype_h='<'wctype.h'>'
-         fi
+                                                                                                case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+                                                gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+               sed -n '\#/wctype.h#{
+                 s#.*"\(.*/wctype.h\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'
+          else
+            gl_cv_next_wctype_h='<'wctype.h'>'
+          fi
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_wctype_h" >&5
@@ -26825,6 +33191,15 @@ $as_echo "$gl_cv_next_wctype_h" >&6; }
      fi
      NEXT_WCTYPE_H=$gl_cv_next_wctype_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'wctype.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_wctype_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
+
 
 
     HAVE_WCTYPE_H=1
@@ -26833,7 +33208,6 @@ $as_echo "$gl_cv_next_wctype_h" >&6; }
   fi
 
 
-
   if test "$gl_cv_func_iswcntrl_works" = no; then
     REPLACE_ISWCNTRL=1
   else
@@ -26841,6 +33215,8 @@ $as_echo "$gl_cv_next_wctype_h" >&6; }
   fi
 
 
+  # Code from module write:
+
 
 
 
@@ -26851,6 +33227,15 @@ $as_echo "$gl_cv_next_wctype_h" >&6; }
 
 
 
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_WRITE 1
+_ACEOF
+
+
+
+  # Code from module xsize:
+
+
 
 
 for ac_header in stdint.h
@@ -26999,6 +33384,7 @@ fi
 done
 
 
+  # End of code from modules
 
 
 
@@ -27020,6 +33406,11 @@ done
 
 
   gl_source_base='tests'
+  gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
+
+  gl_module_indicator_condition=$gltests_WITNESS
+
+
 
 
 
@@ -27337,7 +33728,7 @@ no group specified (--with-group) -- using 'backup'
 AAW_EOF
 
 
-           CLIENT_LOGIN=backup
+           SETUID_GROUP=backup
 
 
 fi
 if test "${enable_syntax_checks+set}" = set; then
   enableval=$enable_syntax_checks;
            case "$enableval" in
-               no) CHECK_SCRIPTS_AT_BUILD=false;;
-               *) CHECK_SCRIPTS_AT_BUILD=true;;
+               no) SYNTAX_CHECKS=false;;
+               *)
+                   SYNTAX_CHECKS=true
+
+    { $as_echo "$as_me:$LINENO: WARNING: --enable-syntax-checks can cause build failures and should only be used by developers" >&5
+$as_echo "$as_me: WARNING: --enable-syntax-checks can cause build failures and should only be used by developers" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+--enable-syntax-checks can cause build failures and should only be used by developers
+AAW_EOF
+
+
+                   ;;
            esac
 
 else
 
-           CHECK_SCRIPTS_AT_BUILD=true
+           SYNTAX_CHECKS=false
 
 fi
 
 
-     if $CHECK_SCRIPTS_AT_BUILD; then
-  CHECK_SCRIPTS_AT_BUILD_TRUE=
-  CHECK_SCRIPTS_AT_BUILD_FALSE='#'
+     if $SYNTAX_CHECKS; then
+  SYNTAX_CHECKS_TRUE=
+  SYNTAX_CHECKS_FALSE='#'
 else
-  CHECK_SCRIPTS_AT_BUILD_TRUE='#'
-  CHECK_SCRIPTS_AT_BUILD_FALSE=
+  SYNTAX_CHECKS_TRUE='#'
+  SYNTAX_CHECKS_FALSE=
 fi
 
 
@@ -29311,230 +35714,37 @@ _ACEOF
 
 
 
-    # Extract the first word of "chio", so it can be a program name with args.
-set dummy chio; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CHIO+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $CHIO in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_CHIO="$CHIO" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_CHIO="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_CHIO" && ac_cv_path_CHIO="chio"
-  ;;
-esac
-fi
-CHIO=$ac_cv_path_CHIO
-if test -n "$CHIO"; then
-  { $as_echo "$as_me:$LINENO: result: $CHIO" >&5
-$as_echo "$CHIO" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-    # Extract the first word of "chs", so it can be a program name with args.
-set dummy chs; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CHS+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $CHS in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_CHS="$CHS" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_CHS="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_CHS" && ac_cv_path_CHS="chs"
-  ;;
-esac
-fi
-CHS=$ac_cv_path_CHS
-if test -n "$CHS"; then
-  { $as_echo "$as_me:$LINENO: result: $CHS" >&5
-$as_echo "$CHS" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-    # Extract the first word of "mtx", so it can be a program name with args.
-set dummy mtx; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MTX+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $MTX in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MTX="$MTX" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_MTX="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_MTX" && ac_cv_path_MTX="mtx"
-  ;;
-esac
-fi
-MTX=$ac_cv_path_MTX
-if test -n "$MTX"; then
-  { $as_echo "$as_me:$LINENO: result: $MTX" >&5
-$as_echo "$MTX" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-    # Extract the first word of "mcutil", so it can be a program name with args.
-set dummy mcutil; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MCUTIL+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $MCUTIL in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MCUTIL="$MCUTIL" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_MCUTIL="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_MCUTIL" && ac_cv_path_MCUTIL="mcutil"
-  ;;
-esac
-fi
-MCUTIL=$ac_cv_path_MCUTIL
-if test -n "$MCUTIL"; then
-  { $as_echo "$as_me:$LINENO: result: $MCUTIL" >&5
-$as_echo "$MCUTIL" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 
+for ac_header in fstab.h \
+       mntent.h \
+       mnttab.h \
+       sys/vfstab.h \
 
-for ac_header in \
-       camlib.h \
-       chio.h \
-       linux/chio.h \
-       scsi/sg.h \
-       scsi/scsi_ioctl.h \
-       sys/chio.h \
-       sys/dsreq.h \
-       sys/mtio.h \
-       sys/scarray.h \
-       sys/gscdds.h \
-       sys/scsi.h \
-       sys/scsiio.h \
-       sys/scsi/impl/uscsi.h \
-       sys/scsi/scsi/ioctl.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
 $as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -29555,40 +35765,115 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
+  ac_header_compiler=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_Header=no"
+       ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 ac_res=`eval 'as_val=${'$as_ac_Header'}
                 $as_echo "$as_val"'`
               { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
+
+fi
 as_val=`eval 'as_val=${'$as_ac_Header'}
                 $as_echo "$as_val"'`
    if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
- \
 
 fi
 
 done
 
 
-    #
-    # chio support
-    #
-    if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
-       { $as_echo "$as_me:$LINENO: checking for HP/UX-like scsi changer support" >&5
-$as_echo_n "checking for HP/UX-like scsi changer support... " >&6; }
-if test "${amanda_cv_hpux_scsi_chio+set}" = set; then
+
+for ac_func in endmntent
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -29597,31 +35882,54 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
 
-#include <sys/scsi.h>
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
 
 int
 main ()
 {
-
-           static struct element_addresses changer_info;
-           int i = SIOC_ELEMENT_ADDRESSES;
-           int j = SIOC_ELEMENT_STATUS;
-           int k = SIOC_MOVE_MEDIUM;
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -29630,33 +35938,43 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  amanda_cv_hpux_scsi_chio=yes
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       amanda_cv_hpux_scsi_chio=no
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi_chio" >&5
-$as_echo "$amanda_cv_hpux_scsi_chio" >&6; }
-       if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then
-           WANT_SCSI_HPUX=yes
-           WANT_CHG_SCSI=yes
-       fi
-    fi
+done
 
-    #
-    # Linux SCSI based on ioctl
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then
-           { $as_echo "$as_me:$LINENO: checking for Linux like scsi support (ioctl)" >&5
-$as_echo_n "checking for Linux like scsi support (ioctl)... " >&6; }
-if test "${amanda_cv_linux_scsi+set}" = set; then
+
+for ac_func in setmntent
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -29665,31 +35983,54 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
-#include <scsi/scsi_ioctl.h>
-#include <sys/mtio.h>
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
 
 int
 main ()
 {
-
-           int device;
-           char *Command;
-           ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command);
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -29698,54 +36039,73 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  amanda_cv_linux_scsi=yes
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       amanda_cv_linux_scsi=no
+       eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_linux_scsi" >&5
-$as_echo "$amanda_cv_linux_scsi" >&6; }
-    fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
-    #
-    # Linux SCSI based on sg
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_scsi_sg_h" = x"yes"; then
-           { $as_echo "$as_me:$LINENO: checking for Linux like scsi support (sg)" >&5
-$as_echo_n "checking for Linux like scsi support (sg)... " >&6; }
-if test "${amanda_cv_linux_sg_scsi+set}" = set; then
+fi
+done
+
+
+
+
+
+
+
+
+for ac_header in fcntl.h \
+        sys/fcntl.h \
+       sys/types.h \
+       sys/file.h \
+       unistd.h \
+
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#include <sys/types.h>
-#include <scsi/sg.h>
-#include <sys/mtio.h>
-
-int
-main ()
-{
-
-           int device;
-           struct sg_header *psg_header;
-           char *buffer;
-           write(device, buffer, 1);
-
-  ;
-  return 0;
-}
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -29765,208 +36125,163 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  amanda_cv_linux_sg_scsi=yes
+  ac_header_compiler=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       amanda_cv_linux_sg_scsi=no
+       ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_linux_sg_scsi" >&5
-$as_echo "$amanda_cv_linux_sg_scsi" >&6; }
-    fi
-
-    if test x"$amanda_cv_linux_scsi" = x"yes" ||
-     test x"$amanda_cv_linux_sg_scsi" = x"yes";then
-           WANT_SCSI_LINUX=yes
-           WANT_CHG_SCSI=yes
-    fi
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
-    #
-    # HP-UX SCSI
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
-           { $as_echo "$as_me:$LINENO: checking for HP-UX like scsi support" >&5
-$as_echo_n "checking for HP-UX like scsi support... " >&6; }
-if test "${amanda_cv_hpux_scsi+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <sys/scsi.h>
-#include <sys/mtio.h>
-
-int
-main ()
-{
-
-           int device;
-           char *Command;
-           ioctl(device, SIOC_IO, Command);
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  amanda_cv_hpux_scsi=yes
+       }; then
+  ac_header_preproc=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       amanda_cv_hpux_scsi=no
+  ac_header_preproc=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi" >&5
-$as_echo "$amanda_cv_hpux_scsi" >&6; }
-           if test x"$amanda_cv_hpux_scsi" = x"yes";then
-                   WANT_SCSI_HPUX_NEW=yes
-                   WANT_CHG_SCSI=yes
-                   WANT_CHG_SCSI_CHIO=yes
-           fi
-    fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
-    #
-    # IRIX SCSI
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then
-           { $as_echo "$as_me:$LINENO: checking for Irix like scsi support" >&5
-$as_echo_n "checking for Irix like scsi support... " >&6; }
-if test "${amanda_cv_irix_scsi+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#include <sys/types.h>
-#include <sys/dsreq.h>
-#include <sys/mtio.h>
-
-int
-main ()
-{
-
-           int device=1;
-           char Command;
-           ioctl(device, DS_ENTER, &Command);
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
+    ;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  amanda_cv_irix_scsi=yes
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
-       amanda_cv_irix_scsi=no
 fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_irix_scsi" >&5
-$as_echo "$amanda_cv_irix_scsi" >&6; }
-           if test x"$amanda_cv_irix_scsi" = x"yes";then
-                   WANT_SCSI_IRIX=yes
-                   WANT_CHG_SCSI=yes
-           fi
-    fi
 
-    #
-    # Solaris  SCSI
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then
-           { $as_echo "$as_me:$LINENO: checking for Solaris-like scsi support" >&5
-$as_echo_n "checking for Solaris-like scsi support... " >&6; }
-if test "${amanda_cv_solaris_scsi+set}" = set; then
+done
+
+
+    # find a working file-locking mechanism.
+    # Note: these all use AC_TRY_LINK to make sure that we can compile
+    # and link each variant.  They do not try to test the variants --
+    # that is left to runtime.
+    LOCKING="no"
+
+    # check POSIX locking
+    { $as_echo "$as_me:$LINENO: checking whether POSIX locking (with fcntl(2)) is available" >&5
+$as_echo_n "checking whether POSIX locking (with fcntl(2)) is available... " >&6; }
+if test "${amanda_cv_posix_filelocking+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include <sys/types.h>
-#include <sys/scsi/impl/uscsi.h>
-#include <sys/mtio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
 
 int
 main ()
 {
 
-           int device;
-           char *Command;
-           ioctl(device, USCSICMD, Command);
+           struct flock lock;
+
+           lock.l_type = F_RDLCK;
+           lock.l_start = 0;
+           lock.l_whence = SEEK_CUR;
+           lock.l_len = 0;
+           return fcntl(1, F_SETLK, &lock);
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -29975,68 +36290,84 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  amanda_cv_solaris_scsi=yes
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+
+       amanda_cv_posix_filelocking="yes"
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       amanda_cv_solaris_scsi=no
+
+       amanda_cv_posix_filelocking="no"
+
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_solaris_scsi" >&5
-$as_echo "$amanda_cv_solaris_scsi" >&6; }
-           if test x"$amanda_cv_solaris_scsi" = x"yes";then
-                   WANT_SCSI_SOLARIS=yes
-                   WANT_CHG_SCSI=yes
-           fi
+{ $as_echo "$as_me:$LINENO: result: $amanda_cv_posix_filelocking" >&5
+$as_echo "$amanda_cv_posix_filelocking" >&6; }
+    if test "x$amanda_cv_posix_filelocking" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WANT_AMFLOCK_POSIX 1
+_ACEOF
+
+       WANT_AMFLOCK_POSIX="yes"
+       LOCKING="POSIX_FCNTL"
     fi
+     if test x"$WANT_AMFLOCK_POSIX" = x"yes"; then
+  WANT_AMFLOCK_POSIX_TRUE=
+  WANT_AMFLOCK_POSIX_FALSE='#'
+else
+  WANT_AMFLOCK_POSIX_TRUE='#'
+  WANT_AMFLOCK_POSIX_FALSE=
+fi
 
-    #
-    # AIX SCSI
-    #
-    if test x"$ac_cv_header_sys_tape_h" = x"yes" &&
-       test x"$ac_cv_header_sys_scarray_h" = x"yes" &&
-       test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then
-           { $as_echo "$as_me:$LINENO: checking for AIX like scsi support" >&5
-$as_echo_n "checking for AIX like scsi support... " >&6; }
-if test "${amanda_cv_aix_scsi+set}" = set; then
+
+    # check flock-based (BSD) locking
+    { $as_echo "$as_me:$LINENO: checking whether flock locking is available" >&5
+$as_echo_n "checking whether flock locking is available... " >&6; }
+if test "${amanda_cv_flock_filelocking+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include <sys/types.h>
-#include <sys/scarray.h>
-#include <sys/tape.h>
+#if HAVE_SYS_FILE_H
+# include <sys/file.h>
+#endif
 
 int
 main ()
 {
 
-           int device;
-           char *Command;
-           ioctl(device, STIOCMD, Command);
+           return flock(1, LOCK_SH);
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -30045,113 +36376,71 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  amanda_cv_aix_scsi=yes
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+
+       amanda_cv_flock_filelocking="yes"
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       amanda_cv_aix_scsi=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_aix_scsi" >&5
-$as_echo "$amanda_cv_aix_scsi" >&6; }
-           if test x"$amanda_cv_aix_scsi" = x"yes";then
-                   WANT_SCSI_AIX=yes
-                   WANT_CHG_SCSI=yes
-           fi
-    fi
-    #
-    # BSD CAM SCSI
-    #
-    if test x"$ac_cv_header_cam_cam_h" = x"yes";then
-           { $as_echo "$as_me:$LINENO: checking for CAM like scsi support" >&5
-$as_echo_n "checking for CAM like scsi support... " >&6; }
-if test "${amanda_cv_cam_scsi+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-#include <stdio.h>
-# include <fcntl.h>
-# include <cam/cam.h>
-# include <cam/cam_ccb.h>
-# include <cam/scsi/scsi_message.h>
-# include <cam/scsi/scsi_pass.h>
-# include <camlib.h>
+       amanda_cv_flock_filelocking="no"
 
-int
-main ()
-{
+fi
 
-           struct cam_device *curdev;
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 
-           curdev = cam_open_pass("", O_RDWR, NULL);
+fi
+{ $as_echo "$as_me:$LINENO: result: $amanda_cv_flock_filelocking" >&5
+$as_echo "$amanda_cv_flock_filelocking" >&6; }
+    if test "x$amanda_cv_flock_filelocking" = xyes; then
 
-  ;
-  return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define WANT_AMFLOCK_FLOCK 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  amanda_cv_cam_scsi=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       amanda_cv_cam_scsi=no
+       WANT_AMFLOCK_FLOCK="yes"
+       LOCKING="FLOCK"
+    fi
+     if test x"$WANT_AMFLOCK_FLOCK" = x"yes"; then
+  WANT_AMFLOCK_FLOCK_TRUE=
+  WANT_AMFLOCK_FLOCK_FALSE='#'
+else
+  WANT_AMFLOCK_FLOCK_TRUE='#'
+  WANT_AMFLOCK_FLOCK_FALSE=
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_cam_scsi" >&5
-$as_echo "$amanda_cv_cam_scsi" >&6; }
-           if test x"$amanda_cv_cam_scsi" = x"yes";then
-                   WANT_SCSI_CAM=yes
-                   WANT_CHG_SCSI=yes
 
-{ $as_echo "$as_me:$LINENO: checking for main in -lcam" >&5
-$as_echo_n "checking for main in -lcam... " >&6; }
-if test "${ac_cv_lib_cam_main+set}" = set; then
+    # check lockf-based (SVR2, SVR3, SVR4) locking
+    { $as_echo "$as_me:$LINENO: checking whether lockf(3) locking is available" >&5
+$as_echo_n "checking whether lockf(3) locking is available... " >&6; }
+if test "${amanda_cv_lockf_filelocking+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcam  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 
 int
 main ()
 {
-return main ();
+
+           return lockf(1, F_LOCK, 0);
+
   ;
   return 0;
 }
@@ -30177,76 +36466,80 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_cam_main=yes
+
+       amanda_cv_lockf_filelocking="yes"
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_cam_main=no
+
+       amanda_cv_lockf_filelocking="no"
+
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cam_main" >&5
-$as_echo "$ac_cv_lib_cam_main" >&6; }
-if test "x$ac_cv_lib_cam_main" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCAM 1
-_ACEOF
-
-  LIBS="-lcam $LIBS"
 
 fi
+{ $as_echo "$as_me:$LINENO: result: $amanda_cv_lockf_filelocking" >&5
+$as_echo "$amanda_cv_lockf_filelocking" >&6; }
+    if test "x$amanda_cv_lockf_filelocking" = xyes; then
 
-           fi
+cat >>confdefs.h <<\_ACEOF
+#define WANT_AMFLOCK_LOCKF 1
+_ACEOF
+
+       WANT_AMFLOCK_LOCKF="yes"
+       LOCKING="LOCKF"
     fi
+     if test x"$WANT_AMFLOCK_LOCKF" = x"yes"; then
+  WANT_AMFLOCK_LOCKF_TRUE=
+  WANT_AMFLOCK_LOCKF_FALSE='#'
+else
+  WANT_AMFLOCK_LOCKF_TRUE='#'
+  WANT_AMFLOCK_LOCKF_FALSE=
+fi
 
 
-    #
-    # BSD SCSI
-    #
-    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-       test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then
-       { $as_echo "$as_me:$LINENO: checking for BSD like scsi support" >&5
-$as_echo_n "checking for BSD like scsi support... " >&6; }
-if test "${amanda_cv_bsd_scsi+set}" = set; then
+    # check our homebrew hardlink-based locking (requires hardlinks)
+    { $as_echo "$as_me:$LINENO: checking whether link(2) is available for locking" >&5
+$as_echo_n "checking whether link(2) is available for locking... " >&6; }
+if test "${amanda_cv_lnlock_filelocking+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include <sys/types.h>
-#include <sys/scsiio.h>
-#include <sys/mtio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 
 int
 main ()
 {
 
-       int device=1;
-       char Command;
-       ioctl(device, SCIOCCOMMAND, &Command);
+           return link("/tmp/foo", "/tmp/bar");
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -30255,3122 +36548,687 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  amanda_cv_bsd_scsi=yes
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+
+       amanda_cv_lnlock_filelocking="yes"
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       amanda_cv_bsd_scsi=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       amanda_cv_lnlock_filelocking="no"
+
 fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_bsd_scsi" >&5
-$as_echo "$amanda_cv_bsd_scsi" >&6; }
-       if test x"$amanda_cv_bsd_scsi" = x"yes";then
-          WANT_SCSI_BSD=yes
-          WANT_CHG_SCSI=yes
-       fi
-    fi
 
-    # Do not build chg-scsi-chio if we cannot find the needed support
-    # include files for the SCSI interfaces
-    # chio.h and sys/chio.h are chio based systems
-    if test x"$ac_cv_header_chio_h" = x"yes" ||
-       test x"$ac_cv_header_linux_chio_h" = x"yes" ||
-       test x"$ac_cv_header_sys_chio_h" = x"yes"; then
-       # chg-scsi does not support FreeBSD 3.0's chio.h; it became backward
-       # incompatible with the introduction of camlib.h
-       if test x"$ac_cv_header_camlib_h" != x"yes"; then
-        WANT_SCSI_CHIO=yes
-        # prefer to use chg-scsi, unless we already have a driver for that,
-        # in which case set it up as chg-scsi-chio.
-        if test x"$WANT_CHG_SCSI" = x"no"; then
-          WANT_CHG_SCSI=yes
-        else
-          WANT_CHG_SCSI_CHIO=yes
-        fi
-       fi
-    fi
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 
-    # scsi-based implementations
-     if test x"$WANT_CHG_SCSI" = x"yes"; then
-  WANT_CHG_SCSI_TRUE=
-  WANT_CHG_SCSI_FALSE='#'
-else
-  WANT_CHG_SCSI_TRUE='#'
-  WANT_CHG_SCSI_FALSE=
 fi
+{ $as_echo "$as_me:$LINENO: result: $amanda_cv_lnlock_filelocking" >&5
+$as_echo "$amanda_cv_lnlock_filelocking" >&6; }
+    if test "x$amanda_cv_lnlock_filelocking" = xyes; then
 
-     if test x"$WANT_SCSI_LINUX" = x"yes"; then
-  WANT_SCSI_LINUX_TRUE=
-  WANT_SCSI_LINUX_FALSE='#'
-else
-  WANT_SCSI_LINUX_TRUE='#'
-  WANT_SCSI_LINUX_FALSE=
-fi
+cat >>confdefs.h <<\_ACEOF
+#define WANT_AMFLOCK_LNLOCK 1
+_ACEOF
 
-     if test x"$WANT_SCSI_HPUX_NEW" = x"yes"; then
-  WANT_SCSI_HPUX_NEW_TRUE=
-  WANT_SCSI_HPUX_NEW_FALSE='#'
+       WANT_AMFLOCK_LNLOCK="yes"
+       LOCKING="LNLOCK"
+    fi
+     if test x"$WANT_AMFLOCK_LNLOCK" = x"yes"; then
+  WANT_AMFLOCK_LNLOCK_TRUE=
+  WANT_AMFLOCK_LNLOCK_FALSE='#'
 else
-  WANT_SCSI_HPUX_NEW_TRUE='#'
-  WANT_SCSI_HPUX_NEW_FALSE=
+  WANT_AMFLOCK_LNLOCK_TRUE='#'
+  WANT_AMFLOCK_LNLOCK_FALSE=
 fi
 
-     if test x"$WANT_SCSI_IRIX" = x"yes"; then
-  WANT_SCSI_IRIX_TRUE=
-  WANT_SCSI_IRIX_FALSE='#'
-else
-  WANT_SCSI_IRIX_TRUE='#'
-  WANT_SCSI_IRIX_FALSE=
-fi
 
-     if test x"$WANT_SCSI_SOLARIS" = x"yes"; then
-  WANT_SCSI_SOLARIS_TRUE=
-  WANT_SCSI_SOLARIS_FALSE='#'
-else
-  WANT_SCSI_SOLARIS_TRUE='#'
-  WANT_SCSI_SOLARIS_FALSE=
-fi
+    if test x"$LOCKING" = "no"; then
+       # this shouldn't happen, and is *bad* if it does
+       { { $as_echo "$as_me:$LINENO: error: *** No working file locking capability found!" >&5
+$as_echo "$as_me: error: *** No working file locking capability found!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+
 
-     if test x"$WANT_SCSI_AIX" = x"yes"; then
-  WANT_SCSI_AIX_TRUE=
-  WANT_SCSI_AIX_FALSE='#'
-else
-  WANT_SCSI_AIX_TRUE='#'
-  WANT_SCSI_AIX_FALSE=
-fi
 
-     if test x"$WANT_SCSI_CAM" = x"yes"; then
-  WANT_SCSI_CAM_TRUE=
-  WANT_SCSI_CAM_FALSE='#'
+
+    for ac_prog in swig
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_SWIG+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  WANT_SCSI_CAM_TRUE='#'
-  WANT_SCSI_CAM_FALSE=
-fi
+  case $SWIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-     if test x"$WANT_SCSI_BSD" = x"yes"; then
-  WANT_SCSI_BSD_TRUE=
-  WANT_SCSI_BSD_FALSE='#'
+  ;;
+esac
+fi
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+  { $as_echo "$as_me:$LINENO: result: $SWIG" >&5
+$as_echo "$SWIG" >&6; }
 else
-  WANT_SCSI_BSD_TRUE='#'
-  WANT_SCSI_BSD_FALSE=
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-    # scsi-chio-based implementations
-     if test x"$WANT_CHG_SCSI_CHIO" = x"yes"; then
-  WANT_CHG_SCSI_CHIO_TRUE=
-  WANT_CHG_SCSI_CHIO_FALSE='#'
-else
-  WANT_CHG_SCSI_CHIO_TRUE='#'
-  WANT_CHG_SCSI_CHIO_FALSE=
-fi
+  test -n "$SWIG" && break
+done
+
+
+    # 1.3.32 introduces a change in the way empty strings are handled (old versions
+    # returned undef in Perl, while new versions return an empty Perl string)
+    # 1.3.39 is required for the %begin block
 
-     if test x"$WANT_SCSI_HPUX" = x"yes"; then
-  WANT_SCSI_HPUX_TRUE=
-  WANT_SCSI_HPUX_FALSE='#'
+        # Extract the first word of "swig", so it can be a program name with args.
+set dummy swig; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_SWIG+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  WANT_SCSI_HPUX_TRUE='#'
-  WANT_SCSI_HPUX_FALSE=
-fi
+  case $SWIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-     if test x"$WANT_SCSI_CHIO" = x"yes"; then
-  WANT_SCSI_CHIO_TRUE=
-  WANT_SCSI_CHIO_FALSE='#'
+  ;;
+esac
+fi
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+  { $as_echo "$as_me:$LINENO: result: $SWIG" >&5
+$as_echo "$SWIG" >&6; }
 else
-  WANT_SCSI_CHIO_TRUE='#'
-  WANT_SCSI_CHIO_FALSE=
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
+        if test -z "$SWIG" ; then
+                SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
+        elif test -n "1.3.39" ; then
+                { $as_echo "$as_me:$LINENO: checking for SWIG version" >&5
+$as_echo_n "checking for SWIG version... " >&6; }
+                swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
+                { $as_echo "$as_me:$LINENO: result: $swig_version" >&5
+$as_echo "$swig_version" >&6; }
+                if test -n "$swig_version" ; then
+
+  # Used to indicate true or false condition
+  ax_compare_version=false
+
+  # Convert the two version strings to be compared into a format that
+  # allows a simple string comparison.  The end result is that a version
+  # string of the form 1.12.5-r617 will be converted to the form
+  # 0001001200050617.  In other words, each number is zero padded to four
+  # digits, and non digits are removed.
+
+  ax_compare_version_A=`echo "$swig_version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+  ax_compare_version_B=`echo "1.3.39" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
 
+    ax_compare_version=`echo "x$ax_compare_version_A
+x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"`
 
 
 
+    if test "$ax_compare_version" = "true" ; then
 
-for ac_header in fstab.h \
-       mntent.h \
-       mnttab.h \
-       sys/vfstab.h \
+                                                   SWIG_LIB=`$SWIG -swiglib`
 
+    else
+                                                   SWIG='echo "Error: SWIG version >= 1.3.39 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+
+  fi
+
+                else
+                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
+                fi
+        fi
+
+
+
+
+
+    for ac_prog in perl5 perl
 do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PERL+set}" = set; then
   $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_func in endmntent
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-for ac_func in setmntent
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-
-
-
-
-for ac_header in fcntl.h \
-        sys/fcntl.h \
-       sys/types.h \
-       sys/file.h \
-       unistd.h \
-
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-    # find a working file-locking mechanism.
-    # Note: these all use AC_TRY_LINK to make sure that we can compile
-    # and link each variant.  They do not try to test the variants --
-    # that is left to runtime.
-    LOCKING="no"
-
-    # check POSIX locking
-    { $as_echo "$as_me:$LINENO: checking whether POSIX locking (with fcntl(2)) is available" >&5
-$as_echo_n "checking whether POSIX locking (with fcntl(2)) is available... " >&6; }
-if test "${amanda_cv_posix_filelocking+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-           cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-
-int
-main ()
-{
-
-           struct flock lock;
-
-           lock.l_type = F_RDLCK;
-           lock.l_start = 0;
-           lock.l_whence = SEEK_CUR;
-           lock.l_len = 0;
-           return fcntl(1, F_SETLK, &lock);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-
-       amanda_cv_posix_filelocking="yes"
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-       amanda_cv_posix_filelocking="no"
-
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_posix_filelocking" >&5
-$as_echo "$amanda_cv_posix_filelocking" >&6; }
-    if test "x$amanda_cv_posix_filelocking" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define WANT_AMFLOCK_POSIX 1
-_ACEOF
-
-       WANT_AMFLOCK_POSIX="yes"
-       LOCKING="POSIX_FCNTL"
-    fi
-     if test x"$WANT_AMFLOCK_POSIX" = x"yes"; then
-  WANT_AMFLOCK_POSIX_TRUE=
-  WANT_AMFLOCK_POSIX_FALSE='#'
-else
-  WANT_AMFLOCK_POSIX_TRUE='#'
-  WANT_AMFLOCK_POSIX_FALSE=
-fi
-
-
-    # check flock-based (BSD) locking
-    { $as_echo "$as_me:$LINENO: checking whether flock locking is available" >&5
-$as_echo_n "checking whether flock locking is available... " >&6; }
-if test "${amanda_cv_flock_filelocking+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-           cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#if HAVE_SYS_FILE_H
-# include <sys/file.h>
-#endif
-
-int
-main ()
-{
-
-           return flock(1, LOCK_SH);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-
-       amanda_cv_flock_filelocking="yes"
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-       amanda_cv_flock_filelocking="no"
-
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_flock_filelocking" >&5
-$as_echo "$amanda_cv_flock_filelocking" >&6; }
-    if test "x$amanda_cv_flock_filelocking" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define WANT_AMFLOCK_FLOCK 1
-_ACEOF
-
-       WANT_AMFLOCK_FLOCK="yes"
-       LOCKING="FLOCK"
-    fi
-     if test x"$WANT_AMFLOCK_FLOCK" = x"yes"; then
-  WANT_AMFLOCK_FLOCK_TRUE=
-  WANT_AMFLOCK_FLOCK_FALSE='#'
-else
-  WANT_AMFLOCK_FLOCK_TRUE='#'
-  WANT_AMFLOCK_FLOCK_FALSE=
-fi
-
-
-    # check lockf-based (SVR2, SVR3, SVR4) locking
-    { $as_echo "$as_me:$LINENO: checking whether lockf(3) locking is available" >&5
-$as_echo_n "checking whether lockf(3) locking is available... " >&6; }
-if test "${amanda_cv_lockf_filelocking+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-           cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-int
-main ()
-{
-
-           return lockf(1, F_LOCK, 0);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-
-       amanda_cv_lockf_filelocking="yes"
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-       amanda_cv_lockf_filelocking="no"
-
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_lockf_filelocking" >&5
-$as_echo "$amanda_cv_lockf_filelocking" >&6; }
-    if test "x$amanda_cv_lockf_filelocking" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define WANT_AMFLOCK_LOCKF 1
-_ACEOF
-
-       WANT_AMFLOCK_LOCKF="yes"
-       LOCKING="LOCKF"
-    fi
-     if test x"$WANT_AMFLOCK_LOCKF" = x"yes"; then
-  WANT_AMFLOCK_LOCKF_TRUE=
-  WANT_AMFLOCK_LOCKF_FALSE='#'
-else
-  WANT_AMFLOCK_LOCKF_TRUE='#'
-  WANT_AMFLOCK_LOCKF_FALSE=
-fi
-
-
-    # check our homebrew hardlink-based locking (requires hardlinks)
-    { $as_echo "$as_me:$LINENO: checking whether link(2) is available for locking" >&5
-$as_echo_n "checking whether link(2) is available for locking... " >&6; }
-if test "${amanda_cv_lnlock_filelocking+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-           cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-int
-main ()
-{
-
-           return link("/tmp/foo", "/tmp/bar");
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-
-       amanda_cv_lnlock_filelocking="yes"
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-       amanda_cv_lnlock_filelocking="no"
-
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_lnlock_filelocking" >&5
-$as_echo "$amanda_cv_lnlock_filelocking" >&6; }
-    if test "x$amanda_cv_lnlock_filelocking" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define WANT_AMFLOCK_LNLOCK 1
-_ACEOF
-
-       WANT_AMFLOCK_LNLOCK="yes"
-       LOCKING="LNLOCK"
-    fi
-     if test x"$WANT_AMFLOCK_LNLOCK" = x"yes"; then
-  WANT_AMFLOCK_LNLOCK_TRUE=
-  WANT_AMFLOCK_LNLOCK_FALSE='#'
-else
-  WANT_AMFLOCK_LNLOCK_TRUE='#'
-  WANT_AMFLOCK_LNLOCK_FALSE=
-fi
-
-
-    if test x"$LOCKING" = "no"; then
-       # this shouldn't happen, and is *bad* if it does
-       { { $as_echo "$as_me:$LINENO: error: *** No working file locking capability found!" >&5
-$as_echo "$as_me: error: *** No working file locking capability found!" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-
-
-
-
-
-    for ac_prog in swig
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SWIG+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $SWIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-SWIG=$ac_cv_path_SWIG
-if test -n "$SWIG"; then
-  { $as_echo "$as_me:$LINENO: result: $SWIG" >&5
-$as_echo "$SWIG" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$SWIG" && break
-done
-
-
-    # 1.3.32 introduces a change in the way empty strings are handled (old versions
-    # returned undef in Perl, while new versions return an empty Perl string)
-
-        # Extract the first word of "swig", so it can be a program name with args.
-set dummy swig; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SWIG+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $SWIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-SWIG=$ac_cv_path_SWIG
-if test -n "$SWIG"; then
-  { $as_echo "$as_me:$LINENO: result: $SWIG" >&5
-$as_echo "$SWIG" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-        if test -z "$SWIG" ; then
-                SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
-        elif test -n "1.3.32" ; then
-                { $as_echo "$as_me:$LINENO: checking for SWIG version" >&5
-$as_echo_n "checking for SWIG version... " >&6; }
-                swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
-                { $as_echo "$as_me:$LINENO: result: $swig_version" >&5
-$as_echo "$swig_version" >&6; }
-                if test -n "$swig_version" ; then
-                        # Calculate the required version number components
-                        required=1.3.32
-                        required_major=`echo $required | sed 's/[^0-9].*//'`
-                        if test -z "$required_major" ; then
-                                required_major=0
-                        fi
-                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
-                        required_minor=`echo $required | sed 's/[^0-9].*//'`
-                        if test -z "$required_minor" ; then
-                                required_minor=0
-                        fi
-                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
-                        required_patch=`echo $required | sed 's/[^0-9].*//'`
-                        if test -z "$required_patch" ; then
-                                required_patch=0
-                        fi
-                        # Calculate the available version number components
-                        available=$swig_version
-                        available_major=`echo $available | sed 's/[^0-9].*//'`
-                        if test -z "$available_major" ; then
-                                available_major=0
-                        fi
-                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
-                        available_minor=`echo $available | sed 's/[^0-9].*//'`
-                        if test -z "$available_minor" ; then
-                                available_minor=0
-                        fi
-                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
-                        available_patch=`echo $available | sed 's/[^0-9].*//'`
-                        if test -z "$available_patch" ; then
-                                available_patch=0
-                        fi
-                        if test $available_major -ne $required_major \
-                                -o $available_minor -ne $required_minor \
-                                -o $available_patch -lt $required_patch ; then
-                                SWIG='echo "Error: SWIG version >= 1.3.32 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
-                        else
-                                SWIG_LIB=`$SWIG -swiglib`
-                        fi
-                else
-                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
-                fi
-        fi
-
-
-
-
-
-    for ac_prog in perl5 perl
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PERL+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $PERL in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PERL=$ac_cv_path_PERL
-if test -n "$PERL"; then
-  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
-$as_echo "$PERL" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$PERL" && break
-done
-
-
-    # Make sure we have perl
-if test -z "$PERL"; then
-# Extract the first word of "perl", so it can be a program name with args.
-set dummy perl; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_PERL+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$PERL"; then
-  ac_cv_prog_PERL="$PERL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_PERL="perl"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-PERL=$ac_cv_prog_PERL
-if test -n "$PERL"; then
-  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
-$as_echo "$PERL" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-
-# Check if version of Perl is sufficient
-ac_perl_version="5.6.0"
-
-if test "x$PERL" != "x"; then
-  { $as_echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5
-$as_echo_n "checking for perl version greater than or equal to $ac_perl_version... " >&6; }
-  # NB: It would be nice to log the error if there is one, but we cannot rely
-  # on autoconf internals
-  $PERL -e "use $ac_perl_version;" > /dev/null 2>&1
-  if test $? -ne 0; then
-    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; };
-
-       { { $as_echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5
-$as_echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;}
-   { (exit 1); exit 1; }; }
-
-  else
-    { $as_echo "$as_me:$LINENO: result: ok" >&5
-$as_echo "ok" >&6; };
-
-  fi
-else
-  { $as_echo "$as_me:$LINENO: WARNING: could not find perl" >&5
-$as_echo "$as_me: WARNING: could not find perl" >&2;}
-fi
-
-
-
-
-
-
-    # If we want cygwin to copy ddl to modules directory.
-    WANT_CYGWIN_COPY_PERL_DLL="false"
-
-    # test for ExtUtils::Embed
-    ac_perl_list_modules="ExtUtils::Embed 0.0"
-# Make sure we have perl
-if test -z "$PERL"; then
-# Extract the first word of "perl", so it can be a program name with args.
-set dummy perl; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_PERL+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$PERL"; then
-  ac_cv_prog_PERL="$PERL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_PERL="perl"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-PERL=$ac_cv_prog_PERL
-if test -n "$PERL"; then
-  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
-$as_echo "$PERL" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-
-# Check the number of arguments
-args_num=`echo $ac_perl_list_modules | wc -w`
-let "ckeck_args = $args_num % 2"
-if test "$check_args" = "1" ; then
-  { { $as_echo "$as_me:$LINENO: error: syntax error" >&5
-$as_echo "$as_me: error: syntax error" >&2;}
-   { (exit 1); exit 1; }; }
-else
-  eval
-fi
-
-if test "x$PERL" != x; then
-  ac_failed=0
-  while test ${#ac_perl_list_modules} -gt 2 ; do
-       module_name=`echo $ac_perl_list_modules | cut -d " " -f 1`
-       module_version=`echo $ac_perl_list_modules | cut -d " " -f 2`
-       ac_perl_list_modules=`echo $ac_perl_list_modules | cut -d " " -f 3-`
-       { $as_echo "$as_me:$LINENO: checking for perl module $module_name version $module_version" >&5
-$as_echo_n "checking for perl module $module_name version $module_version... " >&6; }
-
-       $PERL "-M$module_name" -e exit > /dev/null 2>&1
-       if test $? -ne 0; then
-         { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; };
-         ac_failed=1
-         ac_perl_list_modules=""
-       else
-         version=`$PERL "-M$module_name" -e 'print $'"$module_name::VERSION" 2>&1`
-         $PERL -e 'exit(shift cmp shift)' "$version" "$module_version"
-         if test $? -eq 0 -o $? -eq 1 ; then
-           { $as_echo "$as_me:$LINENO: result: ok" >&5
-$as_echo "ok" >&6; };
-         else
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-           ac_failed=1
-           ac_perl_list_modules=""
-         fi
-       fi;
-  done
-
-  if test "$ac_failed" = 0; then
-    :
-
-  else
-    :
-
-       { { $as_echo "$as_me:$LINENO: error: *** Amanda requires the perl package ExtUtils::Embed to build its perl modules" >&5
-$as_echo "$as_me: error: *** Amanda requires the perl package ExtUtils::Embed to build its perl modules" >&2;}
-   { (exit 1); exit 1; }; }
-
-  fi
-else
-  { { $as_echo "$as_me:$LINENO: error: could not find perl" >&5
-$as_echo "$as_me: error: could not find perl" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-    # get the include path for building perl extensions
-    PERL_INC=`$PERL -MExtUtils::Embed -e perl_inc`
-
-
-    if test x"$enable_shared" = x"no"; then
-       { { $as_echo "$as_me:$LINENO: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&5
-$as_echo "$as_me: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-
-    case "$host" in
-       *freebsd[123456]*) # up to and including FreeBSD 6.*
-           # Before 7.0, FreeBSD systems don't include a DT_NEEDS segment in
-           # libgthread to automatically pull in the desired threading library.
-           # Instead, they assume that any application linking against
-           # libgthread will pull in the threading library.  This is fine for
-           # Amanda C applications, but for Perl applications this assumption
-           # means that the perl binary would pull in the threading library.
-           # But perl is compiled without threading by default.
-           #
-           # Specifically, this occurs on any FreeBSD using gcc-3.*: the linking
-           # decision is made in gcc's spec files, which were changed in
-           # gcc-4.0.  For a more in-depth discussion, see
-           #  http://wiki.zmanda.com/index.php/Installation/OS_Specific_Notes/Installing_Amanda_on_FreeBSD
-           #
-           # The easiest solution for the "default" case is to link all perl
-           # extension libraries against the threading library, so it is loaded
-           # when perl loads the extension library.  The default threading
-           # library in FreeBSD is libpthread.  The below default will work on
-           # such a FreeBSD system, but ports maintainers and those with
-           # different configurations may need to override this value with
-           # --with-perlextlibs.
-           #
-           # We can't use -pthread because gcc on FreeBSD ignores -pthread in
-           # combination with -shared.  See
-           #   http://lists.freebsd.org/pipermail/freebsd-stable/2006-June/026229.html
-
-           PERLEXTLIBS="-lpthread"
-           ;;
-       *-pc-cygwin)
-           # When need -lperl and the '-L' where it is located,
-           # we don't want the DynaLoader.a
-           PERLEXTLIBS=`perl -MExtUtils::Embed -e ldopts | sed -e 's/^.*-L/-L/'`
-           WANT_CYGWIN_COPY_PERL_DLL="true";
-           ;;
-    esac
-     if $WANT_CYGWIN_COPY_PERL_DLL; then
-  WANT_CYGWIN_COPY_PERL_DLL_TRUE=
-  WANT_CYGWIN_COPY_PERL_DLL_FALSE='#'
-else
-  WANT_CYGWIN_COPY_PERL_DLL_TRUE='#'
-  WANT_CYGWIN_COPY_PERL_DLL_FALSE=
-fi
-
-
-
-# Check whether --with-perlextlibs was given.
-if test "${with_perlextlibs+set}" = set; then
-  withval=$with_perlextlibs;
-           case "$withval" in
-               y|ye|yes) { { $as_echo "$as_me:$LINENO: error: *** You must specify a value for --with-perlextlibs" >&5
-$as_echo "$as_me: error: *** You must specify a value for --with-perlextlibs" >&2;}
-   { (exit 1); exit 1; }; };;
-               n|no) PERLEXTLIBS='';;
-               *) PERLEXTLIBS="$withval" ;;
-           esac
-
-fi
-
-
-
-
-
-    # Extract the first word of "cat", so it can be a program name with args.
-set dummy cat; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CAT+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $CAT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_CAT="$CAT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_CAT" && ac_cv_path_CAT="cat"
-  ;;
-esac
-fi
-CAT=$ac_cv_path_CAT
-if test -n "$CAT"; then
-  { $as_echo "$as_me:$LINENO: result: $CAT" >&5
-$as_echo "$CAT" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-
-
-
-    HAVE_GZIP=
-    if test "$GZIP"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GZIP 1
-_ACEOF
-
-       HAVE_GZIP=1
-       COMPRESS_PATH="$GZIP"
-       COMPRESS_SUFFIX=".gz"
-       COMPRESS_FAST_OPT="--fast"
-       COMPRESS_BEST_OPT="--best"
-       UNCOMPRESS_PATH="$GZIP"
-       UNCOMPRESS_OPT="-dc"
-    else
-       if test "$COMPRESS"; then
-           COMPRESS_PATH="$COMPRESS"
-           COMPRESS_SUFFIX=".Z"
-           COMPRESS_FAST_OPT="-f"
-           COMPRESS_BEST_OPT="-f"
-           UNCOMPRESS_PATH="$COMPRESS"
-           UNCOMPRESS_OPT="-dc"
-       else
-           # If we have to use cat, we don't define COMPRESS_FAST_OPT,
-           # COMPRESS_BEST_OPT, or UNCOMPRESS_OPT as "" since cat will look
-           # look for a file by the name of "".
-           # XXX is the above true? --dustin
-
-
-    { $as_echo "$as_me:$LINENO: WARNING: Cannot find either gzip or compress.  Using cat." >&5
-$as_echo "$as_me: WARNING: Cannot find either gzip or compress.  Using cat." >&2;}
-
-
-    cat <<AAW_EOF >>config.warnings
-Cannot find either gzip or compress.  Using cat.
-AAW_EOF
-
-
-           COMPRESS_PATH="$CAT"
-           COMPRESS_SUFFIX=""
-           COMPRESS_FAST_OPT=""
-           COMPRESS_BEST_OPT=""
-           UNCOMPRESS_PATH="$CAT"
-           UNCOMPRESS_OPT=""
-       fi
-    fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define COMPRESS_PATH "$COMPRESS_PATH"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define COMPRESS_SUFFIX "$COMPRESS_SUFFIX"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define COMPRESS_FAST_OPT "$COMPRESS_FAST_OPT"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define COMPRESS_BEST_OPT "$COMPRESS_BEST_OPT"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define UNCOMPRESS_PATH "$UNCOMPRESS_PATH"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define UNCOMPRESS_OPT "$UNCOMPRESS_OPT"
-_ACEOF
-
-
-
-
-
-
-
-
-
-
-    # Empty GZIP so that make dist works.
-    GZIP=
-
-
-    { $as_echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5
-$as_echo_n "checking if sockaddr_storage struct exists... " >&6; }
-if test "${ac_cv_has_sockaddr_storage+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#      include <sys/types.h>
-#      include <sys/socket.h>
-int
-main ()
-{
-u_int i = sizeof (struct sockaddr_storage)
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_has_sockaddr_storage=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_has_sockaddr_storage=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5
-$as_echo "$ac_cv_has_sockaddr_storage" >&6; }
-
-    if test $ac_cv_has_sockaddr_storage = yes ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SOCKADDR_STORAGE 1
-_ACEOF
-
-    fi
-
-
-
-
-    WORKING_IPV6=no
-
-# Check whether --with-ipv6 was given.
-if test "${with_ipv6+set}" = set; then
-  withval=$with_ipv6;
-           case "$withval" in
-           y | ye | yes) amanda_with_ipv6=yes;;
-           n | no) amanda_with_ipv6=no;;
-           *)
-               { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ipv6 option." >&5
-$as_echo "$as_me: error: *** You must not supply an argument to --with-ipv6 option." >&2;}
-   { (exit 1); exit 1; }; }
-             ;;
-           esac
-
-else
-
-           amanda_with_ipv6=maybe
-
-
-fi
-
-
-    if test x"$amanda_with_ipv6" = x"yes" ||
-       test x"$amanda_with_ipv6" = x"maybe" ; then
-       { $as_echo "$as_me:$LINENO: checking for working IPv6" >&5
-$as_echo_n "checking for working IPv6... " >&6; }
-if test "${amanda_cv_working_ipv6+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-           case "$host" in
-               *-pc-cygwin) amanda_cv_working_ipv6=no;;
-               *)
-                   if test "$cross_compiling" = yes; then
-   amanda_cv_working_ipv6=yes
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#include <sys/socket.h>
-#include <errno.h>
-
-main()
-{
-   int aa;
-   aa = socket(AF_INET6, SOCK_STREAM, 0);
-   if (aa > 0) return 0;
-   return aa;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-   amanda_cv_working_ipv6=yes
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
- amanda_cv_working_ipv6=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-           esac
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_working_ipv6" >&5
-$as_echo "$amanda_cv_working_ipv6" >&6; }
-
-       if test "$amanda_cv_working_ipv6" = yes; then
-           WORKING_IPV6=yes
-
-cat >>confdefs.h <<\_ACEOF
-#define WORKING_IPV6 1
-_ACEOF
-
-       else
-           # error out only if the user specifically requested support
-           if test x"$amanda_with_ipv6" = x"yes"; then
-               { { $as_echo "$as_me:$LINENO: error: IPv6 support was requested, but it is not working." >&5
-$as_echo "$as_me: error: IPv6 support was requested, but it is not working." >&2;}
-   { (exit 1); exit 1; }; }
-           fi
-       fi
-    fi
-
-
-
-
-# Check whether --with-mmap was given.
-if test "${with_mmap+set}" = set; then
-  withval=$with_mmap;
-           case "$FORCE_MMAP" in
-               y | ye | yes | n | no) : ;;
-               *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-mmap." >&5
-$as_echo "$as_me: error: *** You must not supply an argument to --with-mmap." >&2;}
-   { (exit 1); exit 1; }; } ;;
-           esac
-           FORCE_MMAP=$withval
-
-else
-   : ${FORCE_MMAP=no}
-
-fi
-
-
-
-
-
-for ac_header in \
-           sys/shm.h \
-           sys/mman.h \
-
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-for ac_header in stdlib.h unistd.h
+  case $PERL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
 do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
+  ;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
 fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
+PERL=$ac_cv_path_PERL
+if test -n "$PERL"; then
+  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-fi
 
+  test -n "$PERL" && break
 done
 
 
-for ac_func in getpagesize
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+    # Make sure we have perl
+if test -z "$PERL"; then
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PERL+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+  if test -n "$PERL"; then
+  ac_cv_prog_PERL="$PERL" # Let the user override the test.
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PERL="perl"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
+done
+IFS=$as_save_IFS
 
-{ $as_echo "$as_me:$LINENO: checking for working mmap" >&5
-$as_echo_n "checking for working mmap... " >&6; }
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_mmap_fixed_mapped=no
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-/* malloc might have been renamed as rpl_malloc. */
-#undef malloc
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
-   Here is a matrix of mmap possibilities:
-       mmap private not fixed
-       mmap private fixed at somewhere currently unmapped
-       mmap private fixed at somewhere already mapped
-       mmap shared not fixed
-       mmap shared fixed at somewhere currently unmapped
-       mmap shared fixed at somewhere already mapped
-   For private mappings, we should verify that changes cannot be read()
-   back from the file, nor mmap's back from the file at a different
-   address.  (There have been systems where private was not correctly
-   implemented like the infamous i386 svr4.0, and systems where the
-   VM page cache was not coherent with the file system buffer cache
-   like early versions of FreeBSD and possibly contemporary NetBSD.)
-   For shared mappings, we should conversely verify that changes get
-   propagated back to all the places they're supposed to be.
-
-   Grep wants private fixed already mapped.
-   The main things grep needs to know about mmap are:
-   * does it exist and is it safe to write into the mmap'd area
-   * how to use it (BSD variants)  */
-
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
-char *malloc ();
-#endif
-
-/* This mess was copied from the GNU getpagesize.h.  */
-#ifndef HAVE_GETPAGESIZE
-/* Assume that all systems that can run configure have sys/param.h.  */
-# ifndef HAVE_SYS_PARAM_H
-#  define HAVE_SYS_PARAM_H 1
-# endif
-
-# ifdef _SC_PAGESIZE
-#  define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-#  ifdef HAVE_SYS_PARAM_H
-#   include <sys/param.h>
-#   ifdef EXEC_PAGESIZE
-#    define getpagesize() EXEC_PAGESIZE
-#   else /* no EXEC_PAGESIZE */
-#    ifdef NBPG
-#     define getpagesize() NBPG * CLSIZE
-#     ifndef CLSIZE
-#      define CLSIZE 1
-#     endif /* no CLSIZE */
-#    else /* no NBPG */
-#     ifdef NBPC
-#      define getpagesize() NBPC
-#     else /* no NBPC */
-#      ifdef PAGESIZE
-#       define getpagesize() PAGESIZE
-#      endif /* PAGESIZE */
-#     endif /* no NBPC */
-#    endif /* no NBPG */
-#   endif /* no EXEC_PAGESIZE */
-#  else /* no HAVE_SYS_PARAM_H */
-#   define getpagesize() 8192  /* punt totally */
-#  endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
-
-int
-main ()
-{
-  char *data, *data2, *data3;
-  int i, pagesize;
-  int fd;
-
-  pagesize = getpagesize ();
-
-  /* First, make a file with some known garbage in it. */
-  data = (char *) malloc (pagesize);
-  if (!data)
-    return 1;
-  for (i = 0; i < pagesize; ++i)
-    *(data + i) = rand ();
-  umask (0);
-  fd = creat ("conftest.mmap", 0600);
-  if (fd < 0)
-    return 1;
-  if (write (fd, data, pagesize) != pagesize)
-    return 1;
-  close (fd);
-
-  /* Next, try to mmap the file at a fixed address which already has
-     something else allocated at it.  If we can, also make sure that
-     we see the same garbage.  */
-  fd = open ("conftest.mmap", O_RDWR);
-  if (fd < 0)
-    return 1;
-  data2 = (char *) malloc (2 * pagesize);
-  if (!data2)
-    return 1;
-  data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1);
-  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
-                    MAP_PRIVATE | MAP_FIXED, fd, 0L))
-    return 1;
-  for (i = 0; i < pagesize; ++i)
-    if (*(data + i) != *(data2 + i))
-      return 1;
-
-  /* Finally, make sure that changes to the mapped area do not
-     percolate back to the file as seen by read().  (This is a bug on
-     some variants of i386 svr4.0.)  */
-  for (i = 0; i < pagesize; ++i)
-    *(data2 + i) = *(data2 + i) + 1;
-  data3 = (char *) malloc (pagesize);
-  if (!data3)
-    return 1;
-  if (read (fd, data3, pagesize) != pagesize)
-    return 1;
-  for (i = 0; i < pagesize; ++i)
-    if (*(data + i) != *(data3 + i))
-      return 1;
-  close (fd);
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_mmap_fixed_mapped=yes
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_mmap_fixed_mapped=no
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-
-
+PERL=$ac_cv_prog_PERL
+if test -n "$PERL"; then
+  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
-$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
 
 fi
-rm -f conftest.mmap
 
+# Check if version of Perl is sufficient
+ac_perl_version="5.6.0"
 
+if test "x$PERL" != "x"; then
+  { $as_echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5
+$as_echo_n "checking for perl version greater than or equal to $ac_perl_version... " >&6; }
+  # NB: It would be nice to log the error if there is one, but we cannot rely
+  # on autoconf internals
+  $PERL -e "use $ac_perl_version;" > /dev/null 2>&1
+  if test $? -ne 0; then
+    { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; };
 
-for ac_func in shmget
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+       { { $as_echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5
+$as_echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;}
+   { (exit 1); exit 1; }; }
 
-       eval "$as_ac_var=no"
-fi
+  else
+    { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; };
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  fi
+else
+  { $as_echo "$as_me:$LINENO: WARNING: could not find perl" >&5
+$as_echo "$as_me: WARNING: could not find perl" >&2;}
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
 
 
 
 
-for ac_header in sys/types.h \
-           sys/ipc.h \
-           sys/shm.h \
 
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+    WANT_CYGWIN_COPY_PERL_DLL=false
+    WANT_MANDATORY_THREAD_CHECK=false
+
+    # test for ExtUtils::Embed
+    ac_perl_list_modules="ExtUtils::Embed 0.0"
+# Make sure we have perl
+if test -z "$PERL"; then
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PERL+set}" = set; then
   $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  if test -n "$PERL"; then
+  ac_cv_prog_PERL="$PERL" # Let the user override the test.
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PERL="perl"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-       ac_header_compiler=no
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+fi
+PERL=$ac_cv_prog_PERL
+if test -n "$PERL"; then
+  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+fi
 
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
+# Check the number of arguments
+args_num=`echo $ac_perl_list_modules | wc -w`
+let "ckeck_args = $args_num % 2"
+if test "$check_args" = "1" ; then
+  { { $as_echo "$as_me:$LINENO: error: syntax error" >&5
+$as_echo "$as_me: error: syntax error" >&2;}
+   { (exit 1); exit 1; }; }
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  eval
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+if test "x$PERL" != x; then
+  ac_failed=0
+  while test ${#ac_perl_list_modules} -gt 2 ; do
+       module_name=`echo $ac_perl_list_modules | cut -d " " -f 1`
+       module_version=`echo $ac_perl_list_modules | cut -d " " -f 2`
+       ac_perl_list_modules=`echo $ac_perl_list_modules | cut -d " " -f 3-`
+       { $as_echo "$as_me:$LINENO: checking for perl module $module_name version $module_version" >&5
+$as_echo_n "checking for perl module $module_name version $module_version... " >&6; }
 
-fi
+       $PERL "-M$module_name" -e exit > /dev/null 2>&1
+       if test $? -ne 0; then
+         { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; };
+         ac_failed=1
+         ac_perl_list_modules=""
+       else
+         version=`$PERL "-M$module_name" -e 'print $'"$module_name::VERSION" 2>&1`
+         $PERL -e 'exit(shift cmp shift)' "$version" "$module_version"
+         if test $? -eq 0 -o $? -eq 1 ; then
+           { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; };
+         else
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+           ac_failed=1
+           ac_perl_list_modules=""
+         fi
+       fi;
+  done
 
-done
+  if test "$ac_failed" = 0; then
+    :
 
+  else
+    :
 
-       { $as_echo "$as_me:$LINENO: checking for shmdt() argument type" >&5
-$as_echo_n "checking for shmdt() argument type... " >&6; }
-if test "${amanda_cv_shmdt_arg_type+set}" = set; then
-  $as_echo_n "(cached) " >&6
+       { { $as_echo "$as_me:$LINENO: error: *** Amanda requires the perl package ExtUtils::Embed to build its perl modules" >&5
+$as_echo "$as_me: error: *** Amanda requires the perl package ExtUtils::Embed to build its perl modules" >&2;}
+   { (exit 1); exit 1; }; }
+
+  fi
 else
+  { { $as_echo "$as_me:$LINENO: error: could not find perl" >&5
+$as_echo "$as_me: error: could not find perl" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
-               if test "$ac_cv_func_shmget" = yes; then
-                   cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_IPC_H
-# include <sys/ipc.h>
-#endif
-#ifdef HAVE_SYS_SHM_H
-# include <sys/shm.h>
-#endif
+    # get the include path for building perl extensions
+    PERL_INC=`$PERL -MExtUtils::Embed -e perl_inc`
 
-#ifdef __cplusplus
-extern "C" void *shmat(int, void *, int);
-#else
-void *shmat();
-#endif
 
-int main()
-{
-    int i;
-    return 0;
-}
-EOF
-                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
-                   if test $? = 0; then
-                       amanda_cv_shmdt_arg_type=void
-                   else
-                       amanda_cv_shmdt_arg_type=char
-                   fi
-                   rm -f conftest*
-               else
-                   amanda_cv_shmdt_arg_type=nothing
-               fi
+    if test x"$enable_shared" = x"no"; then
+       { { $as_echo "$as_me:$LINENO: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&5
+$as_echo "$as_me: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
 
+    case "$host" in
+       *freebsd[123456].*) # up to and including FreeBSD 6.*
+           # Before 7.0, FreeBSD systems don't include a DT_NEEDS segment in
+           # libgthread to automatically pull in the desired threading library.
+           # Instead, they assume that any application linking against
+           # libgthread will pull in the threading library.  This is fine for
+           # Amanda C applications, but for Perl applications this assumption
+           # means that the perl binary would pull in the threading library.
+           # But perl is compiled without threading by default.
+           #
+           # Specifically, this occurs on any FreeBSD using gcc-3.*: the linking
+           # decision is made in gcc's spec files, which were changed in
+           # gcc-4.0.  For a more in-depth discussion, see
+           #  http://wiki.zmanda.com/index.php/Installation/OS_Specific_Notes/Installing_Amanda_on_FreeBSD
+           #
+           # The easiest solution for the "default" case is to link all perl
+           # extension libraries against the threading library, so it is loaded
+           # when perl loads the extension library.  The default threading
+           # library in FreeBSD is libpthread.  The below default will work on
+           # such a FreeBSD system, but ports maintainers and those with
+           # different configurations may need to override this value with
+           # --with-perlextlibs.
+           #
+           # We can't use -pthread because gcc on FreeBSD ignores -pthread in
+           # combination with -shared.  See
+           #   http://lists.freebsd.org/pipermail/freebsd-stable/2006-June/026229.html
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_shmdt_arg_type" >&5
-$as_echo "$amanda_cv_shmdt_arg_type" >&6; }
+           PERLEXTLIBS="-lpthread"
+           WANT_MANDATORY_THREAD_CHECK=true
+           ;;
 
-cat >>confdefs.h <<_ACEOF
-#define SHM_ARG_TYPE $amanda_cv_shmdt_arg_type
-_ACEOF
+       *freebsd*) # all FreeBSD not matched above
+           # for all FreeBSD (including 1.0-6.0, above), we want to run the
+           # thread-check rule in perl/Makefile.am to double-check that a Perl
+           # script can call a C extension that uses threads.
+           WANT_MANDATORY_THREAD_CHECK=true
+           ;;
 
+       *-pc-cygwin)
+           # When need -lperl and the '-L' where it is located,
+           # we don't want the DynaLoader.a
+           PERLEXTLIBS=`perl -MExtUtils::Embed -e ldopts | sed -e 's/^.*-L/-L/'`
+           # we want cygwin to copy ddl to modules directory.
+           WANT_CYGWIN_COPY_PERL_DLL="true";
+           ;;
+    esac
+     if $WANT_CYGWIN_COPY_PERL_DLL; then
+  WANT_CYGWIN_COPY_PERL_DLL_TRUE=
+  WANT_CYGWIN_COPY_PERL_DLL_FALSE='#'
+else
+  WANT_CYGWIN_COPY_PERL_DLL_TRUE='#'
+  WANT_CYGWIN_COPY_PERL_DLL_FALSE=
+fi
 
+     if $WANT_MANDATORY_THREAD_CHECK; then
+  WANT_MANDATORY_THREAD_CHECK_TRUE=
+  WANT_MANDATORY_THREAD_CHECK_FALSE='#'
+else
+  WANT_MANDATORY_THREAD_CHECK_TRUE='#'
+  WANT_MANDATORY_THREAD_CHECK_FALSE=
+fi
 
-           case "$FORCE_MMAP" in
-           n | no)
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYSVSHM 1
-_ACEOF
 
-             ;;
+# Check whether --with-perlextlibs was given.
+if test "${with_perlextlibs+set}" = set; then
+  withval=$with_perlextlibs;
+           case "$withval" in
+               y|ye|yes) { { $as_echo "$as_me:$LINENO: error: *** You must specify a value for --with-perlextlibs" >&5
+$as_echo "$as_me: error: *** You must specify a value for --with-perlextlibs" >&2;}
+   { (exit 1); exit 1; }; };;
+               n|no) PERLEXTLIBS='';;
+               *) PERLEXTLIBS="$withval" ;;
            esac
 
-
 fi
-done
 
 
-ice_have_shmat=no
 
-for ac_func in shmat
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+
+
+    # Extract the first word of "cat", so it can be a program name with args.
+set dummy cat; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CAT+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
+  case $CAT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAT="$CAT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+  test -z "$ac_cv_path_CAT" && ac_cv_path_CAT="cat"
+  ;;
+esac
+fi
+CAT=$ac_cv_path_CAT
+if test -n "$CAT"; then
+  { $as_echo "$as_me:$LINENO: result: $CAT" >&5
+$as_echo "$CAT" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef $ac_func
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
 
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
-fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_shmat=yes
-fi
-done
 
-if test "${ice_have_shmat}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-$as_echo_n "checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h... " >&6; }
-if test "${ice_cv_have_shmat_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
 
-ice_cv_have_shmat_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/ipc.h sys/shm.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+    HAVE_GZIP=
+    if test "$GZIP"; then
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GZIP 1
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmat[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmat_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_shmat_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+       HAVE_GZIP=1
+       COMPRESS_PATH="$GZIP"
+       COMPRESS_SUFFIX=".gz"
+       COMPRESS_FAST_OPT="--fast"
+       COMPRESS_BEST_OPT="--best"
+       UNCOMPRESS_PATH="$GZIP"
+       UNCOMPRESS_OPT="-dc"
+    else
+       if test "$COMPRESS"; then
+           COMPRESS_PATH="$COMPRESS"
+           COMPRESS_SUFFIX=".Z"
+           COMPRESS_FAST_OPT="-f"
+           COMPRESS_BEST_OPT="-f"
+           UNCOMPRESS_PATH="$COMPRESS"
+           UNCOMPRESS_OPT="-dc"
+       else
+           # If we have to use cat, we don't define COMPRESS_FAST_OPT,
+           # COMPRESS_BEST_OPT, or UNCOMPRESS_OPT as "" since cat will look
+           # look for a file by the name of "".
+           # XXX is the above true? --dustin
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmat[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmat_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_shmat_decl" = yes; then
-       break
-fi
-done
+    { $as_echo "$as_me:$LINENO: WARNING: Cannot find either gzip or compress.  Using cat." >&5
+$as_echo "$as_me: WARNING: Cannot find either gzip or compress.  Using cat." >&2;}
 
-fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_shmat_decl" >&5
-$as_echo "$ice_cv_have_shmat_decl" >&6; }
-if test "$ice_cv_have_shmat_decl" = yes; then
+    cat <<AAW_EOF >>config.warnings
+Cannot find either gzip or compress.  Using cat.
+AAW_EOF
+
+
+           COMPRESS_PATH="$CAT"
+           COMPRESS_SUFFIX=""
+           COMPRESS_FAST_OPT=""
+           COMPRESS_BEST_OPT=""
+           UNCOMPRESS_PATH="$CAT"
+           UNCOMPRESS_OPT=""
+       fi
+    fi
+
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMAT_DECL 1
+#define COMPRESS_PATH "$COMPRESS_PATH"
 _ACEOF
 
-fi
-fi
-
-
-ice_have_shmctl=no
 
-for ac_func in shmctl
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<_ACEOF
+#define COMPRESS_SUFFIX "$COMPRESS_SUFFIX"
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef $ac_func
+cat >>confdefs.h <<_ACEOF
+#define COMPRESS_FAST_OPT "$COMPRESS_FAST_OPT"
+_ACEOF
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
 
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define COMPRESS_BEST_OPT "$COMPRESS_BEST_OPT"
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
-fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+cat >>confdefs.h <<_ACEOF
+#define UNCOMPRESS_PATH "$UNCOMPRESS_PATH"
 _ACEOF
- ice_have_shmctl=yes
-fi
-done
 
-if test "${ice_have_shmctl}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-$as_echo_n "checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h... " >&6; }
-if test "${ice_cv_have_shmctl_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
 
-ice_cv_have_shmctl_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/ipc.h sys/shm.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<_ACEOF
+#define UNCOMPRESS_OPT "$UNCOMPRESS_OPT"
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmctl[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmctl_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_shmctl_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmctl[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmctl_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_shmctl_decl" = yes; then
-       break
-fi
-done
 
-fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_shmctl_decl" >&5
-$as_echo "$ice_cv_have_shmctl_decl" >&6; }
-if test "$ice_cv_have_shmctl_decl" = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMCTL_DECL 1
-_ACEOF
 
-fi
-fi
 
 
-ice_have_shmdt=no
+    # Empty GZIP so that make dist works.
+    GZIP=
+
 
-for ac_func in shmdt
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+    { $as_echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5
+$as_echo_n "checking if sockaddr_storage struct exists... " >&6; }
+if test "${ac_cv_has_sockaddr_storage+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
 
+#      include <sys/types.h>
+#      include <sys/socket.h>
 int
 main ()
 {
-return $ac_func ();
+u_int i = sizeof (struct sockaddr_storage)
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -33379,110 +37237,69 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+       } && test -s conftest.$ac_objext; then
+  ac_cv_has_sockaddr_storage=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+       ac_cv_has_sockaddr_storage=no
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_shmdt=yes
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-done
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5
+$as_echo "$ac_cv_has_sockaddr_storage" >&6; }
 
-if test "${ice_have_shmdt}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-$as_echo_n "checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h... " >&6; }
-if test "${ice_cv_have_shmdt_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
+    if test $ac_cv_has_sockaddr_storage = yes ; then
 
-ice_cv_have_shmdt_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/ipc.h sys/shm.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOCKADDR_STORAGE 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmdt[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmdt_decl=yes
-fi
-rm -f conftest*
+    fi
 
-if test "$ice_cv_have_shmdt_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmdt[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmdt_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_shmdt_decl" = yes; then
-       break
-fi
-done
 
-fi
+    WORKING_IPV6=no
+
+# Check whether --with-ipv6 was given.
+if test "${with_ipv6+set}" = set; then
+  withval=$with_ipv6;
+           case "$withval" in
+           y | ye | yes) amanda_with_ipv6=yes;;
+           n | no) amanda_with_ipv6=no;;
+           *)
+               { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ipv6 option." >&5
+$as_echo "$as_me: error: *** You must not supply an argument to --with-ipv6 option." >&2;}
+   { (exit 1); exit 1; }; }
+             ;;
+           esac
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_shmdt_decl" >&5
-$as_echo "$ice_cv_have_shmdt_decl" >&6; }
-if test "$ice_cv_have_shmdt_decl" = yes; then
+else
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMDT_DECL 1
-_ACEOF
+           amanda_with_ipv6=maybe
 
-fi
-fi
 
+fi
 
-ice_have_shmget=no
 
-for ac_func in shmget
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+    if test x"$amanda_with_ipv6" = x"yes" ||
+       test x"$amanda_with_ipv6" = x"maybe" ; then
+       { $as_echo "$as_me:$LINENO: checking for working IPv6" >&5
+$as_echo_n "checking for working IPv6... " >&6; }
+if test "${amanda_cv_working_ipv6+set}" = set; then
   $as_echo_n "(cached) " >&6
+else
+
+           case "$host" in
+               *-pc-cygwin) amanda_cv_working_ipv6=no;;
+               *)
+                   if test "$cross_compiling" = yes; then
+   amanda_cv_working_ipv6=yes
+
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -33490,46 +37307,29 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
 #endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
 #endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
 #endif
+#include <sys/socket.h>
+#include <errno.h>
 
-int
-main ()
+main()
 {
-return $ac_func ();
-  ;
-  return 0;
+   int aa;
+   aa = socket(AF_INET6, SOCK_STREAM, 0);
+   if (aa > 0) return 0;
+   return aa;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f conftest$ac_exeext
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -33537,141 +37337,55 @@ case "(($ac_try" in
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+   amanda_cv_working_ipv6=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+( exit $ac_status )
+ amanda_cv_working_ipv6=no
 fi
-
 rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_shmget=yes
-fi
-done
-
-if test "${ice_have_shmget}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-$as_echo_n "checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h... " >&6; }
-if test "${ice_cv_have_shmget_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-ice_cv_have_shmget_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/ipc.h sys/shm.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmget[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmget_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_shmget_decl" = yes; then
-       break
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmget[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmget_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_shmget_decl" = yes; then
-       break
-fi
-done
+           esac
 
 fi
+{ $as_echo "$as_me:$LINENO: result: $amanda_cv_working_ipv6" >&5
+$as_echo "$amanda_cv_working_ipv6" >&6; }
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_shmget_decl" >&5
-$as_echo "$ice_cv_have_shmget_decl" >&6; }
-if test "$ice_cv_have_shmget_decl" = yes; then
+       if test "$amanda_cv_working_ipv6" = yes; then
+           WORKING_IPV6=yes
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMGET_DECL 1
+cat >>confdefs.h <<\_ACEOF
+#define WORKING_IPV6 1
 _ACEOF
 
-fi
-fi
-
-
-    if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
-       case "$FORCE_MMAP" in
-       n | no)
-           if test "x$ac_cv_func_shmget" != xyes; then
-
-    { $as_echo "$as_me:$LINENO: WARNING: Neither shmget() nor mmap() found. This system will not support the Amanda server." >&5
-$as_echo "$as_me: WARNING: Neither shmget() nor mmap() found. This system will not support the Amanda server." >&2;}
-
-
-    cat <<AAW_EOF >>config.warnings
-Neither shmget() nor mmap() found. This system will not support the Amanda server.
-AAW_EOF
-
-
-               NO_SERVER_MODE=true
+       else
+           # error out only if the user specifically requested support
+           if test x"$amanda_with_ipv6" = x"yes"; then
+               { { $as_echo "$as_me:$LINENO: error: IPv6 support was requested, but opening an IPv6 socket failed" >&5
+$as_echo "$as_me: error: IPv6 support was requested, but opening an IPv6 socket failed" >&2;}
+   { (exit 1); exit 1; }; }
            fi
-         ;;
-       y | ye | yes)
-
-    { $as_echo "$as_me:$LINENO: WARNING: --with-mmap used on a system with no mmap() support.  This system will not support the Amanda server." >&5
-$as_echo "$as_me: WARNING: --with-mmap used on a system with no mmap() support.  This system will not support the Amanda server." >&2;}
-
-
-    cat <<AAW_EOF >>config.warnings
---with-mmap used on a system with no mmap() support.  This system will not support the Amanda server.
-AAW_EOF
-
-
-           NO_SERVER_MODE=true
-         ;;
-       esac
+       fi
     fi
 
 
@@ -34502,6 +38216,8 @@ _ACEOF
                    ;;
         *-apple-darwin9*) # MacOS X 10.5.* (Leopard)
                    ;;
+        *-apple-darwin10*) # MacOS X 10.6.* (Snow Leopard)
+                   ;;
       *)
 
 
 { $as_echo "$as_me:$LINENO: result: $amanda_cv_HAVE_MTIOCTOP" >&5
 $as_echo "$amanda_cv_HAVE_MTIOCTOP" >&6; }
 
-    # decide which tape device to compile (arranged in such a way that
-    # only one actually gets compiled)
-    case "$host" in
-      *-ibm-aix*) aix_tapeio=yes ;;
-      *-sysv4.2uw2*) uware_tapeio=yes ;;
-      *-sco3.2v5*) xenix_tapeio=yes ;;
-      i386-pc-isc4*) xenix_tapeio=yes ;;
-    esac
-
     # maybe we have no tape device at all (e.g., Mac OS X)?
-    if test -n "$xenix_tapeio" ||
-       test -n "$aix_tapeio" ||
-       test -n "$uware_tapeio" ||
-       test -n "$HAVE_MTIOCTOP"; then
+    if test x"$HAVE_MTIOCTOP" = x"yes"; then
        want_tape_device=yes
 
 cat >>confdefs.h <<\_ACEOF
@@ -37869,39 +41573,6 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
     fi
-
-     if test -n "$xenix_tapeio"; then
-  WANT_TAPE_XENIX_TRUE=
-  WANT_TAPE_XENIX_FALSE='#'
-else
-  WANT_TAPE_XENIX_TRUE='#'
-  WANT_TAPE_XENIX_FALSE=
-fi
-
-     if test -n "$aix_tapeio"; then
-  WANT_TAPE_AIX_TRUE=
-  WANT_TAPE_AIX_FALSE='#'
-else
-  WANT_TAPE_AIX_TRUE='#'
-  WANT_TAPE_AIX_FALSE=
-fi
-
-     if test -n "$uware_tapeio"; then
-  WANT_TAPE_UWARE_TRUE=
-  WANT_TAPE_UWARE_FALSE='#'
-else
-  WANT_TAPE_UWARE_TRUE='#'
-  WANT_TAPE_UWARE_FALSE=
-fi
-
-     if test -n "$HAVE_MTIOCTOP"; then
-  WANT_TAPE_POSIX_TRUE=
-  WANT_TAPE_POSIX_FALSE='#'
-else
-  WANT_TAPE_POSIX_TRUE='#'
-  WANT_TAPE_POSIX_FALSE=
-fi
-
      if test -n "$want_tape_device"; then
   WANT_TAPE_DEVICE_TRUE=
   WANT_TAPE_DEVICE_FALSE='#'
@@ -37911,30 +41582,6 @@ else
 fi
 
 
-    if test -n "$xenix_tapeio"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define WANT_TAPE_XENIX 1
-_ACEOF
-
-    fi
-
-    if test -n "$aix_tapeio"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define WANT_TAPE_AIX 1
-_ACEOF
-
-    fi
-
-    if test -n "$uware_tapeio"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define WANT_TAPE_UWARE 1
-_ACEOF
-
-    fi
-
     #
     # Check for various "mt status" related structure elements.
     #
@@ -40350,6 +43997,24 @@ if test "$LEX" = :; then
 fi
 
 
+
+    if test x"$LEX" != x""; then
+       { $as_echo "$as_me:$LINENO: checking whether lex is broken Solaris (SGU) lex" >&5
+$as_echo_n "checking whether lex is broken Solaris (SGU) lex... " >&6; }
+       $LEX -V < /dev/null >/dev/null 2>conftest.out
+       if grep SGU conftest.out >/dev/null; then
+           { $as_echo "$as_me:$LINENO: result: yes - disabled (set LEX=/path/to/lex to use a specific binary)" >&5
+$as_echo "yes - disabled (set LEX=/path/to/lex to use a specific binary)" >&6; }
+           LEX='echo no lex equivalent available; false'
+       else
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       fi
+       rm conftest.out
+    fi
+
+
+
     # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -40563,6 +44228,7 @@ $as_echo "$MKDIR_P" >&6; }
 
 
 
+
     # Extract the first word of "dd", so it can be a program name with args.
 set dummy dd; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -40791,7 +44457,7 @@ else
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
+for as_dir in $SYSLOCPATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
@@ -40834,6 +44500,51 @@ _ACEOF
 
 
 
+    # Extract the first word of "mtx", so it can be a program name with args.
+set dummy mtx; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MTX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $MTX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MTX="$MTX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MTX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_MTX" && ac_cv_path_MTX="mtx"
+  ;;
+esac
+fi
+MTX=$ac_cv_path_MTX
+if test -n "$MTX"; then
+  { $as_echo "$as_me:$LINENO: result: $MTX" >&5
+$as_echo "$MTX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+
 
     for ac_prog in lpr lp
 do
@@ -41129,6 +44840,7 @@ done
 
     # 1.3.32 introduces a change in the way empty strings are handled (old versions
     # returned undef in Perl, while new versions return an empty Perl string)
+    # 1.3.39 is required for the %begin block
 
         # Extract the first word of "swig", so it can be a program name with args.
 set dummy swig; ac_word=$2
 
         if test -z "$SWIG" ; then
                 SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
-        elif test -n "1.3.32" ; then
+        elif test -n "1.3.39" ; then
                 { $as_echo "$as_me:$LINENO: checking for SWIG version" >&5
 $as_echo_n "checking for SWIG version... " >&6; }
                 swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
                 { $as_echo "$as_me:$LINENO: result: $swig_version" >&5
 $as_echo "$swig_version" >&6; }
                 if test -n "$swig_version" ; then
-                        # Calculate the required version number components
-                        required=1.3.32
-                        required_major=`echo $required | sed 's/[^0-9].*//'`
-                        if test -z "$required_major" ; then
-                                required_major=0
-                        fi
-                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
-                        required_minor=`echo $required | sed 's/[^0-9].*//'`
-                        if test -z "$required_minor" ; then
-                                required_minor=0
-                        fi
-                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
-                        required_patch=`echo $required | sed 's/[^0-9].*//'`
-                        if test -z "$required_patch" ; then
-                                required_patch=0
-                        fi
-                        # Calculate the available version number components
-                        available=$swig_version
-                        available_major=`echo $available | sed 's/[^0-9].*//'`
-                        if test -z "$available_major" ; then
-                                available_major=0
-                        fi
-                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
-                        available_minor=`echo $available | sed 's/[^0-9].*//'`
-                        if test -z "$available_minor" ; then
-                                available_minor=0
-                        fi
-                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
-                        available_patch=`echo $available | sed 's/[^0-9].*//'`
-                        if test -z "$available_patch" ; then
-                                available_patch=0
-                        fi
-                        if test $available_major -ne $required_major \
-                                -o $available_minor -ne $required_minor \
-                                -o $available_patch -lt $required_patch ; then
-                                SWIG='echo "Error: SWIG version >= 1.3.32 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
-                        else
-                                SWIG_LIB=`$SWIG -swiglib`
-                        fi
+
+  # Used to indicate true or false condition
+  ax_compare_version=false
+
+  # Convert the two version strings to be compared into a format that
+  # allows a simple string comparison.  The end result is that a version
+  # string of the form 1.12.5-r617 will be converted to the form
+  # 0001001200050617.  In other words, each number is zero padded to four
+  # digits, and non digits are removed.
+
+  ax_compare_version_A=`echo "$swig_version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+  ax_compare_version_B=`echo "1.3.39" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+    ax_compare_version=`echo "x$ax_compare_version_A
+x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"`
+
+
+
+    if test "$ax_compare_version" = "true" ; then
+
+                                                   SWIG_LIB=`$SWIG -swiglib`
+
+    else
+                                                   SWIG='echo "Error: SWIG version >= 1.3.39 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+
+  fi
+
                 else
                         SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
                 fi
 
 
 
-    # rpcgen rules (which only appear in ndmp-src) are disabled completely
-    # on systems where rpcgen is not available
-     if test "x$RPCGEN" != "x"; then
-  HAVE_RPCGEN_TRUE=
-  HAVE_RPCGEN_FALSE='#'
-else
-  HAVE_RPCGEN_TRUE='#'
-  HAVE_RPCGEN_FALSE=
-fi
-
-
 
 
 #
@@ -42948,13 +46648,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:42951: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:46651: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:42954: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:46654: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:42957: output\"" >&5)
+  (eval echo "\"\$as_me:46657: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -44052,7 +47752,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 44055 "configure"' > conftest.$ac_ext
+  echo '#line 47755 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -45421,11 +49121,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:45424: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:49124: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:45428: \$? = $ac_status" >&5
+   echo "$as_me:49128: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -45745,11 +49445,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:45748: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:49448: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:45752: \$? = $ac_status" >&5
+   echo "$as_me:49452: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -45850,11 +49550,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:45853: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:49553: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:45857: \$? = $ac_status" >&5
+   echo "$as_me:49557: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -45905,11 +49605,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:45908: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:49608: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:45912: \$? = $ac_status" >&5
+   echo "$as_me:49612: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -48710,7 +52410,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 48713 "configure"
+#line 52413 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -48810,7 +52510,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 48813 "configure"
+#line 52513 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
     esac
 
 
-    # search for pkg-config, which the glib configuration uses, adding a few
-    # system-specific search paths.
-    # Extract the first word of "pkg-config", so it can be a program name with args.
+
+
+
+
+
+
+    # if any of the precious variables are set, disable the pkg-config run
+    explicit_glib=no
+    test x"$GLIB_CFLAGS" = x"" || explicit_glib=yes
+    test x"$GLIB_LIBS" = x"" || explicit_glib=yes
+    test x"$GLIB_GENMARSHAL" = x"" || explicit_glib=yes
+    test x"$GOBJECT_QUERY" = x"" || explicit_glib=yes
+    test x"$GLIB_MKENUMS" = x"" || explicit_glib=yes
+
+    if test x"$explicit_glib" = x"no"; then
+       # search for pkg-config, which the glib configuration uses, adding a few
+       # system-specific search paths.
+       # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 
 
 
-    case "$host" in
-       sparc-sun-solaris2.8) # Solaris 8
-           # give the linker a runtime search path; pkg-config doesn't supply this.
-           # Users could also specify this with LD_LIBRARY_PATH to both ./configure
-           # and make.  Adding this support here makes straight './configure; make'
-           # "just work" on Solaris 8
-           if test -n "$PKG_CONFIG"; then
-               glib_R_flag=`$PKG_CONFIG glib-2.0 --libs-only-L 2>/dev/null | sed -e 's/-L/-R/g'`
-               LDFLAGS="$LDFLAGS $glib_R_flag"
-           fi
-           ;;
-    esac
+       case "$host" in
+           sparc-sun-solaris2.8) # Solaris 8
+               # give the linker a runtime search path; pkg-config doesn't supply this.
+               # Users could also specify this with LD_LIBRARY_PATH to both ./configure
+               # and make.  Adding this support here makes straight './configure; make'
+               # "just work" on Solaris 8
+               if test -n "$PKG_CONFIG"; then
+                   glib_R_flag=`$PKG_CONFIG glib-2.0 --libs-only-L 2>/dev/null | sed -e 's/-L/-R/g'`
+                   LDFLAGS="$LDFLAGS $glib_R_flag"
+               fi
+               ;;
+       esac
 
-    # Check whether --enable-glibtest was given.
+       # Check whether --enable-glibtest was given.
 if test "${enable_glibtest+set}" = set; then
   enableval=$enable_glibtest;
 else
@@ -54865,7 +58580,7 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      GOBJECT_QUERY=""
      GLIB_MKENUMS=""
 
-       { { $as_echo "$as_me:$LINENO: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&5
+           { { $as_echo "$as_me:$LINENO: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&5
 $as_echo "$as_me: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&2;}
    { (exit 1); exit 1; }; }
 
@@ -54877,6 +58592,12 @@ $as_echo "$as_me: error: glib not found or too old; See http://wiki.zmanda.com/i
 
   rm -f conf.glibtest
 
+    else
+       { { $as_echo "$as_me:$LINENO: error: explicit glib" >&5
+$as_echo "$as_me: error: explicit glib" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
     # GLIB_CPPFLAGS is not set by autoconf, yet GLIB_CFLAGS contains what GLIB_CPPFLAGS should contain.
     CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
 
 fi
 
 
+for ac_func in unsetenv
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
 ice_have_vfprintf=no
 
 for ac_func in vfprintf
@@ -69960,7 +73782,7 @@ fi
 
 
 
-ac_config_files="$ac_config_files Makefile amandad-src/Makefile amar-src/Makefile amplot/Makefile changer-src/Makefile client-src/Makefile common-src/Makefile config/Makefile device-src/Makefile application-src/Makefile example/Makefile gnulib/Makefile installcheck/Makefile man/Makefile ndmp-src/Makefile oldrecover-src/Makefile packaging/Makefile perl/Makefile po/Makefile recover-src/Makefile server-src/Makefile xfer-src/Makefile"
+ac_config_files="$ac_config_files Makefile amandad-src/Makefile amar-src/Makefile amplot/Makefile changer-src/Makefile client-src/Makefile common-src/Makefile config/Makefile device-src/Makefile application-src/Makefile example/Makefile gnulib/Makefile installcheck/Makefile man/Makefile ndmp-src/Makefile oldrecover-src/Makefile packaging/Makefile perl/amglue/Makefile perl/Makefile po/Makefile recover-src/Makefile server-src/Makefile xfer-src/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -70095,7 +73917,7 @@ fi
     if test -n "$gl_LIBOBJS"; then
       # Remove the extension.
       sed_drop_objext='s/\.o$//;s/\.obj$//'
-      for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
+      for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
         gl_libobjs="$gl_libobjs $i.$ac_objext"
         gl_ltlibobjs="$gl_ltlibobjs $i.lo"
       done
@@ -70111,7 +73933,7 @@ fi
     if test -n "$gltests_LIBOBJS"; then
       # Remove the extension.
       sed_drop_objext='s/\.o$//;s/\.obj$//'
-      for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
+      for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
         gltests_libobjs="$gltests_libobjs $i.$ac_objext"
         gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
       done
@@ -70142,10 +73964,10 @@ $as_echo "$as_me: error: conditional \"WANT_INSTALLPERMS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${CHECK_SCRIPTS_AT_BUILD_TRUE}" && test -z "${CHECK_SCRIPTS_AT_BUILD_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"CHECK_SCRIPTS_AT_BUILD\" was never defined.
+if test -z "${SYNTAX_CHECKS_TRUE}" && test -z "${SYNTAX_CHECKS_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"SYNTAX_CHECKS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"CHECK_SCRIPTS_AT_BUILD\" was never defined.
+$as_echo "$as_me: error: conditional \"SYNTAX_CHECKS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -70205,83 +74027,6 @@ $as_echo "$as_me: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${WANT_CHG_SCSI_TRUE}" && test -z "${WANT_CHG_SCSI_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_CHG_SCSI\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_CHG_SCSI\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_SCSI_LINUX_TRUE}" && test -z "${WANT_SCSI_LINUX_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_LINUX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_SCSI_LINUX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_SCSI_HPUX_NEW_TRUE}" && test -z "${WANT_SCSI_HPUX_NEW_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_HPUX_NEW\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_SCSI_HPUX_NEW\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_SCSI_IRIX_TRUE}" && test -z "${WANT_SCSI_IRIX_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_IRIX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_SCSI_IRIX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_SCSI_SOLARIS_TRUE}" && test -z "${WANT_SCSI_SOLARIS_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_SOLARIS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_SCSI_SOLARIS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_SCSI_AIX_TRUE}" && test -z "${WANT_SCSI_AIX_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_AIX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_SCSI_AIX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_SCSI_CAM_TRUE}" && test -z "${WANT_SCSI_CAM_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_CAM\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_SCSI_CAM\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_SCSI_BSD_TRUE}" && test -z "${WANT_SCSI_BSD_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_BSD\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_SCSI_BSD\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_CHG_SCSI_CHIO_TRUE}" && test -z "${WANT_CHG_SCSI_CHIO_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_CHG_SCSI_CHIO\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_CHG_SCSI_CHIO\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_SCSI_HPUX_TRUE}" && test -z "${WANT_SCSI_HPUX_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_HPUX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_SCSI_HPUX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_SCSI_CHIO_TRUE}" && test -z "${WANT_SCSI_CHIO_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_CHIO\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_SCSI_CHIO\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
 if test -z "${WANT_AMFLOCK_POSIX_TRUE}" && test -z "${WANT_AMFLOCK_POSIX_FALSE}"; then
   { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_POSIX\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -70317,38 +74062,17 @@ $as_echo "$as_me: error: conditional \"WANT_CYGWIN_COPY_PERL_DLL\" was never def
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${WANT_S3_DEVICE_TRUE}" && test -z "${WANT_S3_DEVICE_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_S3_DEVICE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_S3_DEVICE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_TAPE_XENIX_TRUE}" && test -z "${WANT_TAPE_XENIX_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_XENIX\" was never defined.
+if test -z "${WANT_MANDATORY_THREAD_CHECK_TRUE}" && test -z "${WANT_MANDATORY_THREAD_CHECK_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_MANDATORY_THREAD_CHECK\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_TAPE_XENIX\" was never defined.
+$as_echo "$as_me: error: conditional \"WANT_MANDATORY_THREAD_CHECK\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${WANT_TAPE_AIX_TRUE}" && test -z "${WANT_TAPE_AIX_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_AIX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_TAPE_AIX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_TAPE_UWARE_TRUE}" && test -z "${WANT_TAPE_UWARE_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_UWARE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_TAPE_UWARE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_TAPE_POSIX_TRUE}" && test -z "${WANT_TAPE_POSIX_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_POSIX\" was never defined.
+if test -z "${WANT_S3_DEVICE_TRUE}" && test -z "${WANT_S3_DEVICE_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_S3_DEVICE\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_TAPE_POSIX\" was never defined.
+$as_echo "$as_me: error: conditional \"WANT_S3_DEVICE\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -70422,13 +74146,6 @@ $as_echo "$as_me: error: conditional \"WANT_SAMBA\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${HAVE_RPCGEN_TRUE}" && test -z "${HAVE_RPCGEN_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_RPCGEN\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"HAVE_RPCGEN\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
 
 if test -z "${GCC_COMPILER_TRUE}" && test -z "${GCC_COMPILER_FALSE}"; then
   { { $as_echo "$as_me:$LINENO: error: conditional \"GCC_COMPILER\" was never defined.
@@ -71226,6 +74943,7 @@ do
     "ndmp-src/Makefile") CONFIG_FILES="$CONFIG_FILES ndmp-src/Makefile" ;;
     "oldrecover-src/Makefile") CONFIG_FILES="$CONFIG_FILES oldrecover-src/Makefile" ;;
     "packaging/Makefile") CONFIG_FILES="$CONFIG_FILES packaging/Makefile" ;;
+    "perl/amglue/Makefile") CONFIG_FILES="$CONFIG_FILES perl/amglue/Makefile" ;;
     "perl/Makefile") CONFIG_FILES="$CONFIG_FILES perl/Makefile" ;;
     "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;;
     "recover-src/Makefile") CONFIG_FILES="$CONFIG_FILES recover-src/Makefile" ;;
index 035a0b648f12e19681f98eb7dc07f4162402f7ec..8cc9bfbb35364b48189580680b19780ed6c98f8e 100644 (file)
@@ -76,13 +76,11 @@ AMANDA_SETUP_AMPLOT
 AMANDA_SETUP_DOCUMENTATION
 AMANDA_SETUP_DEFAULTS
 AMANDA_SETUP_LFS
-AMANDA_SETUP_CHANGER
 AMANDA_SETUP_GETFSENT
 AMANDA_SETUP_FILE_LOCKING
 AMANDA_SETUP_SWIG
 AMANDA_CHECK_COMPRESSION
 AMANDA_CHECK_IPV6
-AMANDA_CHECK_SHMEM
 AMANDA_CHECK_READDIR
 AMANDA_CHECK_DEVICE_PREFIXES
 AMANDA_SYSHACKS
@@ -132,7 +130,7 @@ AMANDA_CHECK_USE_RUNDUMP
 AMANDA_PROG_GREP
 AC_PROG_EGREP
 AMANDA_PROG_LINT
-AM_PROG_LEX
+AMANDA_PROG_LEX
 AMANDA_PROG_AR
 AMANDA_PROG_GETTEXT
 AC_PROG_AWK
@@ -143,6 +141,7 @@ AMANDA_PROG_BASH
 AMANDA_PROG_SORT
 AMANDA_PROG_MAILER
 AMANDA_PROG_MT
+AMANDA_PROG_MTX
 AMANDA_PROG_LPR
 AMANDA_PROG_PCAT
 AMANDA_PROG_PERL
@@ -356,6 +355,7 @@ ICE_CHECK_DECL(time,time.h sys/time.h)
 ICE_CHECK_DECL(tolower,ctype.h)
 ICE_CHECK_DECL(toupper,ctype.h)
 ICE_CHECK_DECL(ungetc,stdio.h)
+AC_CHECK_FUNCS(unsetenv)
 ICE_CHECK_DECL(vfprintf,stdio.h stdlib.h)
 ICE_CHECK_DECL(vprintf,stdio.h stdlib.h)
 AC_CHECK_FUNC(wait4)
@@ -386,6 +386,7 @@ AC_CONFIG_FILES([
     ndmp-src/Makefile
     oldrecover-src/Makefile
     packaging/Makefile
+    perl/amglue/Makefile
     perl/Makefile
     po/Makefile
     recover-src/Makefile
index a73fc624cce0b363ceb1b420f8b3484826579e58..69fb328ce04dc34c5b48494c0edae27479b5583e 100644 (file)
@@ -31,7 +31,6 @@ libamdevice_la_LDFLAGS = -release $(VERSION)
 libamdevice_la_SOURCES = \
        property.c \
        device.c \
-       device-queueing.c \
        directtcp-connection.c \
        null-device.c \
        rait-device.c \
@@ -39,33 +38,16 @@ libamdevice_la_SOURCES = \
        xfer-source-device.c \
        xfer-dest-device.c \
        xfer-dest-taper.c \
-       xfer-dest-taper-splitter.c \
+       xfer-dest-taper-cacher.c \
        xfer-dest-taper-directtcp.c \
+       xfer-dest-taper-splitter.c \
        xfer-source-recovery.c
 libamdevice_la_LIBADD = \
        ../common-src/libamanda.la \
        ../xfer-src/libamxfer.la
 
-# tape-device has *lots* of conditionals; the first is whether to support
-# the device at all, and the remainder select a particular kind of OS-specific
-# backend.
-
 if WANT_TAPE_DEVICE
 libamdevice_la_SOURCES += tape-device.c
-
-if WANT_TAPE_XENIX
-libamdevice_la_SOURCES += tape-xenix.c
-endif
-if WANT_TAPE_AIX
-libamdevice_la_SOURCES += tape-aix.c
-endif
-if WANT_TAPE_UWARE
-libamdevice_la_SOURCES += tape-uware.c
-endif
-if WANT_TAPE_POSIX
-libamdevice_la_SOURCES += tape-posix.c
-endif
-
 endif
 
 if WANT_S3_DEVICE
@@ -83,14 +65,9 @@ endif
 
 ## automake-style tests
 
-TESTS = vfs-test
+TESTS =
 noinst_PROGRAMS = $(TESTS)
 
-vfs_test_SOURCES = vfs-test.c
-vfs_test_LDADD = \
-       ../common-src/libtestutils.la \
-       libamdevice.la
-
 ## activate-devpay
 
 if WANT_S3_DEVICE
@@ -101,15 +78,13 @@ endif
 ## headers
 
 noinst_HEADERS = \
-       device-queueing.h \
        device.h \
        directtcp-connection.h \
        property.h \
        s3.h \
        s3-util.h \
-       tape-device.h \
-       tape-ops.h \
        xfer-device.h \
+       xfer-dest-taper.h \
        vfs-device.h
 
 aminclude_HEADERS = 
index 579c7122593a2a1815e5fe3052dbcb0d5fe26ecc..d555a06863c879040e98d9058edc2c0f16e39841 100644 (file)
@@ -142,22 +142,14 @@ DIST_COMMON = $(aminclude_HEADERS) $(noinst_HEADERS) \
 # ndmp-device.c includes files with old-skool prototypes, so:
 @GCC_COMPILER_TRUE@am__append_1 = -Wno-strict-prototypes
 sbin_PROGRAMS = $(am__EXEEXT_2)
-
-# tape-device has *lots* of conditionals; the first is whether to support
-# the device at all, and the remainder select a particular kind of OS-specific
-# backend.
 @WANT_TAPE_DEVICE_TRUE@am__append_2 = tape-device.c
-@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@am__append_3 = tape-xenix.c
-@WANT_TAPE_AIX_TRUE@@WANT_TAPE_DEVICE_TRUE@am__append_4 = tape-aix.c
-@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@am__append_5 = tape-uware.c
-@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@am__append_6 = tape-posix.c
-@WANT_S3_DEVICE_TRUE@am__append_7 = s3-device.c s3.c s3-util.c
-@WANT_DVDRW_DEVICE_TRUE@am__append_8 = dvdrw-device.c
-@WANT_NDMP_DEVICE_TRUE@am__append_9 = ndmp-device.c
-@WANT_NDMP_DEVICE_TRUE@am__append_10 = ../ndmp-src/libndmlib.la
-TESTS = vfs-test$(EXEEXT)
+@WANT_S3_DEVICE_TRUE@am__append_3 = s3-device.c s3.c s3-util.c
+@WANT_DVDRW_DEVICE_TRUE@am__append_4 = dvdrw-device.c
+@WANT_NDMP_DEVICE_TRUE@am__append_5 = ndmp-device.c
+@WANT_NDMP_DEVICE_TRUE@am__append_6 = ../ndmp-src/libndmlib.la
+TESTS =
 noinst_PROGRAMS = $(am__EXEEXT_1)
-@WANT_S3_DEVICE_TRUE@am__append_11 = activate-devpay
+@WANT_S3_DEVICE_TRUE@am__append_7 = activate-devpay
 subdir = device-src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps =  \
@@ -174,7 +166,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -202,7 +193,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -215,10 +205,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -232,7 +226,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -245,10 +241,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -260,21 +259,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -328,40 +331,30 @@ am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" \
        "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amincludedir)"
 LTLIBRARIES = $(amlib_LTLIBRARIES)
 libamdevice_la_DEPENDENCIES = ../common-src/libamanda.la \
-       ../xfer-src/libamxfer.la $(am__append_10)
+       ../xfer-src/libamxfer.la $(am__append_6)
 am__libamdevice_la_SOURCES_DIST = property.c device.c \
-       device-queueing.c directtcp-connection.c null-device.c \
-       rait-device.c vfs-device.c xfer-source-device.c \
-       xfer-dest-device.c xfer-dest-taper.c \
-       xfer-dest-taper-splitter.c xfer-dest-taper-directtcp.c \
-       xfer-source-recovery.c tape-device.c tape-xenix.c tape-aix.c \
-       tape-uware.c tape-posix.c s3-device.c s3.c s3-util.c \
-       dvdrw-device.c ndmp-device.c
+       directtcp-connection.c null-device.c rait-device.c \
+       vfs-device.c xfer-source-device.c xfer-dest-device.c \
+       xfer-dest-taper.c xfer-dest-taper-cacher.c \
+       xfer-dest-taper-directtcp.c xfer-dest-taper-splitter.c \
+       xfer-source-recovery.c tape-device.c s3-device.c s3.c \
+       s3-util.c dvdrw-device.c ndmp-device.c
 @WANT_TAPE_DEVICE_TRUE@am__objects_1 = tape-device.lo
-@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@am__objects_2 =  \
-@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@  tape-xenix.lo
-@WANT_TAPE_AIX_TRUE@@WANT_TAPE_DEVICE_TRUE@am__objects_3 =  \
-@WANT_TAPE_AIX_TRUE@@WANT_TAPE_DEVICE_TRUE@    tape-aix.lo
-@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@am__objects_4 =  \
-@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@  tape-uware.lo
-@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@am__objects_5 =  \
-@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@  tape-posix.lo
-@WANT_S3_DEVICE_TRUE@am__objects_6 = s3-device.lo s3.lo s3-util.lo
-@WANT_DVDRW_DEVICE_TRUE@am__objects_7 = dvdrw-device.lo
-@WANT_NDMP_DEVICE_TRUE@am__objects_8 = ndmp-device.lo
-am_libamdevice_la_OBJECTS = property.lo device.lo device-queueing.lo \
+@WANT_S3_DEVICE_TRUE@am__objects_2 = s3-device.lo s3.lo s3-util.lo
+@WANT_DVDRW_DEVICE_TRUE@am__objects_3 = dvdrw-device.lo
+@WANT_NDMP_DEVICE_TRUE@am__objects_4 = ndmp-device.lo
+am_libamdevice_la_OBJECTS = property.lo device.lo \
        directtcp-connection.lo null-device.lo rait-device.lo \
        vfs-device.lo xfer-source-device.lo xfer-dest-device.lo \
-       xfer-dest-taper.lo xfer-dest-taper-splitter.lo \
-       xfer-dest-taper-directtcp.lo xfer-source-recovery.lo \
-       $(am__objects_1) $(am__objects_2) $(am__objects_3) \
-       $(am__objects_4) $(am__objects_5) $(am__objects_6) \
-       $(am__objects_7) $(am__objects_8)
+       xfer-dest-taper.lo xfer-dest-taper-cacher.lo \
+       xfer-dest-taper-directtcp.lo xfer-dest-taper-splitter.lo \
+       xfer-source-recovery.lo $(am__objects_1) $(am__objects_2) \
+       $(am__objects_3) $(am__objects_4)
 libamdevice_la_OBJECTS = $(am_libamdevice_la_OBJECTS)
 libamdevice_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libamdevice_la_LDFLAGS) $(LDFLAGS) -o $@
-am__EXEEXT_1 = vfs-test$(EXEEXT)
+am__EXEEXT_1 =
 @WANT_S3_DEVICE_TRUE@am__EXEEXT_2 = activate-devpay$(EXEEXT)
 PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
 am__activate_devpay_SOURCES_DIST = activate-devpay.c
@@ -369,9 +362,6 @@ am__activate_devpay_SOURCES_DIST = activate-devpay.c
 @WANT_S3_DEVICE_TRUE@  activate-devpay.$(OBJEXT)
 activate_devpay_OBJECTS = $(am_activate_devpay_OBJECTS)
 activate_devpay_LDADD = $(LDADD)
-am_vfs_test_OBJECTS = vfs-test.$(OBJEXT)
-vfs_test_OBJECTS = $(am_vfs_test_OBJECTS)
-vfs_test_DEPENDENCIES = ../common-src/libtestutils.la libamdevice.la
 SCRIPTS = $(sbin_SCRIPTS)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
@@ -386,10 +376,9 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
-SOURCES = $(libamdevice_la_SOURCES) $(activate_devpay_SOURCES) \
-       $(vfs_test_SOURCES)
+SOURCES = $(libamdevice_la_SOURCES) $(activate_devpay_SOURCES)
 DIST_SOURCES = $(am__libamdevice_la_SOURCES_DIST) \
-       $(am__activate_devpay_SOURCES_DIST) $(vfs_test_SOURCES)
+       $(am__activate_devpay_SOURCES_DIST)
 HEADERS = $(aminclude_HEADERS) $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
@@ -417,7 +406,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -437,10 +426,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -496,78 +482,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -578,12 +619,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -598,17 +668,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -617,60 +691,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -678,13 +811,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -693,9 +832,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -731,7 +873,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -740,7 +881,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -748,19 +888,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -786,47 +949,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -834,6 +1053,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -856,19 +1076,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -878,13 +1100,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -928,6 +1147,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -984,32 +1204,23 @@ SCRIPTS_PERL = \
 sbin_SCRIPTS = $(SCRIPTS_PERL)
 amlib_LTLIBRARIES = libamdevice.la
 libamdevice_la_LDFLAGS = -release $(VERSION) 
-libamdevice_la_SOURCES = property.c device.c device-queueing.c \
-       directtcp-connection.c null-device.c rait-device.c \
-       vfs-device.c xfer-source-device.c xfer-dest-device.c \
-       xfer-dest-taper.c xfer-dest-taper-splitter.c \
-       xfer-dest-taper-directtcp.c xfer-source-recovery.c \
-       $(am__append_2) $(am__append_3) $(am__append_4) \
-       $(am__append_5) $(am__append_6) $(am__append_7) \
-       $(am__append_8) $(am__append_9)
+libamdevice_la_SOURCES = property.c device.c directtcp-connection.c \
+       null-device.c rait-device.c vfs-device.c xfer-source-device.c \
+       xfer-dest-device.c xfer-dest-taper.c xfer-dest-taper-cacher.c \
+       xfer-dest-taper-directtcp.c xfer-dest-taper-splitter.c \
+       xfer-source-recovery.c $(am__append_2) $(am__append_3) \
+       $(am__append_4) $(am__append_5)
 libamdevice_la_LIBADD = ../common-src/libamanda.la \
-       ../xfer-src/libamxfer.la $(am__append_10)
-vfs_test_SOURCES = vfs-test.c
-vfs_test_LDADD = \
-       ../common-src/libtestutils.la \
-       libamdevice.la
-
+       ../xfer-src/libamxfer.la $(am__append_6)
 @WANT_S3_DEVICE_TRUE@activate_devpay_SOURCES = activate-devpay.c
 noinst_HEADERS = \
-       device-queueing.h \
        device.h \
        directtcp-connection.h \
        property.h \
        s3.h \
        s3-util.h \
-       tape-device.h \
-       tape-ops.h \
        xfer-device.h \
+       xfer-dest-taper.h \
        vfs-device.h
 
 aminclude_HEADERS = 
@@ -1136,9 +1347,6 @@ clean-sbinPROGRAMS:
 activate-devpay$(EXEEXT): $(activate_devpay_OBJECTS) $(activate_devpay_DEPENDENCIES) 
        @rm -f activate-devpay$(EXEEXT)
        $(LINK) $(activate_devpay_OBJECTS) $(activate_devpay_LDADD) $(LIBS)
-vfs-test$(EXEEXT): $(vfs_test_OBJECTS) $(vfs_test_DEPENDENCIES) 
-       @rm -f vfs-test$(EXEEXT)
-       $(LINK) $(vfs_test_OBJECTS) $(vfs_test_LDADD) $(LIBS)
 install-sbinSCRIPTS: $(sbin_SCRIPTS)
        @$(NORMAL_INSTALL)
        test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
@@ -1181,7 +1389,6 @@ distclean-compile:
        -rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/activate-devpay.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device-queueing.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directtcp-connection.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvdrw-device.Plo@am__quote@
@@ -1192,14 +1399,10 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3-device.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3-util.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-aix.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-device.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-posix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-uware.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-xenix.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs-device.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs-test.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-dest-device.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-dest-taper-cacher.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-dest-taper-directtcp.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-dest-taper-splitter.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-dest-taper.Plo@am__quote@
@@ -1430,6 +1633,7 @@ distdir: $(DISTFILES)
        $(MAKE) $(AM_MAKEFLAGS) \
          top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-hook
+@SYNTAX_CHECKS_FALSE@check-local:
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
 check: $(BUILT_SOURCES)
@@ -1519,7 +1723,7 @@ install-ps: install-ps-am
 
 install-ps-am:
 
-installcheck-am: installcheck-local
+installcheck-am:
 
 maintainer-clean: maintainer-clean-am
        -rm -rf ./$(DEPDIR)
@@ -1556,10 +1760,10 @@ uninstall-am: uninstall-amincludeHEADERS uninstall-amlibLTLIBRARIES \
        install-info-am install-man install-pdf install-pdf-am \
        install-ps install-ps-am install-sbinPROGRAMS \
        install-sbinSCRIPTS install-strip installcheck installcheck-am \
-       installcheck-local installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-amincludeHEADERS \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-amincludeHEADERS \
        uninstall-amlibLTLIBRARIES uninstall-sbinPROGRAMS \
        uninstall-sbinSCRIPTS
 
@@ -1568,11 +1772,13 @@ uninstall-am: uninstall-amincludeHEADERS uninstall-amlibLTLIBRARIES \
 %: %.pl $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          rm $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  fi
+@SYNTAX_CHECKS_TRUE@   @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+@SYNTAX_CHECKS_TRUE@           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
+@SYNTAX_CHECKS_TRUE@           rm $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@   else \
+@SYNTAX_CHECKS_TRUE@           echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
+@SYNTAX_CHECKS_TRUE@   fi
 
 %.pl: %.pl.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
@@ -1596,33 +1802,22 @@ uninstall-am: uninstall-amincludeHEADERS uninstall-amlibLTLIBRARIES \
 %.awk: %.awk.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
 
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
 check-perl: $(SCRIPTS_PERL)
        @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
            test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-           if test -n "$(PERL)"; then \
-                   for perlobj in $$SCRIPTS_PERL; do \
-                           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
-                           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
-                           rm $$perlobj.nouselib; \
-                   done; \
-           fi \
-       fi
-check-local: check-perl
-
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
-       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
-       if test x"$(SKIP_CHECKS)" = x"" && \
-           test -n "$(PERL)"; then \
-               for perlobj in $$SCRIPTS_PERL; do \
-                       $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
-               done; \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
        fi
-installcheck-local: installcheck-perl
+@SYNTAX_CHECKS_TRUE@check-local: check-perl
 
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
 check-shell: $(SCRIPTS_SHELL)
        @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
@@ -1640,7 +1835,7 @@ check-shell: $(SCRIPTS_SHELL)
                        echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
        fi
-check-local: check-shell
+@SYNTAX_CHECKS_TRUE@check-local: check-shell
 
 # make sure that the sources for all shell and perl scripts get included
 # in the distribution
index 9563071d70d78fd10e3fd4a4697b8c779b24dc99..db3ec7733b6e6a45706c77efdbd123e77b92c089 100644 (file)
@@ -194,9 +194,9 @@ static void do_output(Credentials * rare) {
         exit(EXIT_FAILURE);
     }
 
-    g_printf("device_property \"S3_USER_TOKEN\" \"%s\"\n"
-             "device_property \"S3_ACCESS_KEY\" \"%s\"\n"
-             "device_property \"S3_SECRET_KEY\" \"%s\"\n",
+    g_printf("device-property \"S3_USER_TOKEN\" \"%s\"\n"
+             "device-property \"S3_ACCESS_KEY\" \"%s\"\n"
+             "device-property \"S3_SECRET_KEY\" \"%s\"\n",
              rare->user_token->str, rare->access_key->str,
              rare->secret_key->str);
 }
index fe47f3a3352839b4720d441f041bdb2ddf9a11f3..9b8ccfe962469e9dffccd78235f7847152138a33 100644 (file)
@@ -1,5 +1,5 @@
 #! @PERL@
-# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -21,6 +21,7 @@ use lib '@amperldir@';
 use Getopt::Long;
 
 use strict;
+use warnings;
 use Amanda::Device qw( :constants );
 use Amanda::Config qw( :getconf :init );
 use Amanda::Debug qw( :logging );
index 171f5a2c57d42dba440191ed4dd2b971e614e1cf..bbc7d32aa34e0a8572b0aedb2f3c54a75e294734 100644 (file)
@@ -22,6 +22,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 
 use File::Basename;
 use Getopt::Long;
@@ -159,7 +160,7 @@ sub write_one_file(%) {
     } else {
        die "Unknown PATTERN $pattern";
     }
-    $dest = Amanda::Xfer::Dest::Device->new($device, 0);
+    $dest = Amanda::Xfer::Dest::Device->new($device, 1);
     $xfer = Amanda::Xfer->new([$source, $dest]);
 
     # set up the relevant callbacks
@@ -216,6 +217,10 @@ sub write_one_file(%) {
        return $device->error_or_status();
     }
 
+    if ($got_error && $got_error =~ /LEOM detected/) {
+       return "LEOM";
+    }
+
     if ($got_error) {
        return $got_error;
     }
@@ -456,12 +461,12 @@ sub check_property {
 
     if ($need_fsf_after_filemark == 0 && $fsf_after_filemark_works == 0) {
        if (defined $opt_property || $fsf_after_filemark) {
-           print STDOUT "device_property \"FSF_AFTER_FILEMARK\" \"false\"\n";
+           print STDOUT "device-property \"FSF_AFTER_FILEMARK\" \"false\"\n";
        }
        $device->property_set('FSF_AFTER_FILEMARK', 0);
     } elsif ($need_fsf_after_filemark == 1 && $fsf_after_filemark_works == 1) {
        if (defined $opt_property || !$fsf_after_filemark) {
-           print STDOUT "device_property \"FSF_AFTER_FILEMARK\" \"true\"\n";
+           print STDOUT "device-property \"FSF_AFTER_FILEMARK\" \"true\"\n";
        }
        $device->property_set('FSF_AFTER_FILEMARK', 1);
     } else {
@@ -575,6 +580,12 @@ sub make_tapetype {
     $speed_estimate = int $speed_estimate;
     print STDERR "Wrote $volume_size_estimate bytes at $speed_estimate kb/sec\n";
 
+    my $leom = 0;
+    if ($err eq 'LEOM') {
+       print STDERR "Got LEOM indication, so drive and kernel together support LEOM\n";
+       $leom = 1;
+    }
+
     # now we want to write about 100 filemarks; round down to the blocksize
     # to avoid counting padding as part of the filemark
     my $file_size = $volume_size_estimate / 100;
@@ -604,13 +615,13 @@ sub make_tapetype {
     my $volume_size_estimate_kb = $volume_size_estimate/1024;
     my $filemark_kb = $filemark_estimate/1024;
 
-    # and suggest using device_property for blocksize if it's not an even multiple
+    # and suggest using device-property for blocksize if it's not an even multiple
     # of 1kb
     my $blocksize_line;
     if ($blocksize % 1024 == 0) {
        $blocksize_line = "blocksize " . $blocksize/1024 . " kbytes";
     } else {
-       $blocksize_line = "# add device_property \"BLOCK_SIZE\" \"$blocksize\" to the device";
+       $blocksize_line = "# add device-property \"BLOCK_SIZE\" \"$blocksize\" to the device";
     }
 
     print <<EOF;
@@ -622,6 +633,14 @@ define tapetype $opt_tapetype_name {
     $blocksize_line
 }
 EOF
+
+    if ($leom) {
+       print "# for this drive and kernel, LEOM is supported; add\n";
+       print "#   device-property \"LEOM\" \"TRUE\"\n";
+       print "# for this device.\n";
+    } else {
+       print "# LEOM is not supported for this drive and kernel\n";
+    }
 }
 
 sub usage {
diff --git a/device-src/device-queueing.c b/device-src/device-queueing.c
deleted file mode 100644 (file)
index 171c124..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-#include "amanda.h"
-#include "device-queueing.h"
-#include "device.h"
-
-producer_result_t device_read_producer(gpointer devicep,
-                                       queue_buffer_t *buffer,
-                                       size_t hint_size G_GNUC_UNUSED) {
-    Device* device;
-
-    device = (Device*) devicep;
-    g_assert(IS_DEVICE(device));
-
-    buffer->offset = 0;
-    for (;;) {
-        int result, read_size;
-        read_size = buffer->alloc_size;
-        result = device_read_block(device, buffer->data, &read_size);
-        if (result > 0) {
-            buffer->data_size = read_size;
-            return PRODUCER_MORE;
-        } else if (result == 0) {
-           /* unfortunately, the best "memory" we have of needing a larger
-            * block size is the next time this buffer comes around, and even
-            * this is incomplete as buffers may be resized periodically.  So
-            * we'll end up calling read_block with small buffers more often
-            * than strictly necessary. */
-            buffer->data = realloc(buffer->data, read_size);
-            buffer->alloc_size = read_size;
-        } else if (device->is_eof) {
-            return PRODUCER_FINISHED;
-        } else {
-            buffer->data_size = 0;
-            return PRODUCER_ERROR;
-        }
-    }
-}
-
-ssize_t device_write_consumer(gpointer devicep, queue_buffer_t *buffer) {
-    Device* device;
-    size_t write_size;
-    gsize block_size;
-
-    device = DEVICE(devicep);
-
-    block_size = device->block_size;
-    write_size = MIN(buffer->data_size, block_size);
-
-    /* we assume that the queueing module is providing us with
-     * appropriately-sized blocks until the last block. */
-    if (device_write_block(device, write_size,
-                           buffer->data + buffer->offset)) {
-        /* Success! */
-        return write_size;
-    } else {
-        /* Nope, really an error. */
-        return -1;
-    }
-}
-
diff --git a/device-src/device-queueing.h b/device-src/device-queueing.h
deleted file mode 100644 (file)
index 9efbe21..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-#ifndef DEVICE_QUEUEING_H
-#define DEVICE_QUEUEING_H
-
-/* some utilities for using queueing with device */
-
-#include "queueing.h"
-
-/* These functions will call device_read_block and device_write_block
- * respectively. The user data should be a Device*.
- *
- * device_write_consumer assumes that the block_size passed to
- * do_consumer_producer_queue_full is at least device->block_size();
- * do_consumer_thread() will not pass a buffer of less than block_size
- * to the consumer unless it has received EOF from the producer thread.
- *
- * Similarly, device_read_producer works similarly, but will expand its
- * buffers if the device encounters larger blocks - this is Amanda's
- * ability to read volumes written with larger block sizes.
- */
-producer_result_t device_read_producer(gpointer device,
-                                       queue_buffer_t *buffer,
-                                       size_t hint_size);
-ssize_t device_write_consumer(gpointer device, queue_buffer_t *buffer);
-
-#endif /* DEVICE_QUEUEING_H */
index 9af29f65708c6c2cdff78bf412af4eb5c73b6d2e..921b9480c45b42f5c87382bc86af61df78755985 100644 (file)
@@ -28,8 +28,6 @@
 #include <regex.h>
 
 #include "device.h"
-#include "queueing.h"
-#include "device-queueing.h"
 #include "property.h"
 
 #include "timestamp.h"
@@ -184,9 +182,6 @@ static void simple_property_free(SimpleProperty *o);
 static void default_device_open_device(Device * self, char * device_name,
                                    char * device_type, char * device_node);
 static gboolean default_device_configure(Device *self, gboolean use_global_config);
-static gboolean default_device_write_from_fd(Device *self,
-                                            queue_fd_t *queue_fd);
-static gboolean default_device_read_to_fd(Device *self, queue_fd_t *queue_fd);
 static gboolean default_device_property_get_ex(Device * self, DevicePropertyId id,
                                               GValue * val,
                                               PropertySurety *surety,
@@ -307,8 +302,6 @@ device_class_init (DeviceClass * device_class)
 
     device_class->open_device = default_device_open_device;
     device_class->configure = default_device_configure;
-    device_class->write_from_fd = default_device_write_from_fd;
-    device_class->read_to_fd = default_device_read_to_fd;
     device_class->property_get_ex = default_device_property_get_ex;
     device_class->property_set_ex = default_device_property_set_ex;
     g_object_class->finalize = device_finalize;
@@ -377,6 +370,11 @@ device_base_init (DeviceClass * device_class)
            PROPERTY_ACCESS_GET_MASK|PROPERTY_ACCESS_SET_MASK,
            device_simple_property_get_fn,
            device_simple_property_set_fn);
+
+    device_class_register_property(device_class, PROPERTY_LEOM,
+           PROPERTY_ACCESS_GET_MASK,
+           device_simple_property_get_fn,
+           device_simple_property_set_fn);
 }
 
 static void simple_property_free(SimpleProperty * resp) {
@@ -433,7 +431,7 @@ handle_device_regex(const char * user_name, char ** driver_name,
         *driver_name = stralloc("tape");
         *device = stralloc(user_name);
 #else /* !WANT_TAPE_DEVICE */
-       errmsg = newvstrallocf(errmsg, "\"%s\" is not a valid device name.\n", user_name);
+       *errmsg = newvstrallocf(*errmsg, "\"%s\" is not a valid device name.\n", user_name);
        regfree(&regex);
        return FALSE;
 #endif /* WANT_TAPE_DEVICE */
@@ -1071,60 +1069,6 @@ device_property_get_list (Device * self)
     return DEVICE_GET_CLASS(self)->class_properties_list;
 }
 
-static gboolean
-default_device_read_to_fd(Device *self, queue_fd_t *queue_fd) {
-    GValue val;
-    StreamingRequirement streaming_mode;
-
-    if (device_in_error(self)) return FALSE;
-
-    /* Get the device's parameters */
-    bzero(&val, sizeof(val));
-    if (!device_property_get(self, PROPERTY_STREAMING, &val)
-       || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) {
-       streaming_mode = STREAMING_REQUIREMENT_REQUIRED;
-    } else {
-       streaming_mode = g_value_get_enum(&val);
-    }
-
-    return QUEUE_SUCCESS ==
-       do_consumer_producer_queue_full(
-           device_read_producer,
-           self,
-           fd_write_consumer,
-           queue_fd,
-           self->block_size,
-           DEFAULT_MAX_BUFFER_MEMORY,
-           streaming_mode);
-}
-
-static gboolean
-default_device_write_from_fd(Device *self, queue_fd_t *queue_fd) {
-    GValue val;
-    StreamingRequirement streaming_mode;
-
-    if (device_in_error(self)) return FALSE;
-
-    /* Get the device's parameters */
-    bzero(&val, sizeof(val));
-    if (!device_property_get(self, PROPERTY_STREAMING, &val)
-       || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) {
-       streaming_mode = STREAMING_REQUIREMENT_REQUIRED;
-    } else {
-       streaming_mode = g_value_get_enum(&val);
-    }
-
-    return QUEUE_SUCCESS ==
-       do_consumer_producer_queue_full(
-           fd_read_producer,
-           queue_fd,
-           device_write_consumer,
-           self,
-           self->block_size,
-           DEFAULT_MAX_BUFFER_MEMORY,
-           streaming_mode);
-}
-
 /* XXX WARNING XXX
  * All the functions below this comment are stub functions that do nothing
  * but implement the virtual function table. Call these functions and they
@@ -1241,20 +1185,6 @@ device_write_block (Device * self, guint size, gpointer block)
     return (*klass->write_block)(self,size, block);
 }
 
-gboolean
-device_write_from_fd (Device * self, queue_fd_t * queue_fd)
-{
-    DeviceClass *klass;
-
-    g_assert(IS_DEVICE (self));
-    g_assert(queue_fd->fd >= 0);
-    g_assert(IS_WRITABLE_ACCESS_MODE(self->access_mode));
-
-    klass = DEVICE_GET_CLASS(self);
-    g_assert(klass->write_from_fd);
-    return (klass->write_from_fd)(self,queue_fd);
-}
-
 gboolean
 device_start_file (Device * self, dumpfile_t * jobInfo) {
     DeviceClass * klass;
@@ -1329,21 +1259,6 @@ device_read_block (Device * self, gpointer buffer, int * size)
     return (klass->read_block)(self,buffer,size);
 }
 
-gboolean
-device_read_to_fd (Device * self, queue_fd_t *queue_fd)
-{
-    DeviceClass *klass;
-
-    g_assert(IS_DEVICE (self));
-    g_assert(queue_fd->fd >= 0);
-    g_assert(self->access_mode == ACCESS_READ);
-
-    klass = DEVICE_GET_CLASS(self);
-    g_assert(klass->read_to_fd);
-    return (klass->read_to_fd)(self,queue_fd);
-}
-
-
 gboolean
 device_property_get_ex(
        Device * self,
@@ -1473,6 +1388,28 @@ device_accept(
     }
 }
 
+gboolean
+device_connect(
+    Device *self,
+    gboolean for_writing,
+    DirectTCPAddr *addrs,
+    DirectTCPConnection **conn,
+    ProlongProc prolong,
+    gpointer prolong_data)
+{
+    DeviceClass *klass;
+
+    klass = DEVICE_GET_CLASS(self);
+    if(klass->connect) {
+       return (klass->connect)(self, for_writing, addrs, conn, prolong, prolong_data);
+    } else {
+       device_set_error(self,
+           stralloc(_("Unimplemented method")),
+           DEVICE_STATUS_DEVICE_ERROR);
+       return FALSE;
+    }
+}
+
 gboolean
 device_write_from_connection(
     Device *self,
index b39a7d0b462e94598334f79ce91698ac78a71a37..d7104ff6b14f1406e9d64526fcd921bad73b6ba8 100644 (file)
@@ -175,12 +175,10 @@ struct _DeviceClass {
                         char * label, char * timestamp);
     gboolean (* start_file) (Device * self, dumpfile_t * info);
     gboolean (* write_block) (Device * self, guint size, gpointer data);
-    gboolean (* write_from_fd) (Device * self, queue_fd_t *queue_fd);
     gboolean (* finish_file) (Device * self);
     dumpfile_t* (* seek_file) (Device * self, guint file);
     gboolean (* seek_block) (Device * self, guint64 block);
     int (* read_block) (Device * self, gpointer buf, int * size);
-    gboolean (* read_to_fd) (Device * self, queue_fd_t *queue_fd);
     gboolean (* property_get_ex) (Device * self, DevicePropertyId id,
                                  GValue * val,
                                  PropertySurety *surety,
@@ -198,6 +196,9 @@ struct _DeviceClass {
     gboolean (* listen)(Device *self, gboolean for_writing, DirectTCPAddr **addrs);
     gboolean (* accept)(Device *self, DirectTCPConnection **conn,
                        ProlongProc prolong, gpointer prolong_data);
+    gboolean (* connect)(Device *self, gboolean for_writing, DirectTCPAddr *addrs,
+                       DirectTCPConnection **conn, ProlongProc prolong,
+                       gpointer prolong_data);
     gboolean (* write_from_connection)(Device *self, guint64 size, guint64 *actual_size);
     gboolean (* read_to_connection)(Device *self, guint64 size, guint64 *actual_size);
     gboolean (* use_connection)(Device *self, DirectTCPConnection *conn);
@@ -297,16 +298,12 @@ gboolean        device_start_file       (Device * self,
 gboolean       device_write_block      (Device * self,
                                          guint size,
                                          gpointer data);
-gboolean       device_write_from_fd    (Device * self,
-                                       queue_fd_t *queue_fd);
 gboolean       device_finish_file      (Device * self);
 dumpfile_t*    device_seek_file        (Device * self,
                                        guint file);
 gboolean       device_seek_block       (Device * self,
                                        guint64 block);
 int    device_read_block       (Device * self, gpointer buffer, int * size);
-gboolean       device_read_to_fd       (Device * self,
-                                       queue_fd_t *queue_fd);
 const GSList * device_property_get_list        (Device * self);
 gboolean       device_property_get_ex  (Device * self,
                                          DevicePropertyId id,
@@ -333,6 +330,9 @@ gboolean    device_eject    (Device * self);
 gboolean device_listen(Device *self, gboolean for_writing, DirectTCPAddr **addrs);
 gboolean device_accept(Device *self, DirectTCPConnection **conn,
                 ProlongProc prolong, gpointer prolong_data);
+gboolean device_connect(Device *self, gboolean for_writing, DirectTCPAddr *addrs,
+                       DirectTCPConnection **conn, ProlongProc prolong,
+                       gpointer prolong_data);
 gboolean device_write_from_connection(Device *self, guint64 size, guint64 *actual_size);
 gboolean device_read_to_connection(Device *self, guint64 size, guint64 *actual_size);
 gboolean device_use_connection(Device *self, DirectTCPConnection *conn);
index ddae35e45130897c5b44aa2e8cad4934a9a7c76d..128e05ff0d17694d226e478e3c2a77d35fdd8850 100644 (file)
@@ -321,6 +321,12 @@ dvdrw_device_init (DvdRwDevice *self)
     device_set_simple_property(dself, PROPERTY_FULL_DELETION,
        &val, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
     g_value_unset(&val);
+
+    g_value_init(&val, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&val, TRUE);
+    device_set_simple_property(dself, PROPERTY_LEOM,
+       &val, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
+    g_value_unset(&val);
 }
 
 static gboolean
@@ -511,22 +517,13 @@ dvdrw_device_finish(Device *dself)
     /* Save access mode before parent class messes with it */
     mode = dself->access_mode;
 
-    if (device_in_error(dself)) {
-       if (mode == ACCESS_READ) {
-           /* Still need to do this, don't care if it works or not */
-           unmount_disc(self);
-       }
-
-       return FALSE;
-    }
-
     result = parent_class->finish(dself);
 
     if (mode == ACCESS_READ) {
        unmount_disc(self);
     }
 
-    if (! result) {
+    if (!result || device_in_error(dself)) {
        return FALSE;
     }
 
index c832270208ff5698502ba52e56692b52db04530b..0fe626a8829e258ab317aa500306809e2f12d41f 100644 (file)
@@ -22,7 +22,6 @@
 #include "util.h"
 #include "device.h"
 #include "directtcp.h"
-#include "stream.h"
 #include "ndmlib.h"
 #include "ndmpconnobj.h"
 
@@ -55,10 +54,6 @@ struct NdmpDevice_ {
     DirectTCPAddr *listen_addrs;
     gboolean for_writing;
 
-    /* support for IndirectTCP */
-    int indirecttcp_sock; /* -1 if not in use */
-    int force_indirecttcp;
-
     /* Current DirectTCPConnectionNDMP */
     struct DirectTCPConnectionNDMP_ *directtcp_conn;
 
@@ -70,6 +65,7 @@ struct NdmpDevice_ {
     gchar       *ndmp_password;
     gchar       *ndmp_auth;
     gboolean    verbose;
+    gsize       read_block_size;
 };
 
 /*
@@ -140,11 +136,10 @@ typedef enum {
 static DevicePropertyBase device_property_ndmp_username;
 static DevicePropertyBase device_property_ndmp_password;
 static DevicePropertyBase device_property_ndmp_auth;
-static DevicePropertyBase device_property__force_indirecttcp;
 #define PROPERTY_NDMP_USERNAME (device_property_ndmp_username.ID)
 #define PROPERTY_NDMP_PASSWORD (device_property_ndmp_password.ID)
 #define PROPERTY_NDMP_AUTH (device_property_ndmp_auth.ID)
-#define PROPERTY__FORCE_INDIRECTTCP (device_property__force_indirecttcp.ID)
+
 
 /*
  * prototypes
@@ -153,6 +148,10 @@ static DevicePropertyBase device_property__force_indirecttcp;
 void ndmp_device_register(void);
 static void set_error_from_ndmp(NdmpDevice *self);
 
+#define ndmp_device_read_size(self) \
+    (((NdmpDevice *)(self))->read_block_size? \
+       ((NdmpDevice *)(self))->read_block_size : ((Device *)(self))->block_size)
+
 /*
  * Utility functions
  */
@@ -454,8 +453,6 @@ static void ndmp_device_finalize(GObject * obj_self)
        g_free(self->ndmp_password);
     if (self->ndmp_auth)
        g_free(self->ndmp_auth);
-    if (self->indirecttcp_sock != -1)
-       close(self->indirecttcp_sock);
 }
 
 static DeviceStatusFlags
@@ -463,9 +460,10 @@ ndmp_device_read_label(
     Device *dself)
 {
     NdmpDevice       *self = NDMP_DEVICE(dself);
-    dumpfile_t       *header;
+    dumpfile_t       *header = NULL;
     gpointer buf = NULL;
     guint64 buf_size = 0;
+    gsize read_block_size = 0;
 
     amfree(dself->volume_label);
     amfree(dself->volume_time);
@@ -474,9 +472,6 @@ ndmp_device_read_label(
 
     if (device_in_error(self)) return dself->status;
 
-    header = dself->volume_header = g_new(dumpfile_t, 1);
-    fh_init(header);
-
     if (!open_tape_agent(self)) {
        /* error status was set by open_tape_agent */
        return dself->status;
@@ -489,10 +484,11 @@ ndmp_device_read_label(
 
     /* read the tape header from the NDMP server */
     dself->status = 0;
-    buf = g_malloc(dself->block_size);
+    read_block_size = ndmp_device_read_size(self);
+    buf = g_malloc(read_block_size);
     if (!ndmp_connection_tape_read(self->ndmp,
        buf,
-       dself->block_size,
+       read_block_size,
        &buf_size)) {
 
        /* handle known errors */
@@ -516,6 +512,8 @@ ndmp_device_read_label(
                device_set_error(dself,
                        g_strdup(_("no tape label found")),
                                DEVICE_STATUS_VOLUME_UNLABELED);
+               header = dself->volume_header = g_new(dumpfile_t, 1);
+               fh_init(header);
                goto read_err;
 
            default:
@@ -524,6 +522,8 @@ ndmp_device_read_label(
            }
        }
 
+       header = dself->volume_header = g_new(dumpfile_t, 1);
+       fh_init(header);
        parse_file_header(buf, header, buf_size);
 
 read_err:
@@ -665,21 +665,23 @@ static gboolean
 ndmp_device_finish(
     Device *dself)
 {
+    gboolean rval;
+
     NdmpDevice *self = NDMP_DEVICE(dself);
-    if (device_in_error(dself)) return FALSE;
+    rval = !device_in_error(dself);
 
     /* we're not in a file anymore */
     dself->access_mode = ACCESS_NULL;
 
     if (!close_tape_agent(self)) {
        /* error is set by close_tape_agent */
-       return FALSE;
+       rval = FALSE;
     }
 
     if (self->ndmp)
        close_connection(self);
 
-    return TRUE;
+    return rval;
 }
 
 static gboolean
@@ -845,6 +847,7 @@ ndmp_device_seek_file(
     gpointer buf;
     guint64 buf_size;
     dumpfile_t *header;
+    gsize read_block_size = 0;
 
     if (device_in_error(dself)) return FALSE;
 
@@ -913,9 +916,10 @@ incomplete_bsf:
     dself->block = 0;
 
     /* now read the header */
-    buf = g_malloc(dself->block_size);
+    read_block_size = ndmp_device_read_size(self);
+    buf = g_malloc(read_block_size);
     if (!ndmp_connection_tape_read(self->ndmp,
-               buf, dself->block_size, &buf_size)) {
+               buf, read_block_size, &buf_size)) {
        switch (ndmp_connection_err_code(self->ndmp)) {
            case NDMP9_EOF_ERR:
            case NDMP9_EOM_ERR:
@@ -953,13 +957,14 @@ static int
 ndmp_device_read_block (Device * dself, gpointer data, int *size_req) {
     NdmpDevice *self = NDMP_DEVICE(dself);
     guint64 requested, actual;
+    gsize read_block_size = ndmp_device_read_size(self);
 
     /* We checked the NDMP device's blocksize when the device was opened, which should
      * catch any misalignent of server block size and Amanda block size */
 
-    g_assert(dself->block_size < INT_MAX); /* check data type mismatch */
-    if (!data || *size_req < (int)(dself->block_size)) {
-       *size_req = (int)(dself->block_size);
+    g_assert(read_block_size < INT_MAX); /* check data type mismatch */
+    if (!data || *size_req < (int)(read_block_size)) {
+       *size_req = (int)(read_block_size);
        return 0;
     }
 
@@ -987,29 +992,6 @@ ndmp_device_read_block (Device * dself, gpointer data, int *size_req) {
     return *size_req;
 }
 
-static gboolean
-indirecttcp_listen(
-    NdmpDevice *self,
-    DirectTCPAddr **addrs)
-{
-    in_port_t port;
-
-    self->indirecttcp_sock = stream_server(AF_INET, &port, 0, STREAM_BUFSIZE, 0);
-    if (self->indirecttcp_sock < 0) {
-       device_set_error(DEVICE(self),
-           g_strdup_printf("Could not bind indirecttcp socket: %s", strerror(errno)),
-           DEVICE_STATUS_DEVICE_ERROR);
-       return FALSE;
-    }
-
-    /* An IndirectTCP address is 255.255.255.255:$port */
-    self->listen_addrs = *addrs = g_new0(DirectTCPAddr, 2);
-    (*addrs)->ipv4 = 0xffffffff;
-    (*addrs)->port = port;
-
-    return TRUE;
-}
-
 static gboolean
 listen_impl(
     Device *dself,
@@ -1028,8 +1010,6 @@ listen_impl(
        return FALSE;
     }
 
-    self->for_writing = for_writing;
-
     /* first, set the window to an empty span so that the mover doesn't start
      * reading or writing data immediately.  NDMJOB tends to reset the record
      * size periodically (in direct contradiction to the spec), so we reset it
@@ -1040,34 +1020,9 @@ listen_impl(
        return FALSE;
     }
 
-    if (for_writing) {
-       /* if we're forcing indirecttcp, just do it */
-       if (self->force_indirecttcp) {
-           return indirecttcp_listen(self, addrs);
-       }
-       if (!ndmp_connection_mover_set_window(self->ndmp, 0, 0)) {
-           /* NDMP9_ILLEGAL_ARGS_ERR means the NDMP server doesn't like a zero-byte
-            * mover window, so we'll ignore it */
-           if (ndmp_connection_err_code(self->ndmp) != NDMP9_ILLEGAL_ARGS_ERR) {
-               set_error_from_ndmp(self);
-               return FALSE;
-           }
-
-           g_debug("NDMP Device: cannot set zero-length mover window; "
-                   "falling back to IndirectTCP");
-           /* In this case, we need to set up IndirectTCP */
-           return indirecttcp_listen(self, addrs);
-       }
-    } else {
-       /* For reading, set the window to the second mover record, so that the
-        * mover will pause immediately when it wants to read the first mover
-        * record. */
-       if (!ndmp_connection_mover_set_window(self->ndmp,
-                   DEVICE(self)->block_size,
-                   DEVICE(self)->block_size)) {
-           set_error_from_ndmp(self);
-           return FALSE;
-       }
+    if (!ndmp_connection_mover_set_window(self->ndmp, 0, 0)) {
+       set_error_from_ndmp(self);
+       return FALSE;
     }
 
     /* then tell it to start listening */
@@ -1079,6 +1034,7 @@ listen_impl(
        return FALSE;
     }
     self->listen_addrs = *addrs;
+    self->for_writing = for_writing;
 
     return TRUE;
 }
@@ -1153,49 +1109,36 @@ accept_impl(
        /* now we should expect a notice that the mover has paused */
     } else {
        /* when writing, the mover will pause as soon as the first byte comes
-        * in, so there's no need to do anything to trigger the pause.
-        *
-        * Well, sometimes it won't - specifically, when it does not allow a
-        * zero-byte mover window, which means we've set up IndirectTCP.  But in
-        * that case, there's nothing interesting to do here.*/
+        * in, so there's no need to do anything to trigger the pause. */
     }
 
-    if (self->indirecttcp_sock == -1) {
-       /* NDMJOB sends NDMP9_MOVER_PAUSE_SEEK to indicate that it wants to write
-        * outside the window, while the standard specifies .._EOW, instead.  When
-        * reading to a connection, we get the appropriate .._SEEK.  It's easy
-        * enough to handle both. */
-
-       if (!ndmp_connection_wait_for_notify(self->ndmp,
-               NULL,
-               NULL,
-               &reason, &seek_position)) {
-           set_error_from_ndmp(self);
-           return FALSE;
-       }
+    /* NDMJOB sends NDMP9_MOVER_PAUSE_SEEK to indicate that it wants to write
+     * outside the window, while the standard specifies .._EOW, instead.  When
+     * reading to a connection, we get the appropriate .._SEEK.  It's easy
+     * enough to handle both. */
 
-       if (reason != NDMP9_MOVER_PAUSE_SEEK && reason != NDMP9_MOVER_PAUSE_EOW) {
-           device_set_error(DEVICE(self),
-               g_strdup_printf("got NOTIFY_MOVER_PAUSED, but not because of EOW or SEEK"),
-               DEVICE_STATUS_DEVICE_ERROR);
-           return FALSE;
-       }
+    if (!ndmp_connection_wait_for_notify(self->ndmp,
+           NULL,
+           NULL,
+           &reason, &seek_position)) {
+       set_error_from_ndmp(self);
+       return FALSE;
     }
 
-    /* at this point, if we're doing directtcp, the mover is paused and ready
-     * to go, and the listen addrs are no longer required; if we're doing
-     * indirecttcp, then the other end may not even know of our listen_addrs
-     * yet, so we can't free them. */
-
-    if (self->indirecttcp_sock == -1) {
-       g_free(self->listen_addrs);
-       self->listen_addrs = NULL;
+    if (reason != NDMP9_MOVER_PAUSE_SEEK && reason != NDMP9_MOVER_PAUSE_EOW) {
+       device_set_error(DEVICE(self),
+           g_strdup_printf("got NOTIFY_MOVER_PAUSED, but not because of EOW or SEEK"),
+           DEVICE_STATUS_DEVICE_ERROR);
+       return FALSE;
     }
 
+    g_free(self->listen_addrs);
+    self->listen_addrs = NULL;
+
     if (self->for_writing)
-       mode = NDMP4_MOVER_MODE_WRITE;
-    else
        mode = NDMP4_MOVER_MODE_READ;
+    else
+       mode = NDMP4_MOVER_MODE_WRITE;
 
     /* set up the new directtcp connection */
     if (self->directtcp_conn)
@@ -1211,75 +1154,109 @@ accept_impl(
 }
 
 static gboolean
-indirecttcp_start_writing(
-       NdmpDevice *self)
+connect_impl(
+    Device *dself,
+    gboolean for_writing,
+    DirectTCPAddr *addrs,
+    DirectTCPConnection **dtcpconn,
+    ProlongProc prolong,
+    gpointer prolong_data)
 {
-    DirectTCPAddr *real_addrs, *iter;
-    int conn_sock;
+    NdmpDevice *self = NDMP_DEVICE(dself);
+    ndmp9_mover_mode mode;
+    ndmp9_mover_pause_reason reason;
+    guint64 seek_position;
 
-    /* The current state is that the other end is trying to connect to
-     * indirecttcp_sock.  The mover remains IDLE, although its window is set
-     * correctly for the part we are about to write. */
+    g_assert(!self->listen_addrs);
 
-    conn_sock = accept(self->indirecttcp_sock, NULL, NULL);
-    if (conn_sock < 0) {
-       device_set_error(DEVICE(self),
-           g_strdup_printf("Could not accept indirecttcp socket: %s", strerror(errno)),
-           DEVICE_STATUS_DEVICE_ERROR);
+    *dtcpconn = NULL;
+    self->for_writing = for_writing;
+
+    /* TODO: support aborting this operation - maybe just always poll? */
+    prolong = prolong;
+    prolong_data = prolong_data;
+
+    if (!open_tape_agent(self)) {
+       /* error message was set by open_tape_agent */
        return FALSE;
     }
 
-    close(self->indirecttcp_sock);
-    self->indirecttcp_sock = -1;
+    /* first, set the window to an empty span so that the mover doesn't start
+     * reading or writing data immediately.  NDMJOB tends to reset the record
+     * size periodically (in direct contradiction to the spec), so we reset it
+     * here as well. */
+    if (!ndmp_connection_mover_set_record_size(self->ndmp,
+               DEVICE(self)->block_size)) {
+       set_error_from_ndmp(self);
+       return FALSE;
+    }
 
-    /* tell mover to start listening */
-    g_assert(self->for_writing);
-    if (!ndmp_connection_mover_listen(self->ndmp,
-               NDMP4_MOVER_MODE_READ,
-               NDMP4_ADDR_TCP,
-               &real_addrs)) {
+    if (!ndmp_connection_mover_set_window(self->ndmp, 0, 0)) {
        set_error_from_ndmp(self);
        return FALSE;
     }
 
-    /* format the addresses and send them down the socket */
-    for (iter = real_addrs; iter && iter->ipv4; iter++) {
-       struct in_addr in;
-       char *addr, *addrspec;
+    if (self->for_writing)
+       mode = NDMP4_MOVER_MODE_READ;
+    else
+       mode = NDMP4_MOVER_MODE_WRITE;
 
-       in.s_addr = htonl(iter->ipv4);
-       addr = inet_ntoa(in);
+    if (!ndmp_connection_mover_connect(self->ndmp, mode, addrs)) {
+       set_error_from_ndmp(self);
+       return FALSE;
+    }
 
-       addrspec = g_strdup_printf("%s:%d%s", addr, iter->port,
-               (iter+1)->ipv4? " ":"");
-       if (full_write(conn_sock, addrspec, strlen(addrspec)) < strlen(addrspec)) {
-           device_set_error(DEVICE(self),
-               g_strdup_printf("writing to indirecttcp socket: %s", strerror(errno)),
-               DEVICE_STATUS_DEVICE_ERROR);
+    if (!self->for_writing) {
+       /* The agent is in the ACTIVE state, and will remain so until we tell
+        * it to do something else.  The thing we want to is for it to start
+        * reading data from the tape, which will immediately trigger an EOW or
+        * SEEK pause. */
+       if (!ndmp_connection_mover_read(self->ndmp, 0, G_MAXUINT64)) {
+           set_error_from_ndmp(self);
            return FALSE;
        }
+
+       /* now we should expect a notice that the mover has paused */
+    } else {
+       /* when writing, the mover will pause as soon as the first byte comes
+        * in, so there's no need to do anything to trigger the pause. */
     }
 
-    /* close the socket for good.  This ensures that the next call to
-     * write_from_connection_impl will not go through the mover setup process.
-     * */
-    if (close(conn_sock) < 0) {
+    /* NDMJOB sends NDMP9_MOVER_PAUSE_SEEK to indicate that it wants to write
+     * outside the window, while the standard specifies .._EOW, instead.  When
+     * reading to a connection, we get the appropriate .._SEEK.  It's easy
+     * enough to handle both. */
+
+    if (!ndmp_connection_wait_for_notify(self->ndmp,
+           NULL,
+           NULL,
+           &reason, &seek_position)) {
+       set_error_from_ndmp(self);
+       return FALSE;
+    }
+
+    if (reason != NDMP9_MOVER_PAUSE_SEEK && reason != NDMP9_MOVER_PAUSE_EOW) {
        device_set_error(DEVICE(self),
-           g_strdup_printf("closing indirecttcp socket: %s", strerror(errno)),
+           g_strdup_printf("got NOTIFY_MOVER_PAUSED, but not because of EOW or SEEK"),
            DEVICE_STATUS_DEVICE_ERROR);
        return FALSE;
     }
-    conn_sock = -1;
 
-    /* and free the listen_addrs, since we didn't free them in accept_impl */
     if (self->listen_addrs) {
        g_free(self->listen_addrs);
        self->listen_addrs = NULL;
     }
 
-    /* Now it's up to the remote end to connect to the mover and start sending
-     * data.  We won't get any notification when this happens, although we could
-     * in principle poll for such a thing. */
+    /* set up the new directtcp connection */
+    if (self->directtcp_conn)
+       g_object_unref(self->directtcp_conn);
+    self->directtcp_conn =
+       directtcp_connection_ndmp_new(self->ndmp, mode);
+    *dtcpconn = DIRECTTCP_CONNECTION(self->directtcp_conn);
+
+    /* reference it for the caller */
+    g_object_ref(*dtcpconn);
+
     return TRUE;
 }
 
@@ -1306,6 +1283,7 @@ write_from_connection_impl(
     /* if this is false, then the caller did not use use_connection correctly */
     g_assert(self->directtcp_conn != NULL);
     g_assert(self->ndmp == nconn->ndmp);
+    g_assert(nconn->mode == NDMP4_MOVER_MODE_READ);
 
     if (!ndmp_connection_mover_get_state(self->ndmp,
                &mover_state, &bytes_moved_before, NULL, NULL)) {
@@ -1313,17 +1291,9 @@ write_from_connection_impl(
        return FALSE;
     }
 
-    if (self->indirecttcp_sock != -1) {
-       /* If we're doing IndirectTCP, then we've deferred the whole mover_set_window
-        * / mover_listen process.. until now.  So the mover should be IDLE. */
-       g_assert(mover_state == NDMP4_MOVER_STATE_IDLE);
-    } else {
-       /* the mover had best be PAUSED right now */
-       g_assert(mover_state == NDMP4_MOVER_STATE_PAUSED);
-    }
+    /* the mover had best be PAUSED right now */
+    g_assert(mover_state == NDMP4_MOVER_STATE_PAUSED);
 
-    /* we want to set the window regardless of whether this is directtcp or
-     * indirecttcp */
     if (!ndmp_connection_mover_set_window(self->ndmp,
                nconn->offset,
                size? size : G_MAXUINT64 - nconn->offset)) {
@@ -1331,16 +1301,9 @@ write_from_connection_impl(
        return FALSE;
     }
 
-    /* for DirectTCP, we just tell the mover to continue; IndirectTCP is more complicated. */
-    if (self->indirecttcp_sock != -1) {
-       if (!indirecttcp_start_writing(self)) {
-           return FALSE;
-       }
-    } else {
-       if (!ndmp_connection_mover_continue(self->ndmp)) {
-           set_error_from_ndmp(self);
-           return FALSE;
-       }
+    if (!ndmp_connection_mover_continue(self->ndmp)) {
+       set_error_from_ndmp(self);
+       return FALSE;
     }
 
     /* now wait for the mover to pause itself again, or halt on EOF or an error */
@@ -1444,12 +1407,10 @@ read_to_connection_impl(
 
     if (device_in_error(self)) return FALSE;
 
-    /* read_to_connection does not support IndirectTCP */
-    g_assert(self->indirecttcp_sock == -1);
-
     /* if this is false, then the caller did not use use_connection correctly */
     g_assert(nconn != NULL);
     g_assert(self->ndmp == nconn->ndmp);
+    g_assert(nconn->mode == NDMP4_MOVER_MODE_WRITE);
 
     if (!ndmp_connection_mover_get_state(self->ndmp,
                &mover_state, &bytes_moved_before, NULL, NULL)) {
@@ -1659,15 +1620,22 @@ ndmp_device_set_verbose_fn(Device *p_self, DevicePropertyBase *base,
 }
 
 static gboolean
-ndmp_device_set__force_indirecttcp_fn(Device *dself,
-    DevicePropertyBase *base, GValue *val,
-    PropertySurety surety, PropertySource source)
+ndmp_device_set_read_block_size_fn(Device *p_self, DevicePropertyBase *base G_GNUC_UNUSED,
+    GValue *val, PropertySurety surety, PropertySource source)
 {
-    NdmpDevice *self = NDMP_DEVICE(dself);
+    NdmpDevice *self = NDMP_DEVICE(p_self);
+    gsize read_block_size = g_value_get_uint(val);
 
-    self->force_indirecttcp = g_value_get_boolean(val);
+    if (read_block_size != 0 &&
+           ((gsize)read_block_size < p_self->block_size ||
+            (gsize)read_block_size > p_self->max_block_size))
+       return FALSE;
 
-    return device_simple_property_set_fn(dself, base, val, surety, source);
+    self->read_block_size = read_block_size;
+
+    /* use the READ_BLOCK_SIZE, even if we're invoked to get the old READ_BUFFER_SIZE */
+    return device_simple_property_set_fn(p_self, base,
+                                       val, surety, source);
 }
 
 static void
@@ -1695,6 +1663,7 @@ ndmp_device_class_init(NdmpDeviceClass * c G_GNUC_UNUSED)
     device_class->directtcp_supported = TRUE;
     device_class->listen = listen_impl;
     device_class->accept = accept_impl;
+    device_class->connect = connect_impl;
     device_class->write_from_connection = write_from_connection_impl;
     device_class->read_to_connection = read_to_connection_impl;
     device_class->use_connection = use_connection_impl;
@@ -1720,11 +1689,10 @@ ndmp_device_class_init(NdmpDeviceClass * c G_GNUC_UNUSED)
            PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK,
            device_simple_property_get_fn,
            ndmp_device_set_verbose_fn);
-
-    device_class_register_property(device_class, PROPERTY__FORCE_INDIRECTTCP,
-           PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK,
+    device_class_register_property(device_class, PROPERTY_READ_BLOCK_SIZE,
+           PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
            device_simple_property_get_fn,
-           ndmp_device_set__force_indirecttcp_fn);
+           ndmp_device_set_read_block_size_fn);
 }
 
 static void
@@ -1773,12 +1741,25 @@ ndmp_device_init(NdmpDevice *self)
            &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
     g_value_unset(&response);
 
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, TRUE);
+    device_set_simple_property(dself, PROPERTY_LEOM,
+           &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
+    g_value_unset(&response);
+
     g_value_init(&response, MEDIA_ACCESS_MODE_TYPE);
     g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE);
     device_set_simple_property(dself, PROPERTY_MEDIUM_ACCESS_TYPE,
            &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
     g_value_unset(&response);
 
+    self->read_block_size = 0;
+    g_value_init(&response, G_TYPE_UINT);
+    g_value_set_uint(&response, self->read_block_size);
+    device_set_simple_property(dself, PROPERTY_READ_BLOCK_SIZE,
+            &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT);
+    g_value_unset(&response);
+
     g_value_init(&response, G_TYPE_STRING);
     g_value_set_string(&response, "ndmp");
     device_set_simple_property(dself, PROPERTY_NDMP_USERNAME,
@@ -1800,14 +1781,6 @@ ndmp_device_init(NdmpDevice *self)
     g_value_unset(&response);
     self->ndmp_auth = g_strdup("md5");
 
-    g_value_init(&response, G_TYPE_BOOLEAN);
-    g_value_set_boolean(&response, FALSE);
-    device_set_simple_property(dself, PROPERTY__FORCE_INDIRECTTCP,
-           &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT);
-    g_value_unset(&response);
-    self->force_indirecttcp = FALSE;
-
-    self->indirecttcp_sock = -1;
 }
 
 static GType
@@ -1869,10 +1842,6 @@ ndmp_device_register(void)
     device_property_fill_and_register(&device_property_ndmp_auth,
                                       G_TYPE_STRING, "ndmp_auth",
        "Authentication method for the NDMP agent - md5 (default), text, none, or void");
-    device_property_fill_and_register(&device_property__force_indirecttcp,
-                                      G_TYPE_BOOLEAN, "_force_indirecttcp",
-       "For testing only - force IndirectTCP mode, even if the NDMP server supports "
-       "window length 0");
 }
 
 /*
index 5365e322408231f4dc4f6a1283f7b7a2991957b3..f7898e2fb3c36f25d3a41a4e9e715b339c58852d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -144,6 +144,12 @@ null_device_init (NullDevice * self)
            &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
     g_value_unset(&response);
 
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, FALSE);
+    device_set_simple_property(dself, PROPERTY_LEOM,
+           &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
+    g_value_unset(&response);
+
     /* this device's canonical name is always "null:", regardless of
      * the name the user supplies; note that we install the simple
      * getter in null_device_class_init. */
@@ -248,9 +254,10 @@ null_device_start (Device * pself, DeviceAccessMode mode,
 /* This default implementation does very little. */
 static gboolean
 null_device_finish (Device * pself) {
+    pself->access_mode = ACCESS_NULL;
+
     if (device_in_error(pself)) return FALSE;
 
-    pself->access_mode = ACCESS_NULL;
     return TRUE;
 }
 
index a2f4c57b98ca8e2e447678ae2456aad5215b9d0d..875e7e6066c043b3f5b5426e2413d47cb886c247 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -96,23 +96,6 @@ GType media_access_mode_get_type (void) {
     return type;
 }
 
-/* Copy function for GBoxed QualifiedSize. */
-static gpointer qualified_size_copy(gpointer source) {
-    gpointer rval = g_new(QualifiedSize, 1);
-    memcpy(rval, source, sizeof(QualifiedSize));
-    return rval;
-}
-
-GType qualified_size_get_type (void) {
-    static GType type = 0;
-    if (G_UNLIKELY(type == 0)) {
-        type = g_boxed_type_register_static ("QualifiedSize",
-                                             qualified_size_copy,
-                                             free);
-    }
-    return type;
-}
-
 /******
  * Property registration and lookup
  */
@@ -248,9 +231,6 @@ void device_property_init(void) {
     device_property_fill_and_register(&device_property_full_deletion,
                                      G_TYPE_BOOLEAN, "full_deletion",
       "Does this device support recycling the entire volume?" );
-    device_property_fill_and_register(&device_property_free_space,
-                                      QUALIFIED_SIZE_TYPE, "free_space",
-      "Remaining capacity of the device.");
     device_property_fill_and_register(&device_property_max_volume_usage,
                                       G_TYPE_UINT64, "max_volume_usage",
       "Artificial limit to data written to volume.");
@@ -260,6 +240,9 @@ void device_property_init(void) {
     device_property_fill_and_register(&device_property_comment,
                                      G_TYPE_STRING, "comment",
        "User-specified comment for the device");
+    device_property_fill_and_register(&device_property_leom,
+                                     G_TYPE_BOOLEAN, "leom",
+       "Does this device support LEOM?");
 }
 
 DevicePropertyBase device_property_concurrency;
@@ -275,7 +258,7 @@ DevicePropertyBase device_property_canonical_name;
 DevicePropertyBase device_property_medium_access_type;
 DevicePropertyBase device_property_partial_deletion;
 DevicePropertyBase device_property_full_deletion;
-DevicePropertyBase device_property_free_space;
 DevicePropertyBase device_property_max_volume_usage;
-DevicePropertyBase device_property_verbose;
 DevicePropertyBase device_property_comment;
+DevicePropertyBase device_property_leom;
+DevicePropertyBase device_property_verbose;
index c3816ff0d77786fa2aa94dbc6a21938a2bc5dd8d..1e296e1dd4b487e0aa3a216d1d866a57b14eff63 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -23,7 +23,6 @@
 
 #include <glib.h>
 #include <glib-object.h>
-#include "queueing.h" /* for StreamingRequirement */
 
 /* The properties interface defines define capabilities and other interesting
  * properties. */
@@ -174,21 +173,6 @@ typedef enum {
 #define MEDIA_ACCESS_MODE_TYPE media_access_mode_get_type()
 GType media_access_mode_get_type (void);
 
-/* This one is not a Glibified enum */
-typedef enum {
-    SIZE_ACCURACY_UNKNOWN,
-    SIZE_ACCURACY_ESTIMATE,
-    SIZE_ACCURACY_REAL
-} SizeAccuracy;
-
-/* But SizeAccuracy does apear in this Glibified (gBoxed) struct. */
-typedef struct {
-    SizeAccuracy accuracy;
-    guint64           bytes;
-} QualifiedSize;
-#define QUALIFIED_SIZE_TYPE qualified_size_get_type()
-GType qualified_size_get_type (void);
-
 /* Standard property definitions follow. See also property.c. */
 
 /* Value is a ConcurrencyParadigm */
@@ -196,6 +180,11 @@ extern DevicePropertyBase device_property_concurrency;
 #define PROPERTY_CONCURRENCY (device_property_concurrency.ID)
 
 /* Value is a StreamingRequirement */
+typedef enum {
+    STREAMING_REQUIREMENT_NONE,
+    STREAMING_REQUIREMENT_DESIRED,
+    STREAMING_REQUIREMENT_REQUIRED
+} StreamingRequirement;
 extern DevicePropertyBase device_property_streaming;
 #define PROPERTY_STREAMING (device_property_streaming.ID)
 
@@ -244,10 +233,6 @@ extern DevicePropertyBase device_property_partial_deletion;
 extern DevicePropertyBase device_property_full_deletion;
 #define PROPERTY_FULL_DELETION (device_property_full_deletion.ID)
 
-/* Value is a QualifiedSize, though the accuracy may be SIZE_ACCURACY_NONE. */
-extern DevicePropertyBase device_property_free_space;
-#define PROPERTY_FREE_SPACE (device_property_free_space.ID)
-
 /* Value is a guint64. On devices that support it, this property will
    limit the total amount of data written to a volume; attempts to
    write beyond this point will cause the device to simulate "out of
@@ -264,4 +249,8 @@ extern DevicePropertyBase device_property_verbose;
 extern DevicePropertyBase device_property_comment;
 #define PROPERTY_COMMENT (device_property_comment.ID)
 
+/* Does this device support LEOM? */
+extern DevicePropertyBase device_property_leom;
+#define PROPERTY_LEOM (device_property_leom.ID)
+
 #endif
index daeb5c8855f09c7a1b33870df25e610f453e590d..e8e8f2e658e89b17cc93c3e0b130cfdce0b0289b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -21,7 +21,7 @@
 /* The RAIT device encapsulates some number of other devices into a single
  * redundant device. */
 
-#include <amanda.h>
+#include "amanda.h"
 #include "property.h"
 #include "util.h"
 #include <glib.h>
@@ -199,10 +199,6 @@ static gboolean property_get_medium_access_type_fn(Device *self,
     DevicePropertyBase *base, GValue *val,
     PropertySurety *surety, PropertySource *source);
 
-static gboolean property_get_free_space_fn(Device *self,
-    DevicePropertyBase *base, GValue *val,
-    PropertySurety *surety, PropertySource *source);
-
 static gboolean property_get_max_volume_usage_fn(Device *self,
     DevicePropertyBase *base, GValue *val,
     PropertySurety *surety, PropertySource *source);
@@ -383,16 +379,16 @@ rait_device_base_init (RaitDeviceClass * c)
            PROPERTY_ACCESS_GET_MASK,
            property_get_boolean_and_fn, NULL);
 
-    device_class_register_property(device_class, PROPERTY_MEDIUM_ACCESS_TYPE,
+    device_class_register_property(device_class, PROPERTY_LEOM,
            PROPERTY_ACCESS_GET_MASK,
-           property_get_medium_access_type_fn, NULL);
+           property_get_boolean_and_fn, NULL);
 
-    device_class_register_property(device_class, PROPERTY_FREE_SPACE,
+    device_class_register_property(device_class, PROPERTY_MEDIUM_ACCESS_TYPE,
            PROPERTY_ACCESS_GET_MASK,
-           property_get_free_space_fn, NULL);
+           property_get_medium_access_type_fn, NULL);
 
     device_class_register_property(device_class, PROPERTY_MAX_VOLUME_USAGE,
-           PROPERTY_ACCESS_GET_MASK,
+           PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
            property_get_max_volume_usage_fn,
            property_set_max_volume_usage_fn);
 }
@@ -2410,76 +2406,6 @@ property_get_medium_access_type_fn(Device *dself,
     return success;
 }
 
-static gboolean
-property_get_free_space_fn(Device *dself,
-    DevicePropertyBase *base G_GNUC_UNUSED, GValue *val,
-    PropertySurety *surety, PropertySource *source)
-{
-    RaitDevice *self = RAIT_DEVICE(dself);
-    QualifiedSize result;
-    guint i;
-    GPtrArray * ops;
-    guint data_children;
-
-    ops = make_property_op_array(self, PROPERTY_MEDIUM_ACCESS_TYPE, NULL, 0, 0);
-    do_rait_child_ops(self, property_get_do_op, ops);
-
-    /* Find the minimal available space of any child, with some funny business
-     * to deal with varying degrees of accuracy. */
-    result.accuracy = SIZE_ACCURACY_UNKNOWN;
-    result.bytes = 0;
-    for (i = 0; i < ops->len; i ++) {
-        QualifiedSize cur;
-        PropertyOp * op = g_ptr_array_index(ops, i);
-
-        if (!op->base.result || G_VALUE_TYPE(&(op->value)) != QUALIFIED_SIZE_TYPE) {
-           /* maybe this child can't tell us .. so this is just an estimate */
-           if (result.accuracy == SIZE_ACCURACY_REAL)
-               result.accuracy = SIZE_ACCURACY_ESTIMATE;
-
-           continue;
-       }
-
-        cur = *(QualifiedSize*)(g_value_get_boxed(&(op->value)));
-
-        if (result.accuracy != cur.accuracy) {
-            result.accuracy = SIZE_ACCURACY_ESTIMATE;
-        }
-
-        if (result.accuracy == SIZE_ACCURACY_UNKNOWN &&
-            cur.accuracy != SIZE_ACCURACY_UNKNOWN) {
-            result.bytes = cur.bytes;
-        } else if (result.accuracy != SIZE_ACCURACY_UNKNOWN &&
-                   cur.accuracy == SIZE_ACCURACY_UNKNOWN) {
-            /* result.bytes unchanged. */
-        } else {
-            result.bytes = MIN(result.bytes, cur.bytes);
-        }
-    }
-
-    g_ptr_array_free_full(ops);
-
-    /* result contains the minimum size available on any child.  We
-     * can use that space on each of our data children, so the total
-     * is larger */
-    find_simple_params(self, NULL, &data_children);
-    result.bytes *= data_children;
-
-    if (val) {
-       g_value_unset_init(val, QUALIFIED_SIZE_TYPE);
-       g_value_set_boxed(val, &result);
-    }
-
-    if (surety)
-       *surety = (result.accuracy == SIZE_ACCURACY_UNKNOWN)?
-                   PROPERTY_SURETY_BAD : PROPERTY_SURETY_GOOD;
-
-    if (source)
-       *source = PROPERTY_SOURCE_DETECTED;
-
-    return TRUE;
-}
-
 static gboolean
 property_get_max_volume_usage_fn(Device *dself,
     DevicePropertyBase *base G_GNUC_UNUSED, GValue *val,
@@ -2506,7 +2432,9 @@ property_get_max_volume_usage_fn(Device *dself,
 
         cur = g_value_get_uint64(&(op->value));
 
-       result = MIN(cur, result);
+       if (!result || (cur && cur < result)) {
+           result = cur;
+       }
     }
 
     g_ptr_array_free_full(ops);
@@ -2636,23 +2564,23 @@ static gboolean
 rait_device_finish (Device * self) {
     GPtrArray * ops;
     gboolean success;
+    gboolean rval = TRUE;
 
-    if (rait_device_in_error(self)) return FALSE;
+    rval = !rait_device_in_error(self);
 
     ops = make_generic_boolean_op_array(RAIT_DEVICE(self));
 
     do_rait_child_ops(RAIT_DEVICE(self), finish_do_op, ops);
 
     success = g_ptr_array_and(ops, extract_boolean_generic_op);
+    if (!success)
+       rval = FALSE;
 
     g_ptr_array_free_full(ops);
 
     self->access_mode = ACCESS_NULL;
 
-    if (!success)
-        return FALSE;
-
-    return TRUE;
+    return rval;
 }
 
 static Device *
index 53692aa3d54e779f00647d10d11e3329aa329200..d060974fff944a9d2153f69605bd34e77bc12780 100644 (file)
@@ -83,6 +83,7 @@ struct _S3Device {
     char *user_token;
 
     char *bucket_location;
+    char *storage_class;
 
     char *ca_info;
 
@@ -153,6 +154,10 @@ static DevicePropertyBase device_property_s3_user_token;
 static DevicePropertyBase device_property_s3_bucket_location;
 #define PROPERTY_S3_BUCKET_LOCATION (device_property_s3_bucket_location.ID)
 
+/* Storage class */
+static DevicePropertyBase device_property_s3_storage_class;
+#define PROPERTY_S3_STORAGE_CLASS (device_property_s3_storage_class.ID)
+
 /* Path to certificate authority certificate */
 static DevicePropertyBase device_property_ssl_ca_info;
 #define PROPERTY_SSL_CA_INFO (device_property_ssl_ca_info.ID)
@@ -289,6 +294,10 @@ static gboolean s3_device_set_bucket_location_fn(Device *self,
     DevicePropertyBase *base, GValue *val,
     PropertySurety surety, PropertySource source);
 
+static gboolean s3_device_set_storage_class_fn(Device *self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source);
+
 static gboolean s3_device_set_ca_info_fn(Device *self,
     DevicePropertyBase *base, GValue *val,
     PropertySurety surety, PropertySource source);
@@ -655,6 +664,9 @@ s3_device_register(void)
     device_property_fill_and_register(&device_property_s3_bucket_location,
                                       G_TYPE_STRING, "s3_bucket_location",
        "Location constraint for buckets on Amazon S3");
+    device_property_fill_and_register(&device_property_s3_storage_class,
+                                      G_TYPE_STRING, "s3_storage_class",
+       "Storage class as specified by Amazon (STANDARD or REDUCED_REDUNDANCY)");
     device_property_fill_and_register(&device_property_ssl_ca_info,
                                       G_TYPE_STRING, "ssl_ca_info",
        "Path to certificate authority certificate");
@@ -739,6 +751,12 @@ s3_device_init(S3Device * self)
            &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
     g_value_unset(&response);
 
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, TRUE); /* well, there *is* no EOM on S3 .. */
+    device_set_simple_property(dself, PROPERTY_LEOM,
+           &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
+    g_value_unset(&response);
+
     g_value_init(&response, G_TYPE_BOOLEAN);
     g_value_set_boolean(&response, FALSE);
     device_set_simple_property(dself, PROPERTY_COMPRESSION,
@@ -799,6 +817,11 @@ s3_device_class_init(S3DeviceClass * c G_GNUC_UNUSED)
            device_simple_property_get_fn,
            s3_device_set_bucket_location_fn);
 
+    device_class_register_property(device_class, PROPERTY_S3_STORAGE_CLASS,
+           PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
+           device_simple_property_get_fn,
+           s3_device_set_storage_class_fn);
+
     device_class_register_property(device_class, PROPERTY_SSL_CA_INFO,
            PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
            device_simple_property_get_fn,
@@ -894,7 +917,7 @@ s3_device_set_bucket_location_fn(Device *p_self, DevicePropertyBase *base,
     }
 
     amfree(self->bucket_location);
-    self->bucket_location = g_value_dup_string(val);
+    self->bucket_location = str_val;
     device_clear_volume_details(p_self);
 
     return device_simple_property_set_fn(p_self, base, val, surety, source);
@@ -904,18 +927,24 @@ fail:
 }
 
 static gboolean
-s3_device_set_ca_info_fn(Device *p_self, DevicePropertyBase *base,
+s3_device_set_storage_class_fn(Device *p_self, DevicePropertyBase *base,
     GValue *val, PropertySurety surety, PropertySource source)
 {
     S3Device *self = S3_DEVICE(p_self);
+    char *str_val = g_value_dup_string(val);
 
-    if (!self->use_ssl) {
-       device_set_error(p_self, stralloc(_(
-               "Path to certificate authority certificate can not be "
-               "set if SSL/TLS is not being used.")),
-           DEVICE_STATUS_DEVICE_ERROR);
-       return FALSE;
-    }
+    amfree(self->storage_class);
+    self->storage_class = str_val;
+    device_clear_volume_details(p_self);
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+}
+
+static gboolean
+s3_device_set_ca_info_fn(Device *p_self, DevicePropertyBase *base,
+    GValue *val, PropertySurety surety, PropertySource source)
+{
+    S3Device *self = S3_DEVICE(p_self);
 
     amfree(self->ca_info);
     self->ca_info = g_value_dup_string(val);
@@ -1081,6 +1110,7 @@ static void s3_device_finalize(GObject * obj_self) {
     if(self->secret_key) g_free(self->secret_key);
     if(self->user_token) g_free(self->user_token);
     if(self->bucket_location) g_free(self->bucket_location);
+    if(self->storage_class) g_free(self->storage_class);
     if(self->ca_info) g_free(self->ca_info);
 }
 
@@ -1102,8 +1132,12 @@ static gboolean setup_handle(S3Device * self) {
             return FALSE;
        }
 
+       if (!self->use_ssl && self->ca_info) {
+           amfree(self->ca_info);
+       }
+
         self->s3 = s3_open(self->access_key, self->secret_key, self->user_token,
-            self->bucket_location, self->ca_info);
+            self->bucket_location, self->storage_class, self->ca_info);
         if (self->s3 == NULL) {
            device_set_error(d_self,
                stralloc(_("Internal error creating S3 handle")),
@@ -1289,11 +1323,11 @@ s3_device_start (Device * pself, DeviceAccessMode mode,
 
 static gboolean
 s3_device_finish (Device * pself) {
-    if (device_in_error(pself)) return FALSE;
-
     /* we're not in a file anymore */
     pself->access_mode = ACCESS_NULL;
 
+    if (device_in_error(pself)) return FALSE;
+
     return TRUE;
 }
 
index 1658a37fa3f496c02533e1ad27ed19eb2198904c..584a47d54ad1feacf0a8eae1e13549c104266dad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -92,6 +92,8 @@
     <LocationConstraint>%s</LocationConstraint>\n\
   </CreateBucketConfiguration>"
 
+#define AMAZON_STORAGE_CLASS_HEADER "x-amz-storage-class"
+
 #define AMAZON_WILDCARD_LOCATION "*"
 
 /* parameters for exponential backoff in the face of retriable errors */
 /* Results which should always be retried */
 #define RESULT_HANDLING_ALWAYS_RETRY \
         { 400,  S3_ERROR_RequestTimeout,     0,                          S3_RESULT_RETRY }, \
+        { 403,  S3_ERROR_RequestTimeTooSkewed,0,                          S3_RESULT_RETRY }, \
         { 409,  S3_ERROR_OperationAborted,   0,                          S3_RESULT_RETRY }, \
         { 412,  S3_ERROR_PreconditionFailed, 0,                          S3_RESULT_RETRY }, \
         { 500,  S3_ERROR_InternalError,      0,                          S3_RESULT_RETRY }, \
@@ -132,7 +135,9 @@ struct S3Handle {
     char *secret_key;
     char *user_token;
 
+    /* attributes for new objects */
     char *bucket_location;
+    char *storage_class;
 
     char *ca_info;
 
@@ -152,6 +157,9 @@ struct S3Handle {
     guint last_num_retries;
     void *last_response_body;
     guint last_response_body_size;
+
+    /* offset with s3 */
+    time_t time_offset_with_s3;
 };
 
 typedef struct {
@@ -163,6 +171,8 @@ typedef struct {
     gboolean headers_done;
     gboolean int_write_done;
     char *etag;
+    /* Points to current handle: Added to get hold of s3 offset */
+    struct S3Handle *hdl;
 } S3InternalData;
 
 /* Callback function to examine headers one-at-a-time
@@ -254,7 +264,8 @@ lookup_result(const result_handling_t *result_handling,
 /*
  * Precompiled regular expressions */
 static regex_t etag_regex, error_name_regex, message_regex, subdomain_regex,
-    location_con_regex;
+    location_con_regex, date_sync_regex;
+
 
 /*
  * Utility functions
@@ -422,7 +433,7 @@ s3_error_code_from_name(char *s3_error_name)
 
     /* do a brute-force search through the list, since it's not sorted */
     for (i = 0; i < S3_ERROR_END; i++) {
-        if (g_strcasecmp(s3_error_name, s3_error_code_names[i]) == 0)
+        if (g_ascii_strcasecmp(s3_error_name, s3_error_code_names[i]) == 0)
             return i;
     }
 
@@ -606,11 +617,17 @@ authenticate_request(S3Handle *hdl,
 
     /* calculate the date */
     t = time(NULL);
+
+    /* sync clock with amazon s3 */
+    t = t + hdl->time_offset_with_s3;
+
 #ifdef _WIN32
     if (!gmtime_s(&tmp, &t)) g_debug("localtime error");
 #else
     if (!gmtime_r(&t, &tmp)) perror("localtime");
 #endif
+
+
     date = g_strdup_printf("%s, %02d %s %04d %02d:%02d:%02d GMT",
         wkday[tmp.tm_wday], tmp.tm_mday, month[tmp.tm_mon], 1900+tmp.tm_year,
         tmp.tm_hour, tmp.tm_min, tmp.tm_sec);
@@ -618,6 +635,7 @@ authenticate_request(S3Handle *hdl,
     g_string_append(auth_string, date);
     g_string_append(auth_string, "\n");
 
+    /* CanonicalizedAmzHeaders, sorted lexicographically */
     if (is_non_empty_string(hdl->user_token)) {
         g_string_append(auth_string, AMAZON_SECURITY_HEADER);
         g_string_append(auth_string, ":");
@@ -627,6 +645,13 @@ authenticate_request(S3Handle *hdl,
         g_string_append(auth_string, "\n");
     }
 
+    if (is_non_empty_string(hdl->storage_class)) {
+        g_string_append(auth_string, AMAZON_STORAGE_CLASS_HEADER);
+        g_string_append(auth_string, ":");
+        g_string_append(auth_string, hdl->storage_class);
+        g_string_append(auth_string, "\n");
+    }
+
     /* CanonicalizedResource */
     g_string_append(auth_string, "/");
     if (bucket) {
@@ -674,6 +699,13 @@ authenticate_request(S3Handle *hdl,
         g_free(buf);
     }
 
+    if (is_non_empty_string(hdl->storage_class)) {
+       buf = g_strdup_printf(AMAZON_STORAGE_CLASS_HEADER ": %s", hdl->storage_class);
+       headers = curl_slist_append(headers, buf);
+       g_free(buf);
+    }
+
+
     buf = g_strdup_printf("Authorization: AWS %s:%s",
                           hdl->access_key, auth_base64);
     headers = curl_slist_append(headers, buf);
@@ -732,7 +764,7 @@ interpret_response(S3Handle *hdl,
 
     /* check ETag, if present */
     if (etag && content_md5 && 200 == response_code) {
-        if (etag && g_strcasecmp(etag, content_md5))
+        if (etag && g_ascii_strcasecmp(etag, content_md5))
             hdl->last_message = g_strdup("S3 Error: Possible data corruption (ETag returned by Amazon did not match the MD5 hash of the data sent)");
         else
             ret = FALSE;
@@ -885,7 +917,7 @@ size_t
 s3_counter_write_func(G_GNUC_UNUSED void *ptr, size_t size, size_t nmemb, void *stream)
 {
     gint64 *count = (gint64*) stream, inc = nmemb*size;
-    
+
     if (count) *count += inc;
     return inc;
 }
@@ -1036,7 +1068,8 @@ perform_request(S3Handle *hdl,
     CURLcode curl_code = CURLE_OK;
     char curl_error_buffer[CURL_ERROR_SIZE] = "";
     struct curl_slist *headers = NULL;
-    S3InternalData int_writedata = {{NULL, 0, 0, MAX_ERROR_RESPONSE_LEN}, NULL, NULL, NULL, FALSE, FALSE, NULL};
+    /* Set S3Internal Data */
+    S3InternalData int_writedata = {{NULL, 0, 0, MAX_ERROR_RESPONSE_LEN}, NULL, NULL, NULL, FALSE, FALSE, NULL, hdl};
     gboolean should_retry;
     guint retries = 0;
     gulong backoff = EXPONENTIAL_BACKOFF_START_USEC;
@@ -1301,16 +1334,40 @@ static size_t
 s3_internal_header_func(void *ptr, size_t size, size_t nmemb, void * stream)
 {
     static const char *final_header = "\r\n";
+    time_t remote_time_in_sec,local_time;
     char *header;
     regmatch_t pmatch[2];
     S3InternalData *data = (S3InternalData *) stream;
 
     header = g_strndup((gchar *) ptr, (gsize) size*nmemb);
+
     if (!s3_regexec_wrap(&etag_regex, header, 2, pmatch, 0))
-            data->etag = find_regex_substring(header, pmatch[1]);
+        data->etag = find_regex_substring(header, pmatch[1]);
     if (!strcmp(final_header, header))
         data->headers_done = TRUE;
 
+    /* If date header is found */
+    if (!s3_regexec_wrap(&date_sync_regex, header, 2, pmatch, 0)){
+        char *date = find_regex_substring(header, pmatch[1]);
+
+        /* Remote time is always in GMT: RFC 2616 */
+        /* both curl_getdate and time operate in UTC, so no timezone math is necessary */
+        if ( (remote_time_in_sec = curl_getdate(date, NULL)) < 0 ){
+            g_debug("Error: Conversion of remote time to seconds failed.");
+            data->hdl->time_offset_with_s3 = 0;
+        }else{
+            local_time = time(NULL);
+            /* Offset time */
+            data->hdl->time_offset_with_s3 = remote_time_in_sec - local_time;
+
+           if (data->hdl->verbose)
+               g_debug("Time Offset (remote - local) :%ld",(long)data->hdl->time_offset_with_s3);
+        }
+
+        g_free(date);
+    }
+
+    g_free(header);
     return size*nmemb;
 }
 
@@ -1326,6 +1383,7 @@ compile_regexes(void)
         {"<Message>[[:space:]]*([^<]*)[[:space:]]*</Message>", REG_EXTENDED | REG_ICASE, &message_regex},
         {"^[a-z0-9](-*[a-z0-9]){2,62}$", REG_EXTENDED | REG_NOSUB, &subdomain_regex},
         {"(/>)|(>([^<]*)</LocationConstraint>)", REG_EXTENDED | REG_ICASE, &location_con_regex},
+        {"^Date:(.*)\r",REG_EXTENDED | REG_ICASE | REG_NEWLINE, &date_sync_regex},
         {NULL, 0, NULL}
     };
     char regmessage[1024];
@@ -1358,6 +1416,9 @@ compile_regexes(void)
         {"(/>)|(>([^<]*)</LocationConstraint>)",
          G_REGEX_CASELESS,
          &location_con_regex},
+        {"^Date:(.*)\\r",
+         G_REGEX_OPTIMIZE | G_REGEX_CASELESS,
+         &date_sync_regex},
         {NULL, 0, NULL}
   };
   int i;
@@ -1415,6 +1476,7 @@ s3_open(const char *access_key,
         const char *secret_key,
         const char *user_token,
         const char *bucket_location,
+        const char *storage_class,
         const char *ca_info
         ) {
     S3Handle *hdl;
@@ -1435,6 +1497,9 @@ s3_open(const char *access_key,
     /* NULL is okay */
     hdl->bucket_location = g_strdup(bucket_location);
 
+    /* NULL is ok */
+    hdl->storage_class = g_strdup(storage_class);
+
     /* NULL is okay */
     hdl->ca_info = g_strdup(ca_info);
 
@@ -1458,6 +1523,7 @@ s3_free(S3Handle *hdl)
         g_free(hdl->secret_key);
         if (hdl->user_token) g_free(hdl->user_token);
         if (hdl->bucket_location) g_free(hdl->bucket_location);
+        if (hdl->storage_class) g_free(hdl->storage_class);
         if (hdl->curl) curl_easy_cleanup(hdl->curl);
 
         g_free(hdl);
@@ -1657,17 +1723,17 @@ list_start_element(GMarkupParseContext *context G_GNUC_UNUSED,
     struct list_keys_thunk *thunk = (struct list_keys_thunk *)user_data;
 
     thunk->want_text = 0;
-    if (g_strcasecmp(element_name, "contents") == 0) {
+    if (g_ascii_strcasecmp(element_name, "contents") == 0) {
         thunk->in_contents = 1;
-    } else if (g_strcasecmp(element_name, "commonprefixes") == 0) {
+    } else if (g_ascii_strcasecmp(element_name, "commonprefixes") == 0) {
         thunk->in_common_prefixes = 1;
-    } else if (g_strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) {
+    } else if (g_ascii_strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) {
         thunk->want_text = 1;
-    } else if (g_strcasecmp(element_name, "key") == 0 && thunk->in_contents) {
+    } else if (g_ascii_strcasecmp(element_name, "key") == 0 && thunk->in_contents) {
         thunk->want_text = 1;
-    } else if (g_strcasecmp(element_name, "istruncated")) {
+    } else if (g_ascii_strcasecmp(element_name, "istruncated")) {
         thunk->want_text = 1;
-    } else if (g_strcasecmp(element_name, "nextmarker")) {
+    } else if (g_ascii_strcasecmp(element_name, "nextmarker")) {
         thunk->want_text = 1;
     }
 }
@@ -1680,20 +1746,20 @@ list_end_element(GMarkupParseContext *context G_GNUC_UNUSED,
 {
     struct list_keys_thunk *thunk = (struct list_keys_thunk *)user_data;
 
-    if (g_strcasecmp(element_name, "contents") == 0) {
+    if (g_ascii_strcasecmp(element_name, "contents") == 0) {
         thunk->in_contents = 0;
-    } else if (g_strcasecmp(element_name, "commonprefixes") == 0) {
+    } else if (g_ascii_strcasecmp(element_name, "commonprefixes") == 0) {
         thunk->in_common_prefixes = 0;
-    } else if (g_strcasecmp(element_name, "key") == 0 && thunk->in_contents) {
+    } else if (g_ascii_strcasecmp(element_name, "key") == 0 && thunk->in_contents) {
         thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text);
         thunk->text = NULL;
-    } else if (g_strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) {
+    } else if (g_ascii_strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) {
         thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text);
         thunk->text = NULL;
-    } else if (g_strcasecmp(element_name, "istruncated") == 0) {
-        if (thunk->text && g_strncasecmp(thunk->text, "false", 5) != 0)
+    } else if (g_ascii_strcasecmp(element_name, "istruncated") == 0) {
+        if (thunk->text && g_ascii_strncasecmp(thunk->text, "false", 5) != 0)
             thunk->is_truncated = TRUE;
-    } else if (g_strcasecmp(element_name, "nextmarker") == 0) {
+    } else if (g_ascii_strcasecmp(element_name, "nextmarker") == 0) {
         if (thunk->next_marker) g_free(thunk->next_marker);
         thunk->next_marker = thunk->text;
         thunk->text = NULL;
@@ -1956,7 +2022,7 @@ s3_make_bucket(S3Handle *hdl,
                                  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                  NULL, NULL, result_handling);
 
-        /* note that we can check only one of the three AND conditions above 
+        /* note that we can check only one of the three AND conditions above
          * and infer that the others are true
          */
         if (result == S3_RESULT_OK && is_non_empty_string(hdl->bucket_location)) {
index dc5d052ea81383331b06a707c92a2031d35cbd2e..1e883a8c4465f01d37c0de9716970f2a67d51a71 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -226,13 +226,14 @@ s3_init(void);
  * @param secret_key: the secret key for Amazon Web Services
  * @param user_token: the user token for Amazon DevPay
  * @param bucket_location: the location constraint for buckets
+ * @param storage_class: the storage class for new objects
  * @param ca_info: the path to pass to libcurl as the certificate authority.
  *                 see curl_easy_setopt() CURLOPT_CAINFO for more
  * @returns: the new S3Handle
  */
 S3Handle *
 s3_open(const char * access_key, const char *secret_key, const char * user_token,
-        const char * bucket_location, const char * ca_info);
+        const char * bucket_location, const char * storage_class, const char * ca_info);
 
 /* Deallocate an S3Handle
  *
diff --git a/device-src/tape-aix.c b/device-src/tape-aix.c
deleted file mode 100644 (file)
index 59c5946..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-#include <amanda.h>
-#include "glib-util.h"
-#include "tape-ops.h"
-
-/* Tape operations for AIX systems. Most of this stuff is based on
-   documentation from 
-   http://publibn.boulder.ibm.com/doc_link/Ja_JP/a_doc_lib/files/aixfiles/rmt.htm */
-
-/* Uncomment to test compilation on non-AIX systems. */
-/* ---
-#undef MTIOCTOP
-#define STIOCTOP 0
-#define stop mtop
-#define st_op mt_op
-#define st_count mt_count
-#define STREW MTREW
-#define STFSF MTFSF
-#define STRSF MTBSF
-#define STFSR MTFSR
-#define STRSR MTBSR
-#define STWEOF MTWEOF
-#define STOFFL MTOFFL
---- */
-
-gboolean tape_rewind(int fd) {
-    struct stop st;
-    st.st_op = STREW;
-    st.st_count = 1;
-    return 0 == ioctl(fd, STIOCTOP, &st);
-}
-
-gboolean tape_fsf(int fd, guint count) {
-    struct stop st;
-    st.st_op = STFSF;
-    st.st_count = count;
-    return 0 == ioctl(fd, STIOCTOP, &st);
-}
-
-gboolean tape_bsf(int fd, guint count) {
-    struct stop st;
-    st.st_op = STRSF;
-    st.st_count = count;
-    return 0 == ioctl(fd, STIOCTOP, &st);
-}
-
-gboolean tape_fsr(int fd, guint count) {
-    struct stop st;
-    st.st_op = STFSR;
-    st.st_count = count;
-    return 0 == ioctl(fd, STIOCTOP, &st);
-}
-
-gboolean tape_bsr(int fd, guint count) {
-    struct stop st;
-    st.st_op = STRSR;
-    st.st_count = count;
-    return 0 == ioctl(fd, STIOCTOP, &st);
-}
-
-gint tape_fileno(int fd) {
-    return TAPE_POSITION_UNKNOWN;
-}
-
-gint tape_eod(int fd G_GNUC_UNUSED) {
-    g_assert_not_reached();
-    return TAPE_OP_ERROR;
-}
-
-gboolean tape_weof(int fd, guint8 count) {
-    struct stop st;
-    st.st_op = STWEOF;
-    st.st_count = count;
-    return 0 == ioctl(fd, STIOCTOP, &st);
-}
-
-gboolean tape_setcompression(int fd G_GNUC_UNUSED, gboolean on G_GNUC_UNUSED) {
-    return FALSE;
-}
-
-gboolean tape_offl(int fd) {
-    struct stop st;
-    st.st_op = STOFFL;
-    st.st_count = 1;
-    return 0 == ioctl(fd, STIOCTOP, &st);
-}
-
-DeviceStatusFlags tape_is_tape_device(int fd G_GNUC_UNUSED) {
-    /* AIX doesn't have a no-op, so we'll just assume this is a tape device */
-    return DEVICE_STATUS_SUCCESS;
-}
-
-DeviceStatusFlags tape_is_ready(int fd G_GNUC_UNUSED, TapeDevice *t_self G_GNUC_UNUSED) {
-    return DEVICE_STATUS_SUCCESS;
-}
-
-void tape_device_detect_capabilities(TapeDevice * t_self) {
-    tape_device_set_capabilities(t_self,
-       TRUE,  PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* fsf*/
-       DEFAULT_FSF_AFTER_FILEMARK, PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* fsf_after_filemark*/
-       TRUE,  PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* bsf*/
-       TRUE,  PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* fsr*/
-       TRUE,  PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* bsr*/
-       FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* eom*/
-       FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsf_after_eom*/
-       2,     PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT  /* final_filemarks*/
-       );
-}
index ba8f7689f27a91d9a4684cb242c659a8de13279b..36498ddf8ce54dce6bc0da4942c371b7d205e7c4 100644 (file)
 #include "pipespawn.h"
 #include <string.h> /* memset() */
 #include "util.h"
-#include "tape-device.h"
-#include "tape-ops.h"
+#include "device.h"
+
+#ifdef HAVE_SYS_TAPE_H
+# include <sys/tape.h>
+#endif
+#ifdef HAVE_SYS_MTIO_H
+# include <sys/mtio.h>
+#endif
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
 
 /* This is equal to 2*1024*1024*1024 - 16*1024*1024 - 1, but written
    explicitly to avoid overflow issues. */
 /* Largest possible block size on SCSI systems. */
 #define LARGEST_BLOCK_ESTIMATE (16 * 1024 * 1024)
 
+/*
+ * Type checking and casting macros
+ */
+
+#define TYPE_TAPE_DEVICE       (tape_device_get_type())
+#define TAPE_DEVICE(obj)       G_TYPE_CHECK_INSTANCE_CAST((obj), tape_device_get_type(), TapeDevice)
+#define TAPE_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), tape_device_get_type(), TapeDevice const)
+#define TAPE_DEVICE_CLASS(klass)       G_TYPE_CHECK_CLASS_CAST((klass), tape_device_get_type(), TapeDeviceClass)
+#define IS_TAPE_DEVICE(obj)    G_TYPE_CHECK_INSTANCE_TYPE((obj), tape_device_get_type ())
+#define TAPE_DEVICE_GET_CLASS(obj)     G_TYPE_INSTANCE_GET_CLASS((obj), tape_device_get_type(), TapeDeviceClass)
+GType  tape_device_get_type    (void);
+
+/*
+ * Main object structure
+ */
+typedef struct TapeDevicePrivate_s TapeDevicePrivate;
+typedef struct _TapeDevice {
+    Device __parent__;
+
+    /* It should go without saying that all this stuff is
+     * look-but-don't-touch. */
+
+    /* characteristics of the device */
+    gboolean fsf, bsf, fsr, bsr, eom, bsf_after_eom, broken_gmt_online;
+    gboolean leom;
+    gboolean nonblocking_open, fsf_after_filemark;
+    int final_filemarks;
+
+    /* 0 if we opened with O_RDWR; error otherwise. */
+    gboolean write_open_errno;
+    int fd;
+
+    TapeDevicePrivate * private;
+} TapeDevice;
+
 struct TapeDevicePrivate_s {
     /* This holds the total number of bytes written to the device,
        modulus RESETOFS_THRESHOLD. */
@@ -40,6 +84,41 @@ struct TapeDevicePrivate_s {
     gsize read_block_size;
 };
 
+/*
+ * Class definition
+ */
+
+typedef struct _TapeDeviceClass TapeDeviceClass;
+struct _TapeDeviceClass {
+       DeviceClass __parent__;
+};
+
+void tape_device_register(void);
+
+/* useful callback for tape ops */
+void tape_device_set_capabilities(TapeDevice *self,
+       gboolean fsf, PropertySurety fsf_surety, PropertySource fsf_source,
+       gboolean fsf_after_filemark, PropertySurety faf_surety, PropertySource faf_source,
+       gboolean bsf, PropertySurety bsf_surety, PropertySource bsf_source,
+       gboolean fsr, PropertySurety fsr_surety, PropertySource fsr_source,
+       gboolean bsr, PropertySurety bsr_surety, PropertySource bsr_source,
+       gboolean eom, PropertySurety eom_surety, PropertySource eom_source,
+       gboolean leom, PropertySurety leom_surety, PropertySource leom_source,
+       gboolean bsf_after_eom, PropertySurety bae_surety, PropertySource bae_source,
+       guint final_filemarks, PropertySurety ff_surety, PropertySource ff_source);
+
+/* Real Operations (always return FALSE if not implemented) */
+gboolean tape_rewind(int fd);
+gboolean tape_fsf(int fd, guint count);
+gboolean tape_bsf(int fd, guint count);
+gboolean tape_fsr(int fd, guint count);
+gboolean tape_bsr(int fd, guint count);
+gint tape_fileno(int fd);
+
+/* tape_fileno returns tape position file number, or one of these: */
+#define TAPE_OP_ERROR -1
+#define TAPE_POSITION_UNKNOWN -2
+
 /* Possible (abstracted) results from a system I/O operation. */
 typedef enum {
     RESULT_SUCCESS,
@@ -53,28 +132,48 @@ typedef enum {
     RESULT_MAX
 } IoResult;
 
-/*
- * Our device-specific properties.  These are not static because they are
- * accessed from the OS-specific tape-*.c files.
- */
-DevicePropertyBase device_property_broken_gmt_online;
-DevicePropertyBase device_property_fsf;
-DevicePropertyBase device_property_fsf_after_filemark;
-DevicePropertyBase device_property_bsf;
-DevicePropertyBase device_property_fsr;
-DevicePropertyBase device_property_bsr;
-DevicePropertyBase device_property_eom;
-DevicePropertyBase device_property_bsf_after_eom;
-DevicePropertyBase device_property_nonblocking_open;
-DevicePropertyBase device_property_final_filemarks;
-DevicePropertyBase device_property_read_buffer_size; /* old name for READ_BLOCK_SIZE */
+/* returns a fileno like tape_fileno */
+gint tape_eod(int fd);
 
-void tape_device_register(void);
+gboolean tape_weof(int fd, guint8 count);
+gboolean tape_setcompression(int fd, gboolean on);
+
+gboolean tape_offl(int fd);
+
+DeviceStatusFlags tape_is_tape_device(int fd);
+DeviceStatusFlags tape_is_ready(int fd, TapeDevice *t_self);
 
 #define tape_device_read_size(self) \
     (((TapeDevice *)(self))->private->read_block_size? \
        ((TapeDevice *)(self))->private->read_block_size : ((Device *)(self))->block_size)
 
+/*
+ * Our device-specific properties.
+ */
+
+#define PROPERTY_BROKEN_GMT_ONLINE (device_property_broken_gmt_online.ID)
+#define PROPERTY_FSF (device_property_fsf.ID)
+#define PROPERTY_FSF_AFTER_FILEMARK (device_property_fsf_after_filemark.ID)
+#define PROPERTY_BSF (device_property_bsf.ID)
+#define PROPERTY_FSR (device_property_fsr.ID)
+#define PROPERTY_BSR (device_property_bsr.ID)
+#define PROPERTY_EOM (device_property_eom.ID)
+#define PROPERTY_BSF_AFTER_EOM (device_property_bsf_after_eom.ID)
+#define PROPERTY_NONBLOCKING_OPEN (device_property_nonblocking_open.ID)
+#define PROPERTY_FINAL_FILEMARKS (device_property_final_filemarks.ID)
+
+static DevicePropertyBase device_property_broken_gmt_online;
+static DevicePropertyBase device_property_fsf;
+static DevicePropertyBase device_property_fsf_after_filemark;
+static DevicePropertyBase device_property_bsf;
+static DevicePropertyBase device_property_fsr;
+static DevicePropertyBase device_property_bsr;
+static DevicePropertyBase device_property_eom;
+static DevicePropertyBase device_property_bsf_after_eom;
+static DevicePropertyBase device_property_nonblocking_open;
+static DevicePropertyBase device_property_final_filemarks;
+static DevicePropertyBase device_property_read_buffer_size; /* old name for READ_BLOCK_SIZE */
+
 /* here are local prototypes */
 static void tape_device_init (TapeDevice * o);
 static void tape_device_class_init (TapeDeviceClass * c);
@@ -164,6 +263,7 @@ tape_device_init (TapeDevice * self) {
     self->fsr = FALSE;
     self->bsr = FALSE;
     self->eom = FALSE;
+    self->leom = FALSE;
     self->bsf_after_eom = FALSE;
 
     g_value_init(&response, G_TYPE_BOOLEAN);
@@ -182,6 +282,8 @@ tape_device_init (TapeDevice * self) {
            &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
     device_set_simple_property(d_self, PROPERTY_EOM,
            &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
+    device_set_simple_property(d_self, PROPERTY_LEOM,
+           &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
     device_set_simple_property(d_self, PROPERTY_BSF_AFTER_EOM,
            &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
 
@@ -669,84 +771,68 @@ static int try_open_tape_device(TapeDevice * self, char * device_filename) {
 }
 
 static void
-tape_device_open_device (Device * d_self, char * device_name,
+tape_device_open_device (Device * dself, char * device_name,
                        char * device_type, char * device_node) {
     TapeDevice * self;
+    GValue val;
 
-    self = TAPE_DEVICE(d_self);
+    self = TAPE_DEVICE(dself);
 
     self->fd = -1;
     self->private->device_filename = stralloc(device_node);
 
-    /* Get tape drive/OS info */
-    tape_device_detect_capabilities(self);
-
-    /* Chain up */
-    if (parent_class->open_device) {
-        parent_class->open_device(d_self, device_name, device_type, device_node);
-    }
-}
-
-void
-tape_device_set_capabilities(TapeDevice *self,
-       gboolean fsf, PropertySurety fsf_surety, PropertySource fsf_source,
-       gboolean fsf_after_filemark, PropertySurety faf_surety, PropertySource faf_source,
-       gboolean bsf, PropertySurety bsf_surety, PropertySource bsf_source,
-       gboolean fsr, PropertySurety fsr_surety, PropertySource fsr_source,
-       gboolean bsr, PropertySurety bsr_surety, PropertySource bsr_source,
-       gboolean eom, PropertySurety eom_surety, PropertySource eom_source,
-       gboolean bsf_after_eom, PropertySurety bae_surety, PropertySource bae_source,
-       guint final_filemarks, PropertySurety ff_surety, PropertySource ff_source)
-{
-    Device *dself = DEVICE(self);
-    GValue val;
-
-    /* this function is called by tape_device_detect_capabilities, and basically
-     * exists to take care of the GValue mechanics in one place */
-
-    g_assert(final_filemarks == 1 || final_filemarks == 2);
-
+    /* Set tape drive/OS info */
     bzero(&val, sizeof(val));
     g_value_init(&val, G_TYPE_BOOLEAN);
 
-    self->fsf = fsf;
-    g_value_set_boolean(&val, fsf);
-    device_set_simple_property(dself, PROPERTY_FSF, &val, fsf_surety, fsf_source);
+    self->fsf = TRUE;
+    g_value_set_boolean(&val, self->fsf);
+    device_set_simple_property(dself, PROPERTY_FSF, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
+
+    self->fsf_after_filemark = DEFAULT_FSF_AFTER_FILEMARK;
+    g_value_set_boolean(&val, self->fsf_after_filemark);
+    device_set_simple_property(dself, PROPERTY_FSF_AFTER_FILEMARK, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
 
-    self->fsf_after_filemark = fsf_after_filemark;
-    g_value_set_boolean(&val, fsf_after_filemark);
-    device_set_simple_property(dself, PROPERTY_FSF_AFTER_FILEMARK, &val, faf_surety, faf_source);
+    self->bsf = TRUE;
+    g_value_set_boolean(&val, self->bsf);
+    device_set_simple_property(dself, PROPERTY_BSF, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
 
-    self->bsf = bsf;
-    g_value_set_boolean(&val, bsf);
-    device_set_simple_property(dself, PROPERTY_BSF, &val, bsf_surety, bsf_source);
+    self->fsr = TRUE;
+    g_value_set_boolean(&val, self->fsr);
+    device_set_simple_property(dself, PROPERTY_FSR, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
 
-    self->fsr = fsr;
-    g_value_set_boolean(&val, fsr);
-    device_set_simple_property(dself, PROPERTY_FSR, &val, fsr_surety, fsr_source);
+    self->bsr = TRUE;
+    g_value_set_boolean(&val, self->bsr);
+    device_set_simple_property(dself, PROPERTY_BSR, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
 
-    self->bsr = bsr;
-    g_value_set_boolean(&val, bsr);
-    device_set_simple_property(dself, PROPERTY_BSR, &val, bsr_surety, bsr_source);
+    self->eom = TRUE;
+    g_value_set_boolean(&val, self->eom);
+    device_set_simple_property(dself, PROPERTY_EOM, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
 
-    self->eom = eom;
-    g_value_set_boolean(&val, eom);
-    device_set_simple_property(dself, PROPERTY_EOM, &val, eom_surety, eom_source);
+    self->leom = FALSE;
+    g_value_set_boolean(&val, self->leom);
+    device_set_simple_property(dself, PROPERTY_LEOM, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
 
-    self->bsf_after_eom = bsf_after_eom;
-    g_value_set_boolean(&val, bsf_after_eom);
-    device_set_simple_property(dself, PROPERTY_BSF_AFTER_EOM, &val, bae_surety, bae_source);
+    self->bsf_after_eom = FALSE;
+    g_value_set_boolean(&val, self->bsf_after_eom);
+    device_set_simple_property(dself, PROPERTY_BSF_AFTER_EOM, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
 
     g_value_unset(&val);
     g_value_init(&val, G_TYPE_UINT);
 
-    self->final_filemarks = final_filemarks;
-    g_value_set_uint(&val, final_filemarks);
-    device_set_simple_property(dself, PROPERTY_FINAL_FILEMARKS, &val, ff_surety, ff_source);
+    self->final_filemarks = 2;
+    g_value_set_uint(&val, self->final_filemarks);
+    device_set_simple_property(dself, PROPERTY_FINAL_FILEMARKS, &val, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT);
 
     g_value_unset(&val);
+
+    /* Chain up */
+    if (parent_class->open_device) {
+        parent_class->open_device(dself, device_name, device_type, device_node);
+    }
 }
 
+
 static DeviceStatusFlags tape_device_read_label(Device * dself) {
     TapeDevice * self;
     char * header_buffer;
@@ -765,9 +851,6 @@ static DeviceStatusFlags tape_device_read_label(Device * dself) {
 
     if (device_in_error(self)) return dself->status;
 
-    header = dself->volume_header = g_new(dumpfile_t, 1);
-    fh_init(header);
-
     if (self->fd == -1) {
         self->fd = try_open_tape_device(self, self->private->device_filename);
        /* if the open failed, then try_open_tape_device already set the
@@ -799,12 +882,17 @@ static DeviceStatusFlags tape_device_read_label(Device * dself) {
            msg = stralloc(_("no data"));
             new_status = (DEVICE_STATUS_VOLUME_ERROR |
                          DEVICE_STATUS_VOLUME_UNLABELED);
+           header = dself->volume_header = g_new(dumpfile_t, 1);
+           fh_init(header);
            break;
 
        case RESULT_SMALL_BUFFER:
            msg = stralloc(_("block size too small"));
             new_status = (DEVICE_STATUS_DEVICE_ERROR |
                          DEVICE_STATUS_VOLUME_ERROR);
+           header = dself->volume_header = g_new(dumpfile_t, 1);
+           fh_init(header);
+           header->type = F_WEIRD;
            break;
 
        default:
@@ -823,6 +911,9 @@ static DeviceStatusFlags tape_device_read_label(Device * dself) {
        return dself->status;
     }
 
+    header = dself->volume_header = g_new(dumpfile_t, 1);
+    fh_init(header);
+
     parse_file_header(header_buffer, header, buffer_len);
     amfree(header_buffer);
     if (header->type != F_TAPESTART) {
@@ -1130,8 +1221,6 @@ static gboolean tape_device_start_file(Device * d_self,
     char * amanda_header;
     char *msg = NULL;
 
-    d_self->is_eom = FALSE;
-
     self = TAPE_DEVICE(d_self);
 
     g_assert(self->fd >= 0);
@@ -1429,7 +1518,8 @@ tape_device_finish (Device * d_self) {
 
     self = TAPE_DEVICE(d_self);
 
-    if (device_in_error(self)) return FALSE;
+    if (device_in_error(self))
+       goto finish_error;
 
     /* if we're already in ACCESS_NULL, then there are no filemarks or anything
      * to worry about, but we need to release the kernel device */
@@ -1442,7 +1532,7 @@ tape_device_finish (Device * d_self) {
     /* Polish off this file, if relevant. */
     if (d_self->in_file && IS_WRITABLE_ACCESS_MODE(d_self->access_mode)) {
         if (!device_finish_file(d_self))
-            return FALSE;
+           goto finish_error;
     }
 
     /* Straighten out the filemarks.  We already wrote one in finish_file, and
@@ -1464,7 +1554,7 @@ tape_device_finish (Device * d_self) {
            device_set_error(d_self,
                stralloc(_("Amanda file header won't fit in a single block!")),
                DEVICE_STATUS_DEVICE_ERROR);
-           return FALSE;
+           goto finish_error;
        }
 
        result = tape_device_robust_write(self, header, d_self->block_size, &msg);
@@ -1475,7 +1565,7 @@ tape_device_finish (Device * d_self) {
                DEVICE_STATUS_DEVICE_ERROR);
            amfree(header);
            amfree(msg);
-           return FALSE;
+           goto finish_error;
        }
        amfree(header);
     }
@@ -1485,7 +1575,7 @@ tape_device_finish (Device * d_self) {
        device_set_error(d_self,
            vstrallocf(_("Couldn't rewind device to finish: %s"), strerror(errno)),
            DEVICE_STATUS_DEVICE_ERROR);
-        return FALSE;
+       goto finish_error;
     }
 
     d_self->is_eof = FALSE;
@@ -1496,6 +1586,15 @@ tape_device_finish (Device * d_self) {
     self->fd = -1;
 
     return TRUE;
+
+finish_error:
+    d_self->access_mode = ACCESS_NULL;
+
+    /* release the kernel's device */
+    robust_close(self->fd);
+    self->fd = -1;
+
+    return FALSE;
 }
 
 /* Works just like read(), except for the following:
@@ -1593,6 +1692,7 @@ static IoResult
 tape_device_robust_write (TapeDevice * self, void * buf, int count, char **errmsg) {
     Device * d_self;
     int result;
+    gboolean retry = FALSE;
 
     d_self = (Device*)self;
 
@@ -1601,17 +1701,51 @@ tape_device_robust_write (TapeDevice * self, void * buf, int count, char **errms
     for (;;) {
         result = write(self->fd, buf, count);
 
-        if (result == count) {
-            /* Success. */
-
-            self->private->write_count ++;
+       /* Success. */
+        if (result == count)
             return RESULT_SUCCESS;
-        } else if (result >= 0) {
-            /* write() returned a short count. This should not happen. */
-           *errmsg = g_strdup_printf("Mysterious short write on tape device: Tried %d, got %d",
-                               count, result);
+
+       if (result > 0) {
+            /* write() returned a short count. This should not happen if the block sizes
+            * are properly aligned. */
+           *errmsg = g_strdup_printf("Short write on tape device: Tried %d, got %d.  Is "
+                           "the drive using a block size smaller than %d bytes?",
+                               count, result, count);
             return RESULT_ERROR;
-        } else if (0
+       }
+
+       /* Detect LEOM (early warning) and handle properly
+        *
+        * FreeBSD: 0-length write; next write will succeed
+        *   http://lists.freebsd.org/pipermail/freebsd-scsi/2010-June/004414.html
+        *
+        * Solaris: 0-length write; next write will succeed
+        *   (from Matthew Jacob on FreeBSD thread)
+        *
+        * Linux: -1/ENOSPC; next write will succeed
+        *   http://www.mjmwired.net/kernel/Documentation/scsi/st.txt
+        *
+        * HP/UX: -1/ENOSPC; next write will succeed
+        *   http://www.adssasia.com/Manual/IBM%203581%20tape%20autoloader.pdf
+        */
+       if (result == 0
+#ifdef ENOSPC
+                       || (result < 0 && errno == ENOSPC)
+#endif
+       ) {
+           /* if we've retried once already, then we're probably really out of space */
+           if (retry)
+               return RESULT_NO_SPACE;
+           retry = TRUE;
+           d_self->is_eom = TRUE;
+
+           g_debug("empty write to tape; treating as LEOM early warning and retrying");
+            continue;
+        }
+
+       /* at this point result < 0, so an error occurred - sort out what */
+
+       if (0
 #ifdef EAGAIN
                    || errno == EAGAIN
 #endif
@@ -1839,3 +1973,184 @@ tape_device_factory (char * device_name, char * device_type, char * device_node)
     device_open_device(rval, device_name, device_type, device_node);
     return rval;
 }
+
+/*
+ * Tape Operations using the POSIX interface
+ */
+
+/* Having one name for every operation would be too easy. */
+#if !defined(MTCOMPRESSION) && defined(MTCOMP)
+# define MTCOMPRESSION MTCOMP
+#endif
+
+#if !defined(MTSETBLK) && defined(MTSETBSIZ)
+# define MTSETBLK MTSETBSIZ
+#endif
+
+#if !defined(MTEOM) && defined(MTEOD)
+# define MTEOM MTEOD
+#endif
+
+gboolean tape_rewind(int fd) {
+    int count = 5;
+    time_t stop_time;
+
+    /* We will retry this for up to 30 seconds or 5 retries,
+       whichever is less, because some hardware/software combinations
+       (notably EXB-8200 on FreeBSD) can fail to rewind. */
+    stop_time = time(NULL) + 30;
+
+    while (--count >= 0 && time(NULL) < stop_time) {
+        struct mtop mt;
+        mt.mt_op = MTREW;
+        mt.mt_count = 1;
+
+        if (0 == ioctl(fd, MTIOCTOP, &mt))
+            return TRUE;
+
+        sleep(3);
+    }
+
+    return FALSE;
+}
+
+gboolean tape_fsf(int fd, guint count) {
+    struct mtop mt;
+    mt.mt_op = MTFSF;
+    mt.mt_count = count;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+}
+
+gboolean tape_bsf(int fd, guint count) {
+    struct mtop mt;
+    mt.mt_op = MTBSF;
+    mt.mt_count = count;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+}
+
+gboolean tape_fsr(int fd, guint count) {
+    struct mtop mt;
+    mt.mt_op = MTFSR;
+    mt.mt_count = count;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+}
+
+gboolean tape_bsr(int fd, guint count) {
+    struct mtop mt;
+    mt.mt_op = MTBSR;
+    mt.mt_count = count;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+}
+
+gint tape_fileno(int fd) {
+    struct mtget get;
+
+    if (0 != ioctl(fd, MTIOCGET, &get))
+        return TAPE_POSITION_UNKNOWN;
+    if (get.mt_fileno < 0)
+        return TAPE_POSITION_UNKNOWN;
+    else
+        return get.mt_fileno;
+}
+
+gint tape_eod(int fd) {
+    struct mtop mt;
+    struct mtget get;
+    mt.mt_op = MTEOM;
+    mt.mt_count = 1;
+    if (0 != ioctl(fd, MTIOCTOP, &mt))
+        return TAPE_OP_ERROR;
+
+    /* Ignored result. This is just to flush buffers. */
+    mt.mt_op = MTNOP;
+    ioctl(fd, MTIOCTOP, &mt);
+
+    if (0 != ioctl(fd, MTIOCGET, &get))
+        return TAPE_POSITION_UNKNOWN;
+    if (get.mt_fileno < 0)
+        return TAPE_POSITION_UNKNOWN;
+    else
+        return get.mt_fileno;
+}
+
+gboolean tape_weof(int fd, guint8 count) {
+    struct mtop mt;
+    mt.mt_op = MTWEOF;
+    mt.mt_count = count;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+}
+
+gboolean tape_setcompression(int fd G_GNUC_UNUSED, 
+       gboolean on G_GNUC_UNUSED) {
+#ifdef MTCOMPRESSION
+    struct mtop mt;
+    mt.mt_op = MTCOMPRESSION;
+    mt.mt_count = on;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+#else
+    return 0;
+#endif
+}
+
+gboolean tape_offl(int fd) {
+    struct mtop mt;
+    int safe_errno;
+
+    mt.mt_op = MTOFFL;
+    mt.mt_count = 1;
+    if (0 == ioctl(fd, MTIOCTOP, &mt))
+       return TRUE;
+
+    safe_errno = errno;
+    g_debug("tape_off: ioctl(MTIOCTOP/MTOFFL) failed: %s", strerror(errno));
+    errno = safe_errno;
+
+    return FALSE;
+}
+
+DeviceStatusFlags tape_is_tape_device(int fd) {
+    struct mtop mt;
+    mt.mt_op = MTNOP;
+    mt.mt_count = 1;
+    if (0 == ioctl(fd, MTIOCTOP, &mt)) {
+        return DEVICE_STATUS_SUCCESS;
+#ifdef ENOMEDIUM
+    } else if (errno == ENOMEDIUM) {
+       return DEVICE_STATUS_VOLUME_MISSING;
+#endif
+    } else {
+       g_debug("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s",
+                strerror(errno));
+       if (errno == EIO) {
+           /* some devices return EIO while the drive is busy loading */
+           return DEVICE_STATUS_DEVICE_ERROR|DEVICE_STATUS_DEVICE_BUSY;
+       } else {
+           return DEVICE_STATUS_DEVICE_ERROR;
+       }
+    }
+}
+
+DeviceStatusFlags tape_is_ready(int fd, TapeDevice *t_self G_GNUC_UNUSED) {
+    struct mtget get;
+    if (0 == ioctl(fd, MTIOCGET, &get)) {
+#if defined(GMT_ONLINE) || defined(GMT_DR_OPEN)
+        if (1
+#ifdef GMT_ONLINE
+            && (t_self->broken_gmt_online || GMT_ONLINE(get.mt_gstat))
+#endif
+#ifdef GMT_DR_OPEN
+            && !GMT_DR_OPEN(get.mt_gstat)
+#endif
+            ) {
+            return DEVICE_STATUS_SUCCESS;
+        } else {
+            return DEVICE_STATUS_VOLUME_MISSING;
+        }
+#else /* Neither macro is defined. */
+        return DEVICE_STATUS_SUCCESS;
+#endif
+    } else {
+        return DEVICE_STATUS_VOLUME_ERROR;
+    }
+}
+
diff --git a/device-src/tape-device.h b/device-src/tape-device.h
deleted file mode 100644 (file)
index 18b3e28..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-#ifndef TAPE_DEVICE_H
-#define TAPE_DEVICE_H
-
-#include <device.h>
-
-/* Unlike other Device classes, this class is implemented across multiple source
- * files, so its class declaration is placed in a header file.
- */
-
-/*
- * Type checking and casting macros
- */
-
-#define TYPE_TAPE_DEVICE       (tape_device_get_type())
-#define TAPE_DEVICE(obj)       G_TYPE_CHECK_INSTANCE_CAST((obj), tape_device_get_type(), TapeDevice)
-#define TAPE_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), tape_device_get_type(), TapeDevice const)
-#define TAPE_DEVICE_CLASS(klass)       G_TYPE_CHECK_CLASS_CAST((klass), tape_device_get_type(), TapeDeviceClass)
-#define IS_TAPE_DEVICE(obj)    G_TYPE_CHECK_INSTANCE_TYPE((obj), tape_device_get_type ())
-#define TAPE_DEVICE_GET_CLASS(obj)     G_TYPE_INSTANCE_GET_CLASS((obj), tape_device_get_type(), TapeDeviceClass)
-GType  tape_device_get_type    (void);
-
-/*
- * Main object structure
- */
-typedef struct TapeDevicePrivate_s TapeDevicePrivate;
-typedef struct _TapeDevice {
-    Device __parent__;
-
-    /* It should go without saying that all this stuff is
-     * look-but-don't-touch. */
-
-    /* characteristics of the device */
-    gboolean fsf, bsf, fsr, bsr, eom, bsf_after_eom, broken_gmt_online;
-    gboolean nonblocking_open, fsf_after_filemark;
-    int final_filemarks;
-
-    /* 0 if we opened with O_RDWR; error otherwise. */
-    gboolean write_open_errno;
-    int fd;
-
-    TapeDevicePrivate * private;
-} TapeDevice;
-
-/*
- * Class definition
- */
-typedef struct _TapeDeviceClass TapeDeviceClass;
-struct _TapeDeviceClass {
-       DeviceClass __parent__;
-};
-
-/* Tape device properties. These properties do not exist on non-linear
-   devices. */
-extern DevicePropertyBase device_property_broken_gmt_online;
-#define PROPERTY_BROKEN_GMT_ONLINE (device_property_broken_gmt_online.ID)
-
-extern DevicePropertyBase device_property_fsf;
-#define PROPERTY_FSF (device_property_fsf.ID)
-
-extern DevicePropertyBase device_property_fsf_after_filemark;
-#define PROPERTY_FSF_AFTER_FILEMARK (device_property_fsf_after_filemark.ID)
-
-extern DevicePropertyBase device_property_bsf;
-#define PROPERTY_BSF (device_property_bsf.ID)
-
-extern DevicePropertyBase device_property_fsr;
-#define PROPERTY_FSR (device_property_fsr.ID)
-
-extern DevicePropertyBase device_property_bsr;
-#define PROPERTY_BSR (device_property_bsr.ID)
-
-/* Is EOM supported? Must be able to read file number afterwards as
-   well. */
-extern DevicePropertyBase device_property_eom;
-#define PROPERTY_EOM (device_property_eom.ID)
-
-/* Is it necessary to perform a BSF after EOM? */
-extern DevicePropertyBase device_property_bsf_after_eom;
-#define PROPERTY_BSF_AFTER_EOM (device_property_bsf_after_eom.ID)
-
-/* Should the device be opened with O_NONBLOCK */
-extern DevicePropertyBase device_property_nonblocking_open;
-#define PROPERTY_NONBLOCKING_OPEN (device_property_nonblocking_open.ID)
-
-/* How many filemarks to write at EOD? (Default is 2).
- * This property is a G_TYPE_UINT, but can only really be set to 1 or 2. */
-extern DevicePropertyBase device_property_final_filemarks;
-#define PROPERTY_FINAL_FILEMARKS (device_property_final_filemarks.ID)
-
-/* useful callback for tape ops */
-void tape_device_set_capabilities(TapeDevice *self,
-       gboolean fsf, PropertySurety fsf_surety, PropertySource fsf_source,
-       gboolean fsf_after_filemark, PropertySurety faf_surety, PropertySource faf_source,
-       gboolean bsf, PropertySurety bsf_surety, PropertySource bsf_source,
-       gboolean fsr, PropertySurety fsr_surety, PropertySource fsr_source,
-       gboolean bsr, PropertySurety bsr_surety, PropertySource bsr_source,
-       gboolean eom, PropertySurety eom_surety, PropertySource eom_source,
-       gboolean bsf_after_eom, PropertySurety bae_surety, PropertySource bae_source,
-       guint final_filemarks, PropertySurety ff_surety, PropertySource ff_source);
-
-#endif
diff --git a/device-src/tape-ops.h b/device-src/tape-ops.h
deleted file mode 100644 (file)
index 7bc0ee3..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-#ifndef TAPE_OPS_H
-
-#include <glib.h>
-#include "tape-device.h"
-#include "amanda.h"
-
-#ifdef HAVE_SYS_TAPE_H
-# include <sys/tape.h>
-#endif
-#ifdef HAVE_SYS_MTIO_H
-# include <sys/mtio.h>
-#endif
-
-/* This file declares functions which are implemented in each of tape-*.c. The
- * appropriate C file is selected at configure time. */
-
-/* Real Operations (always return FALSE if not implemented) */
-gboolean tape_rewind(int fd);
-gboolean tape_fsf(int fd, guint count);
-gboolean tape_bsf(int fd, guint count);
-gboolean tape_fsr(int fd, guint count);
-gboolean tape_bsr(int fd, guint count);
-gint tape_fileno(int fd);
-
-/* tape_fileno returns tape position file number, or one of these: */
-#define TAPE_OP_ERROR -1
-#define TAPE_POSITION_UNKNOWN -2
-
-/* Sets attributes of the device to indicate which of the above operations
- * are available in this device. */
-void tape_device_detect_capabilities(TapeDevice * self);
-
-/* returns a fileno like tape_fileno */
-gint tape_eod(int fd);
-
-gboolean tape_weof(int fd, guint8 count);
-gboolean tape_setcompression(int fd, gboolean on);
-
-gboolean tape_offl(int fd);
-
-DeviceStatusFlags tape_is_tape_device(int fd);
-DeviceStatusFlags tape_is_ready(int fd, TapeDevice *t_self);
-
-#endif
-
diff --git a/device-src/tape-posix.c b/device-src/tape-posix.c
deleted file mode 100644 (file)
index 0fc3040..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-#include "amanda.h"
-#include "util.h"
-#include "tape-ops.h"
-#include "property.h"
-#include <glob.h>
-
-/* Having one name for every operation would be too easy. */
-#if !defined(MTCOMPRESSION) && defined(MTCOMP)
-# define MTCOMPRESSION MTCOMP
-#endif
-
-#if !defined(MTSETBLK) && defined(MTSETBSIZ)
-# define MTSETBLK MTSETBSIZ
-#endif
-
-#if !defined(MTEOM) && defined(MTEOD)
-# define MTEOM MTEOD
-#endif
-
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-gboolean tape_rewind(int fd) {
-    int count = 5;
-    time_t stop_time;
-
-    /* We will retry this for up to 30 seconds or 5 retries,
-       whichever is less, because some hardware/software combinations
-       (notably EXB-8200 on FreeBSD) can fail to rewind. */
-    stop_time = time(NULL) + 30;
-
-    while (--count >= 0 && time(NULL) < stop_time) {
-        struct mtop mt;
-        mt.mt_op = MTREW;
-        mt.mt_count = 1;
-
-        if (0 == ioctl(fd, MTIOCTOP, &mt))
-            return TRUE;
-
-        sleep(3);
-    }
-
-    return FALSE;
-}
-
-gboolean tape_fsf(int fd, guint count) {
-    struct mtop mt;
-    mt.mt_op = MTFSF;
-    mt.mt_count = count;
-    return 0 == ioctl(fd, MTIOCTOP, &mt);
-}
-
-gboolean tape_bsf(int fd, guint count) {
-    struct mtop mt;
-    mt.mt_op = MTBSF;
-    mt.mt_count = count;
-    return 0 == ioctl(fd, MTIOCTOP, &mt);
-}
-
-gboolean tape_fsr(int fd, guint count) {
-    struct mtop mt;
-    mt.mt_op = MTFSR;
-    mt.mt_count = count;
-    return 0 == ioctl(fd, MTIOCTOP, &mt);
-}
-
-gboolean tape_bsr(int fd, guint count) {
-    struct mtop mt;
-    mt.mt_op = MTBSR;
-    mt.mt_count = count;
-    return 0 == ioctl(fd, MTIOCTOP, &mt);
-}
-
-gint tape_fileno(int fd) {
-    struct mtget get;
-
-    if (0 != ioctl(fd, MTIOCGET, &get))
-        return TAPE_POSITION_UNKNOWN;
-    if (get.mt_fileno < 0)
-        return TAPE_POSITION_UNKNOWN;
-    else
-        return get.mt_fileno;
-}
-
-gint tape_eod(int fd) {
-    struct mtop mt;
-    struct mtget get;
-    mt.mt_op = MTEOM;
-    mt.mt_count = 1;
-    if (0 != ioctl(fd, MTIOCTOP, &mt))
-        return TAPE_OP_ERROR;
-
-    /* Ignored result. This is just to flush buffers. */
-    mt.mt_op = MTNOP;
-    ioctl(fd, MTIOCTOP, &mt);
-
-    if (0 != ioctl(fd, MTIOCGET, &get))
-        return TAPE_POSITION_UNKNOWN;
-    if (get.mt_fileno < 0)
-        return TAPE_POSITION_UNKNOWN;
-    else
-        return get.mt_fileno;
-}
-
-gboolean tape_weof(int fd, guint8 count) {
-    struct mtop mt;
-    mt.mt_op = MTWEOF;
-    mt.mt_count = count;
-    return 0 == ioctl(fd, MTIOCTOP, &mt);
-}
-
-gboolean tape_setcompression(int fd G_GNUC_UNUSED, 
-       gboolean on G_GNUC_UNUSED) {
-#ifdef MTCOMPRESSION
-    struct mtop mt;
-    mt.mt_op = MTCOMPRESSION;
-    mt.mt_count = on;
-    return 0 == ioctl(fd, MTIOCTOP, &mt);
-#else
-    return 0;
-#endif
-}
-
-gboolean tape_offl(int fd) {
-    struct mtop mt;
-    int safe_errno;
-
-    mt.mt_op = MTOFFL;
-    mt.mt_count = 1;
-    if (0 == ioctl(fd, MTIOCTOP, &mt))
-       return TRUE;
-
-    safe_errno = errno;
-    g_debug("tape_off: ioctl(MTIOCTOP/MTOFFL) failed: %s", strerror(errno));
-    errno = safe_errno;
-
-    return FALSE;
-}
-
-DeviceStatusFlags tape_is_tape_device(int fd) {
-    struct mtop mt;
-    mt.mt_op = MTNOP;
-    mt.mt_count = 1;
-    if (0 == ioctl(fd, MTIOCTOP, &mt)) {
-        return DEVICE_STATUS_SUCCESS;
-#ifdef ENOMEDIUM
-    } else if (errno == ENOMEDIUM) {
-       return DEVICE_STATUS_VOLUME_MISSING;
-#endif
-    } else {
-       g_debug("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s",
-                strerror(errno));
-       if (errno == EIO) {
-           /* some devices return EIO while the drive is busy loading */
-           return DEVICE_STATUS_DEVICE_ERROR|DEVICE_STATUS_DEVICE_BUSY;
-       } else {
-           return DEVICE_STATUS_DEVICE_ERROR;
-       }
-    }
-}
-
-DeviceStatusFlags tape_is_ready(int fd, TapeDevice *t_self G_GNUC_UNUSED) {
-    struct mtget get;
-    if (0 == ioctl(fd, MTIOCGET, &get)) {
-#if defined(GMT_ONLINE) || defined(GMT_DR_OPEN)
-        if (1
-#ifdef GMT_ONLINE
-            && (t_self->broken_gmt_online || GMT_ONLINE(get.mt_gstat))
-#endif
-#ifdef GMT_DR_OPEN
-            && !GMT_DR_OPEN(get.mt_gstat)
-#endif
-            ) {
-            return DEVICE_STATUS_SUCCESS;
-        } else {
-            return DEVICE_STATUS_VOLUME_MISSING;
-        }
-#else /* Neither macro is defined. */
-        return DEVICE_STATUS_SUCCESS;
-#endif
-    } else {
-        return DEVICE_STATUS_VOLUME_ERROR;
-    }
-}
-
-void tape_device_detect_capabilities(TapeDevice * t_self) {
-    tape_device_set_capabilities(t_self,
-       TRUE,  PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf*/
-       DEFAULT_FSF_AFTER_FILEMARK, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf_after_filemark*/
-       TRUE,  PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsf*/
-       TRUE,  PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsr*/
-       TRUE,  PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsr*/
-       TRUE,  PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* eom*/
-       FALSE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsf_after_eom*/
-       2,     PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT  /* final_filemarks*/
-       );
-}
diff --git a/device-src/tape-uware.c b/device-src/tape-uware.c
deleted file mode 100644 (file)
index f7e4fe2..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-/* Tape operations for SVR4 systems. Most of this stuff is based on
-   documentation from http://docsrv.sco.com/cgi-bin/man/man?sdi+7 */
-
-#include <amanda.h>
-#include <tape-ops.h>
-#include "glib-util.h"
-
-/* Uncomment to test on non-SYSV4 systems. */
-/* ---
-#undef MTIOCTOP
-#define T_RWD 0
-#define T_SFF 0
-#define T_SFB 0
-#define T_SBF 0
-#define T_SBB 0
-#define T_WRFILEM 0
-#define T_RDBLKLEN 0
-#define T_WRBLKLEN 0
-#define T_SETCOMP 0
-#define T_UNLOAD 0
-
-struct blklen {
-    int min_blen, max_blen;
-};
-
- --- */
-
-gboolean tape_rewind(int fd) {
-    return 0 == ioctl(fd, T_RWD);
-}
-
-gboolean tape_fsf(int fd, guint count) {
-    return 0 == ioctl(fd, T_SFF, count);
-}
-
-gboolean tape_bsf(int fd, guint count) {
-    return 0 == ioctl(fd, T_SFB, count);
-}
-
-gboolean tape_fsr(int fd, guint count) {
-    return 0 == ioctl(fd, T_SBF, count);
-}
-
-gboolean tape_bsr(int fd, guint count) {
-    return 0 == ioctl(fd, T_SBB, count);
-}
-
-gint tape_fileno(int fd) {
-    return TAPE_POSITION_UNKNOWN;
-}
-
-gint tape_eod(int fd G_GNUC_UNUSED) {
-    g_assert_not_reached();
-    return TAPE_OP_ERROR;
-}
-
-gboolean tape_weof(int fd, guint8 count) {
-    return 0 == ioctl(fd, T_WRFILEM, count);
-}
-
-gboolean tape_offl(int fd) {
-    return 0 == ioctl(fd, T_UNLOAD);
-}
-
-gboolean tape_setcompression(int fd, gboolean on) {
-    int cmd;
-    if (on) {
-        cmd = 3;
-    } else {
-        cmd = 2;
-    }
-
-    return 0 == ioctl(fd, T_SETCOMP, cmd);
-}
-
-DeviceStatusFlags tape_is_tape_device(int fd) {
-    /* If we can read block information, it's probably a tape device. */
-    struct blklen result;
-    if (0 == ioctl(fd, T_RDBLKLEN, &result)) {
-        return DEVICE_STATUS_SUCCESS;
-    } else {
-        return DEVICE_STATUS_DEVICE_ERROR;
-    }
-}
-
-DeviceStatusFlags tape_is_ready(int fd G_GNUC_UNUSED, TapeDevice *t_self G_GNUC_UNUSED) {
-    /* No good way to determine this, so assume it's ready */
-    return DEVICE_STATUS_SUCCESS;
-}
-
-void tape_device_detect_capabilities(TapeDevice * t_self) {
-    tape_device_set_capabilities(t_self,
-       TRUE,  PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* fsf*/
-       DEFAULT_FSF_AFTER_FILEMARK, PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* fsf_after_filemark*/
-       TRUE,  PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* bsf*/
-       TRUE,  PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* fsr*/
-       TRUE,  PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* bsr*/
-       FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* eom*/
-       FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsf_after_eom*/
-       2,     PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT  /* final_filemarks*/
-       );
-}
diff --git a/device-src/tape-xenix.c b/device-src/tape-xenix.c
deleted file mode 100644 (file)
index 0cce566..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-/* Tape operations for XENIX systems. Most of this stuff is based on
-   documentation from
-   http://www.ifthenfi.nl:8080/cgi-bin/ssl_getmanpage?tape+HW+XNX234+tape
-*/
-
-#include <amanda.h>
-#include <tape-ops.h>
-#include "glib-util.h"
-
-/* Uncomment to test compilation on non-XENIX systems. */
-/* --- 
-#undef MTIOCTOP
-#define MT_REWIND 0
-#define MT_STATUS 0
-#define T_RFM 0
-#define T_WFM 0
-struct tape_info {};
-  --- */
-
-gboolean tape_rewind(int fd) {
-    return 0 == ioctl(fd, MT_REWIND);
-}
-
-gboolean tape_fsf(int fd, guint count) {
-    while (count-- > 0) {
-        if (0 != ioctl(fd, T_RFM))
-            return FALSE;
-    }
-    return TRUE;
-}
-
-gboolean tape_bsf(int fd G_GNUC_UNUSED, guint count G_GNUC_UNUSED) {
-    g_assert_not_reached();
-    return FALSE;
-}
-
-gboolean tape_fsr(int fd G_GNUC_UNUSED, guint count G_GNUC_UNUSED) {
-    g_assert_not_reached();
-    return FALSE;
-}
-
-gboolean tape_bsr(int fd G_GNUC_UNUSED, guint count G_GNUC_UNUSED) {
-    g_assert_not_reached();
-    return FALSE;
-}
-
-gint tape_fileno(int fd) {
-    return TAPE_POSITION_UNKNOWN;
-}
-
-gint tape_eod(int fd G_GNUC_UNUSED) {
-    g_assert_not_reached();
-    return TAPE_OP_ERROR;
-}
-
-gboolean tape_weof(int fd, guint8 count) {
-    while (count-- > 0) {
-        if (0 != ioctl(fd, T_WFM))
-            return FALSE;
-    } 
-
-    return TRUE;
-}
-
-gboolean tape_setcompression(int fd G_GNUC_UNUSED, gboolean on G_GNUC_UNUSED) {
-    return FALSE;
-}
-
-gboolean tape_offl(int fd) {
-    /* return 0 == ioctl(fd, MT_OFFL); */
-    /* return 0 == ioctl(fd, T_UNLOAD); */
-    return TRUE;
-}
-
-DeviceStatusFlags tape_is_tape_device(int fd) {
-    struct tape_info result;
-    if (0 == ioctl(fd, MT_STATUS, &result)) {
-        return DEVICE_STATUS_SUCCESS;
-    } else {
-        return DEVICE_STATUS_DEVICE_ERROR;
-    }
-}
-
-DeviceStatusFlags tape_is_ready(int fd G_GNUC_UNUSED, TapeDevice *t_self G_GNUC_UNUSED) {
-    /* We can probably do better. */
-    return DEVICE_STATUS_SUCCESS;
-}
-
-void tape_device_detect_capabilities(TapeDevice * t_self) {
-    tape_device_set_capabilities(t_self,
-       TRUE,  PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* fsf*/
-       DEFAULT_FSF_AFTER_FILEMARK, PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT, /* fsf_after_filemark*/
-       FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsf*/
-       FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* fsr*/
-       FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsr*/
-       FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* eom*/
-       FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsf_after_eom*/
-       2,     PROPERTY_SURETY_BAD,  PROPERTY_SOURCE_DEFAULT  /* final_filemarks*/
-       );
-}
index 0ab6f1f8db4e74240115190071d3d855ffcc2213..71387c6b08ce61dd6c388c04776b8ff3b546099c 100644 (file)
 #define VFS_DEVICE_DEFAULT_BLOCK_SIZE (DISK_BLOCK_BYTES)
 #define VFS_DEVICE_LABEL_SIZE (32768)
 
+/* Allow comfortable room for another block and a header before PEOM */
+#define EOM_EARLY_WARNING_ZONE_BLOCKS 4
+
+/* Constants for free-space monitoring */
+#define MONITOR_FREE_SPACE_EVERY_SECONDS 5
+#define MONITOR_FREE_SPACE_EVERY_KB 102400
+#define MONITOR_FREE_SPACE_CLOSELY_WITHIN_BLOCKS 128
+
 /* This looks dangerous, but is actually modified by the umask. */
 #define VFS_DEVICE_CREAT_MODE 0666
 
@@ -91,9 +99,15 @@ static gboolean file_number_to_file_name_functor(const char * filename,
 static gboolean vfs_device_set_max_volume_usage_fn(Device *p_self,
                            DevicePropertyBase *base, GValue *val,
                            PropertySurety surety, PropertySource source);
-gboolean vfs_device_get_free_space_fn(struct Device *p_self,
+static gboolean property_get_monitor_free_space_fn(Device *p_self,
                            DevicePropertyBase *base, GValue *val,
                            PropertySurety *surety, PropertySource *source);
+static gboolean property_set_monitor_free_space_fn(Device *p_self,
+                           DevicePropertyBase *base, GValue *val,
+                           PropertySurety surety, PropertySource source);
+static gboolean property_set_leom_fn(Device *p_self,
+                           DevicePropertyBase *base, GValue *val,
+                           PropertySurety surety, PropertySource source);
 //static char* lockfile_name(VfsDevice * self, guint file);
 static gboolean open_lock(VfsDevice * self, int file, gboolean exclusive);
 static void promote_volume_lock(VfsDevice * self);
@@ -112,11 +126,28 @@ static gboolean get_last_file_number_functor(const char * filename,
 static char * make_new_file_name(VfsDevice * self, const dumpfile_t * ji);
 static gboolean try_unlink(const char * file);
 
+/* return TRUE if the device is going to hit ENOSPC "soon" - this is used to
+ * detect LEOM as represented by actually running out of space on the
+ * underlying filesystem.  Size is the size of the buffer that is about to
+ * be written. */
+static gboolean check_at_leom(VfsDevice *self, guint64 size);
+/* Similar, but for PEOM */
+static gboolean check_at_peom(VfsDevice *self, guint64 size);
+
 /* pointer to the classes of our parents */
 static DeviceClass *parent_class = NULL;
 
+/* device-specific properties */
+DevicePropertyBase device_property_monitor_free_space;
+#define PROPERTY_MONITOR_FREE_SPACE (device_property_monitor_free_space.ID)
+
 void vfs_device_register(void) {
     static const char * device_prefix_list[] = { "file", NULL };
+
+    device_property_fill_and_register(&device_property_monitor_free_space,
+                                      G_TYPE_BOOLEAN, "monitor_free_space",
+      "Should VFS device monitor the filesystem's available free space?");
+
     register_device(vfs_device_factory, device_prefix_list);
 }
 
@@ -155,6 +186,12 @@ vfs_device_init (VfsDevice * self) {
     self->open_file_fd = -1;
     self->volume_bytes = 0;
     self->volume_limit = 0;
+    self->leom = TRUE;
+
+    self->monitor_free_space = TRUE;
+    self->checked_fs_free_bytes = G_MAXUINT64;
+    self->checked_fs_free_time = 0;
+    self->checked_fs_free_bytes = G_MAXUINT64;
 
     /* Register Properties */
     bzero(&response, sizeof(response));
@@ -189,6 +226,12 @@ vfs_device_init (VfsDevice * self) {
            &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
     g_value_unset(&response);
 
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, FALSE);
+    device_set_simple_property(dself, PROPERTY_LEOM,
+           &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
+    g_value_unset(&response);
+
     g_value_init(&response, G_TYPE_BOOLEAN);
     g_value_set_boolean(&response, FALSE);
     device_set_simple_property(dself, PROPERTY_COMPRESSION,
@@ -231,10 +274,10 @@ vfs_device_base_init (VfsDeviceClass * c)
 {
     DeviceClass *device_class = (DeviceClass *)c;
 
-    device_class_register_property(device_class, PROPERTY_FREE_SPACE,
-           PROPERTY_ACCESS_GET_MASK,
-           vfs_device_get_free_space_fn,
-           NULL);
+    device_class_register_property(device_class, PROPERTY_MONITOR_FREE_SPACE,
+           PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK,
+           property_get_monitor_free_space_fn,
+           property_set_monitor_free_space_fn);
 
     device_class_register_property(device_class, PROPERTY_MAX_VOLUME_USAGE,
            (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) &
@@ -246,9 +289,15 @@ vfs_device_base_init (VfsDeviceClass * c)
            PROPERTY_ACCESS_GET_MASK,
            device_simple_property_get_fn,
            NULL);
+
+    /* add the ability to set LEOM to FALSE, for testing purposes */
+    device_class_register_property(device_class, PROPERTY_LEOM,
+           PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
+           device_simple_property_get_fn,
+           property_set_leom_fn);
 }
 
-gboolean
+static gboolean
 vfs_device_set_max_volume_usage_fn(Device *p_self,
     DevicePropertyBase *base, GValue *val,
     PropertySurety surety, PropertySource source)
@@ -260,45 +309,49 @@ vfs_device_set_max_volume_usage_fn(Device *p_self,
     return device_simple_property_set_fn(p_self, base, val, surety, source);
 }
 
-gboolean
-vfs_device_get_free_space_fn(struct Device *dself,
-    DevicePropertyBase *base G_GNUC_UNUSED, GValue *val,
-    PropertySurety *surety, PropertySource *source)
+static gboolean
+property_get_monitor_free_space_fn(Device *p_self, DevicePropertyBase *base G_GNUC_UNUSED,
+    GValue *val, PropertySurety *surety, PropertySource *source)
 {
-    VfsDevice *self = VFS_DEVICE(dself);
-    QualifiedSize qsize;
-    struct fs_usage fsusage;
-    guint64 bytes_avail;
-
-    if (get_fs_usage(self->dir_name, NULL, &fsusage) == 0) {
-       if (fsusage.fsu_bavail_top_bit_set)
-           bytes_avail = 0;
-       else
-           bytes_avail = fsusage.fsu_bavail * fsusage.fsu_blocksize;
-       if (self->volume_limit && (guint64)self->volume_limit < bytes_avail / 1024)
-           bytes_avail = (guint64)self->volume_limit * 1024;
-
-       qsize.accuracy = SIZE_ACCURACY_REAL;
-       qsize.bytes = bytes_avail;
-       if (surety)
-           *surety = PROPERTY_SURETY_GOOD;
-    } else {
-       g_warning(_("get_fs_usage('%s') failed: %s"), self->dir_name, strerror(errno));
-       qsize.accuracy = SIZE_ACCURACY_UNKNOWN;
-       qsize.bytes = 0;
-       if (surety)
-           *surety = PROPERTY_SURETY_BAD;
-    }
+    VfsDevice *self = VFS_DEVICE(p_self);
 
-    g_value_unset_init(val, QUALIFIED_SIZE_TYPE);
-    g_value_set_boxed(val, &qsize);
+    g_value_unset_init(val, G_TYPE_BOOLEAN);
+    g_value_set_boolean(val, self->monitor_free_space);
+
+    if (surety)
+       *surety = PROPERTY_SURETY_GOOD;
 
     if (source)
-       *source = PROPERTY_SOURCE_DETECTED;
+       *source = PROPERTY_SOURCE_DEFAULT;
 
     return TRUE;
 }
 
+
+static gboolean
+property_set_monitor_free_space_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    VfsDevice *self = VFS_DEVICE(p_self);
+
+    self->monitor_free_space = g_value_get_boolean(val);
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+}
+
+static gboolean
+property_set_leom_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    VfsDevice *self = VFS_DEVICE(p_self);
+
+    self->leom = g_value_get_boolean(val);
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+}
+
 /* Drops everything associated with the volume file: Its name and fd. */
 void release_file(VfsDevice * self) {
     /* Doesn't hurt. */
@@ -680,7 +733,8 @@ static DeviceStatusFlags vfs_device_read_label(Device * dself) {
     /* close the fd we just opened */
     vfs_device_finish_file(dself);
 
-    if (amanda_header->type != F_TAPESTART) {
+    if (amanda_header->type != F_TAPESTART &&
+       amanda_header->type != F_EMPTY) {
         /* This is an error, and should not happen. */
        device_set_error(dself,
                stralloc(_("Got a bad volume label")),
@@ -689,11 +743,13 @@ static DeviceStatusFlags vfs_device_read_label(Device * dself) {
         return dself->status;
     }
 
-    dself->volume_label = g_strdup(amanda_header->name);
-    dself->volume_time = g_strdup(amanda_header->datestamp);
     /* self->volume_header is already set */
 
-    device_set_error(dself, NULL, DEVICE_STATUS_SUCCESS);
+    if (amanda_header->type == F_TAPESTART) {
+       dself->volume_label = g_strdup(amanda_header->name);
+       dself->volume_time = g_strdup(amanda_header->datestamp);
+       device_set_error(dself, NULL, DEVICE_STATUS_SUCCESS);
+    }
 
     update_volume_size(self);
 
@@ -708,14 +764,15 @@ static gboolean vfs_device_write_block(Device * pself, guint size, gpointer data
 
     g_assert(self->open_file_fd >= 0);
 
-    if (self->volume_limit > 0 &&
-        self->volume_bytes + size > self->volume_limit) {
-        /* Simulate EOF. */
-        pself->is_eom = TRUE;
+    if (check_at_leom(self, size))
+       pself->is_eom = TRUE;
+
+    if (check_at_peom(self, size)) {
+       pself->is_eom = TRUE;
        device_set_error(pself,
            stralloc(_("No space left on device")),
            DEVICE_STATUS_VOLUME_ERROR);
-        return FALSE;
+       return FALSE;
     }
 
     result = vfs_device_robust_write(self, data, size);
@@ -725,6 +782,7 @@ static gboolean vfs_device_write_block(Device * pself, guint size, gpointer data
     }
 
     self->volume_bytes += size;
+    self->checked_bytes_used += size;
     pself->block ++;
 
     return TRUE;
@@ -821,10 +879,11 @@ vfs_device_finish (Device * pself) {
 
     release_file(self);
 
-    if (device_in_error(self)) return FALSE;
-
     pself->access_mode = ACCESS_NULL;
     pself->in_file = FALSE;
+
+    if (device_in_error(self)) return FALSE;
+
     return TRUE;
 }
 
@@ -969,13 +1028,15 @@ vfs_device_start_file (Device * dself, dumpfile_t * ji) {
      * 32k regardless of the block_size setting */
     ji->blocksize = 32768;
 
-    if (self->volume_limit > 0 &&
-        self->volume_bytes + VFS_DEVICE_LABEL_SIZE > self->volume_limit) {
-        dself->is_eom = TRUE;
+    if (check_at_leom(self, VFS_DEVICE_LABEL_SIZE))
+       dself->is_eom = TRUE;
+
+    if (check_at_peom(self, VFS_DEVICE_LABEL_SIZE)) {
+       dself->is_eom = TRUE;
        device_set_error(dself,
                stralloc(_("No space left on device")),
                DEVICE_STATUS_DEVICE_ERROR);
-        return FALSE;
+       return FALSE;
     }
 
     /* The basic idea here is thus:
@@ -1013,6 +1074,7 @@ vfs_device_start_file (Device * dself, dumpfile_t * ji) {
 
     /* handle some accounting business */
     self->volume_bytes += VFS_DEVICE_LABEL_SIZE;
+    self->checked_bytes_used += VFS_DEVICE_LABEL_SIZE;
     dself->in_file = TRUE;
     dself->block = 0;
     /* make_new_file_name set pself->file for us */
@@ -1030,9 +1092,6 @@ vfs_device_finish_file(Device * dself) {
 
     dself->in_file = FALSE;
 
-    if (dself->is_eom)
-        return FALSE;
-
     return TRUE;
 }
 
@@ -1090,9 +1149,12 @@ vfs_device_seek_file (Device * dself, guint requested_file) {
     if (self->file_name == NULL) {
        device_set_error(dself,
            vstrallocf(_("File %d not found"), file),
-           DEVICE_STATUS_VOLUME_ERROR);
+           file == 0 ? DEVICE_STATUS_VOLUME_UNLABELED
+                     : DEVICE_STATUS_VOLUME_ERROR);
         release_file(self);
-        return NULL;
+       rval = g_new(dumpfile_t, 1);
+       fh_init(rval);
+        return rval;
     }
 
     self->open_file_fd = robust_open(self->file_name, O_RDONLY, 0);
@@ -1182,6 +1244,74 @@ static gboolean try_unlink(const char * file) {
     }
 }
 
+static gboolean
+check_at_leom(VfsDevice *self, guint64 size)
+{
+    gboolean recheck = FALSE;
+    guint64 est_avail_now;
+    struct fs_usage fsusage;
+    guint64 block_size = DEVICE(self)->block_size;
+    guint64 eom_warning_buffer = EOM_EARLY_WARNING_ZONE_BLOCKS * block_size;
+
+    if (!self->leom || !self->monitor_free_space)
+       return FALSE;
+
+    /* handle VOLUME_LIMIT */
+    if (self->volume_limit &&
+           self->volume_bytes + size + eom_warning_buffer > self->volume_limit) {
+       return TRUE;
+    }
+
+    /* handle actual filesystem available space, using some heuristics to avoid polling this
+     * too frequently */
+    est_avail_now = 0;
+    if (self->checked_fs_free_bytes >= self->checked_bytes_used + size)
+       est_avail_now = self->checked_fs_free_bytes - self->checked_bytes_used - size;
+
+    /* is it time to check again? */
+    if (est_avail_now <= block_size * MONITOR_FREE_SPACE_CLOSELY_WITHIN_BLOCKS) {
+       recheck = TRUE;
+    } else if (self->checked_bytes_used > MONITOR_FREE_SPACE_EVERY_KB * 1024) {
+       recheck = TRUE;
+    } else if (self->checked_fs_free_time + MONITOR_FREE_SPACE_EVERY_SECONDS <= time(NULL)) {
+       recheck = TRUE;
+    }
+
+    if (!recheck)
+       return FALSE;
+
+    if (get_fs_usage(self->dir_name, NULL, &fsusage) < 0 || fsusage.fsu_bavail_top_bit_set) {
+       g_warning("Filesystem cannot provide free space: %s; setting MONITOR_FREE_SPACE false",
+               fsusage.fsu_bavail_top_bit_set? "no result" : strerror(errno));
+       self->monitor_free_space = FALSE;
+       return FALSE;
+    }
+
+    self->checked_fs_free_bytes = fsusage.fsu_bavail * fsusage.fsu_blocksize;
+    self->checked_bytes_used = 0;
+    self->checked_fs_free_time = time(NULL);
+
+    if (self->checked_fs_free_bytes - size <= eom_warning_buffer) {
+       g_debug("%s: at LEOM", DEVICE(self)->device_name);
+       return TRUE;
+    }
+
+    return FALSE;
+}
+
+static gboolean
+check_at_peom(VfsDevice *self, guint64 size)
+{
+    if (self->volume_limit > 0) {
+       guint64 newtotal = self->volume_bytes + size;
+        if (newtotal > self->volume_limit) {
+           return TRUE;
+       }
+    }
+
+    return FALSE;
+}
+
 static gboolean
 vfs_device_recycle_file (Device * dself, guint filenum) {
     VfsDevice * self = VFS_DEVICE(dself);
@@ -1343,3 +1473,5 @@ vfs_device_robust_write(VfsDevice * self,  char *buf, int count) {
     }
     return RESULT_SUCCESS;
 }
+
+/* TODO: add prop */
index 515b0cc25f2b4b888ef58679619e2e121a2281cd..62442c470d9129b0ccd0a6da76d7be88c6216de0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005-2008 Zmanda Inc.  All Rights Reserved.
+ * Copyright (c) 2005-2008, 2010 Zmanda Inc.  All Rights Reserved.
  *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License version 2.1 as
@@ -46,10 +46,23 @@ typedef struct {
     char * dir_name;
     char * file_name;
     int open_file_fd;
+    gboolean leom;
 
     /* Properties */
     guint64 volume_bytes;
     guint64 volume_limit;
+
+    /* should we monitor free space? (controlled by MONITOR_FREE_SPACE property) */
+    gboolean monitor_free_space;
+
+    /* how many bytes were free at last check */
+    guint64 checked_fs_free_bytes;
+
+    /* when was that check performed? */
+    time_t checked_fs_free_time;
+
+    /* and how many bytes have been written since the last check? */
+    guint64 checked_bytes_used;
 } VfsDevice;
 
 /*
diff --git a/device-src/vfs-test.c b/device-src/vfs-test.c
deleted file mode 100644 (file)
index fc4387b..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * 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
- *
- * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
- * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
- */
-
-#include "glib-util.h"
-#include "amanda.h"
-#include "device.h"
-#include "conffile.h"
-#include "testutils.h"
-
-/* Global state set up for the tests */
-static char *device_path = NULL;
-
-/*
- * Utilities
- */
-
-static void
-cleanup_vtape_dir(char *device_path)
-{
-    char *quoted = g_shell_quote(device_path);
-    char *cmd = vstralloc("rm -rf ", quoted, NULL);
-
-    /* would you rather write 'rm -rf' here? */
-    if (system(cmd) == -1) {
-       exit(1);
-    }
-
-    amfree(cmd);
-    amfree(quoted);
-}
-
-static char *
-setup_vtape_dir(void)
-{
-    char *cwd = g_get_current_dir();
-    char *device_path = NULL;
-    char *data_dir = NULL;
-
-    device_path = vstralloc(cwd, "/vfs-test-XXXXXX", NULL);
-    amfree(cwd);
-
-    if (mkdtemp(device_path) == NULL) {
-       fprintf(stderr, "Could not create temporary directory in %s\n", cwd);
-       return NULL;
-    }
-
-    /* append "/data/" to that for the VFS device*/
-    data_dir = vstralloc(device_path, "/data/", NULL);
-    if (mkdir(data_dir, 0777) == -1) {
-       fprintf(stderr, "Could not create %s: %s\n", cwd, strerror(errno));
-       amfree(data_dir);
-       return NULL;
-    }
-
-    amfree(data_dir);
-    return device_path;
-}
-
-static Device *
-setup_device(void)
-{
-    Device *device;
-    char *device_name = NULL;
-
-    device_name = vstralloc("file:", device_path, NULL);
-    device = device_open(device_name);
-    if (device->status != DEVICE_STATUS_SUCCESS) {
-       g_critical("Could not open device %s: %s\n", device_name, device_error(device));
-    }
-
-    amfree(device_name);
-    return device;
-}
-
-/*
- * Tests
- */
-
-static int
-test_vfs_free_space(void)
-{
-    Device *device = NULL;
-    GValue value;
-    QualifiedSize qsize;
-
-    device = setup_device();
-    if (!device)
-       return FALSE;
-
-    bzero(&value, sizeof(value));
-    if (!device_property_get(device, PROPERTY_FREE_SPACE, &value)) {
-       g_debug("Could not get property_free_space\n");
-       return FALSE;
-    }
-
-    qsize = *(QualifiedSize*)g_value_get_boxed(&value);
-    g_value_unset(&value);
-
-    if (qsize.accuracy != SIZE_ACCURACY_REAL) {
-       g_debug("property_free_space accuracy is not SIZE_ACCURACY_REAL\n");
-       return FALSE;
-    }
-
-    if (qsize.bytes == 0) {
-       g_debug("property_free_space returned bytes=0\n");
-       return FALSE;
-    }
-
-    g_object_unref(device);
-
-    return TRUE;
-}
-
-/*
- * Main driver
- */
-
-int
-main(int argc, char **argv)
-{
-    int result;
-    static TestUtilsTest tests[] = {
-        TU_TEST(test_vfs_free_space, 90),
-       TU_END()
-    };
-
-    glib_init();
-    config_init(0, NULL);
-    device_api_init();
-
-    /* TODO: if more tests are added, we'll need a setup/cleanup hook
-     * for testutils */
-    device_path = setup_vtape_dir();
-
-    result = testutils_run_tests(argc, argv, tests);
-
-    cleanup_vtape_dir(device_path);
-    amfree(device_path);
-
-    return result;
-}
index 13cb35495e12b355429c1015d7bcec616b1934a2..28fd0580c2592268fbed81bedcaea07b448bf708 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "device.h"
 #include "property.h"
 #include "xfer-device.h"
-#include "queueing.h"
-#include "device-queueing.h"
 
 /*
  * Class declaration
@@ -52,9 +50,12 @@ typedef struct XferDestDevice {
     XferElement __parent__;
 
     Device *device;
-    size_t max_memory;
 
-    GThread *thread;
+    gboolean cancel_at_leom;
+
+    gpointer partial;
+    gsize block_size;
+    gsize partial_length;
 } XferDestDevice;
 
 /*
@@ -69,116 +70,117 @@ typedef struct {
  * Implementation
  */
 
-static producer_result_t
-pull_buffer_producer(gpointer data,
-    queue_buffer_t *buffer,
-    size_t hint_size G_GNUC_UNUSED)
+static gboolean
+do_block(
+    XferDestDevice *self,
+    guint size,
+    gpointer data)
 {
-    XferDestDevice *self = (XferDestDevice *)data;
     XferElement *elt = XFER_ELEMENT(self);
-    gpointer buf;
-    size_t size;
 
-    if (elt->cancelled) {
-       /* drain our upstream only if we're expecting an EOF */
-       if (elt->expect_eof) {
-           xfer_element_drain_by_pulling(XFER_ELEMENT(self)->upstream);
-       }
-
-       return PRODUCER_FINISHED;
+    if (!device_write_block(self->device, size, data)) {
+       xfer_cancel_with_error(elt, "%s: %s",
+               self->device->device_name, device_error_or_status(self->device));
+       wait_until_xfer_cancelled(elt->xfer);
+       return FALSE;
     }
 
-    buf = xfer_element_pull_buffer(XFER_ELEMENT(self)->upstream, &size);
-    if (!buf) {
-       return PRODUCER_FINISHED;
+    /* check for LEOM */
+    if (self->cancel_at_leom && self->device->is_eom) {
+       xfer_cancel_with_error(elt, "%s: LEOM detected", self->device->device_name);
+       wait_until_xfer_cancelled(elt->xfer);
+       return FALSE;
     }
 
-    /* queueing recycles allocated buffers back to us, but we don't need them.. */
-    amfree(buffer->data);
-    buffer->data = buf;
-    buffer->alloc_size = buffer->data_size = size;
-    buffer->offset = 0;
-
-    return PRODUCER_MORE;
+    return TRUE;
 }
 
-static gpointer
-queueing_thread(
-    gpointer data)
+static void
+push_buffer_impl(
+    XferElement *elt,
+    gpointer buf,
+    size_t len)
 {
-    XferDestDevice *self = (XferDestDevice *)data;
-    XferElement *elt = (XferElement *)self;
-    queue_result_flags result;
-    GValue val;
-    StreamingRequirement streaming_mode;
-    size_t block_size;
-    size_t max_memory;
-
-    /* Get the device's parameters */
-    bzero(&val, sizeof(val));
-    if (!device_property_get(self->device, PROPERTY_STREAMING, &val)
-       || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) {
-       g_warning("XferDestDevice Couldn't get streaming type for %s", self->device->device_name);
-       streaming_mode = STREAMING_REQUIREMENT_REQUIRED;
-    } else {
-       streaming_mode = g_value_get_enum(&val);
-    }
+    XferDestDevice *self = XFER_DEST_DEVICE(elt);
+    gpointer to_free = buf;
 
-    block_size = self->device->block_size;
+    /* Handle EOF */
+    if (!buf) {
+       /* write out the partial buffer, if there's anything in it */
+       if (self->partial_length) {
+           if (!do_block(self, self->block_size, self->partial)) {
+               return;
+           }
+           self->partial_length = 0;
+       }
 
-    max_memory = self->max_memory || DEFAULT_MAX_BUFFER_MEMORY;
+       device_finish_file(self->device);
+       return;
+    }
 
-    /* this thread creates two other threads (consumer and producer) and
-     * blocks waiting for them to finish.  TODO: when taper no longer uses
-     * queueing, merge the queueing functionality here */
-    result =
-        do_consumer_producer_queue_full(pull_buffer_producer, data,
-                                        device_write_consumer, self->device,
-                                        block_size, max_memory,
-                                        streaming_mode);
+    /* set up the block buffer, now that we can depend on having a blocksize
+     * from the device */
+    if (!self->partial) {
+       self->partial = g_malloc(self->device->block_size);
+       self->block_size = self->device->block_size;
+       self->partial_length = 0;
+    }
 
-    /* finish the file explicitly */
-    if (!(self->device->status & DEVICE_STATUS_DEVICE_ERROR))
-       device_finish_file(self->device);
+    /* if we already have data in the buffer, add the new data to it */
+    if (self->partial_length != 0) {
+       gsize to_copy = min(self->block_size - self->partial_length, len);
+       memmove(self->partial + self->partial_length, buf, to_copy);
+       buf = (gpointer)(to_copy + (char *)buf);
+       len -= to_copy;
+       self->partial_length += to_copy;
+    }
+
+    /* and if the buffer is now full, write the block */
+    if (self->partial_length == self->block_size) {
+       if (!do_block(self, self->block_size, self->partial)) {
+           g_free(to_free);
+           return;
+       }
+       self->partial_length = 0;
+    }
 
-    if (result != QUEUE_SUCCESS) {
-       /* note that our producer never returns an error */
-
-       if ((result & QUEUE_CONSUMER_ERROR)
-               && (self->device->status != DEVICE_STATUS_SUCCESS)) {
-           xfer_cancel_with_error(elt, "%s: %s",
-                   self->device->device_name, device_error_or_status(self->device));
-           wait_until_xfer_cancelled(elt->xfer);
-       } else {
-           xfer_cancel_with_error(elt, _("%s: internal error"),
-                   xfer_element_repr(elt));
-           wait_until_xfer_cancelled(elt->xfer);
+    /* write any whole blocks directly from the push buffer */
+    while (len >= self->block_size) {
+       if (!do_block(self, self->block_size, buf)) {
+           g_free(to_free);
+           return;
        }
 
-       /* and drain our upstream, since the queueing loop is done */
-       if (elt->expect_eof)
-           xfer_element_drain_by_pulling(elt->upstream);
+       buf = (gpointer)(self->block_size + (char *)buf);
+       len -= self->block_size;
     }
 
-    xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
+    /* and finally store any leftover data in the partial buffer */
+    if (len) {
+       memmove(self->partial, buf, len);
+       self->partial_length = len;
+    }
 
-    return NULL;
+    g_free(to_free);
 }
 
-static gboolean
-start_impl(
+static void
+instance_init(
     XferElement *elt)
 {
-    XferDestDevice *self = (XferDestDevice *)elt;
-    self->thread = g_thread_create(queueing_thread, (gpointer)self, FALSE, NULL);
-    return TRUE;
+    XferDestDevice *self = XFER_DEST_DEVICE(elt);
+    self->partial = NULL;
 }
 
 static void
-instance_init(
-    XferElement *elt)
+finalize_impl(
+    GObject * obj_self)
 {
-    elt->can_generate_eof = TRUE;
+    XferDestDevice *self = XFER_DEST_DEVICE(obj_self);
+
+    if (self->partial) {
+       g_free(self->partial);
+    }
 }
 
 static void
@@ -186,16 +188,19 @@ class_init(
     XferDestDeviceClass * selfc)
 {
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
+    GObjectClass *goc = (GObjectClass*) klass;
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_PULL_BUFFER, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, 0, 0},
        { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
     };
 
-    klass->start = start_impl;
+    klass->push_buffer = push_buffer_impl;
 
     klass->perl_class = "Amanda::Xfer::Dest::Device";
     klass->mech_pairs = mech_pairs;
 
+    goc->finalize = finalize_impl;
+
     parent_class = g_type_class_peek_parent(selfc);
 }
 
@@ -228,7 +233,7 @@ xfer_dest_device_get_type (void)
 XferElement *
 xfer_dest_device(
     Device *device,
-    size_t max_memory)
+    gboolean cancel_at_leom)
 {
     XferDestDevice *self = (XferDestDevice *)g_object_new(XFER_DEST_DEVICE_TYPE, NULL);
     XferElement *elt = XFER_ELEMENT(self);
@@ -236,7 +241,7 @@ xfer_dest_device(
     g_assert(device != NULL);
 
     self->device = device;
-    self->max_memory = max_memory;
+    self->cancel_at_leom = cancel_at_leom;
 
     return elt;
 }
diff --git a/device-src/xfer-dest-taper-cacher.c b/device-src/xfer-dest-taper-cacher.c
new file mode 100644 (file)
index 0000000..99b91d4
--- /dev/null
@@ -0,0 +1,1518 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * 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
+ *
+ * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include "amanda.h"
+#include "amxfer.h"
+#include "xfer-device.h"
+#include "arglist.h"
+#include "conffile.h"
+
+/* A transfer destination that writes an entire dumpfile to one or more files
+ * on one or more devices, caching each part so that it can be rewritten on a
+ * subsequent volume in the event of an unexpected EOM.   This is designed to
+ * work in concert with Amanda::Taper::Scribe. */
+
+/* Future Plans:
+ * - capture EOF early enough to avoid wasting a tape when the part size is an even multiple of the volume size - maybe reader thread can just go back and tag previous slab with EOF in that case?
+ * - use mmap to make the disk-cacher thread unnecessary, if supported, by simply mapping slabs into the disk cache file
+ * - can we find a way to fall back to mem_cache when the disk cache gets ENOSPC? Does it even make sense to try, since this would change the part size?
+ * - distinguish some permanent device errors and do not retry the part? (this will be a change of behavior)
+ */
+
+/*
+ * Slabs
+ *
+ * Slabs are larger than blocks, and are the unit on which the element
+ * operates.  They are designed to be a few times larger than a block, to
+ * achieve a corresponding reduction in the number of locks and unlocks used
+ * per block, and similar reduction in the the amount of memory overhead
+ * required.
+ */
+
+typedef struct Slab {
+    struct Slab *next;
+
+    /* counts incoming pointers: the preceding slab's 'next' pointer, and pointers
+     * from any processes operating on the slab */
+    gint refcount;
+
+    /* number of this slab in the sequence, global to this element's lifetime.
+     * Since this counts slabs, which are about 1M, this can address 16
+     * yottabytes of data before wrapping. */
+    guint64 serial;
+
+    /* slab size; this is only less than the element's slab size if the
+     * transfer is at EOF. */
+    gsize size;
+
+    /* base of the slab_size buffer */
+    gpointer base;
+} Slab;
+
+/*
+ * Xfer Dest Taper
+ */
+
+static GObjectClass *parent_class = NULL;
+
+typedef struct XferDestTaperCacher {
+    XferDestTaper __parent__;
+
+    /* object parameters
+     *
+     * These values are supplied to the constructor, and can be assumed
+     * constant for the lifetime of the element.
+     */
+
+    /* maximum buffer space to use for streaming; this is unrelated to the
+     * fallback_splitsize */
+    gsize max_memory;
+
+    /* split buffering info; if we're doing memory buffering, use_mem_cache is
+     * true; if we're doing disk buffering, disk_cache_dirname is non-NULL and
+     * contains the (allocated) filename of the cache file.  In any
+     * case, part_size gives the desired part size.  If part_size is zero, then
+     * no splitting takes place (so part_size is effectively infinite). */
+    gboolean use_mem_cache;
+    char *disk_cache_dirname;
+    guint64 part_size; /* (bytes) */
+
+    /*
+     * threads
+     */
+
+    /* The thread doing the actual writes to tape; this also handles buffering
+     * for streaming */
+    GThread *device_thread;
+
+    /* The thread writing slabs to the disk cache, if any */
+    GThread *disk_cache_thread;
+
+    /* slab train
+     *
+     * All in-memory data is contained in a linked list called the "slab
+     * train".  Various components are operating simultaneously at different
+     * points in this train.  Data from the upstream XferElement is appended to
+     * the head of the train, and the device thread follows along behind,
+     * writing data to the device.  When caching parts in memory, the slab
+     * train just grows to eventually contain the whole part.  When using an
+     * on-disk cache, the disk cache thread writes the tail of the train to
+     * disk, freeing slabs to be re-used at the head of the train.  Some
+     * careful coordination of these components allows them to operate as
+     * independently as possible within the limits of the user's configuration.
+     *
+     * Slabs are rarely, if ever, freed: the oldest_slab reference generally
+     * ensures that all slabs have refcount > 0, and this pointer is only
+     * advanced when re-using slabs that have been flushed to the disk cache or
+     * when freeing slabs after completion of the transfer. */
+
+    /* pointers into the slab train are all protected by this mutex.  Note that
+     * the slabs themselves can be manipulated without this lock; it's only
+     * when changing the pointers that the mutex must be held.  Furthermore, a
+     * foo_slab variable which is not NULL will not be changed except by its
+     * controlling thread (disk_cacher_slab is controlled by disk_cache_thread,
+     * and device_slab is controlled by device_thread).  This means that a
+     * controlling thread can drop the slab_mutex once it has ensured its slab
+     * is non-NULL.
+     *
+     * Slab_cond is notified when a new slab is made available from the reader.
+     * Slab_free_cond is notified when a slab becomes available for
+     * reallocation.
+     *
+     * Any thread waiting on either condition variable should also check
+     * elt->cancelled, and act appropriately if awakened in a cancelled state.
+     */
+    GMutex *slab_mutex; GCond *slab_cond; GCond *slab_free_cond;
+
+    /* slabs in progress by each thread, or NULL if the thread is waiting on
+     * slab_cond.  These can only be changed by their respective threads, except
+     * when they are NULL (in which case the reader will point them to a new
+     * slab and signal the slab_cond). */
+    Slab *volatile disk_cacher_slab;
+    Slab *volatile mem_cache_slab;
+    Slab *volatile device_slab;
+
+    /* tail and head of the slab train */
+    Slab *volatile oldest_slab;
+    Slab *volatile newest_slab;
+
+    /* thread-specific information
+     *
+     * These values are only used by one thread, and thus are not
+     * subject to any locking or concurrency constraints.
+     */
+
+    /* slab in progress by the reader (not in the slab train) */
+    Slab *reader_slab;
+
+    /* the serial to be assigned to reader_slab */
+    guint64 next_serial;
+
+    /* bytes written to the device in this part */
+    guint64 bytes_written;
+
+    /* bytes written to the device in the current slab */
+    guint64 slab_bytes_written;
+
+    /* element state
+     *
+     * "state" includes all of the variables below (including device
+     * parameters).  Note that the device_thread reads state values when
+     * paused is false without locking the mutex.  No other thread should
+     * change state when the element is not paused.
+     *
+     * If there is every any reason to lock both mutexes, acquire this one
+     * first.
+     *
+     * Any thread waiting on this condition variable should also check
+     * elt->cancelled, and act appropriately if awakened in a cancelled state.
+     */
+    GMutex *state_mutex;
+    GCond *state_cond;
+    volatile gboolean paused;
+
+    /* The device to write to, and the header to write to it */
+    Device *volatile device;
+    dumpfile_t *volatile part_header;
+
+    /* If true, when unpaused, the device should begin at the beginning of the
+     * cache; if false, it should proceed to the next part. */
+    volatile gboolean retry_part;
+
+    /* If true, the previous part was completed successfully; only used for
+     * assertions */
+    volatile gboolean last_part_successful;
+
+    /* part number in progress */
+    volatile guint64 partnum;
+
+    /* if true, the main thread should *not* call start_part */
+    volatile gboolean no_more_parts;
+
+    /* the first serial in this part, and the serial to stop at */
+    volatile guint64 part_first_serial, part_stop_serial;
+
+    /* read and write file descriptors for the disk cache file, in use by the
+     * disk_cache_thread.  If these are -1, wait on state_cond until they are
+     * not; once the value is set, it will not change. */
+    volatile int disk_cache_read_fd;
+    volatile int disk_cache_write_fd;
+
+    /* device parameters
+     *
+     * Note that these values aren't known until we begin writing to the
+     * device; if block_size is zero, threads should block on state_cond until
+     * it is nonzero, at which point all of the dependent fields will have
+     * their correct values.  Note that, since this value never changes after
+     * it has been set, it is safe to read block_size without acquiring the
+     * mutext first. */
+
+    /* this device's need for streaming */
+    StreamingRequirement streaming;
+
+    /* block size expected by the target device */
+    gsize block_size;
+
+    /* Size of a slab - some multiple of the block size */
+    gsize slab_size;
+
+    /* maximum number of slabs allowed, rounded up to the next whole slab.  If
+     * using mem cache, this is the equivalent of part_size bytes; otherwise,
+     * it is equivalent to max_memory bytes. */
+    guint64 max_slabs;
+
+    /* number of slabs in a part */
+    guint64 slabs_per_part;
+} XferDestTaperCacher;
+
+static GType xfer_dest_taper_cacher_get_type(void);
+#define XFER_DEST_TAPER_CACHER_TYPE (xfer_dest_taper_cacher_get_type())
+#define XFER_DEST_TAPER_CACHER(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_cacher_get_type(), XferDestTaperCacher)
+#define XFER_DEST_TAPER_CACHER_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_cacher_get_type(), XferDestTaperCacher const)
+#define XFER_DEST_TAPER_CACHER_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_taper_cacher_get_type(), XferDestTaperCacherClass)
+#define IS_XFER_DEST_TAPER_CACHER(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_taper_cacher_get_type ())
+#define XFER_DEST_TAPER_CACHER_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_taper_cacher_get_type(), XferDestTaperCacherClass)
+
+typedef struct {
+    XferDestTaperClass __parent__;
+
+} XferDestTaperCacherClass;
+
+/*
+ * Debug logging
+ */
+
+#define DBG(LEVEL, ...) if (debug_taper >= LEVEL) { _xdt_dbg(__VA_ARGS__); }
+static void
+_xdt_dbg(const char *fmt, ...)
+{
+    va_list argp;
+    char msg[1024];
+
+    arglist_start(argp, fmt);
+    g_vsnprintf(msg, sizeof(msg), fmt, argp);
+    arglist_end(argp);
+    g_debug("XDT thd-%p: %s", g_thread_self(), msg);
+}
+
+/*
+ * Slab handling
+ */
+
+/* called with the slab_mutex held, this gets a new slab to write into, with
+ * refcount 1.  It will block if max_memory slabs are already in use, and mem
+ * caching is not in use, although allocation may be forced with the 'force'
+ * parameter.
+ *
+ * If the memory allocation cannot be satisfied due to system constraints,
+ * this function will send an XMSG_ERROR, wait for the transfer to cancel, and
+ * return NULL.  If the transfer is cancelled by some other means while this
+ * function is blocked awaiting a free slab, it will return NULL.
+ *
+ * @param self: the xfer element
+ * @param force: allocate a slab even if it would exceed max_memory
+ * @returns: a new slab, or NULL if the xfer is cancelled
+ */
+static Slab *
+alloc_slab(
+    XferDestTaperCacher *self,
+    gboolean force)
+{
+    XferElement *elt = XFER_ELEMENT(self);
+    Slab *rv;
+
+    DBG(8, "alloc_slab(force=%d)", force);
+    if (!force) {
+       /* throttle based on maximum number of extant slabs */
+       while (G_UNLIKELY(
+            !elt->cancelled &&
+           self->oldest_slab &&
+           self->newest_slab &&
+           self->oldest_slab->refcount > 1 &&
+           (self->newest_slab->serial - self->oldest_slab->serial + 1) >= self->max_slabs)) {
+           DBG(9, "waiting for available slab");
+           g_cond_wait(self->slab_free_cond, self->slab_mutex);
+       }
+       DBG(9, "done waiting");
+
+        if (elt->cancelled)
+            return NULL;
+    }
+
+    /* if the oldest slab doesn't have anything else pointing to it, just use
+     * that */
+    if (self->oldest_slab && self->oldest_slab->refcount == 1) {
+       rv = self->oldest_slab;
+       self->oldest_slab = rv->next;
+    } else {
+       rv = g_new0(Slab, 1);
+       rv->refcount = 1;
+       rv->base = g_try_malloc(self->slab_size);
+       if (!rv->base) {
+           g_free(rv);
+           xfer_cancel_with_error(XFER_ELEMENT(self),
+               _("Could not allocate %zu bytes of memory"), self->slab_size);
+           return NULL;
+       }
+    }
+
+    rv->next = NULL;
+    rv->size = 0;
+    return rv;
+}
+
+/* called with the slab_mutex held, this frees the given slave entirely.  The
+ * reference count is not consulted.
+ *
+ * @param slab: slab to free
+ */
+static void
+free_slab(
+    Slab *slab)
+{
+    if (slab) {
+       if (slab->base)
+           g_free(slab->base);
+       g_free(slab);
+    }
+}
+
+/* called with the slab_mutex held, this decrements the refcount of the
+ * given slab
+ *
+ * @param self: xfer element
+ * @param slab: slab to free
+ */
+static inline void
+unref_slab(
+    XferDestTaperCacher *self,
+    Slab *slab)
+{
+    g_assert(slab->refcount > 1);
+    slab->refcount--;
+    if (G_UNLIKELY(slab->refcount == 1 && slab == self->oldest_slab)) {
+       g_cond_broadcast(self->slab_free_cond);
+    } else if (G_UNLIKELY(slab->refcount == 0)) {
+       free_slab(slab);
+    }
+}
+
+/* called with the slab_mutex held, this sets *slabp to *slabp->next,
+ * adjusting refcounts appropriately, and returns the new value
+ *
+ * @param self: xfer element
+ * @param slabp: slab pointer to advance
+ * @returns: new value of *slabp
+ */
+static inline Slab *
+next_slab(
+    XferDestTaperCacher *self,
+    Slab * volatile *slabp)
+{
+    Slab *next;
+
+    if (!slabp || !*slabp)
+       return NULL;
+
+    next = (*slabp)->next;
+    if (next)
+       next->refcount++;
+    if (*slabp)
+       unref_slab(self, *slabp);
+    *slabp = next;
+
+    return next;
+}
+
+/*
+ * Disk Cache
+ *
+ * The disk cache thread's job is simply to follow along the slab train at
+ * maximum speed, writing slabs to the disk cache file. */
+
+static gboolean
+open_disk_cache_fds(
+    XferDestTaperCacher *self)
+{
+    char * filename;
+
+    g_assert(self->disk_cache_read_fd == -1);
+    g_assert(self->disk_cache_write_fd == -1);
+
+    g_mutex_lock(self->state_mutex);
+    filename = g_strdup_printf("%s/amanda-split-buffer-XXXXXX",
+                               self->disk_cache_dirname);
+
+    self->disk_cache_write_fd = g_mkstemp(filename);
+    if (self->disk_cache_write_fd < 0) {
+       g_mutex_unlock(self->state_mutex);
+       xfer_cancel_with_error(XFER_ELEMENT(self),
+           _("Error creating cache file in '%s': %s"), self->disk_cache_dirname,
+           strerror(errno));
+       g_free(filename);
+       return FALSE;
+    }
+
+    /* open a separate copy of the file for reading */
+    self->disk_cache_read_fd = open(filename, O_RDONLY);
+    if (self->disk_cache_read_fd < 0) {
+       g_mutex_unlock(self->state_mutex);
+       xfer_cancel_with_error(XFER_ELEMENT(self),
+           _("Error opening cache file in '%s': %s"), self->disk_cache_dirname,
+           strerror(errno));
+       g_free(filename);
+       return FALSE;
+    }
+
+    /* signal anyone waiting for this value */
+    g_cond_broadcast(self->state_cond);
+    g_mutex_unlock(self->state_mutex);
+
+    /* errors from unlink are not fatal */
+    if (unlink(filename) < 0) {
+       g_warning("While unlinking '%s': %s (ignored)", filename, strerror(errno));
+    }
+
+    g_free(filename);
+    return TRUE;
+}
+
+static gpointer
+disk_cache_thread(
+    gpointer data)
+{
+    XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(data);
+    XferElement *elt = XFER_ELEMENT(self);
+
+    DBG(1, "(this is the disk cache thread)");
+
+    /* open up the disk cache file first */
+    if (!open_disk_cache_fds(self))
+       return NULL;
+
+    while (!elt->cancelled) {
+       gboolean eof, eop;
+       guint64 stop_serial;
+       Slab *slab;
+
+       /* rewind to the begining of the disk cache file */
+       if (lseek(self->disk_cache_write_fd, 0, SEEK_SET) == -1) {
+           xfer_cancel_with_error(XFER_ELEMENT(self),
+               _("Error seeking disk cache file in '%s': %s"), self->disk_cache_dirname,
+               strerror(errno));
+           return NULL;
+       }
+
+       /* we need to sit and wait for the next part to begin, first making sure
+        * we have a slab .. */
+       g_mutex_lock(self->slab_mutex);
+       while (!self->disk_cacher_slab && !elt->cancelled) {
+           DBG(9, "waiting for a disk slab");
+           g_cond_wait(self->slab_cond, self->slab_mutex);
+       }
+       DBG(9, "done waiting");
+       g_mutex_unlock(self->slab_mutex);
+
+       if (elt->cancelled)
+           break;
+
+       /* this slab is now fixed until this thread changes it */
+       g_assert(self->disk_cacher_slab != NULL);
+
+       /* and then making sure we're ready to write that slab. */
+       g_mutex_lock(self->state_mutex);
+        while ((self->paused ||
+                   (self->disk_cacher_slab && self->disk_cacher_slab->serial > self->part_first_serial))
+               && !elt->cancelled) {
+            DBG(9, "waiting for the disk slab to become current and un-paused");
+            g_cond_wait(self->state_cond, self->state_mutex);
+        }
+       DBG(9, "done waiting");
+
+       stop_serial = self->part_stop_serial;
+       g_mutex_unlock(self->state_mutex);
+
+       if (elt->cancelled)
+           break;
+
+       g_mutex_lock(self->slab_mutex);
+       slab = self->disk_cacher_slab;
+       eop = eof = FALSE;
+       while (!eop && !eof) {
+           /* if we're at the head of the slab train, wait for more data */
+           while (!self->disk_cacher_slab && !elt->cancelled) {
+               DBG(9, "waiting for the next disk slab");
+               g_cond_wait(self->slab_cond, self->slab_mutex);
+           }
+           DBG(9, "done waiting");
+
+            if (elt->cancelled)
+                break;
+
+           /* drop the lock long enough to write the slab; the refcount
+            * protects the slab during this time */
+           slab = self->disk_cacher_slab;
+           g_mutex_unlock(self->slab_mutex);
+
+           if (full_write(self->disk_cache_write_fd, slab->base, slab->size) < slab->size) {
+               xfer_cancel_with_error(XFER_ELEMENT(self),
+                   _("Error writing to disk cache file in '%s': %s"), self->disk_cache_dirname,
+                   strerror(errno));
+               return NULL;
+           }
+
+           eof = slab->size < self->slab_size;
+           eop = (slab->serial + 1 == stop_serial);
+
+           g_mutex_lock(self->slab_mutex);
+           next_slab(self, &self->disk_cacher_slab);
+       }
+       g_mutex_unlock(self->slab_mutex);
+
+       if (eof) {
+           /* this very thread should have just set this value to NULL, and since it's
+            * EOF, there should not be any 'next' slab */
+           g_assert(self->disk_cacher_slab == NULL);
+           break;
+       }
+    }
+
+    return NULL;
+}
+
+/*
+ * Device Thread
+ *
+ * The device thread's job is to write slabs to self->device, applying whatever
+ * streaming algorithms are required.  It does this by alternately getting the
+ * next slab from a "slab source" and writing that slab to the device.  Most of
+ * the slab source functions assume that self->slab_mutex is held, but may
+ * release the mutex (either explicitly or via a g_cond_wait), so it is not
+ * valid to assume that any slab pointers remain unchanged after a slab_source
+ * function invocation.
+ */
+
+/* This struct tracks the current state of the slab source */
+typedef struct slab_source_state {
+    /* temporary slab used for reading from disk */
+    Slab *tmp_slab;
+
+    /* next serial to read from disk */
+    guint64 next_serial;
+} slab_source_state;
+
+/* Called with the slab_mutex held, this function pre-buffers enough data into the slab
+ * train to meet the device's streaming needs. */
+static gboolean
+slab_source_prebuffer(
+    XferDestTaperCacher *self)
+{
+    XferElement *elt = XFER_ELEMENT(self);
+    guint64 prebuffer_slabs = (self->max_memory + self->slab_size - 1) / self->slab_size;
+    guint64 i;
+    Slab *slab;
+
+    /* always prebuffer at least one slab, even if max_memory is 0 */
+    if (prebuffer_slabs == 0) prebuffer_slabs = 1;
+
+    /* pre-buffering is not necessary if we're retrying a part */
+    if (self->retry_part)
+       return TRUE;
+
+    /* pre-buffering means waiting until we have at least prebuffer_slabs in the
+     * slab train ahead of the device_slab, or the newest slab is at EOF. */
+    while (!elt->cancelled) {
+       gboolean eof_or_eop = FALSE;
+
+       /* see if there's enough data yet */
+       for (i = 0, slab = self->device_slab;
+            i < prebuffer_slabs && slab != NULL;
+            i++, slab = slab->next) {
+           eof_or_eop = (slab->size < self->slab_size)
+               || (slab->serial + 1 == self->part_stop_serial);
+       }
+       if (i == prebuffer_slabs || eof_or_eop)
+           break;
+
+       DBG(9, "prebuffering wait");
+       g_cond_wait(self->slab_cond, self->slab_mutex);
+    }
+    DBG(9, "done waiting");
+
+    if (elt->cancelled) {
+       self->last_part_successful = FALSE;
+       self->no_more_parts = TRUE;
+       return FALSE;
+    }
+
+    return TRUE;
+}
+
+/* Called without the slab_mutex held, this function sets up a new slab_source_state
+ * object based on the configuratino of the Xfer Element. */
+static inline gboolean
+slab_source_setup(
+    XferDestTaperCacher *self,
+    slab_source_state *state)
+{
+    XferElement *elt = XFER_ELEMENT(self);
+    state->tmp_slab = NULL;
+    state->next_serial = G_MAXUINT64;
+
+    /* if we're to retry the part, rewind to the beginning */
+    if (self->retry_part) {
+       if (self->use_mem_cache) {
+           /* rewind device_slab to point to the mem_cache_slab */
+           g_mutex_lock(self->slab_mutex);
+           if (self->device_slab)
+               unref_slab(self, self->device_slab);
+           self->device_slab = self->mem_cache_slab;
+           if(self->device_slab != NULL)
+               self->device_slab->refcount++;
+           g_mutex_unlock(self->slab_mutex);
+       } else {
+           g_mutex_lock(self->slab_mutex);
+
+           /* we're going to read from the disk cache until we get to the oldest useful
+            * slab in memory, so it had best exist */
+           g_assert(self->oldest_slab != NULL);
+
+           /* point device_slab at the oldest slab we have */
+           self->oldest_slab->refcount++;
+           if (self->device_slab)
+               unref_slab(self, self->device_slab);
+           self->device_slab = self->oldest_slab;
+
+           /* and increment it until it is at least the slab we want to start from */
+           while (self->device_slab->serial < self->part_first_serial) {
+               next_slab(self, &self->device_slab);
+           }
+
+           /* get a new, temporary slab for use while reading */
+           state->tmp_slab = alloc_slab(self, TRUE);
+
+           g_mutex_unlock(self->slab_mutex);
+
+           if (!state->tmp_slab) {
+                /* if we couldn't allocate a slab, then we're cancelled, so we're done with
+                 * this part. */
+               self->last_part_successful = FALSE;
+               self->no_more_parts = TRUE;
+               return FALSE;
+           }
+
+           state->tmp_slab->size = self->slab_size;
+           state->next_serial = self->part_first_serial;
+
+           /* We're reading from the disk cache, so we need a file descriptor
+            * to read from, so wait for disk_cache_thread to open the
+            * disk_cache_read_fd */
+           g_assert(self->disk_cache_dirname);
+           g_mutex_lock(self->state_mutex);
+           while (self->disk_cache_read_fd == -1 && !elt->cancelled) {
+               DBG(9, "waiting for disk_cache_thread to set disk_cache_read_fd");
+               g_cond_wait(self->state_cond, self->state_mutex);
+           }
+           DBG(9, "done waiting");
+           g_mutex_unlock(self->state_mutex);
+
+           if (elt->cancelled) {
+               self->last_part_successful = FALSE;
+               self->no_more_parts = TRUE;
+               return FALSE;
+           }
+
+           /* rewind to the beginning */
+           if (lseek(self->disk_cache_read_fd, 0, SEEK_SET) == -1) {
+               xfer_cancel_with_error(XFER_ELEMENT(self),
+                   _("Could not seek disk cache file for reading: %s"),
+                   strerror(errno));
+               self->last_part_successful = FALSE;
+               self->no_more_parts = TRUE;
+               return FALSE;
+           }
+       }
+    }
+
+    /* if the streaming mode requires it, pre-buffer */
+    if (self->streaming == STREAMING_REQUIREMENT_DESIRED ||
+       self->streaming == STREAMING_REQUIREMENT_REQUIRED) {
+       gboolean prebuffer_ok;
+
+       g_mutex_lock(self->slab_mutex);
+       prebuffer_ok = slab_source_prebuffer(self);
+       g_mutex_unlock(self->slab_mutex);
+       if (!prebuffer_ok)
+           return FALSE;
+    }
+
+    return TRUE;
+}
+
+/* Called with the slab_mutex held, this does the work of slab_source_get when
+ * reading from the disk cache.  Note that this explicitly releases the
+ * slab_mutex during execution - do not depend on any protected values across a
+ * call to this function.  The mutex is held on return. */
+static Slab *
+slab_source_get_from_disk(
+    XferDestTaperCacher *self,
+    slab_source_state *state,
+    guint64 serial)
+{
+    XferDestTaper *xdt = XFER_DEST_TAPER(self);
+    gsize bytes_read;
+
+    g_assert(state->next_serial == serial);
+
+    /* NOTE: slab_mutex is held, but we don't need it here, so release it for the moment */
+    g_mutex_unlock(self->slab_mutex);
+
+    bytes_read = full_read(self->disk_cache_read_fd,
+                          state->tmp_slab->base,
+                          self->slab_size);
+    if ((gsize)bytes_read < self->slab_size) {
+       xfer_cancel_with_error(XFER_ELEMENT(xdt),
+           _("Error reading disk cache: %s"),
+           errno? strerror(errno) : _("Unexpected EOF"));
+       goto fatal_error;
+    }
+
+    state->tmp_slab->serial = state->next_serial++;
+    g_mutex_lock(self->slab_mutex);
+    return state->tmp_slab;
+
+fatal_error:
+    g_mutex_lock(self->slab_mutex);
+    self->last_part_successful = FALSE;
+    self->no_more_parts = TRUE;
+    return NULL;
+}
+
+/* Called with the slab_mutex held, this function gets the slab with the given
+ * serial number, waiting if necessary for that slab to be available.  Note
+ * that the slab_mutex may be released during execution, although it is always
+ * held on return. */
+static inline Slab *
+slab_source_get(
+    XferDestTaperCacher *self,
+    slab_source_state *state,
+    guint64 serial)
+{
+    XferElement *elt = (XferElement *)self;
+
+    /* device_slab is only NULL if we're following the slab train, so wait for
+     * a new slab */
+    if (!self->device_slab) {
+       /* if the streaming mode requires it, pre-buffer */
+       if (self->streaming == STREAMING_REQUIREMENT_DESIRED) {
+           if (!slab_source_prebuffer(self))
+               return NULL;
+
+           /* fall through to make sure we have a device_slab;
+            * slab_source_prebuffer doesn't guarantee device_slab != NULL */
+       }
+
+       while (self->device_slab == NULL && !elt->cancelled) {
+           DBG(9, "waiting for the next slab");
+           g_cond_wait(self->slab_cond, self->slab_mutex);
+       }
+       DBG(9, "done waiting");
+
+       if (elt->cancelled)
+           goto fatal_error;
+    }
+
+    /* device slab is now set, and only this thread can change it */
+    g_assert(self->device_slab);
+
+    /* if the next item in the device slab is the one we want, then the job is
+     * pretty easy */
+    if (G_LIKELY(serial == self->device_slab->serial))
+       return self->device_slab;
+
+    /* otherwise, we're reading from disk */
+    g_assert(serial < self->device_slab->serial);
+    return slab_source_get_from_disk(self, state, serial);
+
+fatal_error:
+    self->last_part_successful = FALSE;
+    self->no_more_parts = TRUE;
+    return NULL;
+}
+
+/* Called without the slab_mutex held, this frees any resources assigned
+ * to the slab source state */
+static inline void
+slab_source_free(
+    XferDestTaperCacher *self,
+    slab_source_state *state)
+{
+    if (state->tmp_slab) {
+       g_mutex_lock(self->slab_mutex);
+       free_slab(state->tmp_slab);
+       g_mutex_unlock(self->slab_mutex);
+    }
+}
+
+/* Called without the slab_mutex, this writes the given slab to the device */
+static gboolean
+write_slab_to_device(
+    XferDestTaperCacher *self,
+    Slab *slab)
+{
+    XferElement *elt = XFER_ELEMENT(self);
+    gpointer buf = slab->base;
+    gsize remaining = slab->size;
+
+    while (remaining && !elt->cancelled) {
+       gsize write_size = MIN(self->block_size, remaining);
+       gboolean ok;
+       ok = device_write_block(self->device, write_size, buf);
+       if (!ok) {
+            self->bytes_written += slab->size - remaining;
+
+            /* TODO: handle an error without is_eom
+             * differently/fatally? or at least with a warning? */
+           self->last_part_successful = FALSE;
+           self->no_more_parts = FALSE;
+           return FALSE;
+       }
+
+       buf += write_size;
+       self->slab_bytes_written += write_size;
+       remaining -= write_size;
+    }
+
+    if (elt->cancelled) {
+       self->last_part_successful = FALSE;
+       self->no_more_parts = TRUE;
+        return FALSE;
+    }
+
+    self->bytes_written += slab->size;
+    self->slab_bytes_written = 0;
+    return TRUE;
+}
+
+static XMsg *
+device_thread_write_part(
+    XferDestTaperCacher *self)
+{
+    GTimer *timer = g_timer_new();
+    XMsg *msg;
+    slab_source_state src_state;
+    guint64 serial, stop_serial;
+    gboolean eof = FALSE;
+    int fileno = 0;
+
+    self->last_part_successful = FALSE;
+    self->bytes_written = 0;
+
+    if (!device_start_file(self->device, self->part_header))
+       goto part_done;
+
+    dumpfile_free(self->part_header);
+    self->part_header = NULL;
+
+    fileno = self->device->file;
+    g_assert(fileno > 0);
+
+    if (!slab_source_setup(self, &src_state))
+       goto part_done;
+
+    g_timer_start(timer);
+
+    stop_serial = self->part_stop_serial;
+    g_mutex_lock(self->slab_mutex);
+    for (serial = self->part_first_serial; serial < stop_serial && !eof; serial++) {
+       Slab *slab = slab_source_get(self, &src_state, serial);
+       DBG(8, "writing slab %p (serial %ju) to device", slab, serial);
+       g_mutex_unlock(self->slab_mutex);
+       if (!slab)
+           goto part_done;
+
+       eof = slab->size < self->slab_size;
+
+       if (!write_slab_to_device(self, slab))
+           goto part_done;
+
+       g_mutex_lock(self->slab_mutex);
+       DBG(8, "wrote slab %p to device", slab);
+
+       /* if we're reading from the slab train, advance self->device_slab. */
+       if (slab == self->device_slab) {
+           next_slab(self, &self->device_slab);
+       }
+    }
+    g_mutex_unlock(self->slab_mutex);
+
+    /* if we write all of the blocks, but the finish_file fails, then likely
+     * there was some buffering going on in the device driver, and the blocks
+     * did not all make it to permanent storage -- so it's a failed part. */
+    if (!device_finish_file(self->device))
+       goto part_done;
+
+    slab_source_free(self, &src_state);
+
+    self->last_part_successful = TRUE;
+    self->no_more_parts = eof;
+
+part_done:
+    g_timer_stop(timer);
+
+    msg = xmsg_new(XFER_ELEMENT(self), XMSG_PART_DONE, 0);
+    msg->size = self->bytes_written;
+    msg->duration = g_timer_elapsed(timer, NULL);
+    msg->partnum = self->partnum;
+    msg->fileno = fileno;
+    msg->successful = self->last_part_successful;
+    msg->eom = !self->last_part_successful;
+    msg->eof = self->no_more_parts;
+
+    /* time runs backward on some test boxes, so make sure this is positive */
+    if (msg->duration < 0) msg->duration = 0;
+
+    if (self->last_part_successful)
+       self->partnum++;
+
+    g_timer_destroy(timer);
+
+    return msg;
+}
+
+/* Called with the status_mutex held, this frees any cached data for
+ * a successful part */
+static void
+release_part_cache(
+    XferDestTaperCacher *self)
+{
+    if (self->use_mem_cache && self->mem_cache_slab) {
+       /* move up the mem_cache_slab to point to the first slab in
+        * the next part (probably NULL at this point), so that the
+        * reader can continue reading data into the new mem cache
+        * immediately. */
+       g_mutex_lock(self->slab_mutex);
+       unref_slab(self, self->mem_cache_slab);
+       self->mem_cache_slab = self->device_slab;
+       if (self->mem_cache_slab)
+           self->mem_cache_slab->refcount++;
+       g_mutex_unlock(self->slab_mutex);
+    }
+
+    /* the disk cache gets reused automatically (rewinding to offset 0), so
+     * there's nothing else to do */
+}
+
+static gpointer
+device_thread(
+    gpointer data)
+{
+    XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(data);
+    XferElement *elt = XFER_ELEMENT(self);
+    XMsg *msg;
+
+    DBG(1, "(this is the device thread)");
+
+    if (self->disk_cache_dirname) {
+        GError *error = NULL;
+       self->disk_cache_thread = g_thread_create(disk_cache_thread, (gpointer)self, TRUE, &error);
+        if (!self->disk_cache_thread) {
+            g_critical(_("Error creating new thread: %s (%s)"),
+                error->message, errno? strerror(errno) : _("no error code"));
+        }
+    }
+
+    /* This is the outer loop, that loops once for each split part written to
+     * tape. */
+    g_mutex_lock(self->state_mutex);
+    while (1) {
+       /* wait until the main thread un-pauses us, and check that we have
+        * the relevant device info available (block_size) */
+       while (self->paused && !elt->cancelled) {
+           DBG(9, "waiting to be unpaused");
+           g_cond_wait(self->state_cond, self->state_mutex);
+       }
+       DBG(9, "done waiting");
+
+        if (elt->cancelled)
+           break;
+
+        g_mutex_unlock(self->state_mutex);
+       self->slab_bytes_written = 0;
+       DBG(2, "beginning to write part");
+       msg = device_thread_write_part(self);
+       DBG(2, "done writing part");
+        g_mutex_lock(self->state_mutex);
+
+       /* release any cache of a successful part, but don't bother at EOF */
+       if (msg->successful && !msg->eof)
+           release_part_cache(self);
+
+       xfer_queue_message(elt->xfer, msg);
+
+       /* if this is the last part, we're done with the part loop */
+       if (self->no_more_parts)
+           break;
+
+       /* pause ourselves and await instructions from the main thread */
+       self->paused = TRUE;
+    }
+
+    g_mutex_unlock(self->state_mutex);
+
+    /* make sure the other thread is done before we send XMSG_DONE */
+    if (self->disk_cache_thread)
+        g_thread_join(self->disk_cache_thread);
+
+    /* tell the main thread we're done */
+    xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
+
+    return NULL;
+}
+
+/*
+ * Class mechanics
+ */
+
+/* called with the slab_mutex held, this adds the reader_slab to the head of
+ * the slab train and signals the condition variable. */
+static void
+add_reader_slab_to_train(
+    XferDestTaperCacher *self)
+{
+    Slab *slab = self->reader_slab;
+
+    DBG(3, "adding slab of new data to the slab train");
+
+    if (self->newest_slab) {
+       self->newest_slab->next = slab;
+       slab->refcount++;
+
+       self->newest_slab->refcount--;
+    }
+
+    self->newest_slab = slab; /* steal reader_slab's ref */
+    self->reader_slab = NULL;
+
+    /* steal reader_slab's reference for newest_slab */
+
+    /* if any of the other pointers are waiting for this slab, update them */
+    if (self->disk_cache_dirname && !self->disk_cacher_slab) {
+       self->disk_cacher_slab = slab;
+       slab->refcount++;
+    }
+    if (self->use_mem_cache && !self->mem_cache_slab) {
+       self->mem_cache_slab = slab;
+       slab->refcount++;
+    }
+    if (!self->device_slab) {
+       self->device_slab = slab;
+       slab->refcount++;
+    }
+    if (!self->oldest_slab) {
+       self->oldest_slab = slab;
+       slab->refcount++;
+    }
+
+    g_cond_broadcast(self->slab_cond);
+}
+
+static void
+push_buffer_impl(
+    XferElement *elt,
+    gpointer buf,
+    size_t size)
+{
+    XferDestTaperCacher *self = (XferDestTaperCacher *)elt;
+    gpointer p;
+
+    DBG(3, "push_buffer(%p, %ju)", buf, (uintmax_t)size);
+
+    /* do nothing if cancelled */
+    if (G_UNLIKELY(elt->cancelled)) {
+        goto free_and_finish;
+    }
+
+    /* handle EOF */
+    if (G_UNLIKELY(buf == NULL)) {
+       /* send off the last, probably partial slab */
+       g_mutex_lock(self->slab_mutex);
+
+       /* create a new, empty slab if necessary */
+       if (!self->reader_slab) {
+           self->reader_slab = alloc_slab(self, FALSE);
+            if (!self->reader_slab) {
+                /* we've been cancelled while waiting for a slab */
+                g_mutex_unlock(self->slab_mutex);
+
+                /* wait for the xfer to cancel, so we don't get another buffer
+                 * pushed to us (and do so *without* the mutex held) */
+                wait_until_xfer_cancelled(XFER_ELEMENT(self)->xfer);
+
+                goto free_and_finish;
+            }
+           self->reader_slab->serial = self->next_serial++;
+       }
+
+       add_reader_slab_to_train(self);
+       g_mutex_unlock(self->slab_mutex);
+
+       goto free_and_finish;
+    }
+
+    p = buf;
+    while (1) {
+       gsize copy_size;
+
+       /* get a fresh slab, if needed */
+       if (G_UNLIKELY(!self->reader_slab) || self->reader_slab->size == self->slab_size) {
+           g_mutex_lock(self->slab_mutex);
+           if (self->reader_slab)
+               add_reader_slab_to_train(self);
+           self->reader_slab = alloc_slab(self, FALSE);
+            if (!self->reader_slab) {
+                /* we've been cancelled while waiting for a slab */
+                g_mutex_unlock(self->slab_mutex);
+
+                /* wait for the xfer to cancel, so we don't get another buffer
+                 * pushed to us (and do so *without* the mutex held) */
+                wait_until_xfer_cancelled(XFER_ELEMENT(self)->xfer);
+
+                goto free_and_finish;
+            }
+           self->reader_slab->serial = self->next_serial++;
+           g_mutex_unlock(self->slab_mutex);
+       }
+
+       if (size == 0)
+           break;
+
+       copy_size = MIN(self->slab_size - self->reader_slab->size, size);
+       memcpy(self->reader_slab->base+self->reader_slab->size, p, copy_size);
+
+       self->reader_slab->size += copy_size;
+       p += copy_size;
+       size -= copy_size;
+    }
+
+free_and_finish:
+    if (buf)
+        g_free(buf);
+}
+
+/*
+ * Element mechanics
+ */
+
+static gboolean
+start_impl(
+    XferElement *elt)
+{
+    XferDestTaperCacher *self = (XferDestTaperCacher *)elt;
+    GError *error = NULL;
+
+    self->device_thread = g_thread_create(device_thread, (gpointer)self, FALSE, &error);
+    if (!self->device_thread) {
+        g_critical(_("Error creating new thread: %s (%s)"),
+            error->message, errno? strerror(errno) : _("no error code"));
+    }
+
+    return TRUE;
+}
+
+static gboolean
+cancel_impl(
+    XferElement *elt,
+    gboolean expect_eof)
+{
+    XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(elt);
+    gboolean rv;
+
+    /* chain up first */
+    rv = XFER_ELEMENT_CLASS(parent_class)->cancel(elt, expect_eof);
+
+    /* then signal all of our condition variables, so that threads waiting on them
+     * wake up and see elt->cancelled. */
+    g_mutex_lock(self->state_mutex);
+    g_cond_broadcast(self->state_cond);
+    g_mutex_unlock(self->state_mutex);
+
+    g_mutex_lock(self->slab_mutex);
+    g_cond_broadcast(self->slab_cond);
+    g_cond_broadcast(self->slab_free_cond);
+    g_mutex_unlock(self->slab_mutex);
+
+    return rv;
+}
+
+static void
+start_part_impl(
+    XferDestTaper *xdt,
+    gboolean retry_part,
+    dumpfile_t *header)
+{
+    XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(xdt);
+
+    g_assert(self->device != NULL);
+    g_assert(!self->device->in_file);
+    g_assert(header != NULL);
+
+    DBG(1, "start_part(retry_part=%d)", retry_part);
+
+    g_mutex_lock(self->state_mutex);
+    g_assert(self->paused);
+    g_assert(!self->no_more_parts);
+
+    if (self->part_header)
+       dumpfile_free(self->part_header);
+    self->part_header = dumpfile_copy(header);
+
+    if (retry_part) {
+       g_assert(!self->last_part_successful);
+       self->retry_part = TRUE;
+    } else {
+       g_assert(self->last_part_successful);
+       self->retry_part = FALSE;
+       self->part_first_serial = self->part_stop_serial;
+       if (self->part_size != 0) {
+           self->part_stop_serial = self->part_first_serial + self->slabs_per_part;
+       } else {
+           /* set part_stop_serial to an effectively infinite value */
+           self->part_stop_serial = G_MAXUINT64;
+       }
+    }
+
+    DBG(1, "unpausing");
+    self->paused = FALSE;
+    g_cond_broadcast(self->state_cond);
+
+    g_mutex_unlock(self->state_mutex);
+}
+
+static void
+use_device_impl(
+    XferDestTaper *xdt,
+    Device *device)
+{
+    XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(xdt);
+    GValue val;
+
+    /* short-circuit if nothing is changing */
+    if (self->device == device)
+       return;
+
+    g_mutex_lock(self->state_mutex);
+    if (self->device)
+       g_object_unref(self->device);
+    self->device = device;
+    g_object_ref(device);
+
+    /* get this new device's streaming requirements */
+    bzero(&val, sizeof(val));
+    if (!device_property_get(self->device, PROPERTY_STREAMING, &val)
+        || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) {
+        g_warning("Couldn't get streaming type for %s", self->device->device_name);
+        self->streaming = STREAMING_REQUIREMENT_REQUIRED;
+    } else {
+        self->streaming = g_value_get_enum(&val);
+    }
+    g_value_unset(&val);
+
+    /* check that the blocksize hasn't changed */
+    if (self->block_size != device->block_size) {
+        g_mutex_unlock(self->state_mutex);
+        xfer_cancel_with_error(XFER_ELEMENT(self),
+            _("All devices used by the taper must have the same block size"));
+        return;
+    }
+    g_mutex_unlock(self->state_mutex);
+}
+
+static guint64
+get_part_bytes_written_impl(
+    XferDestTaper *xdt)
+{
+    XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(xdt);
+
+    /* NOTE: this access is unsafe and may return inconsistent results (e.g, a
+     * partial write to the 64-bit value on a 32-bit system).  This is ok for
+     * the moment, as it's only informational, but be warned. */
+    return self->bytes_written + self->slab_bytes_written;
+}
+
+static void
+instance_init(
+    XferElement *elt)
+{
+    XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(elt);
+    elt->can_generate_eof = FALSE;
+
+    self->state_mutex = g_mutex_new();
+    self->state_cond = g_cond_new();
+    self->slab_mutex = g_mutex_new();
+    self->slab_cond = g_cond_new();
+    self->slab_free_cond = g_cond_new();
+
+    self->last_part_successful = TRUE;
+    self->paused = TRUE;
+    self->part_stop_serial = 0;
+    self->disk_cache_read_fd = -1;
+    self->disk_cache_write_fd = -1;
+}
+
+static void
+finalize_impl(
+    GObject * obj_self)
+{
+    XferDestTaperCacher *self = XFER_DEST_TAPER_CACHER(obj_self);
+    Slab *slab, *next_slab;
+
+    if (self->disk_cache_dirname)
+       g_free(self->disk_cache_dirname);
+
+    g_mutex_free(self->state_mutex);
+    g_cond_free(self->state_cond);
+
+    g_mutex_free(self->slab_mutex);
+    g_cond_free(self->slab_cond);
+    g_cond_free(self->slab_free_cond);
+
+    /* free the slab train, without reference to the refcounts */
+    for (slab = self->oldest_slab; slab != NULL; slab = next_slab) {
+        next_slab = slab->next;
+        free_slab(slab);
+    }
+    self->disk_cacher_slab = NULL;
+    self->mem_cache_slab = NULL;
+    self->device_slab = NULL;
+    self->oldest_slab = NULL;
+    self->newest_slab = NULL;
+
+    if (self->reader_slab) {
+        free_slab(self->reader_slab);
+        self->reader_slab = NULL;
+    }
+
+    if (self->part_header)
+       dumpfile_free(self->part_header);
+
+    if (self->disk_cache_read_fd != -1)
+       close(self->disk_cache_read_fd); /* ignore error */
+    if (self->disk_cache_write_fd != -1)
+       close(self->disk_cache_write_fd); /* ignore error */
+
+    if (self->device)
+       g_object_unref(self->device);
+
+    /* chain up */
+    G_OBJECT_CLASS(parent_class)->finalize(obj_self);
+}
+
+static void
+class_init(
+    XferDestTaperCacherClass * selfc)
+{
+    XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
+    XferDestTaperClass *xdt_klass = XFER_DEST_TAPER_CLASS(selfc);
+    GObjectClass *goc = G_OBJECT_CLASS(selfc);
+    static xfer_element_mech_pair_t mech_pairs[] = {
+       { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, 1, 1},
+       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+    };
+
+    klass->start = start_impl;
+    klass->cancel = cancel_impl;
+    klass->push_buffer = push_buffer_impl;
+    xdt_klass->start_part = start_part_impl;
+    xdt_klass->use_device = use_device_impl;
+    xdt_klass->get_part_bytes_written = get_part_bytes_written_impl;
+    goc->finalize = finalize_impl;
+
+    klass->perl_class = "Amanda::Xfer::Dest::Taper::Cacher";
+    klass->mech_pairs = mech_pairs;
+
+    parent_class = g_type_class_peek_parent(selfc);
+}
+
+static GType
+xfer_dest_taper_cacher_get_type (void)
+{
+    static GType type = 0;
+
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (XferDestTaperCacherClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (XferDestTaperCacher),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) instance_init,
+            NULL
+        };
+
+        type = g_type_register_static (XFER_DEST_TAPER_TYPE, "XferDestTaperCacher", &info, 0);
+    }
+
+    return type;
+}
+
+/*
+ * Constructor
+ */
+
+XferElement *
+xfer_dest_taper_cacher(
+    Device *first_device,
+    size_t max_memory,
+    guint64 part_size,
+    gboolean use_mem_cache,
+    const char *disk_cache_dirname)
+{
+    XferDestTaperCacher *self = (XferDestTaperCacher *)g_object_new(XFER_DEST_TAPER_CACHER_TYPE, NULL);
+
+    self->max_memory = max_memory;
+    self->part_size = part_size;
+    self->partnum = 1;
+    self->device = first_device;
+    g_object_ref(self->device);
+
+    /* pick only one caching mechanism, caller! */
+    if (use_mem_cache)
+       g_assert(!disk_cache_dirname);
+    if (disk_cache_dirname)
+       g_assert(!use_mem_cache);
+
+    /* and if part size is zero, then we don't do any caching */
+    g_assert(part_size != 0 || (!use_mem_cache && !disk_cache_dirname));
+
+    self->use_mem_cache = use_mem_cache;
+    if (disk_cache_dirname)
+       self->disk_cache_dirname = g_strdup(disk_cache_dirname);
+
+    /* calculate the device-dependent parameters */
+    self->block_size = first_device->block_size;
+
+    /* The slab size should be large enough to justify the overhead of all
+     * of the mutexes, but it needs to be small enough to have a few slabs
+     * available so that the threads are not constantly waiting on one
+     * another.  The choice is sixteen blocks, not more than a quarter of
+     * the part size, and not more than 10MB.  If we're not using the mem
+     * cache, then avoid exceeding max_memory by keeping the slab size less
+     * than a quarter of max_memory. */
+
+    self->slab_size = self->block_size * 16;
+    if (self->part_size)
+        self->slab_size = MIN(self->slab_size, self->part_size / 4);
+    self->slab_size = MIN(self->slab_size, 10*1024*1024);
+    if (!use_mem_cache)
+        self->slab_size = MIN(self->slab_size, self->max_memory / 4);
+
+    /* round slab size up to the nearest multiple of the block size */
+    self->slab_size =
+        ((self->slab_size + self->block_size - 1) / self->block_size) * self->block_size;
+
+    /* round part size up to a multiple of the slab size */
+    if (self->part_size != 0) {
+        self->slabs_per_part = (self->part_size + self->slab_size - 1) / self->slab_size;
+        self->part_size = self->slabs_per_part * self->slab_size;
+    } else {
+        self->slabs_per_part = 0;
+    }
+
+    /* set max_slabs */
+    if (use_mem_cache) {
+        self->max_slabs = self->slabs_per_part; /* increase max_slabs to serve as mem buf */
+    } else {
+       self->max_slabs = (self->max_memory + self->slab_size - 1) / self->slab_size;
+    }
+
+    /* Note that max_slabs == 1 will cause deadlocks, due to some assumptions in
+        * alloc_slab, so we check here that it's at least 2. */
+    if (self->max_slabs < 2)
+        self->max_slabs = 2;
+
+    DBG(1, "using slab_size %zu and max_slabs %ju", self->slab_size, (uintmax_t)self->max_slabs);
+
+    return XFER_ELEMENT(self);
+}
index 9036d22382bdcf282f8c06461d4d37e1591cca3e..5bc492c67643ab1ccae64ef432485eb1afa298db 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "xfer-device.h"
 #include "arglist.h"
 #include "conffile.h"
@@ -135,6 +135,12 @@ worker_thread(
     DBG(2, "connection accepted; sending XMSG_READY");
     xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_READY, 0));
 
+    /* round the part size up to the next multiple of the block size */
+    if (self->part_size) {
+       self->part_size += self->device->block_size-1;
+       self->part_size -= self->part_size % self->device->block_size;
+    }
+
     /* now loop until we're out of parts */
     while (1) {
        guint64 size;
@@ -209,6 +215,10 @@ worker_thread(
        msg->successful = TRUE;
        msg->eom = eom;
        msg->eof = eof;
+
+       /* time runs backward on some test boxes, so make sure this is positive */
+       if (msg->duration < 0) msg->duration = 0;
+
        xfer_queue_message(elt->xfer, msg);
 
         self->partnum++;
@@ -388,16 +398,6 @@ use_device_impl(
     g_mutex_unlock(self->state_mutex);
 }
 
-static void
-cache_inform_impl(
-    XferDestTaper *xdtself G_GNUC_UNUSED,
-    const char *filename G_GNUC_UNUSED,
-    off_t offset G_GNUC_UNUSED,
-    off_t length G_GNUC_UNUSED)
-{
-    /* do nothing */
-}
-
 static guint64
 get_part_bytes_written_impl(
     XferDestTaper *xdtself G_GNUC_UNUSED)
@@ -466,7 +466,6 @@ class_init(
     klass->cancel = cancel_impl;
     xdt_klass->start_part = start_part_impl;
     xdt_klass->use_device = use_device_impl;
-    xdt_klass->cache_inform = cache_inform_impl;
     xdt_klass->get_part_bytes_written = get_part_bytes_written_impl;
     goc->finalize = finalize_impl;
 
index c0aa5301f324388af6493eb688d60e87a479f087..7295da389c90301ecfb9222bfd7c6c6a91a18014 100644 (file)
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "xfer-device.h"
 #include "arglist.h"
 #include "conffile.h"
 
-/* A transfer destination that writes and entire dumpfile to one or more files on one
- * or more devices.   This is designed to work in concert with Amanda::Taper::Scribe. */
-
-/* Future Plans:
- * - capture EOF early enough to avoid wasting a tape when the part size is an even multiple of the volume size - maybe reader thread can just go back and tag previous slab with EOF in that case?
- * - use mmap to make the disk-cacher thread unnecessary, if supported, by simply mapping slabs into the disk cache file
- * - can we find a way to fall back to mem_cache when the disk cache gets ENOSPC? Does it even make sense to try, since this would change the part size?
- * - distinguish some permanent device errors and do not retry the part? (this will be a change of behavior)
- */
+/* A transfer destination that writes an entire dumpfile to one or more files
+ * on one or more devices, without any caching.  This destination supports both
+ * LEOM-based splitting (in which parts are never rewound) and cache_inform-based
+ * splitting (in which rewound parts are read from holding disk). */
 
 /*
- * Slabs
+ * File Slices - Cache Information
  *
- * Slabs are larger than blocks, and are the unit on which the element
- * operates.  They are designed to be a few times larger than a block, to
- * achieve a corresponding reduction in the number of locks and unlocks used
- * per block, and similar reduction in the the amount of memory overhead
- * required.
- */
-
-typedef struct Slab {
-    struct Slab *next;
-
-    /* counts incoming pointers: the preceding slab's 'next' pointer, and pointers
-     * from any processes operating on the slab */
-    gint refcount;
-
-    /* number of this slab in the sequence, global to this element's lifetime.
-     * Since this counts slabs, which are about 1M, this can address 16
-     * yottabytes of data before wrapping. */
-    guint64 serial;
-
-    /* slab size; this is only less than the element's slab size if the
-     * transfer is at EOF. */
-    gsize size;
-
-    /* base of the slab_size buffer */
-    gpointer base;
-} Slab;
-
-/*
- * File Slices
+ * The cache_inform implementation adds cache information to a linked list of
+ * these objects, in order.  The objects are arranged in a linked list, and
+ * describe the files in which the part data is stored.  Note that we assume
+ * that slices are added *before* they are needed: the xfer element will fail
+ * if it tries to rewind and does not find a suitable slice.
  *
- * These objects are arranged in a linked list, and describe the files in which
- * the disk cache is stored.  Note that we assume that slices are added *before*
- * they are needed: the xfer element will fail if it tries to rewind and does not
- * find a suitable slice.
+ * The slices should be "fast forwarded" after every part, so that the first
+ * byte in part_slices is the first byte of the part; when a retry of a part is
+ * required, use the iterator methods to properly open the various files and do
+ * the buffering.
  */
 
 typedef struct FileSlice {
     struct FileSlice *next;
 
-    /* fully-qualified filename to read from, or NULL to read from disk_cache_read_fd */
+    /* fully-qualified filename to read from (or NULL to read from
+     * disk_cache_read_fd in XferDestTaperCacher) */
     char *filename;
 
     /* offset in file to start at */
-    off_t offset;
+    guint64 offset;
 
     /* length of data to read */
-    gsize length;
+    guint64 length;
 } FileSlice;
 
 /*
@@ -102,108 +74,50 @@ typedef struct XferDestTaperSplitter {
      * constant for the lifetime of the element.
      */
 
-    /* maximum buffer space to use for streaming; this is unrelated to the
-     * fallback_splitsize */
-    gsize max_memory;
-
-    /* split buffering info; if we're doing memory buffering, use_mem_cache is
-     * true; if we're doing disk buffering, disk_cache_dirname is non-NULL
-     * and contains the (allocated) filename of the cache file.  Either way,
-     * part_size gives the desired cache size.  If part_size is zero, then
-     * no splitting takes place (so part_size is effectively infinite) */
-    gboolean use_mem_cache;
-    char *disk_cache_dirname;
-    guint64 part_size; /* (bytes) */
-
-    /*
-     * threads
-     */
+    /* Maximum size of each part (bytes) */
+    guint64 part_size;
 
-    /* The thread doing the actual writes to tape; this also handles buffering
-     * for streaming */
-    GThread *device_thread;
-
-    /* The thread writing slabs to the disk cache, if any */
-    GThread *disk_cache_thread;
+    /* the device's need for streaming (it's assumed that all subsequent devices
+     * have the same needs) */
+    StreamingRequirement streaming;
 
-    /* slab train
-     *
-     * All in-memory data is contained in a linked list called the "slab
-     * train".  Various components are operating simultaneously at different
-     * points in this train.  Data from the upstream XferElement is appended to
-     * the head of the train, and the device thread follows along behind,
-     * writing data to the device.  When caching parts in memory, the slab
-     * train just grows to eventually contain the whole part.  When using an
-     * on-disk cache, the disk cache thread writes the tail of the train to
-     * disk, freeing slabs to be re-used at the head of the train.  Some
-     * careful coordination of these components allows them to operate as
-     * independently as possible within the limits of the user's configuration.
-     *
-     * Slabs are rarely, if ever, freed: the oldest_slab reference generally
-     * ensures that all slabs have refcount > 0, and this pointer is only
-     * advanced when re-using slabs that have been flushed to the disk cache or
-     * when freeing slabs after completion of the transfer. */
-
-    /* pointers into the slab train are all protected by this mutex.  Note that
-     * the slabs themselves can be manipulated without this lock; it's only
-     * when changing the pointers that the mutex must be held.  Furthermore, a
-     * foo_slab variable which is not NULL will not be changed except by its
-     * controlling thread (disk_cacher_slab is controlled by disk_cache_thread,
-     * and device_slab is controlled by device_thread).  This means that a
-     * controlling thread can drop the slab_mutex once it has ensured its slab
-     * is non-NULL.
-     *
-     * Slab_cond is notified when a new slab is made available from the reader.
-     * Slab_free_cond is notified when a slab becomes available for
-     * reallocation.
-     *
-     * Any thread waiting on either condition variable should also check
-     * elt->cancelled, and act appropriately if awakened in a cancelled state.
-     */
-    GMutex *slab_mutex; GCond *slab_cond; GCond *slab_free_cond;
+    /* block size expected by the target device */
+    gsize block_size;
 
-    /* slabs in progress by each thread, or NULL if the thread is waiting on
-     * slab_cond.  These can only be changed by their respective threads, except
-     * when they are NULL (in which case the reader will point them to a new
-     * slab and signal the slab_cond). */
-    Slab *volatile disk_cacher_slab;
-    Slab *volatile mem_cache_slab;
-    Slab *volatile device_slab;
+    /* TRUE if this element is expecting slices via cache_inform */
+    gboolean expect_cache_inform;
 
-    /* tail and head of the slab train */
-    Slab *volatile oldest_slab;
-    Slab *volatile newest_slab;
+    /* The thread doing the actual writes to tape; this also handles buffering
+     * for streaming */
+    GThread *device_thread;
 
-    /* thread-specific information
+    /* Ring Buffer
      *
-     * These values are only used by one thread, and thus are not
-     * subject to any locking or concurrency constraints.
+     * This buffer holds MAX_MEMORY bytes of data (rounded up to the next
+     * blocksize), and serves as the interface between the device_thread and
+     * the thread calling push_buffer.  Ring_length is the total length of the
+     * buffer in bytes, while ring_count is the number of data bytes currently
+     * in the buffer.  The ring_add_cond is signalled when data is added to the
+     * buffer, while ring_free_cond is signalled when data is removed.  Both
+     * are governed by ring_mutex, and both are signalled when the transfer is
+     * cancelled.
      */
 
-    /* slab in progress by the reader (not in the slab train) */
-    Slab *reader_slab;
-
-    /* the serial to be assigned to reader_slab */
-    guint64 next_serial;
-
-    /* bytes written to the device in this part */
-    guint64 bytes_written;
-
-    /* bytes written to the device in the current slab */
-    guint64 slab_bytes_written;
+    GMutex *ring_mutex;
+    GCond *ring_add_cond, *ring_free_cond;
+    gchar *ring_buffer;
+    gsize ring_length, ring_count;
+    gsize ring_head, ring_tail;
+    gboolean ring_head_at_eof;
 
-    /* element state
+    /* Element State
      *
      * "state" includes all of the variables below (including device
-     * parameters).  Note that the device_thread reads state values when
-     * paused is false without locking the mutex.  No other thread should
-     * change state when the element is not paused.
+     * parameters).  Note that the device_thread holdes this mutex for the
+     * entire duration of writing a part.
      *
-     * If there is every any reason to lock both mutexes, acquire this one
-     * first.
-     *
-     * Any thread waiting on this condition variable should also check
-     * elt->cancelled, and act appropriately if awakened in a cancelled state.
+     * state_mutex should always be locked before ring_mutex, if both are to be
+     * held simultaneously.
      */
     GMutex *state_mutex;
     GCond *state_cond;
@@ -213,57 +127,31 @@ typedef struct XferDestTaperSplitter {
     Device *volatile device;
     dumpfile_t *volatile part_header;
 
-    /* If true, when unpaused, the device should begin at the beginning of the
-     * cache; if false, it should proceed to the next part. */
-    volatile gboolean retry_part;
-
-    /* If true, the previous part was completed successfully; only used for
-     * assertions */
-    volatile gboolean last_part_successful;
+    /* bytes to read from cached slices before reading from the ring buffer */
+    guint64 bytes_to_read_from_slices;
 
     /* part number in progress */
     volatile guint64 partnum;
 
-    /* if true, the main thread should *not* call start_part */
-    volatile gboolean no_more_parts;
-
-    /* the first serial in this part, and the serial to stop at */
-    volatile guint64 part_first_serial, part_stop_serial;
-
-    /* file slices for the current part */
-    FileSlice *volatile part_slices;
-
-    /* read and write file descriptors for the disk cache file, in use by the
-     * disk_cache_thread.  If these are -1, wait on state_cond until they are
-     * not; once the value is set, it will not change. */
-    volatile int disk_cache_read_fd;
-    volatile int disk_cache_write_fd;
-
-    /* device parameters
-     *
-     * Note that these values aren't known until we begin writing to the
-     * device; if block_size is zero, threads should block on state_cond until
-     * it is nonzero, at which point all of the dependent fields will have
-     * their correct values.  Note that, since this value never changes after
-     * it has been set, it is safe to read block_size without acquiring the
-     * mutext first. */
-
-    /* this device's need for streaming */
-    StreamingRequirement streaming;
-
-    /* block size expected by the target device */
-    gsize block_size;
-
-    /* Size of a slab - some multiple of the block size */
-    gsize slab_size;
-
-    /* maximum number of slabs allowed, rounded up to the next whole slab.  If
-     * using mem cache, this is the equivalent of part_size bytes; otherwise,
-     * it is equivalent to max_memory bytes. */
-    guint64 max_slabs;
-
-    /* number of slabs in a part */
-    guint64 slabs_per_part;
+    /* status of the last part */
+    gboolean last_part_eof;
+    gboolean last_part_eom;
+    gboolean last_part_successful;
+
+    /* true if the element is done writing to devices */
+    gboolean no_more_parts;
+
+    /* total bytes written in the current part */
+    volatile guint64 part_bytes_written;
+
+    /* The list of active slices for the current part.  The cache_inform method
+     * appends to this list. It is safe to read this linked list, beginning at
+     * the head, *if* you can guarantee that slices will not be fast-forwarded
+     * in the interim.  The finalize method for this class will take care of
+     * freeing any leftover slices. Take the part_slices mutex while modifying
+     * the links in this list. */
+    FileSlice *part_slices;
+    GMutex *part_slices_mutex;
 } XferDestTaperSplitter;
 
 static GType xfer_dest_taper_splitter_get_type(void);
@@ -296,785 +184,399 @@ _xdt_dbg(const char *fmt, ...)
     g_debug("XDT thd-%p: %s", g_thread_self(), msg);
 }
 
-/*
- * Slab handling
- */
-
-/* called with the slab_mutex held, this gets a new slab to write into, with
- * refcount 1.  It will block if max_memory slabs are already in use, and mem
- * caching is not in use, although allocation may be forced with the 'force'
- * parameter.
- *
- * If the memory allocation cannot be satisfied due to system constraints,
- * this function will send an XMSG_ERROR, wait for the transfer to cancel, and
- * return NULL.  If the transfer is cancelled by some other means while this
- * function is blocked awaiting a free slab, it will return NULL.
+/* "Fast forward" the slice list by the given length.  This will free any
+ * slices that are no longer necessary, and adjust the offset and length of the
+ * first remaining slice.  This assumes the state mutex is locked during its
+ * operation.
  *
- * @param self: the xfer element
- * @param force: allocate a slab even if it would exceed max_memory
- * @returns: a new slab, or NULL if the xfer is cancelled
+ * @param self: element
+ * @param length: number of bytes to fast forward
  */
-static Slab *
-alloc_slab(
-    XferDestTaperSplitter *self,
-    gboolean force)
+static void
+fast_forward_slices(
+       XferDestTaperSplitter *self,
+       guint64 length)
 {
-    XferElement *elt = XFER_ELEMENT(self);
-    Slab *rv;
-
-    DBG(8, "alloc_slab(force=%d)", force);
-    if (!force) {
-       /* throttle based on maximum number of extant slabs */
-       while (G_UNLIKELY(
-            !elt->cancelled &&
-           self->oldest_slab &&
-           self->newest_slab &&
-           self->oldest_slab->refcount > 1 &&
-           (self->newest_slab->serial - self->oldest_slab->serial + 1) >= self->max_slabs)) {
-           DBG(9, "waiting for available slab");
-           g_cond_wait(self->slab_free_cond, self->slab_mutex);
-       }
-       DBG(9, "done waiting");
-
-        if (elt->cancelled)
-            return NULL;
-    }
-
-    /* if the oldest slab doesn't have anything else pointing to it, just use
-     * that */
-    if (self->oldest_slab && self->oldest_slab->refcount == 1) {
-       rv = self->oldest_slab;
-       self->oldest_slab = rv->next;
-    } else {
-       rv = g_new0(Slab, 1);
-       rv->refcount = 1;
-       rv->base = g_try_malloc(self->slab_size);
-       if (!rv->base) {
-           g_free(rv);
-           xfer_cancel_with_error(XFER_ELEMENT(self),
-               _("Could not allocate %zu bytes of memory"), self->slab_size);
-           return NULL;
-       }
-    }
+    FileSlice *slice;
 
-    rv->next = NULL;
-    rv->size = 0;
-    return rv;
-}
+    /* consume slices until we've eaten the whole part */
+    g_mutex_lock(self->part_slices_mutex);
+    while (length > 0) {
+       g_assert(self->part_slices);
+       slice = self->part_slices;
 
-/* called with the slab_mutex held, this frees the given slave entirely.  The
- * reference count is not consulted.
- *
- * @param slab: slab to free
- */
-static void
-free_slab(
-    Slab *slab)
-{
-    if (slab) {
-       if (slab->base)
-           g_free(slab->base);
-       g_free(slab);
-    }
-}
+       if (slice->length <= length) {
+           length -= slice->length;
 
-/* called with the slab_mutex held, this decrements the refcount of the
- * given slab
- *
- * @param self: xfer element
- * @param slab: slab to free
- */
-static inline void
-unref_slab(
-    XferDestTaperSplitter *self,
-    Slab *slab)
-{
-    g_assert(slab->refcount > 1);
-    slab->refcount--;
-    if (G_UNLIKELY(slab->refcount == 1 && slab == self->oldest_slab)) {
-       g_cond_broadcast(self->slab_free_cond);
-    } else if (G_UNLIKELY(slab->refcount == 0)) {
-       free_slab(slab);
+           self->part_slices = slice->next;
+           if (slice->filename)
+               g_free(slice->filename);
+           g_free(slice);
+           slice = self->part_slices;
+       } else {
+           slice->length -= length;
+           slice->offset += length;
+           break;
+       }
     }
+    g_mutex_unlock(self->part_slices_mutex);
 }
 
-/* called with the slab_mutex held, this sets *slabp to *slabp->next,
- * adjusting refcounts appropriately, and returns the new value
- *
- * @param self: xfer element
- * @param slabp: slab pointer to advance
- * @returns: new value of *slabp
+/*
+ * Slice Iterator
  */
-static inline Slab *
-next_slab(
-    XferDestTaperSplitter *self,
-    Slab * volatile *slabp)
-{
-    Slab *next;
 
-    if (!slabp || !*slabp)
-       return NULL;
+/* A struct for use in iterating over data in the slices */
+typedef struct SliceIterator {
+    /* current slice */
+    FileSlice *slice;
 
-    next = (*slabp)->next;
-    if (next)
-       next->refcount++;
-    if (*slabp)
-       unref_slab(self, *slabp);
-    *slabp = next;
+    /* file descriptor of the current file, or -1 if it's not open yet */
+    int cur_fd;
 
-    return next;
-}
+    /* bytes remaining in this slice */
+    guint64 slice_remaining;
+} SliceIterator;
 
-/*
- * Disk Cache
- *
- * The disk cache thread's job is simply to follow along the slab train at
- * maximum speed, writing slabs to the disk cache file. */
+/* Utility functions for SliceIterator */
 
-static gboolean
-open_disk_cache_fds(
-    XferDestTaperSplitter *self)
+/* Begin iterating over slices, starting at the first byte of the first slice.
+ * Initializes a pre-allocated SliceIterator.  The caller must ensure that
+ * fast_forward_slices is not called while an iteration is in
+ * progress.
+ */
+static void
+iterate_slices(
+       XferDestTaperSplitter *self,
+       SliceIterator *iter)
 {
-    char * filename;
-
-    g_assert(self->disk_cache_read_fd == -1);
-    g_assert(self->disk_cache_write_fd == -1);
-
-    g_mutex_lock(self->state_mutex);
-    filename = g_strdup_printf("%s/amanda-split-buffer-XXXXXX",
-                               self->disk_cache_dirname);
-
-    self->disk_cache_write_fd = g_mkstemp(filename);
-    if (self->disk_cache_write_fd < 0) {
-       g_mutex_unlock(self->state_mutex);
-       xfer_cancel_with_error(XFER_ELEMENT(self),
-           _("Error creating cache file in '%s': %s"), self->disk_cache_dirname,
-           strerror(errno));
-       g_free(filename);
-       return FALSE;
-    }
-
-    /* open a separate copy of the file for reading */
-    self->disk_cache_read_fd = open(filename, O_RDONLY);
-    if (self->disk_cache_read_fd < 0) {
-       g_mutex_unlock(self->state_mutex);
-       xfer_cancel_with_error(XFER_ELEMENT(self),
-           _("Error opening cache file in '%s': %s"), self->disk_cache_dirname,
-           strerror(errno));
-       g_free(filename);
-       return FALSE;
-    }
-
-    /* signal anyone waiting for this value */
-    g_cond_broadcast(self->state_cond);
-    g_mutex_unlock(self->state_mutex);
-
-    /* errors from unlink are not fatal */
-    if (unlink(filename) < 0) {
-       g_warning("While unlinking '%s': %s (ignored)", filename, strerror(errno));
-    }
-
-    g_free(filename);
-    return TRUE;
+    iter->cur_fd = -1;
+    iter->slice_remaining = 0;
+    g_mutex_lock(self->part_slices_mutex);
+    iter->slice = self->part_slices;
+    /* it's safe to unlock this because, at worst, a new entry will
+     * be appended while the iterator is in progress */
+    g_mutex_unlock(self->part_slices_mutex);
 }
 
+
+/* Get a block of data from the iterator, returning a pointer to a buffer
+ * containing the data; the buffer remains the property of the iterator.
+ * Returns NULL on error, after calling xfer_cancel_with_error with an
+ * appropriate error message.  This function does not block, so it does not
+ * check for cancellation.
+ */
 static gpointer
-disk_cache_thread(
-    gpointer data)
+iterator_get_block(
+       XferDestTaperSplitter *self,
+       SliceIterator *iter,
+       gpointer buf,
+       gsize bytes_needed)
 {
-    XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(data);
+    gsize buf_offset = 0;
     XferElement *elt = XFER_ELEMENT(self);
 
-    DBG(1, "(this is the disk cache thread)");
-
-    /* open up the disk cache file first */
-    if (!open_disk_cache_fds(self))
-       return NULL;
-
-    while (!elt->cancelled) {
-       gboolean eof, eop;
-       guint64 stop_serial;
-       Slab *slab;
+    g_assert(iter != NULL);
+    g_assert(buf != NULL);
 
-       /* rewind to the begining of the disk cache file */
-       if (lseek(self->disk_cache_write_fd, 0, SEEK_SET) == -1) {
-           xfer_cancel_with_error(XFER_ELEMENT(self),
-               _("Error seeking disk cache file in '%s': %s"), self->disk_cache_dirname,
-               strerror(errno));
-           return NULL;
-       }
-
-       /* we need to sit and wait for the next part to begin, first making sure
-        * we have a slab .. */
-       g_mutex_lock(self->slab_mutex);
-       while (!self->disk_cacher_slab && !elt->cancelled) {
-           DBG(9, "waiting for a disk slab");
-           g_cond_wait(self->slab_cond, self->slab_mutex);
-       }
-       DBG(9, "done waiting");
-       g_mutex_unlock(self->slab_mutex);
+    while (bytes_needed > 0) {
+       gsize read_size;
+       int bytes_read;
 
-       if (elt->cancelled)
-           break;
+       if (iter->cur_fd < 0) {
+           guint64 offset;
 
-       /* this slab is now fixed until this thread changes it */
-       g_assert(self->disk_cacher_slab != NULL);
-
-       /* and then making sure we're ready to write that slab. */
-       g_mutex_lock(self->state_mutex);
-        while ((self->paused ||
-                   (self->disk_cacher_slab && self->disk_cacher_slab->serial > self->part_first_serial))
-               && !elt->cancelled) {
-            DBG(9, "waiting for the disk slab to become current and un-paused");
-            g_cond_wait(self->state_cond, self->state_mutex);
-        }
-       DBG(9, "done waiting");
+           g_assert(iter->slice != NULL);
+           g_assert(iter->slice->filename != NULL);
 
-       stop_serial = self->part_stop_serial;
-       g_mutex_unlock(self->state_mutex);
+           iter->cur_fd = open(iter->slice->filename, O_RDONLY, 0);
+           if (iter->cur_fd < 0) {
+               xfer_cancel_with_error(elt,
+                   _("Could not open '%s' for reading: %s"),
+                   iter->slice->filename, strerror(errno));
+               return NULL;
+           }
 
-       if (elt->cancelled)
-           break;
+           iter->slice_remaining = iter->slice->length;
+           offset = iter->slice->offset;
 
-       g_mutex_lock(self->slab_mutex);
-       slab = self->disk_cacher_slab;
-       eop = eof = FALSE;
-       while (!eop && !eof) {
-           /* if we're at the head of the slab train, wait for more data */
-           while (!self->disk_cacher_slab && !elt->cancelled) {
-               DBG(9, "waiting for the next disk slab");
-               g_cond_wait(self->slab_cond, self->slab_mutex);
+           if (lseek(iter->cur_fd, offset, SEEK_SET) == -1) {
+               xfer_cancel_with_error(elt,
+                   _("Could not seek '%s' for reading: %s"),
+                   iter->slice->filename, strerror(errno));
+               return NULL;
            }
-           DBG(9, "done waiting");
+       }
 
-            if (elt->cancelled)
-                break;
+       read_size = MIN(iter->slice_remaining, bytes_needed);
+       bytes_read = full_read(iter->cur_fd,
+                              buf + buf_offset,
+                              read_size);
+       if (bytes_read < 0 || (gsize)bytes_read < read_size) {
+           xfer_cancel_with_error(elt,
+               _("Error reading '%s': %s"),
+               iter->slice->filename,
+               errno? strerror(errno) : _("Unexpected EOF"));
+           return NULL;
+       }
 
-           /* drop the lock long enough to write the slab; the refcount
-            * protects the slab during this time */
-           slab = self->disk_cacher_slab;
-           g_mutex_unlock(self->slab_mutex);
+       iter->slice_remaining -= bytes_read;
+       buf_offset += bytes_read;
+       bytes_needed -= bytes_read;
 
-           if (full_write(self->disk_cache_write_fd, slab->base, slab->size) < slab->size) {
-               xfer_cancel_with_error(XFER_ELEMENT(self),
-                   _("Error writing to disk cache file in '%s': %s"), self->disk_cache_dirname,
-                   strerror(errno));
+       if (iter->slice_remaining <= 0) {
+           if (close(iter->cur_fd) < 0) {
+               xfer_cancel_with_error(elt,
+                   _("Could not close fd %d: %s"),
+                   iter->cur_fd, strerror(errno));
                return NULL;
            }
+           iter->cur_fd = -1;
 
-           eof = slab->size < self->slab_size;
-           eop = (slab->serial + 1 == stop_serial);
+           iter->slice = iter->slice->next;
 
-           g_mutex_lock(self->slab_mutex);
-           next_slab(self, &self->disk_cacher_slab);
-       }
-       g_mutex_unlock(self->slab_mutex);
-
-       if (eof) {
-           /* this very thread should have just set this value to NULL, and since it's
-            * EOF, there should not be any 'next' slab */
-           g_assert(self->disk_cacher_slab == NULL);
-           break;
+           if (elt->cancelled)
+               return NULL;
        }
     }
 
-    return NULL;
+    return buf;
+}
+
+
+/* Free the iterator's resources */
+static void
+iterator_free(
+       SliceIterator *iter)
+{
+    if (iter->cur_fd >= 0)
+       close(iter->cur_fd);
 }
 
 /*
  * Device Thread
- *
- * The device thread's job is to write slabs to self->device, applying whatever
- * streaming algorithms are required.  It does this by alternately getting the
- * next slab from a "slab source" and writing that slab to the device.  Most of
- * the slab source functions assume that self->slab_mutex is held, but may
- * release the mutex (either explicitly or via a g_cond_wait), so it is not
- * valid to assume that any slab pointers remain unchanged after a slab_source
- * function invication.
  */
 
-/* This struct tracks the current state of the slab source */
-typedef struct slab_source_state {
-    /* temporary slab used for reading from disk */
-    Slab *tmp_slab;
-
-    /* current source slice */
-    FileSlice *slice;
-
-    /* open fd in current slice, or -1 */
-    int slice_fd;
-
-    /* next serial to read from disk */
-    guint64 next_serial;
-
-    /* bytes remaining in this slice */
-    gsize slice_remaining;
-} slab_source_state;
-
-/* Called with the slab_mutex held, this function pre-buffers enough data into the slab
- * train to meet the device's streaming needs. */
-static gboolean
-slab_source_prebuffer(
+/* Wait for at least one block, or EOF, to be available in the ring buffer.
+ * Called with the ring mutex held. */
+static gsize
+device_thread_wait_for_block(
     XferDestTaperSplitter *self)
 {
     XferElement *elt = XFER_ELEMENT(self);
-    guint64 prebuffer_slabs = (self->max_memory + self->slab_size - 1) / self->slab_size;
-    guint64 i;
-    Slab *slab;
-
-    /* always prebuffer at least one slab, even if max_memory is 0 */
-    if (prebuffer_slabs == 0) prebuffer_slabs = 1;
-
-    /* pre-buffering is not necessary if we're reading from a disk cache */
-    if (self->retry_part && self->part_slices)
-       return TRUE;
-
-    /* pre-buffering means waiting until we have at least prebuffer_slabs in the
-     * slab train ahead of the device_slab, or the newest slab is at EOF. */
-    while (!elt->cancelled) {
-       gboolean eof_or_eop = FALSE;
-
-       /* see if there's enough data yet */
-       for (i = 0, slab = self->device_slab;
-            i < prebuffer_slabs && slab != NULL;
-            i++, slab = slab->next) {
-           eof_or_eop = (slab->size < self->slab_size)
-               || (slab->serial + 1 == self->part_stop_serial);
-       }
-       if (i == prebuffer_slabs || eof_or_eop)
-           break;
+    gsize bytes_needed = self->device->block_size;
+    gsize usable;
 
-       DBG(9, "prebuffering wait");
-       g_cond_wait(self->slab_cond, self->slab_mutex);
-    }
-    DBG(9, "done waiting");
+    /* for any kind of streaming, we need to fill the entire buffer before the
+     * first byte */
+    if (self->part_bytes_written == 0 && self->streaming != STREAMING_REQUIREMENT_NONE)
+       bytes_needed = self->ring_length;
 
-    if (elt->cancelled) {
-       self->last_part_successful = FALSE;
-       self->no_more_parts = TRUE;
-       return FALSE;
-    }
-
-    return TRUE;
-}
-
-/* Called without the slab_mutex held, this function sets up a new slab_source_state
- * object based on the configuratino of the Xfer Element. */
-static inline gboolean
-slab_source_setup(
-    XferDestTaperSplitter *self,
-    slab_source_state *state)
-{
-    state->tmp_slab = NULL;
-    state->slice_fd = -1;
-    state->slice = NULL;
-    state->slice_remaining = 0;
-    state->next_serial = G_MAXUINT64;
-
-    /* if we're to retry the part, rewind to the beginning */
-    if (self->retry_part) {
-       if (self->use_mem_cache) {
-           /* rewind device_slab to point to the mem_cache_slab */
-           g_mutex_lock(self->slab_mutex);
-           if (self->device_slab)
-               unref_slab(self, self->device_slab);
-           self->device_slab = self->mem_cache_slab;
-           if(self->device_slab != NULL)
-               self->device_slab->refcount++;
-           g_mutex_unlock(self->slab_mutex);
-       } else {
-           g_assert(self->part_slices);
-
-           g_mutex_lock(self->slab_mutex);
-
-           /* we're going to read from the disk cache until we get to the oldest useful
-            * slab in memory, so it had best exist */
-           g_assert(self->oldest_slab != NULL);
-
-           /* point device_slab at the oldest slab we have */
-           self->oldest_slab->refcount++;
-           if (self->device_slab)
-               unref_slab(self, self->device_slab);
-           self->device_slab = self->oldest_slab;
-
-           /* and increment it until it is at least the slab we want to start from */
-           while (self->device_slab->serial < self->part_first_serial) {
-               next_slab(self, &self->device_slab);
-           }
+    while (1) {
+       /* are we ready? */
+       if (elt->cancelled)
+           break;
 
-           /* get a new, temporary slab for use while reading */
-           state->tmp_slab = alloc_slab(self, TRUE);
+       if (self->ring_count >= bytes_needed)
+           break;
 
-           g_mutex_unlock(self->slab_mutex);
+       if (self->ring_head_at_eof)
+           break;
 
-           if (!state->tmp_slab) {
-                /* if we couldn't allocate a slab, then we're cancelled, so we're done with
-                 * this part. */
-               self->last_part_successful = FALSE;
-               self->no_more_parts = TRUE;
-               return FALSE;
-           }
+       /* nope - so wait */
+       g_cond_wait(self->ring_add_cond, self->ring_mutex);
 
-           state->tmp_slab->size = self->slab_size;
-           state->slice = self->part_slices;
-           state->next_serial = self->part_first_serial;
-       }
+       /* in STREAMING_REQUIREMENT_REQUIRED, once we decide to wait for more bytes,
+        * we need to wait for the entire buffer to fill */
+       if (self->streaming == STREAMING_REQUIREMENT_REQUIRED)
+           bytes_needed = self->ring_length;
     }
 
-    /* if the streaming mode requires it, pre-buffer */
-    if (self->streaming == STREAMING_REQUIREMENT_DESIRED ||
-       self->streaming == STREAMING_REQUIREMENT_REQUIRED) {
-       gboolean prebuffer_ok;
-
-       g_mutex_lock(self->slab_mutex);
-       prebuffer_ok = slab_source_prebuffer(self);
-       g_mutex_unlock(self->slab_mutex);
-       if (!prebuffer_ok)
-           return FALSE;
-    }
+    usable = MIN(self->ring_count, bytes_needed);
+    if (self->part_size)
+       usable = MIN(usable, self->part_size - self->part_bytes_written);
 
-    return TRUE;
+    return usable;
 }
 
-/* Called with the slab_mutex held, this does the work of slab_source_get when
- * reading from the disk cache.  Note that this explicitly releases the
- * slab_mutex during execution - do not depend on any protected values across a
- * call to this function.  The mutex is held on return. */
-static Slab *
-slab_source_get_from_disk(
+/* Mark WRITTEN bytes as free in the ring buffer.  Called with the ring mutex
+ * held. */
+static void
+device_thread_consume_block(
     XferDestTaperSplitter *self,
-    slab_source_state *state,
-    guint64 serial)
+    gsize written)
+{
+    self->ring_count -= written;
+    self->ring_tail += written;
+    if (self->ring_tail >= self->ring_length)
+       self->ring_tail -= self->ring_length;
+    g_cond_broadcast(self->ring_free_cond);
+}
+
+/* Write an entire part.  Called with the state_mutex held */
+static XMsg *
+device_thread_write_part(
+    XferDestTaperSplitter *self)
 {
+    GTimer *timer = g_timer_new();
     XferElement *elt = XFER_ELEMENT(self);
-    gsize bytes_needed = self->slab_size;
-    gsize slab_offset = 0;
 
-    /* NOTE: slab_mutex is held, but we don't need it here, so release it for the moment */
-    g_mutex_unlock(self->slab_mutex);
+    enum { PART_EOF, PART_LEOM, PART_EOP, PART_FAILED } part_status = PART_FAILED;
+    int fileno = 0;
+    XMsg *msg;
 
-    g_assert(state->next_serial == serial);
+    self->part_bytes_written = 0;
 
-    while (bytes_needed > 0) {
-       gsize read_size, bytes_read;
-
-       if (state->slice_fd < 0) {
-           g_assert(state->slice);
-           if (state->slice->filename) {
-               /* regular cache_inform file - just open it */
-               state->slice_fd = open(state->slice->filename, O_RDONLY, 0);
-               if (state->slice_fd < 0) {
-                   xfer_cancel_with_error(XFER_ELEMENT(self),
-                        _("Could not open '%s' for reading: %s"),
-                       state->slice->filename, strerror(errno));
-                   goto fatal_error;
-               }
-           } else {
-               /* wait for the disk_cache_thread to open the disk_cache_read_fd, and then copy it */
-               g_mutex_lock(self->state_mutex);
-               while (self->disk_cache_read_fd == -1 && !elt->cancelled) {
-                   DBG(9, "waiting for disk_cache_thread to start up");
-                   g_cond_wait(self->state_cond, self->state_mutex);
-               }
-               DBG(9, "done waiting");
-               state->slice_fd = self->disk_cache_read_fd;
-               g_mutex_unlock(self->state_mutex);
-           }
+    g_timer_start(timer);
 
-           if (lseek(state->slice_fd, state->slice->offset, SEEK_SET) == -1) {
-               xfer_cancel_with_error(XFER_ELEMENT(self),
-                    _("Could not seek '%s' for reading: %s"),
-                   state->slice->filename? state->slice->filename : "(cache file)",
-                   strerror(errno));
-               goto fatal_error;
-           }
+    /* write the header; if this fails or hits LEOM, we consider this a
+     * successful 0-byte part */
+    if (!device_start_file(self->device, self->part_header) || self->device->is_eom) {
+       part_status = PART_LEOM;
+       goto part_done;
+    }
 
-           state->slice_remaining = state->slice->length;
-       }
+    fileno = self->device->file;
+    g_assert(fileno > 0);
 
-       read_size = MIN(state->slice_remaining, bytes_needed);
-       bytes_read = full_read(state->slice_fd,
-                              state->tmp_slab->base + slab_offset,
-                              read_size);
-       if (bytes_read < read_size) {
-            xfer_cancel_with_error(XFER_ELEMENT(self),
-                _("Error reading '%s': %s"),
-               state->slice->filename? state->slice->filename : "(cache file)",
-               errno? strerror(errno) : _("Unexpected EOF"));
-            goto fatal_error;
-       }
+    /* free the header, now that it's written */
+    dumpfile_free(self->part_header);
+    self->part_header = NULL;
 
-       state->slice_remaining -= bytes_read;
-       if (state->slice_remaining == 0) {
-           if (close(state->slice_fd) < 0) {
-               xfer_cancel_with_error(XFER_ELEMENT(self),
-                    _("Could not close fd %d: %s"),
-                   state->slice_fd, strerror(errno));
-               goto fatal_error;
-           }
-           state->slice_fd = -1;
-           state->slice = state->slice->next;
-       }
+    /* First, read the requisite number of bytes from the part_slices, if the part was
+     * unsuccessful. */
+    if (self->bytes_to_read_from_slices) {
+       SliceIterator iter;
+       gsize to_write = self->block_size;
+       gpointer buf = g_malloc(to_write);
+       gboolean successful = TRUE;
+       guint64 bytes_from_slices = self->bytes_to_read_from_slices;
 
-       bytes_needed -= bytes_read;
-       slab_offset += bytes_read;
-    }
+       DBG(5, "reading %ju bytes from slices", (uintmax_t)bytes_from_slices);
 
-    state->tmp_slab->serial = state->next_serial++;
+       iterate_slices(self, &iter);
+       while (bytes_from_slices) {
+           gboolean ok;
 
-    g_mutex_lock(self->slab_mutex);
-    return state->tmp_slab;
+           if (!iterator_get_block(self, &iter, buf, to_write)) {
+               part_status = PART_FAILED;
+               successful = FALSE;
+               break;
+           }
 
-fatal_error:
-    g_mutex_lock(self->slab_mutex);
+           /* note that it's OK to reference these ring_* vars here, as they
+            * are static at this point */
+           ok = device_write_block(self->device, (guint)to_write, buf);
 
-    self->last_part_successful = FALSE;
-    self->no_more_parts = TRUE;
-    return NULL;
-}
+           if (!ok) {
+               part_status = PART_FAILED;
+               successful = FALSE;
+               break;
+           }
 
-/* Called with the slab_mutex held, this function gets the slab with the given
- * serial number, waiting if necessary for that slab to be available.  Note
- * that the slab_mutex may be released during execution, although it is always
- * held on return. */
-static inline Slab *
-slab_source_get(
-    XferDestTaperSplitter *self,
-    slab_source_state *state,
-    guint64 serial)
-{
-    XferElement *elt = (XferElement *)self;
-
-    /* device_slab is only NULL if we're following the slab train, so wait for
-     * a new slab */
-    if (!self->device_slab) {
-       /* if the streaming mode requires it, pre-buffer */
-       if (self->streaming == STREAMING_REQUIREMENT_DESIRED) {
-           if (!slab_source_prebuffer(self))
-               return NULL;
+           self->part_bytes_written += to_write;
+           bytes_from_slices -= to_write;
 
-           /* fall through to make sure we have a device_slab;
-            * slab_source_prebuffer doesn't guarantee device_slab != NULL */
+           if (self->part_size && self->part_bytes_written >= self->part_size) {
+               part_status = PART_EOP;
+               successful = FALSE;
+               break;
+           } else if (self->device->is_eom) {
+               part_status = PART_LEOM;
+               successful = FALSE;
+               break;
+           }
        }
 
-       while (self->device_slab == NULL && !elt->cancelled) {
-           DBG(9, "waiting for the next slab");
-           g_cond_wait(self->slab_cond, self->slab_mutex);
-       }
-       DBG(9, "done waiting");
+       iterator_free(&iter);
+       g_free(buf);
 
-       if (elt->cancelled)
-           goto fatal_error;
+       /* if we didn't finish, get out of here now */
+       if (!successful)
+           goto part_done;
     }
 
-    /* device slab is now set, and only this thread can change it */
-    g_assert(self->device_slab);
-
-    /* if the next item in the device slab is the one we want, then the job is
-     * pretty easy */
-    if (G_LIKELY(serial == self->device_slab->serial))
-       return self->device_slab;
-
-    /* otherwise, we're reading from disk */
-    g_assert(serial < self->device_slab->serial);
-    return slab_source_get_from_disk(self, state, serial);
+    g_mutex_lock(self->ring_mutex);
+    while (1) {
+       gsize to_write;
+       gboolean ok;
 
-fatal_error:
-    self->last_part_successful = FALSE;
-    self->no_more_parts = TRUE;
-    return NULL;
-}
+       /* wait for at least one block, and (if necessary) prebuffer */
+       to_write = device_thread_wait_for_block(self);
+       to_write = MIN(to_write, self->device->block_size);
+       if (elt->cancelled)
+           break;
 
-/* Called without the slab_mutex held, this frees any resources assigned
- * to the slab source state */
-static inline void
-slab_source_free(
-    XferDestTaperSplitter *self,
-    slab_source_state *state)
-{
-    if (state->slice_fd != -1)
-       close(state->slice_fd);
+       if (to_write == 0) {
+           part_status = PART_EOF;
+           break;
+       }
 
-    if (state->tmp_slab) {
-       g_mutex_lock(self->slab_mutex);
-       free_slab(state->tmp_slab);
-       g_mutex_unlock(self->slab_mutex);
-    }
-}
+       g_mutex_unlock(self->ring_mutex);
+       DBG(8, "writing %ju bytes to device", (uintmax_t)to_write);
 
-/* Called without the slab_mutex, this writes the given slab to the device */
-static gboolean
-write_slab_to_device(
-    XferDestTaperSplitter *self,
-    Slab *slab)
-{
-    XferElement *elt = XFER_ELEMENT(self);
-    gpointer buf = slab->base;
-    gsize remaining = slab->size;
+       /* note that it's OK to reference these ring_* vars here, as they
+        * are static at this point */
+       ok = device_write_block(self->device, (guint)to_write,
+               self->ring_buffer + self->ring_tail);
+       g_mutex_lock(self->ring_mutex);
 
-    while (remaining && !elt->cancelled) {
-       gsize write_size = MIN(self->block_size, remaining);
-       gboolean ok;
-       ok = device_write_block(self->device, write_size, buf);
        if (!ok) {
-            self->bytes_written += slab->size - remaining;
-
-            /* TODO: handle an error without is_eom
-             * differently/fatally? or at least with a warning? */
-           self->last_part_successful = FALSE;
-           self->no_more_parts = FALSE;
-           return FALSE;
+           part_status = PART_FAILED;
+           break;
        }
 
-       buf += write_size;
-       self->slab_bytes_written += write_size;
-       remaining -= write_size;
-    }
+       self->part_bytes_written += to_write;
+       device_thread_consume_block(self, to_write);
 
-    if (elt->cancelled) {
-       self->last_part_successful = FALSE;
-       self->no_more_parts = TRUE;
-        return FALSE;
+       if (self->part_size && self->part_bytes_written >= self->part_size) {
+           part_status = PART_EOP;
+           break;
+       } else if (self->device->is_eom) {
+           part_status = PART_LEOM;
+           break;
+       }
     }
+    g_mutex_unlock(self->ring_mutex);
+part_done:
 
-    self->bytes_written += slab->size;
-    self->slab_bytes_written = 0;
-    return TRUE;
-}
-
-static XMsg *
-device_thread_write_part(
-    XferDestTaperSplitter *self)
-{
-    GTimer *timer = g_timer_new();
-    XMsg *msg;
-    slab_source_state src_state;
-    guint64 serial, stop_serial;
-    gboolean eof = FALSE;
-    int fileno = 0;
-
-    self->last_part_successful = FALSE;
-    self->bytes_written = 0;
-
-    if (!device_start_file(self->device, self->part_header))
-       goto part_done;
-
-    dumpfile_free(self->part_header);
-    self->part_header = NULL;
-
-    fileno = self->device->file;
-    g_assert(fileno > 0);
-
-    if (!slab_source_setup(self, &src_state))
-       goto part_done;
-
-    g_timer_start(timer);
-
-    stop_serial = self->part_stop_serial;
-    g_mutex_lock(self->slab_mutex);
-    for (serial = self->part_first_serial; serial < stop_serial && !eof; serial++) {
-       Slab *slab = slab_source_get(self, &src_state, serial);
-       DBG(8, "writing slab %p (serial %ju) to device", slab, serial);
-       g_mutex_unlock(self->slab_mutex);
-       if (!slab)
-           goto part_done;
-
-       eof = slab->size < self->slab_size;
-
-       if (!write_slab_to_device(self, slab))
-           goto part_done;
-
-       g_mutex_lock(self->slab_mutex);
-       DBG(8, "wrote slab %p to device", slab);
-
-       /* if we're reading from the slab train, advance self->device_slab. */
-       if (slab == self->device_slab) {
-           next_slab(self, &self->device_slab);
-       }
+    if (elt->cancelled) {
+       g_timer_destroy(timer);
+       return NULL;
     }
-    g_mutex_unlock(self->slab_mutex);
 
     /* if we write all of the blocks, but the finish_file fails, then likely
      * there was some buffering going on in the device driver, and the blocks
-     * did not all make it to permanent storage -- so it's a failed part. */
-    if (!device_finish_file(self->device))
-       goto part_done;
-
-    slab_source_free(self, &src_state);
-
-    self->last_part_successful = TRUE;
-    self->no_more_parts = eof;
+     * did not all make it to permanent storage -- so it's a failed part.  Note
+     * that we try to finish_file even if the part failed, just to be thorough. */
+    if (self->device->in_file) {
+       if (!device_finish_file(self->device))
+           part_status = PART_FAILED;
+    }
 
-part_done:
     g_timer_stop(timer);
 
     msg = xmsg_new(XFER_ELEMENT(self), XMSG_PART_DONE, 0);
-    msg->size = self->bytes_written;
+    msg->size = self->part_bytes_written;
     msg->duration = g_timer_elapsed(timer, NULL);
     msg->partnum = self->partnum;
     msg->fileno = fileno;
-    msg->successful = self->last_part_successful;
-    msg->eom = !self->last_part_successful;
-    msg->eof = self->no_more_parts;
+    msg->successful = self->last_part_successful = part_status != PART_FAILED;
+    msg->eom = self->last_part_eom = (part_status == PART_LEOM || !msg->successful);
+    msg->eof = self->last_part_eof = part_status == PART_EOF;
 
-    if (self->last_part_successful)
+    /* time runs backward on some test boxes, so make sure this is positive */
+    if (msg->duration < 0) msg->duration = 0;
+
+    if (msg->successful)
        self->partnum++;
+    self->no_more_parts = msg->eof || (!msg->successful && !self->expect_cache_inform);
 
     g_timer_destroy(timer);
 
     return msg;
 }
 
-/* Called with the status_mutex held, this frees any cached data for
- * a successful part */
-static void
-release_part_cache(
-    XferDestTaperSplitter *self)
-{
-    if (self->use_mem_cache && self->mem_cache_slab) {
-       /* move up the mem_cache_slab to point to the first slab in
-        * the next part (probably NULL at this point), so that the
-        * reader can continue reading data into the new mem cache
-        * immediately. */
-       g_mutex_lock(self->slab_mutex);
-       unref_slab(self, self->mem_cache_slab);
-       self->mem_cache_slab = self->device_slab;
-       if (self->mem_cache_slab)
-           self->mem_cache_slab->refcount++;
-       g_mutex_unlock(self->slab_mutex);
-    }
-
-    /* the disk_cache_thread takes care of freeing its cache */
-    else if (self->disk_cache_dirname)
-       return;
-
-    /* if we have part_slices, fast-forward them. Note that we should have a
-     * full part's worth of slices by now. */
-    else if (self->part_slices) {
-       guint64 bytes_remaining = self->slabs_per_part * self->slab_size;
-       FileSlice *slice = self->part_slices;
-
-       /* consume slices until we've eaten the whole part */
-       while (bytes_remaining > 0) {
-           if (slice == NULL)
-               g_critical("Not all data in part was represented to cache_inform");
-
-           if (slice->length <= bytes_remaining) {
-               bytes_remaining -= slice->length;
-
-               self->part_slices = slice->next;
-               g_free(slice->filename);
-               g_free(slice);
-               slice = self->part_slices;
-           } else {
-               slice->length -= bytes_remaining;
-               slice->offset += bytes_remaining;
-               break;
-           }
-       }
-    }
-}
-
 static gpointer
 device_thread(
     gpointer data)
@@ -1085,15 +587,6 @@ device_thread(
 
     DBG(1, "(this is the device thread)");
 
-    if (self->disk_cache_dirname) {
-        GError *error = NULL;
-       self->disk_cache_thread = g_thread_create(disk_cache_thread, (gpointer)self, TRUE, &error);
-        if (!self->disk_cache_thread) {
-            g_critical(_("Error creating new thread: %s (%s)"),
-                error->message, errno? strerror(errno) : _("no error code"));
-        }
-    }
-
     /* This is the outer loop, that loops once for each split part written to
      * tape. */
     g_mutex_lock(self->state_mutex);
@@ -1109,33 +602,29 @@ device_thread(
         if (elt->cancelled)
            break;
 
-        g_mutex_unlock(self->state_mutex);
-       self->slab_bytes_written = 0;
        DBG(2, "beginning to write part");
        msg = device_thread_write_part(self);
        DBG(2, "done writing part");
-        g_mutex_lock(self->state_mutex);
 
-       /* release any cache of a successful part, but don't bother at EOF */
-       if (msg->successful && !msg->eof)
-           release_part_cache(self);
+       if (!msg) /* cancelled */
+           break;
+
+       /* release the slices for this part, if there were any slices */
+       if (msg->successful && self->expect_cache_inform) {
+           fast_forward_slices(self, msg->size);
+       }
 
        xfer_queue_message(elt->xfer, msg);
 
+       /* pause ourselves and await instructions from the main thread */
+       self->paused = TRUE;
+
        /* if this is the last part, we're done with the part loop */
        if (self->no_more_parts)
            break;
-
-       /* pause ourselves and await instructions from the main thread */
-       self->paused = TRUE;
     }
-
     g_mutex_unlock(self->state_mutex);
 
-    /* make sure the other thread is done before we send XMSG_DONE */
-    if (self->disk_cache_thread)
-        g_thread_join(self->disk_cache_thread);
-
     /* tell the main thread we're done */
     xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
 
@@ -1146,49 +635,6 @@ device_thread(
  * Class mechanics
  */
 
-/* called with the slab_mutex held, this adds the reader_slab to the head of
- * the slab train and signals the condition variable. */
-static void
-add_reader_slab_to_train(
-    XferDestTaperSplitter *self)
-{
-    Slab *slab = self->reader_slab;
-
-    DBG(3, "adding slab of new data to the slab train");
-
-    if (self->newest_slab) {
-       self->newest_slab->next = slab;
-       slab->refcount++;
-
-       self->newest_slab->refcount--;
-    }
-
-    self->newest_slab = slab; /* steal reader_slab's ref */
-    self->reader_slab = NULL;
-
-    /* steal reader_slab's reference for newest_slab */
-
-    /* if any of the other pointers are waiting for this slab, update them */
-    if (self->disk_cache_dirname && !self->disk_cacher_slab) {
-       self->disk_cacher_slab = slab;
-       slab->refcount++;
-    }
-    if (self->use_mem_cache && !self->mem_cache_slab) {
-       self->mem_cache_slab = slab;
-       slab->refcount++;
-    }
-    if (!self->device_slab) {
-       self->device_slab = slab;
-       slab->refcount++;
-    }
-    if (!self->oldest_slab) {
-       self->oldest_slab = slab;
-       slab->refcount++;
-    }
-
-    g_cond_broadcast(self->slab_cond);
-}
-
 static void
 push_buffer_impl(
     XferElement *elt,
@@ -1196,7 +642,7 @@ push_buffer_impl(
     size_t size)
 {
     XferDestTaperSplitter *self = (XferDestTaperSplitter *)elt;
-    gpointer p;
+    gchar *p = buf;
 
     DBG(3, "push_buffer(%p, %ju)", buf, (uintmax_t)size);
 
@@ -1207,66 +653,52 @@ push_buffer_impl(
 
     /* handle EOF */
     if (G_UNLIKELY(buf == NULL)) {
-       /* send off the last, probably partial slab */
-       g_mutex_lock(self->slab_mutex);
-
-       /* create a new, empty slab if necessary */
-       if (!self->reader_slab) {
-           self->reader_slab = alloc_slab(self, FALSE);
-            if (!self->reader_slab) {
-                /* we've been cancelled while waiting for a slab */
-                g_mutex_unlock(self->slab_mutex);
-
-                /* wait for the xfer to cancel, so we don't get another buffer
-                 * pushed to us (and do so *without* the mutex held) */
-                wait_until_xfer_cancelled(XFER_ELEMENT(self)->xfer);
-
-                goto free_and_finish;
-            }
-           self->reader_slab->serial = self->next_serial++;
-       }
-
-       add_reader_slab_to_train(self);
-       g_mutex_unlock(self->slab_mutex);
-
+       /* indicate EOF to the device thread */
+       g_mutex_lock(self->ring_mutex);
+       self->ring_head_at_eof = TRUE;
+       g_cond_broadcast(self->ring_add_cond);
+       g_mutex_unlock(self->ring_mutex);
        goto free_and_finish;
     }
 
-    p = buf;
-    while (1) {
-       gsize copy_size;
-
-       /* get a fresh slab, if needed */
-       if (G_UNLIKELY(!self->reader_slab) || self->reader_slab->size == self->slab_size) {
-           g_mutex_lock(self->slab_mutex);
-           if (self->reader_slab)
-               add_reader_slab_to_train(self);
-           self->reader_slab = alloc_slab(self, FALSE);
-            if (!self->reader_slab) {
-                /* we've been cancelled while waiting for a slab */
-                g_mutex_unlock(self->slab_mutex);
-
-                /* wait for the xfer to cancel, so we don't get another buffer
-                 * pushed to us (and do so *without* the mutex held) */
-                wait_until_xfer_cancelled(XFER_ELEMENT(self)->xfer);
-
-                goto free_and_finish;
-            }
-           self->reader_slab->serial = self->next_serial++;
-           g_mutex_unlock(self->slab_mutex);
-       }
+    /* push the block into the ring buffer, in pieces if necessary */
+    g_mutex_lock(self->ring_mutex);
+    while (size > 0) {
+       gsize avail;
 
-       if (size == 0)
-           break;
-
-       copy_size = MIN(self->slab_size - self->reader_slab->size, size);
-       memcpy(self->reader_slab->base+self->reader_slab->size, p, copy_size);
+       /* wait for some space */
+       while (self->ring_count == self->ring_length && !elt->cancelled) {
+           DBG(9, "waiting for any space to buffer pushed data");
+           g_cond_wait(self->ring_free_cond, self->ring_mutex);
+       }
+       DBG(9, "done waiting");
 
-       self->reader_slab->size += copy_size;
-       p += copy_size;
-       size -= copy_size;
+       if (elt->cancelled)
+           goto unlock_and_free_and_finish;
+
+       /* only copy to the end of the buffer, if the available space wraps
+        * around to the beginning */
+       avail = MIN(size, self->ring_length - self->ring_count);
+       avail = MIN(avail, self->ring_length - self->ring_head);
+
+       /* copy AVAIL bytes into the ring buf (knowing it's contiguous) */
+       memmove(self->ring_buffer + self->ring_head, p, avail);
+
+       /* reset the ring variables to represent this state */
+       self->ring_count += avail;
+       self->ring_head += avail; /* will, at most, hit ring_length */
+       if (self->ring_head == self->ring_length)
+           self->ring_head = 0;
+       p = (gpointer)((guchar *)p + avail);
+       size -= avail;
+
+       /* and give the device thread a notice that data is ready */
+       g_cond_broadcast(self->ring_add_cond);
     }
 
+unlock_and_free_and_finish:
+    g_mutex_unlock(self->ring_mutex);
+
 free_and_finish:
     if (buf)
         g_free(buf);
@@ -1309,27 +741,47 @@ cancel_impl(
     g_cond_broadcast(self->state_cond);
     g_mutex_unlock(self->state_mutex);
 
-    g_mutex_lock(self->slab_mutex);
-    g_cond_broadcast(self->slab_cond);
-    g_cond_broadcast(self->slab_free_cond);
-    g_mutex_unlock(self->slab_mutex);
+    g_mutex_lock(self->ring_mutex);
+    g_cond_broadcast(self->ring_add_cond);
+    g_cond_broadcast(self->ring_free_cond);
+    g_mutex_unlock(self->ring_mutex);
 
     return rv;
 }
 
 static void
 start_part_impl(
-    XferDestTaper *xdtself,
+    XferDestTaper *xdt,
     gboolean retry_part,
     dumpfile_t *header)
 {
-    XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(xdtself);
+    XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(xdt);
 
     g_assert(self->device != NULL);
     g_assert(!self->device->in_file);
     g_assert(header != NULL);
 
-    DBG(1, "start_part(retry_part=%d)", retry_part);
+    DBG(1, "start_part()");
+
+    /* we can only retry the part if we're getting slices via cache_inform's */
+    if (retry_part) {
+       if (self->last_part_successful) {
+           xfer_cancel_with_error(XFER_ELEMENT(self),
+               _("Previous part did not fail; cannot retry"));
+           return;
+       }
+
+       if (!self->expect_cache_inform) {
+           xfer_cancel_with_error(XFER_ELEMENT(self),
+               _("No cache for previous failed part; cannot retry"));
+           return;
+       }
+
+       self->bytes_to_read_from_slices = self->part_bytes_written;
+    } else {
+       /* don't read any bytes from the slices, since we're not retrying */
+       self->bytes_to_read_from_slices = 0;
+    }
 
     g_mutex_lock(self->state_mutex);
     g_assert(self->paused);
@@ -1339,27 +791,6 @@ start_part_impl(
        dumpfile_free(self->part_header);
     self->part_header = dumpfile_copy(header);
 
-    if (retry_part) {
-       if (!self->use_mem_cache && !self->part_slices) {
-           g_mutex_unlock(self->state_mutex);
-           xfer_cancel_with_error(XFER_ELEMENT(self),
-               _("Failed part was not cached; cannot retry"));
-           return;
-       }
-       g_assert(!self->last_part_successful);
-       self->retry_part = TRUE;
-    } else {
-       g_assert(self->last_part_successful);
-       self->retry_part = FALSE;
-       self->part_first_serial = self->part_stop_serial;
-       if (self->part_size != 0) {
-           self->part_stop_serial = self->part_first_serial + self->slabs_per_part;
-       } else {
-           /* set part_stop_serial to an effectively infinite value */
-           self->part_stop_serial = G_MAXUINT64;
-       }
-    }
-
     DBG(1, "unpausing");
     self->paused = FALSE;
     g_cond_broadcast(self->state_cond);
@@ -1373,8 +804,11 @@ use_device_impl(
     Device *device)
 {
     XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(xdtself);
+    StreamingRequirement newstreaming;
     GValue val;
 
+    DBG(1, "use_device(%s)%s", device->device_name, (device == self->device)? " (no change)":"");
+
     /* short-circuit if nothing is changing */
     if (self->device == device)
        return;
@@ -1390,9 +824,11 @@ use_device_impl(
     if (!device_property_get(self->device, PROPERTY_STREAMING, &val)
         || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) {
         g_warning("Couldn't get streaming type for %s", self->device->device_name);
-        self->streaming = STREAMING_REQUIREMENT_REQUIRED;
     } else {
-        self->streaming = g_value_get_enum(&val);
+        newstreaming = g_value_get_enum(&val);
+       if (newstreaming != self->streaming)
+           g_warning("New device has different streaming requirements from the original; "
+                   "ignoring new requirement");
     }
     g_value_unset(&val);
 
@@ -1408,41 +844,27 @@ use_device_impl(
 
 static void
 cache_inform_impl(
-    XferDestTaper *xdtself,
+    XferDestTaper *xdt,
     const char *filename,
     off_t offset,
     off_t length)
 {
-    XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(xdtself);
-    FileSlice *slice, *iter;
-
-    DBG(1, "cache_inform(\"%s\", %jd, %jd)", filename, (intmax_t)offset, (intmax_t)length);
+    XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(xdt);
+    FileSlice *slice = g_new(FileSlice, 1), *iter;
 
-    /* do we even need this info? */
-    if (self->disk_cache_dirname || self->use_mem_cache || self->part_size == 0)
-       return;
-
-    /* handle the (admittedly unlikely) event that length is larger than gsize.
-     * Hopefully if sizeof(off_t) = sizeof(gsize), this will get optimized out */
-    while (sizeof(off_t) > sizeof(gsize) && length > (off_t)SIZE_MAX) {
-       cache_inform_impl(xdtself, filename, offset, (off_t)SIZE_MAX);
-       offset += (off_t)SIZE_MAX;
-       length -= (off_t)SIZE_MAX;
-    }
-
-    slice = g_new0(FileSlice, 1);
+    slice->next = NULL;
     slice->filename = g_strdup(filename);
     slice->offset = offset;
-    slice->length = (gsize)length;
+    slice->length = length;
 
-    g_mutex_lock(self->state_mutex);
+    g_mutex_lock(self->part_slices_mutex);
     if (self->part_slices) {
        for (iter = self->part_slices; iter->next; iter = iter->next) {}
        iter->next = slice;
     } else {
        self->part_slices = slice;
     }
-    g_mutex_unlock(self->state_mutex);
+    g_mutex_unlock(self->part_slices_mutex);
 }
 
 static guint64
@@ -1450,7 +872,11 @@ get_part_bytes_written_impl(
     XferDestTaper *xdtself)
 {
     XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(xdtself);
-    return self->bytes_written + self->slab_bytes_written;
+
+    /* NOTE: this access is unsafe and may return inconsistent results (e.g, a
+     * partial write to the 64-bit value on a 32-bit system).  This is ok for
+     * the moment, as it's only informational, but be warned. */
+    return self->part_bytes_written;
 }
 
 static void
@@ -1462,15 +888,17 @@ instance_init(
 
     self->state_mutex = g_mutex_new();
     self->state_cond = g_cond_new();
-    self->slab_mutex = g_mutex_new();
-    self->slab_cond = g_cond_new();
-    self->slab_free_cond = g_cond_new();
+    self->ring_mutex = g_mutex_new();
+    self->ring_add_cond = g_cond_new();
+    self->ring_free_cond = g_cond_new();
+    self->part_slices_mutex = g_mutex_new();
 
-    self->last_part_successful = TRUE;
+    self->device = NULL;
     self->paused = TRUE;
-    self->part_stop_serial = 0;
-    self->disk_cache_read_fd = -1;
-    self->disk_cache_write_fd = -1;
+    self->part_header = NULL;
+    self->partnum = 1;
+    self->part_bytes_written = 0;
+    self->part_slices = NULL;
 }
 
 static void
@@ -1478,49 +906,30 @@ finalize_impl(
     GObject * obj_self)
 {
     XferDestTaperSplitter *self = XFER_DEST_TAPER_SPLITTER(obj_self);
-    Slab *slab, *next_slab;
     FileSlice *slice, *next_slice;
 
-    if (self->disk_cache_dirname)
-       g_free(self->disk_cache_dirname);
-
     g_mutex_free(self->state_mutex);
     g_cond_free(self->state_cond);
 
-    g_mutex_free(self->slab_mutex);
-    g_cond_free(self->slab_cond);
-    g_cond_free(self->slab_free_cond);
+    g_mutex_free(self->ring_mutex);
+    g_cond_free(self->ring_add_cond);
+    g_cond_free(self->ring_free_cond);
 
-    /* free the slab train, without reference to the refcounts */
-    for (slab = self->oldest_slab; slab != NULL; slab = next_slab) {
-        next_slab = slab->next;
-        free_slab(slab);
-    }
-    self->disk_cacher_slab = NULL;
-    self->mem_cache_slab = NULL;
-    self->device_slab = NULL;
-    self->oldest_slab = NULL;
-    self->newest_slab = NULL;
-
-    if (self->reader_slab) {
-        free_slab(self->reader_slab);
-        self->reader_slab = NULL;
-    }
+    g_mutex_free(self->part_slices_mutex);
 
     for (slice = self->part_slices; slice; slice = next_slice) {
        next_slice = slice->next;
-       g_free(slice->filename);
+       if (slice->filename)
+           g_free(slice->filename);
        g_free(slice);
     }
 
+    if (self->ring_buffer)
+       g_free(self->ring_buffer);
+
     if (self->part_header)
        dumpfile_free(self->part_header);
 
-    if (self->disk_cache_read_fd != -1)
-       close(self->disk_cache_read_fd); /* ignore error */
-    if (self->disk_cache_write_fd != -1)
-       close(self->disk_cache_write_fd); /* ignore error */
-
     if (self->device)
        g_object_unref(self->device);
 
@@ -1589,81 +998,48 @@ xfer_dest_taper_splitter(
     Device *first_device,
     size_t max_memory,
     guint64 part_size,
-    gboolean use_mem_cache,
-    const char *disk_cache_dirname)
+    gboolean expect_cache_inform)
 {
     XferDestTaperSplitter *self = (XferDestTaperSplitter *)g_object_new(XFER_DEST_TAPER_SPLITTER_TYPE, NULL);
+    GValue val;
+
+    /* max_memory and part_size get rounded up to the next multiple of
+     * block_size */
+    max_memory = ((max_memory + first_device->block_size - 1)
+                       / first_device->block_size) * first_device->block_size;
+    if (part_size)
+       part_size = ((part_size + first_device->block_size - 1)
+                           / first_device->block_size) * first_device->block_size;
 
-    self->max_memory = max_memory;
     self->part_size = part_size;
     self->partnum = 1;
     self->device = first_device;
-    g_object_ref(self->device);
-
-    /* pick only one caching mechanism, caller! */
-    g_assert(!use_mem_cache || !disk_cache_dirname);
-
-    /* and if part size is zero, then we don't do any caching */
-    if (part_size == 0) {
-       g_assert(!use_mem_cache && !disk_cache_dirname);
-    }
 
-    self->use_mem_cache = use_mem_cache;
-    if (disk_cache_dirname) {
-       self->disk_cache_dirname = g_strdup(disk_cache_dirname);
-
-       self->part_slices = g_new0(FileSlice, 1);
-       self->part_slices->filename = NULL; /* indicates "use disk_cache_read_fd" */
-       self->part_slices->offset = 0;
-       self->part_slices->length = 0; /* will be filled in in start_part */
-    }
-
-    /* calculate the device-dependent parameters */
+    g_object_ref(self->device);
     self->block_size = first_device->block_size;
+    self->paused = TRUE;
+    self->no_more_parts = FALSE;
 
-    /* The slab size should be large enough to justify the overhead of all
-     * of the mutexes, but it needs to be small enough to have a few slabs
-     * available so that the threads are not constantly waiting on one
-     * another.  The choice is sixteen blocks, not more than a quarter of
-     * the part size, and not more than 10MB.  If we're not using the mem
-     * cache, then avoid exceeding max_memory by keeping the slab size less
-     * than a quarter of max_memory. */
-
-    self->slab_size = self->block_size * 16;
-    if (self->part_size)
-        self->slab_size = MIN(self->slab_size, self->part_size / 4);
-    self->slab_size = MIN(self->slab_size, 10*1024*1024);
-    if (!self->use_mem_cache)
-        self->slab_size = MIN(self->slab_size, self->max_memory / 4);
-
-    /* round slab size up to the nearest multiple of the block size */
-    self->slab_size =
-        ((self->slab_size + self->block_size - 1) / self->block_size) * self->block_size;
-
-    /* round part size up to a multiple of the slab size */
-    if (self->part_size != 0) {
-        self->slabs_per_part = (self->part_size + self->slab_size - 1) / self->slab_size;
-        self->part_size = self->slabs_per_part * self->slab_size;
-    } else {
-        self->slabs_per_part = 0;
-    }
-
-    /* fill in the file slice's length, now that we know the real part size */
-    if (self->disk_cache_dirname)
-        self->part_slices->length = self->part_size;
+    /* set up a ring buffer of size max_memory */
+    self->ring_length = max_memory;
+    self->ring_buffer = g_malloc(max_memory);
+    self->ring_head = self->ring_tail = 0;
+    self->ring_count = 0;
+    self->ring_head_at_eof = 0;
 
-    if (self->use_mem_cache) {
-        self->max_slabs = self->slabs_per_part;
+    /* get this new device's streaming requirements */
+    bzero(&val, sizeof(val));
+    if (!device_property_get(self->device, PROPERTY_STREAMING, &val)
+        || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) {
+        g_warning("Couldn't get streaming type for %s", self->device->device_name);
+        self->streaming = STREAMING_REQUIREMENT_REQUIRED;
     } else {
-        self->max_slabs = (self->max_memory + self->slab_size - 1) / self->slab_size;
+        self->streaming = g_value_get_enum(&val);
     }
+    g_value_unset(&val);
 
-    /* Note that max_slabs == 1 will cause deadlocks, due to some assumptions in
-        * alloc_slab, so we check here that it's at least 2. */
-    if (self->max_slabs < 2)
-        self->max_slabs = 2;
-
-    DBG(1, "using slab_size %zu and max_slabs %ju", self->slab_size, (uintmax_t)self->max_slabs);
+    /* grab data from cache_inform, just in case we hit PEOM */
+    self->expect_cache_inform = expect_cache_inform;
 
     return XFER_ELEMENT(self);
 }
index 6d961a2eb232a505a38bb7b74325ac7998c3b7d6..88ef24785ef9b28e2185f2df6f79d1c0e9c75d57 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
 #include "amanda.h"
 #include "xfer-device.h"
 
+static GObjectClass *parent_class = NULL;
+
+/*
+ * Method implementation
+ */
+
+static void
+cache_inform_impl(
+    XferDestTaper *self G_GNUC_UNUSED,
+    const char *filename G_GNUC_UNUSED,
+    off_t offset G_GNUC_UNUSED,
+    off_t length G_GNUC_UNUSED)
+{
+    /* do nothing */
+}
+
+static void
+instance_init(
+    XferElement *elt)
+{
+    elt->can_generate_eof = FALSE;
+}
+
 static void
 class_init(
     XferDestTaperClass * selfc)
 {
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
 
+    selfc->cache_inform = cache_inform_impl;
+
     klass->perl_class = "Amanda::Xfer::Dest::Taper";
+
+    parent_class = g_type_class_peek_parent(selfc);
 }
 
 GType
@@ -46,7 +73,7 @@ xfer_dest_taper_get_type (void)
             NULL /* class_data */,
             sizeof (XferDestTaper),
             0 /* n_preallocs */,
-            (GInstanceInitFunc) NULL,
+            (GInstanceInitFunc) instance_init,
             NULL
         };
 
diff --git a/device-src/xfer-dest-taper.h b/device-src/xfer-dest-taper.h
new file mode 100644 (file)
index 0000000..e7b8537
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * 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
+ *
+ * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#ifndef XFER_DEST_TAPER_H
+#define XFER_DEST_TAPER_H
+
+#include "amxfer.h"
+#include "device.h"
+
+/*
+ * class declaration for XferDestTaper (an abstract base class)
+ */
+
+GType xfer_dest_taper_get_type(void);
+#define XFER_DEST_TAPER_TYPE (xfer_dest_taper_get_type())
+#define XFER_DEST_TAPER(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_get_type(), XferDestTaper)
+#define XFER_DEST_TAPER_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_get_type(), XferDestTaper const)
+#define XFER_DEST_TAPER_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_taper_get_type(), XferDestTaperClass)
+#define IS_XFER_DEST_TAPER(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_taper_get_type ())
+#define XFER_DEST_TAPER_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_taper_get_type(), XferDestTaperClass)
+
+typedef struct XferDestTaper_ {
+    XferElement __parent__;
+} XferDestTaper;
+
+typedef struct {
+    XferElementClass __parent__;
+
+    /* see xfer-device.h for details of these methods */
+    void (*start_part)(XferDestTaper *self, gboolean retry_part, dumpfile_t *header);
+    void (*use_device)(XferDestTaper *self, Device *device);
+    void (*cache_inform)(XferDestTaper *self, const char *filename, off_t offset,
+                        off_t length);
+    guint64 (*get_part_bytes_written)(XferDestTaper *self);
+} XferDestTaperClass;
+
+/* Start writing the next part to the given device.  The part will be written
+ * to the device given to use_device, which should be open and properly positioned.
+ * It should not have a file open yet.
+ *
+ * @param self: the XferDestTaper object
+ * @param retry_part: retry the previous (incomplete) part if true
+ * @param header: part header
+ */
+void xfer_dest_taper_start_part(
+    XferElement *self,
+    gboolean retry_part,
+    dumpfile_t *header);
+
+/* Prepare to write subsequent parts to the given device.  The device must
+ * not be started yet.  It is not necessary to call this method for the first
+ * device used in a transfer.
+ *
+ * @param self: the XferDestTaper object
+ * @param device: the device
+ */
+void xfer_dest_taper_use_device(
+    XferElement *self,
+    Device *device);
+
+/* Add a slice of data to the cache for the element.  This is used by the taper
+ * when reading from holding disk, to tell the element which holding disk files
+ * contain the data that might be needed when rewinding, but can be used in any
+ * situation where the part data is already on-disk.  The order of calls to this
+ * function dictates the order in whch the files will be read, and no gaps or
+ * overlaps are supported.  Note, too, that this must be called *before* any of
+ * the data in the new file is sent into the transfer.
+ *
+ * @param self: the XferDestTaper object
+ * @param filename: the fully qualified filename of the cache file
+ * @param offset: offset into the file at which data begins
+ * @param length: length of data in file
+ */
+void xfer_dest_taper_cache_inform(
+    XferElement *self,
+    const char *filename,
+    off_t offset,
+    off_t length);
+
+/* Return the number of bytes written for the current part.
+ *
+ * @param self: the XferDestTaper object
+ */
+guint64 xfer_dest_taper_get_part_bytes_written(
+    XferElement *self);
+
+#endif
index 8fbc7a2c71339642a9088a6da78af31fa3072085..f18916b3df6d4836a77bc7eee2884df29c91abcf 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "amxfer.h"
 #include "device.h"
+#include "xfer-dest-taper.h"
 
 /* A transfer source that reads from a Device. The device must be positioned
  * at the start of a file before the transfer is started.  The transfer will
@@ -39,97 +40,40 @@ XferElement *xfer_source_device(
 
 /* A transfer destination that writes bytes to a Device.  The device should have a
  * file started, ready for a device_write_block call.  On completion of the transfer,
- * the file will be finished.
+ * the file will be finished.  If a device error occurs, the transfer will be cancelled.
+ *
+ * If cancel_at_leom is true, then the transfer will also be cancelled on LEOM, with
+ * the error message containing the string "LEOM detected" (this is used by amtapetype).
  *
  * Implemented in xfer-dest-device.c
  *
  * @param device: the Device to write to, with a file started
- * @param max_memory: total amount of memory to use for buffers, or zero
- *                    for a reasonable default.
+ * @param canel_at_leom: if true, the element will cancel the transfer at LEOM.
  * @return: new element
  */
 XferElement *xfer_dest_device(
     Device *device,
-    size_t max_memory);
-
-/*
- * class declaration for XferDestTaper (an abstract base class)
- */
-
-GType xfer_dest_taper_get_type(void);
-#define XFER_DEST_TAPER_TYPE (xfer_dest_taper_get_type())
-#define XFER_DEST_TAPER(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_get_type(), XferDestTaper)
-#define XFER_DEST_TAPER_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_taper_get_type(), XferDestTaper const)
-#define XFER_DEST_TAPER_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_taper_get_type(), XferDestTaperClass)
-#define IS_XFER_DEST_TAPER(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_taper_get_type ())
-#define XFER_DEST_TAPER_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_taper_get_type(), XferDestTaperClass)
-
-typedef struct XferDestTaper_ {
-    XferElement __parent__;
-} XferDestTaper;
-
-typedef struct {
-    XferElementClass __parent__;
-
-    /* see xfer-device.h for details of these methods */
-    void (*start_part)(XferDestTaper *self, gboolean retry_part, dumpfile_t *header);
-    void (*use_device)(XferDestTaper *self, Device *device);
-    void (*cache_inform)(XferDestTaper *self, const char *filename, off_t offset,
-                        off_t length);
-    guint64 (*get_part_bytes_written)(XferDestTaper *self);
-} XferDestTaperClass;
-
-/* Start writing the next part to the given device.  The part will be written
- * to the device given to use_device, which should be open and properly positioned.
- * It should not have a file open yet.
- *
- * @param self: the XferDestTaper object
- * @param retry_part: retry the previous (incomplete) part if true
- * @param header: part header
- */
-void xfer_dest_taper_start_part(
-    XferElement *self,
-    gboolean retry_part,
-    dumpfile_t *header);
-
-/* Prepare to write subsequent parts to the given device.  The device must
- * not be started yet.  It is not necessary to call this method for the first
- * device used in a transfer.
- *
- * @param self: the XferDestTaper object
- * @param device: the device
- */
-void xfer_dest_taper_use_device(
-    XferElement *self,
-    Device *device);
-
-/* Add a slice of data to the cache for the element.  This is used by the taper
- * when reading from holding disk, to tell the element which holding disk files
- * contain the data that might be needed when rewinding, but can be used in any
- * situation where the part data is already on-disk.  The order of calls to this
- * function dictates the order in whch the files will be read, and no gaps or
- * overlaps are supported.  Note, too, that this must be called *before* any of
- * the data in the new file is sent into the transfer.
- *
- * @param self: the XferDestTaper object
- * @param filename: the fully qualified filename of the cache file
- * @param offset: offset into the file at which data begins
- * @param length: length of data in file
- */
-void xfer_dest_taper_cache_inform(
-    XferElement *self,
-    const char *filename,
-    off_t offset,
-    off_t length);
+    gboolean canel_at_leom);
 
-/* Return the number of bytes written for the current part.
+/* Constructor for XferDestTaperSplitter, which writes data to devices block by
+ * block and splitting parts but no caching.
  *
- * @param self: the XferDestTaper object
+ * @param first_device: the first device that will be used with this xfer, used
+ *                      to calculate some internal parameters
+ * @param max_memory: total amount of memory to use for buffers, or zero
+ *                    for a reasonable default.
+ * @param part_size: the desired size of each part
+ * @param expect_cache_inform: TRUE if this element will get cache_inform messages
+ * @return: new element
  */
-guint64 xfer_dest_taper_get_part_bytes_written(
-    XferElement *self);
+XferElement *
+xfer_dest_taper_splitter(
+    Device *first_device,
+    size_t max_memory,
+    guint64 part_size,
+    gboolean expect_cache_inform);
 
-/* Constructor for XferDestTaperSplitter, which writes data to devices block by
+/* Constructor for XferDestTaperCacher, which writes data to devices block by
  * block and handles caching and splitting parts.
  *
  * @param first_device: the first device that will be used with this xfer, used
@@ -143,7 +87,7 @@ guint64 xfer_dest_taper_get_part_bytes_written(
  * @return: new element
  */
 XferElement *
-xfer_dest_taper_splitter(
+xfer_dest_taper_cacher(
     Device *first_device,
     size_t max_memory,
     guint64 part_size,
index cb4f113fa02ec7d08d33253f90526430c8ed2079..c709313c04956b5fb8e29fe3f0c797917a2c931e 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "device.h"
 #include "property.h"
 #include "xfer-device.h"
index 425a83789218e3f8a3a248d5f7696e16583475a9..da2813473ebbdc9f3bb3efeae70c3b141f71b8ac 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "device.h"
 #include "property.h"
 #include "xfer-device.h"
@@ -120,40 +120,19 @@ _xsr_dbg(const char *fmt, ...)
  * Implementation
  */
 
+/* common code for both directtcp_listen_thread and directtcp_connect_thread;
+ * this is called after self->conn is filled in and carries out the data
+ * transfer over that connection.  NOTE: start_part_mutex is HELD when this
+ * function begins */
 static gpointer
-directtcp_thread(
-       gpointer data)
+directtcp_common_thread(
+       XferSourceRecovery *self)
 {
-    XferSourceRecovery *self = XFER_SOURCE_RECOVERY(data);
     XferElement *elt = XFER_ELEMENT(self);
     char *errmsg = NULL;
 
-    /* first, we need to accept the incoming connection; we do this while
-     * holding the start_part_mutex, so that a part doesn't get started until
-     * we're finished with the device */
-    g_mutex_lock(self->start_part_mutex);
-
-    if (elt->cancelled) {
-       g_mutex_unlock(self->start_part_mutex);
-       goto send_done;
-    }
-
-    g_assert(self->device != NULL); /* have a device */
-    g_assert(elt->output_listen_addrs != NULL); /* listening on it */
-    g_assert(self->listen_ok);
-
-    DBG(2, "accepting DirectTCP connection on device %s", self->device->device_name);
-    if (!device_accept(self->device, &self->conn, NULL, NULL)) {
-       xfer_cancel_with_error(elt,
-           _("error accepting DirectTCP connection: %s"),
-           device_error_or_status(self->device));
-       g_mutex_unlock(self->start_part_mutex);
-       wait_until_xfer_cancelled(elt->xfer);
-       goto send_done;
-    }
-
     /* send XMSG_READY to indicate it's OK to call start_part now */
-    DBG(2, "connection accepted; sending XMSG_READY");
+    DBG(2, "sending XMSG_READY");
     xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_READY, 0));
 
     /* now we sit around waiting for signals to write a part */
@@ -228,9 +207,90 @@ close_conn_and_send_done:
        }
     }
 
+    xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_DONE, 0));
+
+    return NULL;
+}
+
+static gpointer
+directtcp_connect_thread(
+       gpointer data)
+{
+    XferSourceRecovery *self = XFER_SOURCE_RECOVERY(data);
+    XferElement *elt = XFER_ELEMENT(self);
+
+    DBG(1, "(this is directtcp_connect_thread)")
+
+    /* first, we need to accept the incoming connection; we do this while
+     * holding the start_part_mutex, so that a part doesn't get started until
+     * we're finished with the device */
+    g_mutex_lock(self->start_part_mutex);
+
+    if (elt->cancelled) {
+       g_mutex_unlock(self->start_part_mutex);
+       goto send_done;
+    }
+
+    g_assert(self->device != NULL); /* have a device */
+    g_assert(elt->output_listen_addrs != NULL); /* listening on it */
+    g_assert(self->listen_ok);
+
+    DBG(2, "accepting DirectTCP connection on device %s", self->device->device_name);
+    if (!device_accept(self->device, &self->conn, NULL, NULL)) {
+       xfer_cancel_with_error(elt,
+           _("error accepting DirectTCP connection: %s"),
+           device_error_or_status(self->device));
+       g_mutex_unlock(self->start_part_mutex);
+       wait_until_xfer_cancelled(elt->xfer);
+       goto send_done;
+    }
+    DBG(2, "DirectTCP connection accepted");
+
+    return directtcp_common_thread(self);
+
 send_done:
     xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_DONE, 0));
+    return NULL;
+}
+
+static gpointer
+directtcp_listen_thread(
+       gpointer data)
+{
+    XferSourceRecovery *self = XFER_SOURCE_RECOVERY(data);
+    XferElement *elt = XFER_ELEMENT(self);
+
+    DBG(1, "(this is directtcp_listen_thread)");
+
+    /* we need to make an outgoing connection to downstream; we do this while
+     * holding the start_part_mutex, so that a part doesn't get started until
+     * we're finished with the device */
+    g_mutex_lock(self->start_part_mutex);
+
+    if (elt->cancelled) {
+       g_mutex_unlock(self->start_part_mutex);
+       goto send_done;
+    }
+
+    g_assert(self->device != NULL); /* have a device */
+    g_assert(elt->downstream->input_listen_addrs != NULL); /* downstream listening */
+
+    DBG(2, "making DirectTCP connection on device %s", self->device->device_name);
+    if (!device_connect(self->device, FALSE, elt->downstream->input_listen_addrs,
+                       &self->conn, NULL, NULL)) {
+       xfer_cancel_with_error(elt,
+           _("error making DirectTCP connection: %s"),
+           device_error_or_status(self->device));
+       g_mutex_unlock(self->start_part_mutex);
+       wait_until_xfer_cancelled(elt->xfer);
+       goto send_done;
+    }
+    DBG(2, "DirectTCP connect succeeded");
+
+    return directtcp_common_thread(self);
 
+send_done:
+    xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_DONE, 0));
     return NULL;
 }
 
@@ -251,6 +311,8 @@ setup_impl(
        }
        self->listen_ok = TRUE;
     } else {
+       /* no output_listen_addrs for either XFER_MECH_DIRECTTCP_LISTEN or
+        * XFER_MECH_PULL_BUFFER */
        elt->output_listen_addrs = NULL;
     }
 
@@ -265,7 +327,11 @@ start_impl(
 
     if (elt->output_mech == XFER_MECH_DIRECTTCP_CONNECT) {
        g_assert(elt->output_listen_addrs != NULL);
-       self->thread = g_thread_create(directtcp_thread, (gpointer)self, FALSE, NULL);
+       self->thread = g_thread_create(directtcp_connect_thread, (gpointer)self, FALSE, NULL);
+       return TRUE; /* we'll send XMSG_DONE */
+    } else if (elt->output_mech == XFER_MECH_DIRECTTCP_LISTEN) {
+       g_assert(elt->output_listen_addrs == NULL);
+       self->thread = g_thread_create(directtcp_listen_thread, (gpointer)self, FALSE, NULL);
        return TRUE; /* we'll send XMSG_DONE */
     } else {
        /* nothing to prepare for - we're ready already! */
@@ -414,7 +480,8 @@ start_part_impl(
 
     /* make sure we're ready to go */
     g_assert(self->paused);
-    if (XFER_ELEMENT(self)->output_mech == XFER_MECH_DIRECTTCP_CONNECT) {
+    if (XFER_ELEMENT(self)->output_mech == XFER_MECH_DIRECTTCP_CONNECT
+     || XFER_ELEMENT(self)->output_mech == XFER_MECH_DIRECTTCP_LISTEN) {
        g_assert(self->conn != NULL);
     }
 
@@ -480,6 +547,7 @@ get_mech_pairs_impl(
     };
     static xfer_element_mech_pair_t directtcp_mech_pairs[] = {
        { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_CONNECT, 0, 1},
+       { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_LISTEN, 0, 1},
        /* devices which support DirectTCP are usually not very efficient
         * at delivering data via device_read_block, so this counts an extra
         * byte operation in the cost metrics (2 here vs. 1 in basic_mech_pairs).
index 3f810c3f128b57c81246744e4a0bd9ae5931ffeb..f2f3052c1681cc9b5937d88373a5159e72d26252 100644 (file)
@@ -66,12 +66,3 @@ EXTRA_DIST += $(lbltempl_DATA)
 
 # config.status leaves config.log files around
 CLEANFILES += config.log
-
-# figure out whether to put foo.in or foo itself into the dist tarball, based on whether
-# foo.in exists.
-
-INSTALLPERMS_data = chown=amanda \
-       dest=$(templatedir) $(template_DATA) \
-       dest=$(server_exampledir) $(example_DATA) \
-       dest=$(client_exampledir) $(example_DATA) \
-       dest=$(lbltempldir) $(lbltempl_DATA)
index 3602b47cef839030147f532c586ee18296fe1dd8..f8741e02e9203d5e5c5a037c4b58c6c04e65f0cb 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -125,7 +127,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -153,7 +154,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -166,10 +166,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -183,7 +187,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -196,10 +202,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -211,21 +220,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -304,7 +317,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -324,10 +337,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -383,78 +393,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -465,12 +530,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -485,17 +579,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -504,60 +602,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -565,13 +722,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -580,9 +743,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -618,7 +784,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -627,7 +792,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -635,19 +799,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -673,47 +860,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -721,6 +964,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -743,19 +987,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -765,13 +1011,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -815,6 +1058,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -881,6 +1125,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 amanda_dir = $(amdatadir)
 templatedir = $(amanda_dir)/template.d
 server_exampledir = $(amanda_dir)/example
@@ -930,15 +1187,6 @@ lbltempl_DATA = DLT.ps \
                DLT-A4.ps \
                 DIN-A4.ps 
 
-
-# figure out whether to put foo.in or foo itself into the dist tarball, based on whether
-# foo.in exists.
-INSTALLPERMS_data = chown=amanda \
-       dest=$(templatedir) $(template_DATA) \
-       dest=$(server_exampledir) $(example_DATA) \
-       dest=$(client_exampledir) $(example_DATA) \
-       dest=$(lbltempldir) $(lbltempl_DATA)
-
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -1228,29 +1476,12 @@ uninstall-am: uninstall-client_exampleDATA uninstall-lbltemplDATA \
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index cec4ac521444b9225d59a6548b996ab1867acd33..7ef107b681ab10f80716b5a785222c115d3a219c 100644 (file)
@@ -133,17 +133,13 @@ tapedev "@EXAMPLE_TAPEDEV@"       # tape changer or device to use
 # encounters, uncomment the line below. Note that this will ERASE any
 # non-Amanda tapes you may have, and may also ERASE any near-failing tapes.
 # Use with caution.
-## label_new_tapes "@DEFAULT_CONFIG@-%%%"
+## autolabel "@DEFAULT_CONFIG@-%%%" empty
 
 maxdumpsize -1         # Maximum number of bytes the planner will schedule
                        # for a run (default: runtapes * tape_length).
 tapetype HP-DAT                # what kind of tape it is (see tapetypes below)
 labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$"      # label constraint regex: all tapes must match
 
-amrecover_do_fsf yes           # amrecover will call amrestore with the
-                               # -f flag for faster positioning of the tape.
-amrecover_check_label yes      # amrecover will call amrestore with the
-                               # -l flag to check the label.
 amrecover_changer "changer"    # amrecover will use the changer if you restore
     # from this device. It could be a string like 'changer' and amrecover will use your
     # changer if you set your tape to 'changer' with 'setdevice changer' or via 
@@ -268,8 +264,13 @@ indexdir "@CONFIG_DIR@/@DEFAULT_CONFIG@/index"             # index directory
 #     lbl-templ "@CONFIG_DIR@/config/lbl.exabyte.ps"
 # }
 
+define tapetype global {
+    part_size 3G
+    part_cache_type none
+}
 
 define tapetype QIC-60 {
+    global
     comment "Archive Viper"
     length 60 mbytes
     filemark 100 kbytes                # don't know a better value
@@ -277,6 +278,7 @@ define tapetype QIC-60 {
 }
 
 define tapetype DEC-DLT2000 {
+    global
     comment "DEC Differential Digital Linear Tape 2000"
     length 15000 mbytes
     filemark 8 kbytes
@@ -286,6 +288,7 @@ define tapetype DEC-DLT2000 {
 # goluboff@butch.Colorado.EDU
 # in amanda-users (Thu Dec 26 01:55:38 MEZ 1996)
 define tapetype DLT {
+    global
     comment "DLT tape drives"
     length 20000 mbytes                # 20 Gig tapes
     filemark 2000 kbytes       # I don't know what this means
@@ -293,6 +296,7 @@ define tapetype DLT {
 }
 
 define tapetype SURESTORE-1200E {
+    global
     comment "HP AutoLoader"
     length 3900 mbytes
     filemark 100 kbytes
@@ -300,6 +304,7 @@ define tapetype SURESTORE-1200E {
 }
 
 define tapetype EXB-8500 {
+    global
     comment "Exabyte EXB-8500 drive on decent machine"
     length 4200 mbytes
     filemark 48 kbytes
@@ -307,6 +312,7 @@ define tapetype EXB-8500 {
 }
 
 define tapetype EXB-8200 {
+    global
     comment "Exabyte EXB-8200 drive on decent machine"
     length 2200 mbytes
     filemark 2130 kbytes
@@ -314,6 +320,7 @@ define tapetype EXB-8200 {
 }
 
 define tapetype HP-DAT {
+    global
     comment "DAT tape drives"
     # data provided by Rob Browning <rlb@cs.utexas.edu>
     length 1930 mbytes
@@ -322,6 +329,7 @@ define tapetype HP-DAT {
 }
 
 define tapetype DAT {
+    global
     comment "DAT tape drives"
     length 1000 mbytes         # these numbers are not accurate
     filemark 100 kbytes                # but you get the idea
@@ -329,6 +337,7 @@ define tapetype DAT {
 }
 
 define tapetype MIMSY-MEGATAPE {
+    global
     comment "Megatape (Exabyte based) drive through Emulex on Vax 8600"
     length 2200 mbytes
     filemark 2130 kbytes
@@ -336,10 +345,11 @@ define tapetype MIMSY-MEGATAPE {
 }
 
 define tapetype SEAGATE-ULTRIUM-LTO {
-     comment "SEAGATE ULTRIUM 06242 LTO, compression off"
-     length 99584 mbytes
-     filemark 0 kbytes
-     speed 11288 kps
+    global
+    comment "SEAGATE ULTRIUM 06242 LTO, compression off"
+    length 99584 mbytes
+    filemark 0 kbytes
+    speed 11288 kps
 }
 
 # dumptypes
@@ -475,25 +485,6 @@ define tapetype SEAGATE-ULTRIUM-LTO {
 #                              only be performed when an 'amadmin force' 
 #                              has been issued 
 #                Default: [strategy standard]
-# tape_splitsize - (optional) split dump file into pieces of a specified size.
-#                This allows dumps to be spread across multiple tapes, and can
-#                potentially make more efficient use of tape space.  Note that
-#                if this value is too large (more than half the size of the
-#                average dump being split), substantial tape space can be
-#                wasted.  If too small, large dumps will be split into
-#                innumerable tiny dumpfiles, adding to restoration complexity.
-#                A good rule of thumb, usually, is 1/10 of the size of your
-#                tape.  Default: [disabled]
-# split_diskbuffer - (optional) When dumping a split dump  in  PORT-WRITE
-#                 mode (usually meaning "no holding disk"), buffer the split
-#                chunks to a file in the directory specified by this option.
-#                Default: [none]
-# fallback_splitsize - (optional) When dumping a split dump  in  PORT-WRITE
-#                 mode, if no split_diskbuffer is specified (or if we somehow
-#                 fail to use our split_diskbuffer), we must buffer split
-#                 chunks in memory.  This specifies the maximum size split
-#                 chunks can be in this scenario, and thus the maximum amount
-#                 of memory consumed for in-memory splitting.  Default: [10m]
 #
 # Note that you may specify previously defined dumptypes as a shorthand way of
 # defining parameters.
@@ -544,7 +535,6 @@ define dumptype user-tar {
 
 define dumptype user-tar-span {
     root-tar
-    tape_splitsize 3 Gb
     comment "tape-spanning user partitions dumped with tar"
     priority medium
 }
@@ -587,7 +577,6 @@ define dumptype comp-user {
 
 define dumptype comp-user-span {
     global
-    tape_splitsize 5 Gb
     comment "Tape-spanning non-root partitions on reasonably fast machines"
     compress client fast
     priority medium
index 1a0ee064ae16c45f46cd5c428ff9e0feea0f8b31..71d3fed5b18fa0b927f0a1464e31e15695c832ac 100644 (file)
@@ -50,14 +50,10 @@ device_output_buffer_size 1280k
 # encounters, uncomment the line below. Note that this will ERASE any
 # non-Amanda tapes you may have, and may also ERASE any near-failing tapes.
 # Use with caution.
-## label_new_tapes "DailySet1-%%%"
+## autolabel "DailySet1-%%%" empty
                        
 maxdumpsize -1         # Maximum total size the planner will schedule
                        # for a run (default: runtapes * tape_length) (kbytes).
-amrecover_do_fsf yes           # amrecover will call amrestore with the
-                               # -f flag for faster positioning of the tape.
-amrecover_check_label yes      # amrecover will call amrestore with the
-                               # -l flag to check the label.
 bumpmult 4             # threshold = bumpsize * bumpmult^(level-1)
 
 
index 149fc9efa057ce57da3ca999fe1549d82762548d..73e07de3c7af1a3284d61ef36197017432786bc8 100644 (file)
@@ -11,9 +11,7 @@ tapecycle 10 tapes    # the number of tapes in rotation
                        # cycle
 runtapes 1             # number of tapes to be used in a single run of amdump
 tpchanger "chg-multi"  # the tape-changer glue script
-tapedev "S3:"          # the no-rewind tape device to be used
 changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/changer.conf" 
-#changerdev "/dev/sg1"
 tapetype S3    # what kind of tape it is (see tapetypes below)
 
 holdingdisk hd2 {
@@ -21,7 +19,7 @@ holdingdisk hd2 {
     use 1000 Mb
     }
 
-label_new_tapes "@DEFAULT_CONFIG@-%%%%"        # Enable auto labeling 
+autolabel "@DEFAULT_CONFIG@-%%%%" empty
 labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$"      # label constraint regex: all tapes must match
 
 dtimeout 1800          # number of idle seconds before a dump is aborted.
@@ -51,14 +49,11 @@ define dumptype gui-base {
         index yes
 }
 
-define tapetype HARDDISK {
-    comment "Virtual Tapes"
-    length 5000 mbytes
-}
-
 define tapetype S3 {
-    comment "S3 Bucket"
-    length 10240 gigabytes # Bucket size 10TB
+    comment "S3 pseudo-tape"
+    length 10240 gigabytes
+    part_size 100G
+    part_cache_type none
 }
 
 includefile "./advanced.conf"
index 53ec87b830dbecb12f3e07d14f94bd2c7f62f670..9ed969e4a320f44753139273dfd9e068c8a9679e 100644 (file)
@@ -46,6 +46,8 @@ define dumptype gui-base {
 define tapetype HARDDISK {
     comment "Virtual Tapes"
     length 5000 mbytes
+    part_size 500 mbytes
+    part_cache_type none
 }
 
 includefile "./advanced.conf"
index da67d455808cbd9a24812c672c7b821c6aa36a9e..d73639ad0d79462a035d13483373f255f759ed8d 100644 (file)
 #                              only be performed when an 'amadmin force' 
 #                              has been issued 
 #                Default: [strategy standard]
-# tape_splitsize - (optional) split dump file into pieces of a specified size.
-#                This allows dumps to be spread across multiple tapes, and can
-#                potentially make more efficient use of tape space.  Note that
-#                if this value is too large (more than half the size of the
-#                average dump being split), substantial tape space can be
-#                wasted.  If too small, large dumps will be split into
-#                innumerable tiny dumpfiles, adding to restoration complexity.
-#                A good rule of thumb, usually, is 1/10 of the size of your
-#                tape.  Default: [disabled]
-# split_diskbuffer - (optional) When dumping a split dump  in  PORT-WRITE
-#                 mode (usually meaning "no holding disk"), buffer the split
-#                chunks to a file in the directory specified by this option.
-#                Default: [none]
-# fallback_splitsize - (optional) When dumping a split dump  in  PORT-WRITE
-#                 mode, if no split_diskbuffer is specified (or if we somehow
-#                 fail to use our split_diskbuffer), we must buffer split
-#                 chunks in memory.  This specifies the maximum size split
-#                 chunks can be in this scenario, and thus the maximum amount
-#                 of memory consumed for in-memory splitting.  Default: [10m]
-#
 #
 # Note that you may specify previously defined dumptypes as a shorthand way
 # of defining parameters.
@@ -184,7 +164,6 @@ define dumptype user-star {
 
 define dumptype user-star-span {
     root-star
-    tape_splitsize 3 Gb
     comment "tape-spanning user partitions dumped with star"
     priority medium
 }
@@ -232,7 +211,6 @@ define dumptype user-tar {
 
 define dumptype user-tar-span {
     root-tar
-    tape_splitsize 3 Gb
     comment "tape-spanning user partitions dumped with tar"
     priority medium
 }
@@ -277,7 +255,6 @@ define dumptype comp-user {
 
 define dumptype comp-user-span {
     global
-    tape_splitsize 5 Gb
     comment "Tape-spanning non-root partitions on reasonably fast machines"
     compress client fast
     priority medium
index 547b48714ce1d58cf6f5c9e49bcfe5a38b767920..11ccc45d65c7efa21d948e4868f1e2ebaf62d8ae 100644 (file)
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2009 Free Software Foundation, Inc.
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --tests-base=tests --aux-dir=config --libtool --macro-prefix=gl base64 fseeko fsusage ftello ftruncate full-read full-write getaddrinfo getopt lock lseek mkdtemp physmem regex visibility
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --tests-base=tests --aux-dir=config --libtool --macro-prefix=gl base64 environ fseeko fsusage ftello ftruncate full-read full-write getaddrinfo getopt-gnu inet_pton lock lseek mkdtemp physmem regex
 
 AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
 
@@ -30,6 +30,7 @@ AM_CPPFLAGS =
 if GCC_COMPILER
   AM_CFLAGS = -Wno-error -Wno-sign-compare
 endif
+AM_CFLAGS =
 
 noinst_LTLIBRARIES += libgnu.la
 
@@ -39,16 +40,12 @@ libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
 EXTRA_libgnu_la_SOURCES =
 libgnu_la_LDFLAGS = $(AM_LDFLAGS)
 
-## begin gnulib module alloca
+## begin gnulib module alignof
 
 
-EXTRA_DIST += alloca.c
+EXTRA_DIST += alignof.h
 
-EXTRA_libgnu_la_SOURCES += alloca.c
-
-libgnu_la_LIBADD += @LTALLOCA@
-libgnu_la_DEPENDENCIES += @LTALLOCA@
-## end   gnulib module alloca
+## end   gnulib module alignof
 
 ## begin gnulib module alloca-opt
 
@@ -57,9 +54,10 @@ BUILT_SOURCES += $(ALLOCA_H)
 # We need the following in order to create <alloca.h> when the system
 # doesn't have one that works with the given compiler.
 alloca.h: alloca.in.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          cat $(srcdir)/alloca.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv -f $@-t $@
 MOSTLYCLEANFILES += alloca.h alloca.h-t
 
@@ -67,15 +65,39 @@ EXTRA_DIST += alloca.in.h
 
 ## end   gnulib module alloca-opt
 
+## begin gnulib module arg-nonnull
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += arg-nonnull.h
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
+arg-nonnull.h: $(top_srcdir)/config/arg-nonnull.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/config/arg-nonnull.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+
+ARG_NONNULL_H=arg-nonnull.h
+
+EXTRA_DIST += $(top_srcdir)/config/arg-nonnull.h
+
+## end   gnulib module arg-nonnull
+
 ## begin gnulib module arpa_inet
 
-BUILT_SOURCES += $(ARPA_INET_H)
+BUILT_SOURCES += arpa/inet.h
 
 # We need the following in order to create <arpa/inet.h> when the system
 # doesn't have one.
-arpa/inet.h:
-       @MKDIR_P@ arpa
-       rm -f $@-t $@
+arpa/inet.h: arpa_inet.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) arpa
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -85,9 +107,10 @@ arpa/inet.h:
              -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
              -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
              -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/arpa_inet.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
 MOSTLYCLEANDIRS += arpa
@@ -111,6 +134,36 @@ EXTRA_libgnu_la_SOURCES += btowc.c
 
 ## end   gnulib module btowc
 
+## begin gnulib module c++defs
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += c++defs.h
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/config/c++defs.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/_GL_CXXDEFS/,$$p' \
+         < $(top_srcdir)/config/c++defs.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+
+CXXDEFS_H=c++defs.h
+
+EXTRA_DIST += $(top_srcdir)/config/c++defs.h
+
+## end   gnulib module c++defs
+
+## begin gnulib module c-ctype
+
+libgnu_la_SOURCES += c-ctype.h c-ctype.c
+
+## end   gnulib module c-ctype
+
 ## begin gnulib module configmake
 
 # Retrieve values of the variables through 'configure' followed by
@@ -131,7 +184,7 @@ EXTRA_libgnu_la_SOURCES += btowc.c
 # The Automake-defined pkg* macros are appended, in the order
 # listed in the Automake 1.10a+ documentation.
 configmake.h: Makefile
-       rm -f $@-t $@
+       $(AM_V_GEN)rm -f $@-t && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          echo '#define PREFIX "$(prefix)"'; \
          echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
@@ -160,8 +213,13 @@ configmake.h: Makefile
          echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
          echo '#define PKGLIBDIR "$(pkglibdir)"'; \
          echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
-       } | sed '/""/d' > $@-t
-       mv $@-t $@
+       } | sed '/""/d' > $@-t && \
+       if test -f $@ && cmp $@-t $@ > /dev/null; then \
+         rm -f $@-t; \
+       else \
+         rm -f $@; mv $@-t $@; \
+       fi
+
 BUILT_SOURCES += configmake.h
 CLEANFILES += configmake.h configmake.h-t
 
@@ -174,7 +232,7 @@ BUILT_SOURCES += $(ERRNO_H)
 # We need the following in order to create <errno.h> when the system
 # doesn't have one that is POSIX compliant.
 errno.h: errno.in.h
-       rm -f $@-t $@
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -186,7 +244,7 @@ errno.h: errno.in.h
              -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
              -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
              < $(srcdir)/errno.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += errno.h errno.h-t
 
@@ -201,13 +259,13 @@ BUILT_SOURCES += $(FLOAT_H)
 # We need the following in order to create <float.h> when the system
 # doesn't have one that works with the given compiler.
 float.h: float.in.h
-       rm -f $@-t $@
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
              < $(srcdir)/float.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += float.h float.h-t
 
@@ -236,7 +294,7 @@ EXTRA_libgnu_la_SOURCES += fsusage.c
 ## begin gnulib module ftello
 
 
-EXTRA_DIST += ftello.c
+EXTRA_DIST += ftello.c stdio-impl.h
 
 EXTRA_libgnu_la_SOURCES += ftello.c
 
@@ -272,16 +330,22 @@ EXTRA_libgnu_la_SOURCES += gai_strerror.c getaddrinfo.c
 
 ## end   gnulib module getaddrinfo
 
-## begin gnulib module getopt
+## begin gnulib module getopt-posix
 
 BUILT_SOURCES += $(GETOPT_H)
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h
+getopt.h: getopt.in.h $(ARG_NONNULL_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/getopt.in.h; \
-       } > $@-t
+         sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             < $(srcdir)/getopt.in.h; \
+       } > $@-t && \
        mv -f $@-t $@
 MOSTLYCLEANFILES += getopt.h getopt.h-t
 
@@ -289,7 +353,7 @@ EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h
 
 EXTRA_libgnu_la_SOURCES += getopt.c getopt1.c
 
-## end   gnulib module getopt
+## end   gnulib module getopt-posix
 
 ## begin gnulib module gettext-h
 
@@ -322,13 +386,43 @@ EXTRA_libgnu_la_SOURCES += inet_ntop.c
 
 ## end   gnulib module inet_ntop
 
-## begin gnulib module link-warning
+## begin gnulib module inet_pton
+
+
+EXTRA_DIST += inet_pton.c
+
+EXTRA_libgnu_la_SOURCES += inet_pton.c
 
-LINK_WARNING_H=$(top_srcdir)/config/link-warning.h
+## end   gnulib module inet_pton
 
-EXTRA_DIST += $(top_srcdir)/config/link-warning.h
+## begin gnulib module langinfo
 
-## end   gnulib module link-warning
+BUILT_SOURCES += langinfo.h
+
+# We need the following in order to create an empty placeholder for
+# <langinfo.h> when the system doesn't have one.
+langinfo.h: langinfo.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
+             -e 's|@''GNULIB_NL_LANGINFO''@|$(GNULIB_NL_LANGINFO)|g' \
+             -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \
+             -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
+             -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
+             -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/langinfo.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += langinfo.h langinfo.h-t
+
+EXTRA_DIST += langinfo.in.h
+
+## end   gnulib module langinfo
 
 ## begin gnulib module localcharset
 
@@ -345,7 +439,8 @@ all-local: charset.alias ref-add.sed ref-del.sed
 
 charset_alias = $(DESTDIR)$(libdir)/charset.alias
 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
-install-exec-local: all-local
+install-exec-local: install-exec-localcharset
+install-exec-localcharset: all-local
        if test $(GLIBC21) = no; then \
          case '$(host_os)' in \
            darwin[56]*) \
@@ -373,7 +468,8 @@ install-exec-local: all-local
          fi ; \
        fi
 
-uninstall-local: all-local
+uninstall-local: uninstall-localcharset
+uninstall-localcharset: all-local
        if test -f $(charset_alias); then \
          sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
          if grep '^# Packages using this file: $$' $(charset_tmp) \
@@ -386,14 +482,14 @@ uninstall-local: all-local
        fi
 
 charset.alias: config.charset
-       rm -f t-$@ $@
-       $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
+       $(AM_V_GEN)rm -f t-$@ $@ && \
+       $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
        mv t-$@ $@
 
 SUFFIXES += .sed .sin
 .sin.sed:
-       rm -f t-$@ $@
-       sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
+       $(AM_V_GEN)rm -f t-$@ $@ && \
+       sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
        mv t-$@ $@
 
 CLEANFILES += charset.alias ref-add.sed ref-del.sed
@@ -426,14 +522,14 @@ EXTRA_libgnu_la_SOURCES += lstat.c
 
 ## end   gnulib module lstat
 
-## begin gnulib module malloc
+## begin gnulib module malloc-gnu
 
 
 EXTRA_DIST += malloc.c
 
 EXTRA_libgnu_la_SOURCES += malloc.c
 
-## end   gnulib module malloc
+## end   gnulib module malloc-gnu
 
 ## begin gnulib module malloc-posix
 
@@ -462,6 +558,15 @@ EXTRA_libgnu_la_SOURCES += mbsinit.c
 
 ## end   gnulib module mbsinit
 
+## begin gnulib module memchr
+
+
+EXTRA_DIST += memchr.c memchr.valgrind
+
+EXTRA_libgnu_la_SOURCES += memchr.c
+
+## end   gnulib module memchr
+
 ## begin gnulib module mkdtemp
 
 
@@ -473,12 +578,12 @@ EXTRA_libgnu_la_SOURCES += mkdtemp.c
 
 ## begin gnulib module netdb
 
-BUILT_SOURCES += $(NETDB_H)
+BUILT_SOURCES += netdb.h
 
 # We need the following in order to create <netdb.h> when the system
 # doesn't have one that works with the given compiler.
-netdb.h: netdb.in.h
-       rm -f $@-t $@
+netdb.h: netdb.in.h $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -490,8 +595,10 @@ netdb.h: netdb.in.h
              -e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \
              -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
              -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/netdb.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += netdb.h netdb.h-t
 
@@ -506,15 +613,15 @@ BUILT_SOURCES += $(NETINET_IN_H)
 # We need the following in order to create <netinet/in.h> when the system
 # doesn't have one.
 netinet/in.h: netinet_in.in.h
-       @MKDIR_P@ netinet
-       rm -f $@-t $@
+       $(AM_V_at)$(MKDIR_P) netinet
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
              -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
              < $(srcdir)/netinet_in.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
 MOSTLYCLEANDIRS += netinet
@@ -523,6 +630,15 @@ EXTRA_DIST += netinet_in.in.h
 
 ## end   gnulib module netinet_in
 
+## begin gnulib module nl_langinfo
+
+
+EXTRA_DIST += nl_langinfo.c
+
+EXTRA_libgnu_la_SOURCES += nl_langinfo.c
+
+## end   gnulib module nl_langinfo
+
 ## begin gnulib module physmem
 
 
@@ -574,6 +690,15 @@ EXTRA_libgnu_la_SOURCES += snprintf.c
 
 ## end   gnulib module snprintf
 
+## begin gnulib module stat
+
+
+EXTRA_DIST += stat.c
+
+EXTRA_libgnu_la_SOURCES += stat.c
+
+## end   gnulib module stat
+
 ## begin gnulib module stdbool
 
 BUILT_SOURCES += $(STDBOOL_H)
@@ -581,10 +706,10 @@ BUILT_SOURCES += $(STDBOOL_H)
 # We need the following in order to create <stdbool.h> when the system
 # doesn't have one that works.
 stdbool.h: stdbool.in.h
-       rm -f $@-t $@
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += stdbool.h stdbool.h-t
 
@@ -592,6 +717,29 @@ EXTRA_DIST += stdbool.in.h
 
 ## end   gnulib module stdbool
 
+## begin gnulib module stddef
+
+BUILT_SOURCES += $(STDDEF_H)
+
+# We need the following in order to create <stddef.h> when the system
+# doesn't have one that works with the given compiler.
+stddef.h: stddef.in.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+             -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+             -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+             < $(srcdir)/stddef.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += stddef.h stddef.h-t
+
+EXTRA_DIST += stddef.in.h
+
+## end   gnulib module stddef
+
 ## begin gnulib module stdint
 
 BUILT_SOURCES += $(STDINT_H)
@@ -599,7 +747,7 @@ BUILT_SOURCES += $(STDINT_H)
 # We need the following in order to create <stdint.h> when the system
 # doesn't have one that works with the given compiler.
 stdint.h: stdint.in.h
-       rm -f $@-t $@
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -626,7 +774,7 @@ stdint.h: stdint.in.h
              -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
              -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
              < $(srcdir)/stdint.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += stdint.h stdint.h-t
 
@@ -640,81 +788,101 @@ BUILT_SOURCES += stdio.h
 
 # We need the following in order to create <stdio.h> when the system
 # doesn't have one that works with the given compiler.
-stdio.h: stdio.in.h
-       rm -f $@-t $@
+stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-             -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
-             -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
-             -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
-             -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
-             -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
-             -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
-             -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
              -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
-             -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
-             -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
-             -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
-             -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
+             -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
              -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
+             -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
+             -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
+             -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
+             -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
              -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
              -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
              -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
              -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
              -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
-             -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-             -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
-             -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
-             -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
-             -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
-             -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
-             -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
              -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
              -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
              -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
+             -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
+             -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
              -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
+             -e 's|@''GNULIB_POPEN''@|$(GNULIB_POPEN)|g' \
+             -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
+             -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
+             -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
+             -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
+             -e 's|@''GNULIB_REMOVE''@|$(GNULIB_REMOVE)|g' \
+             -e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \
+             -e 's|@''GNULIB_RENAMEAT''@|$(GNULIB_RENAMEAT)|g' \
+             -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
+             -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
              -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
-             -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
-             -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-             -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-             -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-             -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-             -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+             -e 's|@''GNULIB_TMPFILE''@|$(GNULIB_TMPFILE)|g' \
+             -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
+             -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
+             -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
+             -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
+             -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
+             -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
+             < $(srcdir)/stdio.in.h | \
+         sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+             -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+             -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+             -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
              -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-             -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
              -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-             -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
-             -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
              -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
-             -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-             -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
-             -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+             -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
+             -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+             -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
              -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-             -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
-             -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-             -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
+             -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+             -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
+             -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+             -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
              -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
+             -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+             -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
              -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
-             -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
              -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
-             -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+             -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
              -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
-             -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-             -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-             -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-             -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+             -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+             -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
              -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+             -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
              -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-             < $(srcdir)/stdio.in.h; \
-       } > $@-t
+             -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
+             -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+             -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
+             -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
+             -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
+             -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+             -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+             -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+             -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
+             -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+             -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+             -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+             -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+             -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+             -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+             -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += stdio.h stdio.h-t
 
@@ -730,36 +898,52 @@ BUILT_SOURCES += stdlib.h
 
 # We need the following in order to create <stdlib.h> when the system
 # doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h
-       rm -f $@-t $@
+stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
-             -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
-             -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
-             -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
-             -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
+             -e 's|@''GNULIB__EXIT''@|$(GNULIB__EXIT)|g' \
              -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \
+             -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
+             -e 's|@''GNULIB_CANONICALIZE_FILE_NAME''@|$(GNULIB_CANONICALIZE_FILE_NAME)|g' \
              -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
              -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
+             -e 's|@''GNULIB_GRANTPT''@|$(GNULIB_GRANTPT)|g' \
+             -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
              -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
+             -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \
+             -e 's|@''GNULIB_MKOSTEMPS''@|$(GNULIB_MKOSTEMPS)|g' \
              -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
+             -e 's|@''GNULIB_MKSTEMPS''@|$(GNULIB_MKSTEMPS)|g' \
+             -e 's|@''GNULIB_PTSNAME''@|$(GNULIB_PTSNAME)|g' \
              -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
              -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
+             -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
+             -e 's|@''GNULIB_REALPATH''@|$(GNULIB_REALPATH)|g' \
              -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
              -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
              -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
              -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \
              -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \
+             -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
              -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
+             -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-             -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
+             -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
              -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-             -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
+             -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
              -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
-             -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
+             -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
+             -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
+             -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
+             -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+             -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+             -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
              -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
+             -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
              -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
              -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
              -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
@@ -767,15 +951,23 @@ stdlib.h: stdlib.in.h
              -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
              -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
              -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
+             -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
              -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
-             -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
+             -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
+             -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+             -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
+             -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
+             -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
              -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
-             -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/stdlib.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += stdlib.h stdlib.h-t
 
@@ -790,14 +982,105 @@ EXTRA_DIST += streq.h
 
 ## end   gnulib module streq
 
+## begin gnulib module string
+
+BUILT_SOURCES += string.h
+
+# We need the following in order to create <string.h> when the system
+# doesn't have one that works with the given compiler.
+string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+             -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
+             -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
+             -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
+             -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
+             -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
+             -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
+             -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
+             -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
+             -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
+             -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
+             -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
+             -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
+             -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
+             -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
+             -e 's|@''GNULIB_MEMCHR''@|$(GNULIB_MEMCHR)|g' \
+             -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
+             -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
+             -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
+             -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \
+             -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
+             -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
+             -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
+             -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
+             -e 's|@''GNULIB_STRNCAT''@|$(GNULIB_STRNCAT)|g' \
+             -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
+             -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
+             -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
+             -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
+             -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
+             -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
+             -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
+             -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
+             -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
+             -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \
+             < $(srcdir)/string.in.h | \
+         sed -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+             -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
+             -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+             -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+             -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+             -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
+             -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
+             -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+             -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
+             -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
+             -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
+             -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
+             -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
+             -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+             -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
+             -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
+             -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+             -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+             -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+             -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
+             -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+             -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+             -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
+             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+             -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+             -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
+             -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+             -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
+             -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+             -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+             -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+             < $(srcdir)/string.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += string.h string.h-t
+
+EXTRA_DIST += string.in.h
+
+## end   gnulib module string
+
 ## begin gnulib module sys_socket
 
-BUILT_SOURCES += $(SYS_SOCKET_H)
+BUILT_SOURCES += sys/socket.h
 
 # We need the following in order to create <sys/socket.h> when the system
 # doesn't have one that works with the given compiler.
-sys/socket.h: sys_socket.in.h
-       @MKDIR_P@ sys
+sys/socket.h: sys_socket.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -818,11 +1101,17 @@ sys/socket.h: sys_socket.in.h
              -e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \
              -e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \
              -e 's|@''GNULIB_SHUTDOWN''@|$(GNULIB_SHUTDOWN)|g' \
+             -e 's|@''GNULIB_ACCEPT4''@|$(GNULIB_ACCEPT4)|g' \
              -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
              -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
+             -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
+             -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_socket.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv -f $@-t $@
 MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
 MOSTLYCLEANDIRS += sys
@@ -833,26 +1122,54 @@ EXTRA_DIST += sys_socket.in.h
 
 ## begin gnulib module sys_stat
 
-BUILT_SOURCES += $(SYS_STAT_H)
+BUILT_SOURCES += sys/stat.h
 
 # We need the following in order to create <sys/stat.h> when the system
 # has one that is incomplete.
-sys/stat.h: sys_stat.in.h
-       @MKDIR_P@ sys
-       rm -f $@-t $@
+sys/stat.h: sys_stat.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+             -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
+             -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
+             -e 's|@''GNULIB_FUTIMENS''@|$(GNULIB_FUTIMENS)|g' \
              -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
              -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
+             -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
+             -e 's|@''GNULIB_MKFIFO''@|$(GNULIB_MKFIFO)|g' \
+             -e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
+             -e 's|@''GNULIB_MKNOD''@|$(GNULIB_MKNOD)|g' \
+             -e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
+             -e 's|@''GNULIB_STAT''@|$(GNULIB_STAT)|g' \
+             -e 's|@''GNULIB_UTIMENSAT''@|$(GNULIB_UTIMENSAT)|g' \
+             -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
+             -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
+             -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
              -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
              -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+             -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
+             -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \
+             -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
+             -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
+             -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
+             -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
+             -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
+             -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
+             -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
              -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
              -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
+             -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
+             -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
+             -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_stat.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
 MOSTLYCLEANDIRS += sys
@@ -863,22 +1180,27 @@ EXTRA_DIST += sys_stat.in.h
 
 ## begin gnulib module sys_time
 
-BUILT_SOURCES += $(SYS_TIME_H)
+BUILT_SOURCES += sys/time.h
 
 # We need the following in order to create <sys/time.h> when the system
 # doesn't have one that works with the given compiler.
-sys/time.h: sys_time.in.h
-       @MKDIR_P@ sys
-       rm -f $@-t $@
+sys/time.h: sys_time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
+             -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
              -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_time.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += sys/time.h sys/time.h-t
 
@@ -903,14 +1225,54 @@ EXTRA_DIST += $(top_srcdir)/config/config.rpath
 
 ## end   gnulib module threadlib
 
+## begin gnulib module time
+
+BUILT_SOURCES += time.h
+
+# We need the following in order to create <time.h> when the system
+# doesn't have one that works with the given compiler.
+time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+             -e 's|@''GNULIB_MKTIME''@|$(GNULIB_MKTIME)|g' \
+             -e 's|@''GNULIB_NANOSLEEP''@|$(GNULIB_NANOSLEEP)|g' \
+             -e 's|@''GNULIB_STRPTIME''@|$(GNULIB_STRPTIME)|g' \
+             -e 's|@''GNULIB_TIMEGM''@|$(GNULIB_TIMEGM)|g' \
+             -e 's|@''GNULIB_TIME_R''@|$(GNULIB_TIME_R)|g' \
+             -e 's|@''HAVE_LOCALTIME_R''@|$(HAVE_LOCALTIME_R)|g' \
+             -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
+             -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
+             -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+             -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
+             -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
+             -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
+             -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+             -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/time.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += time.h time.h-t
+
+EXTRA_DIST += time.in.h
+
+## end   gnulib module time
+
 ## begin gnulib module unistd
 
 BUILT_SOURCES += unistd.h
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
-unistd.h: unistd.in.h
-       rm -f $@-t $@
+unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -919,53 +1281,108 @@ unistd.h: unistd.in.h
              -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
              -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
              -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
+             -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \
              -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
              -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
+             -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \
              -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
+             -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \
              -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
              -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
              -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
              -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \
              -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \
+             -e 's|@''GNULIB_GETGROUPS''@|$(GNULIB_GETGROUPS)|g' \
              -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \
+             -e 's|@''GNULIB_GETLOGIN''@|$(GNULIB_GETLOGIN)|g' \
              -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
              -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
              -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \
              -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
              -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
+             -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \
              -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
+             -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
+             -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
+             -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
              -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
+             -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
+             -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
              -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
+             -e 's|@''GNULIB_SYMLINK''@|$(GNULIB_SYMLINK)|g' \
+             -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \
+             -e 's|@''GNULIB_TTYNAME_R''@|$(GNULIB_TTYNAME_R)|g' \
+             -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \
              -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
+             -e 's|@''GNULIB_UNLINK''@|$(GNULIB_UNLINK)|g' \
+             -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \
+             -e 's|@''GNULIB_USLEEP''@|$(GNULIB_USLEEP)|g' \
              -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
+             < $(srcdir)/unistd.in.h | \
+         sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
              -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+             -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
              -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+             -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
+             -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
+             -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
              -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
              -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
              -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
+             -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
+             -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
-             -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
+             -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
+             -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
+             -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
+             -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+             -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
              -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
+             -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+             -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
+             -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
+             -e 's|@''HAVE_TTYNAME_R''@|$(HAVE_TTYNAME_R)|g' \
+             -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
+             -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
              -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+             -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
+             -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
              -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
              -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
              -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
              -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-             -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
+             -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
+             -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+             -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+             -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
+             -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
+             -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+             -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+             -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
+             -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
+             -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
+             -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
+             -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+             -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
+             -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
+             -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
+             -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
              -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
              -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-             < $(srcdir)/unistd.in.h; \
-       } > $@-t
+             -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += unistd.h unistd.h-t
 
@@ -988,14 +1405,33 @@ libgnu_la_SOURCES += verify.h
 
 ## end   gnulib module verify
 
+## begin gnulib module warn-on-use
+
+BUILT_SOURCES += warn-on-use.h
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/warn-on-use.h, except that it has the copyright header cut off.
+warn-on-use.h: $(top_srcdir)/config/warn-on-use.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/^.ifndef/,$$p' \
+         < $(top_srcdir)/config/warn-on-use.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+
+WARN_ON_USE_H=warn-on-use.h
+
+EXTRA_DIST += $(top_srcdir)/config/warn-on-use.h
+
+## end   gnulib module warn-on-use
+
 ## begin gnulib module wchar
 
-BUILT_SOURCES += $(WCHAR_H)
+BUILT_SOURCES += wchar.h
 
 # We need the following in order to create <wchar.h> when the system
 # version does not work standalone.
-wchar.h: wchar.in.h
-       rm -f $@-t $@
+wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1034,10 +1470,13 @@ wchar.h: wchar.in.h
              -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
              -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
              -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
+             -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
              -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
            < $(srcdir)/wchar.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += wchar.h wchar.h-t
 
@@ -1056,22 +1495,26 @@ EXTRA_libgnu_la_SOURCES += wcrtomb.c
 
 ## begin gnulib module wctype
 
-BUILT_SOURCES += $(WCTYPE_H)
+BUILT_SOURCES += wctype.h
 
 # We need the following in order to create <wctype.h> when the system
 # doesn't have one that works with the given compiler.
-wctype.h: wctype.in.h
-       rm -f $@-t $@
+wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+             -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
              -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
              -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+             -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
              -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/wctype.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += wctype.h wctype.h-t
 
index ffdeec0de8cfdf3ddd00cb0e619612c7b205f99b..c2bd04baa30a77d5185947484c014cc0a1a3e74f 100644 (file)
@@ -15,7 +15,7 @@
 
 @SET_MAKE@
 
-# Copyright (C) 2002-2009 Free Software Foundation, Inc.
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
@@ -24,7 +24,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --tests-base=tests --aux-dir=config --libtool --macro-prefix=gl base64 fseeko fsusage ftello ftruncate full-read full-write getaddrinfo getopt lock lseek mkdtemp physmem regex visibility
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --tests-base=tests --aux-dir=config --libtool --macro-prefix=gl base64 environ fseeko fsusage ftello ftruncate full-read full-write getaddrinfo getopt-gnu inet_pton lock lseek mkdtemp physmem regex
 
 
 
@@ -49,7 +49,7 @@ build_triplet = @build@
 host_triplet = @host@
 subdir = gnulib
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in alloca.c
+       $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps =  \
        $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
@@ -65,7 +65,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -93,7 +92,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -106,10 +104,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -123,7 +125,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -136,10 +140,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -151,21 +158,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -198,7 +209,7 @@ LIBRARIES = $(noinst_LIBRARIES)
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 am__dirstamp = $(am__leading_dot)dirstamp
-am_libgnu_la_OBJECTS = base64.lo full-read.lo full-write.lo \
+am_libgnu_la_OBJECTS = base64.lo c-ctype.lo full-read.lo full-write.lo \
        localcharset.lo glthread/lock.lo glthread/threadlib.lo
 libgnu_la_OBJECTS = $(am_libgnu_la_OBJECTS)
 libgnu_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -282,7 +293,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -302,10 +313,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -361,78 +369,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -443,12 +506,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -463,17 +555,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -482,60 +578,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -543,13 +698,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -558,9 +719,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -596,7 +760,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -605,7 +768,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -613,19 +775,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -651,47 +836,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -699,6 +940,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -721,19 +963,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -743,13 +987,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -793,6 +1034,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -829,35 +1071,52 @@ noinst_LIBRARIES =
 noinst_LTLIBRARIES = libgnu.la
 
 # Make sure regenerate/* are in the distribution tarball
-EXTRA_DIST = alloca.c alloca.in.h arpa_inet.in.h btowc.c errno.in.h \
-       float.in.h fseeko.c stdio-impl.h fsusage.c fsusage.h ftello.c \
-       ftruncate.c gai_strerror.c getaddrinfo.c getopt.c getopt.in.h \
-       getopt1.c getopt_int.h gettimeofday.c \
-       $(top_srcdir)/config/config.rpath inet_ntop.c \
-       $(top_srcdir)/config/link-warning.h config.charset ref-add.sin \
+EXTRA_DIST = alignof.h alloca.in.h $(top_srcdir)/config/arg-nonnull.h \
+       arpa_inet.in.h btowc.c $(top_srcdir)/config/c++defs.h \
+       errno.in.h float.in.h fseeko.c stdio-impl.h fsusage.c \
+       fsusage.h ftello.c stdio-impl.h ftruncate.c gai_strerror.c \
+       getaddrinfo.c getopt.c getopt.in.h getopt1.c getopt_int.h \
+       gettimeofday.c $(top_srcdir)/config/config.rpath inet_ntop.c \
+       inet_pton.c langinfo.in.h config.charset ref-add.sin \
        ref-del.sin lseek.c lstat.c malloc.c malloc.c mbrtowc.c \
-       mbsinit.c mkdtemp.c netdb.in.h netinet_in.in.h physmem.c \
-       physmem.h regcomp.c regex.c regex.h regex_internal.c \
-       regex_internal.h regexec.c safe-read.c safe-read.h \
-       safe-write.c safe-write.h snprintf.c stdbool.in.h stdint.in.h \
-       stdio-write.c stdio.in.h stdlib.in.h streq.h sys_socket.in.h \
+       mbsinit.c memchr.c memchr.valgrind mkdtemp.c netdb.in.h \
+       netinet_in.in.h nl_langinfo.c physmem.c physmem.h regcomp.c \
+       regex.c regex.h regex_internal.c regex_internal.h regexec.c \
+       safe-read.c safe-read.h safe-write.c safe-write.h snprintf.c \
+       stat.c stdbool.in.h stddef.in.h stdint.in.h stdio-write.c \
+       stdio.in.h stdlib.in.h streq.h string.in.h sys_socket.in.h \
        sys_stat.in.h sys_time.in.h tempname.c tempname.h \
-       $(top_srcdir)/config/config.rpath unistd.in.h asnprintf.c \
-       float+.h printf-args.c printf-args.h printf-parse.c \
-       printf-parse.h vasnprintf.c vasnprintf.h wchar.in.h wcrtomb.c \
+       $(top_srcdir)/config/config.rpath time.in.h unistd.in.h \
+       asnprintf.c float+.h printf-args.c printf-args.h \
+       printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h \
+       $(top_srcdir)/config/warn-on-use.h wchar.in.h wcrtomb.c \
        wctype.in.h write.c regenerate/no-error.patch \
        regenerate/regenerate
-BUILT_SOURCES = $(ALLOCA_H) $(ARPA_INET_H) configmake.h $(ERRNO_H) \
-       $(FLOAT_H) $(GETOPT_H) $(NETDB_H) $(NETINET_IN_H) $(STDBOOL_H) \
-       $(STDINT_H) stdio.h stdlib.h $(SYS_SOCKET_H) $(SYS_STAT_H) \
-       $(SYS_TIME_H) unistd.h $(WCHAR_H) $(WCTYPE_H)
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+BUILT_SOURCES = $(ALLOCA_H) arg-nonnull.h arpa/inet.h c++defs.h \
+       configmake.h $(ERRNO_H) $(FLOAT_H) $(GETOPT_H) langinfo.h \
+       netdb.h $(NETINET_IN_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \
+       stdio.h stdlib.h string.h sys/socket.h sys/stat.h sys/time.h \
+       time.h unistd.h warn-on-use.h wchar.h wctype.h
 SUFFIXES = .sed .sin
-MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \
-       arpa/inet.h-t errno.h errno.h-t float.h float.h-t getopt.h \
-       getopt.h-t netdb.h netdb.h-t netinet/in.h netinet/in.h-t \
-       stdbool.h stdbool.h-t stdint.h stdint.h-t stdio.h stdio.h-t \
-       stdlib.h stdlib.h-t sys/socket.h sys/socket.h-t sys/stat.h \
-       sys/stat.h-t sys/time.h sys/time.h-t unistd.h unistd.h-t \
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arg-nonnull.h \
+       arg-nonnull.h-t arpa/inet.h arpa/inet.h-t c++defs.h \
+       c++defs.h-t errno.h errno.h-t float.h float.h-t getopt.h \
+       getopt.h-t langinfo.h langinfo.h-t netdb.h netdb.h-t \
+       netinet/in.h netinet/in.h-t stdbool.h stdbool.h-t stddef.h \
+       stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t stdlib.h \
+       stdlib.h-t string.h string.h-t sys/socket.h sys/socket.h-t \
+       sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t time.h \
+       time.h-t unistd.h unistd.h-t warn-on-use.h warn-on-use.h-t \
        wchar.h wchar.h-t wctype.h wctype.h-t
 MOSTLYCLEANDIRS = arpa netinet sys sys
 CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \
@@ -866,23 +1125,27 @@ DISTCLEANFILES =
 MAINTAINERCLEANFILES = 
 AM_CPPFLAGS = 
 @GCC_COMPILER_TRUE@AM_CFLAGS = -Wno-error -Wno-sign-compare
-libgnu_la_SOURCES = base64.h base64.c full-read.h full-read.c \
-       full-write.h full-write.c gettext.h localcharset.h \
+AM_CFLAGS = 
+libgnu_la_SOURCES = base64.h base64.c c-ctype.h c-ctype.c full-read.h \
+       full-read.c full-write.h full-write.c gettext.h localcharset.h \
        localcharset.c glthread/lock.h glthread/lock.c size_max.h \
        glthread/threadlib.c verify.h xsize.h
-libgnu_la_LIBADD = $(gl_LTLIBOBJS) @LTALLOCA@
-libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) @LTALLOCA@
-EXTRA_libgnu_la_SOURCES = alloca.c btowc.c fseeko.c fsusage.c ftello.c \
+libgnu_la_LIBADD = $(gl_LTLIBOBJS)
+libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
+EXTRA_libgnu_la_SOURCES = btowc.c fseeko.c fsusage.c ftello.c \
        ftruncate.c gai_strerror.c getaddrinfo.c getopt.c getopt1.c \
-       gettimeofday.c inet_ntop.c lseek.c lstat.c malloc.c malloc.c \
-       mbrtowc.c mbsinit.c mkdtemp.c physmem.c regcomp.c regex.c \
-       regex_internal.c regexec.c safe-read.c safe-write.c snprintf.c \
+       gettimeofday.c inet_ntop.c inet_pton.c lseek.c lstat.c \
+       malloc.c malloc.c mbrtowc.c mbsinit.c memchr.c mkdtemp.c \
+       nl_langinfo.c physmem.c regcomp.c regex.c regex_internal.c \
+       regexec.c safe-read.c safe-write.c snprintf.c stat.c \
        stdio-write.c tempname.c asnprintf.c printf-args.c \
        printf-parse.c vasnprintf.c wcrtomb.c write.c
 libgnu_la_LDFLAGS = $(AM_LDFLAGS)
-LINK_WARNING_H = $(top_srcdir)/config/link-warning.h
+ARG_NONNULL_H = arg-nonnull.h
+CXXDEFS_H = c++defs.h
 charset_alias = $(DESTDIR)$(libdir)/charset.alias
 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
+WARN_ON_USE_H = warn-on-use.h
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
@@ -953,11 +1216,10 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloca.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btowc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-ctype.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseeko.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftello.Plo@am__quote@
@@ -970,13 +1232,16 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsinit.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdtemp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl_langinfo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physmem.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Plo@am__quote@
@@ -987,6 +1252,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safe-read.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safe-write.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio-write.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Plo@am__quote@
@@ -1264,7 +1530,7 @@ clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
        clean-noinstLTLIBRARIES mostlyclean-am
 
 distclean: distclean-recursive
-       -rm -rf $(DEPDIR) ./$(DEPDIR) glthread/$(DEPDIR)
+       -rm -rf ./$(DEPDIR) glthread/$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -1310,7 +1576,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
-       -rm -rf $(DEPDIR) ./$(DEPDIR) glthread/$(DEPDIR)
+       -rm -rf ./$(DEPDIR) glthread/$(DEPDIR)
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -1353,16 +1619,25 @@ uninstall-am: uninstall-local
 # We need the following in order to create <alloca.h> when the system
 # doesn't have one that works with the given compiler.
 alloca.h: alloca.in.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          cat $(srcdir)/alloca.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv -f $@-t $@
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
+arg-nonnull.h: $(top_srcdir)/config/arg-nonnull.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/config/arg-nonnull.h \
+         > $@-t && \
+       mv $@-t $@
 
 # We need the following in order to create <arpa/inet.h> when the system
 # doesn't have one.
-arpa/inet.h:
-       @MKDIR_P@ arpa
-       rm -f $@-t $@
+arpa/inet.h: arpa_inet.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) arpa
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1372,9 +1647,18 @@ arpa/inet.h:
              -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
              -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
              -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/arpa_inet.in.h; \
-       } > $@-t
+       } > $@-t && \
+       mv $@-t $@
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/config/c++defs.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/_GL_CXXDEFS/,$$p' \
+         < $(top_srcdir)/config/c++defs.h \
+         > $@-t && \
        mv $@-t $@
 
 # Retrieve values of the variables through 'configure' followed by
@@ -1395,7 +1679,7 @@ arpa/inet.h:
 # The Automake-defined pkg* macros are appended, in the order
 # listed in the Automake 1.10a+ documentation.
 configmake.h: Makefile
-       rm -f $@-t $@
+       $(AM_V_GEN)rm -f $@-t && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          echo '#define PREFIX "$(prefix)"'; \
          echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
@@ -1424,13 +1708,17 @@ configmake.h: Makefile
          echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
          echo '#define PKGLIBDIR "$(pkglibdir)"'; \
          echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
-       } | sed '/""/d' > $@-t
-       mv $@-t $@
+       } | sed '/""/d' > $@-t && \
+       if test -f $@ && cmp $@-t $@ > /dev/null; then \
+         rm -f $@-t; \
+       else \
+         rm -f $@; mv $@-t $@; \
+       fi
 
 # We need the following in order to create <errno.h> when the system
 # doesn't have one that is POSIX compliant.
 errno.h: errno.in.h
-       rm -f $@-t $@
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1442,29 +1730,55 @@ errno.h: errno.in.h
              -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
              -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
              < $(srcdir)/errno.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <float.h> when the system
 # doesn't have one that works with the given compiler.
 float.h: float.in.h
-       rm -f $@-t $@
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
              < $(srcdir)/float.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h
+getopt.h: getopt.in.h $(ARG_NONNULL_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/getopt.in.h; \
-       } > $@-t
+         sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             < $(srcdir)/getopt.in.h; \
+       } > $@-t && \
        mv -f $@-t $@
 
+# We need the following in order to create an empty placeholder for
+# <langinfo.h> when the system doesn't have one.
+langinfo.h: langinfo.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
+             -e 's|@''GNULIB_NL_LANGINFO''@|$(GNULIB_NL_LANGINFO)|g' \
+             -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \
+             -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
+             -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
+             -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/langinfo.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+
 # We need the following in order to install a simple file in $(libdir)
 # which is shared with other installed packages. We use a list of referencing
 # packages so that "make uninstall" will remove the file if and only if it
@@ -1473,7 +1787,8 @@ getopt.h: getopt.in.h
 # avoid installing it.
 
 all-local: charset.alias ref-add.sed ref-del.sed
-install-exec-local: all-local
+install-exec-local: install-exec-localcharset
+install-exec-localcharset: all-local
        if test $(GLIBC21) = no; then \
          case '$(host_os)' in \
            darwin[56]*) \
@@ -1501,7 +1816,8 @@ install-exec-local: all-local
          fi ; \
        fi
 
-uninstall-local: all-local
+uninstall-local: uninstall-localcharset
+uninstall-localcharset: all-local
        if test -f $(charset_alias); then \
          sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
          if grep '^# Packages using this file: $$' $(charset_tmp) \
@@ -1514,18 +1830,18 @@ uninstall-local: all-local
        fi
 
 charset.alias: config.charset
-       rm -f t-$@ $@
-       $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
+       $(AM_V_GEN)rm -f t-$@ $@ && \
+       $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
        mv t-$@ $@
 .sin.sed:
-       rm -f t-$@ $@
-       sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
+       $(AM_V_GEN)rm -f t-$@ $@ && \
+       sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
        mv t-$@ $@
 
 # We need the following in order to create <netdb.h> when the system
 # doesn't have one that works with the given compiler.
-netdb.h: netdb.in.h
-       rm -f $@-t $@
+netdb.h: netdb.in.h $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1537,37 +1853,53 @@ netdb.h: netdb.in.h
              -e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \
              -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
              -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/netdb.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <netinet/in.h> when the system
 # doesn't have one.
 netinet/in.h: netinet_in.in.h
-       @MKDIR_P@ netinet
-       rm -f $@-t $@
+       $(AM_V_at)$(MKDIR_P) netinet
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
              -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
              < $(srcdir)/netinet_in.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <stdbool.h> when the system
 # doesn't have one that works.
 stdbool.h: stdbool.in.h
-       rm -f $@-t $@
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
-       } > $@-t
+       } > $@-t && \
+       mv $@-t $@
+
+# We need the following in order to create <stddef.h> when the system
+# doesn't have one that works with the given compiler.
+stddef.h: stddef.in.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+             -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+             -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+             < $(srcdir)/stddef.in.h; \
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <stdint.h> when the system
 # doesn't have one that works with the given compiler.
 stdint.h: stdint.in.h
-       rm -f $@-t $@
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1594,120 +1926,156 @@ stdint.h: stdint.in.h
              -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
              -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
              < $(srcdir)/stdint.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <stdio.h> when the system
 # doesn't have one that works with the given compiler.
-stdio.h: stdio.in.h
-       rm -f $@-t $@
+stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-             -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
-             -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
-             -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
-             -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
-             -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
-             -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
-             -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
              -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
-             -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
-             -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
-             -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
-             -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
+             -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
              -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
+             -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
+             -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
+             -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
+             -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
              -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
              -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
              -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
              -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
              -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
-             -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-             -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
-             -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
-             -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
-             -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
-             -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
-             -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
              -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
              -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
              -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
+             -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
+             -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
              -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
+             -e 's|@''GNULIB_POPEN''@|$(GNULIB_POPEN)|g' \
+             -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
+             -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
+             -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
+             -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
+             -e 's|@''GNULIB_REMOVE''@|$(GNULIB_REMOVE)|g' \
+             -e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \
+             -e 's|@''GNULIB_RENAMEAT''@|$(GNULIB_RENAMEAT)|g' \
+             -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
+             -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
              -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
-             -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
-             -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-             -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-             -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-             -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-             -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+             -e 's|@''GNULIB_TMPFILE''@|$(GNULIB_TMPFILE)|g' \
+             -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
+             -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
+             -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
+             -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
+             -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
+             -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
+             < $(srcdir)/stdio.in.h | \
+         sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+             -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+             -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+             -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
              -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-             -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
              -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-             -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
-             -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
              -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
-             -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-             -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
-             -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+             -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
+             -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+             -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
              -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-             -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
-             -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-             -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
+             -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+             -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
+             -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+             -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
              -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
+             -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+             -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
              -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
-             -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
              -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
-             -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+             -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
              -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
-             -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-             -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-             -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-             -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+             -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+             -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
              -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+             -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
              -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-             < $(srcdir)/stdio.in.h; \
-       } > $@-t
+             -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
+             -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+             -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
+             -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
+             -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
+             -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+             -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+             -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+             -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
+             -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+             -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+             -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+             -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+             -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+             -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+             -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <stdlib.h> when the system
 # doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h
-       rm -f $@-t $@
+stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
-             -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
-             -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
-             -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
-             -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
+             -e 's|@''GNULIB__EXIT''@|$(GNULIB__EXIT)|g' \
              -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \
+             -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
+             -e 's|@''GNULIB_CANONICALIZE_FILE_NAME''@|$(GNULIB_CANONICALIZE_FILE_NAME)|g' \
              -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
              -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
+             -e 's|@''GNULIB_GRANTPT''@|$(GNULIB_GRANTPT)|g' \
+             -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
              -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
+             -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \
+             -e 's|@''GNULIB_MKOSTEMPS''@|$(GNULIB_MKOSTEMPS)|g' \
              -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
+             -e 's|@''GNULIB_MKSTEMPS''@|$(GNULIB_MKSTEMPS)|g' \
+             -e 's|@''GNULIB_PTSNAME''@|$(GNULIB_PTSNAME)|g' \
              -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
              -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
+             -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
+             -e 's|@''GNULIB_REALPATH''@|$(GNULIB_REALPATH)|g' \
              -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
              -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
              -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
              -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \
              -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \
+             -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
              -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
+             -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-             -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
+             -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
              -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-             -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
+             -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
              -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
-             -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
+             -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
+             -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
+             -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
+             -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+             -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+             -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
              -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
+             -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
              -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
              -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
              -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
@@ -1715,21 +2083,111 @@ stdlib.h: stdlib.in.h
              -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
              -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
              -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
+             -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
              -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
-             -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
+             -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
+             -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+             -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
+             -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
+             -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
              -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
-             -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/stdlib.in.h; \
-       } > $@-t
+       } > $@-t && \
+       mv $@-t $@
+
+# We need the following in order to create <string.h> when the system
+# doesn't have one that works with the given compiler.
+string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+             -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
+             -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
+             -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
+             -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
+             -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
+             -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
+             -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
+             -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
+             -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
+             -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
+             -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
+             -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
+             -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
+             -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
+             -e 's|@''GNULIB_MEMCHR''@|$(GNULIB_MEMCHR)|g' \
+             -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
+             -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
+             -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
+             -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \
+             -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
+             -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
+             -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
+             -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
+             -e 's|@''GNULIB_STRNCAT''@|$(GNULIB_STRNCAT)|g' \
+             -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
+             -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
+             -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
+             -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
+             -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
+             -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
+             -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
+             -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
+             -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
+             -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \
+             < $(srcdir)/string.in.h | \
+         sed -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+             -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
+             -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+             -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+             -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+             -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
+             -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
+             -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+             -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
+             -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
+             -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
+             -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
+             -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
+             -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+             -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
+             -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
+             -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+             -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+             -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+             -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
+             -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+             -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+             -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
+             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+             -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+             -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
+             -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+             -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
+             -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+             -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+             -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+             < $(srcdir)/string.in.h; \
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <sys/socket.h> when the system
 # doesn't have one that works with the given compiler.
-sys/socket.h: sys_socket.in.h
-       @MKDIR_P@ sys
+sys/socket.h: sys_socket.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1750,53 +2208,123 @@ sys/socket.h: sys_socket.in.h
              -e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \
              -e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \
              -e 's|@''GNULIB_SHUTDOWN''@|$(GNULIB_SHUTDOWN)|g' \
+             -e 's|@''GNULIB_ACCEPT4''@|$(GNULIB_ACCEPT4)|g' \
              -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
              -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
+             -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
+             -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_socket.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv -f $@-t $@
 
 # We need the following in order to create <sys/stat.h> when the system
 # has one that is incomplete.
-sys/stat.h: sys_stat.in.h
-       @MKDIR_P@ sys
-       rm -f $@-t $@
+sys/stat.h: sys_stat.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+             -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
+             -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
+             -e 's|@''GNULIB_FUTIMENS''@|$(GNULIB_FUTIMENS)|g' \
              -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
              -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
+             -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
+             -e 's|@''GNULIB_MKFIFO''@|$(GNULIB_MKFIFO)|g' \
+             -e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
+             -e 's|@''GNULIB_MKNOD''@|$(GNULIB_MKNOD)|g' \
+             -e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
+             -e 's|@''GNULIB_STAT''@|$(GNULIB_STAT)|g' \
+             -e 's|@''GNULIB_UTIMENSAT''@|$(GNULIB_UTIMENSAT)|g' \
+             -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
+             -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
+             -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
              -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
              -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+             -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
+             -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \
+             -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
+             -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
+             -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
+             -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
+             -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
+             -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
+             -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
              -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
              -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
+             -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
+             -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
+             -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_stat.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <sys/time.h> when the system
 # doesn't have one that works with the given compiler.
-sys/time.h: sys_time.in.h
-       @MKDIR_P@ sys
-       rm -f $@-t $@
+sys/time.h: sys_time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
+             -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
              -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_time.in.h; \
-       } > $@-t
+       } > $@-t && \
+       mv $@-t $@
+
+# We need the following in order to create <time.h> when the system
+# doesn't have one that works with the given compiler.
+time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+             -e 's|@''GNULIB_MKTIME''@|$(GNULIB_MKTIME)|g' \
+             -e 's|@''GNULIB_NANOSLEEP''@|$(GNULIB_NANOSLEEP)|g' \
+             -e 's|@''GNULIB_STRPTIME''@|$(GNULIB_STRPTIME)|g' \
+             -e 's|@''GNULIB_TIMEGM''@|$(GNULIB_TIMEGM)|g' \
+             -e 's|@''GNULIB_TIME_R''@|$(GNULIB_TIME_R)|g' \
+             -e 's|@''HAVE_LOCALTIME_R''@|$(HAVE_LOCALTIME_R)|g' \
+             -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
+             -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
+             -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+             -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
+             -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
+             -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
+             -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+             -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/time.in.h; \
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
-unistd.h: unistd.in.h
-       rm -f $@-t $@
+unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1805,59 +2333,122 @@ unistd.h: unistd.in.h
              -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
              -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
              -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
+             -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \
              -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
              -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
+             -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \
              -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
+             -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \
              -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
              -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
              -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
              -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \
              -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \
+             -e 's|@''GNULIB_GETGROUPS''@|$(GNULIB_GETGROUPS)|g' \
              -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \
+             -e 's|@''GNULIB_GETLOGIN''@|$(GNULIB_GETLOGIN)|g' \
              -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
              -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
              -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \
              -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
              -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
+             -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \
              -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
+             -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
+             -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
+             -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
              -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
+             -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
+             -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
              -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
+             -e 's|@''GNULIB_SYMLINK''@|$(GNULIB_SYMLINK)|g' \
+             -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \
+             -e 's|@''GNULIB_TTYNAME_R''@|$(GNULIB_TTYNAME_R)|g' \
+             -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \
              -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
+             -e 's|@''GNULIB_UNLINK''@|$(GNULIB_UNLINK)|g' \
+             -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \
+             -e 's|@''GNULIB_USLEEP''@|$(GNULIB_USLEEP)|g' \
              -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
+             < $(srcdir)/unistd.in.h | \
+         sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
              -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+             -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
              -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+             -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
+             -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
+             -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
              -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
              -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
              -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
+             -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
+             -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
-             -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
+             -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
+             -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
+             -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
+             -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+             -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
              -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
+             -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+             -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
+             -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
+             -e 's|@''HAVE_TTYNAME_R''@|$(HAVE_TTYNAME_R)|g' \
+             -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
+             -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
              -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+             -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
+             -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
              -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
              -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
              -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
              -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-             -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
+             -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
+             -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+             -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+             -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
+             -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
+             -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+             -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+             -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
+             -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
+             -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
+             -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
+             -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+             -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
+             -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
+             -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
+             -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
              -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
              -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-             < $(srcdir)/unistd.in.h; \
-       } > $@-t
+             -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+       } > $@-t && \
+       mv $@-t $@
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/warn-on-use.h, except that it has the copyright header cut off.
+warn-on-use.h: $(top_srcdir)/config/warn-on-use.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/^.ifndef/,$$p' \
+         < $(top_srcdir)/config/warn-on-use.h \
+         > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <wchar.h> when the system
 # version does not work standalone.
-wchar.h: wchar.in.h
-       rm -f $@-t $@
+wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1896,26 +2487,33 @@ wchar.h: wchar.in.h
              -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
              -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
              -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
+             -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
              -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
            < $(srcdir)/wchar.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <wctype.h> when the system
 # doesn't have one that works with the given compiler.
-wctype.h: wctype.in.h
-       rm -f $@-t $@
+wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+             -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
              -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
              -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+             -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
              -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/wctype.in.h; \
-       } > $@-t
+       } > $@-t && \
        mv $@-t $@
 
 mostlyclean-local: mostlyclean-generic
diff --git a/gnulib/alignof.h b/gnulib/alignof.h
new file mode 100644 (file)
index 0000000..240468c
--- /dev/null
@@ -0,0 +1,53 @@
+/* Determine alignment of types.
+   Copyright (C) 2003-2004, 2006, 2009-2010 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 3, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _ALIGNOF_H
+#define _ALIGNOF_H
+
+#include <stddef.h>
+
+/* Determine the alignment of a structure slot (field) of a given type,
+   at compile time.  Note that the result depends on the ABI.
+   Note: The result cannot be used as a value for an 'enum' constant,
+   due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc.  */
+#if defined __cplusplus
+  template <class type> struct alignof_helper { char __slot1; type __slot2; };
+# define alignof_slot(type) offsetof (alignof_helper<type>, __slot2)
+#else
+# define alignof_slot(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
+#endif
+
+/* Determine the good alignment of a object of the given type at compile time.
+   Note that this is not necessarily the same as alignof_slot(type).
+   For example, with GNU C on x86 platforms: alignof_type(double) = 8, but
+   - when -malign-double is not specified:  alignof_slot(double) = 4,
+   - when -malign-double is specified:      alignof_slot(double) = 8.
+   Note: The result cannot be used as a value for an 'enum' constant,
+   due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc.  */
+#if defined __GNUC__
+# define alignof_type __alignof__
+#else
+# define alignof_type alignof_slot
+#endif
+
+/* alignof is an alias for alignof_slot semantics, since that's what most
+   callers need.
+   Note: The result cannot be used as a value for an 'enum' constant,
+   due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc.  */
+#define alignof alignof_slot
+
+#endif /* _ALIGNOF_H */
diff --git a/gnulib/alloca.c b/gnulib/alloca.c
deleted file mode 100644 (file)
index 3a1f4e2..0000000
+++ /dev/null
@@ -1,489 +0,0 @@
-/* alloca.c -- allocate automatically reclaimed memory
-   (Mostly) portable public-domain implementation -- D A Gwyn
-
-   This implementation of the PWB library alloca function,
-   which is used to allocate space off the run-time stack so
-   that it is automatically reclaimed upon procedure exit,
-   was inspired by discussions with J. Q. Johnson of Cornell.
-   J.Otto Tennant <jot@cray.com> contributed the Cray support.
-
-   There are some preprocessor constants that can
-   be defined when compiling for your specific system, for
-   improved efficiency; however, the defaults should be okay.
-
-   The general concept of this implementation is to keep
-   track of all alloca-allocated blocks, and reclaim any
-   that are found to be deeper in the stack than the current
-   invocation.  This heuristic does not reclaim storage as
-   soon as it becomes invalid, but it will do so eventually.
-
-   As a special case, alloca(0) reclaims storage without
-   allocating any.  It is a good idea to use alloca(0) in
-   your main control loop, etc. to force garbage collection.  */
-
-#include <config.h>
-
-#include <alloca.h>
-
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef emacs
-# include "lisp.h"
-# include "blockinput.h"
-# ifdef EMACS_FREE
-#  undef free
-#  define free EMACS_FREE
-# endif
-#else
-# define memory_full() abort ()
-#endif
-
-/* If compiling with GCC 2, this file's not needed.  */
-#if !defined (__GNUC__) || __GNUC__ < 2
-
-/* If someone has defined alloca as a macro,
-   there must be some other way alloca is supposed to work.  */
-# ifndef alloca
-
-#  ifdef emacs
-#   ifdef static
-/* actually, only want this if static is defined as ""
-   -- this is for usg, in which emacs must undefine static
-   in order to make unexec workable
-   */
-#    ifndef STACK_DIRECTION
-you
-lose
--- must know STACK_DIRECTION at compile-time
-/* Using #error here is not wise since this file should work for
-   old and obscure compilers.  */
-#    endif /* STACK_DIRECTION undefined */
-#   endif /* static */
-#  endif /* emacs */
-
-/* If your stack is a linked list of frames, you have to
-   provide an "address metric" ADDRESS_FUNCTION macro.  */
-
-#  if defined (CRAY) && defined (CRAY_STACKSEG_END)
-long i00afunc ();
-#   define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
-#  else
-#   define ADDRESS_FUNCTION(arg) &(arg)
-#  endif
-
-/* Define STACK_DIRECTION if you know the direction of stack
-   growth for your system; otherwise it will be automatically
-   deduced at run-time.
-
-   STACK_DIRECTION > 0 => grows toward higher addresses
-   STACK_DIRECTION < 0 => grows toward lower addresses
-   STACK_DIRECTION = 0 => direction of growth unknown  */
-
-#  ifndef STACK_DIRECTION
-#   define STACK_DIRECTION     0       /* Direction unknown.  */
-#  endif
-
-#  if STACK_DIRECTION != 0
-
-#   define STACK_DIR   STACK_DIRECTION /* Known at compile-time.  */
-
-#  else /* STACK_DIRECTION == 0; need run-time code.  */
-
-static int stack_dir;          /* 1 or -1 once known.  */
-#   define STACK_DIR   stack_dir
-
-static void
-find_stack_direction (void)
-{
-  static char *addr = NULL;    /* Address of first `dummy', once known.  */
-  auto char dummy;             /* To get stack address.  */
-
-  if (addr == NULL)
-    {                          /* Initial entry.  */
-      addr = ADDRESS_FUNCTION (dummy);
-
-      find_stack_direction (); /* Recurse once.  */
-    }
-  else
-    {
-      /* Second entry.  */
-      if (ADDRESS_FUNCTION (dummy) > addr)
-       stack_dir = 1;          /* Stack grew upward.  */
-      else
-       stack_dir = -1;         /* Stack grew downward.  */
-    }
-}
-
-#  endif /* STACK_DIRECTION == 0 */
-
-/* An "alloca header" is used to:
-   (a) chain together all alloca'ed blocks;
-   (b) keep track of stack depth.
-
-   It is very important that sizeof(header) agree with malloc
-   alignment chunk size.  The following default should work okay.  */
-
-#  ifndef      ALIGN_SIZE
-#   define ALIGN_SIZE  sizeof(double)
-#  endif
-
-typedef union hdr
-{
-  char align[ALIGN_SIZE];      /* To force sizeof(header).  */
-  struct
-    {
-      union hdr *next;         /* For chaining headers.  */
-      char *deep;              /* For stack depth measure.  */
-    } h;
-} header;
-
-static header *last_alloca_header = NULL;      /* -> last alloca header.  */
-
-/* Return a pointer to at least SIZE bytes of storage,
-   which will be automatically reclaimed upon exit from
-   the procedure that called alloca.  Originally, this space
-   was supposed to be taken from the current stack frame of the
-   caller, but that method cannot be made to work for some
-   implementations of C, for example under Gould's UTX/32.  */
-
-void *
-alloca (size_t size)
-{
-  auto char probe;             /* Probes stack depth: */
-  register char *depth = ADDRESS_FUNCTION (probe);
-
-#  if STACK_DIRECTION == 0
-  if (STACK_DIR == 0)          /* Unknown growth direction.  */
-    find_stack_direction ();
-#  endif
-
-  /* Reclaim garbage, defined as all alloca'd storage that
-     was allocated from deeper in the stack than currently.  */
-
-  {
-    register header *hp;       /* Traverses linked list.  */
-
-#  ifdef emacs
-    BLOCK_INPUT;
-#  endif
-
-    for (hp = last_alloca_header; hp != NULL;)
-      if ((STACK_DIR > 0 && hp->h.deep > depth)
-         || (STACK_DIR < 0 && hp->h.deep < depth))
-       {
-         register header *np = hp->h.next;
-
-         free (hp);            /* Collect garbage.  */
-
-         hp = np;              /* -> next header.  */
-       }
-      else
-       break;                  /* Rest are not deeper.  */
-
-    last_alloca_header = hp;   /* -> last valid storage.  */
-
-#  ifdef emacs
-    UNBLOCK_INPUT;
-#  endif
-  }
-
-  if (size == 0)
-    return NULL;               /* No allocation required.  */
-
-  /* Allocate combined header + user data storage.  */
-
-  {
-    /* Address of header.  */
-    register header *new;
-
-    size_t combined_size = sizeof (header) + size;
-    if (combined_size < sizeof (header))
-      memory_full ();
-
-    new = malloc (combined_size);
-
-    if (! new)
-      memory_full ();
-
-    new->h.next = last_alloca_header;
-    new->h.deep = depth;
-
-    last_alloca_header = new;
-
-    /* User storage begins just after header.  */
-
-    return (void *) (new + 1);
-  }
-}
-
-#  if defined (CRAY) && defined (CRAY_STACKSEG_END)
-
-#   ifdef DEBUG_I00AFUNC
-#    include <stdio.h>
-#   endif
-
-#   ifndef CRAY_STACK
-#    define CRAY_STACK
-#    ifndef CRAY2
-/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
-struct stack_control_header
-  {
-    long shgrow:32;            /* Number of times stack has grown.  */
-    long shaseg:32;            /* Size of increments to stack.  */
-    long shhwm:32;             /* High water mark of stack.  */
-    long shsize:32;            /* Current size of stack (all segments).  */
-  };
-
-/* The stack segment linkage control information occurs at
-   the high-address end of a stack segment.  (The stack
-   grows from low addresses to high addresses.)  The initial
-   part of the stack segment linkage control information is
-   0200 (octal) words.  This provides for register storage
-   for the routine which overflows the stack.  */
-
-struct stack_segment_linkage
-  {
-    long ss[0200];             /* 0200 overflow words.  */
-    long sssize:32;            /* Number of words in this segment.  */
-    long ssbase:32;            /* Offset to stack base.  */
-    long:32;
-    long sspseg:32;            /* Offset to linkage control of previous
-                                  segment of stack.  */
-    long:32;
-    long sstcpt:32;            /* Pointer to task common address block.  */
-    long sscsnm;               /* Private control structure number for
-                                  microtasking.  */
-    long ssusr1;               /* Reserved for user.  */
-    long ssusr2;               /* Reserved for user.  */
-    long sstpid;               /* Process ID for pid based multi-tasking.  */
-    long ssgvup;               /* Pointer to multitasking thread giveup.  */
-    long sscray[7];            /* Reserved for Cray Research.  */
-    long ssa0;
-    long ssa1;
-    long ssa2;
-    long ssa3;
-    long ssa4;
-    long ssa5;
-    long ssa6;
-    long ssa7;
-    long sss0;
-    long sss1;
-    long sss2;
-    long sss3;
-    long sss4;
-    long sss5;
-    long sss6;
-    long sss7;
-  };
-
-#    else /* CRAY2 */
-/* The following structure defines the vector of words
-   returned by the STKSTAT library routine.  */
-struct stk_stat
-  {
-    long now;                  /* Current total stack size.  */
-    long maxc;                 /* Amount of contiguous space which would
-                                  be required to satisfy the maximum
-                                  stack demand to date.  */
-    long high_water;           /* Stack high-water mark.  */
-    long overflows;            /* Number of stack overflow ($STKOFEN) calls.  */
-    long hits;                 /* Number of internal buffer hits.  */
-    long extends;              /* Number of block extensions.  */
-    long stko_mallocs;         /* Block allocations by $STKOFEN.  */
-    long underflows;           /* Number of stack underflow calls ($STKRETN).  */
-    long stko_free;            /* Number of deallocations by $STKRETN.  */
-    long stkm_free;            /* Number of deallocations by $STKMRET.  */
-    long segments;             /* Current number of stack segments.  */
-    long maxs;                 /* Maximum number of stack segments so far.  */
-    long pad_size;             /* Stack pad size.  */
-    long current_address;      /* Current stack segment address.  */
-    long current_size;         /* Current stack segment size.  This
-                                  number is actually corrupted by STKSTAT to
-                                  include the fifteen word trailer area.  */
-    long initial_address;      /* Address of initial segment.  */
-    long initial_size;         /* Size of initial segment.  */
-  };
-
-/* The following structure describes the data structure which trails
-   any stack segment.  I think that the description in 'asdef' is
-   out of date.  I only describe the parts that I am sure about.  */
-
-struct stk_trailer
-  {
-    long this_address;         /* Address of this block.  */
-    long this_size;            /* Size of this block (does not include
-                                  this trailer).  */
-    long unknown2;
-    long unknown3;
-    long link;                 /* Address of trailer block of previous
-                                  segment.  */
-    long unknown5;
-    long unknown6;
-    long unknown7;
-    long unknown8;
-    long unknown9;
-    long unknown10;
-    long unknown11;
-    long unknown12;
-    long unknown13;
-    long unknown14;
-  };
-
-#    endif /* CRAY2 */
-#   endif /* not CRAY_STACK */
-
-#   ifdef CRAY2
-/* Determine a "stack measure" for an arbitrary ADDRESS.
-   I doubt that "lint" will like this much.  */
-
-static long
-i00afunc (long *address)
-{
-  struct stk_stat status;
-  struct stk_trailer *trailer;
-  long *block, size;
-  long result = 0;
-
-  /* We want to iterate through all of the segments.  The first
-     step is to get the stack status structure.  We could do this
-     more quickly and more directly, perhaps, by referencing the
-     $LM00 common block, but I know that this works.  */
-
-  STKSTAT (&status);
-
-  /* Set up the iteration.  */
-
-  trailer = (struct stk_trailer *) (status.current_address
-                                   + status.current_size
-                                   - 15);
-
-  /* There must be at least one stack segment.  Therefore it is
-     a fatal error if "trailer" is null.  */
-
-  if (trailer == 0)
-    abort ();
-
-  /* Discard segments that do not contain our argument address.  */
-
-  while (trailer != 0)
-    {
-      block = (long *) trailer->this_address;
-      size = trailer->this_size;
-      if (block == 0 || size == 0)
-       abort ();
-      trailer = (struct stk_trailer *) trailer->link;
-      if ((block <= address) && (address < (block + size)))
-       break;
-    }
-
-  /* Set the result to the offset in this segment and add the sizes
-     of all predecessor segments.  */
-
-  result = address - block;
-
-  if (trailer == 0)
-    {
-      return result;
-    }
-
-  do
-    {
-      if (trailer->this_size <= 0)
-       abort ();
-      result += trailer->this_size;
-      trailer = (struct stk_trailer *) trailer->link;
-    }
-  while (trailer != 0);
-
-  /* We are done.  Note that if you present a bogus address (one
-     not in any segment), you will get a different number back, formed
-     from subtracting the address of the first block.  This is probably
-     not what you want.  */
-
-  return (result);
-}
-
-#   else /* not CRAY2 */
-/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
-   Determine the number of the cell within the stack,
-   given the address of the cell.  The purpose of this
-   routine is to linearize, in some sense, stack addresses
-   for alloca.  */
-
-static long
-i00afunc (long address)
-{
-  long stkl = 0;
-
-  long size, pseg, this_segment, stack;
-  long result = 0;
-
-  struct stack_segment_linkage *ssptr;
-
-  /* Register B67 contains the address of the end of the
-     current stack segment.  If you (as a subprogram) store
-     your registers on the stack and find that you are past
-     the contents of B67, you have overflowed the segment.
-
-     B67 also points to the stack segment linkage control
-     area, which is what we are really interested in.  */
-
-  stkl = CRAY_STACKSEG_END ();
-  ssptr = (struct stack_segment_linkage *) stkl;
-
-  /* If one subtracts 'size' from the end of the segment,
-     one has the address of the first word of the segment.
-
-     If this is not the first segment, 'pseg' will be
-     nonzero.  */
-
-  pseg = ssptr->sspseg;
-  size = ssptr->sssize;
-
-  this_segment = stkl - size;
-
-  /* It is possible that calling this routine itself caused
-     a stack overflow.  Discard stack segments which do not
-     contain the target address.  */
-
-  while (!(this_segment <= address && address <= stkl))
-    {
-#    ifdef DEBUG_I00AFUNC
-      fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
-#    endif
-      if (pseg == 0)
-       break;
-      stkl = stkl - pseg;
-      ssptr = (struct stack_segment_linkage *) stkl;
-      size = ssptr->sssize;
-      pseg = ssptr->sspseg;
-      this_segment = stkl - size;
-    }
-
-  result = address - this_segment;
-
-  /* If you subtract pseg from the current end of the stack,
-     you get the address of the previous stack segment's end.
-     This seems a little convoluted to me, but I'll bet you save
-     a cycle somewhere.  */
-
-  while (pseg != 0)
-    {
-#    ifdef DEBUG_I00AFUNC
-      fprintf (stderr, "%011o %011o\n", pseg, size);
-#    endif
-      stkl = stkl - pseg;
-      ssptr = (struct stack_segment_linkage *) stkl;
-      size = ssptr->sssize;
-      pseg = ssptr->sspseg;
-      result += size;
-    }
-  return (result);
-}
-
-#   endif /* not CRAY2 */
-#  endif /* CRAY */
-
-# endif /* no alloca */
-#endif /* not GCC version 2 */
index 5d16e08b7f6cfe494c6040f090d6f08df78dbb58..44f20b7a1a0d7fb17c52ecffcf9eedc1c9e3a091 100644 (file)
@@ -1,11 +1,11 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2008 Free Software
-   Foundation, Inc.
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2010 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)
+   by the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
index 315d9661f3bddc7ea211900ba6fced2442e791f3..f7c3bc728abb02406065dffb0de1111ed7ca180b 100644 (file)
@@ -1,10 +1,10 @@
 /* A GNU-like <arpa/inet.h>.
 
-   Copyright (C) 2005-2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 
 #ifndef _GL_ARPA_INET_H
 
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
 /* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
-   under MinGW. */
-#include <sys/socket.h>
+   under MinGW.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <sys/socket.h>
+#endif
 
 #if @HAVE_ARPA_INET_H@
 
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
-
 /* The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
 
@@ -36,7 +39,9 @@
 #ifndef _GL_ARPA_INET_H
 #define _GL_ARPA_INET_H
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 #ifdef __cplusplus
 extern "C" {
@@ -60,26 +65,28 @@ extern "C" {
    For more details, see the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/inet_ntop.html>.  */
 extern const char *inet_ntop (int af, const void *restrict src,
-                             char *restrict dst, socklen_t cnt);
+                              char *restrict dst, socklen_t cnt)
+     _GL_ARG_NONNULL ((2, 3));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef inet_ntop
-# define inet_ntop(af,src,dst,cnt) \
-    (GL_LINK_WARNING ("inet_ntop is unportable - " \
-                      "use gnulib module inet_ntop for portability"), \
-     inet_ntop (af, src, dst, cnt))
+# if HAVE_RAW_DECL_INET_NTOP
+_GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
+                 "use gnulib module inet_ntop for portability");
+# endif
 #endif
 
 #if @GNULIB_INET_PTON@
 # if !@HAVE_DECL_INET_PTON@
-extern int inet_pton (int af, const char *restrict src, void *restrict dst);
+extern int inet_pton (int af, const char *restrict src, void *restrict dst)
+     _GL_ARG_NONNULL ((2, 3));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef inet_pton
-# define inet_pton(af,src,dst) \
-  (GL_LINK_WARNING ("inet_pton is unportable - " \
-                   "use gnulib module inet_pton for portability"), \
-   inet_pton (af, src, dst))
+# if HAVE_RAW_DECL_INET_PTON
+_GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
+                 "use gnulib module inet_pton for portability");
+# endif
 #endif
 
 #ifdef __cplusplus
index 26c3988b01eff997d89c2813db1a3a91f5c886c0..3bd2229d524875e7fb2dabccc4d2b9d2d8553bca 100644 (file)
@@ -1,9 +1,9 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006, 2009, 2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
index 8aff43002fbd53d2bb3d02c428f6d4d094d8bd8c..d99e175f9d6233b49ad773f38cac03ba44a4a09e 100644 (file)
@@ -1,10 +1,10 @@
 /* base64.c -- Encode binary data using printable characters.
-   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2006 Free Software
+   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2006, 2009, 2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -67,7 +67,7 @@ to_uchar (char ch)
    terminate the output buffer. */
 void
 base64_encode (const char *restrict in, size_t inlen,
-              char *restrict out, size_t outlen)
+               char *restrict out, size_t outlen)
 {
   static const char b64str[64] =
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -76,27 +76,27 @@ base64_encode (const char *restrict in, size_t inlen,
     {
       *out++ = b64str[(to_uchar (in[0]) >> 2) & 0x3f];
       if (!--outlen)
-       break;
+        break;
       *out++ = b64str[((to_uchar (in[0]) << 4)
-                      + (--inlen ? to_uchar (in[1]) >> 4 : 0))
-                     & 0x3f];
+                       + (--inlen ? to_uchar (in[1]) >> 4 : 0))
+                      & 0x3f];
       if (!--outlen)
-       break;
+        break;
       *out++ =
-       (inlen
-        ? b64str[((to_uchar (in[1]) << 2)
-                  + (--inlen ? to_uchar (in[2]) >> 6 : 0))
-                 & 0x3f]
-        : '=');
+        (inlen
+         ? b64str[((to_uchar (in[1]) << 2)
+                   + (--inlen ? to_uchar (in[2]) >> 6 : 0))
+                  & 0x3f]
+         : '=');
       if (!--outlen)
-       break;
+        break;
       *out++ = inlen ? b64str[to_uchar (in[2]) & 0x3f] : '=';
       if (!--outlen)
-       break;
+        break;
       if (inlen)
-       inlen--;
+        inlen--;
       if (inlen)
-       in += 3;
+        in += 3;
     }
 
   if (outlen)
@@ -153,71 +153,71 @@ base64_encode_alloc (const char *in, size_t inlen, char **out)
 
    IBM C V6 for AIX mishandles "#define B64(x) ...'x'...", so use "_"
    as the formal parameter rather than "x".  */
-#define B64(_)                                 \
-  ((_) == 'A' ? 0                              \
-   : (_) == 'B' ? 1                            \
-   : (_) == 'C' ? 2                            \
-   : (_) == 'D' ? 3                            \
-   : (_) == 'E' ? 4                            \
-   : (_) == 'F' ? 5                            \
-   : (_) == 'G' ? 6                            \
-   : (_) == 'H' ? 7                            \
-   : (_) == 'I' ? 8                            \
-   : (_) == 'J' ? 9                            \
-   : (_) == 'K' ? 10                           \
-   : (_) == 'L' ? 11                           \
-   : (_) == 'M' ? 12                           \
-   : (_) == 'N' ? 13                           \
-   : (_) == 'O' ? 14                           \
-   : (_) == 'P' ? 15                           \
-   : (_) == 'Q' ? 16                           \
-   : (_) == 'R' ? 17                           \
-   : (_) == 'S' ? 18                           \
-   : (_) == 'T' ? 19                           \
-   : (_) == 'U' ? 20                           \
-   : (_) == 'V' ? 21                           \
-   : (_) == 'W' ? 22                           \
-   : (_) == 'X' ? 23                           \
-   : (_) == 'Y' ? 24                           \
-   : (_) == 'Z' ? 25                           \
-   : (_) == 'a' ? 26                           \
-   : (_) == 'b' ? 27                           \
-   : (_) == 'c' ? 28                           \
-   : (_) == 'd' ? 29                           \
-   : (_) == 'e' ? 30                           \
-   : (_) == 'f' ? 31                           \
-   : (_) == 'g' ? 32                           \
-   : (_) == 'h' ? 33                           \
-   : (_) == 'i' ? 34                           \
-   : (_) == 'j' ? 35                           \
-   : (_) == 'k' ? 36                           \
-   : (_) == 'l' ? 37                           \
-   : (_) == 'm' ? 38                           \
-   : (_) == 'n' ? 39                           \
-   : (_) == 'o' ? 40                           \
-   : (_) == 'p' ? 41                           \
-   : (_) == 'q' ? 42                           \
-   : (_) == 'r' ? 43                           \
-   : (_) == 's' ? 44                           \
-   : (_) == 't' ? 45                           \
-   : (_) == 'u' ? 46                           \
-   : (_) == 'v' ? 47                           \
-   : (_) == 'w' ? 48                           \
-   : (_) == 'x' ? 49                           \
-   : (_) == 'y' ? 50                           \
-   : (_) == 'z' ? 51                           \
-   : (_) == '0' ? 52                           \
-   : (_) == '1' ? 53                           \
-   : (_) == '2' ? 54                           \
-   : (_) == '3' ? 55                           \
-   : (_) == '4' ? 56                           \
-   : (_) == '5' ? 57                           \
-   : (_) == '6' ? 58                           \
-   : (_) == '7' ? 59                           \
-   : (_) == '8' ? 60                           \
-   : (_) == '9' ? 61                           \
-   : (_) == '+' ? 62                           \
-   : (_) == '/' ? 63                           \
+#define B64(_)                                  \
+  ((_) == 'A' ? 0                               \
+   : (_) == 'B' ? 1                             \
+   : (_) == 'C' ? 2                             \
+   : (_) == 'D' ? 3                             \
+   : (_) == 'E' ? 4                             \
+   : (_) == 'F' ? 5                             \
+   : (_) == 'G' ? 6                             \
+   : (_) == 'H' ? 7                             \
+   : (_) == 'I' ? 8                             \
+   : (_) == 'J' ? 9                             \
+   : (_) == 'K' ? 10                            \
+   : (_) == 'L' ? 11                            \
+   : (_) == 'M' ? 12                            \
+   : (_) == 'N' ? 13                            \
+   : (_) == 'O' ? 14                            \
+   : (_) == 'P' ? 15                            \
+   : (_) == 'Q' ? 16                            \
+   : (_) == 'R' ? 17                            \
+   : (_) == 'S' ? 18                            \
+   : (_) == 'T' ? 19                            \
+   : (_) == 'U' ? 20                            \
+   : (_) == 'V' ? 21                            \
+   : (_) == 'W' ? 22                            \
+   : (_) == 'X' ? 23                            \
+   : (_) == 'Y' ? 24                            \
+   : (_) == 'Z' ? 25                            \
+   : (_) == 'a' ? 26                            \
+   : (_) == 'b' ? 27                            \
+   : (_) == 'c' ? 28                            \
+   : (_) == 'd' ? 29                            \
+   : (_) == 'e' ? 30                            \
+   : (_) == 'f' ? 31                            \
+   : (_) == 'g' ? 32                            \
+   : (_) == 'h' ? 33                            \
+   : (_) == 'i' ? 34                            \
+   : (_) == 'j' ? 35                            \
+   : (_) == 'k' ? 36                            \
+   : (_) == 'l' ? 37                            \
+   : (_) == 'm' ? 38                            \
+   : (_) == 'n' ? 39                            \
+   : (_) == 'o' ? 40                            \
+   : (_) == 'p' ? 41                            \
+   : (_) == 'q' ? 42                            \
+   : (_) == 'r' ? 43                            \
+   : (_) == 's' ? 44                            \
+   : (_) == 't' ? 45                            \
+   : (_) == 'u' ? 46                            \
+   : (_) == 'v' ? 47                            \
+   : (_) == 'w' ? 48                            \
+   : (_) == 'x' ? 49                            \
+   : (_) == 'y' ? 50                            \
+   : (_) == 'z' ? 51                            \
+   : (_) == '0' ? 52                            \
+   : (_) == '1' ? 53                            \
+   : (_) == '2' ? 54                            \
+   : (_) == '3' ? 55                            \
+   : (_) == '4' ? 56                            \
+   : (_) == '5' ? 57                            \
+   : (_) == '6' ? 58                            \
+   : (_) == '7' ? 59                            \
+   : (_) == '8' ? 60                            \
+   : (_) == '9' ? 61                            \
+   : (_) == '+' ? 62                            \
+   : (_) == '/' ? 63                            \
    : -1)
 
 static const signed char b64[0x100] = {
@@ -328,12 +328,12 @@ get_4 (struct base64_decode_context *ctx,
     {
       char const *t = *in;
       if (4 <= in_end - *in && memchr (t, '\n', 4) == NULL)
-       {
-         /* This is the common case: no newline.  */
-         *in += 4;
-         *n_non_newline = 4;
-         return (char *) t;
-       }
+        {
+          /* This is the common case: no newline.  */
+          *in += 4;
+          *n_non_newline = 4;
+          return (char *) t;
+        }
     }
 
   {
@@ -341,13 +341,13 @@ get_4 (struct base64_decode_context *ctx,
     char const *p = *in;
     while (p < in_end)
       {
-       char c = *p++;
-       if (c != '\n')
-         {
-           ctx->buf[ctx->i++] = c;
-           if (ctx->i == 4)
-             break;
-         }
+        char c = *p++;
+        if (c != '\n')
+          {
+            ctx->buf[ctx->i++] = c;
+            if (ctx->i == 4)
+              break;
+          }
       }
 
     *in = p;
@@ -356,12 +356,12 @@ get_4 (struct base64_decode_context *ctx,
   }
 }
 
-#define return_false                           \
-  do                                           \
-    {                                          \
-      *outp = out;                             \
-      return false;                            \
-    }                                          \
+#define return_false                            \
+  do                                            \
+    {                                           \
+      *outp = out;                              \
+      return false;                             \
+    }                                           \
   while (false)
 
 /* Decode up to four bytes of base64-encoded data, IN, of length INLEN
@@ -372,7 +372,7 @@ get_4 (struct base64_decode_context *ctx,
    *OUTLEN to reflect the number of bytes remaining in *OUT.  */
 static inline bool
 decode_4 (char const *restrict in, size_t inlen,
-         char *restrict *outp, size_t *outleft)
+          char *restrict *outp, size_t *outleft)
 {
   char *out = *outp;
   if (inlen < 2)
@@ -384,7 +384,7 @@ decode_4 (char const *restrict in, size_t inlen,
   if (*outleft)
     {
       *out++ = ((b64[to_uchar (in[0])] << 2)
-               | (b64[to_uchar (in[1])] >> 4));
+                | (b64[to_uchar (in[1])] >> 4));
       --*outleft;
     }
 
@@ -394,43 +394,43 @@ decode_4 (char const *restrict in, size_t inlen,
   if (in[2] == '=')
     {
       if (inlen != 4)
-       return_false;
+        return_false;
 
       if (in[3] != '=')
-       return_false;
+        return_false;
     }
   else
     {
       if (!isbase64 (in[2]))
-       return_false;
+        return_false;
 
       if (*outleft)
-       {
-         *out++ = (((b64[to_uchar (in[1])] << 4) & 0xf0)
-                   | (b64[to_uchar (in[2])] >> 2));
-         --*outleft;
-       }
+        {
+          *out++ = (((b64[to_uchar (in[1])] << 4) & 0xf0)
+                    | (b64[to_uchar (in[2])] >> 2));
+          --*outleft;
+        }
 
       if (inlen == 3)
-       return_false;
+        return_false;
 
       if (in[3] == '=')
-       {
-         if (inlen != 4)
-           return_false;
-       }
+        {
+          if (inlen != 4)
+            return_false;
+        }
       else
-       {
-         if (!isbase64 (in[3]))
-           return_false;
-
-         if (*outleft)
-           {
-             *out++ = (((b64[to_uchar (in[2])] << 6) & 0xc0)
-                       | b64[to_uchar (in[3])]);
-             --*outleft;
-           }
-       }
+        {
+          if (!isbase64 (in[3]))
+            return_false;
+
+          if (*outleft)
+            {
+              *out++ = (((b64[to_uchar (in[2])] << 6) & 0xc0)
+                        | b64[to_uchar (in[3])]);
+              --*outleft;
+            }
+        }
     }
 
   *outp = out;
@@ -457,8 +457,8 @@ decode_4 (char const *restrict in, size_t inlen,
 
 bool
 base64_decode_ctx (struct base64_decode_context *ctx,
-                  const char *restrict in, size_t inlen,
-                  char *restrict out, size_t *outlen)
+                   const char *restrict in, size_t inlen,
+                   char *restrict out, size_t *outlen)
 {
   size_t outleft = *outlen;
   bool ignore_newlines = ctx != NULL;
@@ -476,57 +476,57 @@ base64_decode_ctx (struct base64_decode_context *ctx,
     {
       size_t outleft_save = outleft;
       if (ctx_i == 0 && !flush_ctx)
-       {
-         while (true)
-           {
-             /* Save a copy of outleft, in case we need to re-parse this
-                block of four bytes.  */
-             outleft_save = outleft;
-             if (!decode_4 (in, inlen, &out, &outleft))
-               break;
-
-             in += 4;
-             inlen -= 4;
-           }
-       }
+        {
+          while (true)
+            {
+              /* Save a copy of outleft, in case we need to re-parse this
+                 block of four bytes.  */
+              outleft_save = outleft;
+              if (!decode_4 (in, inlen, &out, &outleft))
+                break;
+
+              in += 4;
+              inlen -= 4;
+            }
+        }
 
       if (inlen == 0 && !flush_ctx)
-       break;
+        break;
 
       /* Handle the common case of 72-byte wrapped lines.
-        This also handles any other multiple-of-4-byte wrapping.  */
+         This also handles any other multiple-of-4-byte wrapping.  */
       if (inlen && *in == '\n' && ignore_newlines)
-       {
-         ++in;
-         --inlen;
-         continue;
-       }
+        {
+          ++in;
+          --inlen;
+          continue;
+        }
 
       /* Restore OUT and OUTLEFT.  */
       out -= outleft_save - outleft;
       outleft = outleft_save;
 
       {
-       char const *in_end = in + inlen;
-       char const *non_nl;
-
-       if (ignore_newlines)
-         non_nl = get_4 (ctx, &in, in_end, &inlen);
-       else
-         non_nl = in;  /* Might have nl in this case. */
-
-       /* If the input is empty or consists solely of newlines (0 non-newlines),
-          then we're done.  Likewise if there are fewer than 4 bytes when not
-          flushing context and not treating newlines as garbage.  */
-       if (inlen == 0 || (inlen < 4 && !flush_ctx && ignore_newlines))
-         {
-           inlen = 0;
-           break;
-         }
-       if (!decode_4 (non_nl, inlen, &out, &outleft))
-         break;
-
-       inlen = in_end - in;
+        char const *in_end = in + inlen;
+        char const *non_nl;
+
+        if (ignore_newlines)
+          non_nl = get_4 (ctx, &in, in_end, &inlen);
+        else
+          non_nl = in;  /* Might have nl in this case. */
+
+        /* If the input is empty or consists solely of newlines (0 non-newlines),
+           then we're done.  Likewise if there are fewer than 4 bytes when not
+           flushing context and not treating newlines as garbage.  */
+        if (inlen == 0 || (inlen < 4 && !flush_ctx && ignore_newlines))
+          {
+            inlen = 0;
+            break;
+          }
+        if (!decode_4 (non_nl, inlen, &out, &outleft))
+          break;
+
+        inlen = in_end - in;
       }
     }
 
@@ -548,8 +548,8 @@ base64_decode_ctx (struct base64_decode_context *ctx,
    undefined. */
 bool
 base64_decode_alloc_ctx (struct base64_decode_context *ctx,
-                        const char *in, size_t inlen, char **out,
-                        size_t *outlen)
+                         const char *in, size_t inlen, char **out,
+                         size_t *outlen)
 {
   /* This may allocate a few bytes too many, depending on input,
      but it's not worth the extra CPU time to compute the exact size.
index 9c31651e4c801c6e796bfd73e5918767e0a77cd4..2be394bdade0594b260214543c672c26ffc6c63f 100644 (file)
@@ -1,10 +1,10 @@
 /* base64.h -- Encode binary data using printable characters.
-   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -38,24 +38,24 @@ struct base64_decode_context
 extern bool isbase64 (char ch);
 
 extern void base64_encode (const char *restrict in, size_t inlen,
-                          char *restrict out, size_t outlen);
+                           char *restrict out, size_t outlen);
 
 extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out);
 
 extern void base64_decode_ctx_init (struct base64_decode_context *ctx);
 
 extern bool base64_decode_ctx (struct base64_decode_context *ctx,
-                              const char *restrict in, size_t inlen,
-                              char *restrict out, size_t *outlen);
+                               const char *restrict in, size_t inlen,
+                               char *restrict out, size_t *outlen);
 
 extern bool base64_decode_alloc_ctx (struct base64_decode_context *ctx,
-                                    const char *in, size_t inlen,
-                                    char **out, size_t *outlen);
+                                     const char *in, size_t inlen,
+                                     char **out, size_t *outlen);
 
 #define base64_decode(in, inlen, out, outlen) \
-       base64_decode_ctx (NULL, in, inlen, out, outlen)
+        base64_decode_ctx (NULL, in, inlen, out, outlen)
 
 #define base64_decode_alloc(in, inlen, out, outlen) \
-       base64_decode_alloc_ctx (NULL, in, inlen, out, outlen)
+        base64_decode_alloc_ctx (NULL, in, inlen, out, outlen)
 
 #endif /* BASE64_H */
index 7f3b9663c4f261ece2ce3ff4db8bd3a6d7a99876..8744602aaf25ed826985490ed18bd2ba25d006cb 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert unibyte character to wide character.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -21,6 +21,7 @@
 #include <wchar.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 
 wint_t
 btowc (int c)
@@ -32,7 +33,7 @@ btowc (int c)
 
       buf[0] = c;
       if (mbtowc (&wc, buf, 1) >= 0)
-       return wc;
+        return wc;
     }
   return WEOF;
 }
diff --git a/gnulib/c-ctype.c b/gnulib/c-ctype.c
new file mode 100644 (file)
index 0000000..0d8da20
--- /dev/null
@@ -0,0 +1,396 @@
+/* Character handling in C locale.
+
+   Copyright 2000-2003, 2006, 2009-2010 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 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+/* Specification.  */
+#define NO_C_CTYPE_MACROS
+#include "c-ctype.h"
+
+/* The function isascii is not locale dependent. Its use in EBCDIC is
+   questionable. */
+bool
+c_isascii (int c)
+{
+  return (c >= 0x00 && c <= 0x7f);
+}
+
+bool
+c_isalnum (int c)
+{
+#if C_CTYPE_CONSECUTIVE_DIGITS \
+    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+  return ((c >= '0' && c <= '9')
+          || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z'));
+#else
+  return ((c >= '0' && c <= '9')
+          || (c >= 'A' && c <= 'Z')
+          || (c >= 'a' && c <= 'z'));
+#endif
+#else
+  switch (c)
+    {
+    case '0': case '1': case '2': case '3': case '4': case '5':
+    case '6': case '7': case '8': case '9':
+    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+    case 'Y': case 'Z':
+    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+    case 'y': case 'z':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isalpha (int c)
+{
+#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+  return ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z');
+#else
+  return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
+#endif
+#else
+  switch (c)
+    {
+    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+    case 'Y': case 'Z':
+    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+    case 'y': case 'z':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isblank (int c)
+{
+  return (c == ' ' || c == '\t');
+}
+
+bool
+c_iscntrl (int c)
+{
+#if C_CTYPE_ASCII
+  return ((c & ~0x1f) == 0 || c == 0x7f);
+#else
+  switch (c)
+    {
+    case ' ': case '!': case '"': case '#': case '$': case '%':
+    case '&': case '\'': case '(': case ')': case '*': case '+':
+    case ',': case '-': case '.': case '/':
+    case '0': case '1': case '2': case '3': case '4': case '5':
+    case '6': case '7': case '8': case '9':
+    case ':': case ';': case '<': case '=': case '>': case '?':
+    case '@':
+    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+    case 'Y': case 'Z':
+    case '[': case '\\': case ']': case '^': case '_': case '`':
+    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+    case 'y': case 'z':
+    case '{': case '|': case '}': case '~':
+      return 0;
+    default:
+      return 1;
+    }
+#endif
+}
+
+bool
+c_isdigit (int c)
+{
+#if C_CTYPE_CONSECUTIVE_DIGITS
+  return (c >= '0' && c <= '9');
+#else
+  switch (c)
+    {
+    case '0': case '1': case '2': case '3': case '4': case '5':
+    case '6': case '7': case '8': case '9':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_islower (int c)
+{
+#if C_CTYPE_CONSECUTIVE_LOWERCASE
+  return (c >= 'a' && c <= 'z');
+#else
+  switch (c)
+    {
+    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+    case 'y': case 'z':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isgraph (int c)
+{
+#if C_CTYPE_ASCII
+  return (c >= '!' && c <= '~');
+#else
+  switch (c)
+    {
+    case '!': case '"': case '#': case '$': case '%': case '&':
+    case '\'': case '(': case ')': case '*': case '+': case ',':
+    case '-': case '.': case '/':
+    case '0': case '1': case '2': case '3': case '4': case '5':
+    case '6': case '7': case '8': case '9':
+    case ':': case ';': case '<': case '=': case '>': case '?':
+    case '@':
+    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+    case 'Y': case 'Z':
+    case '[': case '\\': case ']': case '^': case '_': case '`':
+    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+    case 'y': case 'z':
+    case '{': case '|': case '}': case '~':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isprint (int c)
+{
+#if C_CTYPE_ASCII
+  return (c >= ' ' && c <= '~');
+#else
+  switch (c)
+    {
+    case ' ': case '!': case '"': case '#': case '$': case '%':
+    case '&': case '\'': case '(': case ')': case '*': case '+':
+    case ',': case '-': case '.': case '/':
+    case '0': case '1': case '2': case '3': case '4': case '5':
+    case '6': case '7': case '8': case '9':
+    case ':': case ';': case '<': case '=': case '>': case '?':
+    case '@':
+    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+    case 'Y': case 'Z':
+    case '[': case '\\': case ']': case '^': case '_': case '`':
+    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+    case 'y': case 'z':
+    case '{': case '|': case '}': case '~':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_ispunct (int c)
+{
+#if C_CTYPE_ASCII
+  return ((c >= '!' && c <= '~')
+          && !((c >= '0' && c <= '9')
+               || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z')));
+#else
+  switch (c)
+    {
+    case '!': case '"': case '#': case '$': case '%': case '&':
+    case '\'': case '(': case ')': case '*': case '+': case ',':
+    case '-': case '.': case '/':
+    case ':': case ';': case '<': case '=': case '>': case '?':
+    case '@':
+    case '[': case '\\': case ']': case '^': case '_': case '`':
+    case '{': case '|': case '}': case '~':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isspace (int c)
+{
+  return (c == ' ' || c == '\t'
+          || c == '\n' || c == '\v' || c == '\f' || c == '\r');
+}
+
+bool
+c_isupper (int c)
+{
+#if C_CTYPE_CONSECUTIVE_UPPERCASE
+  return (c >= 'A' && c <= 'Z');
+#else
+  switch (c)
+    {
+    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+    case 'Y': case 'Z':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isxdigit (int c)
+{
+#if C_CTYPE_CONSECUTIVE_DIGITS \
+    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+  return ((c >= '0' && c <= '9')
+          || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'F'));
+#else
+  return ((c >= '0' && c <= '9')
+          || (c >= 'A' && c <= 'F')
+          || (c >= 'a' && c <= 'f'));
+#endif
+#else
+  switch (c)
+    {
+    case '0': case '1': case '2': case '3': case '4': case '5':
+    case '6': case '7': case '8': case '9':
+    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+int
+c_tolower (int c)
+{
+#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+  return (c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c);
+#else
+  switch (c)
+    {
+    case 'A': return 'a';
+    case 'B': return 'b';
+    case 'C': return 'c';
+    case 'D': return 'd';
+    case 'E': return 'e';
+    case 'F': return 'f';
+    case 'G': return 'g';
+    case 'H': return 'h';
+    case 'I': return 'i';
+    case 'J': return 'j';
+    case 'K': return 'k';
+    case 'L': return 'l';
+    case 'M': return 'm';
+    case 'N': return 'n';
+    case 'O': return 'o';
+    case 'P': return 'p';
+    case 'Q': return 'q';
+    case 'R': return 'r';
+    case 'S': return 's';
+    case 'T': return 't';
+    case 'U': return 'u';
+    case 'V': return 'v';
+    case 'W': return 'w';
+    case 'X': return 'x';
+    case 'Y': return 'y';
+    case 'Z': return 'z';
+    default: return c;
+    }
+#endif
+}
+
+int
+c_toupper (int c)
+{
+#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+  return (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c);
+#else
+  switch (c)
+    {
+    case 'a': return 'A';
+    case 'b': return 'B';
+    case 'c': return 'C';
+    case 'd': return 'D';
+    case 'e': return 'E';
+    case 'f': return 'F';
+    case 'g': return 'G';
+    case 'h': return 'H';
+    case 'i': return 'I';
+    case 'j': return 'J';
+    case 'k': return 'K';
+    case 'l': return 'L';
+    case 'm': return 'M';
+    case 'n': return 'N';
+    case 'o': return 'O';
+    case 'p': return 'P';
+    case 'q': return 'Q';
+    case 'r': return 'R';
+    case 's': return 'S';
+    case 't': return 'T';
+    case 'u': return 'U';
+    case 'v': return 'V';
+    case 'w': return 'W';
+    case 'x': return 'X';
+    case 'y': return 'Y';
+    case 'z': return 'Z';
+    default: return c;
+    }
+#endif
+}
diff --git a/gnulib/c-ctype.h b/gnulib/c-ctype.h
new file mode 100644 (file)
index 0000000..0eb27e6
--- /dev/null
@@ -0,0 +1,295 @@
+/* Character handling in C locale.
+
+   These functions work like the corresponding functions in <ctype.h>,
+   except that they have the C (POSIX) locale hardwired, whereas the
+   <ctype.h> functions' behaviour depends on the current locale set via
+   setlocale.
+
+   Copyright (C) 2000-2003, 2006, 2008-2010 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 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef C_CTYPE_H
+#define C_CTYPE_H
+
+#include <stdbool.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* The functions defined in this file assume the "C" locale and a character
+   set without diacritics (ASCII-US or EBCDIC-US or something like that).
+   Even if the "C" locale on a particular system is an extension of the ASCII
+   character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
+   is ISO-8859-1), the functions in this file recognize only the ASCII
+   characters.  */
+
+
+/* Check whether the ASCII optimizations apply. */
+
+/* ANSI C89 (and ISO C99 5.2.1.3 too) already guarantees that
+   '0', '1', ..., '9' have consecutive integer values.  */
+#define C_CTYPE_CONSECUTIVE_DIGITS 1
+
+#if ('A' <= 'Z') \
+    && ('A' + 1 == 'B') && ('B' + 1 == 'C') && ('C' + 1 == 'D') \
+    && ('D' + 1 == 'E') && ('E' + 1 == 'F') && ('F' + 1 == 'G') \
+    && ('G' + 1 == 'H') && ('H' + 1 == 'I') && ('I' + 1 == 'J') \
+    && ('J' + 1 == 'K') && ('K' + 1 == 'L') && ('L' + 1 == 'M') \
+    && ('M' + 1 == 'N') && ('N' + 1 == 'O') && ('O' + 1 == 'P') \
+    && ('P' + 1 == 'Q') && ('Q' + 1 == 'R') && ('R' + 1 == 'S') \
+    && ('S' + 1 == 'T') && ('T' + 1 == 'U') && ('U' + 1 == 'V') \
+    && ('V' + 1 == 'W') && ('W' + 1 == 'X') && ('X' + 1 == 'Y') \
+    && ('Y' + 1 == 'Z')
+#define C_CTYPE_CONSECUTIVE_UPPERCASE 1
+#endif
+
+#if ('a' <= 'z') \
+    && ('a' + 1 == 'b') && ('b' + 1 == 'c') && ('c' + 1 == 'd') \
+    && ('d' + 1 == 'e') && ('e' + 1 == 'f') && ('f' + 1 == 'g') \
+    && ('g' + 1 == 'h') && ('h' + 1 == 'i') && ('i' + 1 == 'j') \
+    && ('j' + 1 == 'k') && ('k' + 1 == 'l') && ('l' + 1 == 'm') \
+    && ('m' + 1 == 'n') && ('n' + 1 == 'o') && ('o' + 1 == 'p') \
+    && ('p' + 1 == 'q') && ('q' + 1 == 'r') && ('r' + 1 == 's') \
+    && ('s' + 1 == 't') && ('t' + 1 == 'u') && ('u' + 1 == 'v') \
+    && ('v' + 1 == 'w') && ('w' + 1 == 'x') && ('x' + 1 == 'y') \
+    && ('y' + 1 == 'z')
+#define C_CTYPE_CONSECUTIVE_LOWERCASE 1
+#endif
+
+#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+    && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+    && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+    && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+    && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+    && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+    && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+    && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+    && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+    && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+    && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+    && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+    && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+    && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+    && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+    && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+    && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+    && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+    && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+    && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+    && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+    && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+    && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
+/* The character set is ASCII or one of its variants or extensions, not EBCDIC.
+   Testing the value of '\n' and '\r' is not relevant.  */
+#define C_CTYPE_ASCII 1
+#endif
+
+
+/* Function declarations. */
+
+/* Unlike the functions in <ctype.h>, which require an argument in the range
+   of the 'unsigned char' type, the functions here operate on values that are
+   in the 'unsigned char' range or in the 'char' range.  In other words,
+   when you have a 'char' value, you need to cast it before using it as
+   argument to a <ctype.h> function:
+
+         const char *s = ...;
+         if (isalpha ((unsigned char) *s)) ...
+
+   but you don't need to cast it for the functions defined in this file:
+
+         const char *s = ...;
+         if (c_isalpha (*s)) ...
+ */
+
+extern bool c_isascii (int c); /* not locale dependent */
+
+extern bool c_isalnum (int c);
+extern bool c_isalpha (int c);
+extern bool c_isblank (int c);
+extern bool c_iscntrl (int c);
+extern bool c_isdigit (int c);
+extern bool c_islower (int c);
+extern bool c_isgraph (int c);
+extern bool c_isprint (int c);
+extern bool c_ispunct (int c);
+extern bool c_isspace (int c);
+extern bool c_isupper (int c);
+extern bool c_isxdigit (int c);
+
+extern int c_tolower (int c);
+extern int c_toupper (int c);
+
+
+#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS
+
+/* ASCII optimizations. */
+
+#undef c_isascii
+#define c_isascii(c) \
+  ({ int __c = (c); \
+     (__c >= 0x00 && __c <= 0x7f); \
+   })
+
+#if C_CTYPE_CONSECUTIVE_DIGITS \
+    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+#undef c_isalnum
+#define c_isalnum(c) \
+  ({ int __c = (c); \
+     ((__c >= '0' && __c <= '9') \
+      || ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z')); \
+   })
+#else
+#undef c_isalnum
+#define c_isalnum(c) \
+  ({ int __c = (c); \
+     ((__c >= '0' && __c <= '9') \
+      || (__c >= 'A' && __c <= 'Z') \
+      || (__c >= 'a' && __c <= 'z')); \
+   })
+#endif
+#endif
+
+#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+#undef c_isalpha
+#define c_isalpha(c) \
+  ({ int __c = (c); \
+     ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z'); \
+   })
+#else
+#undef c_isalpha
+#define c_isalpha(c) \
+  ({ int __c = (c); \
+     ((__c >= 'A' && __c <= 'Z') || (__c >= 'a' && __c <= 'z')); \
+   })
+#endif
+#endif
+
+#undef c_isblank
+#define c_isblank(c) \
+  ({ int __c = (c); \
+     (__c == ' ' || __c == '\t'); \
+   })
+
+#if C_CTYPE_ASCII
+#undef c_iscntrl
+#define c_iscntrl(c) \
+  ({ int __c = (c); \
+     ((__c & ~0x1f) == 0 || __c == 0x7f); \
+   })
+#endif
+
+#if C_CTYPE_CONSECUTIVE_DIGITS
+#undef c_isdigit
+#define c_isdigit(c) \
+  ({ int __c = (c); \
+     (__c >= '0' && __c <= '9'); \
+   })
+#endif
+
+#if C_CTYPE_CONSECUTIVE_LOWERCASE
+#undef c_islower
+#define c_islower(c) \
+  ({ int __c = (c); \
+     (__c >= 'a' && __c <= 'z'); \
+   })
+#endif
+
+#if C_CTYPE_ASCII
+#undef c_isgraph
+#define c_isgraph(c) \
+  ({ int __c = (c); \
+     (__c >= '!' && __c <= '~'); \
+   })
+#endif
+
+#if C_CTYPE_ASCII
+#undef c_isprint
+#define c_isprint(c) \
+  ({ int __c = (c); \
+     (__c >= ' ' && __c <= '~'); \
+   })
+#endif
+
+#if C_CTYPE_ASCII
+#undef c_ispunct
+#define c_ispunct(c) \
+  ({ int _c = (c); \
+     (c_isgraph (_c) && ! c_isalnum (_c)); \
+   })
+#endif
+
+#undef c_isspace
+#define c_isspace(c) \
+  ({ int __c = (c); \
+     (__c == ' ' || __c == '\t' \
+      || __c == '\n' || __c == '\v' || __c == '\f' || __c == '\r'); \
+   })
+
+#if C_CTYPE_CONSECUTIVE_UPPERCASE
+#undef c_isupper
+#define c_isupper(c) \
+  ({ int __c = (c); \
+     (__c >= 'A' && __c <= 'Z'); \
+   })
+#endif
+
+#if C_CTYPE_CONSECUTIVE_DIGITS \
+    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+#undef c_isxdigit
+#define c_isxdigit(c) \
+  ({ int __c = (c); \
+     ((__c >= '0' && __c <= '9') \
+      || ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'F')); \
+   })
+#else
+#undef c_isxdigit
+#define c_isxdigit(c) \
+  ({ int __c = (c); \
+     ((__c >= '0' && __c <= '9') \
+      || (__c >= 'A' && __c <= 'F') \
+      || (__c >= 'a' && __c <= 'f')); \
+   })
+#endif
+#endif
+
+#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#undef c_tolower
+#define c_tolower(c) \
+  ({ int __c = (c); \
+     (__c >= 'A' && __c <= 'Z' ? __c - 'A' + 'a' : __c); \
+   })
+#undef c_toupper
+#define c_toupper(c) \
+  ({ int __c = (c); \
+     (__c >= 'a' && __c <= 'z' ? __c - 'a' + 'A' : __c); \
+   })
+#endif
+
+#endif /* optimizing for speed */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* C_CTYPE_H */
old mode 100755 (executable)
new mode 100644 (file)
index 03ed8c3..aa7d00d
@@ -1,11 +1,11 @@
 #! /bin/sh
 # Output a system dependent table of character encoding aliases.
 #
-#   Copyright (C) 2000-2004, 2006-2009 Free Software Foundation, Inc.
+#   Copyright (C) 2000-2004, 2006-2010 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)
+#   the Free Software Foundation; either version 3, or (at your option)
 #   any later version.
 #
 #   This program is distributed in the hope that it will be useful,
 # The current list of GNU canonical charset names is as follows.
 #
 #       name              MIME?             used by which systems
-#   ASCII, ANSI_X3.4-1968       glibc solaris freebsd netbsd darwin
-#   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-3              Y   glibc solaris
+#   ASCII, ANSI_X3.4-1968       glibc solaris freebsd netbsd darwin cygwin
+#   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+#   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+#   ISO-8859-3              Y   glibc solaris cygwin
 #   ISO-8859-4              Y   osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-6              Y   glibc aix hpux solaris
-#   ISO-8859-7              Y   glibc aix hpux irix osf solaris netbsd openbsd darwin
-#   ISO-8859-8              Y   glibc aix hpux osf solaris
-#   ISO-8859-9              Y   glibc aix hpux irix osf solaris darwin
-#   ISO-8859-13                 glibc netbsd openbsd darwin
-#   ISO-8859-14                 glibc
-#   ISO-8859-15                 glibc aix osf solaris freebsd netbsd openbsd darwin
+#   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+#   ISO-8859-6              Y   glibc aix hpux solaris cygwin
+#   ISO-8859-7              Y   glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin
+#   ISO-8859-8              Y   glibc aix hpux osf solaris cygwin
+#   ISO-8859-9              Y   glibc aix hpux irix osf solaris darwin cygwin
+#   ISO-8859-13                 glibc netbsd openbsd darwin cygwin
+#   ISO-8859-14                 glibc cygwin
+#   ISO-8859-15                 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin
 #   KOI8-R                  Y   glibc solaris freebsd netbsd openbsd darwin
-#   KOI8-U                  Y   glibc freebsd netbsd openbsd darwin
+#   KOI8-U                  Y   glibc freebsd netbsd openbsd darwin cygwin
 #   KOI8-T                      glibc
 #   CP437                       dos
 #   CP775                       dos
@@ -61,7 +61,7 @@
 #   CP869                       dos
 #   CP874                       woe32 dos
 #   CP922                       aix
-#   CP932                       aix woe32 dos
+#   CP932                       aix cygwin woe32 dos
 #   CP943                       aix
 #   CP949                       osf darwin woe32 dos
 #   CP950                       woe32 dos
@@ -71,7 +71,7 @@
 #   CP1129                      aix
 #   CP1131                      darwin
 #   CP1250                      woe32
-#   CP1251                      glibc solaris netbsd openbsd darwin woe32
+#   CP1251                      glibc solaris netbsd openbsd darwin cygwin woe32
 #   CP1252                      aix woe32
 #   CP1253                      woe32
 #   CP1254                      woe32
 #   CP1257                      woe32
 #   GB2312                  Y   glibc aix hpux irix solaris freebsd netbsd darwin
 #   EUC-JP                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
-#   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
+#   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
 #   EUC-TW                      glibc aix hpux irix osf solaris netbsd
-#   BIG5                    Y   glibc aix hpux osf solaris freebsd netbsd darwin
+#   BIG5                    Y   glibc aix hpux osf solaris freebsd netbsd darwin cygwin
 #   BIG5-HKSCS                  glibc solaris darwin
-#   GBK                         glibc aix osf solaris darwin woe32 dos
+#   GBK                         glibc aix osf solaris darwin cygwin woe32 dos
 #   GB18030                     glibc solaris netbsd darwin
 #   SHIFT_JIS               Y   hpux osf solaris freebsd netbsd darwin
 #   JOHAB                       glibc solaris woe32
-#   TIS-620                     glibc aix hpux osf solaris
+#   TIS-620                     glibc aix hpux osf solaris cygwin
 #   VISCII                  Y   glibc
 #   TCVN5712-1                  glibc
 #   ARMSCII-8                   glibc darwin
-#   GEORGIAN-PS                 glibc
+#   GEORGIAN-PS                 glibc cygwin
 #   PT154                       glibc
 #   HP-ROMAN8                   hpux
 #   HP-ARABIC8                  hpux
 #   HP-KANA8                    hpux
 #   DEC-KANJI                   osf
 #   DEC-HANYU                   osf
-#   UTF-8                   Y   glibc aix hpux osf solaris netbsd darwin
+#   UTF-8                   Y   glibc aix hpux osf solaris netbsd darwin cygwin
 #
 # Note: Names which are not marked as being a MIME name should not be used in
 # Internet protocols for information interchange (mail, news, etc.).
@@ -123,561 +123,561 @@ echo "# It was automatically generated from config.charset."
 # List of references, updated during installation:
 echo "# Packages using this file: "
 case "$os" in
-    linux-gnulibc1*)
-       # Linux libc5 doesn't have nl_langinfo(CODESET); therefore
-       # localcharset.c falls back to using the full locale name
-       # from the environment variables.
-       echo "C ASCII"
-       echo "POSIX ASCII"
-       for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
-                en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
-                en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
-                es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
-                et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
-                fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
-                it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
-                sv_FI sv_SE; do
-         echo "$l ISO-8859-1"
-         echo "$l.iso-8859-1 ISO-8859-1"
-         echo "$l.iso-8859-15 ISO-8859-15"
-         echo "$l.iso-8859-15@euro ISO-8859-15"
-         echo "$l@euro ISO-8859-15"
-         echo "$l.cp-437 CP437"
-         echo "$l.cp-850 CP850"
-         echo "$l.cp-1252 CP1252"
-         echo "$l.cp-1252@euro CP1252"
-         #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
-         echo "$l.utf-8 UTF-8"
-         echo "$l.utf-8@euro UTF-8"
-       done
-       for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
-                sl_SI sr sr_CS sr_YU; do
-         echo "$l ISO-8859-2"
-         echo "$l.iso-8859-2 ISO-8859-2"
-         echo "$l.cp-852 CP852"
-         echo "$l.cp-1250 CP1250"
-         echo "$l.utf-8 UTF-8"
-       done
-       for l in mk mk_MK ru ru_RU; do
-         echo "$l ISO-8859-5"
-         echo "$l.iso-8859-5 ISO-8859-5"
-         echo "$l.koi8-r KOI8-R"
-         echo "$l.cp-866 CP866"
-         echo "$l.cp-1251 CP1251"
-         echo "$l.utf-8 UTF-8"
-       done
-       for l in ar ar_SA; do
-         echo "$l ISO-8859-6"
-         echo "$l.iso-8859-6 ISO-8859-6"
-         echo "$l.cp-864 CP864"
-         #echo "$l.cp-868 CP868" # not a commonly used encoding
-         echo "$l.cp-1256 CP1256"
-         echo "$l.utf-8 UTF-8"
-       done
-       for l in el el_GR gr gr_GR; do
-         echo "$l ISO-8859-7"
-         echo "$l.iso-8859-7 ISO-8859-7"
-         echo "$l.cp-869 CP869"
-         echo "$l.cp-1253 CP1253"
-         echo "$l.cp-1253@euro CP1253"
-         echo "$l.utf-8 UTF-8"
-         echo "$l.utf-8@euro UTF-8"
-       done
-       for l in he he_IL iw iw_IL; do
-         echo "$l ISO-8859-8"
-         echo "$l.iso-8859-8 ISO-8859-8"
-         echo "$l.cp-862 CP862"
-         echo "$l.cp-1255 CP1255"
-         echo "$l.utf-8 UTF-8"
-       done
-       for l in tr tr_TR; do
-         echo "$l ISO-8859-9"
-         echo "$l.iso-8859-9 ISO-8859-9"
-         echo "$l.cp-857 CP857"
-         echo "$l.cp-1254 CP1254"
-         echo "$l.utf-8 UTF-8"
-       done
-       for l in lt lt_LT lv lv_LV; do
-         #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
-         echo "$l ISO-8859-13"
-       done
-       for l in ru_UA uk uk_UA; do
-         echo "$l KOI8-U"
-       done
-       for l in zh zh_CN; do
-         #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
-         echo "$l GB2312"
-       done
-       for l in ja ja_JP ja_JP.EUC; do
-         echo "$l EUC-JP"
-       done
-       for l in ko ko_KR; do
-         echo "$l EUC-KR"
-       done
-       for l in th th_TH; do
-         echo "$l TIS-620"
-       done
-       for l in fa fa_IR; do
-         #echo "$l ISIRI-3342" # a broken encoding
-         echo "$l.utf-8 UTF-8"
-       done
-       ;;
-    linux* | *-gnu*)
-       # With glibc-2.1 or newer, we don't need any canonicalization,
-       # because glibc has iconv and both glibc and libiconv support all
-       # GNU canonical names directly. Therefore, the Makefile does not
-       # need to install the alias file at all.
-       # The following applies only to glibc-2.0.x and older libcs.
-       echo "ISO_646.IRV:1983 ASCII"
-       ;;
-    aix*)
-       echo "ISO8859-1 ISO-8859-1"
-       echo "ISO8859-2 ISO-8859-2"
-       echo "ISO8859-5 ISO-8859-5"
-       echo "ISO8859-6 ISO-8859-6"
-       echo "ISO8859-7 ISO-8859-7"
-       echo "ISO8859-8 ISO-8859-8"
-       echo "ISO8859-9 ISO-8859-9"
-       echo "ISO8859-15 ISO-8859-15"
-       echo "IBM-850 CP850"
-       echo "IBM-856 CP856"
-       echo "IBM-921 ISO-8859-13"
-       echo "IBM-922 CP922"
-       echo "IBM-932 CP932"
-       echo "IBM-943 CP943"
-       echo "IBM-1046 CP1046"
-       echo "IBM-1124 CP1124"
-       echo "IBM-1129 CP1129"
-       echo "IBM-1252 CP1252"
-       echo "IBM-eucCN GB2312"
-       echo "IBM-eucJP EUC-JP"
-       echo "IBM-eucKR EUC-KR"
-       echo "IBM-eucTW EUC-TW"
-       echo "big5 BIG5"
-       echo "GBK GBK"
-       echo "TIS-620 TIS-620"
-       echo "UTF-8 UTF-8"
-       ;;
-    hpux*)
-       echo "iso88591 ISO-8859-1"
-       echo "iso88592 ISO-8859-2"
-       echo "iso88595 ISO-8859-5"
-       echo "iso88596 ISO-8859-6"
-       echo "iso88597 ISO-8859-7"
-       echo "iso88598 ISO-8859-8"
-       echo "iso88599 ISO-8859-9"
-       echo "iso885915 ISO-8859-15"
-       echo "roman8 HP-ROMAN8"
-       echo "arabic8 HP-ARABIC8"
-       echo "greek8 HP-GREEK8"
-       echo "hebrew8 HP-HEBREW8"
-       echo "turkish8 HP-TURKISH8"
-       echo "kana8 HP-KANA8"
-       echo "tis620 TIS-620"
-       echo "big5 BIG5"
-       echo "eucJP EUC-JP"
-       echo "eucKR EUC-KR"
-       echo "eucTW EUC-TW"
-       echo "hp15CN GB2312"
-       #echo "ccdc ?" # what is this?
-       echo "SJIS SHIFT_JIS"
-       echo "utf8 UTF-8"
-       ;;
-    irix*)
-       echo "ISO8859-1 ISO-8859-1"
-       echo "ISO8859-2 ISO-8859-2"
-       echo "ISO8859-5 ISO-8859-5"
-       echo "ISO8859-7 ISO-8859-7"
-       echo "ISO8859-9 ISO-8859-9"
-       echo "eucCN GB2312"
-       echo "eucJP EUC-JP"
-       echo "eucKR EUC-KR"
-       echo "eucTW EUC-TW"
-       ;;
-    osf*)
-       echo "ISO8859-1 ISO-8859-1"
-       echo "ISO8859-2 ISO-8859-2"
-       echo "ISO8859-4 ISO-8859-4"
-       echo "ISO8859-5 ISO-8859-5"
-       echo "ISO8859-7 ISO-8859-7"
-       echo "ISO8859-8 ISO-8859-8"
-       echo "ISO8859-9 ISO-8859-9"
-       echo "ISO8859-15 ISO-8859-15"
-       echo "cp850 CP850"
-       echo "big5 BIG5"
-       echo "dechanyu DEC-HANYU"
-       echo "dechanzi GB2312"
-       echo "deckanji DEC-KANJI"
-       echo "deckorean EUC-KR"
-       echo "eucJP EUC-JP"
-       echo "eucKR EUC-KR"
-       echo "eucTW EUC-TW"
-       echo "GBK GBK"
-       echo "KSC5601 CP949"
-       echo "sdeckanji EUC-JP"
-       echo "SJIS SHIFT_JIS"
-       echo "TACTIS TIS-620"
-       echo "UTF-8 UTF-8"
-       ;;
-    solaris*)
-       echo "646 ASCII"
-       echo "ISO8859-1 ISO-8859-1"
-       echo "ISO8859-2 ISO-8859-2"
-       echo "ISO8859-3 ISO-8859-3"
-       echo "ISO8859-4 ISO-8859-4"
-       echo "ISO8859-5 ISO-8859-5"
-       echo "ISO8859-6 ISO-8859-6"
-       echo "ISO8859-7 ISO-8859-7"
-       echo "ISO8859-8 ISO-8859-8"
-       echo "ISO8859-9 ISO-8859-9"
-       echo "ISO8859-15 ISO-8859-15"
-       echo "koi8-r KOI8-R"
-       echo "ansi-1251 CP1251"
-       echo "BIG5 BIG5"
-       echo "Big5-HKSCS BIG5-HKSCS"
-       echo "gb2312 GB2312"
-       echo "GBK GBK"
-       echo "GB18030 GB18030"
-       echo "cns11643 EUC-TW"
-       echo "5601 EUC-KR"
-       echo "ko_KR.johap92 JOHAB"
-       echo "eucJP EUC-JP"
-       echo "PCK SHIFT_JIS"
-       echo "TIS620.2533 TIS-620"
-       #echo "sun_eu_greek ?" # what is this?
-       echo "UTF-8 UTF-8"
-       ;;
-    freebsd* | os2*)
-       # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
-       # localcharset.c falls back to using the full locale name
-       # from the environment variables.
-       # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
-       # reuse FreeBSD's locale data for OS/2.
-       echo "C ASCII"
-       echo "US-ASCII ASCII"
-       for l in la_LN lt_LN; do
-         echo "$l.ASCII ASCII"
-       done
-       for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
-                fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
-                lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
-         echo "$l.ISO_8859-1 ISO-8859-1"
-         echo "$l.DIS_8859-15 ISO-8859-15"
-       done
-       for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
-         echo "$l.ISO_8859-2 ISO-8859-2"
-       done
-       for l in la_LN lt_LT; do
-         echo "$l.ISO_8859-4 ISO-8859-4"
-       done
-       for l in ru_RU ru_SU; do
-         echo "$l.KOI8-R KOI8-R"
-         echo "$l.ISO_8859-5 ISO-8859-5"
-         echo "$l.CP866 CP866"
-       done
-       echo "uk_UA.KOI8-U KOI8-U"
-       echo "zh_TW.BIG5 BIG5"
-       echo "zh_TW.Big5 BIG5"
-       echo "zh_CN.EUC GB2312"
-       echo "ja_JP.EUC EUC-JP"
-       echo "ja_JP.SJIS SHIFT_JIS"
-       echo "ja_JP.Shift_JIS SHIFT_JIS"
-       echo "ko_KR.EUC EUC-KR"
-       ;;
-    netbsd*)
-       echo "646 ASCII"
-       echo "ISO8859-1 ISO-8859-1"
-       echo "ISO8859-2 ISO-8859-2"
-       echo "ISO8859-4 ISO-8859-4"
-       echo "ISO8859-5 ISO-8859-5"
-       echo "ISO8859-7 ISO-8859-7"
-       echo "ISO8859-13 ISO-8859-13"
-       echo "ISO8859-15 ISO-8859-15"
-       echo "eucCN GB2312"
-       echo "eucJP EUC-JP"
-       echo "eucKR EUC-KR"
-       echo "eucTW EUC-TW"
-       echo "BIG5 BIG5"
-       echo "SJIS SHIFT_JIS"
-       ;;
-    openbsd*)
-       echo "646 ASCII"
-       echo "ISO8859-1 ISO-8859-1"
-       echo "ISO8859-2 ISO-8859-2"
-       echo "ISO8859-4 ISO-8859-4"
-       echo "ISO8859-5 ISO-8859-5"
-       echo "ISO8859-7 ISO-8859-7"
-       echo "ISO8859-13 ISO-8859-13"
-       echo "ISO8859-15 ISO-8859-15"
-       ;;
-    darwin[56]*)
-       # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
-       # localcharset.c falls back to using the full locale name
-       # from the environment variables.
-       echo "C ASCII"
-       for l in en_AU en_CA en_GB en_US la_LN; do
-         echo "$l.US-ASCII ASCII"
-       done
-       for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
-                fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
-                nl_NL no_NO pt_PT sv_SE; do
-         echo "$l ISO-8859-1"
-         echo "$l.ISO8859-1 ISO-8859-1"
-         echo "$l.ISO8859-15 ISO-8859-15"
-       done
-       for l in la_LN; do
-         echo "$l.ISO8859-1 ISO-8859-1"
-         echo "$l.ISO8859-15 ISO-8859-15"
-       done
-       for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
-         echo "$l.ISO8859-2 ISO-8859-2"
-       done
-       for l in la_LN lt_LT; do
-         echo "$l.ISO8859-4 ISO-8859-4"
-       done
-       for l in ru_RU; do
-         echo "$l.KOI8-R KOI8-R"
-         echo "$l.ISO8859-5 ISO-8859-5"
-         echo "$l.CP866 CP866"
-       done
-       for l in bg_BG; do
-         echo "$l.CP1251 CP1251"
-       done
-       echo "uk_UA.KOI8-U KOI8-U"
-       echo "zh_TW.BIG5 BIG5"
-       echo "zh_TW.Big5 BIG5"
-       echo "zh_CN.EUC GB2312"
-       echo "ja_JP.EUC EUC-JP"
-       echo "ja_JP.SJIS SHIFT_JIS"
-       echo "ko_KR.EUC EUC-KR"
-       ;;
-    darwin*)
-       # Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
-       # useless:
-       # - It returns the empty string when LANG is set to a locale of the
-       #   form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
-       #   LC_CTYPE file.
-       # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
-       #   the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
-       # - The documentation says:
-       #     "... all code that calls BSD system routines should ensure
-       #      that the const *char parameters of these routines are in UTF-8
-       #      encoding. All BSD system functions expect their string
-       #      parameters to be in UTF-8 encoding and nothing else."
-       #   It also says
-       #     "An additional caveat is that string parameters for files,
-       #      paths, and other file-system entities must be in canonical
-       #      UTF-8. In a canonical UTF-8 Unicode string, all decomposable
-       #      characters are decomposed ..."
-       #   but this is not true: You can pass non-decomposed UTF-8 strings
-       #   to file system functions, and it is the OS which will convert
-       #   them to decomposed UTF-8 before accessing the file system.
-       # - The Apple Terminal application displays UTF-8 by default.
-       # - However, other applications are free to use different encodings:
-       #   - xterm uses ISO-8859-1 by default.
-       #   - TextEdit uses MacRoman by default.
-       # We prefer UTF-8 over decomposed UTF-8-MAC because one should
-       # minimize the use of decomposed Unicode. Unfortunately, through the
-       # Darwin file system, decomposed UTF-8 strings are leaked into user
-       # space nevertheless.
-       # Then there are also the locales with encodings other than US-ASCII
-       # and UTF-8. These locales can be occasionally useful to users (e.g.
-       # when grepping through ISO-8859-1 encoded text files), when all their
-       # file names are in US-ASCII.
-       echo "ISO8859-1 ISO-8859-1"
-       echo "ISO8859-2 ISO-8859-2"
-       echo "ISO8859-4 ISO-8859-4"
-       echo "ISO8859-5 ISO-8859-5"
-       echo "ISO8859-7 ISO-8859-7"
-       echo "ISO8859-9 ISO-8859-9"
-       echo "ISO8859-13 ISO-8859-13"
-       echo "ISO8859-15 ISO-8859-15"
-       echo "KOI8-R KOI8-R"
-       echo "KOI8-U KOI8-U"
-       echo "CP866 CP866"
-       echo "CP949 CP949"
-       echo "CP1131 CP1131"
-       echo "CP1251 CP1251"
-       echo "eucCN GB2312"
-       echo "GB2312 GB2312"
-       echo "eucJP EUC-JP"
-       echo "eucKR EUC-KR"
-       echo "Big5 BIG5"
-       echo "Big5HKSCS BIG5-HKSCS"
-       echo "GBK GBK"
-       echo "GB18030 GB18030"
-       echo "SJIS SHIFT_JIS"
-       echo "ARMSCII-8 ARMSCII-8"
-       echo "PT154 PT154"
-       #echo "ISCII-DEV ?"
-       echo "* UTF-8"
-       ;;
-    beos* | haiku*)
-       # BeOS and Haiku have a single locale, and it has UTF-8 encoding.
-       echo "* UTF-8"
-       ;;
-    msdosdjgpp*)
-       # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
-       # localcharset.c falls back to using the full locale name
-       # from the environment variables.
-       echo "#"
-       echo "# The encodings given here may not all be correct."
-       echo "# If you find that the encoding given for your language and"
-       echo "# country is not the one your DOS machine actually uses, just"
-       echo "# correct it in this file, and send a mail to"
-       echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
-       echo "# and Bruno Haible <bruno@clisp.org>."
-       echo "#"
-       echo "C ASCII"
-       # ISO-8859-1 languages
-       echo "ca CP850"
-       echo "ca_ES CP850"
-       echo "da CP865"    # not CP850 ??
-       echo "da_DK CP865" # not CP850 ??
-       echo "de CP850"
-       echo "de_AT CP850"
-       echo "de_CH CP850"
-       echo "de_DE CP850"
-       echo "en CP850"
-       echo "en_AU CP850" # not CP437 ??
-       echo "en_CA CP850"
-       echo "en_GB CP850"
-       echo "en_NZ CP437"
-       echo "en_US CP437"
-       echo "en_ZA CP850" # not CP437 ??
-       echo "es CP850"
-       echo "es_AR CP850"
-       echo "es_BO CP850"
-       echo "es_CL CP850"
-       echo "es_CO CP850"
-       echo "es_CR CP850"
-       echo "es_CU CP850"
-       echo "es_DO CP850"
-       echo "es_EC CP850"
-       echo "es_ES CP850"
-       echo "es_GT CP850"
-       echo "es_HN CP850"
-       echo "es_MX CP850"
-       echo "es_NI CP850"
-       echo "es_PA CP850"
-       echo "es_PY CP850"
-       echo "es_PE CP850"
-       echo "es_SV CP850"
-       echo "es_UY CP850"
-       echo "es_VE CP850"
-       echo "et CP850"
-       echo "et_EE CP850"
-       echo "eu CP850"
-       echo "eu_ES CP850"
-       echo "fi CP850"
-       echo "fi_FI CP850"
-       echo "fr CP850"
-       echo "fr_BE CP850"
-       echo "fr_CA CP850"
-       echo "fr_CH CP850"
-       echo "fr_FR CP850"
-       echo "ga CP850"
-       echo "ga_IE CP850"
-       echo "gd CP850"
-       echo "gd_GB CP850"
-       echo "gl CP850"
-       echo "gl_ES CP850"
-       echo "id CP850"    # not CP437 ??
-       echo "id_ID CP850" # not CP437 ??
-       echo "is CP861"    # not CP850 ??
-       echo "is_IS CP861" # not CP850 ??
-       echo "it CP850"
-       echo "it_CH CP850"
-       echo "it_IT CP850"
-       echo "lt CP775"
-       echo "lt_LT CP775"
-       echo "lv CP775"
-       echo "lv_LV CP775"
-       echo "nb CP865"    # not CP850 ??
-       echo "nb_NO CP865" # not CP850 ??
-       echo "nl CP850"
-       echo "nl_BE CP850"
-       echo "nl_NL CP850"
-       echo "nn CP865"    # not CP850 ??
-       echo "nn_NO CP865" # not CP850 ??
-       echo "no CP865"    # not CP850 ??
-       echo "no_NO CP865" # not CP850 ??
-       echo "pt CP850"
-       echo "pt_BR CP850"
-       echo "pt_PT CP850"
-       echo "sv CP850"
-       echo "sv_SE CP850"
-       # ISO-8859-2 languages
-       echo "cs CP852"
-       echo "cs_CZ CP852"
-       echo "hr CP852"
-       echo "hr_HR CP852"
-       echo "hu CP852"
-       echo "hu_HU CP852"
-       echo "pl CP852"
-       echo "pl_PL CP852"
-       echo "ro CP852"
-       echo "ro_RO CP852"
-       echo "sk CP852"
-       echo "sk_SK CP852"
-       echo "sl CP852"
-       echo "sl_SI CP852"
-       echo "sq CP852"
-       echo "sq_AL CP852"
-       echo "sr CP852"    # CP852 or CP866 or CP855 ??
-       echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
-       echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
-       # ISO-8859-3 languages
-       echo "mt CP850"
-       echo "mt_MT CP850"
-       # ISO-8859-5 languages
-       echo "be CP866"
-       echo "be_BE CP866"
-       echo "bg CP866"    # not CP855 ??
-       echo "bg_BG CP866" # not CP855 ??
-       echo "mk CP866"    # not CP855 ??
-       echo "mk_MK CP866" # not CP855 ??
-       echo "ru CP866"
-       echo "ru_RU CP866"
-       echo "uk CP1125"
-       echo "uk_UA CP1125"
-       # ISO-8859-6 languages
-       echo "ar CP864"
-       echo "ar_AE CP864"
-       echo "ar_DZ CP864"
-       echo "ar_EG CP864"
-       echo "ar_IQ CP864"
-       echo "ar_IR CP864"
-       echo "ar_JO CP864"
-       echo "ar_KW CP864"
-       echo "ar_MA CP864"
-       echo "ar_OM CP864"
-       echo "ar_QA CP864"
-       echo "ar_SA CP864"
-       echo "ar_SY CP864"
-       # ISO-8859-7 languages
-       echo "el CP869"
-       echo "el_GR CP869"
-       # ISO-8859-8 languages
-       echo "he CP862"
-       echo "he_IL CP862"
-       # ISO-8859-9 languages
-       echo "tr CP857"
-       echo "tr_TR CP857"
-       # Japanese
-       echo "ja CP932"
-       echo "ja_JP CP932"
-       # Chinese
-       echo "zh_CN GBK"
-       echo "zh_TW CP950" # not CP938 ??
-       # Korean
-       echo "kr CP949"    # not CP934 ??
-       echo "kr_KR CP949" # not CP934 ??
-       # Thai
-       echo "th CP874"
-       echo "th_TH CP874"
-       # Other
-       echo "eo CP850"
-       echo "eo_EO CP850"
-       ;;
+  linux-gnulibc1*)
+    # Linux libc5 doesn't have nl_langinfo(CODESET); therefore
+    # localcharset.c falls back to using the full locale name
+    # from the environment variables.
+    echo "C ASCII"
+    echo "POSIX ASCII"
+    for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
+             en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
+             en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
+             es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
+             et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
+             fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
+             it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
+             sv_FI sv_SE; do
+      echo "$l ISO-8859-1"
+      echo "$l.iso-8859-1 ISO-8859-1"
+      echo "$l.iso-8859-15 ISO-8859-15"
+      echo "$l.iso-8859-15@euro ISO-8859-15"
+      echo "$l@euro ISO-8859-15"
+      echo "$l.cp-437 CP437"
+      echo "$l.cp-850 CP850"
+      echo "$l.cp-1252 CP1252"
+      echo "$l.cp-1252@euro CP1252"
+      #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
+      echo "$l.utf-8 UTF-8"
+      echo "$l.utf-8@euro UTF-8"
+    done
+    for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
+             sl_SI sr sr_CS sr_YU; do
+      echo "$l ISO-8859-2"
+      echo "$l.iso-8859-2 ISO-8859-2"
+      echo "$l.cp-852 CP852"
+      echo "$l.cp-1250 CP1250"
+      echo "$l.utf-8 UTF-8"
+    done
+    for l in mk mk_MK ru ru_RU; do
+      echo "$l ISO-8859-5"
+      echo "$l.iso-8859-5 ISO-8859-5"
+      echo "$l.koi8-r KOI8-R"
+      echo "$l.cp-866 CP866"
+      echo "$l.cp-1251 CP1251"
+      echo "$l.utf-8 UTF-8"
+    done
+    for l in ar ar_SA; do
+      echo "$l ISO-8859-6"
+      echo "$l.iso-8859-6 ISO-8859-6"
+      echo "$l.cp-864 CP864"
+      #echo "$l.cp-868 CP868" # not a commonly used encoding
+      echo "$l.cp-1256 CP1256"
+      echo "$l.utf-8 UTF-8"
+    done
+    for l in el el_GR gr gr_GR; do
+      echo "$l ISO-8859-7"
+      echo "$l.iso-8859-7 ISO-8859-7"
+      echo "$l.cp-869 CP869"
+      echo "$l.cp-1253 CP1253"
+      echo "$l.cp-1253@euro CP1253"
+      echo "$l.utf-8 UTF-8"
+      echo "$l.utf-8@euro UTF-8"
+    done
+    for l in he he_IL iw iw_IL; do
+      echo "$l ISO-8859-8"
+      echo "$l.iso-8859-8 ISO-8859-8"
+      echo "$l.cp-862 CP862"
+      echo "$l.cp-1255 CP1255"
+      echo "$l.utf-8 UTF-8"
+    done
+    for l in tr tr_TR; do
+      echo "$l ISO-8859-9"
+      echo "$l.iso-8859-9 ISO-8859-9"
+      echo "$l.cp-857 CP857"
+      echo "$l.cp-1254 CP1254"
+      echo "$l.utf-8 UTF-8"
+    done
+    for l in lt lt_LT lv lv_LV; do
+      #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
+      echo "$l ISO-8859-13"
+    done
+    for l in ru_UA uk uk_UA; do
+      echo "$l KOI8-U"
+    done
+    for l in zh zh_CN; do
+      #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
+      echo "$l GB2312"
+    done
+    for l in ja ja_JP ja_JP.EUC; do
+      echo "$l EUC-JP"
+    done
+    for l in ko ko_KR; do
+      echo "$l EUC-KR"
+    done
+    for l in th th_TH; do
+      echo "$l TIS-620"
+    done
+    for l in fa fa_IR; do
+      #echo "$l ISIRI-3342" # a broken encoding
+      echo "$l.utf-8 UTF-8"
+    done
+    ;;
+  linux* | *-gnu*)
+    # With glibc-2.1 or newer, we don't need any canonicalization,
+    # because glibc has iconv and both glibc and libiconv support all
+    # GNU canonical names directly. Therefore, the Makefile does not
+    # need to install the alias file at all.
+    # The following applies only to glibc-2.0.x and older libcs.
+    echo "ISO_646.IRV:1983 ASCII"
+    ;;
+  aix*)
+    echo "ISO8859-1 ISO-8859-1"
+    echo "ISO8859-2 ISO-8859-2"
+    echo "ISO8859-5 ISO-8859-5"
+    echo "ISO8859-6 ISO-8859-6"
+    echo "ISO8859-7 ISO-8859-7"
+    echo "ISO8859-8 ISO-8859-8"
+    echo "ISO8859-9 ISO-8859-9"
+    echo "ISO8859-15 ISO-8859-15"
+    echo "IBM-850 CP850"
+    echo "IBM-856 CP856"
+    echo "IBM-921 ISO-8859-13"
+    echo "IBM-922 CP922"
+    echo "IBM-932 CP932"
+    echo "IBM-943 CP943"
+    echo "IBM-1046 CP1046"
+    echo "IBM-1124 CP1124"
+    echo "IBM-1129 CP1129"
+    echo "IBM-1252 CP1252"
+    echo "IBM-eucCN GB2312"
+    echo "IBM-eucJP EUC-JP"
+    echo "IBM-eucKR EUC-KR"
+    echo "IBM-eucTW EUC-TW"
+    echo "big5 BIG5"
+    echo "GBK GBK"
+    echo "TIS-620 TIS-620"
+    echo "UTF-8 UTF-8"
+    ;;
+  hpux*)
+    echo "iso88591 ISO-8859-1"
+    echo "iso88592 ISO-8859-2"
+    echo "iso88595 ISO-8859-5"
+    echo "iso88596 ISO-8859-6"
+    echo "iso88597 ISO-8859-7"
+    echo "iso88598 ISO-8859-8"
+    echo "iso88599 ISO-8859-9"
+    echo "iso885915 ISO-8859-15"
+    echo "roman8 HP-ROMAN8"
+    echo "arabic8 HP-ARABIC8"
+    echo "greek8 HP-GREEK8"
+    echo "hebrew8 HP-HEBREW8"
+    echo "turkish8 HP-TURKISH8"
+    echo "kana8 HP-KANA8"
+    echo "tis620 TIS-620"
+    echo "big5 BIG5"
+    echo "eucJP EUC-JP"
+    echo "eucKR EUC-KR"
+    echo "eucTW EUC-TW"
+    echo "hp15CN GB2312"
+    #echo "ccdc ?" # what is this?
+    echo "SJIS SHIFT_JIS"
+    echo "utf8 UTF-8"
+    ;;
+  irix*)
+    echo "ISO8859-1 ISO-8859-1"
+    echo "ISO8859-2 ISO-8859-2"
+    echo "ISO8859-5 ISO-8859-5"
+    echo "ISO8859-7 ISO-8859-7"
+    echo "ISO8859-9 ISO-8859-9"
+    echo "eucCN GB2312"
+    echo "eucJP EUC-JP"
+    echo "eucKR EUC-KR"
+    echo "eucTW EUC-TW"
+    ;;
+  osf*)
+    echo "ISO8859-1 ISO-8859-1"
+    echo "ISO8859-2 ISO-8859-2"
+    echo "ISO8859-4 ISO-8859-4"
+    echo "ISO8859-5 ISO-8859-5"
+    echo "ISO8859-7 ISO-8859-7"
+    echo "ISO8859-8 ISO-8859-8"
+    echo "ISO8859-9 ISO-8859-9"
+    echo "ISO8859-15 ISO-8859-15"
+    echo "cp850 CP850"
+    echo "big5 BIG5"
+    echo "dechanyu DEC-HANYU"
+    echo "dechanzi GB2312"
+    echo "deckanji DEC-KANJI"
+    echo "deckorean EUC-KR"
+    echo "eucJP EUC-JP"
+    echo "eucKR EUC-KR"
+    echo "eucTW EUC-TW"
+    echo "GBK GBK"
+    echo "KSC5601 CP949"
+    echo "sdeckanji EUC-JP"
+    echo "SJIS SHIFT_JIS"
+    echo "TACTIS TIS-620"
+    echo "UTF-8 UTF-8"
+    ;;
+  solaris*)
+    echo "646 ASCII"
+    echo "ISO8859-1 ISO-8859-1"
+    echo "ISO8859-2 ISO-8859-2"
+    echo "ISO8859-3 ISO-8859-3"
+    echo "ISO8859-4 ISO-8859-4"
+    echo "ISO8859-5 ISO-8859-5"
+    echo "ISO8859-6 ISO-8859-6"
+    echo "ISO8859-7 ISO-8859-7"
+    echo "ISO8859-8 ISO-8859-8"
+    echo "ISO8859-9 ISO-8859-9"
+    echo "ISO8859-15 ISO-8859-15"
+    echo "koi8-r KOI8-R"
+    echo "ansi-1251 CP1251"
+    echo "BIG5 BIG5"
+    echo "Big5-HKSCS BIG5-HKSCS"
+    echo "gb2312 GB2312"
+    echo "GBK GBK"
+    echo "GB18030 GB18030"
+    echo "cns11643 EUC-TW"
+    echo "5601 EUC-KR"
+    echo "ko_KR.johap92 JOHAB"
+    echo "eucJP EUC-JP"
+    echo "PCK SHIFT_JIS"
+    echo "TIS620.2533 TIS-620"
+    #echo "sun_eu_greek ?" # what is this?
+    echo "UTF-8 UTF-8"
+    ;;
+  freebsd* | os2*)
+    # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
+    # localcharset.c falls back to using the full locale name
+    # from the environment variables.
+    # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
+    # reuse FreeBSD's locale data for OS/2.
+    echo "C ASCII"
+    echo "US-ASCII ASCII"
+    for l in la_LN lt_LN; do
+      echo "$l.ASCII ASCII"
+    done
+    for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
+             fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
+             lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
+      echo "$l.ISO_8859-1 ISO-8859-1"
+      echo "$l.DIS_8859-15 ISO-8859-15"
+    done
+    for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
+      echo "$l.ISO_8859-2 ISO-8859-2"
+    done
+    for l in la_LN lt_LT; do
+      echo "$l.ISO_8859-4 ISO-8859-4"
+    done
+    for l in ru_RU ru_SU; do
+      echo "$l.KOI8-R KOI8-R"
+      echo "$l.ISO_8859-5 ISO-8859-5"
+      echo "$l.CP866 CP866"
+    done
+    echo "uk_UA.KOI8-U KOI8-U"
+    echo "zh_TW.BIG5 BIG5"
+    echo "zh_TW.Big5 BIG5"
+    echo "zh_CN.EUC GB2312"
+    echo "ja_JP.EUC EUC-JP"
+    echo "ja_JP.SJIS SHIFT_JIS"
+    echo "ja_JP.Shift_JIS SHIFT_JIS"
+    echo "ko_KR.EUC EUC-KR"
+    ;;
+  netbsd*)
+    echo "646 ASCII"
+    echo "ISO8859-1 ISO-8859-1"
+    echo "ISO8859-2 ISO-8859-2"
+    echo "ISO8859-4 ISO-8859-4"
+    echo "ISO8859-5 ISO-8859-5"
+    echo "ISO8859-7 ISO-8859-7"
+    echo "ISO8859-13 ISO-8859-13"
+    echo "ISO8859-15 ISO-8859-15"
+    echo "eucCN GB2312"
+    echo "eucJP EUC-JP"
+    echo "eucKR EUC-KR"
+    echo "eucTW EUC-TW"
+    echo "BIG5 BIG5"
+    echo "SJIS SHIFT_JIS"
+    ;;
+  openbsd*)
+    echo "646 ASCII"
+    echo "ISO8859-1 ISO-8859-1"
+    echo "ISO8859-2 ISO-8859-2"
+    echo "ISO8859-4 ISO-8859-4"
+    echo "ISO8859-5 ISO-8859-5"
+    echo "ISO8859-7 ISO-8859-7"
+    echo "ISO8859-13 ISO-8859-13"
+    echo "ISO8859-15 ISO-8859-15"
+    ;;
+  darwin[56]*)
+    # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
+    # localcharset.c falls back to using the full locale name
+    # from the environment variables.
+    echo "C ASCII"
+    for l in en_AU en_CA en_GB en_US la_LN; do
+      echo "$l.US-ASCII ASCII"
+    done
+    for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
+             fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
+             nl_NL no_NO pt_PT sv_SE; do
+      echo "$l ISO-8859-1"
+      echo "$l.ISO8859-1 ISO-8859-1"
+      echo "$l.ISO8859-15 ISO-8859-15"
+    done
+    for l in la_LN; do
+      echo "$l.ISO8859-1 ISO-8859-1"
+      echo "$l.ISO8859-15 ISO-8859-15"
+    done
+    for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
+      echo "$l.ISO8859-2 ISO-8859-2"
+    done
+    for l in la_LN lt_LT; do
+      echo "$l.ISO8859-4 ISO-8859-4"
+    done
+    for l in ru_RU; do
+      echo "$l.KOI8-R KOI8-R"
+      echo "$l.ISO8859-5 ISO-8859-5"
+      echo "$l.CP866 CP866"
+    done
+    for l in bg_BG; do
+      echo "$l.CP1251 CP1251"
+    done
+    echo "uk_UA.KOI8-U KOI8-U"
+    echo "zh_TW.BIG5 BIG5"
+    echo "zh_TW.Big5 BIG5"
+    echo "zh_CN.EUC GB2312"
+    echo "ja_JP.EUC EUC-JP"
+    echo "ja_JP.SJIS SHIFT_JIS"
+    echo "ko_KR.EUC EUC-KR"
+    ;;
+  darwin*)
+    # Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
+    # useless:
+    # - It returns the empty string when LANG is set to a locale of the
+    #   form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
+    #   LC_CTYPE file.
+    # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
+    #   the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
+    # - The documentation says:
+    #     "... all code that calls BSD system routines should ensure
+    #      that the const *char parameters of these routines are in UTF-8
+    #      encoding. All BSD system functions expect their string
+    #      parameters to be in UTF-8 encoding and nothing else."
+    #   It also says
+    #     "An additional caveat is that string parameters for files,
+    #      paths, and other file-system entities must be in canonical
+    #      UTF-8. In a canonical UTF-8 Unicode string, all decomposable
+    #      characters are decomposed ..."
+    #   but this is not true: You can pass non-decomposed UTF-8 strings
+    #   to file system functions, and it is the OS which will convert
+    #   them to decomposed UTF-8 before accessing the file system.
+    # - The Apple Terminal application displays UTF-8 by default.
+    # - However, other applications are free to use different encodings:
+    #   - xterm uses ISO-8859-1 by default.
+    #   - TextEdit uses MacRoman by default.
+    # We prefer UTF-8 over decomposed UTF-8-MAC because one should
+    # minimize the use of decomposed Unicode. Unfortunately, through the
+    # Darwin file system, decomposed UTF-8 strings are leaked into user
+    # space nevertheless.
+    # Then there are also the locales with encodings other than US-ASCII
+    # and UTF-8. These locales can be occasionally useful to users (e.g.
+    # when grepping through ISO-8859-1 encoded text files), when all their
+    # file names are in US-ASCII.
+    echo "ISO8859-1 ISO-8859-1"
+    echo "ISO8859-2 ISO-8859-2"
+    echo "ISO8859-4 ISO-8859-4"
+    echo "ISO8859-5 ISO-8859-5"
+    echo "ISO8859-7 ISO-8859-7"
+    echo "ISO8859-9 ISO-8859-9"
+    echo "ISO8859-13 ISO-8859-13"
+    echo "ISO8859-15 ISO-8859-15"
+    echo "KOI8-R KOI8-R"
+    echo "KOI8-U KOI8-U"
+    echo "CP866 CP866"
+    echo "CP949 CP949"
+    echo "CP1131 CP1131"
+    echo "CP1251 CP1251"
+    echo "eucCN GB2312"
+    echo "GB2312 GB2312"
+    echo "eucJP EUC-JP"
+    echo "eucKR EUC-KR"
+    echo "Big5 BIG5"
+    echo "Big5HKSCS BIG5-HKSCS"
+    echo "GBK GBK"
+    echo "GB18030 GB18030"
+    echo "SJIS SHIFT_JIS"
+    echo "ARMSCII-8 ARMSCII-8"
+    echo "PT154 PT154"
+    #echo "ISCII-DEV ?"
+    echo "* UTF-8"
+    ;;
+  beos* | haiku*)
+    # BeOS and Haiku have a single locale, and it has UTF-8 encoding.
+    echo "* UTF-8"
+    ;;
+  msdosdjgpp*)
+    # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
+    # localcharset.c falls back to using the full locale name
+    # from the environment variables.
+    echo "#"
+    echo "# The encodings given here may not all be correct."
+    echo "# If you find that the encoding given for your language and"
+    echo "# country is not the one your DOS machine actually uses, just"
+    echo "# correct it in this file, and send a mail to"
+    echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
+    echo "# and Bruno Haible <bruno@clisp.org>."
+    echo "#"
+    echo "C ASCII"
+    # ISO-8859-1 languages
+    echo "ca CP850"
+    echo "ca_ES CP850"
+    echo "da CP865"    # not CP850 ??
+    echo "da_DK CP865" # not CP850 ??
+    echo "de CP850"
+    echo "de_AT CP850"
+    echo "de_CH CP850"
+    echo "de_DE CP850"
+    echo "en CP850"
+    echo "en_AU CP850" # not CP437 ??
+    echo "en_CA CP850"
+    echo "en_GB CP850"
+    echo "en_NZ CP437"
+    echo "en_US CP437"
+    echo "en_ZA CP850" # not CP437 ??
+    echo "es CP850"
+    echo "es_AR CP850"
+    echo "es_BO CP850"
+    echo "es_CL CP850"
+    echo "es_CO CP850"
+    echo "es_CR CP850"
+    echo "es_CU CP850"
+    echo "es_DO CP850"
+    echo "es_EC CP850"
+    echo "es_ES CP850"
+    echo "es_GT CP850"
+    echo "es_HN CP850"
+    echo "es_MX CP850"
+    echo "es_NI CP850"
+    echo "es_PA CP850"
+    echo "es_PY CP850"
+    echo "es_PE CP850"
+    echo "es_SV CP850"
+    echo "es_UY CP850"
+    echo "es_VE CP850"
+    echo "et CP850"
+    echo "et_EE CP850"
+    echo "eu CP850"
+    echo "eu_ES CP850"
+    echo "fi CP850"
+    echo "fi_FI CP850"
+    echo "fr CP850"
+    echo "fr_BE CP850"
+    echo "fr_CA CP850"
+    echo "fr_CH CP850"
+    echo "fr_FR CP850"
+    echo "ga CP850"
+    echo "ga_IE CP850"
+    echo "gd CP850"
+    echo "gd_GB CP850"
+    echo "gl CP850"
+    echo "gl_ES CP850"
+    echo "id CP850"    # not CP437 ??
+    echo "id_ID CP850" # not CP437 ??
+    echo "is CP861"    # not CP850 ??
+    echo "is_IS CP861" # not CP850 ??
+    echo "it CP850"
+    echo "it_CH CP850"
+    echo "it_IT CP850"
+    echo "lt CP775"
+    echo "lt_LT CP775"
+    echo "lv CP775"
+    echo "lv_LV CP775"
+    echo "nb CP865"    # not CP850 ??
+    echo "nb_NO CP865" # not CP850 ??
+    echo "nl CP850"
+    echo "nl_BE CP850"
+    echo "nl_NL CP850"
+    echo "nn CP865"    # not CP850 ??
+    echo "nn_NO CP865" # not CP850 ??
+    echo "no CP865"    # not CP850 ??
+    echo "no_NO CP865" # not CP850 ??
+    echo "pt CP850"
+    echo "pt_BR CP850"
+    echo "pt_PT CP850"
+    echo "sv CP850"
+    echo "sv_SE CP850"
+    # ISO-8859-2 languages
+    echo "cs CP852"
+    echo "cs_CZ CP852"
+    echo "hr CP852"
+    echo "hr_HR CP852"
+    echo "hu CP852"
+    echo "hu_HU CP852"
+    echo "pl CP852"
+    echo "pl_PL CP852"
+    echo "ro CP852"
+    echo "ro_RO CP852"
+    echo "sk CP852"
+    echo "sk_SK CP852"
+    echo "sl CP852"
+    echo "sl_SI CP852"
+    echo "sq CP852"
+    echo "sq_AL CP852"
+    echo "sr CP852"    # CP852 or CP866 or CP855 ??
+    echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
+    echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
+    # ISO-8859-3 languages
+    echo "mt CP850"
+    echo "mt_MT CP850"
+    # ISO-8859-5 languages
+    echo "be CP866"
+    echo "be_BE CP866"
+    echo "bg CP866"    # not CP855 ??
+    echo "bg_BG CP866" # not CP855 ??
+    echo "mk CP866"    # not CP855 ??
+    echo "mk_MK CP866" # not CP855 ??
+    echo "ru CP866"
+    echo "ru_RU CP866"
+    echo "uk CP1125"
+    echo "uk_UA CP1125"
+    # ISO-8859-6 languages
+    echo "ar CP864"
+    echo "ar_AE CP864"
+    echo "ar_DZ CP864"
+    echo "ar_EG CP864"
+    echo "ar_IQ CP864"
+    echo "ar_IR CP864"
+    echo "ar_JO CP864"
+    echo "ar_KW CP864"
+    echo "ar_MA CP864"
+    echo "ar_OM CP864"
+    echo "ar_QA CP864"
+    echo "ar_SA CP864"
+    echo "ar_SY CP864"
+    # ISO-8859-7 languages
+    echo "el CP869"
+    echo "el_GR CP869"
+    # ISO-8859-8 languages
+    echo "he CP862"
+    echo "he_IL CP862"
+    # ISO-8859-9 languages
+    echo "tr CP857"
+    echo "tr_TR CP857"
+    # Japanese
+    echo "ja CP932"
+    echo "ja_JP CP932"
+    # Chinese
+    echo "zh_CN GBK"
+    echo "zh_TW CP950" # not CP938 ??
+    # Korean
+    echo "kr CP949"    # not CP934 ??
+    echo "kr_KR CP949" # not CP934 ??
+    # Thai
+    echo "th CP874"
+    echo "th_TH CP874"
+    # Other
+    echo "eo CP850"
+    echo "eo_EO CP850"
+    ;;
 esac
index eef3931f9c2766b743326ae43b17c77add0168b2..140e5d134685a9525c0e87f41106b25f166c1ca6 100644 (file)
@@ -1,10 +1,10 @@
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 #  define GNULIB_defined_ENOTSUP 1
 # endif
 
+# ifndef ESTALE
+#  define ESTALE    2009
+#  define GNULIB_defined_ESTALE 1
+# endif
+
 # ifndef ECANCELED
 #  define ECANCELED 2008
 #  define GNULIB_defined_ECANCELED 1
index 4de25a941eaced67fc0f5c340c4929fc46592aa8..b55e5e6def6905c72b4bf04f01bc2a15a51a9bd5 100644 (file)
@@ -1,10 +1,10 @@
 /* Supplemental information about the floating-point formats.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
index 9ba2bce4b5bdb912ae3b6087a30cad1504ce3421..caf822f1d0a98a043977c2e1283acb57c2aeffeb 100644 (file)
@@ -1,6 +1,6 @@
 /* A correct <float.h>.
 
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
index 813e6abe7e8e41271400e23f0bbd44d0d58f6433..05a7384c07905fe491c0f567ad5aacc60cf9b4de 100644 (file)
@@ -1,9 +1,9 @@
 /* An fseeko() function that, together with fflush(), is POSIX compliant.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 
 #include "stdio-impl.h"
 
+int
+fseeko (FILE *fp, off_t offset, int whence)
 #undef fseeko
 #if !HAVE_FSEEKO
 # undef fseek
 # define fseeko fseek
 #endif
-
-int
-rpl_fseeko (FILE *fp, off_t offset, int whence)
 {
 #if LSEEK_PIPE_BROKEN
   /* mingw gives bogus answers rather than failure on non-seekable files.  */
@@ -50,10 +49,10 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
   if ((fp->_flags & __SL64) == 0)
     {
       /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
-        mode; but has an fseeko that requires 64-bit mode.  */
+         mode; but has an fseeko that requires 64-bit mode.  */
       FILE *tmp = fopen ("/dev/null", "r");
       if (!tmp)
-       return -1;
+        return -1;
       fp->_flags |= __SL64;
       fp->_seek64 = tmp->_seek64;
       fclose (tmp);
@@ -62,8 +61,8 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
   if (fp_->_p == fp_->_bf._base
       && fp_->_r == 0
       && fp_->_w == ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
-                    ? fp_->_bf._size
-                    : 0)
+                     ? fp_->_bf._size
+                     : 0)
       && fp_ub._base == NULL)
 #elif defined __EMX__               /* emx+gcc */
   if (fp->_ptr == fp->_buffer
@@ -77,9 +76,9 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
   if (((fp->__modeflags & __FLAG_WRITING) == 0
        || fp->__bufpos == fp->__bufstart)
       && ((fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) == 0
-         || fp->__bufpos == fp->__bufread))
+          || fp->__bufpos == fp->__bufread))
 #elif defined __QNX__               /* QNX */
-  if ((fp->_Mode & _MWRITE ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend)
+  if ((fp->_Mode & 0x2000 /* _MWRITE */ ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend)
       && fp->_Rback == fp->_Back + sizeof (fp->_Back)
       && fp->_Rsave == NULL)
 #elif defined __MINT__              /* Atari FreeMiNT */
@@ -92,25 +91,42 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
 #endif
     {
       /* We get here when an fflush() call immediately preceded this one.  We
-        know there are no buffers.
-        POSIX requires us to modify the file descriptor's position.
-        But we cannot position beyond end of file here.  */
+         know there are no buffers.
+         POSIX requires us to modify the file descriptor's position.
+         But we cannot position beyond end of file here.  */
       off_t pos =
-       lseek (fileno (fp),
-              whence == SEEK_END && offset > 0 ? 0 : offset,
-              whence);
+        lseek (fileno (fp),
+               whence == SEEK_END && offset > 0 ? 0 : offset,
+               whence);
       if (pos == -1)
-       {
+        {
 #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
-         fp_->_flags &= ~__SOFF;
+          fp_->_flags &= ~__SOFF;
 #endif
-         return -1;
-       }
+          return -1;
+        }
 
 #if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
       fp->_flags &= ~_IO_EOF_SEEN;
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
+# if defined __CYGWIN__
+      /* fp_->_offset is typed as an integer.  */
       fp_->_offset = pos;
+# else
+      /* fp_->_offset is an fpos_t.  */
+      {
+        /* Use a union, since on NetBSD, the compilation flags
+           determine whether fpos_t is typedef'd to off_t or a struct
+           containing a single off_t member.  */
+        union
+          {
+            fpos_t f;
+            off_t o;
+          } u;
+        u.o = pos;
+        fp_->_offset = u.f;
+      }
+# endif
       fp_->_flags |= __SOFF;
       fp_->_flags &= ~__SEOF;
 #elif defined __EMX__               /* emx+gcc */
@@ -122,9 +138,9 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
       fp->__eof = 0;
 #endif
       /* If we were not requested to position beyond end of file, we're
-        done.  */
+         done.  */
       if (!(whence == SEEK_END && offset > 0))
-       return 0;
+        return 0;
     }
   return fseeko (fp, offset, whence);
 }
index ade4195e33ac26ab2c269a1bb367bce43e3e7a22..17102aad2e4cd318c9eba4328a161341f1de3427 100644 (file)
@@ -1,7 +1,7 @@
 /* fsusage.c -- return space usage of mounted file systems
 
-   Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2010 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
@@ -23,7 +23,7 @@
 #include <limits.h>
 #include <sys/types.h>
 
-#if STAT_STATVFS               /* POSIX 1003.1-2001 (and later) with XSI */
+#if STAT_STATVFS                /* POSIX 1003.1-2001 (and later) with XSI */
 # include <sys/statvfs.h>
 #else
 /* Don't include backward-compatibility files unless they're needed.
 # if HAVE_SYS_VFS_H
 #  include <sys/vfs.h>
 # endif
-# if HAVE_SYS_FS_S5PARAM_H     /* Fujitsu UXP/V */
+# if HAVE_SYS_FS_S5PARAM_H      /* Fujitsu UXP/V */
 #  include <sys/fs/s5param.h>
 # endif
 # if defined HAVE_SYS_FILSYS_H && !defined _CRAY
-#  include <sys/filsys.h>      /* SVR2 */
+#  include <sys/filsys.h>       /* SVR2 */
 # endif
 # if HAVE_SYS_STATFS_H
 #  include <sys/statfs.h>
 # endif
-# if HAVE_DUSTAT_H             /* AIX PS/2 */
+# if HAVE_DUSTAT_H              /* AIX PS/2 */
 #  include <sys/dustat.h>
 # endif
 # include "full-read.h"
 #define PROPAGATE_ALL_ONES(x) \
   ((sizeof (x) < sizeof (uintmax_t) \
     && (~ (x) == (sizeof (x) < sizeof (int) \
-                 ? - (1 << (sizeof (x) * CHAR_BIT)) \
-                 : 0))) \
+                  ? - (1 << (sizeof (x) * CHAR_BIT)) \
+                  : 0))) \
    ? UINTMAX_MAX : (uintmax_t) (x))
 
 /* Extract the top bit of X as an uintmax_t value.  */
 #define EXTRACT_TOP_BIT(x) ((x) \
-                           & ((uintmax_t) 1 << (sizeof (x) * CHAR_BIT - 1)))
+                            & ((uintmax_t) 1 << (sizeof (x) * CHAR_BIT - 1)))
 
 /* If a value is negative, many space usage primitives store it into an
    integer variable by assignment, even if the variable's type is unsigned.
@@ -94,8 +94,7 @@
 int
 get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
 {
-  (void) disk;  /* avoid argument-unused warning */
-#if defined STAT_STATVFS               /* POSIX */
+#if defined STAT_STATVFS                /* POSIX, except glibc/Linux */
 
   struct statvfs fsd;
 
@@ -104,10 +103,10 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
 
   /* f_frsize isn't guaranteed to be supported.  */
   fsp->fsu_blocksize = (fsd.f_frsize
-                       ? PROPAGATE_ALL_ONES (fsd.f_frsize)
-                       : PROPAGATE_ALL_ONES (fsd.f_bsize));
+                        ? PROPAGATE_ALL_ONES (fsd.f_frsize)
+                        : PROPAGATE_ALL_ONES (fsd.f_bsize));
 
-#elif defined STAT_STATFS2_FS_DATA     /* Ultrix */
+#elif defined STAT_STATFS2_FS_DATA      /* Ultrix */
 
   struct fs_data fsd;
 
@@ -122,7 +121,7 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
   fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.fd_req.gtot);
   fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.fd_req.gfree);
 
-#elif defined STAT_READ_FILSYS         /* SVR2 */
+#elif defined STAT_READ_FILSYS          /* SVR2 */
 # ifndef SUPERBOFF
 #  define SUPERBOFF (SUPERB * 512)
 # endif
@@ -153,11 +152,11 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
   fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.s_tfree);
   fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.s_tfree) != 0;
   fsp->fsu_files = (fsd.s_isize == -1
-                   ? UINTMAX_MAX
-                   : (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1));
+                    ? UINTMAX_MAX
+                    : (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1));
   fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.s_tinode);
 
-#elif defined STAT_STATFS3_OSF1
+#elif defined STAT_STATFS3_OSF1         /* OSF/1 */
 
   struct statfs fsd;
 
@@ -166,7 +165,9 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
 
   fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
 
-#elif defined STAT_STATFS2_BSIZE       /* 4.3BSD, SunOS 4, HP-UX, AIX */
+#elif defined STAT_STATFS2_BSIZE        /* glibc/Linux, 4.3BSD, SunOS 4, \
+                                           MacOS X < 10.4, FreeBSD < 5.0, \
+                                           NetBSD < 3.0, OpenBSD < 4.4 */
 
   struct statfs fsd;
 
@@ -190,7 +191,7 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
     }
 # endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
 
-#elif defined STAT_STATFS2_FSIZE       /* 4.4BSD */
+#elif defined STAT_STATFS2_FSIZE        /* 4.4BSD and older NetBSD */
 
   struct statfs fsd;
 
@@ -199,7 +200,8 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
 
   fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
 
-#elif defined STAT_STATFS4             /* SVR3, Dynix, Irix, AIX */
+#elif defined STAT_STATFS4              /* SVR3, Dynix, old Irix, old AIX, \
+                                           Dolphin */
 
 # if !_AIX && !defined _SEQUENT_ && !defined DOLPHIN
 #  define f_bavail f_bfree
@@ -233,6 +235,7 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
 
 #endif
 
+  (void) disk;  /* avoid argument-unused warning */
   return 0;
 }
 
index b32abe1836a11886de26e8aefe237c6b27bae51a..bb2d86f135fa57a87484541b72bf17ac083e606b 100644 (file)
@@ -1,6 +1,6 @@
 /* fsusage.h -- declarations for file system space usage info
 
-   Copyright (C) 1991, 1992, 1997, 2003, 2004, 2005, 2006 Free Software
+   Copyright (C) 1991-1992, 1997, 2003-2006, 2009-2010 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
 
 struct fs_usage
 {
-  uintmax_t fsu_blocksize;     /* Size of a block.  */
-  uintmax_t fsu_blocks;                /* Total blocks. */
-  uintmax_t fsu_bfree;         /* Free blocks available to superuser. */
-  uintmax_t fsu_bavail;                /* Free blocks available to non-superuser. */
-  bool fsu_bavail_top_bit_set; /* 1 if fsu_bavail represents a value < 0.  */
-  uintmax_t fsu_files;         /* Total file nodes. */
-  uintmax_t fsu_ffree;         /* Free file nodes. */
+  uintmax_t fsu_blocksize;      /* Size of a block.  */
+  uintmax_t fsu_blocks;         /* Total blocks. */
+  uintmax_t fsu_bfree;          /* Free blocks available to superuser. */
+  uintmax_t fsu_bavail;         /* Free blocks available to non-superuser. */
+  bool fsu_bavail_top_bit_set;  /* 1 if fsu_bavail represents a value < 0.  */
+  uintmax_t fsu_files;          /* Total file nodes. */
+  uintmax_t fsu_ffree;          /* Free file nodes. */
 };
 
 int get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp);
index f2524084c35fb6f5c50ca146d62006f9814007b0..098e36ae58b0c7306baaf1e853b5a7882136d825 100644 (file)
@@ -1,5 +1,5 @@
 /* An ftello() function that works around platform bugs.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2010 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
 /* Get lseek.  */
 #include <unistd.h>
 
+#include "stdio-impl.h"
+
+off_t
+ftello (FILE *fp)
 #undef ftello
 #if !HAVE_FTELLO
 # undef ftell
 # define ftello ftell
 #endif
-
-off_t
-rpl_ftello (FILE *fp)
 {
 #if LSEEK_PIPE_BROKEN
   /* mingw gives bogus answers rather than failure on non-seekable files.  */
@@ -37,14 +38,36 @@ rpl_ftello (FILE *fp)
     return -1;
 #endif
 
+#if FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE /* Solaris */
+  /* The Solaris stdio leaves the _IOREAD flag set after reading from a file
+     reaches EOF and the program then starts writing to the file.  ftello
+     gets confused by this.  */
+  if (fp_->_flag & _IOWRT)
+    {
+      off_t pos;
+
+      /* Call ftello nevertheless, for the side effects that it does on fp.  */
+      ftello (fp);
+
+      /* Compute the file position ourselves.  */
+      pos = llseek (fileno (fp), (off_t) 0, SEEK_CUR);
+      if (pos >= 0)
+        {
+          if ((fp_->_flag & _IONBF) == 0 && fp_->_base != NULL)
+            pos += fp_->_ptr - fp_->_base;
+        }
+      return pos;
+    }
+#endif
+
 #if defined __SL64 && defined __SCLE /* Cygwin */
   if ((fp->_flags & __SL64) == 0)
     {
       /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
-        mode; but has an ftello that requires 64-bit mode.  */
+         mode; but has an ftello that requires 64-bit mode.  */
       FILE *tmp = fopen ("/dev/null", "r");
       if (!tmp)
-       return -1;
+        return -1;
       fp->_flags |= __SL64;
       fp->_seek64 = tmp->_seek64;
       fclose (tmp);
index ff7d11b090a4f41760885dd15cbbd00e344c80fe..33b69d81076040bb128f0555d9e230f34e66ec6a 100644 (file)
@@ -38,11 +38,11 @@ ftruncate (int fd, off_t length)
     {
       /* Extend file length. */
       if (lseek (fd, (length - 1), SEEK_SET) < 0)
-       return -1;
+        return -1;
 
       /* Write a "0" byte. */
       if (write (fd, "", 1) != 1)
-       return -1;
+        return -1;
     }
   else
     {
@@ -52,14 +52,14 @@ ftruncate (int fd, off_t length)
       fl.l_whence = 0;
       fl.l_len = 0;
       fl.l_start = length;
-      fl.l_type = F_WRLCK;     /* write lock on file space */
+      fl.l_type = F_WRLCK;      /* write lock on file space */
 
       /* This relies on the *undocumented* F_FREESP argument to fcntl,
-        which truncates the file so that it ends at the position
-        indicated by fl.l_start.  Will minor miracles never cease?  */
+         which truncates the file so that it ends at the position
+         indicated by fl.l_start.  Will minor miracles never cease?  */
 
       if (fcntl (fd, F_FREESP, &fl) < 0)
-       return -1;
+        return -1;
     }
 
   return 0;
index fb7212bbec811e51b1cdbbb32c6432091b32fac9..e5de376017ce755e58b8ec644aacc126763f592e 100644 (file)
@@ -1,5 +1,5 @@
 /* An interface to read that retries after partial reads and interrupts.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2009-2010 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
index a341ee0060751052a6284e29836e20ed4ace4769..a41f617c11a16060cbb9da21924f7f3e4ff66fc2 100644 (file)
@@ -1,6 +1,6 @@
 /* An interface to read() that reads all it is asked to read.
 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2010 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
index 51f2d3819bf59909cb757d726160a08c1136c7d1..5d9b7c33ce6200c6d3794c4f921e6f98bb5c477a 100644 (file)
@@ -1,7 +1,6 @@
 /* An interface to read and write that retries (if necessary) until complete.
 
-   Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 1997-2006, 2009-2010 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
@@ -65,12 +64,12 @@ full_rw (int fd, const void *buf, size_t count)
     {
       size_t n_rw = safe_rw (fd, ptr, count);
       if (n_rw == (size_t) -1)
-       break;
+        break;
       if (n_rw == 0)
-       {
-         errno = ZERO_BYTE_TRANSFER_ERRNO;
-         break;
-       }
+        {
+          errno = ZERO_BYTE_TRANSFER_ERRNO;
+          break;
+        }
       total += n_rw;
       ptr += n_rw;
       count -= n_rw;
index 9a8014644547aa39739fb63291148e1bbfa2c016..15d61808ff5e0e43f8882f03d96f990f431a2877 100644 (file)
@@ -1,6 +1,6 @@
 /* An interface to write() that writes all it is asked to write.
 
-   Copyright (C) 2002-2003 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2009-2010 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
index e11c979c4cc63c8cb5af3fbf399d1e9931e3aaf2..c05b5c47ee392272fa7ca64b9b001503ee219cb6 100644 (file)
@@ -1,10 +1,11 @@
-/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2008, 2009, 2010 Free
+   Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
index 6a36bf0fc0a923af6ce68905e4aeaf7017a2cff1..6aa676c89ce4e13030da78867c22ba8d30203392 100644 (file)
@@ -1,11 +1,10 @@
 /* Get address information (partial implementation).
-   Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software
-   Foundation, Inc.
+   Copyright (C) 1997, 2001-2002, 2004-2010 Free Software Foundation, Inc.
    Contributed by Simon Josefsson <simon@josefsson.org>.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 
 #include <config.h>
 
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
+   optimizes away the sa == NULL test below.  */
+#define _GL_ARG_NONNULL(params)
+
 #include <netdb.h>
 
 #if HAVE_NETINET_IN_H
 
 #ifdef WIN32_NATIVE
 typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*,
-                                       const struct addrinfo*,
-                                       struct addrinfo**);
+                                        const struct addrinfo*,
+                                        struct addrinfo**);
 typedef void (WSAAPI *freeaddrinfo_func) (struct addrinfo*);
 typedef int (WSAAPI *getnameinfo_func) (const struct sockaddr*,
-                                       socklen_t, char*, DWORD,
-                                       char*, DWORD, int);
+                                        socklen_t, char*, DWORD,
+                                        char*, DWORD, int);
 
 static getaddrinfo_func getaddrinfo_ptr = NULL;
 static freeaddrinfo_func freeaddrinfo_ptr = NULL;
@@ -123,9 +126,9 @@ validate_family (int family)
    socket addresses. */
 int
 getaddrinfo (const char *restrict nodename,
-            const char *restrict servname,
-            const struct addrinfo *restrict hints,
-            struct addrinfo **restrict res)
+             const char *restrict servname,
+             const struct addrinfo *restrict hints,
+             struct addrinfo **restrict res)
 {
   struct addrinfo *tmp;
   int port = 0;
@@ -165,7 +168,7 @@ getaddrinfo (const char *restrict nodename,
   if (!nodename)
     {
       if (!(hints->ai_flags & AI_PASSIVE))
-       return EAI_NONAME;
+        return EAI_NONAME;
 
 #ifdef HAVE_IPV6
       nodename = (hints->ai_family == AF_INET6) ? "::" : "0.0.0.0";
@@ -178,24 +181,24 @@ getaddrinfo (const char *restrict nodename,
     {
       struct servent *se = NULL;
       const char *proto =
-       (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp";
+        (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp";
 
       if (hints == NULL || !(hints->ai_flags & AI_NUMERICSERV))
-       /* FIXME: Use getservbyname_r if available. */
-       se = getservbyname (servname, proto);
+        /* FIXME: Use getservbyname_r if available. */
+        se = getservbyname (servname, proto);
 
       if (!se)
-       {
-         char *c;
-         if (!(*servname >= '0' && *servname <= '9'))
-           return EAI_NONAME;
-         port = strtoul (servname, &c, 10);
-         if (*c || port > 0xffff)
-           return EAI_NONAME;
-         port = htons (port);
-       }
+        {
+          char *c;
+          if (!(*servname >= '0' && *servname <= '9'))
+            return EAI_NONAME;
+          port = strtoul (servname, &c, 10);
+          if (*c || port > 0xffff)
+            return EAI_NONAME;
+          port = htons (port);
+        }
       else
-       port = se->s_port;
+        port = se->s_port;
     }
 
   /* FIXME: Use gethostbyname_r if available. */
@@ -230,23 +233,23 @@ getaddrinfo (const char *restrict nodename,
 #if HAVE_IPV6
     case PF_INET6:
       {
-       struct v6_pair *p = storage;
-       struct sockaddr_in6 *sinp = &p->sockaddr_in6;
-       tmp = &p->addrinfo;
+        struct v6_pair *p = storage;
+        struct sockaddr_in6 *sinp = &p->sockaddr_in6;
+        tmp = &p->addrinfo;
 
-       if (port)
-         sinp->sin6_port = port;
+        if (port)
+          sinp->sin6_port = port;
 
-       if (he->h_length != sizeof (sinp->sin6_addr))
-         {
-           free (storage);
-           return EAI_SYSTEM; /* FIXME: Better return code?  Set errno? */
-         }
+        if (he->h_length != sizeof (sinp->sin6_addr))
+          {
+            free (storage);
+            return EAI_SYSTEM; /* FIXME: Better return code?  Set errno? */
+          }
 
-       memcpy (&sinp->sin6_addr, he->h_addr_list[0], sizeof sinp->sin6_addr);
+        memcpy (&sinp->sin6_addr, he->h_addr_list[0], sizeof sinp->sin6_addr);
 
-       tmp->ai_addr = (struct sockaddr *) sinp;
-       tmp->ai_addrlen = sizeof *sinp;
+        tmp->ai_addr = (struct sockaddr *) sinp;
+        tmp->ai_addrlen = sizeof *sinp;
       }
       break;
 #endif
@@ -254,23 +257,23 @@ getaddrinfo (const char *restrict nodename,
 #if HAVE_IPV4
     case PF_INET:
       {
-       struct v4_pair *p = storage;
-       struct sockaddr_in *sinp = &p->sockaddr_in;
-       tmp = &p->addrinfo;
+        struct v4_pair *p = storage;
+        struct sockaddr_in *sinp = &p->sockaddr_in;
+        tmp = &p->addrinfo;
 
-       if (port)
-         sinp->sin_port = port;
+        if (port)
+          sinp->sin_port = port;
 
-       if (he->h_length != sizeof (sinp->sin_addr))
-         {
-           free (storage);
-           return EAI_SYSTEM; /* FIXME: Better return code?  Set errno? */
-         }
+        if (he->h_length != sizeof (sinp->sin_addr))
+          {
+            free (storage);
+            return EAI_SYSTEM; /* FIXME: Better return code?  Set errno? */
+          }
 
-       memcpy (&sinp->sin_addr, he->h_addr_list[0], sizeof sinp->sin_addr);
+        memcpy (&sinp->sin_addr, he->h_addr_list[0], sizeof sinp->sin_addr);
 
-       tmp->ai_addr = (struct sockaddr *) sinp;
-       tmp->ai_addrlen = sizeof *sinp;
+        tmp->ai_addr = (struct sockaddr *) sinp;
+        tmp->ai_addrlen = sizeof *sinp;
       }
       break;
 #endif
@@ -284,16 +287,16 @@ getaddrinfo (const char *restrict nodename,
     {
       const char *cn;
       if (he->h_name)
-       cn = he->h_name;
+        cn = he->h_name;
       else
-       cn = nodename;
+        cn = nodename;
 
       tmp->ai_canonname = strdup (cn);
       if (!tmp->ai_canonname)
-       {
-         free (storage);
-         return EAI_MEMORY;
-       }
+        {
+          free (storage);
+          return EAI_MEMORY;
+        }
     }
 
   tmp->ai_protocol = (hints) ? hints->ai_protocol : 0;
@@ -348,15 +351,16 @@ freeaddrinfo (struct addrinfo *ai)
     }
 }
 
-int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
-               char *restrict node, socklen_t nodelen,
-               char *restrict service, socklen_t servicelen,
-               int flags)
+int
+getnameinfo (const struct sockaddr *restrict sa, socklen_t salen,
+             char *restrict node, socklen_t nodelen,
+             char *restrict service, socklen_t servicelen,
+             int flags)
 {
 #ifdef WIN32_NATIVE
   if (use_win32_p ())
     return getnameinfo_ptr (sa, salen, node, nodelen,
-                           service, servicelen, flags);
+                            service, servicelen, flags);
 #endif
 
   /* FIXME: Support other flags. */
@@ -373,13 +377,13 @@ int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
 #if HAVE_IPV4
     case AF_INET:
       if (salen < sizeof (struct sockaddr_in))
-       return EAI_FAMILY;
+        return EAI_FAMILY;
       break;
 #endif
 #if HAVE_IPV6
     case AF_INET6:
       if (salen < sizeof (struct sockaddr_in6))
-       return EAI_FAMILY;
+        return EAI_FAMILY;
       break;
 #endif
     default:
@@ -389,28 +393,28 @@ int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
   if (node && nodelen > 0 && flags & NI_NUMERICHOST)
     {
       switch (sa->sa_family)
-       {
+        {
 #if HAVE_IPV4
-       case AF_INET:
-         if (!inet_ntop (AF_INET,
-                         &(((const struct sockaddr_in *) sa)->sin_addr),
-                         node, nodelen))
-           return EAI_SYSTEM;
-         break;
+        case AF_INET:
+          if (!inet_ntop (AF_INET,
+                          &(((const struct sockaddr_in *) sa)->sin_addr),
+                          node, nodelen))
+            return EAI_SYSTEM;
+          break;
 #endif
 
 #if HAVE_IPV6
-       case AF_INET6:
-         if (!inet_ntop (AF_INET6,
-                         &(((const struct sockaddr_in6 *) sa)->sin6_addr),
-                         node, nodelen))
-           return EAI_SYSTEM;
-         break;
+        case AF_INET6:
+          if (!inet_ntop (AF_INET6,
+                          &(((const struct sockaddr_in6 *) sa)->sin6_addr),
+                          node, nodelen))
+            return EAI_SYSTEM;
+          break;
 #endif
 
-       default:
-         return EAI_FAMILY;
-       }
+        default:
+          return EAI_FAMILY;
+        }
     }
 
   if (service && servicelen > 0 && flags & NI_NUMERICSERV)
@@ -422,13 +426,13 @@ int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
 #if HAVE_IPV6
       case AF_INET6:
 #endif
-       {
-         unsigned short int port
-           = ntohs (((const struct sockaddr_in *) sa)->sin_port);
-         if (servicelen <= snprintf (service, servicelen, "%u", port))
-           return EAI_OVERFLOW;
-       }
-       break;
+        {
+          unsigned short int port
+            = ntohs (((const struct sockaddr_in *) sa)->sin_port);
+          if (servicelen <= snprintf (service, servicelen, "%u", port))
+            return EAI_OVERFLOW;
+        }
+        break;
       }
 
   return 0;
index f1e6d1f7c702a4015baa324e85fe4fa41cb803e6..3791f1293724c6ab74f4c45f57c3a2a4a3a31811 100644 (file)
@@ -1,9 +1,9 @@
 /* Getopt for GNU.
-   NOTE: getopt is now part of the C library, so if you don't know what
+   NOTE: getopt is part of the C library, so if you don't know what
    "Keep this file name-space clean" means, talk to drepper@gnu.org
    before changing it!
-   Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006,2008
-       Free Software Foundation, Inc.
+   Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2010 Free Software
+   Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
 # include <wchar.h>
 #endif
 
-#ifndef attribute_hidden
-# define attribute_hidden
-#endif
-
-/* Unlike standard Unix `getopt', functions like `getopt_long'
-   let the user intersperse the options with the other arguments.
+/* This version of `getopt' appears to the caller like standard Unix `getopt'
+   but it behaves differently for the user, since it allows the user
+   to intersperse the options with the other arguments.
 
    As `getopt_long' works, it permutes the elements of ARGV so that,
    when it is done, all the options precede everything else.  Thus
@@ -54,7 +51,7 @@
 
    Using `getopt' or setting the environment variable POSIXLY_CORRECT
    disables permutation.
-   Then the application's behavior is completely standard.
+   Then the behavior is completely standard.
 
    GNU application programs can use a third alternative mode in which
    they can distinguish the relative order of options and other arguments.  */
@@ -121,18 +118,18 @@ extern char *__getopt_nonoption_flags;
 
 # ifdef USE_NONOPTION_FLAGS
 #  define SWAP_FLAGS(ch1, ch2) \
-  if (d->__nonoption_flags_len > 0)                                          \
-    {                                                                        \
-      char __tmp = __getopt_nonoption_flags[ch1];                            \
-      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];         \
-      __getopt_nonoption_flags[ch2] = __tmp;                                 \
+  if (d->__nonoption_flags_len > 0)                                           \
+    {                                                                         \
+      char __tmp = __getopt_nonoption_flags[ch1];                             \
+      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];          \
+      __getopt_nonoption_flags[ch2] = __tmp;                                  \
     }
 # else
 #  define SWAP_FLAGS(ch1, ch2)
 # endif
-#else  /* !_LIBC */
+#else   /* !_LIBC */
 # define SWAP_FLAGS(ch1, ch2)
-#endif /* _LIBC */
+#endif  /* _LIBC */
 
 /* Exchange two adjacent subsequences of ARGV.
    One subsequence is elements [first_nonopt,last_nonopt)
@@ -163,57 +160,57 @@ exchange (char **argv, struct _getopt_data *d)
   if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len)
     {
       /* We must extend the array.  The user plays games with us and
-        presents new arguments.  */
+         presents new arguments.  */
       char *new_str = malloc (top + 1);
       if (new_str == NULL)
-       d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0;
+        d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0;
       else
-       {
-         memset (__mempcpy (new_str, __getopt_nonoption_flags,
-                            d->__nonoption_flags_max_len),
-                 '\0', top + 1 - d->__nonoption_flags_max_len);
-         d->__nonoption_flags_max_len = top + 1;
-         __getopt_nonoption_flags = new_str;
-       }
+        {
+          memset (__mempcpy (new_str, __getopt_nonoption_flags,
+                             d->__nonoption_flags_max_len),
+                  '\0', top + 1 - d->__nonoption_flags_max_len);
+          d->__nonoption_flags_max_len = top + 1;
+          __getopt_nonoption_flags = new_str;
+        }
     }
 #endif
 
   while (top > middle && middle > bottom)
     {
       if (top - middle > middle - bottom)
-       {
-         /* Bottom segment is the short one.  */
-         int len = middle - bottom;
-         register int i;
-
-         /* Swap it with the top part of the top segment.  */
-         for (i = 0; i < len; i++)
-           {
-             tem = argv[bottom + i];
-             argv[bottom + i] = argv[top - (middle - bottom) + i];
-             argv[top - (middle - bottom) + i] = tem;
-             SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
-           }
-         /* Exclude the moved bottom segment from further swapping.  */
-         top -= len;
-       }
+        {
+          /* Bottom segment is the short one.  */
+          int len = middle - bottom;
+          register int i;
+
+          /* Swap it with the top part of the top segment.  */
+          for (i = 0; i < len; i++)
+            {
+              tem = argv[bottom + i];
+              argv[bottom + i] = argv[top - (middle - bottom) + i];
+              argv[top - (middle - bottom) + i] = tem;
+              SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
+            }
+          /* Exclude the moved bottom segment from further swapping.  */
+          top -= len;
+        }
       else
-       {
-         /* Top segment is the short one.  */
-         int len = top - middle;
-         register int i;
-
-         /* Swap it with the bottom part of the bottom segment.  */
-         for (i = 0; i < len; i++)
-           {
-             tem = argv[bottom + i];
-             argv[bottom + i] = argv[middle + i];
-             argv[middle + i] = tem;
-             SWAP_FLAGS (bottom + i, middle + i);
-           }
-         /* Exclude the moved top segment from further swapping.  */
-         bottom += len;
-       }
+        {
+          /* Top segment is the short one.  */
+          int len = top - middle;
+          register int i;
+
+          /* Swap it with the bottom part of the bottom segment.  */
+          for (i = 0; i < len; i++)
+            {
+              tem = argv[bottom + i];
+              argv[bottom + i] = argv[middle + i];
+              argv[middle + i] = tem;
+              SWAP_FLAGS (bottom + i, middle + i);
+            }
+          /* Exclude the moved top segment from further swapping.  */
+          bottom += len;
+        }
     }
 
   /* Update records for the slots the non-options now occupy.  */
@@ -225,8 +222,9 @@ exchange (char **argv, struct _getopt_data *d)
 /* Initialize the internal data when the first call is made.  */
 
 static const char *
-_getopt_initialize (int argc, char **argv, const char *optstring,
-                   int posixly_correct, struct _getopt_data *d)
+_getopt_initialize (int argc _GL_UNUSED,
+                    char **argv _GL_UNUSED, const char *optstring,
+                    struct _getopt_data *d, int posixly_correct)
 {
   /* Start processing options with ARGV-element 1 (since ARGV-element 0
      is the program name); the sequence of previously skipped
@@ -260,25 +258,25 @@ _getopt_initialize (int argc, char **argv, const char *optstring,
       && argc == __libc_argc && argv == __libc_argv)
     {
       if (d->__nonoption_flags_max_len == 0)
-       {
-         if (__getopt_nonoption_flags == NULL
-             || __getopt_nonoption_flags[0] == '\0')
-           d->__nonoption_flags_max_len = -1;
-         else
-           {
-             const char *orig_str = __getopt_nonoption_flags;
-             int len = d->__nonoption_flags_max_len = strlen (orig_str);
-             if (d->__nonoption_flags_max_len < argc)
-               d->__nonoption_flags_max_len = argc;
-             __getopt_nonoption_flags =
-               (char *) malloc (d->__nonoption_flags_max_len);
-             if (__getopt_nonoption_flags == NULL)
-               d->__nonoption_flags_max_len = -1;
-             else
-               memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
-                       '\0', d->__nonoption_flags_max_len - len);
-           }
-       }
+        {
+          if (__getopt_nonoption_flags == NULL
+              || __getopt_nonoption_flags[0] == '\0')
+            d->__nonoption_flags_max_len = -1;
+          else
+            {
+              const char *orig_str = __getopt_nonoption_flags;
+              int len = d->__nonoption_flags_max_len = strlen (orig_str);
+              if (d->__nonoption_flags_max_len < argc)
+                d->__nonoption_flags_max_len = argc;
+              __getopt_nonoption_flags =
+                (char *) malloc (d->__nonoption_flags_max_len);
+              if (__getopt_nonoption_flags == NULL)
+                d->__nonoption_flags_max_len = -1;
+              else
+                memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
+                        '\0', d->__nonoption_flags_max_len - len);
+            }
+        }
       d->__nonoption_flags_len = d->__nonoption_flags_max_len;
     }
   else
@@ -330,6 +328,10 @@ _getopt_initialize (int argc, char **argv, const char *optstring,
    `flag' field is nonzero, the value of the option's `val' field
    if the `flag' field is zero.
 
+   The elements of ARGV aren't really const, because we permute them.
+   But we pretend they're const in the prototype to be compatible
+   with other systems.
+
    LONGOPTS is a vector of `struct option' terminated by an
    element containing a name which is zero.
 
@@ -338,19 +340,14 @@ _getopt_initialize (int argc, char **argv, const char *optstring,
    recent call.
 
    If LONG_ONLY is nonzero, '-' as well as '--' can introduce
-   long-named options.
-
-   If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT
-   environment variable were set.  */
+   long-named options.  */
 
 int
 _getopt_internal_r (int argc, char **argv, const char *optstring,
-                   const struct option *longopts, int *longind,
-                   int long_only, int posixly_correct, struct _getopt_data *d)
+                    const struct option *longopts, int *longind,
+                    int long_only, struct _getopt_data *d, int posixly_correct)
 {
   int print_errors = d->opterr;
-  if (optstring[0] == ':')
-    print_errors = 0;
 
   if (argc < 1)
     return -1;
@@ -360,11 +357,15 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
   if (d->optind == 0 || !d->__initialized)
     {
       if (d->optind == 0)
-       d->optind = 1;  /* Don't scan ARGV[0], the program name.  */
-      optstring = _getopt_initialize (argc, argv, optstring,
-                                     posixly_correct, d);
+        d->optind = 1;  /* Don't scan ARGV[0], the program name.  */
+      optstring = _getopt_initialize (argc, argv, optstring, d,
+                                      posixly_correct);
       d->__initialized = 1;
     }
+  else if (optstring[0] == '-' || optstring[0] == '+')
+    optstring++;
+  if (optstring[0] == ':')
+    print_errors = 0;
 
   /* Test whether ARGV[optind] points to a non-option argument.
      Either it does not have option syntax, or there is an environment flag
@@ -372,8 +373,8 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
      is only used when the used in the GNU libc.  */
 #if defined _LIBC && defined USE_NONOPTION_FLAGS
 # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \
-                     || (d->optind < d->__nonoption_flags_len                \
-                         && __getopt_nonoption_flags[d->optind] == '1'))
+                      || (d->optind < d->__nonoption_flags_len                \
+                          && __getopt_nonoption_flags[d->optind] == '1'))
 #else
 # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
 #endif
@@ -383,78 +384,78 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
       /* Advance to the next ARGV-element.  */
 
       /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
-        moved back by the user (who may also have changed the arguments).  */
+         moved back by the user (who may also have changed the arguments).  */
       if (d->__last_nonopt > d->optind)
-       d->__last_nonopt = d->optind;
+        d->__last_nonopt = d->optind;
       if (d->__first_nonopt > d->optind)
-       d->__first_nonopt = d->optind;
+        d->__first_nonopt = d->optind;
 
       if (d->__ordering == PERMUTE)
-       {
-         /* If we have just processed some options following some non-options,
-            exchange them so that the options come first.  */
+        {
+          /* If we have just processed some options following some non-options,
+             exchange them so that the options come first.  */
 
-         if (d->__first_nonopt != d->__last_nonopt
-             && d->__last_nonopt != d->optind)
-           exchange ((char **) argv, d);
-         else if (d->__last_nonopt != d->optind)
-           d->__first_nonopt = d->optind;
+          if (d->__first_nonopt != d->__last_nonopt
+              && d->__last_nonopt != d->optind)
+            exchange ((char **) argv, d);
+          else if (d->__last_nonopt != d->optind)
+            d->__first_nonopt = d->optind;
 
-         /* Skip any additional non-options
-            and extend the range of non-options previously skipped.  */
+          /* Skip any additional non-options
+             and extend the range of non-options previously skipped.  */
 
-         while (d->optind < argc && NONOPTION_P)
-           d->optind++;
-         d->__last_nonopt = d->optind;
-       }
+          while (d->optind < argc && NONOPTION_P)
+            d->optind++;
+          d->__last_nonopt = d->optind;
+        }
 
       /* The special ARGV-element `--' means premature end of options.
-        Skip it like a null option,
-        then exchange with previous non-options as if it were an option,
-        then skip everything else like a non-option.  */
+         Skip it like a null option,
+         then exchange with previous non-options as if it were an option,
+         then skip everything else like a non-option.  */
 
       if (d->optind != argc && !strcmp (argv[d->optind], "--"))
-       {
-         d->optind++;
+        {
+          d->optind++;
 
-         if (d->__first_nonopt != d->__last_nonopt
-             && d->__last_nonopt != d->optind)
-           exchange ((char **) argv, d);
-         else if (d->__first_nonopt == d->__last_nonopt)
-           d->__first_nonopt = d->optind;
-         d->__last_nonopt = argc;
+          if (d->__first_nonopt != d->__last_nonopt
+              && d->__last_nonopt != d->optind)
+            exchange ((char **) argv, d);
+          else if (d->__first_nonopt == d->__last_nonopt)
+            d->__first_nonopt = d->optind;
+          d->__last_nonopt = argc;
 
-         d->optind = argc;
-       }
+          d->optind = argc;
+        }
 
       /* If we have done all the ARGV-elements, stop the scan
-        and back over any non-options that we skipped and permuted.  */
+         and back over any non-options that we skipped and permuted.  */
 
       if (d->optind == argc)
-       {
-         /* Set the next-arg-index to point at the non-options
-            that we previously skipped, so the caller will digest them.  */
-         if (d->__first_nonopt != d->__last_nonopt)
-           d->optind = d->__first_nonopt;
-         return -1;
-       }
+        {
+          /* Set the next-arg-index to point at the non-options
+             that we previously skipped, so the caller will digest them.  */
+          if (d->__first_nonopt != d->__last_nonopt)
+            d->optind = d->__first_nonopt;
+          return -1;
+        }
 
       /* If we have come to a non-option and did not permute it,
-        either stop the scan or describe it to the caller and pass it by.  */
+         either stop the scan or describe it to the caller and pass it by.  */
 
       if (NONOPTION_P)
-       {
-         if (d->__ordering == REQUIRE_ORDER)
-           return -1;
-         d->optarg = argv[d->optind++];
-         return 1;
-       }
+        {
+          if (d->__ordering == REQUIRE_ORDER)
+            return -1;
+          d->optarg = argv[d->optind++];
+          return 1;
+        }
 
       /* We have found another option-ARGV-element.
-        Skip the initial punctuation.  */
+         Skip the initial punctuation.  */
 
       d->__nextchar = (argv[d->optind] + 1
-                 + (longopts != NULL && argv[d->optind][1] == '-'));
+                  + (longopts != NULL && argv[d->optind][1] == '-'));
     }
 
   /* Decode the current option-ARGV-element.  */
@@ -474,8 +475,8 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
 
   if (longopts != NULL
       && (argv[d->optind][1] == '-'
-         || (long_only && (argv[d->optind][2]
-                           || !strchr (optstring, argv[d->optind][1])))))
+          || (long_only && (argv[d->optind][2]
+                            || !strchr (optstring, argv[d->optind][1])))))
     {
       char *nameend;
       const struct option *p;
@@ -486,594 +487,585 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
       int option_index;
 
       for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
-       /* Do nothing.  */ ;
+        /* Do nothing.  */ ;
 
       /* Test all long options for either exact match
-        or abbreviated matches.  */
+         or abbreviated matches.  */
       for (p = longopts, option_index = 0; p->name; p++, option_index++)
-       if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
-         {
-           if ((unsigned int) (nameend - d->__nextchar)
-               == (unsigned int) strlen (p->name))
-             {
-               /* Exact match found.  */
-               pfound = p;
-               indfound = option_index;
-               exact = 1;
-               break;
-             }
-           else if (pfound == NULL)
-             {
-               /* First nonexact match found.  */
-               pfound = p;
-               indfound = option_index;
-             }
-           else if (long_only
-                    || pfound->has_arg != p->has_arg
-                    || pfound->flag != p->flag
-                    || pfound->val != p->val)
-             /* Second or later nonexact match found.  */
-             ambig = 1;
-         }
+        if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
+          {
+            if ((unsigned int) (nameend - d->__nextchar)
+                == (unsigned int) strlen (p->name))
+              {
+                /* Exact match found.  */
+                pfound = p;
+                indfound = option_index;
+                exact = 1;
+                break;
+              }
+            else if (pfound == NULL)
+              {
+                /* First nonexact match found.  */
+                pfound = p;
+                indfound = option_index;
+              }
+            else if (long_only
+                     || pfound->has_arg != p->has_arg
+                     || pfound->flag != p->flag
+                     || pfound->val != p->val)
+              /* Second or later nonexact match found.  */
+              ambig = 1;
+          }
 
       if (ambig && !exact)
-       {
-         if (print_errors)
-           {
+        {
+          if (print_errors)
+            {
 #if defined _LIBC && defined USE_IN_LIBIO
-             char *buf;
+              char *buf;
 
-             if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"),
-                             argv[0], argv[d->optind]) >= 0)
-               {
-                 _IO_flockfile (stderr);
+              if (__asprintf (&buf, _("%s: option '%s' is ambiguous\n"),
+                              argv[0], argv[d->optind]) >= 0)
+                {
+                  _IO_flockfile (stderr);
 
-                 int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                 ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                  int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                  ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-                 __fxprintf (NULL, "%s", buf);
+                  __fxprintf (NULL, "%s", buf);
 
-                 ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                 _IO_funlockfile (stderr);
+                  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                  _IO_funlockfile (stderr);
 
-                 free (buf);
-               }
+                  free (buf);
+                }
 #else
-             fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
-                      argv[0], argv[d->optind]);
+              fprintf (stderr, _("%s: option '%s' is ambiguous\n"),
+                       argv[0], argv[d->optind]);
 #endif
-           }
-         d->__nextchar += strlen (d->__nextchar);
-         d->optind++;
-         d->optopt = 0;
-         return '?';
-       }
+            }
+          d->__nextchar += strlen (d->__nextchar);
+          d->optind++;
+          d->optopt = 0;
+          return '?';
+        }
 
       if (pfound != NULL)
-       {
-         option_index = indfound;
-         d->optind++;
-         if (*nameend)
-           {
-             /* Don't test has_arg with >, because some C compilers don't
-                allow it to be used on enums.  */
-             if (pfound->has_arg)
-               d->optarg = nameend + 1;
-             else
-               {
-                 if (print_errors)
-                   {
+        {
+          option_index = indfound;
+          d->optind++;
+          if (*nameend)
+            {
+              /* Don't test has_arg with >, because some C compilers don't
+                 allow it to be used on enums.  */
+              if (pfound->has_arg)
+                d->optarg = nameend + 1;
+              else
+                {
+                  if (print_errors)
+                    {
 #if defined _LIBC && defined USE_IN_LIBIO
-                     char *buf;
-                     int n;
+                      char *buf;
+                      int n;
 #endif
 
-                     if (argv[d->optind - 1][1] == '-')
-                       {
-                         /* --option */
+                      if (argv[d->optind - 1][1] == '-')
+                        {
+                          /* --option */
 #if defined _LIBC && defined USE_IN_LIBIO
-                         n = __asprintf (&buf, _("\
-%s: option `--%s' doesn't allow an argument\n"),
-                                         argv[0], pfound->name);
+                          n = __asprintf (&buf, _("\
+%s: option '--%s' doesn't allow an argument\n"),
+                                          argv[0], pfound->name);
 #else
-                         fprintf (stderr, _("\
-%s: option `--%s' doesn't allow an argument\n"),
-                                  argv[0], pfound->name);
+                          fprintf (stderr, _("\
+%s: option '--%s' doesn't allow an argument\n"),
+                                   argv[0], pfound->name);
 #endif
-                       }
-                     else
-                       {
-                         /* +option or -option */
+                        }
+                      else
+                        {
+                          /* +option or -option */
 #if defined _LIBC && defined USE_IN_LIBIO
-                         n = __asprintf (&buf, _("\
-%s: option `%c%s' doesn't allow an argument\n"),
-                                         argv[0], argv[d->optind - 1][0],
-                                         pfound->name);
+                          n = __asprintf (&buf, _("\
+%s: option '%c%s' doesn't allow an argument\n"),
+                                          argv[0], argv[d->optind - 1][0],
+                                          pfound->name);
 #else
-                         fprintf (stderr, _("\
-%s: option `%c%s' doesn't allow an argument\n"),
-                                  argv[0], argv[d->optind - 1][0],
-                                  pfound->name);
+                          fprintf (stderr, _("\
+%s: option '%c%s' doesn't allow an argument\n"),
+                                   argv[0], argv[d->optind - 1][0],
+                                   pfound->name);
 #endif
-                       }
+                        }
 
 #if defined _LIBC && defined USE_IN_LIBIO
-                     if (n >= 0)
-                       {
-                         _IO_flockfile (stderr);
+                      if (n >= 0)
+                        {
+                          _IO_flockfile (stderr);
 
-                         int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                         ((_IO_FILE *) stderr)->_flags2
-                           |= _IO_FLAGS2_NOTCANCEL;
+                          int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                          ((_IO_FILE *) stderr)->_flags2
+                            |= _IO_FLAGS2_NOTCANCEL;
 
-                         __fxprintf (NULL, "%s", buf);
+                          __fxprintf (NULL, "%s", buf);
 
-                         ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                         _IO_funlockfile (stderr);
+                          ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                          _IO_funlockfile (stderr);
 
-                         free (buf);
-                       }
+                          free (buf);
+                        }
 #endif
-                   }
-
-                 d->__nextchar += strlen (d->__nextchar);
-
-                 d->optopt = pfound->val;
-                 return '?';
-               }
-           }
-         else if (pfound->has_arg == 1)
-           {
-             if (d->optind < argc)
-               d->optarg = argv[d->optind++];
-             else
-               {
-                 if (print_errors)
-                   {
+                    }
+
+                  d->__nextchar += strlen (d->__nextchar);
+
+                  d->optopt = pfound->val;
+                  return '?';
+                }
+            }
+          else if (pfound->has_arg == 1)
+            {
+              if (d->optind < argc)
+                d->optarg = argv[d->optind++];
+              else
+                {
+                  if (print_errors)
+                    {
 #if defined _LIBC && defined USE_IN_LIBIO
-                     char *buf;
+                      char *buf;
 
-                     if (__asprintf (&buf, _("\
-%s: option `%s' requires an argument\n"),
-                                     argv[0], argv[d->optind - 1]) >= 0)
-                       {
-                         _IO_flockfile (stderr);
+                      if (__asprintf (&buf, _("\
+%s: option '--%s' requires an argument\n"),
+                                      argv[0], pfound->name) >= 0)
+                        {
+                          _IO_flockfile (stderr);
 
-                         int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                         ((_IO_FILE *) stderr)->_flags2
-                           |= _IO_FLAGS2_NOTCANCEL;
+                          int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                          ((_IO_FILE *) stderr)->_flags2
+                            |= _IO_FLAGS2_NOTCANCEL;
 
-                         __fxprintf (NULL, "%s", buf);
+                          __fxprintf (NULL, "%s", buf);
 
-                         ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                         _IO_funlockfile (stderr);
+                          ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                          _IO_funlockfile (stderr);
 
-                         free (buf);
-                       }
+                          free (buf);
+                        }
 #else
-                     fprintf (stderr,
-                              _("%s: option `%s' requires an argument\n"),
-                              argv[0], argv[d->optind - 1]);
+                      fprintf (stderr,
+                               _("%s: option '--%s' requires an argument\n"),
+                               argv[0], pfound->name);
 #endif
-                   }
-                 d->__nextchar += strlen (d->__nextchar);
-                 d->optopt = pfound->val;
-                 return optstring[0] == ':' ? ':' : '?';
-               }
-           }
-         d->__nextchar += strlen (d->__nextchar);
-         if (longind != NULL)
-           *longind = option_index;
-         if (pfound->flag)
-           {
-             *(pfound->flag) = pfound->val;
-             return 0;
-           }
-         return pfound->val;
-       }
+                    }
+                  d->__nextchar += strlen (d->__nextchar);
+                  d->optopt = pfound->val;
+                  return optstring[0] == ':' ? ':' : '?';
+                }
+            }
+          d->__nextchar += strlen (d->__nextchar);
+          if (longind != NULL)
+            *longind = option_index;
+          if (pfound->flag)
+            {
+              *(pfound->flag) = pfound->val;
+              return 0;
+            }
+          return pfound->val;
+        }
 
       /* Can't find it as a long option.  If this is not getopt_long_only,
-        or the option starts with '--' or is not a valid short
-        option, then it's an error.
-        Otherwise interpret it as a short option.  */
+         or the option starts with '--' or is not a valid short
+         option, then it's an error.
+         Otherwise interpret it as a short option.  */
       if (!long_only || argv[d->optind][1] == '-'
-         || strchr (optstring, *d->__nextchar) == NULL)
-       {
-         if (print_errors)
-           {
+          || strchr (optstring, *d->__nextchar) == NULL)
+        {
+          if (print_errors)
+            {
 #if defined _LIBC && defined USE_IN_LIBIO
-             char *buf;
-             int n;
+              char *buf;
+              int n;
 #endif
 
-             if (argv[d->optind][1] == '-')
-               {
-                 /* --option */
+              if (argv[d->optind][1] == '-')
+                {
+                  /* --option */
 #if defined _LIBC && defined USE_IN_LIBIO
-                 n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"),
-                                 argv[0], d->__nextchar);
+                  n = __asprintf (&buf, _("%s: unrecognized option '--%s'\n"),
+                                  argv[0], d->__nextchar);
 #else
-                 fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
-                          argv[0], d->__nextchar);
+                  fprintf (stderr, _("%s: unrecognized option '--%s'\n"),
+                           argv[0], d->__nextchar);
 #endif
-               }
-             else
-               {
-                 /* +option or -option */
+                }
+              else
+                {
+                  /* +option or -option */
 #if defined _LIBC && defined USE_IN_LIBIO
-                 n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"),
-                                 argv[0], argv[d->optind][0], d->__nextchar);
+                  n = __asprintf (&buf, _("%s: unrecognized option '%c%s'\n"),
+                                  argv[0], argv[d->optind][0], d->__nextchar);
 #else
-                 fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
-                          argv[0], argv[d->optind][0], d->__nextchar);
+                  fprintf (stderr, _("%s: unrecognized option '%c%s'\n"),
+                           argv[0], argv[d->optind][0], d->__nextchar);
 #endif
-               }
+                }
 
 #if defined _LIBC && defined USE_IN_LIBIO
-             if (n >= 0)
-               {
-                 _IO_flockfile (stderr);
+              if (n >= 0)
+                {
+                  _IO_flockfile (stderr);
 
-                 int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                 ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                  int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                  ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-                 __fxprintf (NULL, "%s", buf);
+                  __fxprintf (NULL, "%s", buf);
 
-                 ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                 _IO_funlockfile (stderr);
+                  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                  _IO_funlockfile (stderr);
 
-                 free (buf);
-               }
+                  free (buf);
+                }
 #endif
-           }
-         d->__nextchar = (char *) "";
-         d->optind++;
-         d->optopt = 0;
-         return '?';
-       }
+            }
+          d->__nextchar = (char *) "";
+          d->optind++;
+          d->optopt = 0;
+          return '?';
+        }
     }
 
   /* Look at and handle the next short option-character.  */
 
   {
     char c = *d->__nextchar++;
-    char *temp = strchr (optstring, c);
+    const char *temp = strchr (optstring, c);
 
     /* Increment `optind' when we start to process its last character.  */
     if (*d->__nextchar == '\0')
       ++d->optind;
 
-    if (temp == NULL || c == ':')
+    if (temp == NULL || c == ':' || c == ';')
       {
-       if (print_errors)
-         {
+        if (print_errors)
+          {
 #if defined _LIBC && defined USE_IN_LIBIO
-             char *buf;
-             int n;
+              char *buf;
+              int n;
 #endif
 
-           if (d->__posixly_correct)
-             {
-               /* 1003.2 specifies the format of this message.  */
 #if defined _LIBC && defined USE_IN_LIBIO
-               n = __asprintf (&buf, _("%s: illegal option -- %c\n"),
-                               argv[0], c);
+              n = __asprintf (&buf, _("%s: invalid option -- '%c'\n"),
+                              argv[0], c);
 #else
-               fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
+              fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
 #endif
-             }
-           else
-             {
-#if defined _LIBC && defined USE_IN_LIBIO
-               n = __asprintf (&buf, _("%s: invalid option -- %c\n"),
-                               argv[0], c);
-#else
-               fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
-#endif
-             }
 
 #if defined _LIBC && defined USE_IN_LIBIO
-           if (n >= 0)
-             {
-               _IO_flockfile (stderr);
+            if (n >= 0)
+              {
+                _IO_flockfile (stderr);
 
-               int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-               ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-               __fxprintf (NULL, "%s", buf);
+                __fxprintf (NULL, "%s", buf);
 
-               ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-               _IO_funlockfile (stderr);
+                ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                _IO_funlockfile (stderr);
 
-               free (buf);
-             }
+                free (buf);
+              }
 #endif
-         }
-       d->optopt = c;
-       return '?';
+          }
+        d->optopt = c;
+        return '?';
       }
     /* Convenience. Treat POSIX -W foo same as long option --foo */
     if (temp[0] == 'W' && temp[1] == ';')
       {
-       char *nameend;
-       const struct option *p;
-       const struct option *pfound = NULL;
-       int exact = 0;
-       int ambig = 0;
-       int indfound = 0;
-       int option_index;
-
-       /* This is an option that requires an argument.  */
-       if (*d->__nextchar != '\0')
-         {
-           d->optarg = d->__nextchar;
-           /* If we end this ARGV-element by taking the rest as an arg,
-              we must advance to the next element now.  */
-           d->optind++;
-         }
-       else if (d->optind == argc)
-         {
-           if (print_errors)
-             {
-               /* 1003.2 specifies the format of this message.  */
+        char *nameend;
+        const struct option *p;
+        const struct option *pfound = NULL;
+        int exact = 0;
+        int ambig = 0;
+        int indfound = 0;
+        int option_index;
+
+        /* This is an option that requires an argument.  */
+        if (*d->__nextchar != '\0')
+          {
+            d->optarg = d->__nextchar;
+            /* If we end this ARGV-element by taking the rest as an arg,
+               we must advance to the next element now.  */
+            d->optind++;
+          }
+        else if (d->optind == argc)
+          {
+            if (print_errors)
+              {
 #if defined _LIBC && defined USE_IN_LIBIO
-               char *buf;
+                char *buf;
 
-               if (__asprintf (&buf,
-                               _("%s: option requires an argument -- %c\n"),
-                               argv[0], c) >= 0)
-                 {
-                   _IO_flockfile (stderr);
+                if (__asprintf (&buf,
+                                _("%s: option requires an argument -- '%c'\n"),
+                                argv[0], c) >= 0)
+                  {
+                    _IO_flockfile (stderr);
 
-                   int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                   ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                    int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                    ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-                   __fxprintf (NULL, "%s", buf);
+                    __fxprintf (NULL, "%s", buf);
 
-                   ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                   _IO_funlockfile (stderr);
+                    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                    _IO_funlockfile (stderr);
 
-                   free (buf);
-                 }
+                    free (buf);
+                  }
 #else
-               fprintf (stderr, _("%s: option requires an argument -- %c\n"),
-                        argv[0], c);
+                fprintf (stderr,
+                         _("%s: option requires an argument -- '%c'\n"),
+                         argv[0], c);
 #endif
-             }
-           d->optopt = c;
-           if (optstring[0] == ':')
-             c = ':';
-           else
-             c = '?';
-           return c;
-         }
-       else
-         /* We already incremented `d->optind' once;
-            increment it again when taking next ARGV-elt as argument.  */
-         d->optarg = argv[d->optind++];
-
-       /* optarg is now the argument, see if it's in the
-          table of longopts.  */
-
-       for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '=';
-            nameend++)
-         /* Do nothing.  */ ;
-
-       /* Test all long options for either exact match
-          or abbreviated matches.  */
-       for (p = longopts, option_index = 0; p->name; p++, option_index++)
-         if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
-           {
-             if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name))
-               {
-                 /* Exact match found.  */
-                 pfound = p;
-                 indfound = option_index;
-                 exact = 1;
-                 break;
-               }
-             else if (pfound == NULL)
-               {
-                 /* First nonexact match found.  */
-                 pfound = p;
-                 indfound = option_index;
-               }
-             else
-               /* Second or later nonexact match found.  */
-               ambig = 1;
-           }
-       if (ambig && !exact)
-         {
-           if (print_errors)
-             {
+              }
+            d->optopt = c;
+            if (optstring[0] == ':')
+              c = ':';
+            else
+              c = '?';
+            return c;
+          }
+        else
+          /* We already incremented `d->optind' once;
+             increment it again when taking next ARGV-elt as argument.  */
+          d->optarg = argv[d->optind++];
+
+        /* optarg is now the argument, see if it's in the
+           table of longopts.  */
+
+        for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '=';
+             nameend++)
+          /* Do nothing.  */ ;
+
+        /* Test all long options for either exact match
+           or abbreviated matches.  */
+        for (p = longopts, option_index = 0; p->name; p++, option_index++)
+          if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
+            {
+              if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name))
+                {
+                  /* Exact match found.  */
+                  pfound = p;
+                  indfound = option_index;
+                  exact = 1;
+                  break;
+                }
+              else if (pfound == NULL)
+                {
+                  /* First nonexact match found.  */
+                  pfound = p;
+                  indfound = option_index;
+                }
+              else if (long_only
+                       || pfound->has_arg != p->has_arg
+                       || pfound->flag != p->flag
+                       || pfound->val != p->val)
+                /* Second or later nonexact match found.  */
+                ambig = 1;
+            }
+        if (ambig && !exact)
+          {
+            if (print_errors)
+              {
 #if defined _LIBC && defined USE_IN_LIBIO
-               char *buf;
+                char *buf;
 
-               if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"),
-                               argv[0], argv[d->optind]) >= 0)
-                 {
-                   _IO_flockfile (stderr);
+                if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"),
+                                argv[0], d->optarg) >= 0)
+                  {
+                    _IO_flockfile (stderr);
 
-                   int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                   ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                    int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                    ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-                   __fxprintf (NULL, "%s", buf);
+                    __fxprintf (NULL, "%s", buf);
 
-                   ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                   _IO_funlockfile (stderr);
+                    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                    _IO_funlockfile (stderr);
 
-                   free (buf);
-                 }
+                    free (buf);
+                  }
 #else
-               fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
-                        argv[0], argv[d->optind]);
+                fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
+                         argv[0], d->optarg);
 #endif
-             }
-           d->__nextchar += strlen (d->__nextchar);
-           d->optind++;
-           return '?';
-         }
-       if (pfound != NULL)
-         {
-           option_index = indfound;
-           if (*nameend)
-             {
-               /* Don't test has_arg with >, because some C compilers don't
-                  allow it to be used on enums.  */
-               if (pfound->has_arg)
-                 d->optarg = nameend + 1;
-               else
-                 {
-                   if (print_errors)
-                     {
+              }
+            d->__nextchar += strlen (d->__nextchar);
+            d->optind++;
+            return '?';
+          }
+        if (pfound != NULL)
+          {
+            option_index = indfound;
+            if (*nameend)
+              {
+                /* Don't test has_arg with >, because some C compilers don't
+                   allow it to be used on enums.  */
+                if (pfound->has_arg)
+                  d->optarg = nameend + 1;
+                else
+                  {
+                    if (print_errors)
+                      {
 #if defined _LIBC && defined USE_IN_LIBIO
-                       char *buf;
+                        char *buf;
 
-                       if (__asprintf (&buf, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
-                                       argv[0], pfound->name) >= 0)
-                         {
-                           _IO_flockfile (stderr);
+                        if (__asprintf (&buf, _("\
+%s: option '-W %s' doesn't allow an argument\n"),
+                                        argv[0], pfound->name) >= 0)
+                          {
+                            _IO_flockfile (stderr);
 
-                           int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                           ((_IO_FILE *) stderr)->_flags2
-                             |= _IO_FLAGS2_NOTCANCEL;
+                            int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                            ((_IO_FILE *) stderr)->_flags2
+                              |= _IO_FLAGS2_NOTCANCEL;
 
-                           __fxprintf (NULL, "%s", buf);
+                            __fxprintf (NULL, "%s", buf);
 
-                           ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                           _IO_funlockfile (stderr);
+                            ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                            _IO_funlockfile (stderr);
 
-                           free (buf);
-                         }
+                            free (buf);
+                          }
 #else
-                       fprintf (stderr, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
-                                argv[0], pfound->name);
+                        fprintf (stderr, _("\
+%s: option '-W %s' doesn't allow an argument\n"),
+                                 argv[0], pfound->name);
 #endif
-                     }
-
-                   d->__nextchar += strlen (d->__nextchar);
-                   return '?';
-                 }
-             }
-           else if (pfound->has_arg == 1)
-             {
-               if (d->optind < argc)
-                 d->optarg = argv[d->optind++];
-               else
-                 {
-                   if (print_errors)
-                     {
+                      }
+
+                    d->__nextchar += strlen (d->__nextchar);
+                    return '?';
+                  }
+              }
+            else if (pfound->has_arg == 1)
+              {
+                if (d->optind < argc)
+                  d->optarg = argv[d->optind++];
+                else
+                  {
+                    if (print_errors)
+                      {
 #if defined _LIBC && defined USE_IN_LIBIO
-                       char *buf;
+                        char *buf;
 
-                       if (__asprintf (&buf, _("\
-%s: option `%s' requires an argument\n"),
-                                       argv[0], argv[d->optind - 1]) >= 0)
-                         {
-                           _IO_flockfile (stderr);
+                        if (__asprintf (&buf, _("\
+%s: option '-W %s' requires an argument\n"),
+                                        argv[0], pfound->name) >= 0)
+                          {
+                            _IO_flockfile (stderr);
 
-                           int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                           ((_IO_FILE *) stderr)->_flags2
-                             |= _IO_FLAGS2_NOTCANCEL;
+                            int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                            ((_IO_FILE *) stderr)->_flags2
+                              |= _IO_FLAGS2_NOTCANCEL;
 
-                           __fxprintf (NULL, "%s", buf);
+                            __fxprintf (NULL, "%s", buf);
 
-                           ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                           _IO_funlockfile (stderr);
+                            ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                            _IO_funlockfile (stderr);
 
-                           free (buf);
-                         }
+                            free (buf);
+                          }
 #else
-                       fprintf (stderr,
-                                _("%s: option `%s' requires an argument\n"),
-                                argv[0], argv[d->optind - 1]);
+                        fprintf (stderr, _("\
+%s: option '-W %s' requires an argument\n"),
+                                 argv[0], pfound->name);
 #endif
-                     }
-                   d->__nextchar += strlen (d->__nextchar);
-                   return optstring[0] == ':' ? ':' : '?';
-                 }
-             }
-           d->__nextchar += strlen (d->__nextchar);
-           if (longind != NULL)
-             *longind = option_index;
-           if (pfound->flag)
-             {
-               *(pfound->flag) = pfound->val;
-               return 0;
-             }
-           return pfound->val;
-         }
-         d->__nextchar = NULL;
-         return 'W';   /* Let the application handle it.   */
+                      }
+                    d->__nextchar += strlen (d->__nextchar);
+                    return optstring[0] == ':' ? ':' : '?';
+                  }
+              }
+            else
+              d->optarg = NULL;
+            d->__nextchar += strlen (d->__nextchar);
+            if (longind != NULL)
+              *longind = option_index;
+            if (pfound->flag)
+              {
+                *(pfound->flag) = pfound->val;
+                return 0;
+              }
+            return pfound->val;
+          }
+          d->__nextchar = NULL;
+          return 'W';   /* Let the application handle it.   */
       }
     if (temp[1] == ':')
       {
-       if (temp[2] == ':')
-         {
-           /* This is an option that accepts an argument optionally.  */
-           if (*d->__nextchar != '\0')
-             {
-               d->optarg = d->__nextchar;
-               d->optind++;
-             }
-           else
-             d->optarg = NULL;
-           d->__nextchar = NULL;
-         }
-       else
-         {
-           /* This is an option that requires an argument.  */
-           if (*d->__nextchar != '\0')
-             {
-               d->optarg = d->__nextchar;
-               /* If we end this ARGV-element by taking the rest as an arg,
-                  we must advance to the next element now.  */
-               d->optind++;
-             }
-           else if (d->optind == argc)
-             {
-               if (print_errors)
-                 {
-                   /* 1003.2 specifies the format of this message.  */
+        if (temp[2] == ':')
+          {
+            /* This is an option that accepts an argument optionally.  */
+            if (*d->__nextchar != '\0')
+              {
+                d->optarg = d->__nextchar;
+                d->optind++;
+              }
+            else
+              d->optarg = NULL;
+            d->__nextchar = NULL;
+          }
+        else
+          {
+            /* This is an option that requires an argument.  */
+            if (*d->__nextchar != '\0')
+              {
+                d->optarg = d->__nextchar;
+                /* If we end this ARGV-element by taking the rest as an arg,
+                   we must advance to the next element now.  */
+                d->optind++;
+              }
+            else if (d->optind == argc)
+              {
+                if (print_errors)
+                  {
 #if defined _LIBC && defined USE_IN_LIBIO
-                   char *buf;
+                    char *buf;
 
-                   if (__asprintf (&buf, _("\
-%s: option requires an argument -- %c\n"),
-                                   argv[0], c) >= 0)
-                     {
-                       _IO_flockfile (stderr);
+                    if (__asprintf (&buf, _("\
+%s: option requires an argument -- '%c'\n"),
+                                    argv[0], c) >= 0)
+                      {
+                        _IO_flockfile (stderr);
 
-                       int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                       ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                        int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                        ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-                       __fxprintf (NULL, "%s", buf);
+                        __fxprintf (NULL, "%s", buf);
 
-                       ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                       _IO_funlockfile (stderr);
+                        ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                        _IO_funlockfile (stderr);
 
-                       free (buf);
-                     }
+                        free (buf);
+                      }
 #else
-                   fprintf (stderr,
-                            _("%s: option requires an argument -- %c\n"),
-                            argv[0], c);
+                    fprintf (stderr,
+                             _("%s: option requires an argument -- '%c'\n"),
+                             argv[0], c);
 #endif
-                 }
-               d->optopt = c;
-               if (optstring[0] == ':')
-                 c = ':';
-               else
-                 c = '?';
-             }
-           else
-             /* We already incremented `optind' once;
-                increment it again when taking next ARGV-elt as argument.  */
-             d->optarg = argv[d->optind++];
-           d->__nextchar = NULL;
-         }
+                  }
+                d->optopt = c;
+                if (optstring[0] == ':')
+                  c = ':';
+                else
+                  c = '?';
+              }
+            else
+              /* We already incremented `optind' once;
+                 increment it again when taking next ARGV-elt as argument.  */
+              d->optarg = argv[d->optind++];
+            d->__nextchar = NULL;
+          }
       }
     return c;
   }
@@ -1081,16 +1073,17 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
 
 int
 _getopt_internal (int argc, char **argv, const char *optstring,
-                 const struct option *longopts, int *longind,
-                 int long_only, int posixly_correct)
+                  const struct option *longopts, int *longind, int long_only,
+                  int posixly_correct)
 {
   int result;
 
   getopt_data.optind = optind;
   getopt_data.opterr = opterr;
 
-  result = _getopt_internal_r (argc, argv, optstring, longopts, longind,
-                              long_only, posixly_correct, &getopt_data);
+  result = _getopt_internal_r (argc, argv, optstring, longopts,
+                               longind, long_only, &getopt_data,
+                               posixly_correct);
 
   optind = getopt_data.optind;
   optarg = getopt_data.optarg;
@@ -1110,9 +1103,22 @@ enum { POSIXLY_CORRECT = 1 };
 int
 getopt (int argc, char *const *argv, const char *optstring)
 {
-  return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0,
-                          POSIXLY_CORRECT);
+  return _getopt_internal (argc, (char **) argv, optstring,
+                           (const struct option *) 0,
+                           (int *) 0,
+                           0, POSIXLY_CORRECT);
+}
+
+#ifdef _LIBC
+int
+__posix_getopt (int argc, char *const *argv, const char *optstring)
+{
+  return _getopt_internal (argc, argv, optstring,
+                           (const struct option *) 0,
+                           (int *) 0,
+                           0, 1);
 }
+#endif
 
 \f
 #ifdef TEST
@@ -1132,51 +1138,51 @@ main (int argc, char **argv)
 
       c = getopt (argc, argv, "abc:d:0123456789");
       if (c == -1)
-       break;
+        break;
 
       switch (c)
-       {
-       case '0':
-       case '1':
-       case '2':
-       case '3':
-       case '4':
-       case '5':
-       case '6':
-       case '7':
-       case '8':
-       case '9':
-         if (digit_optind != 0 && digit_optind != this_option_optind)
-           printf ("digits occur in two different argv-elements.\n");
-         digit_optind = this_option_optind;
-         printf ("option %c\n", c);
-         break;
-
-       case 'a':
-         printf ("option a\n");
-         break;
-
-       case 'b':
-         printf ("option b\n");
-         break;
-
-       case 'c':
-         printf ("option c with value `%s'\n", optarg);
-         break;
-
-       case '?':
-         break;
-
-       default:
-         printf ("?? getopt returned character code 0%o ??\n", c);
-       }
+        {
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+          if (digit_optind != 0 && digit_optind != this_option_optind)
+            printf ("digits occur in two different argv-elements.\n");
+          digit_optind = this_option_optind;
+          printf ("option %c\n", c);
+          break;
+
+        case 'a':
+          printf ("option a\n");
+          break;
+
+        case 'b':
+          printf ("option b\n");
+          break;
+
+        case 'c':
+          printf ("option c with value '%s'\n", optarg);
+          break;
+
+        case '?':
+          break;
+
+        default:
+          printf ("?? getopt returned character code 0%o ??\n", c);
+        }
     }
 
   if (optind < argc)
     {
       printf ("non-option ARGV-elements: ");
       while (optind < argc)
-       printf ("%s ", argv[optind++]);
+        printf ("%s ", argv[optind++]);
       printf ("\n");
     }
 
index d2d3e6e63bb484f2554713e2269972c752330aa4..57a8e8992d98cd03cd5cbb1119b00e3dd56a7937 100644 (file)
@@ -1,6 +1,6 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007
-   Free Software Foundation, Inc.
+   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2010 Free Software
+   Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GETOPT_H
+#ifndef _GL_GETOPT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
+/* The include_next requires a split double-inclusion guard.  We must
+   also inform the replacement unistd.h to not recursively use
+   <getopt.h>; our definitions will be present soon enough.  */
+#if @HAVE_GETOPT_H@
+# define _GL_SYSTEM_GETOPT
+# @INCLUDE_NEXT@ @NEXT_GETOPT_H@
+# undef _GL_SYSTEM_GETOPT
+#endif
+
+#ifndef _GL_GETOPT_H
 
 #ifndef __need_getopt
-# define _GETOPT_H 1
+# define _GL_GETOPT_H 1
 #endif
 
 /* Standalone applications should #define __GETOPT_PREFIX to an
    identifier that prefixes the external functions and variables
    defined in this header.  When this happens, include the
    headers that might declare getopt so that they will not cause
-   confusion if included after this file.  Then systematically rename
+   confusion if included after this file (if the system had <getopt.h>,
+   we have already included it).  Then systematically rename
    identifiers so that they do not collide with the system functions
    and variables.  Renaming avoids problems with some compilers and
    linkers.  */
 #if defined __GETOPT_PREFIX && !defined __need_getopt
-# include <stdlib.h>
-# include <stdio.h>
-# include <unistd.h>
+# if !@HAVE_GETOPT_H@
+#  include <stdlib.h>
+#  include <stdio.h>
+#  include <unistd.h>
+# endif
 # undef __need_getopt
 # undef getopt
 # undef getopt_long
@@ -42,6 +60,7 @@
 # undef opterr
 # undef optind
 # undef optopt
+# undef option
 # define __GETOPT_CONCAT(x, y) x ## y
 # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
 # define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
@@ -52,6 +71,8 @@
 # define opterr __GETOPT_ID (opterr)
 # define optind __GETOPT_ID (optind)
 # define optopt __GETOPT_ID (optopt)
+# define option __GETOPT_ID (option)
+# define _getopt_internal __GETOPT_ID (getopt_internal)
 #endif
 
 /* Standalone applications get correct prototypes for getopt_long and
 #  define __GNUC_PREREQ(maj, min) (0)
 # endif
 # if defined __cplusplus && __GNUC_PREREQ (2,8)
-#  define __THROW      throw ()
+#  define __THROW       throw ()
 # else
 #  define __THROW
 # endif
 #endif
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -142,9 +165,9 @@ extern int optopt;
    zero.
 
    The field `has_arg' is:
-   no_argument         (or 0) if the option does not take an argument,
-   required_argument   (or 1) if the option requires an argument,
-   optional_argument   (or 2) if the option takes an optional argument.
+   no_argument          (or 0) if the option does not take an argument,
+   required_argument    (or 1) if the option requires an argument,
+   optional_argument    (or 2) if the option takes an optional argument.
 
    If the field `flag' is not NULL, it points to a variable that is set
    to the value given in the field `val' when the option is found, but
@@ -169,10 +192,10 @@ struct option
 
 /* Names for the values of the `has_arg' field of `struct option'.  */
 
-# define no_argument           0
-# define required_argument     1
-# define optional_argument     2
-#endif /* need getopt */
+# define no_argument            0
+# define required_argument      1
+# define optional_argument      2
+#endif  /* need getopt */
 
 
 /* Get definitions and prototypes for functions to process the
@@ -201,17 +224,17 @@ struct option
    the environment, then do not permute arguments.  */
 
 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
-       __THROW;
+       __THROW _GL_ARG_NONNULL ((2, 3));
 
 #ifndef __need_getopt
 extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
-                       const char *__shortopts,
-                       const struct option *__longopts, int *__longind)
-       __THROW;
+                        const char *__shortopts,
+                        const struct option *__longopts, int *__longind)
+       __THROW _GL_ARG_NONNULL ((2, 3));
 extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
-                            const char *__shortopts,
-                            const struct option *__longopts, int *__longind)
-       __THROW;
+                             const char *__shortopts,
+                             const struct option *__longopts, int *__longind)
+       __THROW _GL_ARG_NONNULL ((2, 3));
 
 #endif
 
@@ -223,3 +246,4 @@ extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
 #undef __need_getopt
 
 #endif /* getopt.h */
+#endif /* getopt.h */
index d6a3ecf4e709543b202652a300c9721286ad504a..046d69f940f619bab7c922ba7d9e1f2e6d8c7c47 100644 (file)
@@ -1,6 +1,6 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006
-     Free Software Foundation, Inc.
+   Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
+   1998, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
 #include <stdlib.h>
 #endif
 
-#ifndef        NULL
+#ifndef NULL
 #define NULL 0
 #endif
 
 int
 getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
-            const struct option *long_options, int *opt_index)
+             const struct option *long_options, int *opt_index)
 {
   return _getopt_internal (argc, (char **) argv, options, long_options,
-                          opt_index, 0, 0);
+                           opt_index, 0, 0);
 }
 
 int
 _getopt_long_r (int argc, char **argv, const char *options,
-               const struct option *long_options, int *opt_index,
-               struct _getopt_data *d)
+                const struct option *long_options, int *opt_index,
+                struct _getopt_data *d)
 {
   return _getopt_internal_r (argc, argv, options, long_options, opt_index,
-                            0, 0, d);
+                             0, d, 0);
 }
 
 /* Like getopt_long, but '-' as well as '--' can indicate a long option.
@@ -60,20 +60,20 @@ _getopt_long_r (int argc, char **argv, const char *options,
 
 int
 getopt_long_only (int argc, char *__getopt_argv_const *argv,
-                 const char *options,
-                 const struct option *long_options, int *opt_index)
+                  const char *options,
+                  const struct option *long_options, int *opt_index)
 {
   return _getopt_internal (argc, (char **) argv, options, long_options,
-                          opt_index, 1, 0);
+                           opt_index, 1, 0);
 }
 
 int
 _getopt_long_only_r (int argc, char **argv, const char *options,
-                    const struct option *long_options, int *opt_index,
-                    struct _getopt_data *d)
+                     const struct option *long_options, int *opt_index,
+                     struct _getopt_data *d)
 {
   return _getopt_internal_r (argc, argv, options, long_options, opt_index,
-                            1, 0, d);
+                             1, d, 0);
 }
 
 \f
@@ -91,76 +91,76 @@ main (int argc, char **argv)
     {
       int this_option_optind = optind ? optind : 1;
       int option_index = 0;
-      static struct option long_options[] =
+      static const struct option long_options[] =
       {
-       {"add", 1, 0, 0},
-       {"append", 0, 0, 0},
-       {"delete", 1, 0, 0},
-       {"verbose", 0, 0, 0},
-       {"create", 0, 0, 0},
-       {"file", 1, 0, 0},
-       {0, 0, 0, 0}
+        {"add", 1, 0, 0},
+        {"append", 0, 0, 0},
+        {"delete", 1, 0, 0},
+        {"verbose", 0, 0, 0},
+        {"create", 0, 0, 0},
+        {"file", 1, 0, 0},
+        {0, 0, 0, 0}
       };
 
       c = getopt_long (argc, argv, "abc:d:0123456789",
-                      long_options, &option_index);
+                       long_options, &option_index);
       if (c == -1)
-       break;
+        break;
 
       switch (c)
-       {
-       case 0:
-         printf ("option %s", long_options[option_index].name);
-         if (optarg)
-           printf (" with arg %s", optarg);
-         printf ("\n");
-         break;
-
-       case '0':
-       case '1':
-       case '2':
-       case '3':
-       case '4':
-       case '5':
-       case '6':
-       case '7':
-       case '8':
-       case '9':
-         if (digit_optind != 0 && digit_optind != this_option_optind)
-           printf ("digits occur in two different argv-elements.\n");
-         digit_optind = this_option_optind;
-         printf ("option %c\n", c);
-         break;
-
-       case 'a':
-         printf ("option a\n");
-         break;
-
-       case 'b':
-         printf ("option b\n");
-         break;
-
-       case 'c':
-         printf ("option c with value `%s'\n", optarg);
-         break;
-
-       case 'd':
-         printf ("option d with value `%s'\n", optarg);
-         break;
-
-       case '?':
-         break;
-
-       default:
-         printf ("?? getopt returned character code 0%o ??\n", c);
-       }
+        {
+        case 0:
+          printf ("option %s", long_options[option_index].name);
+          if (optarg)
+            printf (" with arg %s", optarg);
+          printf ("\n");
+          break;
+
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+          if (digit_optind != 0 && digit_optind != this_option_optind)
+            printf ("digits occur in two different argv-elements.\n");
+          digit_optind = this_option_optind;
+          printf ("option %c\n", c);
+          break;
+
+        case 'a':
+          printf ("option a\n");
+          break;
+
+        case 'b':
+          printf ("option b\n");
+          break;
+
+        case 'c':
+          printf ("option c with value `%s'\n", optarg);
+          break;
+
+        case 'd':
+          printf ("option d with value `%s'\n", optarg);
+          break;
+
+        case '?':
+          break;
+
+        default:
+          printf ("?? getopt returned character code 0%o ??\n", c);
+        }
     }
 
   if (optind < argc)
     {
       printf ("non-option ARGV-elements: ");
       while (optind < argc)
-       printf ("%s ", argv[optind++]);
+        printf ("%s ", argv[optind++]);
       printf ("\n");
     }
 
index 3c6628bb94a920215a25a562b9c5b408c30b9cf7..980b7507f150f5e8732fdbbc810191fd3f82f374 100644 (file)
@@ -1,6 +1,6 @@
 /* Internal declarations for getopt.
-   Copyright (C) 1989-1994,1996-1999,2001,2003,2004
-   Free Software Foundation, Inc.
+   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2010 Free Software
+   Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _GETOPT_INT_H
-#define _GETOPT_INT_H  1
+#define _GETOPT_INT_H   1
+
+#include <getopt.h>
 
 extern int _getopt_internal (int ___argc, char **___argv,
-                            const char *__shortopts,
-                            const struct option *__longopts, int *__longind,
-                            int __long_only, int __posixly_correct);
+                             const char *__shortopts,
+                             const struct option *__longopts, int *__longind,
+                             int __long_only, int __posixly_correct);
 
 \f
 /* Reentrant versions which can handle parsing multiple argument
    vectors at the same time.  */
 
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+   If the caller did not specify anything,
+   the default is REQUIRE_ORDER if the environment variable
+   POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+   REQUIRE_ORDER means don't recognize them as options;
+   stop option processing when the first non-option is seen.
+   This is what Unix does.
+   This mode of operation is selected by either setting the environment
+   variable POSIXLY_CORRECT, or using `+' as the first character
+   of the list of option characters, or by calling getopt.
+
+   PERMUTE is the default.  We permute the contents of ARGV as we
+   scan, so that eventually all the non-options are at the end.
+   This allows options to be given in any order, even with programs
+   that were not written to expect this.
+
+   RETURN_IN_ORDER is an option available to programs that were
+   written to expect options and other ARGV-elements in any order
+   and that care about the ordering of the two.  We describe each
+   non-option ARGV-element as if it were the argument of an option
+   with character code 1.  Using `-' as the first character of the
+   list of option characters selects this mode of operation.
+
+   The special argument `--' forces an end of option-scanning regardless
+   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
+   `--' can cause `getopt' to return -1 with `optind' != ARGC.  */
+
+enum __ord
+  {
+    REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+  };
+
 /* Data type for reentrant functions.  */
 struct _getopt_data
 {
@@ -52,39 +88,8 @@ struct _getopt_data
      by advancing to the next ARGV-element.  */
   char *__nextchar;
 
-  /* Describe how to deal with options that follow non-option ARGV-elements.
-
-     If the caller did not specify anything,
-     the default is REQUIRE_ORDER if the environment variable
-     POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
-     REQUIRE_ORDER means don't recognize them as options;
-     stop option processing when the first non-option is seen.
-     This is what Unix does.
-     This mode of operation is selected by either setting the environment
-     variable POSIXLY_CORRECT, or using `+' as the first character
-     of the list of option characters, or by calling getopt.
-
-     PERMUTE is the default.  We permute the contents of ARGV as we
-     scan, so that eventually all the non-options are at the end.
-     This allows options to be given in any order, even with programs
-     that were not written to expect this.
-
-     RETURN_IN_ORDER is an option available to programs that were
-     written to expect options and other ARGV-elements in any order
-     and that care about the ordering of the two.  We describe each
-     non-option ARGV-element as if it were the argument of an option
-     with character code 1.  Using `-' as the first character of the
-     list of option characters selects this mode of operation.
-
-     The special argument `--' forces an end of option-scanning regardless
-     of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
-     `--' can cause `getopt' to return -1 with `optind' != ARGC.  */
-
-  enum
-    {
-      REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
-    } __ordering;
+  /* See __ord above.  */
+  enum __ord __ordering;
 
   /* If the POSIXLY_CORRECT environment variable is set
      or getopt was called.  */
@@ -108,23 +113,23 @@ struct _getopt_data
 
 /* The initializer is necessary to set OPTIND and OPTERR to their
    default values and to clear the initialization flag.  */
-#define _GETOPT_DATA_INITIALIZER       { 1, 1 }
+#define _GETOPT_DATA_INITIALIZER        { 1, 1 }
 
 extern int _getopt_internal_r (int ___argc, char **___argv,
-                              const char *__shortopts,
-                              const struct option *__longopts, int *__longind,
-                              int __long_only, int __posixly_correct,
-                              struct _getopt_data *__data);
+                               const char *__shortopts,
+                               const struct option *__longopts, int *__longind,
+                               int __long_only, struct _getopt_data *__data,
+                               int __posixly_correct);
 
 extern int _getopt_long_r (int ___argc, char **___argv,
-                          const char *__shortopts,
-                          const struct option *__longopts, int *__longind,
-                          struct _getopt_data *__data);
+                           const char *__shortopts,
+                           const struct option *__longopts, int *__longind,
+                           struct _getopt_data *__data);
 
 extern int _getopt_long_only_r (int ___argc, char **___argv,
-                               const char *__shortopts,
-                               const struct option *__longopts,
-                               int *__longind,
-                               struct _getopt_data *__data);
+                                const char *__shortopts,
+                                const struct option *__longopts,
+                                int *__longind,
+                                struct _getopt_data *__data);
 
 #endif /* getopt_int.h */
index 9d76ec9afccff2785cad1c468b05251a6eba3de2..881ae3304b21677923f1c2fc930e0df994b07e56 100644 (file)
@@ -1,9 +1,10 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
    for invalid uses of the value returned from these functions.
    On pre-ANSI systems without 'const', the config.h file is supposed to
    contain "#define const".  */
+# undef gettext
 # define gettext(Msgid) ((const char *) (Msgid))
+# undef dgettext
 # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
+# undef dcgettext
 # define dcgettext(Domainname, Msgid, Category) \
     ((void) (Category), dgettext (Domainname, Msgid))
+# undef ngettext
 # define ngettext(Msgid1, Msgid2, N) \
     ((N) == 1 \
      ? ((void) (Msgid2), (const char *) (Msgid1)) \
      : ((void) (Msgid1), (const char *) (Msgid2)))
+# undef dngettext
 # define dngettext(Domainname, Msgid1, Msgid2, N) \
     ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
+# undef dcngettext
 # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
-    ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
+    ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
+# undef textdomain
 # define textdomain(Domainname) ((const char *) (Domainname))
+# undef bindtextdomain
 # define bindtextdomain(Domainname, Dirname) \
     ((void) (Domainname), (const char *) (Dirname))
+# undef bind_textdomain_codeset
 # define bind_textdomain_codeset(Domainname, Codeset) \
     ((void) (Domainname), (const char *) (Codeset))
 
@@ -131,8 +141,8 @@ inline
 #endif
 static const char *
 pgettext_aux (const char *domain,
-             const char *msg_ctxt_id, const char *msgid,
-             int category)
+              const char *msg_ctxt_id, const char *msgid,
+              int category)
 {
   const char *translation = dcgettext (domain, msg_ctxt_id, category);
   if (translation == msg_ctxt_id)
@@ -150,9 +160,9 @@ inline
 #endif
 static const char *
 npgettext_aux (const char *domain,
-              const char *msg_ctxt_id, const char *msgid,
-              const char *msgid_plural, unsigned long int n,
-              int category)
+               const char *msg_ctxt_id, const char *msgid,
+               const char *msgid_plural, unsigned long int n,
+               int category)
 {
   const char *translation =
     dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
@@ -190,8 +200,8 @@ inline
 #endif
 static const char *
 dcpgettext_expr (const char *domain,
-                const char *msgctxt, const char *msgid,
-                int category)
+                 const char *msgctxt, const char *msgid,
+                 int category)
 {
   size_t msgctxt_len = strlen (msgctxt) + 1;
   size_t msgid_len = strlen (msgid) + 1;
@@ -213,10 +223,10 @@ dcpgettext_expr (const char *domain,
       translation = dcgettext (domain, msg_ctxt_id, category);
 #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
       if (msg_ctxt_id != buf)
-       free (msg_ctxt_id);
+        free (msg_ctxt_id);
 #endif
       if (translation != msg_ctxt_id)
-       return translation;
+        return translation;
     }
   return msgid;
 }
@@ -235,9 +245,9 @@ inline
 #endif
 static const char *
 dcnpgettext_expr (const char *domain,
-                 const char *msgctxt, const char *msgid,
-                 const char *msgid_plural, unsigned long int n,
-                 int category)
+                  const char *msgctxt, const char *msgid,
+                  const char *msgid_plural, unsigned long int n,
+                  int category)
 {
   size_t msgctxt_len = strlen (msgctxt) + 1;
   size_t msgid_len = strlen (msgid) + 1;
@@ -259,10 +269,10 @@ dcnpgettext_expr (const char *domain,
       translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
 #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
       if (msg_ctxt_id != buf)
-       free (msg_ctxt_id);
+        free (msg_ctxt_id);
 #endif
       if (!(translation == msg_ctxt_id || translation == msgid_plural))
-       return translation;
+        return translation;
     }
   return (n == 1 ? msgid : msgid_plural);
 }
index 7e711f790dd3537c90b7d1879fcb7a924abfe531..74fc55813979034a3628eb7ccc1329bb14569099 100644 (file)
@@ -1,11 +1,10 @@
 /* Provide gettimeofday for systems that don't have it or for which it's broken.
 
-   Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software
-   Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2007, 2009-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -101,7 +100,7 @@ rpl_tzset (void)
    causes problems.  */
 
 int
-rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz)
+gettimeofday (struct timeval *restrict tv, void *restrict tz)
 {
 #undef gettimeofday
 #if HAVE_GETTIMEOFDAY
@@ -111,7 +110,7 @@ rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz)
   struct tm save = *localtime_buffer_addr;
 # endif
 
-  int result = gettimeofday (tv, tz);
+  int result = gettimeofday (tv, (struct timezone *) tz);
 
 # if GETTIMEOFDAY_CLOBBERS_LOCALTIME
   *localtime_buffer_addr = save;
index dc44d0869b9e9cb51556356103ea753bb15393dc..69e1cfbd7d7c0821c73c2031825650044806cb1b 100644 (file)
@@ -1,9 +1,9 @@
 /* Locking in multithreaded situations.
-   Copyright (C) 2005-2008 Free Software Foundation, Inc.
+   Copyright (C) 2005-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -56,19 +56,19 @@ glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
 
       err = pthread_mutex_lock (&lock->guard);
       if (err != 0)
-       return err;
+        return err;
       if (!lock->initialized)
-       {
-         err = glthread_rwlock_init_multithreaded (lock);
-         if (err != 0)
-           {
-             pthread_mutex_unlock (&lock->guard);
-             return err;
-           }
-       }
+        {
+          err = glthread_rwlock_init_multithreaded (lock);
+          if (err != 0)
+            {
+              pthread_mutex_unlock (&lock->guard);
+              return err;
+            }
+        }
       err = pthread_mutex_unlock (&lock->guard);
       if (err != 0)
-       return err;
+        return err;
     }
   return pthread_rwlock_rdlock (&lock->rwlock);
 }
@@ -82,19 +82,19 @@ glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
 
       err = pthread_mutex_lock (&lock->guard);
       if (err != 0)
-       return err;
+        return err;
       if (!lock->initialized)
-       {
-         err = glthread_rwlock_init_multithreaded (lock);
-         if (err != 0)
-           {
-             pthread_mutex_unlock (&lock->guard);
-             return err;
-           }
-       }
+        {
+          err = glthread_rwlock_init_multithreaded (lock);
+          if (err != 0)
+            {
+              pthread_mutex_unlock (&lock->guard);
+              return err;
+            }
+        }
       err = pthread_mutex_unlock (&lock->guard);
       if (err != 0)
-       return err;
+        return err;
     }
   return pthread_rwlock_wrlock (&lock->rwlock);
 }
@@ -161,13 +161,13 @@ glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
   while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
     {
       /* This thread has to wait for a while.  Enqueue it among the
-        waiting_readers.  */
+         waiting_readers.  */
       err = pthread_cond_wait (&lock->waiting_readers, &lock->lock);
       if (err != 0)
-       {
-         pthread_mutex_unlock (&lock->lock);
-         return err;
-       }
+        {
+          pthread_mutex_unlock (&lock->lock);
+          return err;
+        }
     }
   lock->runcount++;
   return pthread_mutex_unlock (&lock->lock);
@@ -185,15 +185,15 @@ glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
   while (!(lock->runcount == 0))
     {
       /* This thread has to wait for a while.  Enqueue it among the
-        waiting_writers.  */
+         waiting_writers.  */
       lock->waiting_writers_count++;
       err = pthread_cond_wait (&lock->waiting_writers, &lock->lock);
       if (err != 0)
-       {
-         lock->waiting_writers_count--;
-         pthread_mutex_unlock (&lock->lock);
-         return err;
-       }
+        {
+          lock->waiting_writers_count--;
+          pthread_mutex_unlock (&lock->lock);
+          return err;
+        }
       lock->waiting_writers_count--;
     }
   lock->runcount--; /* runcount becomes -1 */
@@ -212,46 +212,46 @@ glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
     {
       /* Drop a writer lock.  */
       if (!(lock->runcount == -1))
-       {
-         pthread_mutex_unlock (&lock->lock);
-         return EINVAL;
-       }
+        {
+          pthread_mutex_unlock (&lock->lock);
+          return EINVAL;
+        }
       lock->runcount = 0;
     }
   else
     {
       /* Drop a reader lock.  */
       if (!(lock->runcount > 0))
-       {
-         pthread_mutex_unlock (&lock->lock);
-         return EINVAL;
-       }
+        {
+          pthread_mutex_unlock (&lock->lock);
+          return EINVAL;
+        }
       lock->runcount--;
     }
   if (lock->runcount == 0)
     {
       /* POSIX recommends that "write locks shall take precedence over read
-        locks", to avoid "writer starvation".  */
+         locks", to avoid "writer starvation".  */
       if (lock->waiting_writers_count > 0)
-       {
-         /* Wake up one of the waiting writers.  */
-         err = pthread_cond_signal (&lock->waiting_writers);
-         if (err != 0)
-           {
-             pthread_mutex_unlock (&lock->lock);
-             return err;
-           }
-       }
+        {
+          /* Wake up one of the waiting writers.  */
+          err = pthread_cond_signal (&lock->waiting_writers);
+          if (err != 0)
+            {
+              pthread_mutex_unlock (&lock->lock);
+              return err;
+            }
+        }
       else
-       {
-         /* Wake up all waiting readers.  */
-         err = pthread_cond_broadcast (&lock->waiting_readers);
-         if (err != 0)
-           {
-             pthread_mutex_unlock (&lock->lock);
-             return err;
-           }
-       }
+        {
+          /* Wake up all waiting readers.  */
+          err = pthread_cond_broadcast (&lock->waiting_readers);
+          if (err != 0)
+            {
+              pthread_mutex_unlock (&lock->lock);
+              return err;
+            }
+        }
     }
   return pthread_mutex_unlock (&lock->lock);
 }
@@ -347,19 +347,19 @@ glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
 
       err = pthread_mutex_lock (&lock->guard);
       if (err != 0)
-       return err;
+        return err;
       if (!lock->initialized)
-       {
-         err = glthread_recursive_lock_init_multithreaded (lock);
-         if (err != 0)
-           {
-             pthread_mutex_unlock (&lock->guard);
-             return err;
-           }
-       }
+        {
+          err = glthread_recursive_lock_init_multithreaded (lock);
+          if (err != 0)
+            {
+              pthread_mutex_unlock (&lock->guard);
+              return err;
+            }
+        }
       err = pthread_mutex_unlock (&lock->guard);
       if (err != 0)
-       return err;
+        return err;
     }
   return pthread_mutex_lock (&lock->recmutex);
 }
@@ -413,7 +413,7 @@ glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
 
       err = pthread_mutex_lock (&lock->mutex);
       if (err != 0)
-       return err;
+        return err;
       lock->owner = self;
     }
   if (++(lock->depth) == 0) /* wraparound? */
@@ -552,7 +552,7 @@ glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
 
       err = mutex_lock (&lock->mutex);
       if (err != 0)
-       return err;
+        return err;
       lock->owner = self;
     }
   if (++(lock->depth) == 0) /* wraparound? */
@@ -597,15 +597,15 @@ glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void
       int err;
 
       /* Use the mutex to guarantee that if another thread is already calling
-        the initfunction, this thread waits until it's finished.  */
+         the initfunction, this thread waits until it's finished.  */
       err = mutex_lock (&once_control->mutex);
       if (err != 0)
-       return err;
+        return err;
       if (!once_control->inited)
-       {
-         once_control->inited = 1;
-         initfunction ();
-       }
+        {
+          once_control->inited = 1;
+          initfunction ();
+        }
       return mutex_unlock (&once_control->mutex);
     }
   else
@@ -647,13 +647,13 @@ glthread_lock_lock_func (gl_lock_t *lock)
   if (!lock->guard.done)
     {
       if (InterlockedIncrement (&lock->guard.started) == 0)
-       /* This thread is the first one to need this lock.  Initialize it.  */
-       glthread_lock_init (lock);
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glthread_lock_init (lock);
       else
-       /* Yield the CPU while waiting for another thread to finish
-          initializing this lock.  */
-       while (!lock->guard.done)
-         Sleep (0);
+        /* Yield the CPU while waiting for another thread to finish
+           initializing this lock.  */
+        while (!lock->guard.done)
+          Sleep (0);
     }
   EnterCriticalSection (&lock->lock);
   return 0;
@@ -704,28 +704,28 @@ gl_waitqueue_add (gl_waitqueue_t *wq)
     {
       unsigned int new_alloc = 2 * wq->alloc + 1;
       HANDLE *new_array =
-       (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
+        (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
       if (new_array == NULL)
-       /* No more memory.  */
-       return INVALID_HANDLE_VALUE;
+        /* No more memory.  */
+        return INVALID_HANDLE_VALUE;
       /* Now is a good opportunity to rotate the array so that its contents
-        starts at offset 0.  */
+         starts at offset 0.  */
       if (wq->offset > 0)
-       {
-         unsigned int old_count = wq->count;
-         unsigned int old_alloc = wq->alloc;
-         unsigned int old_offset = wq->offset;
-         unsigned int i;
-         if (old_offset + old_count > old_alloc)
-           {
-             unsigned int limit = old_offset + old_count - old_alloc;
-             for (i = 0; i < limit; i++)
-               new_array[old_alloc + i] = new_array[i];
-           }
-         for (i = 0; i < old_count; i++)
-           new_array[i] = new_array[old_offset + i];
-         wq->offset = 0;
-       }
+        {
+          unsigned int old_count = wq->count;
+          unsigned int old_alloc = wq->alloc;
+          unsigned int old_offset = wq->offset;
+          unsigned int i;
+          if (old_offset + old_count > old_alloc)
+            {
+              unsigned int limit = old_offset + old_count - old_alloc;
+              for (i = 0; i < limit; i++)
+                new_array[old_alloc + i] = new_array[i];
+            }
+          for (i = 0; i < old_count; i++)
+            new_array[i] = new_array[old_offset + i];
+          wq->offset = 0;
+        }
       wq->array = new_array;
       wq->alloc = new_alloc;
     }
@@ -764,7 +764,7 @@ gl_waitqueue_notify_all (gl_waitqueue_t *wq)
     {
       unsigned int index = wq->offset + i;
       if (index >= wq->alloc)
-       index -= wq->alloc;
+        index -= wq->alloc;
       SetEvent (wq->array[index]);
     }
   wq->count = 0;
@@ -787,13 +787,13 @@ glthread_rwlock_rdlock_func (gl_rwlock_t *lock)
   if (!lock->guard.done)
     {
       if (InterlockedIncrement (&lock->guard.started) == 0)
-       /* This thread is the first one to need this lock.  Initialize it.  */
-       glthread_rwlock_init (lock);
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glthread_rwlock_init (lock);
       else
-       /* Yield the CPU while waiting for another thread to finish
-          initializing this lock.  */
-       while (!lock->guard.done)
-         Sleep (0);
+        /* Yield the CPU while waiting for another thread to finish
+           initializing this lock.  */
+        while (!lock->guard.done)
+          Sleep (0);
     }
   EnterCriticalSection (&lock->lock);
   /* Test whether only readers are currently running, and whether the runcount
@@ -801,34 +801,34 @@ glthread_rwlock_rdlock_func (gl_rwlock_t *lock)
   if (!(lock->runcount + 1 > 0))
     {
       /* This thread has to wait for a while.  Enqueue it among the
-        waiting_readers.  */
+         waiting_readers.  */
       HANDLE event = gl_waitqueue_add (&lock->waiting_readers);
       if (event != INVALID_HANDLE_VALUE)
-       {
-         DWORD result;
-         LeaveCriticalSection (&lock->lock);
-         /* Wait until another thread signals this event.  */
-         result = WaitForSingleObject (event, INFINITE);
-         if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
-           abort ();
-         CloseHandle (event);
-         /* The thread which signalled the event already did the bookkeeping:
-            removed us from the waiting_readers, incremented lock->runcount.  */
-         if (!(lock->runcount > 0))
-           abort ();
-         return 0;
-       }
+        {
+          DWORD result;
+          LeaveCriticalSection (&lock->lock);
+          /* Wait until another thread signals this event.  */
+          result = WaitForSingleObject (event, INFINITE);
+          if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+            abort ();
+          CloseHandle (event);
+          /* The thread which signalled the event already did the bookkeeping:
+             removed us from the waiting_readers, incremented lock->runcount.  */
+          if (!(lock->runcount > 0))
+            abort ();
+          return 0;
+        }
       else
-       {
-         /* Allocation failure.  Weird.  */
-         do
-           {
-             LeaveCriticalSection (&lock->lock);
-             Sleep (1);
-             EnterCriticalSection (&lock->lock);
-           }
-         while (!(lock->runcount + 1 > 0));
-       }
+        {
+          /* Allocation failure.  Weird.  */
+          do
+            {
+              LeaveCriticalSection (&lock->lock);
+              Sleep (1);
+              EnterCriticalSection (&lock->lock);
+            }
+          while (!(lock->runcount + 1 > 0));
+        }
     }
   lock->runcount++;
   LeaveCriticalSection (&lock->lock);
@@ -841,47 +841,47 @@ glthread_rwlock_wrlock_func (gl_rwlock_t *lock)
   if (!lock->guard.done)
     {
       if (InterlockedIncrement (&lock->guard.started) == 0)
-       /* This thread is the first one to need this lock.  Initialize it.  */
-       glthread_rwlock_init (lock);
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glthread_rwlock_init (lock);
       else
-       /* Yield the CPU while waiting for another thread to finish
-          initializing this lock.  */
-       while (!lock->guard.done)
-         Sleep (0);
+        /* Yield the CPU while waiting for another thread to finish
+           initializing this lock.  */
+        while (!lock->guard.done)
+          Sleep (0);
     }
   EnterCriticalSection (&lock->lock);
   /* Test whether no readers or writers are currently running.  */
   if (!(lock->runcount == 0))
     {
       /* This thread has to wait for a while.  Enqueue it among the
-        waiting_writers.  */
+         waiting_writers.  */
       HANDLE event = gl_waitqueue_add (&lock->waiting_writers);
       if (event != INVALID_HANDLE_VALUE)
-       {
-         DWORD result;
-         LeaveCriticalSection (&lock->lock);
-         /* Wait until another thread signals this event.  */
-         result = WaitForSingleObject (event, INFINITE);
-         if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
-           abort ();
-         CloseHandle (event);
-         /* The thread which signalled the event already did the bookkeeping:
-            removed us from the waiting_writers, set lock->runcount = -1.  */
-         if (!(lock->runcount == -1))
-           abort ();
-         return 0;
-       }
+        {
+          DWORD result;
+          LeaveCriticalSection (&lock->lock);
+          /* Wait until another thread signals this event.  */
+          result = WaitForSingleObject (event, INFINITE);
+          if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+            abort ();
+          CloseHandle (event);
+          /* The thread which signalled the event already did the bookkeeping:
+             removed us from the waiting_writers, set lock->runcount = -1.  */
+          if (!(lock->runcount == -1))
+            abort ();
+          return 0;
+        }
       else
-       {
-         /* Allocation failure.  Weird.  */
-         do
-           {
-             LeaveCriticalSection (&lock->lock);
-             Sleep (1);
-             EnterCriticalSection (&lock->lock);
-           }
-         while (!(lock->runcount == 0));
-       }
+        {
+          /* Allocation failure.  Weird.  */
+          do
+            {
+              LeaveCriticalSection (&lock->lock);
+              Sleep (1);
+              EnterCriticalSection (&lock->lock);
+            }
+          while (!(lock->runcount == 0));
+        }
     }
   lock->runcount--; /* runcount becomes -1 */
   LeaveCriticalSection (&lock->lock);
@@ -898,35 +898,35 @@ glthread_rwlock_unlock_func (gl_rwlock_t *lock)
     {
       /* Drop a writer lock.  */
       if (!(lock->runcount == -1))
-       abort ();
+        abort ();
       lock->runcount = 0;
     }
   else
     {
       /* Drop a reader lock.  */
       if (!(lock->runcount > 0))
-       {
-         LeaveCriticalSection (&lock->lock);
-         return EPERM;
-       }
+        {
+          LeaveCriticalSection (&lock->lock);
+          return EPERM;
+        }
       lock->runcount--;
     }
   if (lock->runcount == 0)
     {
       /* POSIX recommends that "write locks shall take precedence over read
-        locks", to avoid "writer starvation".  */
+         locks", to avoid "writer starvation".  */
       if (lock->waiting_writers.count > 0)
-       {
-         /* Wake up one of the waiting writers.  */
-         lock->runcount--;
-         gl_waitqueue_notify_first (&lock->waiting_writers);
-       }
+        {
+          /* Wake up one of the waiting writers.  */
+          lock->runcount--;
+          gl_waitqueue_notify_first (&lock->waiting_writers);
+        }
       else
-       {
-         /* Wake up all waiting readers.  */
-         lock->runcount += lock->waiting_readers.count;
-         gl_waitqueue_notify_all (&lock->waiting_readers);
-       }
+        {
+          /* Wake up all waiting readers.  */
+          lock->runcount += lock->waiting_readers.count;
+          gl_waitqueue_notify_all (&lock->waiting_readers);
+        }
     }
   LeaveCriticalSection (&lock->lock);
   return 0;
@@ -965,25 +965,25 @@ glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock)
   if (!lock->guard.done)
     {
       if (InterlockedIncrement (&lock->guard.started) == 0)
-       /* This thread is the first one to need this lock.  Initialize it.  */
-       glthread_recursive_lock_init (lock);
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glthread_recursive_lock_init (lock);
       else
-       /* Yield the CPU while waiting for another thread to finish
-          initializing this lock.  */
-       while (!lock->guard.done)
-         Sleep (0);
+        /* Yield the CPU while waiting for another thread to finish
+           initializing this lock.  */
+        while (!lock->guard.done)
+          Sleep (0);
     }
   {
     DWORD self = GetCurrentThreadId ();
     if (lock->owner != self)
       {
-       EnterCriticalSection (&lock->lock);
-       lock->owner = self;
+        EnterCriticalSection (&lock->lock);
+        lock->owner = self;
       }
     if (++(lock->depth) == 0) /* wraparound? */
       {
-       lock->depth--;
-       return EAGAIN;
+        lock->depth--;
+        return EAGAIN;
       }
   }
   return 0;
@@ -1022,34 +1022,34 @@ glthread_once_func (gl_once_t *once_control, void (*initfunction) (void))
   if (once_control->inited <= 0)
     {
       if (InterlockedIncrement (&once_control->started) == 0)
-       {
-         /* This thread is the first one to come to this once_control.  */
-         InitializeCriticalSection (&once_control->lock);
-         EnterCriticalSection (&once_control->lock);
-         once_control->inited = 0;
-         initfunction ();
-         once_control->inited = 1;
-         LeaveCriticalSection (&once_control->lock);
-       }
+        {
+          /* This thread is the first one to come to this once_control.  */
+          InitializeCriticalSection (&once_control->lock);
+          EnterCriticalSection (&once_control->lock);
+          once_control->inited = 0;
+          initfunction ();
+          once_control->inited = 1;
+          LeaveCriticalSection (&once_control->lock);
+        }
       else
-       {
-         /* Undo last operation.  */
-         InterlockedDecrement (&once_control->started);
-         /* Some other thread has already started the initialization.
-            Yield the CPU while waiting for the other thread to finish
-            initializing and taking the lock.  */
-         while (once_control->inited < 0)
-           Sleep (0);
-         if (once_control->inited <= 0)
-           {
-             /* Take the lock.  This blocks until the other thread has
-                finished calling the initfunction.  */
-             EnterCriticalSection (&once_control->lock);
-             LeaveCriticalSection (&once_control->lock);
-             if (!(once_control->inited > 0))
-               abort ();
-           }
-       }
+        {
+          /* Undo last operation.  */
+          InterlockedDecrement (&once_control->started);
+          /* Some other thread has already started the initialization.
+             Yield the CPU while waiting for the other thread to finish
+             initializing and taking the lock.  */
+          while (once_control->inited < 0)
+            Sleep (0);
+          if (once_control->inited <= 0)
+            {
+              /* Take the lock.  This blocks until the other thread has
+                 finished calling the initfunction.  */
+              EnterCriticalSection (&once_control->lock);
+              LeaveCriticalSection (&once_control->lock);
+              if (!(once_control->inited > 0))
+                abort ();
+            }
+        }
     }
 }
 
index 282a22b660098e02d81b85379e362c8620f9b180..b0bb804dce62bc501e8b9a4dd1181416a7aff778 100644 (file)
@@ -1,9 +1,9 @@
 /* Locking in multithreaded situations.
-   Copyright (C) 2005-2008 Free Software Foundation, Inc.
+   Copyright (C) 2005-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -418,11 +418,11 @@ typedef pth_mutex_t gl_lock_t;
 # define gl_lock_initializer \
     PTH_MUTEX_INIT
 # define glthread_lock_init(LOCK) \
-    (pth_in_use() && !pth_mutex_init (LOCK) ? errno : 0)
+    (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
 # define glthread_lock_lock(LOCK) \
-    (pth_in_use() && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
+    (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
 # define glthread_lock_unlock(LOCK) \
-    (pth_in_use() && !pth_mutex_release (LOCK) ? errno : 0)
+    (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
 # define glthread_lock_destroy(LOCK) \
     ((void)(LOCK), 0)
 
@@ -436,13 +436,13 @@ typedef pth_rwlock_t gl_rwlock_t;
 #  define gl_rwlock_initializer \
      PTH_RWLOCK_INIT
 #  define glthread_rwlock_init(LOCK) \
-     (pth_in_use() && !pth_rwlock_init (LOCK) ? errno : 0)
+     (pth_in_use () && !pth_rwlock_init (LOCK) ? errno : 0)
 #  define glthread_rwlock_rdlock(LOCK) \
-     (pth_in_use() && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RD, 0, NULL) ? errno : 0)
+     (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RD, 0, NULL) ? errno : 0)
 #  define glthread_rwlock_wrlock(LOCK) \
-     (pth_in_use() && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RW, 0, NULL) ? errno : 0)
+     (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RW, 0, NULL) ? errno : 0)
 #  define glthread_rwlock_unlock(LOCK) \
-     (pth_in_use() && !pth_rwlock_release (LOCK) ? errno : 0)
+     (pth_in_use () && !pth_rwlock_release (LOCK) ? errno : 0)
 #  define glthread_rwlock_destroy(LOCK) \
      ((void)(LOCK), 0)
 
@@ -457,11 +457,11 @@ typedef pth_mutex_t gl_recursive_lock_t;
 #  define gl_recursive_lock_initializer \
      PTH_MUTEX_INIT
 #  define glthread_recursive_lock_init(LOCK) \
-     (pth_in_use() && !pth_mutex_init (LOCK) ? errno : 0)
+     (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
 #  define glthread_recursive_lock_lock(LOCK) \
-     (pth_in_use() && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
+     (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
 #  define glthread_recursive_lock_unlock(LOCK) \
-     (pth_in_use() && !pth_mutex_release (LOCK) ? errno : 0)
+     (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
 #  define glthread_recursive_lock_destroy(LOCK) \
      ((void)(LOCK), 0)
 
index 791c430943db83b542c46aeac08f546412b7dd37..292e6a5dc4399cd8517d6ac87e9111bf5daa1971 100644 (file)
@@ -1,9 +1,9 @@
 /* Multithreading primitives.
-   Copyright (C) 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -48,16 +48,16 @@ glthread_in_use (void)
       pthread_t thread;
 
       if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
-       /* Thread creation failed.  */
-       result = 0;
+        /* Thread creation failed.  */
+        result = 0;
       else
-       {
-         /* Thread creation works.  */
-         void *retval;
-         if (pthread_join (thread, &retval) != 0)
-           abort ();
-         result = 1;
-       }
+        {
+          /* Thread creation works.  */
+          void *retval;
+          if (pthread_join (thread, &retval) != 0)
+            abort ();
+          result = 1;
+        }
       tested = 1;
     }
   return result;
index 16eb109210e2e59658073c9576096eb9eb8d659a..baaa23f85655a6eab253a96fc05db261ce7a05ea 100644 (file)
@@ -1,10 +1,10 @@
 /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
 
-   Copyright (C) 2005, 2006, 2008  Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 #include <string.h>
 #include <errno.h>
 
-#ifndef EAFNOSUPPORT
-# define EAFNOSUPPORT EINVAL
-#endif
-
 #define NS_IN6ADDRSZ 16
 #define NS_INT16SZ 2
 
@@ -63,15 +59,15 @@ static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t si
 
 /* char *
  * inet_ntop(af, src, dst, size)
- *     convert a network format address to presentation format.
+ *      convert a network format address to presentation format.
  * return:
- *     pointer to presentation format address (`dst'), or NULL (see errno).
+ *      pointer to presentation format address (`dst'), or NULL (see errno).
  * author:
- *     Paul Vixie, 1996.
+ *      Paul Vixie, 1996.
  */
 const char *
 inet_ntop (int af, const void *restrict src,
-          char *restrict dst, socklen_t cnt)
+           char *restrict dst, socklen_t cnt)
 {
   switch (af)
     {
@@ -94,14 +90,14 @@ inet_ntop (int af, const void *restrict src,
 
 /* const char *
  * inet_ntop4(src, dst, size)
- *     format an IPv4 address
+ *      format an IPv4 address
  * return:
- *     `dst' (as a const)
+ *      `dst' (as a const)
  * notes:
- *     (1) uses no statics
- *     (2) takes a u_char* not an in_addr as input
+ *      (1) uses no statics
+ *      (2) takes a u_char* not an in_addr as input
  * author:
- *     Paul Vixie, 1996.
+ *      Paul Vixie, 1996.
  */
 static const char *
 inet_ntop4 (const unsigned char *src, char *dst, socklen_t size)
@@ -126,9 +122,9 @@ inet_ntop4 (const unsigned char *src, char *dst, socklen_t size)
 
 /* const char *
  * inet_ntop6(src, dst, size)
- *     convert IPv6 binary address into presentation (printable) format
+ *      convert IPv6 binary address into presentation (printable) format
  * author:
- *     Paul Vixie, 1996.
+ *      Paul Vixie, 1996.
  */
 static const char *
 inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
@@ -161,26 +157,26 @@ inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
   for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
     {
       if (words[i] == 0)
-       {
-         if (cur.base == -1)
-           cur.base = i, cur.len = 1;
-         else
-           cur.len++;
-       }
+        {
+          if (cur.base == -1)
+            cur.base = i, cur.len = 1;
+          else
+            cur.len++;
+        }
       else
-       {
-         if (cur.base != -1)
-           {
-             if (best.base == -1 || cur.len > best.len)
-               best = cur;
-             cur.base = -1;
-           }
-       }
+        {
+          if (cur.base != -1)
+            {
+              if (best.base == -1 || cur.len > best.len)
+                best = cur;
+              cur.base = -1;
+            }
+        }
     }
   if (cur.base != -1)
     {
       if (best.base == -1 || cur.len > best.len)
-       best = cur;
+        best = cur;
     }
   if (best.base != -1 && best.len < 2)
     best.base = -1;
@@ -193,28 +189,28 @@ inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
     {
       /* Are we inside the best run of 0x00's? */
       if (best.base != -1 && i >= best.base && i < (best.base + best.len))
-       {
-         if (i == best.base)
-           *tp++ = ':';
-         continue;
-       }
+        {
+          if (i == best.base)
+            *tp++ = ':';
+          continue;
+        }
       /* Are we following an initial run of 0x00s or any real hex? */
       if (i != 0)
-       *tp++ = ':';
+        *tp++ = ':';
       /* Is this address an encapsulated IPv4? */
       if (i == 6 && best.base == 0 &&
-         (best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
-       {
-         if (!inet_ntop4 (src + 12, tp, sizeof tmp - (tp - tmp)))
-           return (NULL);
-         tp += strlen (tp);
-         break;
-       }
+          (best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
+        {
+          if (!inet_ntop4 (src + 12, tp, sizeof tmp - (tp - tmp)))
+            return (NULL);
+          tp += strlen (tp);
+          break;
+        }
       {
-       int len = sprintf (tp, "%x", words[i]);
-       if (len < 0)
-         return NULL;
-       tp += len;
+        int len = sprintf (tp, "%x", words[i]);
+        if (len < 0)
+          return NULL;
+        tp += len;
       }
     }
   /* Was it a trailing run of 0x00's? */
diff --git a/gnulib/inet_pton.c b/gnulib/inet_pton.c
new file mode 100644 (file)
index 0000000..d8a2dee
--- /dev/null
@@ -0,0 +1,253 @@
+/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
+
+   Copyright (C) 2006, 2008, 2009, 2010 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 3 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, see <http://www.gnu.org/licenses/>.  */
+
+/*
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include <config.h>
+
+/* Specification.  */
+#include <arpa/inet.h>
+
+#include <c-ctype.h>
+#include <string.h>
+#include <errno.h>
+
+#define NS_INADDRSZ 4
+#define NS_IN6ADDRSZ 16
+#define NS_INT16SZ 2
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static int inet_pton4 (const char *src, unsigned char *dst);
+#if HAVE_IPV6
+static int inet_pton6 (const char *src, unsigned char *dst);
+#endif
+
+/* int
+ * inet_pton(af, src, dst)
+ *      convert from presentation format (which usually means ASCII printable)
+ *      to network format (which is usually some kind of binary format).
+ * return:
+ *      1 if the address was valid for the specified address family
+ *      0 if the address wasn't valid (`dst' is untouched in this case)
+ *      -1 if some other error occurred (`dst' is untouched in this case, too)
+ * author:
+ *      Paul Vixie, 1996.
+ */
+int
+inet_pton (int af, const char *restrict src, void *restrict dst)
+{
+  switch (af)
+    {
+    case AF_INET:
+      return (inet_pton4 (src, dst));
+
+#if HAVE_IPV6
+    case AF_INET6:
+      return (inet_pton6 (src, dst));
+#endif
+
+    default:
+      errno = EAFNOSUPPORT;
+      return (-1);
+    }
+  /* NOTREACHED */
+}
+
+/* int
+ * inet_pton4(src, dst)
+ *      like inet_aton() but without all the hexadecimal, octal (with the
+ *      exception of 0) and shorthand.
+ * return:
+ *      1 if `src' is a valid dotted quad, else 0.
+ * notice:
+ *      does not touch `dst' unless it's returning 1.
+ * author:
+ *      Paul Vixie, 1996.
+ */
+static int
+inet_pton4 (const char *restrict src, unsigned char *restrict dst)
+{
+  int saw_digit, octets, ch;
+  unsigned char tmp[NS_INADDRSZ], *tp;
+
+  saw_digit = 0;
+  octets = 0;
+  *(tp = tmp) = 0;
+  while ((ch = *src++) != '\0')
+    {
+
+      if (ch >= '0' && ch <= '9')
+        {
+          unsigned new = *tp * 10 + (ch - '0');
+
+          if (saw_digit && *tp == 0)
+            return (0);
+          if (new > 255)
+            return (0);
+          *tp = new;
+          if (!saw_digit)
+            {
+              if (++octets > 4)
+                return (0);
+              saw_digit = 1;
+            }
+        }
+      else if (ch == '.' && saw_digit)
+        {
+          if (octets == 4)
+            return (0);
+          *++tp = 0;
+          saw_digit = 0;
+        }
+      else
+        return (0);
+    }
+  if (octets < 4)
+    return (0);
+  memcpy (dst, tmp, NS_INADDRSZ);
+  return (1);
+}
+
+#if HAVE_IPV6
+
+/* int
+ * inet_pton6(src, dst)
+ *      convert presentation level address to network order binary form.
+ * return:
+ *      1 if `src' is a valid [RFC1884 2.2] address, else 0.
+ * notice:
+ *      (1) does not touch `dst' unless it's returning 1.
+ *      (2) :: in a full address is silently ignored.
+ * credit:
+ *      inspired by Mark Andrews.
+ * author:
+ *      Paul Vixie, 1996.
+ */
+static int
+inet_pton6 (const char *restrict src, unsigned char *restrict dst)
+{
+  static const char xdigits[] = "0123456789abcdef";
+  unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+  const char *curtok;
+  int ch, saw_xdigit;
+  unsigned val;
+
+  tp = memset (tmp, '\0', NS_IN6ADDRSZ);
+  endp = tp + NS_IN6ADDRSZ;
+  colonp = NULL;
+  /* Leading :: requires some special handling. */
+  if (*src == ':')
+    if (*++src != ':')
+      return (0);
+  curtok = src;
+  saw_xdigit = 0;
+  val = 0;
+  while ((ch = c_tolower (*src++)) != '\0')
+    {
+      const char *pch;
+
+      pch = strchr (xdigits, ch);
+      if (pch != NULL)
+        {
+          val <<= 4;
+          val |= (pch - xdigits);
+          if (val > 0xffff)
+            return (0);
+          saw_xdigit = 1;
+          continue;
+        }
+      if (ch == ':')
+        {
+          curtok = src;
+          if (!saw_xdigit)
+            {
+              if (colonp)
+                return (0);
+              colonp = tp;
+              continue;
+            }
+          else if (*src == '\0')
+            {
+              return (0);
+            }
+          if (tp + NS_INT16SZ > endp)
+            return (0);
+          *tp++ = (u_char) (val >> 8) & 0xff;
+          *tp++ = (u_char) val & 0xff;
+          saw_xdigit = 0;
+          val = 0;
+          continue;
+        }
+      if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
+          inet_pton4 (curtok, tp) > 0)
+        {
+          tp += NS_INADDRSZ;
+          saw_xdigit = 0;
+          break;                /* '\0' was seen by inet_pton4(). */
+        }
+      return (0);
+    }
+  if (saw_xdigit)
+    {
+      if (tp + NS_INT16SZ > endp)
+        return (0);
+      *tp++ = (u_char) (val >> 8) & 0xff;
+      *tp++ = (u_char) val & 0xff;
+    }
+  if (colonp != NULL)
+    {
+      /*
+       * Since some memmove()'s erroneously fail to handle
+       * overlapping regions, we'll do the shift by hand.
+       */
+      const int n = tp - colonp;
+      int i;
+
+      if (tp == endp)
+        return (0);
+      for (i = 1; i <= n; i++)
+        {
+          endp[-i] = colonp[n - i];
+          colonp[n - i] = 0;
+        }
+      tp = endp;
+    }
+  if (tp != endp)
+    return (0);
+  memcpy (dst, tmp, NS_IN6ADDRSZ);
+  return (1);
+}
+#endif
diff --git a/gnulib/langinfo.in.h b/gnulib/langinfo.in.h
new file mode 100644 (file)
index 0000000..0865d96
--- /dev/null
@@ -0,0 +1,162 @@
+/* Substitute for and wrapper around <langinfo.h>.
+   Copyright (C) 2009, 2010 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 3, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/*
+ * POSIX <langinfo.h> for platforms that lack it or have an incomplete one.
+ * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>
+ */
+
+#ifndef _GL_LANGINFO_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
+/* The include_next requires a split double-inclusion guard.  */
+#if @HAVE_LANGINFO_H@
+# @INCLUDE_NEXT@ @NEXT_LANGINFO_H@
+#endif
+
+#ifndef _GL_LANGINFO_H
+#define _GL_LANGINFO_H
+
+
+#if !@HAVE_LANGINFO_H@
+
+/* A platform that lacks <langinfo.h>.  */
+
+/* Assume that it also lacks <nl_types.h> and the nl_item type.  */
+typedef int nl_item;
+
+/* nl_langinfo items of the LC_CTYPE category */
+# define CODESET     10000
+/* nl_langinfo items of the LC_NUMERIC category */
+# define RADIXCHAR   10001
+# define THOUSEP     10002
+/* nl_langinfo items of the LC_TIME category */
+# define D_T_FMT     10003
+# define D_FMT       10004
+# define T_FMT       10005
+# define T_FMT_AMPM  10006
+# define AM_STR      10007
+# define PM_STR      10008
+# define DAY_1       10009
+# define DAY_2       (DAY_1 + 1)
+# define DAY_3       (DAY_1 + 2)
+# define DAY_4       (DAY_1 + 3)
+# define DAY_5       (DAY_1 + 4)
+# define DAY_6       (DAY_1 + 5)
+# define DAY_7       (DAY_1 + 6)
+# define ABDAY_1     10016
+# define ABDAY_2     (ABDAY_1 + 1)
+# define ABDAY_3     (ABDAY_1 + 2)
+# define ABDAY_4     (ABDAY_1 + 3)
+# define ABDAY_5     (ABDAY_1 + 4)
+# define ABDAY_6     (ABDAY_1 + 5)
+# define ABDAY_7     (ABDAY_1 + 6)
+# define MON_1       10023
+# define MON_2       (MON_1 + 1)
+# define MON_3       (MON_1 + 2)
+# define MON_4       (MON_1 + 3)
+# define MON_5       (MON_1 + 4)
+# define MON_6       (MON_1 + 5)
+# define MON_7       (MON_1 + 6)
+# define MON_8       (MON_1 + 7)
+# define MON_9       (MON_1 + 8)
+# define MON_10      (MON_1 + 9)
+# define MON_11      (MON_1 + 10)
+# define MON_12      (MON_1 + 11)
+# define ABMON_1     10035
+# define ABMON_2     (ABMON_1 + 1)
+# define ABMON_3     (ABMON_1 + 2)
+# define ABMON_4     (ABMON_1 + 3)
+# define ABMON_5     (ABMON_1 + 4)
+# define ABMON_6     (ABMON_1 + 5)
+# define ABMON_7     (ABMON_1 + 6)
+# define ABMON_8     (ABMON_1 + 7)
+# define ABMON_9     (ABMON_1 + 8)
+# define ABMON_10    (ABMON_1 + 9)
+# define ABMON_11    (ABMON_1 + 10)
+# define ABMON_12    (ABMON_1 + 11)
+# define ERA         10047
+# define ERA_D_FMT   10048
+# define ERA_D_T_FMT 10049
+# define ERA_T_FMT   10050
+# define ALT_DIGITS  10051
+/* nl_langinfo items of the LC_MONETARY category */
+# define CRNCYSTR    10052
+/* nl_langinfo items of the LC_MESSAGES category */
+# define YESEXPR     10053
+# define NOEXPR      10054
+
+#else
+
+/* A platform that has <langinfo.h>.  */
+
+# if !@HAVE_LANGINFO_CODESET@
+#  define CODESET     10000
+#  define GNULIB_defined_CODESET 1
+# endif
+
+# if !@HAVE_LANGINFO_ERA@
+#  define ERA         10047
+#  define ERA_D_FMT   10048
+#  define ERA_D_T_FMT 10049
+#  define ERA_T_FMT   10050
+#  define ALT_DIGITS  10051
+#  define GNULIB_defined_ERA 1
+# endif
+
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+/* Declare overridden functions.  */
+
+
+/* Return a piece of locale dependent information.
+   Note: The difference between nl_langinfo (CODESET) and locale_charset ()
+   is that the latter normalizes the encoding names to GNU conventions.  */
+
+#if @GNULIB_NL_LANGINFO@
+# if @REPLACE_NL_LANGINFO@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef nl_langinfo
+#   define nl_langinfo rpl_nl_langinfo
+#  endif
+_GL_FUNCDECL_RPL (nl_langinfo, char *, (nl_item item));
+_GL_CXXALIAS_RPL (nl_langinfo, char *, (nl_item item));
+# else
+#  if !@HAVE_NL_LANGINFO@
+_GL_FUNCDECL_SYS (nl_langinfo, char *, (nl_item item));
+#  endif
+_GL_CXXALIAS_SYS (nl_langinfo, char *, (nl_item item));
+# endif
+_GL_CXXALIASWARN (nl_langinfo);
+#elif defined GNULIB_POSIXCHECK
+# undef nl_langinfo
+# if HAVE_RAW_DECL_NL_LANGINFO
+_GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - "
+                 "use gnulib module nl_langinfo for portability");
+# endif
+#endif
+
+
+#endif /* _GL_LANGINFO_H */
+#endif /* _GL_LANGINFO_H */
index 1ff46052d757089ce020dbd65afaef7c3b7923ef..fa2207fe14e0aa5b585804793c12d9b4a4a0f096 100644 (file)
@@ -1,10 +1,10 @@
 /* Determine a canonical name for the current locale's character encoding.
 
-   Copyright (C) 2000-2006, 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2000-2006, 2008-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -23,6 +23,7 @@
 /* Specification.  */
 #include "localcharset.h"
 
+#include <fcntl.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
@@ -44,6 +45,7 @@
 #endif
 
 #if !defined WIN32_NATIVE
+# include <unistd.h>
 # if HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
 # else
 # include "configmake.h"
 #endif
 
+/* Define O_NOFOLLOW to 0 on platforms where it does not exist.  */
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW 0
+#endif
+
 #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
   /* Win32, Cygwin, OS/2, DOS */
 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
@@ -117,192 +124,219 @@ get_charset_aliases (void)
   if (cp == NULL)
     {
 #if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
-      FILE *fp;
       const char *dir;
       const char *base = "charset.alias";
       char *file_name;
 
       /* Make it possible to override the charset.alias location.  This is
-        necessary for running the testsuite before "make install".  */
+         necessary for running the testsuite before "make install".  */
       dir = getenv ("CHARSETALIASDIR");
       if (dir == NULL || dir[0] == '\0')
-       dir = relocate (LIBDIR);
+        dir = relocate (LIBDIR);
 
       /* Concatenate dir and base into freshly allocated file_name.  */
       {
-       size_t dir_len = strlen (dir);
-       size_t base_len = strlen (base);
-       int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
-       file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
-       if (file_name != NULL)
-         {
-           memcpy (file_name, dir, dir_len);
-           if (add_slash)
-             file_name[dir_len] = DIRECTORY_SEPARATOR;
-           memcpy (file_name + dir_len + add_slash, base, base_len + 1);
-         }
+        size_t dir_len = strlen (dir);
+        size_t base_len = strlen (base);
+        int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
+        file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
+        if (file_name != NULL)
+          {
+            memcpy (file_name, dir, dir_len);
+            if (add_slash)
+              file_name[dir_len] = DIRECTORY_SEPARATOR;
+            memcpy (file_name + dir_len + add_slash, base, base_len + 1);
+          }
       }
 
-      if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
-       /* Out of memory or file not found, treat it as empty.  */
-       cp = "";
+      if (file_name == NULL)
+        /* Out of memory.  Treat the file as empty.  */
+        cp = "";
       else
-       {
-         /* Parse the file's contents.  */
-         char *res_ptr = NULL;
-         size_t res_size = 0;
-
-         for (;;)
-           {
-             int c;
-             char buf1[50+1];
-             char buf2[50+1];
-             size_t l1, l2;
-             char *old_res_ptr;
-
-             c = getc (fp);
-             if (c == EOF)
-               break;
-             if (c == '\n' || c == ' ' || c == '\t')
-               continue;
-             if (c == '#')
-               {
-                 /* Skip comment, to end of line.  */
-                 do
-                   c = getc (fp);
-                 while (!(c == EOF || c == '\n'));
-                 if (c == EOF)
-                   break;
-                 continue;
-               }
-             ungetc (c, fp);
-             if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
-               break;
-             l1 = strlen (buf1);
-             l2 = strlen (buf2);
-             old_res_ptr = res_ptr;
-             if (res_size == 0)
-               {
-                 res_size = l1 + 1 + l2 + 1;
-                 res_ptr = (char *) malloc (res_size + 1);
-               }
-             else
-               {
-                 res_size += l1 + 1 + l2 + 1;
-                 res_ptr = (char *) realloc (res_ptr, res_size + 1);
-               }
-             if (res_ptr == NULL)
-               {
-                 /* Out of memory. */
-                 res_size = 0;
-                 if (old_res_ptr != NULL)
-                   free (old_res_ptr);
-                 break;
-               }
-             strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
-             strcpy (res_ptr + res_size - (l2 + 1), buf2);
-           }
-         fclose (fp);
-         if (res_size == 0)
-           cp = "";
-         else
-           {
-             *(res_ptr + res_size) = '\0';
-             cp = res_ptr;
-           }
-       }
-
-      if (file_name != NULL)
-       free (file_name);
+        {
+          int fd;
+
+          /* Open the file.  Reject symbolic links on platforms that support
+             O_NOFOLLOW.  This is a security feature.  Without it, an attacker
+             could retrieve parts of the contents (namely, the tail of the
+             first line that starts with "* ") of an arbitrary file by placing
+             a symbolic link to that file under the name "charset.alias" in
+             some writable directory and defining the environment variable
+             CHARSETALIASDIR to point to that directory.  */
+          fd = open (file_name,
+                     O_RDONLY | (HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0));
+          if (fd < 0)
+            /* File not found.  Treat it as empty.  */
+            cp = "";
+          else
+            {
+              FILE *fp;
+
+              fp = fdopen (fd, "r");
+              if (fp == NULL)
+                {
+                  /* Out of memory.  Treat the file as empty.  */
+                  close (fd);
+                  cp = "";
+                }
+              else
+                {
+                  /* Parse the file's contents.  */
+                  char *res_ptr = NULL;
+                  size_t res_size = 0;
+
+                  for (;;)
+                    {
+                      int c;
+                      char buf1[50+1];
+                      char buf2[50+1];
+                      size_t l1, l2;
+                      char *old_res_ptr;
+
+                      c = getc (fp);
+                      if (c == EOF)
+                        break;
+                      if (c == '\n' || c == ' ' || c == '\t')
+                        continue;
+                      if (c == '#')
+                        {
+                          /* Skip comment, to end of line.  */
+                          do
+                            c = getc (fp);
+                          while (!(c == EOF || c == '\n'));
+                          if (c == EOF)
+                            break;
+                          continue;
+                        }
+                      ungetc (c, fp);
+                      if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
+                        break;
+                      l1 = strlen (buf1);
+                      l2 = strlen (buf2);
+                      old_res_ptr = res_ptr;
+                      if (res_size == 0)
+                        {
+                          res_size = l1 + 1 + l2 + 1;
+                          res_ptr = (char *) malloc (res_size + 1);
+                        }
+                      else
+                        {
+                          res_size += l1 + 1 + l2 + 1;
+                          res_ptr = (char *) realloc (res_ptr, res_size + 1);
+                        }
+                      if (res_ptr == NULL)
+                        {
+                          /* Out of memory. */
+                          res_size = 0;
+                          if (old_res_ptr != NULL)
+                            free (old_res_ptr);
+                          break;
+                        }
+                      strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
+                      strcpy (res_ptr + res_size - (l2 + 1), buf2);
+                    }
+                  fclose (fp);
+                  if (res_size == 0)
+                    cp = "";
+                  else
+                    {
+                      *(res_ptr + res_size) = '\0';
+                      cp = res_ptr;
+                    }
+                }
+            }
+
+          free (file_name);
+        }
 
 #else
 
 # if defined DARWIN7
       /* To avoid the trouble of installing a file that is shared by many
-        GNU packages -- many packaging systems have problems with this --,
-        simply inline the aliases here.  */
+         GNU packages -- many packaging systems have problems with this --,
+         simply inline the aliases here.  */
       cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
-          "ISO8859-2" "\0" "ISO-8859-2" "\0"
-          "ISO8859-4" "\0" "ISO-8859-4" "\0"
-          "ISO8859-5" "\0" "ISO-8859-5" "\0"
-          "ISO8859-7" "\0" "ISO-8859-7" "\0"
-          "ISO8859-9" "\0" "ISO-8859-9" "\0"
-          "ISO8859-13" "\0" "ISO-8859-13" "\0"
-          "ISO8859-15" "\0" "ISO-8859-15" "\0"
-          "KOI8-R" "\0" "KOI8-R" "\0"
-          "KOI8-U" "\0" "KOI8-U" "\0"
-          "CP866" "\0" "CP866" "\0"
-          "CP949" "\0" "CP949" "\0"
-          "CP1131" "\0" "CP1131" "\0"
-          "CP1251" "\0" "CP1251" "\0"
-          "eucCN" "\0" "GB2312" "\0"
-          "GB2312" "\0" "GB2312" "\0"
-          "eucJP" "\0" "EUC-JP" "\0"
-          "eucKR" "\0" "EUC-KR" "\0"
-          "Big5" "\0" "BIG5" "\0"
-          "Big5HKSCS" "\0" "BIG5-HKSCS" "\0"
-          "GBK" "\0" "GBK" "\0"
-          "GB18030" "\0" "GB18030" "\0"
-          "SJIS" "\0" "SHIFT_JIS" "\0"
-          "ARMSCII-8" "\0" "ARMSCII-8" "\0"
-          "PT154" "\0" "PT154" "\0"
-        /*"ISCII-DEV" "\0" "?" "\0"*/
-          "*" "\0" "UTF-8" "\0";
+           "ISO8859-2" "\0" "ISO-8859-2" "\0"
+           "ISO8859-4" "\0" "ISO-8859-4" "\0"
+           "ISO8859-5" "\0" "ISO-8859-5" "\0"
+           "ISO8859-7" "\0" "ISO-8859-7" "\0"
+           "ISO8859-9" "\0" "ISO-8859-9" "\0"
+           "ISO8859-13" "\0" "ISO-8859-13" "\0"
+           "ISO8859-15" "\0" "ISO-8859-15" "\0"
+           "KOI8-R" "\0" "KOI8-R" "\0"
+           "KOI8-U" "\0" "KOI8-U" "\0"
+           "CP866" "\0" "CP866" "\0"
+           "CP949" "\0" "CP949" "\0"
+           "CP1131" "\0" "CP1131" "\0"
+           "CP1251" "\0" "CP1251" "\0"
+           "eucCN" "\0" "GB2312" "\0"
+           "GB2312" "\0" "GB2312" "\0"
+           "eucJP" "\0" "EUC-JP" "\0"
+           "eucKR" "\0" "EUC-KR" "\0"
+           "Big5" "\0" "BIG5" "\0"
+           "Big5HKSCS" "\0" "BIG5-HKSCS" "\0"
+           "GBK" "\0" "GBK" "\0"
+           "GB18030" "\0" "GB18030" "\0"
+           "SJIS" "\0" "SHIFT_JIS" "\0"
+           "ARMSCII-8" "\0" "ARMSCII-8" "\0"
+           "PT154" "\0" "PT154" "\0"
+         /*"ISCII-DEV" "\0" "?" "\0"*/
+           "*" "\0" "UTF-8" "\0";
 # endif
 
 # if defined VMS
       /* To avoid the troubles of an extra file charset.alias_vms in the
-        sources of many GNU packages, simply inline the aliases here.  */
+         sources of many GNU packages, simply inline the aliases here.  */
       /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
-        "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
-        section 10.7 "Handling Different Character Sets".  */
+         "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
+         section 10.7 "Handling Different Character Sets".  */
       cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
-          "ISO8859-2" "\0" "ISO-8859-2" "\0"
-          "ISO8859-5" "\0" "ISO-8859-5" "\0"
-          "ISO8859-7" "\0" "ISO-8859-7" "\0"
-          "ISO8859-8" "\0" "ISO-8859-8" "\0"
-          "ISO8859-9" "\0" "ISO-8859-9" "\0"
-          /* Japanese */
-          "eucJP" "\0" "EUC-JP" "\0"
-          "SJIS" "\0" "SHIFT_JIS" "\0"
-          "DECKANJI" "\0" "DEC-KANJI" "\0"
-          "SDECKANJI" "\0" "EUC-JP" "\0"
-          /* Chinese */
-          "eucTW" "\0" "EUC-TW" "\0"
-          "DECHANYU" "\0" "DEC-HANYU" "\0"
-          "DECHANZI" "\0" "GB2312" "\0"
-          /* Korean */
-          "DECKOREAN" "\0" "EUC-KR" "\0";
+           "ISO8859-2" "\0" "ISO-8859-2" "\0"
+           "ISO8859-5" "\0" "ISO-8859-5" "\0"
+           "ISO8859-7" "\0" "ISO-8859-7" "\0"
+           "ISO8859-8" "\0" "ISO-8859-8" "\0"
+           "ISO8859-9" "\0" "ISO-8859-9" "\0"
+           /* Japanese */
+           "eucJP" "\0" "EUC-JP" "\0"
+           "SJIS" "\0" "SHIFT_JIS" "\0"
+           "DECKANJI" "\0" "DEC-KANJI" "\0"
+           "SDECKANJI" "\0" "EUC-JP" "\0"
+           /* Chinese */
+           "eucTW" "\0" "EUC-TW" "\0"
+           "DECHANYU" "\0" "DEC-HANYU" "\0"
+           "DECHANZI" "\0" "GB2312" "\0"
+           /* Korean */
+           "DECKOREAN" "\0" "EUC-KR" "\0";
 # endif
 
 # if defined WIN32_NATIVE || defined __CYGWIN__
       /* To avoid the troubles of installing a separate file in the same
-        directory as the DLL and of retrieving the DLL's directory at
-        runtime, simply inline the aliases here.  */
+         directory as the DLL and of retrieving the DLL's directory at
+         runtime, simply inline the aliases here.  */
 
       cp = "CP936" "\0" "GBK" "\0"
-          "CP1361" "\0" "JOHAB" "\0"
-          "CP20127" "\0" "ASCII" "\0"
-          "CP20866" "\0" "KOI8-R" "\0"
-          "CP20936" "\0" "GB2312" "\0"
-          "CP21866" "\0" "KOI8-RU" "\0"
-          "CP28591" "\0" "ISO-8859-1" "\0"
-          "CP28592" "\0" "ISO-8859-2" "\0"
-          "CP28593" "\0" "ISO-8859-3" "\0"
-          "CP28594" "\0" "ISO-8859-4" "\0"
-          "CP28595" "\0" "ISO-8859-5" "\0"
-          "CP28596" "\0" "ISO-8859-6" "\0"
-          "CP28597" "\0" "ISO-8859-7" "\0"
-          "CP28598" "\0" "ISO-8859-8" "\0"
-          "CP28599" "\0" "ISO-8859-9" "\0"
-          "CP28605" "\0" "ISO-8859-15" "\0"
-          "CP38598" "\0" "ISO-8859-8" "\0"
-          "CP51932" "\0" "EUC-JP" "\0"
-          "CP51936" "\0" "GB2312" "\0"
-          "CP51949" "\0" "EUC-KR" "\0"
-          "CP51950" "\0" "EUC-TW" "\0"
-          "CP54936" "\0" "GB18030" "\0"
-          "CP65001" "\0" "UTF-8" "\0";
+           "CP1361" "\0" "JOHAB" "\0"
+           "CP20127" "\0" "ASCII" "\0"
+           "CP20866" "\0" "KOI8-R" "\0"
+           "CP20936" "\0" "GB2312" "\0"
+           "CP21866" "\0" "KOI8-RU" "\0"
+           "CP28591" "\0" "ISO-8859-1" "\0"
+           "CP28592" "\0" "ISO-8859-2" "\0"
+           "CP28593" "\0" "ISO-8859-3" "\0"
+           "CP28594" "\0" "ISO-8859-4" "\0"
+           "CP28595" "\0" "ISO-8859-5" "\0"
+           "CP28596" "\0" "ISO-8859-6" "\0"
+           "CP28597" "\0" "ISO-8859-7" "\0"
+           "CP28598" "\0" "ISO-8859-8" "\0"
+           "CP28599" "\0" "ISO-8859-9" "\0"
+           "CP28605" "\0" "ISO-8859-15" "\0"
+           "CP38598" "\0" "ISO-8859-8" "\0"
+           "CP51932" "\0" "EUC-JP" "\0"
+           "CP51936" "\0" "GB2312" "\0"
+           "CP51949" "\0" "EUC-KR" "\0"
+           "CP51950" "\0" "EUC-TW" "\0"
+           "CP54936" "\0" "GB18030" "\0"
+           "CP65001" "\0" "UTF-8" "\0";
 # endif
 #endif
 
@@ -335,10 +369,9 @@ locale_charset (void)
   codeset = nl_langinfo (CODESET);
 
 #  ifdef __CYGWIN__
-  /* Cygwin 2006 does not have locales.  nl_langinfo (CODESET) always
-     returns "US-ASCII".  As long as this is not fixed, return the suffix
-     of the locale name from the environment variables (if present) or
-     the codepage as a number.  */
+  /* Cygwin < 1.7 does not have locales.  nl_langinfo (CODESET) always
+     returns "US-ASCII".  Return the suffix of the locale name from the
+     environment variables (if present) or the codepage as a number.  */
   if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
     {
       const char *locale;
@@ -346,36 +379,46 @@ locale_charset (void)
 
       locale = getenv ("LC_ALL");
       if (locale == NULL || locale[0] == '\0')
-       {
-         locale = getenv ("LC_CTYPE");
-         if (locale == NULL || locale[0] == '\0')
-           locale = getenv ("LANG");
-       }
+        {
+          locale = getenv ("LC_CTYPE");
+          if (locale == NULL || locale[0] == '\0')
+            locale = getenv ("LANG");
+        }
       if (locale != NULL && locale[0] != '\0')
-       {
-         /* If the locale name contains an encoding after the dot, return
-            it.  */
-         const char *dot = strchr (locale, '.');
-
-         if (dot != NULL)
-           {
-             const char *modifier;
-
-             dot++;
-             /* Look for the possible @... trailer and remove it, if any.  */
-             modifier = strchr (dot, '@');
-             if (modifier == NULL)
-               return dot;
-             if (modifier - dot < sizeof (buf))
-               {
-                 memcpy (buf, dot, modifier - dot);
-                 buf [modifier - dot] = '\0';
-                 return buf;
-               }
-           }
-       }
-
-      /* Woe32 has a function returning the locale's codepage as a number.  */
+        {
+          /* If the locale name contains an encoding after the dot, return
+             it.  */
+          const char *dot = strchr (locale, '.');
+
+          if (dot != NULL)
+            {
+              const char *modifier;
+
+              dot++;
+              /* Look for the possible @... trailer and remove it, if any.  */
+              modifier = strchr (dot, '@');
+              if (modifier == NULL)
+                return dot;
+              if (modifier - dot < sizeof (buf))
+                {
+                  memcpy (buf, dot, modifier - dot);
+                  buf [modifier - dot] = '\0';
+                  return buf;
+                }
+            }
+        }
+
+      /* Woe32 has a function returning the locale's codepage as a number:
+         GetACP().  This encoding is used by Cygwin, unless the user has set
+         the environment variable CYGWIN=codepage:oem (which very few people
+         do).
+         Output directed to console windows needs to be converted (to
+         GetOEMCP() if the console is using a raster font, or to
+         GetConsoleOutputCP() if it is using a TrueType font).  Cygwin does
+         this conversion transparently (see winsup/cygwin/fhandler_console.cc),
+         converting to GetConsoleOutputCP().  This leads to correct results,
+         except when SetConsoleOutputCP has been called and a raster font is
+         in use.  */
       sprintf (buf, "CP%u", GetACP ());
       codeset = buf;
     }
@@ -397,11 +440,11 @@ locale_charset (void)
     {
       locale = getenv ("LC_ALL");
       if (locale == NULL || locale[0] == '\0')
-       {
-         locale = getenv ("LC_CTYPE");
-         if (locale == NULL || locale[0] == '\0')
-           locale = getenv ("LANG");
-       }
+        {
+          locale = getenv ("LC_CTYPE");
+          if (locale == NULL || locale[0] == '\0')
+            locale = getenv ("LANG");
+        }
     }
 
   /* On some old systems, one used to set locale = "iso8859_1". On others,
@@ -415,7 +458,13 @@ locale_charset (void)
 
   static char buf[2 + 10 + 1];
 
-  /* Woe32 has a function returning the locale's codepage as a number.  */
+  /* Woe32 has a function returning the locale's codepage as a number:
+     GetACP().
+     When the output goes to a console window, it needs to be provided in
+     GetOEMCP() encoding if the console is using a raster font, or in
+     GetConsoleOutputCP() encoding if it is using a TrueType font.
+     But in GUI programs and for output sent to files and pipes, GetACP()
+     encoding is the best bet.  */
   sprintf (buf, "CP%u", GetACP ());
   codeset = buf;
 
@@ -433,7 +482,7 @@ locale_charset (void)
     {
       locale = getenv ("LC_CTYPE");
       if (locale == NULL || locale[0] == '\0')
-       locale = getenv ("LANG");
+        locale = getenv ("LANG");
     }
   if (locale != NULL && locale[0] != '\0')
     {
@@ -441,21 +490,21 @@ locale_charset (void)
       const char *dot = strchr (locale, '.');
 
       if (dot != NULL)
-       {
-         const char *modifier;
-
-         dot++;
-         /* Look for the possible @... trailer and remove it, if any.  */
-         modifier = strchr (dot, '@');
-         if (modifier == NULL)
-           return dot;
-         if (modifier - dot < sizeof (buf))
-           {
-             memcpy (buf, dot, modifier - dot);
-             buf [modifier - dot] = '\0';
-             return buf;
-           }
-       }
+        {
+          const char *modifier;
+
+          dot++;
+          /* Look for the possible @... trailer and remove it, if any.  */
+          modifier = strchr (dot, '@');
+          if (modifier == NULL)
+            return dot;
+          if (modifier - dot < sizeof (buf))
+            {
+              memcpy (buf, dot, modifier - dot);
+              buf [modifier - dot] = '\0';
+              return buf;
+            }
+        }
 
       /* Resolve through the charset.alias file.  */
       codeset = locale;
@@ -464,12 +513,12 @@ locale_charset (void)
     {
       /* OS/2 has a function returning the locale's codepage as a number.  */
       if (DosQueryCp (sizeof (cp), cp, &cplen))
-       codeset = "";
+        codeset = "";
       else
-       {
-         sprintf (buf, "CP%u", cp[0]);
-         codeset = buf;
-       }
+        {
+          sprintf (buf, "CP%u", cp[0]);
+          codeset = buf;
+        }
     }
 
 #endif
@@ -483,10 +532,10 @@ locale_charset (void)
        *aliases != '\0';
        aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
     if (strcmp (codeset, aliases) == 0
-       || (aliases[0] == '*' && aliases[1] == '\0'))
+        || (aliases[0] == '*' && aliases[1] == '\0'))
       {
-       codeset = aliases + strlen (aliases) + 1;
-       break;
+        codeset = aliases + strlen (aliases) + 1;
+        break;
       }
 
   /* Don't return an empty string.  GNU libc and GNU libiconv interpret
index 5030210d113ec0854e090eff7d76bd0055eaf6d9..899b3bae767e22c57c34460df9b8339331788e6f 100644 (file)
@@ -1,10 +1,10 @@
 /* Determine a canonical name for the current locale's character encoding.
-   Copyright (C) 2000-2003 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2009-2010 Free Software Foundation, Inc.
    This file is part of the GNU CHARSET Library.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
index db8dbfb3e96392d4e194870959b29e1e61efeedf..0d5376ab34fcb0dbd49bbdaa06aba35fc3333293 100644 (file)
@@ -1,9 +1,9 @@
 /* An lseek() function that detects pipes.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
index 3e07270801a9a019c747ca8c83d36136ee0116ca..586ab16b2abfa74c2fe46deee9aa358ae336a714 100644 (file)
@@ -1,6 +1,6 @@
 /* Work around a bug of lstat on some systems
 
-   Copyright (C) 1997-1999, 2000-2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1997-2006, 2008-2010 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
 
 #include <config.h>
 
-/* Get the original definition of open.  It might be defined as a macro.  */
-#define __need_system_sys_stat_h
-#include <sys/types.h>
-#include <sys/stat.h>
-#undef __need_system_sys_stat_h
+#if !HAVE_LSTAT
+/* On systems that lack symlinks, our replacement <sys/stat.h> already
+   defined lstat as stat, so there is nothing further to do other than
+   avoid an empty file.  */
+typedef int dummy;
+#else /* HAVE_LSTAT */
+
+/* Get the original definition of lstat.  It might be defined as a macro.  */
+# define __need_system_sys_stat_h
+# include <sys/types.h>
+# include <sys/stat.h>
+# undef __need_system_sys_stat_h
 
 static inline int
 orig_lstat (const char *filename, struct stat *buf)
@@ -32,10 +39,10 @@ orig_lstat (const char *filename, struct stat *buf)
 }
 
 /* Specification.  */
-#include <sys/stat.h>
+# include <sys/stat.h>
 
-#include <string.h>
-#include <errno.h>
+# include <string.h>
+# include <errno.h>
 
 /* lstat works differently on Linux and Solaris systems.  POSIX (see
    `pathname resolution' in the glossary) requires that programs like
@@ -56,27 +63,29 @@ rpl_lstat (const char *file, struct stat *sbuf)
   size_t len;
   int lstat_result = orig_lstat (file, sbuf);
 
-  if (lstat_result != 0 || !S_ISLNK (sbuf->st_mode))
+  if (lstat_result != 0)
     return lstat_result;
 
+  /* This replacement file can blindly check against '/' rather than
+     using the ISSLASH macro, because all platforms with '\\' either
+     lack symlinks (mingw) or have working lstat (cygwin) and thus do
+     not compile this file.  0 len should have already been filtered
+     out above, with a failure return of ENOENT.  */
   len = strlen (file);
-  if (len == 0 || file[len - 1] != '/')
-    return 0;
-
-  /* FILE refers to a symbolic link and the name ends with a slash.
-     Call stat() to get info about the link's referent.  */
-
-  /* If stat fails, then we do the same.  */
-  if (stat (file, sbuf) != 0)
-    return -1;
-
-  /* If FILE references a directory, return 0.  */
-  if (S_ISDIR (sbuf->st_mode))
+  if (file[len - 1] != '/' || S_ISDIR (sbuf->st_mode))
     return 0;
 
-  /* Here, we know stat succeeded and FILE references a non-directory.
-     But it was specified via a name including a trailing slash.
-     Fail with errno set to ENOTDIR to indicate the contradiction.  */
-  errno = ENOTDIR;
-  return -1;
+  /* At this point, a trailing slash is only permitted on
+     symlink-to-dir; but it should have found information on the
+     directory, not the symlink.  Call stat() to get info about the
+     link's referent.  Our replacement stat guarantees valid results,
+     even if the symlink is not pointing to a directory.  */
+  if (!S_ISLNK (sbuf->st_mode))
+    {
+      errno = ENOTDIR;
+      return -1;
+    }
+  return stat (file, sbuf);
 }
+
+#endif /* HAVE_LSTAT */
index eba131d1f273049bbc0f3137ff48f193dee686e1..4fa38ee41b8dc98df5551aa15b72b0b6535a4a5f 100644 (file)
@@ -1,10 +1,10 @@
 /* malloc() function that is glibc compatible.
 
-   Copyright (C) 1997, 1998, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2006-2007, 2009-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 #include <config.h>
 /* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h.  */
 #ifdef malloc
-# define NEED_MALLOC_GNU
+# define NEED_MALLOC_GNU 1
 # undef malloc
+/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU.  */
+#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU
+# define NEED_MALLOC_GNU 1
 #endif
 
 /* Specification.  */
@@ -41,7 +44,7 @@ rpl_malloc (size_t n)
 {
   void *result;
 
-#ifdef NEED_MALLOC_GNU
+#if NEED_MALLOC_GNU
   if (n == 0)
     n = 1;
 #endif
index 0fec5f1c9fac3c67af2fde58774c55b44bd97dcf..5c2650e9520751569df711577333e7d53ecc8c58 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 1999-2002, 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2005-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -63,30 +63,30 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
     switch (nstate)
       {
       case 0:
-       p = s;
-       m = n;
-       break;
+        p = s;
+        m = n;
+        break;
       case 3:
-       buf[2] = pstate[3];
-       /*FALLTHROUGH*/
+        buf[2] = pstate[3];
+        /*FALLTHROUGH*/
       case 2:
-       buf[1] = pstate[2];
-       /*FALLTHROUGH*/
+        buf[1] = pstate[2];
+        /*FALLTHROUGH*/
       case 1:
-       buf[0] = pstate[1];
-       p = buf;
-       m = nstate;
-       buf[m++] = s[0];
-       if (n >= 2 && m < 4)
-         {
-           buf[m++] = s[1];
-           if (n >= 3 && m < 4)
-             buf[m++] = s[2];
-         }
-       break;
+        buf[0] = pstate[1];
+        p = buf;
+        m = nstate;
+        buf[m++] = s[0];
+        if (n >= 2 && m < 4)
+          {
+            buf[m++] = s[1];
+            if (n >= 3 && m < 4)
+              buf[m++] = s[2];
+          }
+        break;
       default:
-       errno = EINVAL;
-       return (size_t)(-1);
+        errno = EINVAL;
+        return (size_t)(-1);
       }
 
     /* Here m > 0.  */
@@ -99,208 +99,208 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
       int res = mbtowc (pwc, p, m);
 
       if (res >= 0)
-       {
-         if (pwc != NULL && ((*pwc == 0) != (res == 0)))
-           abort ();
-         if (nstate >= (res > 0 ? res : 1))
-           abort ();
-         res -= nstate;
-         pstate[0] = 0;
-         return res;
-       }
+        {
+          if (pwc != NULL && ((*pwc == 0) != (res == 0)))
+            abort ();
+          if (nstate >= (res > 0 ? res : 1))
+            abort ();
+          res -= nstate;
+          pstate[0] = 0;
+          return res;
+        }
 
       /* mbtowc does not distinguish between invalid and incomplete multibyte
-        sequences.  But mbrtowc needs to make this distinction.
-        There are two possible approaches:
-          - Use iconv() and its return value.
-          - Use built-in knowledge about the possible encodings.
-        Given the low quality of implementation of iconv() on the systems that
-        lack mbrtowc(), we use the second approach.
-        The possible encodings are:
-          - 8-bit encodings,
-          - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS,
-          - UTF-8.
-        Use specialized code for each.  */
+         sequences.  But mbrtowc needs to make this distinction.
+         There are two possible approaches:
+           - Use iconv() and its return value.
+           - Use built-in knowledge about the possible encodings.
+         Given the low quality of implementation of iconv() on the systems that
+         lack mbrtowc(), we use the second approach.
+         The possible encodings are:
+           - 8-bit encodings,
+           - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS,
+           - UTF-8.
+         Use specialized code for each.  */
       if (m >= 4 || m >= MB_CUR_MAX)
-       goto invalid;
+        goto invalid;
       /* Here MB_CUR_MAX > 1 and 0 < m < 4.  */
       {
-       const char *encoding = locale_charset ();
-
-       if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
-         {
-           /* Cf. unistr/u8-mblen.c.  */
-           unsigned char c = (unsigned char) p[0];
-
-           if (c >= 0xc2)
-             {
-               if (c < 0xe0)
-                 {
-                   if (m == 1)
-                     goto incomplete;
-                 }
-               else if (c < 0xf0)
-                 {
-                   if (m == 1)
-                     goto incomplete;
-                   if (m == 2)
-                     {
-                       unsigned char c2 = (unsigned char) p[1];
-
-                       if ((c2 ^ 0x80) < 0x40
-                           && (c >= 0xe1 || c2 >= 0xa0)
-                           && (c != 0xed || c2 < 0xa0))
-                         goto incomplete;
-                     }
-                 }
-               else if (c <= 0xf4)
-                 {
-                   if (m == 1)
-                     goto incomplete;
-                   else /* m == 2 || m == 3 */
-                     {
-                       unsigned char c2 = (unsigned char) p[1];
-
-                       if ((c2 ^ 0x80) < 0x40
-                           && (c >= 0xf1 || c2 >= 0x90)
-                           && (c < 0xf4 || (c == 0xf4 && c2 < 0x90)))
-                         {
-                           if (m == 2)
-                             goto incomplete;
-                           else /* m == 3 */
-                             {
-                               unsigned char c3 = (unsigned char) p[2];
-
-                               if ((c3 ^ 0x80) < 0x40)
-                                 goto incomplete;
-                             }
-                         }
-                     }
-                 }
-             }
-           goto invalid;
-         }
-
-       /* As a reference for this code, you can use the GNU libiconv
-          implementation.  Look for uses of the RET_TOOFEW macro.  */
-
-       if (STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
-         {
-           if (m == 1)
-             {
-               unsigned char c = (unsigned char) p[0];
-
-               if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f)
-                 goto incomplete;
-             }
-           if (m == 2)
-             {
-               unsigned char c = (unsigned char) p[0];
-
-               if (c == 0x8f)
-                 {
-                   unsigned char c2 = (unsigned char) p[1];
-
-                   if (c2 >= 0xa1 && c2 < 0xff)
-                     goto incomplete;
-                 }
-             }
-           goto invalid;
-         }
-       if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
-           || STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
-           || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
-         {
-           if (m == 1)
-             {
-               unsigned char c = (unsigned char) p[0];
-
-               if (c >= 0xa1 && c < 0xff)
-                 goto incomplete;
-             }
-           goto invalid;
-         }
-       if (STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
-         {
-           if (m == 1)
-             {
-               unsigned char c = (unsigned char) p[0];
-
-               if ((c >= 0xa1 && c < 0xff) || c == 0x8e)
-                 goto incomplete;
-             }
-           else /* m == 2 || m == 3 */
-             {
-               unsigned char c = (unsigned char) p[0];
-
-               if (c == 0x8e)
-                 goto incomplete;
-             }
-           goto invalid;
-         }
-       if (STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
-         {
-           if (m == 1)
-             {
-               unsigned char c = (unsigned char) p[0];
-
-               if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe))
-                 goto incomplete;
-             }
-           else /* m == 2 || m == 3 */
-             {
-               unsigned char c = (unsigned char) p[0];
-
-               if (c >= 0x90 && c <= 0xe3)
-                 {
-                   unsigned char c2 = (unsigned char) p[1];
-
-                   if (c2 >= 0x30 && c2 <= 0x39)
-                     {
-                       if (m == 2)
-                         goto incomplete;
-                       else /* m == 3 */
-                         {
-                           unsigned char c3 = (unsigned char) p[2];
-
-                           if (c3 >= 0x81 && c3 <= 0xfe)
-                             goto incomplete;
-                         }
-                     }
-                 }
-             }
-           goto invalid;
-         }
-       if (STREQ (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
-         {
-           if (m == 1)
-             {
-               unsigned char c = (unsigned char) p[0];
-
-               if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)
-                   || (c >= 0xf0 && c <= 0xf9))
-                 goto incomplete;
-             }
-           goto invalid;
-         }
-
-       /* An unknown multibyte encoding.  */
-       goto incomplete;
+        const char *encoding = locale_charset ();
+
+        if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
+          {
+            /* Cf. unistr/u8-mblen.c.  */
+            unsigned char c = (unsigned char) p[0];
+
+            if (c >= 0xc2)
+              {
+                if (c < 0xe0)
+                  {
+                    if (m == 1)
+                      goto incomplete;
+                  }
+                else if (c < 0xf0)
+                  {
+                    if (m == 1)
+                      goto incomplete;
+                    if (m == 2)
+                      {
+                        unsigned char c2 = (unsigned char) p[1];
+
+                        if ((c2 ^ 0x80) < 0x40
+                            && (c >= 0xe1 || c2 >= 0xa0)
+                            && (c != 0xed || c2 < 0xa0))
+                          goto incomplete;
+                      }
+                  }
+                else if (c <= 0xf4)
+                  {
+                    if (m == 1)
+                      goto incomplete;
+                    else /* m == 2 || m == 3 */
+                      {
+                        unsigned char c2 = (unsigned char) p[1];
+
+                        if ((c2 ^ 0x80) < 0x40
+                            && (c >= 0xf1 || c2 >= 0x90)
+                            && (c < 0xf4 || (c == 0xf4 && c2 < 0x90)))
+                          {
+                            if (m == 2)
+                              goto incomplete;
+                            else /* m == 3 */
+                              {
+                                unsigned char c3 = (unsigned char) p[2];
+
+                                if ((c3 ^ 0x80) < 0x40)
+                                  goto incomplete;
+                              }
+                          }
+                      }
+                  }
+              }
+            goto invalid;
+          }
+
+        /* As a reference for this code, you can use the GNU libiconv
+           implementation.  Look for uses of the RET_TOOFEW macro.  */
+
+        if (STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
+          {
+            if (m == 1)
+              {
+                unsigned char c = (unsigned char) p[0];
+
+                if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f)
+                  goto incomplete;
+              }
+            if (m == 2)
+              {
+                unsigned char c = (unsigned char) p[0];
+
+                if (c == 0x8f)
+                  {
+                    unsigned char c2 = (unsigned char) p[1];
+
+                    if (c2 >= 0xa1 && c2 < 0xff)
+                      goto incomplete;
+                  }
+              }
+            goto invalid;
+          }
+        if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+            || STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
+            || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
+          {
+            if (m == 1)
+              {
+                unsigned char c = (unsigned char) p[0];
+
+                if (c >= 0xa1 && c < 0xff)
+                  goto incomplete;
+              }
+            goto invalid;
+          }
+        if (STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
+          {
+            if (m == 1)
+              {
+                unsigned char c = (unsigned char) p[0];
+
+                if ((c >= 0xa1 && c < 0xff) || c == 0x8e)
+                  goto incomplete;
+              }
+            else /* m == 2 || m == 3 */
+              {
+                unsigned char c = (unsigned char) p[0];
+
+                if (c == 0x8e)
+                  goto incomplete;
+              }
+            goto invalid;
+          }
+        if (STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
+          {
+            if (m == 1)
+              {
+                unsigned char c = (unsigned char) p[0];
+
+                if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe))
+                  goto incomplete;
+              }
+            else /* m == 2 || m == 3 */
+              {
+                unsigned char c = (unsigned char) p[0];
+
+                if (c >= 0x90 && c <= 0xe3)
+                  {
+                    unsigned char c2 = (unsigned char) p[1];
+
+                    if (c2 >= 0x30 && c2 <= 0x39)
+                      {
+                        if (m == 2)
+                          goto incomplete;
+                        else /* m == 3 */
+                          {
+                            unsigned char c3 = (unsigned char) p[2];
+
+                            if (c3 >= 0x81 && c3 <= 0xfe)
+                              goto incomplete;
+                          }
+                      }
+                  }
+              }
+            goto invalid;
+          }
+        if (STREQ (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
+          {
+            if (m == 1)
+              {
+                unsigned char c = (unsigned char) p[0];
+
+                if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)
+                    || (c >= 0xf0 && c <= 0xf9))
+                  goto incomplete;
+              }
+            goto invalid;
+          }
+
+        /* An unknown multibyte encoding.  */
+        goto incomplete;
       }
 
      incomplete:
       {
-       size_t k = nstate;
-       /* Here 0 <= k < m < 4.  */
-       pstate[++k] = s[0];
-       if (k < m)
-         {
-           pstate[++k] = s[1];
-           if (k < m)
-             pstate[++k] = s[2];
-         }
-       if (k != m)
-         abort ();
+        size_t k = nstate;
+        /* Here 0 <= k < m < 4.  */
+        pstate[++k] = s[0];
+        if (k < m)
+          {
+            pstate[++k] = s[1];
+            if (k < m)
+              pstate[++k] = s[2];
+          }
+        if (k != m)
+          abort ();
       }
       pstate[0] = m;
       return (size_t)(-2);
@@ -341,25 +341,25 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
 
     if (!mbsinit (ps))
       {
-       /* Parse the rest of the multibyte character byte for byte.  */
-       size_t count = 0;
-       for (; n > 0; s++, n--)
-         {
-           wchar_t wc;
-           size_t ret = mbrtowc (&wc, s, 1, ps);
-
-           if (ret == (size_t)(-1))
-             return (size_t)(-1);
-           count++;
-           if (ret != (size_t)(-2))
-             {
-               /* The multibyte character has been completed.  */
-               if (pwc != NULL)
-                 *pwc = wc;
-               return (wc == 0 ? 0 : count);
-             }
-         }
-       return (size_t)(-2);
+        /* Parse the rest of the multibyte character byte for byte.  */
+        size_t count = 0;
+        for (; n > 0; s++, n--)
+          {
+            wchar_t wc;
+            size_t ret = mbrtowc (&wc, s, 1, ps);
+
+            if (ret == (size_t)(-1))
+              return (size_t)(-1);
+            count++;
+            if (ret != (size_t)(-2))
+              {
+                /* The multibyte character has been completed.  */
+                if (pwc != NULL)
+                  *pwc = wc;
+                return (wc == 0 ? 0 : count);
+              }
+          }
+        return (size_t)(-2);
       }
   }
 # endif
@@ -371,10 +371,10 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
 
     if (ret != (size_t)(-1) && ret != (size_t)(-2))
       {
-       if (pwc != NULL)
-         *pwc = wc;
-       if (wc == 0)
-         ret = 0;
+        if (pwc != NULL)
+          *pwc = wc;
+        if (wc == 0)
+          ret = 0;
       }
     return ret;
   }
index 81fed5a12b8849a8df57809aeddc139bdb201b88..066ddfe5bf1dcfa789e17c71ef3c41b10106540c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for initial conversion state.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/gnulib/memchr.c b/gnulib/memchr.c
new file mode 100644 (file)
index 0000000..6c2b2d6
--- /dev/null
@@ -0,0 +1,172 @@
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2010
+   Free Software Foundation, Inc.
+
+   Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
+   with help from Dan Sahlin (dan@sics.se) and
+   commentary by Jim Blandy (jimb@ai.mit.edu);
+   adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
+   and implemented by Roland McGrath (roland@ai.mit.edu).
+
+NOTE: The canonical source of this file is maintained with the GNU C Library.
+Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+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 3 of the License, or 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, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <string.h>
+
+#include <stddef.h>
+
+#if defined _LIBC
+# include <memcopy.h>
+#else
+# define reg_char char
+#endif
+
+#include <limits.h>
+
+#if HAVE_BP_SYM_H || defined _LIBC
+# include <bp-sym.h>
+#else
+# define BP_SYM(sym) sym
+#endif
+
+#undef __memchr
+#ifdef _LIBC
+# undef memchr
+#endif
+
+#ifndef weak_alias
+# define __memchr memchr
+#endif
+
+/* Search no more than N bytes of S for C.  */
+void *
+__memchr (void const *s, int c_in, size_t n)
+{
+  /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
+     long instead of a 64-bit uintmax_t tends to give better
+     performance.  On 64-bit hardware, unsigned long is generally 64
+     bits already.  Change this typedef to experiment with
+     performance.  */
+  typedef unsigned long int longword;
+
+  const unsigned char *char_ptr;
+  const longword *longword_ptr;
+  longword repeated_one;
+  longword repeated_c;
+  unsigned reg_char c;
+
+  c = (unsigned char) c_in;
+
+  /* Handle the first few bytes by reading one byte at a time.
+     Do this until CHAR_PTR is aligned on a longword boundary.  */
+  for (char_ptr = (const unsigned char *) s;
+       n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
+       --n, ++char_ptr)
+    if (*char_ptr == c)
+      return (void *) char_ptr;
+
+  longword_ptr = (const longword *) char_ptr;
+
+  /* All these elucidatory comments refer to 4-byte longwords,
+     but the theory applies equally well to any size longwords.  */
+
+  /* Compute auxiliary longword values:
+     repeated_one is a value which has a 1 in every byte.
+     repeated_c has c in every byte.  */
+  repeated_one = 0x01010101;
+  repeated_c = c | (c << 8);
+  repeated_c |= repeated_c << 16;
+  if (0xffffffffU < (longword) -1)
+    {
+      repeated_one |= repeated_one << 31 << 1;
+      repeated_c |= repeated_c << 31 << 1;
+      if (8 < sizeof (longword))
+        {
+          size_t i;
+
+          for (i = 64; i < sizeof (longword) * 8; i *= 2)
+            {
+              repeated_one |= repeated_one << i;
+              repeated_c |= repeated_c << i;
+            }
+        }
+    }
+
+  /* Instead of the traditional loop which tests each byte, we will test a
+     longword at a time.  The tricky part is testing if *any of the four*
+     bytes in the longword in question are equal to c.  We first use an xor
+     with repeated_c.  This reduces the task to testing whether *any of the
+     four* bytes in longword1 is zero.
+
+     We compute tmp =
+       ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
+     That is, we perform the following operations:
+       1. Subtract repeated_one.
+       2. & ~longword1.
+       3. & a mask consisting of 0x80 in every byte.
+     Consider what happens in each byte:
+       - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+         and step 3 transforms it into 0x80.  A carry can also be propagated
+         to more significant bytes.
+       - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+         position k (0 <= k <= 7); so the lowest k bits are 0.  After step 1,
+         the byte ends in a single bit of value 0 and k bits of value 1.
+         After step 2, the result is just k bits of value 1: 2^k - 1.  After
+         step 3, the result is 0.  And no carry is produced.
+     So, if longword1 has only non-zero bytes, tmp is zero.
+     Whereas if longword1 has a zero byte, call j the position of the least
+     significant zero byte.  Then the result has a zero at positions 0, ...,
+     j-1 and a 0x80 at position j.  We cannot predict the result at the more
+     significant bytes (positions j+1..3), but it does not matter since we
+     already have a non-zero bit at position 8*j+7.
+
+     So, the test whether any byte in longword1 is zero is equivalent to
+     testing whether tmp is nonzero.  */
+
+  while (n >= sizeof (longword))
+    {
+      longword longword1 = *longword_ptr ^ repeated_c;
+
+      if ((((longword1 - repeated_one) & ~longword1)
+           & (repeated_one << 7)) != 0)
+        break;
+      longword_ptr++;
+      n -= sizeof (longword);
+    }
+
+  char_ptr = (const unsigned char *) longword_ptr;
+
+  /* At this point, we know that either n < sizeof (longword), or one of the
+     sizeof (longword) bytes starting at char_ptr is == c.  On little-endian
+     machines, we could determine the first such byte without any further
+     memory accesses, just by looking at the tmp result from the last loop
+     iteration.  But this does not work on big-endian machines.  Choose code
+     that works in both cases.  */
+
+  for (; n > 0; --n, ++char_ptr)
+    {
+      if (*char_ptr == c)
+        return (void *) char_ptr;
+    }
+
+  return NULL;
+}
+#ifdef weak_alias
+weak_alias (__memchr, BP_SYM (memchr))
+#endif
diff --git a/gnulib/memchr.valgrind b/gnulib/memchr.valgrind
new file mode 100644 (file)
index 0000000..60f247e
--- /dev/null
@@ -0,0 +1,14 @@
+# Suppress a valgrind message about use of uninitialized memory in memchr().
+# POSIX states that when the character is found, memchr must not read extra
+# bytes in an overestimated length (for example, where memchr is used to
+# implement strnlen).  However, we use a safe word read to provide a speedup.
+{
+    memchr-value4
+    Memcheck:Value4
+    fun:rpl_memchr
+}
+{
+    memchr-value8
+    Memcheck:Value8
+    fun:rpl_memchr
+}
index 6b9dd15134d042b55a5865e485ca8d39a04def0a..075cf32ca15c936faeb9fe377b81b71bb4c4205f 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999, 2001-2003, 2006-2007 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2010 Free Software
+   Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
 
 #include "tempname.h"
 
-/* Generate a unique temporary directory from TEMPLATE.
-   The last six characters of TEMPLATE must be "XXXXXX";
+/* Generate a unique temporary directory from XTEMPLATE.
+   The last six characters of XTEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the filename unique.
    The directory is created, mode 700, and its name is returned.
    (This function comes from OpenBSD.) */
 char *
-mkdtemp (char *template)
+mkdtemp (char *xtemplate)
 {
-  if (gen_tempname (template, GT_DIR))
+  if (gen_tempname (xtemplate, 0, 0, GT_DIR))
     return NULL;
   else
-    return template;
+    return xtemplate;
 }
index c6aff668b4009194c19abf3047f0d73a6ca07c3d..f800cac876175a083b65871e2efdc693e4350d83 100644 (file)
@@ -1,10 +1,10 @@
 /* Provide a netdb.h header file for systems lacking it (read: MinGW).
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 
 #ifndef _GL_NETDB_H
 
-#if @HAVE_NETDB_H@
-
-# if __GNUC__ >= 3
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
-# endif
+#endif
+
+#if @HAVE_NETDB_H@
 
 /* The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_NETDB_H@
 /* Get netdb.h definitions such as struct hostent for MinGW.  */
 #include <sys/socket.h>
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 /* Declarations for a platform that lacks <netdb.h>, or where it is
    incomplete.  */
 
 /* Structure to contain information about address of a service provider.  */
 struct addrinfo
 {
-  int ai_flags;                        /* Input flags.  */
-  int ai_family;               /* Protocol family for socket.  */
-  int ai_socktype;             /* Socket type.  */
-  int ai_protocol;             /* Protocol for socket.  */
-  socklen_t ai_addrlen;                /* Length of socket address.  */
-  struct sockaddr *ai_addr;    /* Socket address for socket.  */
-  char *ai_canonname;          /* Canonical name for service location.  */
-  struct addrinfo *ai_next;    /* Pointer to next in list.  */
+  int ai_flags;                 /* Input flags.  */
+  int ai_family;                /* Protocol family for socket.  */
+  int ai_socktype;              /* Socket type.  */
+  int ai_protocol;              /* Protocol for socket.  */
+  socklen_t ai_addrlen;         /* Length of socket address.  */
+  struct sockaddr *ai_addr;     /* Socket address for socket.  */
+  char *ai_canonname;           /* Canonical name for service location.  */
+  struct addrinfo *ai_next;     /* Pointer to next in list.  */
 };
 # endif
 
 /* Possible values for `ai_flags' field in `addrinfo' structure.  */
 # ifndef AI_PASSIVE
-#  define AI_PASSIVE   0x0001  /* Socket address is intended for `bind'.  */
+#  define AI_PASSIVE    0x0001  /* Socket address is intended for `bind'.  */
 # endif
 # ifndef AI_CANONNAME
-#  define AI_CANONNAME 0x0002  /* Request for canonical name.  */
+#  define AI_CANONNAME  0x0002  /* Request for canonical name.  */
 # endif
 # ifndef AI_NUMERICSERV
-#  define AI_NUMERICSERV       0x0400  /* Don't use name resolution.  */
+#  define AI_NUMERICSERV        0x0400  /* Don't use name resolution.  */
 # endif
 
 # if 0
-/* The commented out definitions below are not yet implemented in the
-   GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact,
-   cause conflicts on systems with a getaddrinfo() function which does not
-   define them.
+#  define AI_NUMERICHOST        0x0004  /* Don't use name resolution.  */
+# endif
 
-   If they are restored, be sure to protect the definitions with #ifndef.  */
-#  define AI_NUMERICHOST       0x0004  /* Don't use name resolution.  */
-#  define AI_V4MAPPED  0x0008  /* IPv4 mapped addresses are acceptable.  */
-#  define AI_ALL               0x0010  /* Return IPv4 mapped and IPv6 addresses.  */
-#  define AI_ADDRCONFIG        0x0020  /* Use configuration of this host to choose
-                                  returned address type..  */
-# endif /* 0 */
+/* These symbolic constants are required to be present by POSIX, but
+   our getaddrinfo replacement doesn't use them (yet).  Setting them
+   to 0 on systems that doesn't have them avoids causing problems for
+   system getaddrinfo implementations that would be confused by
+   unknown values.  */
+# ifndef AI_V4MAPPED
+#  define AI_V4MAPPED    0 /* 0x0008: IPv4 mapped addresses are acceptable.  */
+# endif
+# ifndef AI_ALL
+#  define AI_ALL         0 /* 0x0010: Return IPv4 mapped and IPv6 addresses. */
+# endif
+# ifndef AI_ADDRCONFIG
+#  define AI_ADDRCONFIG  0 /* 0x0020: Use configuration of this host to choose
+                                      returned address type.  */
+# endif
 
 /* Error values for `getaddrinfo' function.  */
 # ifndef EAI_BADFLAGS
-#  define EAI_BADFLAGS   -1    /* Invalid value for `ai_flags' field.  */
-#  define EAI_NONAME     -2    /* NAME or SERVICE is unknown.  */
-#  define EAI_AGAIN      -3    /* Temporary failure in name resolution.  */
-#  define EAI_FAIL       -4    /* Non-recoverable failure in name res.  */
-#  define EAI_NODATA     -5    /* No address associated with NAME.  */
-#  define EAI_FAMILY     -6    /* `ai_family' not supported.  */
-#  define EAI_SOCKTYPE   -7    /* `ai_socktype' not supported.  */
-#  define EAI_SERVICE    -8    /* SERVICE not supported for `ai_socktype'.  */
-#  define EAI_MEMORY     -10   /* Memory allocation failure.  */
+#  define EAI_BADFLAGS    -1    /* Invalid value for `ai_flags' field.  */
+#  define EAI_NONAME      -2    /* NAME or SERVICE is unknown.  */
+#  define EAI_AGAIN       -3    /* Temporary failure in name resolution.  */
+#  define EAI_FAIL        -4    /* Non-recoverable failure in name res.  */
+#  define EAI_NODATA      -5    /* No address associated with NAME.  */
+#  define EAI_FAMILY      -6    /* `ai_family' not supported.  */
+#  define EAI_SOCKTYPE    -7    /* `ai_socktype' not supported.  */
+#  define EAI_SERVICE     -8    /* SERVICE not supported for `ai_socktype'.  */
+#  define EAI_MEMORY      -10   /* Memory allocation failure.  */
 # endif
 
 /* Since EAI_NODATA is deprecated by RFC3493, some systems (at least
@@ -107,15 +117,15 @@ struct addrinfo
 
 # ifndef EAI_OVERFLOW
 /* Not defined on mingw32 and Haiku. */
-#  define EAI_OVERFLOW   -12   /* Argument buffer overflow.  */
+#  define EAI_OVERFLOW    -12   /* Argument buffer overflow.  */
 # endif
 # ifndef EAI_ADDRFAMILY
 /* Not defined on mingw32. */
-#  define EAI_ADDRFAMILY  -9   /* Address family for NAME not supported.  */
+#  define EAI_ADDRFAMILY  -9    /* Address family for NAME not supported.  */
 # endif
 # ifndef EAI_SYSTEM
 /* Not defined on mingw32. */
-#  define EAI_SYSTEM     -11   /* System error returned in `errno'.  */
+#  define EAI_SYSTEM      -11   /* System error returned in `errno'.  */
 # endif
 
 # if 0
@@ -124,12 +134,12 @@ struct addrinfo
 
    If they are restored, be sure to protect the definitions with #ifndef.  */
 #  ifndef EAI_INPROGRESS
-#   define EAI_INPROGRESS      -100    /* Processing request in progress.  */
-#   define EAI_CANCELED                -101    /* Request canceled.  */
-#   define EAI_NOTCANCELED     -102    /* Request not canceled.  */
-#   define EAI_ALLDONE         -103    /* All requests done.  */
-#   define EAI_INTR            -104    /* Interrupted by a signal.  */
-#   define EAI_IDN_ENCODE      -105    /* IDN encoding failed.  */
+#   define EAI_INPROGRESS       -100    /* Processing request in progress.  */
+#   define EAI_CANCELED         -101    /* Request canceled.  */
+#   define EAI_NOTCANCELED      -102    /* Request not canceled.  */
+#   define EAI_ALLDONE          -103    /* All requests done.  */
+#   define EAI_INTR             -104    /* Interrupted by a signal.  */
+#   define EAI_IDN_ENCODE       -105    /* IDN encoding failed.  */
 #  endif
 # endif
 
@@ -139,16 +149,17 @@ struct addrinfo
    For more details, see the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/getaddrinfo.html>.  */
 extern int getaddrinfo (const char *restrict nodename,
-                       const char *restrict servname,
-                       const struct addrinfo *restrict hints,
-                       struct addrinfo **restrict res);
+                        const char *restrict servname,
+                        const struct addrinfo *restrict hints,
+                        struct addrinfo **restrict res)
+     _GL_ARG_NONNULL ((4));
 # endif
 
 # if !@HAVE_DECL_FREEADDRINFO@
 /* Free `addrinfo' structure AI including associated storage.
    For more details, see the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/getaddrinfo.html>.  */
-extern void freeaddrinfo (struct addrinfo *ai);
+extern void freeaddrinfo (struct addrinfo *ai) _GL_ARG_NONNULL ((1));
 # endif
 
 # if !@HAVE_DECL_GAI_STRERROR@
@@ -162,10 +173,11 @@ extern const char *gai_strerror (int ecode);
 /* Convert socket address to printable node and service names.
    For more details, see the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/getnameinfo.html>.  */
-extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
-                      char *restrict node, socklen_t nodelen,
-                      char *restrict service, socklen_t servicelen,
-                      int flags);
+extern int getnameinfo (const struct sockaddr *restrict sa, socklen_t salen,
+                        char *restrict node, socklen_t nodelen,
+                        char *restrict service, socklen_t servicelen,
+                        int flags)
+     _GL_ARG_NONNULL ((1));
 # endif
 
 /* Possible flags for getnameinfo.  */
@@ -176,7 +188,33 @@ extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
 #  define NI_NUMERICSERV 2
 # endif
 
-#endif /* @GNULIB_GETADDRINFO@ */
+#elif defined GNULIB_POSIXCHECK
+
+# undef getaddrinfo
+# if HAVE_RAW_DECL_GETADDRINFO
+_GL_WARN_ON_USE (getaddrinfo, "getaddrinfo is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef freeaddrinfo
+# if HAVE_RAW_DECL_FREEADDRINFO
+_GL_WARN_ON_USE (freeaddrinfo, "freeaddrinfo is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef gai_strerror
+# if HAVE_RAW_DECL_GAI_STRERROR
+_GL_WARN_ON_USE (gai_strerror, "gai_strerror is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef getnameinfo
+# if HAVE_RAW_DECL_GETNAMEINFO
+_GL_WARN_ON_USE (getnameinfo, "getnameinfo is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+#endif
 
 #endif /* _GL_NETDB_H */
 #endif /* _GL_NETDB_H */
index 82aefb4992494fb95950cb75565710d11a28f2cf..7f0ff4214369a61cdf33b14c018539981b602760 100644 (file)
@@ -1,9 +1,9 @@
 /* Substitute for <netinet/in.h>.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 
 #ifndef _GL_NETINET_IN_H
 
-#if @HAVE_NETINET_IN_H@
-
-# if __GNUC__ >= 3
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
-# endif
+#endif
+
+#if @HAVE_NETINET_IN_H@
 
 /* On many platforms, <netinet/in.h> assumes prior inclusion of
    <sys/types.h>.  */
diff --git a/gnulib/nl_langinfo.c b/gnulib/nl_langinfo.c
new file mode 100644 (file)
index 0000000..e81c81e
--- /dev/null
@@ -0,0 +1,260 @@
+/* nl_langinfo() replacement: query locale dependent information.
+
+   Copyright (C) 2007-2010 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 3 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, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <langinfo.h>
+
+#if REPLACE_NL_LANGINFO
+
+/* Override nl_langinfo with support for added nl_item values.  */
+
+# include <locale.h>
+# include <string.h>
+
+# undef nl_langinfo
+
+char *
+rpl_nl_langinfo (nl_item item)
+{
+  switch (item)
+    {
+# if GNULIB_defined_CODESET
+    case CODESET:
+      {
+        const char *locale;
+        static char buf[2 + 10 + 1];
+
+        locale = setlocale (LC_CTYPE, NULL);
+        if (locale != NULL && locale[0] != '\0')
+          {
+            /* If the locale name contains an encoding after the dot, return
+               it.  */
+            const char *dot = strchr (locale, '.');
+
+            if (dot != NULL)
+              {
+                const char *modifier;
+
+                dot++;
+                /* Look for the possible @... trailer and remove it, if any.  */
+                modifier = strchr (dot, '@');
+                if (modifier == NULL)
+                  return dot;
+                if (modifier - dot < sizeof (buf))
+                  {
+                    memcpy (buf, dot, modifier - dot);
+                    buf [modifier - dot] = '\0';
+                    return buf;
+                  }
+              }
+          }
+        return "";
+      }
+# endif
+# if GNULIB_defined_ERA
+    case ERA:
+      /* The format is not standardized.  In glibc it is a sequence of strings
+         of the form "direction:offset:start_date:end_date:era_name:era_format"
+         with an empty string at the end.  */
+      return "";
+    case ERA_D_FMT:
+      /* The %Ex conversion in strftime behaves like %x if the locale does not
+         have an alternative time format.  */
+      item = D_FMT;
+      break;
+    case ERA_D_T_FMT:
+      /* The %Ec conversion in strftime behaves like %c if the locale does not
+         have an alternative time format.  */
+      item = D_T_FMT;
+      break;
+    case ERA_T_FMT:
+      /* The %EX conversion in strftime behaves like %X if the locale does not
+         have an alternative time format.  */
+      item = T_FMT;
+      break;
+    case ALT_DIGITS:
+      /* The format is not standardized.  In glibc it is a sequence of 10
+         strings, appended in memory.  */
+      return "\0\0\0\0\0\0\0\0\0\0";
+# endif
+    default:
+      break;
+    }
+  return nl_langinfo (item);
+}
+
+#else
+
+/* Provide nl_langinfo from scratch.  */
+
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* Native Windows platforms.  */
+
+#  define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#  include <windows.h>
+
+#  include <stdio.h>
+
+# else
+
+/* An old Unix platform without locales, such as Linux libc5 or BeOS.  */
+
+# endif
+
+# include <locale.h>
+
+char *
+nl_langinfo (nl_item item)
+{
+  switch (item)
+    {
+    /* nl_langinfo items of the LC_CTYPE category */
+    case CODESET:
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+      {
+        static char buf[2 + 10 + 1];
+
+        /* Woe32 has a function returning the locale's codepage as a number.  */
+        sprintf (buf, "CP%u", GetACP ());
+        return buf;
+      }
+# elif defined __BEOS__
+      return "UTF-8";
+# else
+      return "ISO-8859-1";
+# endif
+    /* nl_langinfo items of the LC_NUMERIC category */
+    case RADIXCHAR:
+      return localeconv () ->decimal_point;
+    case THOUSEP:
+      return localeconv () ->thousands_sep;
+    /* nl_langinfo items of the LC_TIME category.
+       TODO: Really use the locale.  */
+    case D_T_FMT:
+    case ERA_D_T_FMT:
+      return "%a %b %e %H:%M:%S %Y";
+    case D_FMT:
+    case ERA_D_FMT:
+      return "%m/%d/%y";
+    case T_FMT:
+    case ERA_T_FMT:
+      return "%H:%M:%S";
+    case T_FMT_AMPM:
+      return "%I:%M:%S %p";
+    case AM_STR:
+      return "AM";
+    case PM_STR:
+      return "PM";
+    case DAY_1:
+      return "Sunday";
+    case DAY_2:
+      return "Monday";
+    case DAY_3:
+      return "Tuesday";
+    case DAY_4:
+      return "Wednesday";
+    case DAY_5:
+      return "Thursday";
+    case DAY_6:
+      return "Friday";
+    case DAY_7:
+      return "Saturday";
+    case ABDAY_1:
+      return "Sun";
+    case ABDAY_2:
+      return "Mon";
+    case ABDAY_3:
+      return "Tue";
+    case ABDAY_4:
+      return "Wed";
+    case ABDAY_5:
+      return "Thu";
+    case ABDAY_6:
+      return "Fri";
+    case ABDAY_7:
+      return "Sat";
+    case MON_1:
+      return "January";
+    case MON_2:
+      return "February";
+    case MON_3:
+      return "March";
+    case MON_4:
+      return "April";
+    case MON_5:
+      return "May";
+    case MON_6:
+      return "June";
+    case MON_7:
+      return "July";
+    case MON_8:
+      return "August";
+    case MON_9:
+      return "September";
+    case MON_10:
+      return "October";
+    case MON_11:
+      return "November";
+    case MON_12:
+      return "December";
+    case ABMON_1:
+      return "Jan";
+    case ABMON_2:
+      return "Feb";
+    case ABMON_3:
+      return "Mar";
+    case ABMON_4:
+      return "Apr";
+    case ABMON_5:
+      return "May";
+    case ABMON_6:
+      return "Jun";
+    case ABMON_7:
+      return "Jul";
+    case ABMON_8:
+      return "Aug";
+    case ABMON_9:
+      return "Sep";
+    case ABMON_10:
+      return "Oct";
+    case ABMON_11:
+      return "Nov";
+    case ABMON_12:
+      return "Dec";
+    case ERA:
+      return "";
+    case ALT_DIGITS:
+      return "\0\0\0\0\0\0\0\0\0\0";
+    /* nl_langinfo items of the LC_MONETARY category
+       TODO: Really use the locale. */
+    case CRNCYSTR:
+      return "-";
+    /* nl_langinfo items of the LC_MESSAGES category
+       TODO: Really use the locale. */
+    case YESEXPR:
+      return "^[yY]";
+    case NOEXPR:
+      return "^[nN]";
+    default:
+      return "";
+    }
+}
+
+#endif
index 4b532e1a083db6236548a9093493049a3c80f27f..1b19ef35f274314df62af15a3e22bd6d1d1b8443 100644 (file)
@@ -1,6 +1,6 @@
 /* Calculate the size of physical memory.
 
-   Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software
+   Copyright (C) 2000-2001, 2003, 2005-2006, 2009-2010 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -95,10 +95,10 @@ physmem_total (void)
     struct pst_static pss;
     if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0))
       {
-       double pages = pss.physical_memory;
-       double pagesize = pss.page_size;
-       if (0 <= pages && 0 <= pagesize)
-         return pages * pagesize;
+        double pages = pss.physical_memory;
+        double pagesize = pss.page_size;
+        if (0 <= pages && 0 <= pagesize)
+          return pages * pagesize;
       }
   }
 #endif
@@ -108,10 +108,10 @@ physmem_total (void)
     struct rminfo realmem;
     if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
       {
-       double pagesize = sysconf (_SC_PAGESIZE);
-       double pages = realmem.physmem;
-       if (0 <= pages && 0 <= pagesize)
-         return pages * pagesize;
+        double pagesize = sysconf (_SC_PAGESIZE);
+        double pages = realmem.physmem;
+        if (0 <= pages && 0 <= pagesize)
+          return pages * pagesize;
       }
   }
 #endif
@@ -121,12 +121,12 @@ physmem_total (void)
     int physmem;
 
     if (getsysinfo (GSI_PHYSMEM, (caddr_t) &physmem, sizeof (physmem),
-                   NULL, NULL, NULL) == 1)
+                    NULL, NULL, NULL) == 1)
       {
-       double kbytes = physmem;
+        double kbytes = physmem;
 
-       if (0 <= kbytes)
-         return kbytes * 1024.0;
+        if (0 <= kbytes)
+          return kbytes * 1024.0;
       }
   }
 #endif
@@ -138,7 +138,7 @@ physmem_total (void)
     static int mib[2] = { CTL_HW, HW_PHYSMEM };
 
     if (sysctl (mib, ARRAY_SIZE (mib), &physmem, &len, NULL, 0) == 0
-       && len == sizeof (physmem))
+        && len == sizeof (physmem))
       return (double) physmem;
   }
 #endif
@@ -159,20 +159,20 @@ physmem_total (void)
     /*  Use GlobalMemoryStatusEx if available.  */
     if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
       {
-       lMEMORYSTATUSEX lms_ex;
-       lms_ex.dwLength = sizeof lms_ex;
-       if (!pfnex (&lms_ex))
-         return 0.0;
-       return (double) lms_ex.ullTotalPhys;
+        lMEMORYSTATUSEX lms_ex;
+        lms_ex.dwLength = sizeof lms_ex;
+        if (!pfnex (&lms_ex))
+          return 0.0;
+        return (double) lms_ex.ullTotalPhys;
       }
 
     /*  Fall back to GlobalMemoryStatus which is always available.
         but returns wrong results for physical memory > 4GB.  */
     else
       {
-       MEMORYSTATUS ms;
-       GlobalMemoryStatus (&ms);
-       return (double) ms.dwTotalPhys;
+        MEMORYSTATUS ms;
+        GlobalMemoryStatus (&ms);
+        return (double) ms.dwTotalPhys;
       }
   }
 #endif
@@ -199,12 +199,12 @@ physmem_available (void)
     struct pst_static pss;
     struct pst_dynamic psd;
     if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0)
-       && 0 <= pstat_getdynamic (&psd, sizeof psd, 1, 0))
+        && 0 <= pstat_getdynamic (&psd, sizeof psd, 1, 0))
       {
-       double pages = psd.psd_free;
-       double pagesize = pss.page_size;
-       if (0 <= pages && 0 <= pagesize)
-         return pages * pagesize;
+        double pages = psd.psd_free;
+        double pagesize = pss.page_size;
+        if (0 <= pages && 0 <= pagesize)
+          return pages * pagesize;
       }
   }
 #endif
@@ -214,10 +214,10 @@ physmem_available (void)
     struct rminfo realmem;
     if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
       {
-       double pagesize = sysconf (_SC_PAGESIZE);
-       double pages = realmem.availrmem;
-       if (0 <= pages && 0 <= pagesize)
-         return pages * pagesize;
+        double pagesize = sysconf (_SC_PAGESIZE);
+        double pages = realmem.availrmem;
+        if (0 <= pages && 0 <= pagesize)
+          return pages * pagesize;
       }
   }
 #endif
@@ -228,11 +228,11 @@ physmem_available (void)
 
     if (table (TBL_VMSTATS, 0, &vmstats, 1, sizeof (vmstats)) == 1)
       {
-       double pages = vmstats.free_count;
-       double pagesize = vmstats.pagesize;
+        double pages = vmstats.free_count;
+        double pagesize = vmstats.pagesize;
 
-       if (0 <= pages && 0 <= pagesize)
-         return pages * pagesize;
+        if (0 <= pages && 0 <= pagesize)
+          return pages * pagesize;
       }
   }
 #endif
@@ -244,7 +244,7 @@ physmem_available (void)
     static int mib[2] = { CTL_HW, HW_USERMEM };
 
     if (sysctl (mib, ARRAY_SIZE (mib), &usermem, &len, NULL, 0) == 0
-       && len == sizeof (usermem))
+        && len == sizeof (usermem))
       return (double) usermem;
   }
 #endif
@@ -260,20 +260,20 @@ physmem_available (void)
     /*  Use GlobalMemoryStatusEx if available.  */
     if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
       {
-       lMEMORYSTATUSEX lms_ex;
-       lms_ex.dwLength = sizeof lms_ex;
-       if (!pfnex (&lms_ex))
-         return 0.0;
-       return (double) lms_ex.ullAvailPhys;
+        lMEMORYSTATUSEX lms_ex;
+        lms_ex.dwLength = sizeof lms_ex;
+        if (!pfnex (&lms_ex))
+          return 0.0;
+        return (double) lms_ex.ullAvailPhys;
       }
 
     /*  Fall back to GlobalMemoryStatus which is always available.
         but returns wrong results for physical memory > 4GB  */
     else
       {
-       MEMORYSTATUS ms;
-       GlobalMemoryStatus (&ms);
-       return (double) ms.dwAvailPhys;
+        MEMORYSTATUS ms;
+        GlobalMemoryStatus (&ms);
+        return (double) ms.dwAvailPhys;
       }
   }
 #endif
index 95375d797ae2edd281552a6ab8b0190a2c130b64..f77d85beb461f263864a60989c6d19970de4c2f9 100644 (file)
@@ -1,6 +1,6 @@
 /* Calculate the size of physical memory.
 
-   Copyright (C) 2000, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2003, 2009-2010 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
index 497891466239c9078089c1d9c813d14e8ae86a01..46c03a21eaed86ab8bc8e8a82ba4cb74ef87e43b 100644 (file)
@@ -1,9 +1,10 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -42,146 +43,146 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
     switch (ap->type)
       {
       case TYPE_SCHAR:
-       ap->a.a_schar = va_arg (args, /*signed char*/ int);
-       break;
+        ap->a.a_schar = va_arg (args, /*signed char*/ int);
+        break;
       case TYPE_UCHAR:
-       ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
-       break;
+        ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
+        break;
       case TYPE_SHORT:
-       ap->a.a_short = va_arg (args, /*short*/ int);
-       break;
+        ap->a.a_short = va_arg (args, /*short*/ int);
+        break;
       case TYPE_USHORT:
-       ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
-       break;
+        ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
+        break;
       case TYPE_INT:
-       ap->a.a_int = va_arg (args, int);
-       break;
+        ap->a.a_int = va_arg (args, int);
+        break;
       case TYPE_UINT:
-       ap->a.a_uint = va_arg (args, unsigned int);
-       break;
+        ap->a.a_uint = va_arg (args, unsigned int);
+        break;
       case TYPE_LONGINT:
-       ap->a.a_longint = va_arg (args, long int);
-       break;
+        ap->a.a_longint = va_arg (args, long int);
+        break;
       case TYPE_ULONGINT:
-       ap->a.a_ulongint = va_arg (args, unsigned long int);
-       break;
+        ap->a.a_ulongint = va_arg (args, unsigned long int);
+        break;
 #if HAVE_LONG_LONG_INT
       case TYPE_LONGLONGINT:
-       ap->a.a_longlongint = va_arg (args, long long int);
-       break;
+        ap->a.a_longlongint = va_arg (args, long long int);
+        break;
       case TYPE_ULONGLONGINT:
-       ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
-       break;
+        ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
+        break;
 #endif
       case TYPE_DOUBLE:
-       ap->a.a_double = va_arg (args, double);
-       break;
+        ap->a.a_double = va_arg (args, double);
+        break;
       case TYPE_LONGDOUBLE:
-       ap->a.a_longdouble = va_arg (args, long double);
-       break;
+        ap->a.a_longdouble = va_arg (args, long double);
+        break;
       case TYPE_CHAR:
-       ap->a.a_char = va_arg (args, int);
-       break;
+        ap->a.a_char = va_arg (args, int);
+        break;
 #if HAVE_WINT_T
       case TYPE_WIDE_CHAR:
-       /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
-          default argument promotions", this is not the case in mingw32,
-          where wint_t is 'unsigned short'.  */
-       ap->a.a_wide_char =
-         (sizeof (wint_t) < sizeof (int)
-          ? va_arg (args, int)
-          : va_arg (args, wint_t));
-       break;
+        /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
+           default argument promotions", this is not the case in mingw32,
+           where wint_t is 'unsigned short'.  */
+        ap->a.a_wide_char =
+          (sizeof (wint_t) < sizeof (int)
+           ? (wint_t) va_arg (args, int)
+           : va_arg (args, wint_t));
+        break;
 #endif
       case TYPE_STRING:
-       ap->a.a_string = va_arg (args, const char *);
-       /* A null pointer is an invalid argument for "%s", but in practice
-          it occurs quite frequently in printf statements that produce
-          debug output.  Use a fallback in this case.  */
-       if (ap->a.a_string == NULL)
-         ap->a.a_string = "(NULL)";
-       break;
+        ap->a.a_string = va_arg (args, const char *);
+        /* A null pointer is an invalid argument for "%s", but in practice
+           it occurs quite frequently in printf statements that produce
+           debug output.  Use a fallback in this case.  */
+        if (ap->a.a_string == NULL)
+          ap->a.a_string = "(NULL)";
+        break;
 #if HAVE_WCHAR_T
       case TYPE_WIDE_STRING:
-       ap->a.a_wide_string = va_arg (args, const wchar_t *);
-       /* A null pointer is an invalid argument for "%ls", but in practice
-          it occurs quite frequently in printf statements that produce
-          debug output.  Use a fallback in this case.  */
-       if (ap->a.a_wide_string == NULL)
-         {
-           static const wchar_t wide_null_string[] =
-             {
-               (wchar_t)'(',
-               (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
-               (wchar_t)')',
-               (wchar_t)0
-             };
-           ap->a.a_wide_string = wide_null_string;
-         }
-       break;
+        ap->a.a_wide_string = va_arg (args, const wchar_t *);
+        /* A null pointer is an invalid argument for "%ls", but in practice
+           it occurs quite frequently in printf statements that produce
+           debug output.  Use a fallback in this case.  */
+        if (ap->a.a_wide_string == NULL)
+          {
+            static const wchar_t wide_null_string[] =
+              {
+                (wchar_t)'(',
+                (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
+                (wchar_t)')',
+                (wchar_t)0
+              };
+            ap->a.a_wide_string = wide_null_string;
+          }
+        break;
 #endif
       case TYPE_POINTER:
-       ap->a.a_pointer = va_arg (args, void *);
-       break;
+        ap->a.a_pointer = va_arg (args, void *);
+        break;
       case TYPE_COUNT_SCHAR_POINTER:
-       ap->a.a_count_schar_pointer = va_arg (args, signed char *);
-       break;
+        ap->a.a_count_schar_pointer = va_arg (args, signed char *);
+        break;
       case TYPE_COUNT_SHORT_POINTER:
-       ap->a.a_count_short_pointer = va_arg (args, short *);
-       break;
+        ap->a.a_count_short_pointer = va_arg (args, short *);
+        break;
       case TYPE_COUNT_INT_POINTER:
-       ap->a.a_count_int_pointer = va_arg (args, int *);
-       break;
+        ap->a.a_count_int_pointer = va_arg (args, int *);
+        break;
       case TYPE_COUNT_LONGINT_POINTER:
-       ap->a.a_count_longint_pointer = va_arg (args, long int *);
-       break;
+        ap->a.a_count_longint_pointer = va_arg (args, long int *);
+        break;
 #if HAVE_LONG_LONG_INT
       case TYPE_COUNT_LONGLONGINT_POINTER:
-       ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
-       break;
+        ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
+        break;
 #endif
 #if ENABLE_UNISTDIO
       /* The unistdio extensions.  */
       case TYPE_U8_STRING:
-       ap->a.a_u8_string = va_arg (args, const uint8_t *);
-       /* A null pointer is an invalid argument for "%U", but in practice
-          it occurs quite frequently in printf statements that produce
-          debug output.  Use a fallback in this case.  */
-       if (ap->a.a_u8_string == NULL)
-         {
-           static const uint8_t u8_null_string[] =
-             { '(', 'N', 'U', 'L', 'L', ')', 0 };
-           ap->a.a_u8_string = u8_null_string;
-         }
-       break;
+        ap->a.a_u8_string = va_arg (args, const uint8_t *);
+        /* A null pointer is an invalid argument for "%U", but in practice
+           it occurs quite frequently in printf statements that produce
+           debug output.  Use a fallback in this case.  */
+        if (ap->a.a_u8_string == NULL)
+          {
+            static const uint8_t u8_null_string[] =
+              { '(', 'N', 'U', 'L', 'L', ')', 0 };
+            ap->a.a_u8_string = u8_null_string;
+          }
+        break;
       case TYPE_U16_STRING:
-       ap->a.a_u16_string = va_arg (args, const uint16_t *);
-       /* A null pointer is an invalid argument for "%lU", but in practice
-          it occurs quite frequently in printf statements that produce
-          debug output.  Use a fallback in this case.  */
-       if (ap->a.a_u16_string == NULL)
-         {
-           static const uint16_t u16_null_string[] =
-             { '(', 'N', 'U', 'L', 'L', ')', 0 };
-           ap->a.a_u16_string = u16_null_string;
-         }
-       break;
+        ap->a.a_u16_string = va_arg (args, const uint16_t *);
+        /* A null pointer is an invalid argument for "%lU", but in practice
+           it occurs quite frequently in printf statements that produce
+           debug output.  Use a fallback in this case.  */
+        if (ap->a.a_u16_string == NULL)
+          {
+            static const uint16_t u16_null_string[] =
+              { '(', 'N', 'U', 'L', 'L', ')', 0 };
+            ap->a.a_u16_string = u16_null_string;
+          }
+        break;
       case TYPE_U32_STRING:
-       ap->a.a_u32_string = va_arg (args, const uint32_t *);
-       /* A null pointer is an invalid argument for "%llU", but in practice
-          it occurs quite frequently in printf statements that produce
-          debug output.  Use a fallback in this case.  */
-       if (ap->a.a_u32_string == NULL)
-         {
-           static const uint32_t u32_null_string[] =
-             { '(', 'N', 'U', 'L', 'L', ')', 0 };
-           ap->a.a_u32_string = u32_null_string;
-         }
-       break;
+        ap->a.a_u32_string = va_arg (args, const uint32_t *);
+        /* A null pointer is an invalid argument for "%llU", but in practice
+           it occurs quite frequently in printf statements that produce
+           debug output.  Use a fallback in this case.  */
+        if (ap->a.a_u32_string == NULL)
+          {
+            static const uint32_t u32_null_string[] =
+              { '(', 'N', 'U', 'L', 'L', ')', 0 };
+            ap->a.a_u32_string = u32_null_string;
+          }
+        break;
 #endif
       default:
-       /* Unknown type.  */
-       return -1;
+        /* Unknown type.  */
+        return -1;
       }
   return 0;
 }
index 6f75e2aea40ab226dafd173c0c2cd0278e93e5f8..2536ebafd32ea983bc3a76caf50fb0469c214221 100644 (file)
@@ -1,9 +1,10 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2003, 2006-2007, 2009-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -93,42 +94,42 @@ typedef struct
   arg_type type;
   union
   {
-    signed char                        a_schar;
-    unsigned char              a_uchar;
-    short                      a_short;
-    unsigned short             a_ushort;
-    int                                a_int;
-    unsigned int               a_uint;
-    long int                   a_longint;
-    unsigned long int          a_ulongint;
+    signed char                 a_schar;
+    unsigned char               a_uchar;
+    short                       a_short;
+    unsigned short              a_ushort;
+    int                         a_int;
+    unsigned int                a_uint;
+    long int                    a_longint;
+    unsigned long int           a_ulongint;
 #if HAVE_LONG_LONG_INT
-    long long int              a_longlongint;
-    unsigned long long int     a_ulonglongint;
+    long long int               a_longlongint;
+    unsigned long long int      a_ulonglongint;
 #endif
-    float                      a_float;
-    double                     a_double;
-    long double                        a_longdouble;
-    int                                a_char;
+    float                       a_float;
+    double                      a_double;
+    long double                 a_longdouble;
+    int                         a_char;
 #if HAVE_WINT_T
-    wint_t                     a_wide_char;
+    wint_t                      a_wide_char;
 #endif
-    const char*                        a_string;
+    const char*                 a_string;
 #if HAVE_WCHAR_T
-    const wchar_t*             a_wide_string;
+    const wchar_t*              a_wide_string;
 #endif
-    void*                      a_pointer;
-    signed char *              a_count_schar_pointer;
-    short *                    a_count_short_pointer;
-    int *                      a_count_int_pointer;
-    long int *                 a_count_longint_pointer;
+    void*                       a_pointer;
+    signed char *               a_count_schar_pointer;
+    short *                     a_count_short_pointer;
+    int *                       a_count_int_pointer;
+    long int *                  a_count_longint_pointer;
 #if HAVE_LONG_LONG_INT
-    long long int *            a_count_longlongint_pointer;
+    long long int *             a_count_longlongint_pointer;
 #endif
 #if ENABLE_UNISTDIO
     /* The unistdio extensions.  */
-    const uint8_t *            a_u8_string;
-    const uint16_t *           a_u16_string;
-    const uint32_t *           a_u32_string;
+    const uint8_t *             a_u8_string;
+    const uint16_t *            a_u16_string;
+    const uint32_t *            a_u32_string;
 #endif
   }
   a;
index b11f6bb22896103ba78413c4d1fc27328fe043ab..f612beb5b7ac11d1f165e2763cc62722a91723da 100644 (file)
@@ -1,9 +1,9 @@
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2008 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -80,10 +80,10 @@ STATIC
 int
 PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
 {
-  const CHAR_T *cp = format;           /* pointer into format */
-  size_t arg_posn = 0;         /* number of regular arguments consumed */
-  size_t d_allocated;                  /* allocated elements of d->dir */
-  size_t a_allocated;                  /* allocated elements of a->arg */
+  const CHAR_T *cp = format;            /* pointer into format */
+  size_t arg_posn = 0;          /* number of regular arguments consumed */
+  size_t d_allocated;                   /* allocated elements of d->dir */
+  size_t a_allocated;                   /* allocated elements of a->arg */
   size_t max_width_length = 0;
   size_t max_precision_length = 0;
 
@@ -99,501 +99,501 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
   a->arg = NULL;
 
 #define REGISTER_ARG(_index_,_type_) \
-  {                                                                    \
-    size_t n = (_index_);                                              \
-    if (n >= a_allocated)                                              \
-      {                                                                        \
-       size_t memory_size;                                             \
-       argument *memory;                                               \
-                                                                       \
-       a_allocated = xtimes (a_allocated, 2);                          \
-       if (a_allocated <= n)                                           \
-         a_allocated = xsum (n, 1);                                    \
-       memory_size = xtimes (a_allocated, sizeof (argument));          \
-       if (size_overflow_p (memory_size))                              \
-         /* Overflow, would lead to out of memory.  */                 \
-         goto out_of_memory;                                           \
-       memory = (argument *) (a->arg                                   \
-                              ? realloc (a->arg, memory_size)          \
-                              : malloc (memory_size));                 \
-       if (memory == NULL)                                             \
-         /* Out of memory.  */                                         \
-         goto out_of_memory;                                           \
-       a->arg = memory;                                                \
-      }                                                                        \
-    while (a->count <= n)                                              \
-      a->arg[a->count++].type = TYPE_NONE;                             \
-    if (a->arg[n].type == TYPE_NONE)                                   \
-      a->arg[n].type = (_type_);                                       \
-    else if (a->arg[n].type != (_type_))                               \
-      /* Ambiguous type for positional argument.  */                   \
-      goto error;                                                      \
+  {                                                                     \
+    size_t n = (_index_);                                               \
+    if (n >= a_allocated)                                               \
+      {                                                                 \
+        size_t memory_size;                                             \
+        argument *memory;                                               \
+                                                                        \
+        a_allocated = xtimes (a_allocated, 2);                          \
+        if (a_allocated <= n)                                           \
+          a_allocated = xsum (n, 1);                                    \
+        memory_size = xtimes (a_allocated, sizeof (argument));          \
+        if (size_overflow_p (memory_size))                              \
+          /* Overflow, would lead to out of memory.  */                 \
+          goto out_of_memory;                                           \
+        memory = (argument *) (a->arg                                   \
+                               ? realloc (a->arg, memory_size)          \
+                               : malloc (memory_size));                 \
+        if (memory == NULL)                                             \
+          /* Out of memory.  */                                         \
+          goto out_of_memory;                                           \
+        a->arg = memory;                                                \
+      }                                                                 \
+    while (a->count <= n)                                               \
+      a->arg[a->count++].type = TYPE_NONE;                              \
+    if (a->arg[n].type == TYPE_NONE)                                    \
+      a->arg[n].type = (_type_);                                        \
+    else if (a->arg[n].type != (_type_))                                \
+      /* Ambiguous type for positional argument.  */                    \
+      goto error;                                                       \
   }
 
   while (*cp != '\0')
     {
       CHAR_T c = *cp++;
       if (c == '%')
-       {
-         size_t arg_index = ARG_NONE;
-         DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
-
-         /* Initialize the next directive.  */
-         dp->dir_start = cp - 1;
-         dp->flags = 0;
-         dp->width_start = NULL;
-         dp->width_end = NULL;
-         dp->width_arg_index = ARG_NONE;
-         dp->precision_start = NULL;
-         dp->precision_end = NULL;
-         dp->precision_arg_index = ARG_NONE;
-         dp->arg_index = ARG_NONE;
-
-         /* Test for positional argument.  */
-         if (*cp >= '0' && *cp <= '9')
-           {
-             const CHAR_T *np;
-
-             for (np = cp; *np >= '0' && *np <= '9'; np++)
-               ;
-             if (*np == '$')
-               {
-                 size_t n = 0;
-
-                 for (np = cp; *np >= '0' && *np <= '9'; np++)
-                   n = xsum (xtimes (n, 10), *np - '0');
-                 if (n == 0)
-                   /* Positional argument 0.  */
-                   goto error;
-                 if (size_overflow_p (n))
-                   /* n too large, would lead to out of memory later.  */
-                   goto error;
-                 arg_index = n - 1;
-                 cp = np + 1;
-               }
-           }
-
-         /* Read the flags.  */
-         for (;;)
-           {
-             if (*cp == '\'')
-               {
-                 dp->flags |= FLAG_GROUP;
-                 cp++;
-               }
-             else if (*cp == '-')
-               {
-                 dp->flags |= FLAG_LEFT;
-                 cp++;
-               }
-             else if (*cp == '+')
-               {
-                 dp->flags |= FLAG_SHOWSIGN;
-                 cp++;
-               }
-             else if (*cp == ' ')
-               {
-                 dp->flags |= FLAG_SPACE;
-                 cp++;
-               }
-             else if (*cp == '#')
-               {
-                 dp->flags |= FLAG_ALT;
-                 cp++;
-               }
-             else if (*cp == '0')
-               {
-                 dp->flags |= FLAG_ZERO;
-                 cp++;
-               }
-             else
-               break;
-           }
-
-         /* Parse the field width.  */
-         if (*cp == '*')
-           {
-             dp->width_start = cp;
-             cp++;
-             dp->width_end = cp;
-             if (max_width_length < 1)
-               max_width_length = 1;
-
-             /* Test for positional argument.  */
-             if (*cp >= '0' && *cp <= '9')
-               {
-                 const CHAR_T *np;
-
-                 for (np = cp; *np >= '0' && *np <= '9'; np++)
-                   ;
-                 if (*np == '$')
-                   {
-                     size_t n = 0;
-
-                     for (np = cp; *np >= '0' && *np <= '9'; np++)
-                       n = xsum (xtimes (n, 10), *np - '0');
-                     if (n == 0)
-                       /* Positional argument 0.  */
-                       goto error;
-                     if (size_overflow_p (n))
-                       /* n too large, would lead to out of memory later.  */
-                       goto error;
-                     dp->width_arg_index = n - 1;
-                     cp = np + 1;
-                   }
-               }
-             if (dp->width_arg_index == ARG_NONE)
-               {
-                 dp->width_arg_index = arg_posn++;
-                 if (dp->width_arg_index == ARG_NONE)
-                   /* arg_posn wrapped around.  */
-                   goto error;
-               }
-             REGISTER_ARG (dp->width_arg_index, TYPE_INT);
-           }
-         else if (*cp >= '0' && *cp <= '9')
-           {
-             size_t width_length;
-
-             dp->width_start = cp;
-             for (; *cp >= '0' && *cp <= '9'; cp++)
-               ;
-             dp->width_end = cp;
-             width_length = dp->width_end - dp->width_start;
-             if (max_width_length < width_length)
-               max_width_length = width_length;
-           }
-
-         /* Parse the precision.  */
-         if (*cp == '.')
-           {
-             cp++;
-             if (*cp == '*')
-               {
-                 dp->precision_start = cp - 1;
-                 cp++;
-                 dp->precision_end = cp;
-                 if (max_precision_length < 2)
-                   max_precision_length = 2;
-
-                 /* Test for positional argument.  */
-                 if (*cp >= '0' && *cp <= '9')
-                   {
-                     const CHAR_T *np;
-
-                     for (np = cp; *np >= '0' && *np <= '9'; np++)
-                       ;
-                     if (*np == '$')
-                       {
-                         size_t n = 0;
-
-                         for (np = cp; *np >= '0' && *np <= '9'; np++)
-                           n = xsum (xtimes (n, 10), *np - '0');
-                         if (n == 0)
-                           /* Positional argument 0.  */
-                           goto error;
-                         if (size_overflow_p (n))
-                           /* n too large, would lead to out of memory
-                              later.  */
-                           goto error;
-                         dp->precision_arg_index = n - 1;
-                         cp = np + 1;
-                       }
-                   }
-                 if (dp->precision_arg_index == ARG_NONE)
-                   {
-                     dp->precision_arg_index = arg_posn++;
-                     if (dp->precision_arg_index == ARG_NONE)
-                       /* arg_posn wrapped around.  */
-                       goto error;
-                   }
-                 REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
-               }
-             else
-               {
-                 size_t precision_length;
-
-                 dp->precision_start = cp - 1;
-                 for (; *cp >= '0' && *cp <= '9'; cp++)
-                   ;
-                 dp->precision_end = cp;
-                 precision_length = dp->precision_end - dp->precision_start;
-                 if (max_precision_length < precision_length)
-                   max_precision_length = precision_length;
-               }
-           }
-
-         {
-           arg_type type;
-
-           /* Parse argument type/size specifiers.  */
-           {
-             int flags = 0;
-
-             for (;;)
-               {
-                 if (*cp == 'h')
-                   {
-                     flags |= (1 << (flags & 1));
-                     cp++;
-                   }
-                 else if (*cp == 'L')
-                   {
-                     flags |= 4;
-                     cp++;
-                   }
-                 else if (*cp == 'l')
-                   {
-                     flags += 8;
-                     cp++;
-                   }
-                 else if (*cp == 'j')
-                   {
-                     if (sizeof (intmax_t) > sizeof (long))
-                       {
-                         /* intmax_t = long long */
-                         flags += 16;
-                       }
-                     else if (sizeof (intmax_t) > sizeof (int))
-                       {
-                         /* intmax_t = long */
-                         flags += 8;
-                       }
-                     cp++;
-                   }
-                 else if (*cp == 'z' || *cp == 'Z')
-                   {
-                     /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
-                        because the warning facility in gcc-2.95.2 understands
-                        only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784).  */
-                     if (sizeof (size_t) > sizeof (long))
-                       {
-                         /* size_t = long long */
-                         flags += 16;
-                       }
-                     else if (sizeof (size_t) > sizeof (int))
-                       {
-                         /* size_t = long */
-                         flags += 8;
-                       }
-                     cp++;
-                   }
-                 else if (*cp == 't')
-                   {
-                     if (sizeof (ptrdiff_t) > sizeof (long))
-                       {
-                         /* ptrdiff_t = long long */
-                         flags += 16;
-                       }
-                     else if (sizeof (ptrdiff_t) > sizeof (int))
-                       {
-                         /* ptrdiff_t = long */
-                         flags += 8;
-                       }
-                     cp++;
-                   }
+        {
+          size_t arg_index = ARG_NONE;
+          DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
+
+          /* Initialize the next directive.  */
+          dp->dir_start = cp - 1;
+          dp->flags = 0;
+          dp->width_start = NULL;
+          dp->width_end = NULL;
+          dp->width_arg_index = ARG_NONE;
+          dp->precision_start = NULL;
+          dp->precision_end = NULL;
+          dp->precision_arg_index = ARG_NONE;
+          dp->arg_index = ARG_NONE;
+
+          /* Test for positional argument.  */
+          if (*cp >= '0' && *cp <= '9')
+            {
+              const CHAR_T *np;
+
+              for (np = cp; *np >= '0' && *np <= '9'; np++)
+                ;
+              if (*np == '$')
+                {
+                  size_t n = 0;
+
+                  for (np = cp; *np >= '0' && *np <= '9'; np++)
+                    n = xsum (xtimes (n, 10), *np - '0');
+                  if (n == 0)
+                    /* Positional argument 0.  */
+                    goto error;
+                  if (size_overflow_p (n))
+                    /* n too large, would lead to out of memory later.  */
+                    goto error;
+                  arg_index = n - 1;
+                  cp = np + 1;
+                }
+            }
+
+          /* Read the flags.  */
+          for (;;)
+            {
+              if (*cp == '\'')
+                {
+                  dp->flags |= FLAG_GROUP;
+                  cp++;
+                }
+              else if (*cp == '-')
+                {
+                  dp->flags |= FLAG_LEFT;
+                  cp++;
+                }
+              else if (*cp == '+')
+                {
+                  dp->flags |= FLAG_SHOWSIGN;
+                  cp++;
+                }
+              else if (*cp == ' ')
+                {
+                  dp->flags |= FLAG_SPACE;
+                  cp++;
+                }
+              else if (*cp == '#')
+                {
+                  dp->flags |= FLAG_ALT;
+                  cp++;
+                }
+              else if (*cp == '0')
+                {
+                  dp->flags |= FLAG_ZERO;
+                  cp++;
+                }
+              else
+                break;
+            }
+
+          /* Parse the field width.  */
+          if (*cp == '*')
+            {
+              dp->width_start = cp;
+              cp++;
+              dp->width_end = cp;
+              if (max_width_length < 1)
+                max_width_length = 1;
+
+              /* Test for positional argument.  */
+              if (*cp >= '0' && *cp <= '9')
+                {
+                  const CHAR_T *np;
+
+                  for (np = cp; *np >= '0' && *np <= '9'; np++)
+                    ;
+                  if (*np == '$')
+                    {
+                      size_t n = 0;
+
+                      for (np = cp; *np >= '0' && *np <= '9'; np++)
+                        n = xsum (xtimes (n, 10), *np - '0');
+                      if (n == 0)
+                        /* Positional argument 0.  */
+                        goto error;
+                      if (size_overflow_p (n))
+                        /* n too large, would lead to out of memory later.  */
+                        goto error;
+                      dp->width_arg_index = n - 1;
+                      cp = np + 1;
+                    }
+                }
+              if (dp->width_arg_index == ARG_NONE)
+                {
+                  dp->width_arg_index = arg_posn++;
+                  if (dp->width_arg_index == ARG_NONE)
+                    /* arg_posn wrapped around.  */
+                    goto error;
+                }
+              REGISTER_ARG (dp->width_arg_index, TYPE_INT);
+            }
+          else if (*cp >= '0' && *cp <= '9')
+            {
+              size_t width_length;
+
+              dp->width_start = cp;
+              for (; *cp >= '0' && *cp <= '9'; cp++)
+                ;
+              dp->width_end = cp;
+              width_length = dp->width_end - dp->width_start;
+              if (max_width_length < width_length)
+                max_width_length = width_length;
+            }
+
+          /* Parse the precision.  */
+          if (*cp == '.')
+            {
+              cp++;
+              if (*cp == '*')
+                {
+                  dp->precision_start = cp - 1;
+                  cp++;
+                  dp->precision_end = cp;
+                  if (max_precision_length < 2)
+                    max_precision_length = 2;
+
+                  /* Test for positional argument.  */
+                  if (*cp >= '0' && *cp <= '9')
+                    {
+                      const CHAR_T *np;
+
+                      for (np = cp; *np >= '0' && *np <= '9'; np++)
+                        ;
+                      if (*np == '$')
+                        {
+                          size_t n = 0;
+
+                          for (np = cp; *np >= '0' && *np <= '9'; np++)
+                            n = xsum (xtimes (n, 10), *np - '0');
+                          if (n == 0)
+                            /* Positional argument 0.  */
+                            goto error;
+                          if (size_overflow_p (n))
+                            /* n too large, would lead to out of memory
+                               later.  */
+                            goto error;
+                          dp->precision_arg_index = n - 1;
+                          cp = np + 1;
+                        }
+                    }
+                  if (dp->precision_arg_index == ARG_NONE)
+                    {
+                      dp->precision_arg_index = arg_posn++;
+                      if (dp->precision_arg_index == ARG_NONE)
+                        /* arg_posn wrapped around.  */
+                        goto error;
+                    }
+                  REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
+                }
+              else
+                {
+                  size_t precision_length;
+
+                  dp->precision_start = cp - 1;
+                  for (; *cp >= '0' && *cp <= '9'; cp++)
+                    ;
+                  dp->precision_end = cp;
+                  precision_length = dp->precision_end - dp->precision_start;
+                  if (max_precision_length < precision_length)
+                    max_precision_length = precision_length;
+                }
+            }
+
+          {
+            arg_type type;
+
+            /* Parse argument type/size specifiers.  */
+            {
+              int flags = 0;
+
+              for (;;)
+                {
+                  if (*cp == 'h')
+                    {
+                      flags |= (1 << (flags & 1));
+                      cp++;
+                    }
+                  else if (*cp == 'L')
+                    {
+                      flags |= 4;
+                      cp++;
+                    }
+                  else if (*cp == 'l')
+                    {
+                      flags += 8;
+                      cp++;
+                    }
+                  else if (*cp == 'j')
+                    {
+                      if (sizeof (intmax_t) > sizeof (long))
+                        {
+                          /* intmax_t = long long */
+                          flags += 16;
+                        }
+                      else if (sizeof (intmax_t) > sizeof (int))
+                        {
+                          /* intmax_t = long */
+                          flags += 8;
+                        }
+                      cp++;
+                    }
+                  else if (*cp == 'z' || *cp == 'Z')
+                    {
+                      /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
+                         because the warning facility in gcc-2.95.2 understands
+                         only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784).  */
+                      if (sizeof (size_t) > sizeof (long))
+                        {
+                          /* size_t = long long */
+                          flags += 16;
+                        }
+                      else if (sizeof (size_t) > sizeof (int))
+                        {
+                          /* size_t = long */
+                          flags += 8;
+                        }
+                      cp++;
+                    }
+                  else if (*cp == 't')
+                    {
+                      if (sizeof (ptrdiff_t) > sizeof (long))
+                        {
+                          /* ptrdiff_t = long long */
+                          flags += 16;
+                        }
+                      else if (sizeof (ptrdiff_t) > sizeof (int))
+                        {
+                          /* ptrdiff_t = long */
+                          flags += 8;
+                        }
+                      cp++;
+                    }
 #if defined __APPLE__ && defined __MACH__
-                 /* On MacOS X 10.3, PRIdMAX is defined as "qd".
-                    We cannot change it to "lld" because PRIdMAX must also
-                    be understood by the system's printf routines.  */
-                 else if (*cp == 'q')
-                   {
-                     if (64 / 8 > sizeof (long))
-                       {
-                         /* int64_t = long long */
-                         flags += 16;
-                       }
-                     else
-                       {
-                         /* int64_t = long */
-                         flags += 8;
-                       }
-                     cp++;
-                   }
+                  /* On MacOS X 10.3, PRIdMAX is defined as "qd".
+                     We cannot change it to "lld" because PRIdMAX must also
+                     be understood by the system's printf routines.  */
+                  else if (*cp == 'q')
+                    {
+                      if (64 / 8 > sizeof (long))
+                        {
+                          /* int64_t = long long */
+                          flags += 16;
+                        }
+                      else
+                        {
+                          /* int64_t = long */
+                          flags += 8;
+                        }
+                      cp++;
+                    }
 #endif
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-                 /* On native Win32, PRIdMAX is defined as "I64d".
-                    We cannot change it to "lld" because PRIdMAX must also
-                    be understood by the system's printf routines.  */
-                 else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
-                   {
-                     if (64 / 8 > sizeof (long))
-                       {
-                         /* __int64 = long long */
-                         flags += 16;
-                       }
-                     else
-                       {
-                         /* __int64 = long */
-                         flags += 8;
-                       }
-                     cp += 3;
-                   }
+                  /* On native Win32, PRIdMAX is defined as "I64d".
+                     We cannot change it to "lld" because PRIdMAX must also
+                     be understood by the system's printf routines.  */
+                  else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
+                    {
+                      if (64 / 8 > sizeof (long))
+                        {
+                          /* __int64 = long long */
+                          flags += 16;
+                        }
+                      else
+                        {
+                          /* __int64 = long */
+                          flags += 8;
+                        }
+                      cp += 3;
+                    }
 #endif
-                 else
-                   break;
-               }
-
-             /* Read the conversion character.  */
-             c = *cp++;
-             switch (c)
-               {
-               case 'd': case 'i':
+                  else
+                    break;
+                }
+
+              /* Read the conversion character.  */
+              c = *cp++;
+              switch (c)
+                {
+                case 'd': case 'i':
 #if HAVE_LONG_LONG_INT
-                 /* If 'long long' exists and is larger than 'long':  */
-                 if (flags >= 16 || (flags & 4))
-                   type = TYPE_LONGLONGINT;
-                 else
+                  /* If 'long long' exists and is larger than 'long':  */
+                  if (flags >= 16 || (flags & 4))
+                    type = TYPE_LONGLONGINT;
+                  else
 #endif
-                 /* If 'long long' exists and is the same as 'long', we parse
-                    "lld" into TYPE_LONGINT.  */
-                 if (flags >= 8)
-                   type = TYPE_LONGINT;
-                 else if (flags & 2)
-                   type = TYPE_SCHAR;
-                 else if (flags & 1)
-                   type = TYPE_SHORT;
-                 else
-                   type = TYPE_INT;
-                 break;
-               case 'o': case 'u': case 'x': case 'X':
+                  /* If 'long long' exists and is the same as 'long', we parse
+                     "lld" into TYPE_LONGINT.  */
+                  if (flags >= 8)
+                    type = TYPE_LONGINT;
+                  else if (flags & 2)
+                    type = TYPE_SCHAR;
+                  else if (flags & 1)
+                    type = TYPE_SHORT;
+                  else
+                    type = TYPE_INT;
+                  break;
+                case 'o': case 'u': case 'x': case 'X':
 #if HAVE_LONG_LONG_INT
-                 /* If 'long long' exists and is larger than 'long':  */
-                 if (flags >= 16 || (flags & 4))
-                   type = TYPE_ULONGLONGINT;
-                 else
+                  /* If 'long long' exists and is larger than 'long':  */
+                  if (flags >= 16 || (flags & 4))
+                    type = TYPE_ULONGLONGINT;
+                  else
 #endif
-                 /* If 'unsigned long long' exists and is the same as
-                    'unsigned long', we parse "llu" into TYPE_ULONGINT.  */
-                 if (flags >= 8)
-                   type = TYPE_ULONGINT;
-                 else if (flags & 2)
-                   type = TYPE_UCHAR;
-                 else if (flags & 1)
-                   type = TYPE_USHORT;
-                 else
-                   type = TYPE_UINT;
-                 break;
-               case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
-               case 'a': case 'A':
-                 if (flags >= 16 || (flags & 4))
-                   type = TYPE_LONGDOUBLE;
-                 else
-                   type = TYPE_DOUBLE;
-                 break;
-               case 'c':
-                 if (flags >= 8)
+                  /* If 'unsigned long long' exists and is the same as
+                     'unsigned long', we parse "llu" into TYPE_ULONGINT.  */
+                  if (flags >= 8)
+                    type = TYPE_ULONGINT;
+                  else if (flags & 2)
+                    type = TYPE_UCHAR;
+                  else if (flags & 1)
+                    type = TYPE_USHORT;
+                  else
+                    type = TYPE_UINT;
+                  break;
+                case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+                case 'a': case 'A':
+                  if (flags >= 16 || (flags & 4))
+                    type = TYPE_LONGDOUBLE;
+                  else
+                    type = TYPE_DOUBLE;
+                  break;
+                case 'c':
+                  if (flags >= 8)
 #if HAVE_WINT_T
-                   type = TYPE_WIDE_CHAR;
+                    type = TYPE_WIDE_CHAR;
 #else
-                   goto error;
+                    goto error;
 #endif
-                 else
-                   type = TYPE_CHAR;
-                 break;
+                  else
+                    type = TYPE_CHAR;
+                  break;
 #if HAVE_WINT_T
-               case 'C':
-                 type = TYPE_WIDE_CHAR;
-                 c = 'c';
-                 break;
+                case 'C':
+                  type = TYPE_WIDE_CHAR;
+                  c = 'c';
+                  break;
 #endif
-               case 's':
-                 if (flags >= 8)
+                case 's':
+                  if (flags >= 8)
 #if HAVE_WCHAR_T
-                   type = TYPE_WIDE_STRING;
+                    type = TYPE_WIDE_STRING;
 #else
-                   goto error;
+                    goto error;
 #endif
-                 else
-                   type = TYPE_STRING;
-                 break;
+                  else
+                    type = TYPE_STRING;
+                  break;
 #if HAVE_WCHAR_T
-               case 'S':
-                 type = TYPE_WIDE_STRING;
-                 c = 's';
-                 break;
+                case 'S':
+                  type = TYPE_WIDE_STRING;
+                  c = 's';
+                  break;
 #endif
-               case 'p':
-                 type = TYPE_POINTER;
-                 break;
-               case 'n':
+                case 'p':
+                  type = TYPE_POINTER;
+                  break;
+                case 'n':
 #if HAVE_LONG_LONG_INT
-                 /* If 'long long' exists and is larger than 'long':  */
-                 if (flags >= 16 || (flags & 4))
-                   type = TYPE_COUNT_LONGLONGINT_POINTER;
-                 else
+                  /* If 'long long' exists and is larger than 'long':  */
+                  if (flags >= 16 || (flags & 4))
+                    type = TYPE_COUNT_LONGLONGINT_POINTER;
+                  else
 #endif
-                 /* If 'long long' exists and is the same as 'long', we parse
-                    "lln" into TYPE_COUNT_LONGINT_POINTER.  */
-                 if (flags >= 8)
-                   type = TYPE_COUNT_LONGINT_POINTER;
-                 else if (flags & 2)
-                   type = TYPE_COUNT_SCHAR_POINTER;
-                 else if (flags & 1)
-                   type = TYPE_COUNT_SHORT_POINTER;
-                 else
-                   type = TYPE_COUNT_INT_POINTER;
-                 break;
+                  /* If 'long long' exists and is the same as 'long', we parse
+                     "lln" into TYPE_COUNT_LONGINT_POINTER.  */
+                  if (flags >= 8)
+                    type = TYPE_COUNT_LONGINT_POINTER;
+                  else if (flags & 2)
+                    type = TYPE_COUNT_SCHAR_POINTER;
+                  else if (flags & 1)
+                    type = TYPE_COUNT_SHORT_POINTER;
+                  else
+                    type = TYPE_COUNT_INT_POINTER;
+                  break;
 #if ENABLE_UNISTDIO
-               /* The unistdio extensions.  */
-               case 'U':
-                 if (flags >= 16)
-                   type = TYPE_U32_STRING;
-                 else if (flags >= 8)
-                   type = TYPE_U16_STRING;
-                 else
-                   type = TYPE_U8_STRING;
-                 break;
+                /* The unistdio extensions.  */
+                case 'U':
+                  if (flags >= 16)
+                    type = TYPE_U32_STRING;
+                  else if (flags >= 8)
+                    type = TYPE_U16_STRING;
+                  else
+                    type = TYPE_U8_STRING;
+                  break;
 #endif
-               case '%':
-                 type = TYPE_NONE;
-                 break;
-               default:
-                 /* Unknown conversion character.  */
-                 goto error;
-               }
-           }
-
-           if (type != TYPE_NONE)
-             {
-               dp->arg_index = arg_index;
-               if (dp->arg_index == ARG_NONE)
-                 {
-                   dp->arg_index = arg_posn++;
-                   if (dp->arg_index == ARG_NONE)
-                     /* arg_posn wrapped around.  */
-                     goto error;
-                 }
-               REGISTER_ARG (dp->arg_index, type);
-             }
-           dp->conversion = c;
-           dp->dir_end = cp;
-         }
-
-         d->count++;
-         if (d->count >= d_allocated)
-           {
-             size_t memory_size;
-             DIRECTIVE *memory;
-
-             d_allocated = xtimes (d_allocated, 2);
-             memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
-             if (size_overflow_p (memory_size))
-               /* Overflow, would lead to out of memory.  */
-               goto out_of_memory;
-             memory = (DIRECTIVE *) realloc (d->dir, memory_size);
-             if (memory == NULL)
-               /* Out of memory.  */
-               goto out_of_memory;
-             d->dir = memory;
-           }
-       }
+                case '%':
+                  type = TYPE_NONE;
+                  break;
+                default:
+                  /* Unknown conversion character.  */
+                  goto error;
+                }
+            }
+
+            if (type != TYPE_NONE)
+              {
+                dp->arg_index = arg_index;
+                if (dp->arg_index == ARG_NONE)
+                  {
+                    dp->arg_index = arg_posn++;
+                    if (dp->arg_index == ARG_NONE)
+                      /* arg_posn wrapped around.  */
+                      goto error;
+                  }
+                REGISTER_ARG (dp->arg_index, type);
+              }
+            dp->conversion = c;
+            dp->dir_end = cp;
+          }
+
+          d->count++;
+          if (d->count >= d_allocated)
+            {
+              size_t memory_size;
+              DIRECTIVE *memory;
+
+              d_allocated = xtimes (d_allocated, 2);
+              memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
+              if (size_overflow_p (memory_size))
+                /* Overflow, would lead to out of memory.  */
+                goto out_of_memory;
+              memory = (DIRECTIVE *) realloc (d->dir, memory_size);
+              if (memory == NULL)
+                /* Out of memory.  */
+                goto out_of_memory;
+              d->dir = memory;
+            }
+        }
 #if CHAR_T_ONLY_ASCII
       else if (!c_isascii (c))
-       {
-         /* Non-ASCII character.  Not supported.  */
-         goto error;
-       }
+        {
+          /* Non-ASCII character.  Not supported.  */
+          goto error;
+        }
 #endif
     }
   d->dir[d->count].dir_start = cp;
index de7fc49b6fbc17d79196cdd59b6eac099ba63624..0f2b708209eedb792dfd8bf56848a6d899ccb781 100644 (file)
@@ -1,9 +1,10 @@
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2003, 2005, 2007, 2009-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 
 
 /* Flags */
-#define FLAG_GROUP      1      /* ' flag */
-#define FLAG_LEFT       2      /* - flag */
-#define FLAG_SHOWSIGN   4      /* + flag */
-#define FLAG_SPACE      8      /* space flag */
-#define FLAG_ALT       16      /* # flag */
-#define FLAG_ZERO      32
+#define FLAG_GROUP       1      /* ' flag */
+#define FLAG_LEFT        2      /* - flag */
+#define FLAG_SHOWSIGN    4      /* + flag */
+#define FLAG_SPACE       8      /* space flag */
+#define FLAG_ALT        16      /* # flag */
+#define FLAG_ZERO       32
 
 /* arg_index value indicating that no argument is consumed.  */
-#define ARG_NONE       (~(size_t)0)
+#define ARG_NONE        (~(size_t)0)
 
 /* xxx_directive: A parsed directive.
    xxx_directives: A parsed format string.  */
@@ -163,10 +164,10 @@ extern int
        u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a);
 extern int
        u16_printf_parse (const uint16_t *format, u16_directives *d,
-                        arguments *a);
+                         arguments *a);
 extern int
        u32_printf_parse (const uint32_t *format, u32_directives *d,
-                        arguments *a);
+                         arguments *a);
 #else
 # ifdef STATIC
 STATIC
index bc5cc7976f68453eba0fb84ac0afaaa465369246..dbb61df3dc7c7a8d621518af8941004687180f53 100644 (file)
@@ -1,10 +1,10 @@
 # Add this package to a list of references stored in a text file.
 #
-#   Copyright (C) 2000 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009, 2010 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)
+#   the Free Software Foundation; either version 3, or (at your option)
 #   any later version.
 #
 #   This program is distributed in the hope that it will be useful,
index e9301bf2ea4d93569d9bac866e9c56aa9551ab25..4c31a6eafd83f02ef617a58cb6464eb13e05a19c 100644 (file)
@@ -1,10 +1,10 @@
 # Remove this package from a list of references stored in a text file.
 #
-#   Copyright (C) 2000 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009, 2010 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)
+#   the Free Software Foundation; either version 3, or (at your option)
 #   any later version.
 #
 #   This program is distributed in the hope that it will be useful,
index 6472ff6b2eb0d1b7707ddce159c58bd9da81d3fc..86ca02b0c5b08b70f466ff16aea09790eb8826cc 100644 (file)
@@ -1,12 +1,12 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009
-   Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+   Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -383,7 +383,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
             applies to multibyte character sets; for single byte character
             sets, the SIMPLE_BRACKET again suffices.  */
          if (dfa->mb_cur_max > 1
-             && (cset->nchar_classes || cset->non_match
+             && (cset->nchar_classes || cset->non_match || cset->nranges
 # ifdef _LIBC
                  || cset->nequiv_classes
 # endif /* _LIBC */
@@ -636,7 +636,7 @@ free_dfa_content (re_dfa_t *dfa)
            re_dfastate_t *state = entry->array[j];
            free_state (state);
          }
-        re_free (entry->array);
+       re_free (entry->array);
       }
   re_free (dfa->state_table);
 #ifdef RE_ENABLE_I18N
@@ -850,6 +850,9 @@ static reg_errcode_t
 init_dfa (re_dfa_t *dfa, size_t pat_len)
 {
   __re_size_t table_size;
+#ifndef _LIBC
+  char *codeset_name;
+#endif
 #ifdef RE_ENABLE_I18N
   size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t));
 #else
@@ -893,7 +896,9 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
   dfa->map_notascii = (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_TO_NONASCII)
                       != 0);
 #else
-  if (strcmp (locale_charset (), "UTF-8") == 0)
+  codeset_name = nl_langinfo (CODESET);
+  if (strcasecmp (codeset_name, "UTF-8") == 0
+      || strcasecmp (codeset_name, "UTF8") == 0)
     dfa->is_utf8 = 1;
 
   /* We check exhaustively in the loop below if this charset is a
@@ -1016,7 +1021,10 @@ create_initial_state (re_dfa_t *dfa)
            Idx dest_idx = dfa->edests[node_idx].elems[0];
            if (!re_node_set_contains (&init_nodes, dest_idx))
              {
-               re_node_set_merge (&init_nodes, dfa->eclosures + dest_idx);
+               reg_errcode_t merge_err
+                  = re_node_set_merge (&init_nodes, dfa->eclosures + dest_idx);
+               if (merge_err != REG_NOERROR)
+                 return merge_err;
                i = 0;
              }
          }
@@ -1085,8 +1093,8 @@ optimize_utf8 (re_dfa_t *dfa)
          }
        break;
       case OP_PERIOD:
-        has_period = true;
-        break;
+       has_period = true;
+       break;
       case OP_BACK_REF:
       case OP_ALT:
       case END_OF_RE:
@@ -1187,7 +1195,7 @@ analyze (regex_t *preg)
     {
       dfa->inveclosures = re_malloc (re_node_set, dfa->nodes_len);
       if (BE (dfa->inveclosures == NULL, 0))
-        return REG_ESPACE;
+       return REG_ESPACE;
       ret = calc_inveclosure (dfa);
     }
 
@@ -1209,16 +1217,16 @@ postorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
         if that's the only child).  */
       while (node->left || node->right)
        if (node->left)
-          node = node->left;
-        else
-          node = node->right;
+         node = node->left;
+       else
+         node = node->right;
 
       do
        {
          reg_errcode_t err = fn (extra, node);
          if (BE (err != REG_NOERROR, 0))
            return err;
-          if (node->parent == NULL)
+         if (node->parent == NULL)
            return REG_NOERROR;
          prev = node;
          node = node->parent;
@@ -1252,7 +1260,7 @@ preorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
              prev = node;
              node = node->parent;
              if (!node)
-               return REG_NOERROR;
+               return REG_NOERROR;
            }
          node = node->right;
        }
@@ -1275,13 +1283,13 @@ optimize_subexps (void *extra, bin_tree_t *node)
     }
 
   else if (node->token.type == SUBEXP
-           && node->left && node->left->token.type == SUBEXP)
+          && node->left && node->left->token.type == SUBEXP)
     {
       Idx other_idx = node->left->token.opr.idx;
 
       node->left = node->left->left;
       if (node->left)
-        node->left->parent = node;
+       node->left->parent = node;
 
       dfa->subexp_map[other_idx] = dfa->subexp_map[node->token.opr.idx];
       if (other_idx < BITSET_WORD_BITS)
@@ -1366,9 +1374,9 @@ calc_first (void *extra, bin_tree_t *node)
       node->first = node;
       node->node_idx = re_dfa_add_node (dfa, node->token);
       if (BE (node->node_idx == REG_MISSING, 0))
-        return REG_ESPACE;
+       return REG_ESPACE;
       if (node->token.type == ANCHOR)
-        dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type;
+       dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type;
     }
   return REG_NOERROR;
 }
@@ -1390,7 +1398,7 @@ calc_next (void *extra, bin_tree_t *node)
       if (node->left)
        node->left->next = node->next;
       if (node->right)
-        node->right->next = node->next;
+       node->right->next = node->next;
       break;
     }
   return REG_NOERROR;
@@ -1441,7 +1449,7 @@ link_nfa_nodes (void *extra, bin_tree_t *node)
     case OP_BACK_REF:
       dfa->nexts[idx] = node->next->node_idx;
       if (node->token.type == OP_BACK_REF)
-       re_node_set_init_1 (dfa->edests + idx, dfa->nexts[idx]);
+       err = re_node_set_init_1 (dfa->edests + idx, dfa->nexts[idx]);
       break;
 
     default:
@@ -1498,7 +1506,6 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
             destination.  */
          org_dest = dfa->edests[org_node].elems[0];
          re_node_set_empty (dfa->edests + clone_node);
-         clone_dest = search_duplicated_node (dfa, org_dest, constraint);
          /* If the node is root_node itself, it means the epsilon closure
             has a loop.  Then tie it to the destination of the root_node.  */
          if (org_node == root_node && clone_node != org_node)
@@ -1542,7 +1549,7 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
            }
          else
            {
-             /* There is a duplicated node which satisfy the constraint,
+             /* There is a duplicated node which satisfies the constraint,
                 use it to avoid infinite loop.  */
              ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
              if (BE (! ok, 0))
@@ -1674,10 +1681,9 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
 {
   reg_errcode_t err;
   Idx i;
-  bool incomplete;
-  bool ok;
   re_node_set eclosure;
-  incomplete = false;
+  bool ok;
+  bool incomplete = false;
   err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1);
   if (BE (err != REG_NOERROR, 0))
     return err;
@@ -1722,7 +1728,9 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
        else
          eclosure_elem = dfa->eclosures[edest];
        /* Merge the epsilon closure of `edest'.  */
-       re_node_set_merge (&eclosure, &eclosure_elem);
+       err = re_node_set_merge (&eclosure, &eclosure_elem);
+       if (BE (err != REG_NOERROR, 0))
+         return err;
        /* If the epsilon closure of `edest' is incomplete,
           the epsilon closure of this node is also incomplete.  */
        if (dfa->eclosures[edest].nelem == 0)
@@ -1732,7 +1740,7 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
          }
       }
 
-  /* Epsilon closures include itself.  */
+  /* An epsilon closure includes itself.  */
   ok = re_node_set_insert (&eclosure, node);
   if (BE (! ok, 0))
     return REG_ESPACE;
@@ -2319,7 +2327,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
          && dfa->word_ops_used == 0)
        init_word_char (dfa);
       if (token->opr.ctx_type == WORD_DELIM
-          || token->opr.ctx_type == NOT_WORD_DELIM)
+         || token->opr.ctx_type == NOT_WORD_DELIM)
        {
          bin_tree_t *tree_first, *tree_last;
          if (token->opr.ctx_type == WORD_DELIM)
@@ -2327,13 +2335,13 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
              token->opr.ctx_type = WORD_FIRST;
              tree_first = create_token_tree (dfa, NULL, NULL, token);
              token->opr.ctx_type = WORD_LAST;
-            }
-          else
-            {
+           }
+         else
+           {
              token->opr.ctx_type = INSIDE_WORD;
              tree_first = create_token_tree (dfa, NULL, NULL, token);
              token->opr.ctx_type = INSIDE_NOTWORD;
-            }
+           }
          tree_last = create_token_tree (dfa, NULL, NULL, token);
          tree = create_tree (dfa, tree_first, tree_last, OP_ALT);
          if (BE (tree_first == NULL || tree_last == NULL || tree == NULL, 0))
@@ -2444,7 +2452,7 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
     {
       tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
       if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
-        *err = REG_EPAREN;
+       *err = REG_EPAREN;
       if (BE (*err != REG_NOERROR, 0))
        return NULL;
     }
@@ -2515,7 +2523,8 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
          return elem;
        }
 
-      if (BE (end != REG_MISSING && start > end, 0))
+      if (BE ((end != REG_MISSING && start > end)
+             || token->type != OP_CLOSE_DUP_NUM, 0))
        {
          /* First number greater than second.  */
          *err = REG_BADBR;
@@ -2568,10 +2577,14 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
   if (BE (tree == NULL, 0))
     goto parse_dup_op_espace;
 
+/* From gnulib's "intprops.h":
+   True if the arithmetic type T is signed.  */
+#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
   /* This loop is actually executed only when end != REG_MISSING,
      to rewrite <re>{0,n} as (<re>(<re>...<re>?)?)?...  We have
      already created the start+1-th copy.  */
-  if ((Idx) -1 < 0 || end != REG_MISSING)
+  if (TYPE_SIGNED (Idx) || end != REG_MISSING)
     for (i = start + 2; i <= end; ++i)
       {
        elem = duplicate_tree (elem, dfa);
@@ -2609,11 +2622,17 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
 static reg_errcode_t
 internal_function
 # ifdef RE_ENABLE_I18N
-build_range_exp (bitset_t sbcset, re_charset_t *mbcset, Idx *range_alloc,
-                bracket_elem_t *start_elem, bracket_elem_t *end_elem)
+build_range_exp (const reg_syntax_t syntax,
+                 bitset_t sbcset,
+                 re_charset_t *mbcset,
+                 Idx *range_alloc,
+                 const bracket_elem_t *start_elem,
+                 const bracket_elem_t *end_elem)
 # else /* not RE_ENABLE_I18N */
-build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
-                bracket_elem_t *end_elem)
+build_range_exp (const reg_syntax_t syntax,
+                 bitset_t sbcset,
+                 const bracket_elem_t *start_elem,
+                 const bracket_elem_t *end_elem)
 # endif /* not RE_ENABLE_I18N */
 {
   unsigned int start_ch, end_ch;
@@ -2652,7 +2671,9 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
       return REG_ECOLLATE;
     cmp_buf[0] = start_wc;
     cmp_buf[4] = end_wc;
-    if (wcscoll (cmp_buf, cmp_buf + 4) > 0)
+
+    if (BE ((syntax & RE_NO_EMPTY_RANGES)
+            && wcscoll (cmp_buf, cmp_buf + 4) > 0, 0))
       return REG_ERANGE;
 
     /* Got valid collation sequence values, add them as a new entry.
@@ -2662,9 +2683,9 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
        no MBCSET if dfa->mb_cur_max == 1.  */
     if (mbcset)
       {
-        /* Check the space of the arrays.  */
-        if (BE (*range_alloc == mbcset->nranges, 0))
-          {
+       /* Check the space of the arrays.  */
+       if (BE (*range_alloc == mbcset->nranges, 0))
+         {
            /* There is not enough space, need realloc.  */
            wchar_t *new_array_start, *new_array_end;
            Idx new_nranges;
@@ -2674,9 +2695,9 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
            /* Use realloc since mbcset->range_starts and mbcset->range_ends
               are NULL if *range_alloc == 0.  */
            new_array_start = re_realloc (mbcset->range_starts, wchar_t,
-                                         new_nranges);
+                                         new_nranges);
            new_array_end = re_realloc (mbcset->range_ends, wchar_t,
-                                       new_nranges);
+                                       new_nranges);
 
            if (BE (new_array_start == NULL || new_array_end == NULL, 0))
              return REG_ESPACE;
@@ -2684,10 +2705,10 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
            mbcset->range_starts = new_array_start;
            mbcset->range_ends = new_array_end;
            *range_alloc = new_nranges;
-          }
+         }
 
-        mbcset->range_starts[mbcset->nranges] = start_wc;
-        mbcset->range_ends[mbcset->nranges++] = end_wc;
+       mbcset->range_starts[mbcset->nranges] = start_wc;
+       mbcset->range_ends[mbcset->nranges++] = end_wc;
       }
 
     /* Build the table for single byte characters.  */
@@ -2799,7 +2820,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       return elem;
     }
 
-  /* Local function for parse_bracket_exp used in _LIBC environement.
+  /* Local function for parse_bracket_exp used in _LIBC environment.
      Look up the collation sequence value of BR_ELEM.
      Return the value if succeeded, UINT_MAX otherwise.  */
 
@@ -2823,7 +2844,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
        }
       else if (br_elem->type == MB_CHAR)
        {
-         return __collseq_table_lookup (collseqwc, br_elem->opr.wch);
+         if (nrules != 0)
+           return __collseq_table_lookup (collseqwc, br_elem->opr.wch);
        }
       else if (br_elem->type == COLL_SYM)
        {
@@ -2904,8 +2926,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
         build below suffices. */
       if (nrules > 0 || dfa->mb_cur_max > 1)
        {
-          /* Check the space of the arrays.  */
-          if (BE (*range_alloc == mbcset->nranges, 0))
+         /* Check the space of the arrays.  */
+         if (BE (*range_alloc == mbcset->nranges, 0))
            {
              /* There is not enough space, need realloc.  */
              uint32_t *new_array_start;
@@ -2917,18 +2939,18 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
              new_array_start = re_realloc (mbcset->range_starts, uint32_t,
                                            new_nranges);
              new_array_end = re_realloc (mbcset->range_ends, uint32_t,
-                                         new_nranges);
+                                         new_nranges);
 
              if (BE (new_array_start == NULL || new_array_end == NULL, 0))
-               return REG_ESPACE;
+               return REG_ESPACE;
 
              mbcset->range_starts = new_array_start;
              mbcset->range_ends = new_array_end;
              *range_alloc = new_nranges;
            }
 
-          mbcset->range_starts[mbcset->nranges] = start_collseq;
-          mbcset->range_ends[mbcset->nranges++] = end_collseq;
+         mbcset->range_starts[mbcset->nranges] = start_collseq;
+         mbcset->range_ends[mbcset->nranges++] = end_collseq;
        }
 
       /* Build the table for single byte characters.  */
@@ -3154,11 +3176,11 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
                                  &start_elem, &end_elem);
 #else
 # ifdef RE_ENABLE_I18N
-         *err = build_range_exp (sbcset,
+         *err = build_range_exp (syntax, sbcset,
                                  dfa->mb_cur_max > 1 ? mbcset : NULL,
                                  &range_alloc, &start_elem, &end_elem);
 # else
-         *err = build_range_exp (sbcset, &start_elem, &end_elem);
+         *err = build_range_exp (syntax, sbcset, &start_elem, &end_elem);
 # endif
 #endif /* RE_ENABLE_I18N */
          if (BE (*err != REG_NOERROR, 0))
@@ -3262,17 +3284,17 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
         of having both SIMPLE_BRACKET and COMPLEX_BRACKET.  */
       if (sbc_idx < BITSET_WORDS)
        {
-          /* Build a tree for simple bracket.  */
-          br_token.type = SIMPLE_BRACKET;
-          br_token.opr.sbcset = sbcset;
-          work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
-          if (BE (work_tree == NULL, 0))
-            goto parse_bracket_exp_espace;
+         /* Build a tree for simple bracket.  */
+         br_token.type = SIMPLE_BRACKET;
+         br_token.opr.sbcset = sbcset;
+         work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
+         if (BE (work_tree == NULL, 0))
+           goto parse_bracket_exp_espace;
 
-          /* Then join them by ALT node.  */
-          work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT);
-          if (BE (work_tree == NULL, 0))
-            goto parse_bracket_exp_espace;
+         /* Then join them by ALT node.  */
+         work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT);
+         if (BE (work_tree == NULL, 0))
+           goto parse_bracket_exp_espace;
        }
       else
        {
@@ -3291,7 +3313,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       br_token.opr.sbcset = sbcset;
       work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
       if (BE (work_tree == NULL, 0))
-        goto parse_bracket_exp_espace;
+       goto parse_bracket_exp_espace;
     }
   return work_tree;
 
@@ -3430,7 +3452,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
 
       /* Build single byte matcing table for this equivalence class.  */
       char_buf[1] = (unsigned char) '\0';
-      len = weights[idx1];
+      len = weights[idx1 & 0xffffff];
       for (ch = 0; ch < SBC_MAX; ++ch)
        {
          char_buf[0] = ch;
@@ -3442,11 +3464,15 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
          if (idx2 == 0)
            /* This isn't a valid character.  */
            continue;
-         if (len == weights[idx2])
+         /* Compare only if the length matches and the collation rule
+            index is the same.  */
+         if (len == weights[idx2 & 0xffffff] && (idx1 >> 24) == (idx2 >> 24))
            {
              int cnt = 0;
+
              while (cnt <= len &&
-                    weights[idx1 + 1 + cnt] == weights[idx2 + 1 + cnt])
+                    weights[(idx1 & 0xffffff) + 1 + cnt]
+                    == weights[(idx2 & 0xffffff) + 1 + cnt])
                ++cnt;
 
              if (cnt > len)
@@ -3842,7 +3868,7 @@ duplicate_tree (const bin_tree_t *root, re_dfa_t *dfa)
              node = node->parent;
              dup_node = dup_node->parent;
              if (!node)
-               return dup_root;
+               return dup_root;
            }
          node = node->right;
          p_new = &dup_node->right;
index 4899e150451976262a57792eb5f658c919ff3853..f62dd5702e24fb0bb1949d821b4acbeb24890159 100644 (file)
@@ -9,6 +9,7 @@ Index: gnulib/Makefile.am
 +if GCC_COMPILER
 +  AM_CFLAGS = -Wno-error -Wno-sign-compare
 +endif
+ AM_CFLAGS =
  
  noinst_LTLIBRARIES += libgnu.la
  
index 6f42fa014782941304af48ccf11826cd02349de5..57565d78ef319fba1b4e6e6531188524d94c25cd 100755 (executable)
@@ -4,7 +4,7 @@
 # same version as was used to generate the source in the repository,
 # run the following in your git repository:
 #
-#   git checkout 8d2524ce78ca107074727cbd8780c26a203a107c
+#   git checkout 09b8fa6cb737f6e091931c494cbd56d12b3ad08d
 
 # get to the project root
 cd `dirname $0`/../..
@@ -39,9 +39,10 @@ shopt -u nullglob
 ## Add your modules here, then see below if you need to patch them. ##
 ######################################################################
 
-GNULIB_MODULES="getaddrinfo lock visibility base64 physmem fsusage"
-GNULIB_MODULES="$GNULIB_MODULES mkdtemp getopt full-read full-write"
-GNULIB_MODULES="$GNULIB_MODULES lseek ftruncate fseeko ftello regex"
+GNULIB_MODULES="getaddrinfo lock base64 physmem fsusage"
+GNULIB_MODULES="$GNULIB_MODULES mkdtemp getopt-gnu full-read full-write"
+GNULIB_MODULES="$GNULIB_MODULES lseek ftruncate fseeko ftello regex environ"
+GNULIB_MODULES="$GNULIB_MODULES inet_pton"
 
 ######################################################################
 ## End modules                                                      ##
index d4eb726b295313342c08c28f45986c8afaf1a72d..ba0eebee728f9690d90477599680ccb134d24ce4 100644 (file)
@@ -1,11 +1,12 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005, 2006, 2009, 2010 Free Software Foundation,
+   Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
index 7a79ca37242e3a4ed2447f86a5486265ae4ad737..e8bd5496cf88c7e76e340386f8bf1fda4f158922 100644 (file)
@@ -1,12 +1,13 @@
 /* Definitions for data structures and routines for the regular
    expression library.
-   Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006
-   Free Software Foundation, Inc.
+   Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1998,
+   2000, 2001, 2002, 2003, 2005, 2006, 2009, 2010 Free Software Foundation,
+   Inc.
    This file is part of the GNU C Library.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -113,10 +114,10 @@ typedef unsigned long int reg_syntax_t;
 /* If this bit is set, then ^ and $ are always anchors (outside bracket
      expressions, of course).
    If this bit is not set, then it depends:
-        ^  is an anchor if it is at the beginning of a regular
-           expression or after an open-group or an alternation operator;
-        $  is an anchor if it is at the end of a regular expression, or
-           before a close-group or an alternation operator.
+       ^  is an anchor if it is at the beginning of a regular
+          expression or after an open-group or an alternation operator;
+       $  is an anchor if it is at the end of a regular expression, or
+          before a close-group or an alternation operator.
 
    This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
    POSIX draft 11.2 says that * etc. in leading positions is undefined.
@@ -218,8 +219,8 @@ typedef unsigned long int reg_syntax_t;
    whether ^ should be special.  */
 # define RE_CARET_ANCHORS_HERE (RE_ICASE << 1)
 
-/* If this bit is set, then \{ cannot be first in an bre or
-   immediately after an alternation or begin-group operator.  */
+/* If this bit is set, then \{ cannot be first in a regex or
+   immediately after an alternation, open-group or \} operator.  */
 # define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1)
 
 /* If this bit is set, then no_sub will be set to 1 during
@@ -494,8 +495,8 @@ struct re_pattern_buffer
 #endif
   unsigned int _REG_RE_NAME (regs_allocated) : 2;
 
-  /* Set to zero when `regex_compile' compiles a pattern; set to one
-     by `re_compile_fastmap' if it updates the fastmap.  */
+  /* Set to zero when `re_compile_pattern' compiles a pattern; set to
+     one by `re_compile_fastmap' if it updates the fastmap.  */
   unsigned int _REG_RE_NAME (fastmap_accurate) : 1;
 
   /* If set, `re_match_2' does not return information about
@@ -609,8 +610,8 @@ extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer,
    register data.
 
    Unless this function is called, the first search or match using
-   PATTERN_BUFFER will allocate its own register data, without
-   freeing the old data.  */
+   BUFFER will allocate its own register data, without freeing the old
+   data.  */
 extern void re_set_registers (struct re_pattern_buffer *__buffer,
                              struct re_registers *__regs,
                              __re_size_t __num_regs,
index 904b88ed934a2a19ab53db2fe2fcbe74b58a3d97..98b8d5d21bb6a2db4226c37a633c033c9fea3791 100644 (file)
@@ -1,12 +1,12 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+   Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -36,7 +36,7 @@ static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa,
    re_string_reconstruct before using the object.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len,
                    RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa)
 {
@@ -64,7 +64,7 @@ re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len,
 /* This function allocate the buffers, and initialize them.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_string_construct (re_string_t *pstr, const char *str, Idx len,
                     RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa)
 {
@@ -127,7 +127,7 @@ re_string_construct (re_string_t *pstr, const char *str, Idx len,
 /* Helper functions for re_string_allocate, and re_string_construct.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len)
 {
 #ifdef RE_ENABLE_I18N
@@ -267,7 +267,7 @@ build_wcs_buffer (re_string_t *pstr)
    but for REG_ICASE.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 build_wcs_upper_buffer (re_string_t *pstr)
 {
   mbstate_t prev_st;
@@ -430,8 +430,8 @@ build_wcs_upper_buffer (re_string_t *pstr)
                    src_idx += mbclen;
                    continue;
                  }
-                else
-                  memcpy (pstr->mbs + byte_idx, p, mbclen);
+               else
+                 memcpy (pstr->mbs + byte_idx, p, mbclen);
              }
            else
              memcpy (pstr->mbs + byte_idx, p, mbclen);
@@ -569,7 +569,7 @@ re_string_translate_buffer (re_string_t *pstr)
    convert to upper case in case of REG_ICASE, apply translation.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
 {
   Idx offset;
@@ -733,15 +733,17 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
                          mbstate_t cur_state;
                          wchar_t wc2;
                          Idx mlen = raw + pstr->len - p;
-                         unsigned char buf[6];
                          size_t mbclen;
 
+#if 0 /* dead code: buf is set but never used */
+                         unsigned char buf[6];
                          if (BE (pstr->trans != NULL, 0))
                            {
                              int i = mlen < 6 ? mlen : 6;
                              while (--i >= 0)
                                buf[i] = pstr->trans[p[i]];
                            }
+#endif
                          /* XXX Don't use mbrtowc, we know which conversion
                             to use (UTF-8 -> UCS4).  */
                          memset (&cur_state, 0, sizeof (cur_state));
@@ -964,7 +966,7 @@ re_string_context_at (const re_string_t *input, Idx idx, int eflags)
 /* Functions for set operation.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_node_set_alloc (re_node_set *set, Idx size)
 {
   set->alloc = size;
@@ -976,7 +978,7 @@ re_node_set_alloc (re_node_set *set, Idx size)
 }
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_node_set_init_1 (re_node_set *set, Idx elem)
 {
   set->alloc = 1;
@@ -992,7 +994,7 @@ re_node_set_init_1 (re_node_set *set, Idx elem)
 }
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_node_set_init_2 (re_node_set *set, Idx elem1, Idx elem2)
 {
   set->alloc = 2;
@@ -1022,7 +1024,7 @@ re_node_set_init_2 (re_node_set *set, Idx elem1, Idx elem2)
 }
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_node_set_init_copy (re_node_set *dest, const re_node_set *src)
 {
   dest->nelem = src->nelem;
@@ -1047,7 +1049,7 @@ re_node_set_init_copy (re_node_set *dest, const re_node_set *src)
    Note: We assume dest->elems is NULL, when dest->alloc is 0.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1,
                           const re_node_set *src2)
 {
@@ -1062,7 +1064,7 @@ re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1,
       Idx new_alloc = src1->nelem + src2->nelem + dest->alloc;
       Idx *new_elems = re_realloc (dest->elems, Idx, new_alloc);
       if (BE (new_elems == NULL, 0))
-        return REG_ESPACE;
+       return REG_ESPACE;
       dest->elems = new_elems;
       dest->alloc = new_alloc;
     }
@@ -1112,20 +1114,20 @@ re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1,
   if (delta > 0 && REG_VALID_INDEX (id))
     for (;;)
       {
-        if (dest->elems[is] > dest->elems[id])
-          {
-            /* Copy from the top.  */
-            dest->elems[id + delta--] = dest->elems[is--];
-            if (delta == 0)
-              break;
-          }
-        else
-          {
-            /* Slide from the bottom.  */
-            dest->elems[id + delta] = dest->elems[id];
-            if (! REG_VALID_INDEX (--id))
-              break;
-          }
+       if (dest->elems[is] > dest->elems[id])
+         {
+           /* Copy from the top.  */
+           dest->elems[id + delta--] = dest->elems[is--];
+           if (delta == 0)
+             break;
+         }
+       else
+         {
+           /* Slide from the bottom.  */
+           dest->elems[id + delta] = dest->elems[id];
+           if (! REG_VALID_INDEX (--id))
+             break;
+         }
       }
 
   /* Copy remaining SRC elements.  */
@@ -1138,7 +1140,7 @@ re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1,
    DEST. Return value indicate the error code or REG_NOERROR if succeeded.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_node_set_init_union (re_node_set *dest, const re_node_set *src1,
                        const re_node_set *src2)
 {
@@ -1191,7 +1193,7 @@ re_node_set_init_union (re_node_set *dest, const re_node_set *src1,
    DEST. Return value indicate the error code or REG_NOERROR if succeeded.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_node_set_merge (re_node_set *dest, const re_node_set *src)
 {
   Idx is, id, sbase, delta;
@@ -1221,11 +1223,11 @@ re_node_set_merge (re_node_set *dest, const re_node_set *src)
        REG_VALID_INDEX (is) && REG_VALID_INDEX (id); )
     {
       if (dest->elems[id] == src->elems[is])
-        is--, id--;
+       is--, id--;
       else if (dest->elems[id] < src->elems[is])
-        dest->elems[--sbase] = src->elems[is--];
+       dest->elems[--sbase] = src->elems[is--];
       else /* if (dest->elems[id] > src->elems[is]) */
-        --id;
+       --id;
     }
 
   if (REG_VALID_INDEX (is))
@@ -1247,21 +1249,21 @@ re_node_set_merge (re_node_set *dest, const re_node_set *src)
   for (;;)
     {
       if (dest->elems[is] > dest->elems[id])
-        {
+       {
          /* Copy from the top.  */
-          dest->elems[id + delta--] = dest->elems[is--];
+         dest->elems[id + delta--] = dest->elems[is--];
          if (delta == 0)
            break;
        }
       else
-        {
-          /* Slide from the bottom.  */
-          dest->elems[id + delta] = dest->elems[id];
+       {
+         /* Slide from the bottom.  */
+         dest->elems[id + delta] = dest->elems[id];
          if (! REG_VALID_INDEX (--id))
            {
              /* Copy remaining SRC elements.  */
              memcpy (dest->elems, dest->elems + sbase,
-                     delta * sizeof (Idx));
+                     delta * sizeof (Idx));
              break;
            }
        }
@@ -1275,7 +1277,7 @@ re_node_set_merge (re_node_set *dest, const re_node_set *src)
    Return true if successful.  */
 
 static bool
-internal_function
+internal_function __attribute_warn_unused_result__
 re_node_set_insert (re_node_set *set, Idx elem)
 {
   Idx idx;
@@ -1308,12 +1310,12 @@ re_node_set_insert (re_node_set *set, Idx elem)
     {
       idx = 0;
       for (idx = set->nelem; idx > 0; idx--)
-        set->elems[idx] = set->elems[idx - 1];
+       set->elems[idx] = set->elems[idx - 1];
     }
   else
     {
       for (idx = set->nelem; set->elems[idx - 1] > elem; idx--)
-        set->elems[idx] = set->elems[idx - 1];
+       set->elems[idx] = set->elems[idx - 1];
     }
 
   /* Insert the new element.  */
@@ -1327,7 +1329,7 @@ re_node_set_insert (re_node_set *set, Idx elem)
    Return true if successful.  */
 
 static bool
-internal_function
+internal_function __attribute_warn_unused_result__
 re_node_set_insert_last (re_node_set *set, Idx elem)
 {
   /* Realloc if we need.  */
@@ -1473,7 +1475,7 @@ calc_state_hash (const re_node_set *nodes, unsigned int context)
           optimization.  */
 
 static re_dfastate_t *
-internal_function
+internal_function __attribute_warn_unused_result__
 re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa,
                  const re_node_set *nodes)
 {
@@ -1521,7 +1523,7 @@ re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa,
           optimization.  */
 
 static re_dfastate_t *
-internal_function
+internal_function __attribute_warn_unused_result__
 re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa,
                          const re_node_set *nodes, unsigned int context)
 {
@@ -1562,6 +1564,7 @@ re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa,
    indicates the error code if failed.  */
 
 static reg_errcode_t
+__attribute_warn_unused_result__
 register_state (const re_dfa_t *dfa, re_dfastate_t *newstate,
                re_hashval_t hash)
 {
@@ -1616,7 +1619,7 @@ free_state (re_dfastate_t *state)
    Return the new state if succeeded, otherwise return NULL.  */
 
 static re_dfastate_t *
-internal_function
+internal_function __attribute_warn_unused_result__
 create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
                    re_hashval_t hash)
 {
@@ -1666,7 +1669,7 @@ create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
    Return the new state if succeeded, otherwise return NULL.  */
 
 static re_dfastate_t *
-internal_function
+internal_function __attribute_warn_unused_result__
 create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
                    unsigned int context, re_hashval_t hash)
 {
@@ -1715,7 +1718,9 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
                  free_state (newstate);
                  return NULL;
                }
-             re_node_set_init_copy (newstate->entrance_nodes, nodes);
+             if (re_node_set_init_copy (newstate->entrance_nodes, nodes)
+                 != REG_NOERROR)
+               return NULL;
              nctx_nodes = 0;
              newstate->has_constraint = 1;
            }
index 859832f513f5dabb44d2856a006d800b9b061105..5aa5aa287acd5f899f2eec04a2687c50ecbecc1d 100644 (file)
@@ -1,12 +1,12 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+   Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -28,9 +28,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#ifdef _LIBC
-# include <langinfo.h>
-#else
+#include <langinfo.h>
+#ifndef _LIBC
 # include "localcharset.h"
 #endif
 #if defined HAVE_LOCALE_H || defined _LIBC
@@ -468,6 +467,8 @@ static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
 # else
 /* alloca is implemented with malloc, so just use malloc.  */
 #  define __libc_use_alloca(n) 0
+#  undef alloca
+#  define alloca(n) malloc (n)
 # endif
 #endif
 
@@ -852,4 +853,21 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx)
 }
 #endif /* RE_ENABLE_I18N */
 
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_MINOR__
+#  define __GNUC_PREREQ(maj, min) \
+         ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+#  define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#if __GNUC_PREREQ (3,4)
+# undef __attribute_warn_unused_result__
+# define __attribute_warn_unused_result__ \
+   __attribute__ ((__warn_unused_result__))
+#else
+# define __attribute_warn_unused_result__ /* empty */
+#endif
+
 #endif /*  _REGEX_INTERNAL_H */
index 21a81669f25ea53ec4752d853b3409bd0ffbe068..dc449ce5279d184681ffbb8e7aac9252b46f2916 100644 (file)
@@ -1,12 +1,12 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+   Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -637,7 +637,7 @@ re_exec (s)
    (0 <= LAST_START && LAST_START <= LENGTH)  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 re_search_internal (const regex_t *preg,
                    const char *string, Idx length,
                    Idx start, Idx last_start, Idx stop,
@@ -833,10 +833,10 @@ re_search_internal (const regex_t *preg,
                break;
              match_first += incr;
              if (match_first < left_lim || match_first > right_lim)
-               {
-                 err = REG_NOMATCH;
-                 goto free_return;
-               }
+               {
+                 err = REG_NOMATCH;
+                 goto free_return;
+               }
            }
          break;
        }
@@ -953,14 +953,14 @@ re_search_internal (const regex_t *preg,
        }
 
       if (dfa->subexp_map)
-        for (reg_idx = 0; reg_idx + 1 < nmatch; reg_idx++)
-          if (dfa->subexp_map[reg_idx] != reg_idx)
-            {
-              pmatch[reg_idx + 1].rm_so
-                = pmatch[dfa->subexp_map[reg_idx] + 1].rm_so;
-              pmatch[reg_idx + 1].rm_eo
-                = pmatch[dfa->subexp_map[reg_idx] + 1].rm_eo;
-            }
+       for (reg_idx = 0; reg_idx + 1 < nmatch; reg_idx++)
+         if (dfa->subexp_map[reg_idx] != reg_idx)
+           {
+             pmatch[reg_idx + 1].rm_so
+               = pmatch[dfa->subexp_map[reg_idx] + 1].rm_so;
+             pmatch[reg_idx + 1].rm_eo
+               = pmatch[dfa->subexp_map[reg_idx] + 1].rm_eo;
+           }
     }
 
  free_return:
@@ -972,7 +972,7 @@ re_search_internal (const regex_t *preg,
 }
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 prune_impossible_nodes (re_match_context_t *mctx)
 {
   const re_dfa_t *const dfa = mctx->dfa;
@@ -1110,7 +1110,7 @@ acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx,
    index of the buffer.  */
 
 static Idx
-internal_function
+internal_function __attribute_warn_unused_result__
 check_matching (re_match_context_t *mctx, bool fl_longest_match,
                Idx *p_match_first)
 {
@@ -1149,7 +1149,7 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match,
            {
              err = transit_state_bkref (mctx, &cur_state->nodes);
              if (BE (err != REG_NOERROR, 0))
-               return err;
+               return err;
            }
        }
     }
@@ -1176,16 +1176,16 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match,
       Idx next_char_idx = re_string_cur_idx (&mctx->input) + 1;
 
       if (BE (next_char_idx >= mctx->input.bufs_len, 0)
-          || (BE (next_char_idx >= mctx->input.valid_len, 0)
-              && mctx->input.valid_len < mctx->input.len))
-        {
-          err = extend_buffers (mctx);
-          if (BE (err != REG_NOERROR, 0))
+         || (BE (next_char_idx >= mctx->input.valid_len, 0)
+             && mctx->input.valid_len < mctx->input.len))
+       {
+         err = extend_buffers (mctx);
+         if (BE (err != REG_NOERROR, 0))
            {
              assert (err == REG_ESPACE);
              return REG_ERROR;
            }
-        }
+       }
 
       cur_state = transit_state (&err, mctx, cur_state);
       if (mctx->state_log != NULL)
@@ -1309,17 +1309,17 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
           if (dest_node == REG_MISSING)
            dest_node = candidate;
 
-          else
+         else
            {
              /* In order to avoid infinite loop like "(a*)*", return the second
-                epsilon-transition if the first was already considered.  */
+                epsilon-transition if the first was already considered.  */
              if (re_node_set_contains (eps_via_nodes, dest_node))
-               return candidate;
+               return candidate;
 
              /* Otherwise, push the second epsilon-transition on the fail stack.  */
              else if (fs != NULL
                       && push_fail_stack (fs, *pidx, candidate, nregs, regs,
-                                          eps_via_nodes))
+                                          eps_via_nodes))
                return REG_ERROR;
 
              /* We know we are going to exit.  */
@@ -1385,7 +1385,7 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
 }
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node,
                 Idx nregs, regmatch_t *regs, re_node_set *eps_via_nodes)
 {
@@ -1432,7 +1432,7 @@ pop_fail_stack (struct re_fail_stack_t *fs, Idx *pidx, Idx nregs,
    pmatch[i].rm_so == pmatch[i].rm_eo == -1 for 0 < i < nmatch.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch,
          regmatch_t *pmatch, bool fl_backtrack)
 {
@@ -1667,7 +1667,7 @@ sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
       if (mctx->state_log[str_idx])
        {
          err = build_sifted_states (mctx, sctx, str_idx, &cur_dest);
-          if (BE (err != REG_NOERROR, 0))
+         if (BE (err != REG_NOERROR, 0))
            goto free_return;
        }
 
@@ -1686,7 +1686,7 @@ sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
 }
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx,
                     Idx str_idx, re_node_set *cur_dest)
 {
@@ -1848,7 +1848,7 @@ update_cur_sifted_state (const re_match_context_t *mctx,
 }
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes,
                       const re_node_set *candidates)
 {
@@ -1863,10 +1863,14 @@ add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes,
     {
       err = re_node_set_alloc (&state->inveclosure, dest_nodes->nelem);
       if (BE (err != REG_NOERROR, 0))
-        return REG_ESPACE;
+       return REG_ESPACE;
       for (i = 0; i < dest_nodes->nelem; i++)
-        re_node_set_merge (&state->inveclosure,
-                          dfa->inveclosures + dest_nodes->elems[i]);
+       {
+         err = re_node_set_merge (&state->inveclosure,
+                                  dfa->inveclosures + dest_nodes->elems[i]);
+         if (BE (err != REG_NOERROR, 0))
+           return REG_ESPACE;
+       }
     }
   return re_node_set_add_intersect (dest_nodes, candidates,
                                    &state->inveclosure);
@@ -1978,7 +1982,7 @@ check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries,
            {
              struct re_backref_cache_entry *ent = mctx->bkref_ents + bkref_idx;
              do
-               {
+               {
                  Idx dst;
                  int cpos;
 
@@ -2000,9 +2004,9 @@ check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries,
                  if (dst == from_node)
                    {
                      if (boundaries & 1)
-                       return -1;
+                       return -1;
                      else /* if (boundaries & 2) */
-                       return 0;
+                       return 0;
                    }
 
                  cpos =
@@ -2016,7 +2020,7 @@ check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries,
                  if (subexp_idx < BITSET_WORD_BITS)
                    ent->eps_reachable_subexps_map
                      &= ~((bitset_word_t) 1 << subexp_idx);
-               }
+               }
              while (ent++->more);
            }
          break;
@@ -2158,7 +2162,7 @@ check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes,
 }
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx,
                   Idx str_idx, const re_node_set *candidates)
 {
@@ -2241,7 +2245,7 @@ sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx,
          re_node_set_remove (&local_sctx.limits, enabled_idx);
 
          /* mctx->bkref_ents may have changed, reload the pointer.  */
-          entry = mctx->bkref_ents + enabled_idx;
+         entry = mctx->bkref_ents + enabled_idx;
        }
       while (enabled_idx++, entry++->more);
     }
@@ -2288,7 +2292,7 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
    update the destination of STATE_LOG.  */
 
 static re_dfastate_t *
-internal_function
+internal_function __attribute_warn_unused_result__
 transit_state (reg_errcode_t *err, re_match_context_t *mctx,
               re_dfastate_t *state)
 {
@@ -2322,7 +2326,7 @@ transit_state (reg_errcode_t *err, re_match_context_t *mctx,
 
       trtable = state->word_trtable;
       if (BE (trtable != NULL, 1))
-        {
+       {
          unsigned int context;
          context
            = re_string_context_at (&mctx->input,
@@ -2368,21 +2372,21 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
       unsigned int context;
       re_node_set next_nodes, *log_nodes, *table_nodes = NULL;
       /* If (state_log[cur_idx] != 0), it implies that cur_idx is
-         the destination of a multibyte char/collating element/
-         back reference.  Then the next state is the union set of
-         these destinations and the results of the transition table.  */
+        the destination of a multibyte char/collating element/
+        back reference.  Then the next state is the union set of
+        these destinations and the results of the transition table.  */
       pstate = mctx->state_log[cur_idx];
       log_nodes = pstate->entrance_nodes;
       if (next_state != NULL)
-        {
-          table_nodes = next_state->entrance_nodes;
-          *err = re_node_set_init_union (&next_nodes, table_nodes,
+       {
+         table_nodes = next_state->entrance_nodes;
+         *err = re_node_set_init_union (&next_nodes, table_nodes,
                                             log_nodes);
-          if (BE (*err != REG_NOERROR, 0))
+         if (BE (*err != REG_NOERROR, 0))
            return NULL;
-        }
+       }
       else
-        next_nodes = *log_nodes;
+       next_nodes = *log_nodes;
       /* Note: We already add the nodes of the initial state,
         then we don't need to add them here.  */
 
@@ -2390,12 +2394,12 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
                                      re_string_cur_idx (&mctx->input) - 1,
                                      mctx->eflags);
       next_state = mctx->state_log[cur_idx]
-        = re_acquire_state_context (err, dfa, &next_nodes, context);
+       = re_acquire_state_context (err, dfa, &next_nodes, context);
       /* We don't need to check errors here, since the return value of
-         this function is next_state and ERR is already set.  */
+        this function is next_state and ERR is already set.  */
 
       if (table_nodes != NULL)
-        re_node_set_free (&next_nodes);
+       re_node_set_free (&next_nodes);
     }
 
   if (BE (dfa->nbackref, 0) && next_state != NULL)
@@ -2436,9 +2440,9 @@ find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
 
       do
        {
-          if (++cur_str_idx > max)
-            return NULL;
-          re_string_skip_bytes (&mctx->input, 1);
+         if (++cur_str_idx > max)
+           return NULL;
+         re_string_skip_bytes (&mctx->input, 1);
        }
       while (mctx->state_log[cur_str_idx] == NULL);
 
@@ -2546,7 +2550,7 @@ transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
       re_dfastate_t *dest_state;
 
       if (!dfa->nodes[cur_node_idx].accept_mb)
-        continue;
+       continue;
 
       if (dfa->nodes[cur_node_idx].constraint)
        {
@@ -2714,7 +2718,7 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
    delay these checking for prune_impossible_nodes().  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
 {
   const re_dfa_t *const dfa = mctx->dfa;
@@ -2727,7 +2731,7 @@ get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
       const struct re_backref_cache_entry *entry
        = mctx->bkref_ents + cache_idx;
       do
-        if (entry->node == bkref_node)
+       if (entry->node == bkref_node)
          return REG_NOERROR; /* We already checked it.  */
       while (entry++->more);
     }
@@ -2915,7 +2919,7 @@ find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
    Return REG_NOERROR if it can arrive, or REG_NOMATCH otherwise.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
               Idx top_str, Idx last_node, Idx last_str, int type)
 {
@@ -3077,7 +3081,7 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
         Can't we unify them?  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
                              re_node_set *cur_nodes, re_node_set *next_nodes)
 {
@@ -3211,7 +3215,7 @@ check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes,
    problematic append it to DST_NODES.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes,
                              Idx target, Idx ex_subexp, int type)
 {
@@ -3256,7 +3260,7 @@ check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes,
    in MCTX->BKREF_ENTS.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes,
                    Idx cur_str, Idx subexp_num, int type)
 {
@@ -3622,7 +3626,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
        }
 #ifdef RE_ENABLE_I18N
       else if (type == OP_UTF8_PERIOD)
-        {
+       {
          if (ASCII_CHARS % BITSET_WORD_BITS == 0)
            memset (accepts, -1, ASCII_CHARS / CHAR_BIT);
          else
@@ -3631,7 +3635,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
            bitset_clear (accepts, '\n');
          if (dfa->syntax & RE_DOT_NOT_NULL)
            bitset_clear (accepts, '\0');
-        }
+       }
 #endif
       else
        continue;
@@ -3836,7 +3840,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
   if (node->type == OP_PERIOD)
     {
       if (char_len <= 1)
-        return 0;
+       return 0;
       /* FIXME: I don't think this if is needed, as both '\n'
         and '\0' are char_len == 1.  */
       /* '.' accepts any one character except the following two cases.  */
@@ -3949,15 +3953,20 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
                _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
              indirect = (const int32_t *)
                _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
-             idx = findidx (&cp);
+             int32_t idx = findidx (&cp);
              if (idx > 0)
                for (i = 0; i < cset->nequiv_classes; ++i)
                  {
                    int32_t equiv_class_idx = cset->equiv_classes[i];
-                   size_t weight_len = weights[idx];
-                   if (weight_len == weights[equiv_class_idx])
+                   size_t weight_len = weights[idx & 0xffffff];
+                   if (weight_len == weights[equiv_class_idx & 0xffffff]
+                       && (idx >> 24) == (equiv_class_idx >> 24))
                      {
                        Idx cnt = 0;
+
+                       idx &= 0xffffff;
+                       equiv_class_idx &= 0xffffff;
+
                        while (cnt <= weight_len
                               && (weights[equiv_class_idx + 1 + cnt]
                                   == weights[idx + 1 + cnt]))
@@ -4123,7 +4132,7 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
 /* Extend the buffers, if the buffers have run out.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 extend_buffers (re_match_context_t *mctx)
 {
   reg_errcode_t ret;
@@ -4186,7 +4195,7 @@ extend_buffers (re_match_context_t *mctx)
 /* Initialize MCTX.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 match_ctx_init (re_match_context_t *mctx, int eflags, Idx n)
 {
   mctx->eflags = eflags;
@@ -4266,7 +4275,7 @@ match_ctx_free (re_match_context_t *mctx)
 */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx, Idx from,
                     Idx to)
 {
@@ -4338,7 +4347,7 @@ search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
    at STR_IDX.  */
 
 static reg_errcode_t
-internal_function
+internal_function __attribute_warn_unused_result__
 match_ctx_add_subtop (re_match_context_t *mctx, Idx node, Idx str_idx)
 {
 #ifdef DEBUG
index 0cb1edee8bc789ab6589d2cd93c7e265ce1a418a..855be677aa07f01dcb77f3907e6aa200f3529fce 100644 (file)
@@ -1,7 +1,7 @@
 /* An interface to read and write that retries after interrupts.
 
-   Copyright (C) 1993, 1994, 1998, 2002, 2003, 2004, 2005, 2006 Free
-   Software Foundation, Inc.
+   Copyright (C) 1993-1994, 1998, 2002-2006, 2009-2010 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
@@ -66,12 +66,12 @@ safe_rw (int fd, void const *buf, size_t count)
       ssize_t result = rw (fd, buf, count);
 
       if (0 <= result)
-       return result;
+        return result;
       else if (IS_EINTR (errno))
-       continue;
+        continue;
       else if (errno == EINVAL && BUGGY_READ_MAXIMUM < count)
-       count = BUGGY_READ_MAXIMUM;
+        count = BUGGY_READ_MAXIMUM;
       else
-       return result;
+        return result;
     }
 }
index ba191713b681712ab85b59953e256a78a8b2d978..1f15b0182627512c74131b088b99f7187a3b5b57 100644 (file)
@@ -1,5 +1,5 @@
 /* An interface to read() that retries after interrupts.
-   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006, 2009-2010 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
index b644f7cff3aae6127cd5bbddda40f161419d1e5a..a2c3b4df1d11c8f2b1628b9f09cbbf29dd6bdd9e 100644 (file)
@@ -1,5 +1,5 @@
 /* An interface to write that retries after interrupts.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2010 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
index da036a97a1054a600bf808f5b9ed89969996c4ae..185f660301c2091a07a6161a3f345c18b9f79d2a 100644 (file)
@@ -1,5 +1,5 @@
 /* An interface to write() that retries after interrupts.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2010 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
index ed0bc137712250b0d4ae0aa44f5121c6f3890f2c..56d5a9b1c58e3d235ad8ac0d20d28b7fb8806e14 100644 (file)
@@ -1,10 +1,10 @@
 /* size_max.h -- declare SIZE_MAX through system headers
-   Copyright (C) 2005-2006 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
index 7b9725b3b6053181b5ef0ef9af8c34aa10451754..810ca14bc9e99c5fde7b985e2f6aa5f73bfa9914 100644 (file)
@@ -1,10 +1,10 @@
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2010 Free Software Foundation, Inc.
    Written by Simon Josefsson and Paul Eggert.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -53,11 +53,11 @@ snprintf (char *str, size_t size, const char *format, ...)
   if (output != str)
     {
       if (size)
-       {
-         size_t pruned_len = (len < size ? len : size - 1);
-         memcpy (str, output, pruned_len);
-         str[pruned_len] = '\0';
-       }
+        {
+          size_t pruned_len = (len < size ? len : size - 1);
+          memcpy (str, output, pruned_len);
+          str[pruned_len] = '\0';
+        }
 
       free (output);
     }
diff --git a/gnulib/stat.c b/gnulib/stat.c
new file mode 100644 (file)
index 0000000..875317b
--- /dev/null
@@ -0,0 +1,104 @@
+/* Work around platform bugs in stat.
+   Copyright (C) 2009, 2010 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 3 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, see <http://www.gnu.org/licenses/>.  */
+
+/* written by Eric Blake */
+
+#include <config.h>
+
+/* Get the original definition of stat.  It might be defined as a macro.  */
+#define __need_system_sys_stat_h
+#include <sys/types.h>
+#include <sys/stat.h>
+#undef __need_system_sys_stat_h
+
+static inline int
+orig_stat (const char *filename, struct stat *buf)
+{
+  return stat (filename, buf);
+}
+
+/* Specification.  */
+#include <sys/stat.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <string.h>
+
+/* Store information about NAME into ST.  Work around bugs with
+   trailing slashes.  Mingw has other bugs (such as st_ino always
+   being 0 on success) which this wrapper does not work around.  But
+   at least this implementation provides the ability to emulate fchdir
+   correctly.  */
+
+int
+rpl_stat (char const *name, struct stat *st)
+{
+  int result = orig_stat (name, st);
+#if REPLACE_FUNC_STAT_FILE
+  /* Solaris 9 mistakenly succeeds when given a non-directory with a
+     trailing slash.  */
+  if (result == 0 && !S_ISDIR (st->st_mode))
+    {
+      size_t len = strlen (name);
+      if (ISSLASH (name[len - 1]))
+        {
+          errno = ENOTDIR;
+          return -1;
+        }
+    }
+#endif /* REPLACE_FUNC_STAT_FILE */
+#if REPLACE_FUNC_STAT_DIR
+  if (result == -1 && errno == ENOENT)
+    {
+      /* Due to mingw's oddities, there are some directories (like
+         c:\) where stat() only succeeds with a trailing slash, and
+         other directories (like c:\windows) where stat() only
+         succeeds without a trailing slash.  But we want the two to be
+         synonymous, since chdir() manages either style.  Likewise, Mingw also
+         reports ENOENT for names longer than PATH_MAX, when we want
+         ENAMETOOLONG, and for stat("file/"), when we want ENOTDIR.
+         Fortunately, mingw PATH_MAX is small enough for stack
+         allocation.  */
+      char fixed_name[PATH_MAX + 1] = {0};
+      size_t len = strlen (name);
+      bool check_dir = false;
+      if (PATH_MAX <= len)
+        errno = ENAMETOOLONG;
+      else if (len)
+        {
+          strcpy (fixed_name, name);
+          if (ISSLASH (fixed_name[len - 1]))
+            {
+              check_dir = true;
+              while (len && ISSLASH (fixed_name[len - 1]))
+                fixed_name[--len] = '\0';
+              if (!len)
+                fixed_name[0] = '/';
+            }
+          else
+            fixed_name[len++] = '/';
+          result = orig_stat (fixed_name, st);
+          if (result == 0 && check_dir && !S_ISDIR (st->st_mode))
+            {
+              result = -1;
+              errno = ENOTDIR;
+            }
+        }
+    }
+#endif /* REPLACE_FUNC_STAT_DIR */
+  return result;
+}
index 8e62b082d08b5bd9cc8550e5e809fafa628296eb..574c281a8f2912987ef2f02835f20c2c5196a4aa 100644 (file)
@@ -1,9 +1,9 @@
-/* Copyright (C) 2001-2003, 2006-2008 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -50,6 +50,9 @@
          with this substitute.  With this substitute, only the values 0 and 1
          give the expected result when converted to _Bool' or 'bool'.
 
+       - C99 allows the use of (_Bool)0.0 in constant expressions, but
+         this substitute cannot always provide this property.
+
    Also, it is suggested that programs use 'bool' rather than '_Bool';
    this isn't required, but 'bool' is more common.  */
 
diff --git a/gnulib/stddef.in.h b/gnulib/stddef.in.h
new file mode 100644 (file)
index 0000000..08778a2
--- /dev/null
@@ -0,0 +1,86 @@
+/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
+
+   Copyright (C) 2009, 2010 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 3, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Written by Eric Blake.  */
+
+/*
+ * POSIX 2008 <stddef.h> for platforms that have issues.
+ * <http://www.opengroup.org/susv3xbd/stddef.h.html>
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
+#if defined __need_wchar_t || defined __need_size_t  \
+  || defined __need_ptrdiff_t || defined __need_NULL \
+  || defined __need_wint_t
+/* Special invocation convention inside gcc header files.  In
+   particular, gcc provides a version of <stddef.h> that blindly
+   redefines NULL even when __need_wint_t was defined, even though
+   wint_t is not normally provided by <stddef.h>.  Hence, we must
+   remember if special invocation has ever been used to obtain wint_t,
+   in which case we need to clean up NULL yet again.  */
+
+# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T)
+#  ifdef __need_wint_t
+#   undef _GL_STDDEF_H
+#   define _GL_STDDEF_WINT_T
+#  endif
+#  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+# endif
+
+#else
+/* Normal invocation convention.  */
+
+# ifndef _GL_STDDEF_H
+
+/* The include_next requires a split double-inclusion guard.  */
+
+#  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+
+#  ifndef _GL_STDDEF_H
+#   define _GL_STDDEF_H
+
+/* On NetBSD 5.0, the definition of NULL lacks proper parentheses.  */
+#if @REPLACE_NULL@
+# undef NULL
+# ifdef __cplusplus
+   /* ISO C++ says that the macro NULL must expand to an integer constant
+      expression, hence '((void *) 0)' is not allowed in C++.  */
+#  if __GNUG__ >= 3
+    /* GNU C++ has a __null macro that behaves like an integer ('int' or
+       'long') but has the same size as a pointer.  Use that, to avoid
+       warnings.  */
+#   define NULL __null
+#  else
+#   define NULL 0L
+#  endif
+# else
+#  define NULL ((void *) 0)
+# endif
+#endif
+
+/* Some platforms lack wchar_t.  */
+#if !@HAVE_WCHAR_T@
+# define wchar_t int
+#endif
+
+#  endif /* _GL_STDDEF_H */
+# endif /* _GL_STDDEF_H */
+#endif /* __need_XXX */
index 869bd3a7fff1e33f61e87b66b2ff3b5a35be3293..5da5f17886aede50777382ef75ed33588550b48c 100644 (file)
@@ -1,10 +1,10 @@
-/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2010 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 
 #ifndef _GL_STDINT_H
 
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
 /* When including a system file that in turn includes <inttypes.h>,
    use the system <inttypes.h>, not our substitute.  This avoids
    problems with (for example) VMS, whose <sys/bitypes.h> includes
@@ -49,9 +53,6 @@
      in <inttypes.h> would reinclude us, skipping our contents because
      _GL_STDINT_H is defined.
      The include_next requires a split double-inclusion guard.  */
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
 #endif
 
   ((signed) \
    ? ~ _STDINT_MIN (signed, bits, zero) \
    : /* The expression for the unsigned case.  The subtraction of (signed) \
-       is a nop in the unsigned case and avoids "signed integer overflow" \
-       warnings in the signed case.  */ \
+        is a nop in the unsigned case and avoids "signed integer overflow" \
+        warnings in the signed case.  */ \
      ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
 /* 7.18.1.1. Exact-width integer types */
@@ -454,10 +455,10 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
 #undef SIG_ATOMIC_MAX
 #define SIG_ATOMIC_MIN  \
    _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
-               0@SIG_ATOMIC_T_SUFFIX@)
+                0@SIG_ATOMIC_T_SUFFIX@)
 #define SIG_ATOMIC_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
-               0@SIG_ATOMIC_T_SUFFIX@)
+                0@SIG_ATOMIC_T_SUFFIX@)
 
 
 /* size_t limit */
index c803e88c97cd0f6f5bca3d41040422289c46d7f5..0e67f66ef6fd3670f111c0977163efb94ab25ee1 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation details of FILE streams.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008, 2010 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
 
 /* BSD stdio derived implementations.  */
 
+#if defined __NetBSD__                         /* NetBSD */
+/* Get __NetBSD_Version__.  */
+# include <sys/param.h>
+#endif
+
 #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
 
 # if defined __DragonFly__          /* DragonFly */
   /* See <http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>.  */
 #  define fp_ ((struct { struct __FILE_public pub; \
-                        struct { unsigned char *_base; int _size; } _bf; \
-                        void *cookie; \
-                        void *_close; \
-                        void *_read; \
-                        void *_seek; \
-                        void *_write; \
-                        struct { unsigned char *_base; int _size; } _ub; \
-                        int _ur; \
-                        unsigned char _ubuf[3]; \
-                        unsigned char _nbuf[1]; \
-                        struct { unsigned char *_base; int _size; } _lb; \
-                        int _blksize; \
-                        fpos_t _offset; \
-                        /* More fields, not relevant here.  */ \
-                      } *) fp)
+                         struct { unsigned char *_base; int _size; } _bf; \
+                         void *cookie; \
+                         void *_close; \
+                         void *_read; \
+                         void *_seek; \
+                         void *_write; \
+                         struct { unsigned char *_base; int _size; } _ub; \
+                         int _ur; \
+                         unsigned char _ubuf[3]; \
+                         unsigned char _nbuf[1]; \
+                         struct { unsigned char *_base; int _size; } _lb; \
+                         int _blksize; \
+                         fpos_t _offset; \
+                         /* More fields, not relevant here.  */ \
+                       } *) fp)
   /* See <http://www.dragonflybsd.org/cvsweb/src/include/stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>.  */
 #  define _p pub._p
 #  define _flags pub._flags
@@ -50,7 +55,7 @@
 #  define fp_ fp
 # endif
 
-# if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */
+# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ /* NetBSD >= 1.5ZA, OpenBSD */
   /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
      and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
   struct __sfileext
@@ -59,7 +64,7 @@
       /* More fields, not relevant here.  */
     };
 #  define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
-# else                                         /* FreeBSD, DragonFly, MacOS X, Cygwin */
+# else                                         /* FreeBSD, NetBSD <= 1.5Z, DragonFly, MacOS X, Cygwin */
 #  define fp_ub fp_->_ub
 # endif
 
 
 # if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
 #  define fp_ ((struct { unsigned char *_ptr; \
-                        unsigned char *_base; \
-                        unsigned char *_end; \
-                        long _cnt; \
-                        int _file; \
-                        unsigned int _flag; \
-                      } *) fp)
+                         unsigned char *_base; \
+                         unsigned char *_end; \
+                         long _cnt; \
+                         int _file; \
+                         unsigned int _flag; \
+                       } *) fp)
 # else
 #  define fp_ fp
 # endif
index f1d0fcb730566c30b61714d872ae0d51a048afff..a6a0eb143da6eaff0cea420368274b99bb778179 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX compatible FILE stream write function.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
 #  include <windows.h>
 
 #  define CALL_WITH_SIGPIPE_EMULATION(RETTYPE, EXPRESSION, FAILED) \
-  if (ferror (stream))                                                       \
-    return (EXPRESSION);                                                     \
-  else                                                                       \
-    {                                                                        \
-      RETTYPE ret;                                                           \
-      SetLastError (0);                                                              \
-      ret = (EXPRESSION);                                                    \
+  if (ferror (stream))                                                        \
+    return (EXPRESSION);                                                      \
+  else                                                                        \
+    {                                                                         \
+      RETTYPE ret;                                                            \
+      SetLastError (0);                                                       \
+      ret = (EXPRESSION);                                                     \
       if (FAILED && GetLastError () == ERROR_NO_DATA && ferror (stream))      \
-       {                                                                     \
-         int fd = fileno (stream);                                           \
-         if (fd >= 0                                                         \
-             && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE)\
-           {                                                                 \
-             /* Try to raise signal SIGPIPE.  */                             \
-             raise (SIGPIPE);                                                \
-             /* If it is currently blocked or ignored, change errno from     \
-                EINVAL to EPIPE.  */                                         \
-             errno = EPIPE;                                                  \
-           }                                                                 \
-       }                                                                     \
-      return ret;                                                            \
+        {                                                                     \
+          int fd = fileno (stream);                                           \
+          if (fd >= 0                                                         \
+              && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE)\
+            {                                                                 \
+              /* Try to raise signal SIGPIPE.  */                             \
+              raise (SIGPIPE);                                                \
+              /* If it is currently blocked or ignored, change errno from     \
+                 EINVAL to EPIPE.  */                                         \
+              errno = EPIPE;                                                  \
+            }                                                                 \
+        }                                                                     \
+      return ret;                                                             \
     }
 
 #  if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
@@ -92,7 +92,7 @@ fprintf (FILE *stream, const char *format, ...)
 }
 #  endif
 
-#  if !REPLACE_VFPRINTF_POSIX /* avoid collision with vprintf.c */
+#  if !REPLACE_VPRINTF_POSIX /* avoid collision with vprintf.c */
 int
 vprintf (const char *format, va_list args)
 {
@@ -100,7 +100,7 @@ vprintf (const char *format, va_list args)
 }
 #  endif
 
-#  if !REPLACE_VPRINTF_POSIX /* avoid collision with vfprintf.c */
+#  if !REPLACE_VFPRINTF_POSIX /* avoid collision with vfprintf.c */
 int
 vfprintf (FILE *stream, const char *format, va_list args)
 #undef vfprintf
index ba63f2cc1e946b1430b8d2621bc18b83e00eeff8..80b9dbfda341628f7db7e77b4697620a4eb5dd27 100644 (file)
@@ -1,10 +1,10 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 #ifndef _GL_STDIO_H
 #define _GL_STDIO_H
 
+/* Get va_list.  Needed on many systems, including glibc 2.8.  */
 #include <stdarg.h>
+
 #include <stddef.h>
 
-#if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \
-  || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \
-  || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \
-  || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@))
-/* Get off_t and ssize_t.  */
-# include <sys/types.h>
-#endif
+/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8.  */
+#include <sys/types.h>
 
 #ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-#  define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
-   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+   The __-protected variants of the attributes 'format' and 'printf' are
+   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
+   We enable __attribute__ only if these are supported too, because
+   gnulib and libintl do '#define printf __printf__' when they override
+   the 'printf' function.  */
 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-#  define __format__ format
-#  define __printf__ printf
+#  define __attribute__(Spec)   /* empty */
 # endif
 #endif
 
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+/* Macros for stringification.  */
+#define _GL_STDIO_STRINGIZE(token) #token
+#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
 
 
-#if @GNULIB_FPRINTF_POSIX@
-# if @REPLACE_FPRINTF@
-#  define fprintf rpl_fprintf
-extern int fprintf (FILE *fp, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 2, 3)));
+#if @GNULIB_DPRINTF@
+# if @REPLACE_DPRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define dprintf rpl_dprintf
+#  endif
+_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
+                                __attribute__ ((__format__ (__printf__, 2, 3)))
+                                _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
+# else
+#  if !@HAVE_DPRINTF@
+_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
+                                __attribute__ ((__format__ (__printf__, 2, 3)))
+                                _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
 # endif
-#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define fprintf rpl_fprintf
-extern int fprintf (FILE *fp, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 2, 3)));
+_GL_CXXALIASWARN (dprintf);
 #elif defined GNULIB_POSIXCHECK
-# undef fprintf
-# define fprintf \
-    (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \
-                      "use gnulib module fprintf-posix for portable " \
-                      "POSIX compliance"), \
-     fprintf)
-#endif
-
-#if @GNULIB_VFPRINTF_POSIX@
-# if @REPLACE_VFPRINTF@
-#  define vfprintf rpl_vfprintf
-extern int vfprintf (FILE *fp, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 2, 0)));
-# endif
-#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define vfprintf rpl_vfprintf
-extern int vfprintf (FILE *fp, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 2, 0)));
+# undef dprintf
+# if HAVE_RAW_DECL_DPRINTF
+_GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
+                 "use gnulib module dprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_FCLOSE@
+/* Close STREAM and its underlying file descriptor.  */
+# if @REPLACE_FCLOSE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define fclose rpl_fclose
+#  endif
+_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
+# endif
+_GL_CXXALIASWARN (fclose);
 #elif defined GNULIB_POSIXCHECK
-# undef vfprintf
-# define vfprintf(s,f,a) \
-    (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
-                      "use gnulib module vfprintf-posix for portable " \
-                      "POSIX compliance"), \
-     vfprintf (s, f, a))
+# undef fclose
+/* Assume fclose is always declared.  */
+_GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
+                 "use gnulib module fclose for portable POSIX compliance");
 #endif
 
-#if @GNULIB_PRINTF_POSIX@
-# if @REPLACE_PRINTF@
-/* Don't break __attribute__((format(printf,M,N))).  */
-#  define printf __printf__
-extern int printf (const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 1, 2)));
+#if @GNULIB_FFLUSH@
+/* Flush all pending data on STREAM according to POSIX rules.  Both
+   output and seekable input streams are supported.
+   Note! LOSS OF DATA can occur if fflush is applied on an input stream
+   that is _not_seekable_ or on an update stream that is _not_seekable_
+   and in which the most recent operation was input.  Seekability can
+   be tested with lseek(fileno(fp),0,SEEK_CUR).  */
+# if @REPLACE_FFLUSH@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define fflush rpl_fflush
+#  endif
+_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
+_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
+# else
+_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
 # endif
-#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-/* Don't break __attribute__((format(printf,M,N))).  */
-# define printf __printf__
-extern int printf (const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 1, 2)));
+_GL_CXXALIASWARN (fflush);
 #elif defined GNULIB_POSIXCHECK
-# undef printf
-# define printf \
-    (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
-                      "use gnulib module printf-posix for portable " \
-                      "POSIX compliance"), \
-     printf)
-/* Don't break __attribute__((format(printf,M,N))).  */
-# define format(kind,m,n) format (__##kind##__, m, n)
-# define __format__(kind,m,n) __format__ (__##kind##__, m, n)
-# define ____printf____ __printf__
-# define ____scanf____ __scanf__
-# define ____strftime____ __strftime__
-# define ____strfmon____ __strfmon__
-#endif
-
-#if @GNULIB_VPRINTF_POSIX@
-# if @REPLACE_VPRINTF@
-#  define vprintf rpl_vprintf
-extern int vprintf (const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 1, 0)));
-# endif
-#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define vprintf rpl_vprintf
-extern int vprintf (const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 1, 0)));
+# undef fflush
+/* Assume fflush is always declared.  */
+_GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
+                 "use gnulib module fflush for portable POSIX compliance");
+#endif
+
+/* It is very rare that the developer ever has full control of stdin,
+   so any use of gets warrants an unconditional warning.  Assume it is
+   always declared, since it is required by C89.  */
+#undef gets
+_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+
+#if @GNULIB_FOPEN@
+# if @REPLACE_FOPEN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fopen
+#   define fopen rpl_fopen
+#  endif
+_GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
+                                 _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
+# endif
+_GL_CXXALIASWARN (fopen);
 #elif defined GNULIB_POSIXCHECK
-# undef vprintf
-# define vprintf(f,a) \
-    (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
-                      "use gnulib module vprintf-posix for portable " \
-                      "POSIX compliance"), \
-     vprintf (f, a))
+# undef fopen
+/* Assume fopen is always declared.  */
+_GL_WARN_ON_USE (fopen, "fopen on Win32 platforms is not POSIX compatible - "
+                 "use gnulib module fopen for portability");
 #endif
 
-#if @GNULIB_SNPRINTF@
-# if @REPLACE_SNPRINTF@
-#  define snprintf rpl_snprintf
+#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
+# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
+     || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define fprintf rpl_fprintf
+#  endif
+#  define GNULIB_overrides_fprintf 1
+_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
+                                __attribute__ ((__format__ (__printf__, 2, 3)))
+                                _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (fprintf);
+#endif
+#if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_fprintf
+#  undef fprintf
 # endif
-# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
-extern int snprintf (char *str, size_t size, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 3, 4)));
+/* Assume fprintf is always declared.  */
+_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
+                 "use gnulib module fprintf-posix for portable "
+                 "POSIX compliance");
+#endif
+
+#if @GNULIB_FPURGE@
+/* Discard all pending buffered I/O data on STREAM.
+   STREAM must not be wide-character oriented.
+   When discarding pending output, the file position is set back to where it
+   was before the write calls.  When discarding pending input, the file
+   position is advanced to match the end of the previously read input.
+   Return 0 if successful.  Upon error, return -1 and set errno.  */
+# if @REPLACE_FPURGE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define fpurge rpl_fpurge
+#  endif
+_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
+# else
+#  if !@HAVE_DECL_FPURGE@
+_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
 # endif
+_GL_CXXALIASWARN (fpurge);
 #elif defined GNULIB_POSIXCHECK
-# undef snprintf
-# define snprintf \
-    (GL_LINK_WARNING ("snprintf is unportable - " \
-                      "use gnulib module snprintf for portability"), \
-     snprintf)
+# undef fpurge
+# if HAVE_RAW_DECL_FPURGE
+_GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
+                 "use gnulib module fpurge for portability");
+# endif
 #endif
 
-#if @GNULIB_VSNPRINTF@
-# if @REPLACE_VSNPRINTF@
-#  define vsnprintf rpl_vsnprintf
+#if @GNULIB_FPUTC@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fputc
+#   define fputc rpl_fputc
+#  endif
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
 # endif
-# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
-extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 3, 0)));
+_GL_CXXALIASWARN (fputc);
+#endif
+
+#if @GNULIB_FPUTS@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fputs
+#   define fputs rpl_fputs
+#  endif
+_GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
+                              _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
 # endif
-#elif defined GNULIB_POSIXCHECK
-# undef vsnprintf
-# define vsnprintf(b,s,f,a) \
-    (GL_LINK_WARNING ("vsnprintf is unportable - " \
-                      "use gnulib module vsnprintf for portability"), \
-     vsnprintf (b, s, f, a))
+_GL_CXXALIASWARN (fputs);
 #endif
 
-#if @GNULIB_SPRINTF_POSIX@
-# if @REPLACE_SPRINTF@
-#  define sprintf rpl_sprintf
-extern int sprintf (char *str, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 2, 3)));
+#if @GNULIB_FREOPEN@
+# if @REPLACE_FREOPEN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef freopen
+#   define freopen rpl_freopen
+#  endif
+_GL_FUNCDECL_RPL (freopen, FILE *,
+                  (const char *filename, const char *mode, FILE *stream)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (freopen, FILE *,
+                  (const char *filename, const char *mode, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (freopen, FILE *,
+                  (const char *filename, const char *mode, FILE *stream));
 # endif
+_GL_CXXALIASWARN (freopen);
 #elif defined GNULIB_POSIXCHECK
-# undef sprintf
-# define sprintf \
-    (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
-                      "use gnulib module sprintf-posix for portable " \
-                      "POSIX compliance"), \
-     sprintf)
+# undef freopen
+/* Assume freopen is always declared.  */
+_GL_WARN_ON_USE (freopen, "freopen on Win32 platforms is not POSIX compatible - "
+                 "use gnulib module freopen for portability");
 #endif
 
-#if @GNULIB_VSPRINTF_POSIX@
-# if @REPLACE_VSPRINTF@
-#  define vsprintf rpl_vsprintf
-extern int vsprintf (char *str, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 2, 0)));
+
+/* Set up the following warnings, based on which modules are in use.
+   GNU Coding Standards discourage the use of fseek, since it imposes
+   an arbitrary limitation on some 32-bit hosts.  Remember that the
+   fseek module depends on the fseeko module, so we only have three
+   cases to consider:
+
+   1. The developer is not using either module.  Issue a warning under
+   GNULIB_POSIXCHECK for both functions, to remind them that both
+   functions have bugs on some systems.  _GL_NO_LARGE_FILES has no
+   impact on this warning.
+
+   2. The developer is using both modules.  They may be unaware of the
+   arbitrary limitations of fseek, so issue a warning under
+   GNULIB_POSIXCHECK.  On the other hand, they may be using both
+   modules intentionally, so the developer can define
+   _GL_NO_LARGE_FILES in the compilation units where the use of fseek
+   is safe, to silence the warning.
+
+   3. The developer is using the fseeko module, but not fseek.  Gnulib
+   guarantees that fseek will still work around platform bugs in that
+   case, but we presume that the developer is aware of the pitfalls of
+   fseek and was trying to avoid it, so issue a warning even when
+   GNULIB_POSIXCHECK is undefined.  Again, _GL_NO_LARGE_FILES can be
+   defined to silence the warning in particular compilation units.
+   In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
+   fseek gets defined as a macro, it is recommended that the developer
+   uses the fseek module, even if he is not calling the fseek function.
+
+   Most gnulib clients that perform stream operations should fall into
+   category 3.  */
+
+#if @GNULIB_FSEEK@
+# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
+#  define _GL_FSEEK_WARN /* Category 2, above.  */
+#  undef fseek
+# endif
+# if @REPLACE_FSEEK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fseek
+#   define fseek rpl_fseek
+#  endif
+_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
+# else
+_GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
+# endif
+_GL_CXXALIASWARN (fseek);
+#endif
+
+#if @GNULIB_FSEEKO@
+# if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
+#  define _GL_FSEEK_WARN /* Category 3, above.  */
+#  undef fseek
+# endif
+# if @REPLACE_FSEEKO@
+/* Provide an fseeko function that is aware of a preceding fflush(), and which
+   detects pipes.  */
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fseeko
+#   define fseeko rpl_fseeko
+#  endif
+_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
+# else
+#  if ! @HAVE_FSEEKO@
+_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
+                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (fseeko);
+# if (@REPLACE_FSEEKO@ || !@HAVE_FSEEKO@) && !@GNULIB_FSEEK@
+   /* Provide an fseek function that is consistent with fseeko.  */
+   /* In order to avoid that fseek gets defined as a macro here, the
+      developer can request the 'fseek' module.  */
+#  undef fseek
+#  define fseek rpl_fseek
+static inline int _GL_ARG_NONNULL ((1))
+rpl_fseek (FILE *fp, long offset, int whence)
+{
+#  if @REPLACE_FSEEKO@
+  return rpl_fseeko (fp, offset, whence);
+#  else
+  return fseeko (fp, offset, whence);
+#  endif
+}
 # endif
 #elif defined GNULIB_POSIXCHECK
-# undef vsprintf
-# define vsprintf(b,f,a) \
-    (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
-                      "use gnulib module vsprintf-posix for portable " \
-                      "POSIX compliance"), \
-     vsprintf (b, f, a))
+# define _GL_FSEEK_WARN /* Category 1, above.  */
+# undef fseek
+# undef fseeko
+# if HAVE_RAW_DECL_FSEEKO
+_GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
+                 "use gnulib module fseeko for portability");
+# endif
 #endif
 
-#if @GNULIB_DPRINTF@
-# if @REPLACE_DPRINTF@
-#  define dprintf rpl_dprintf
+#ifdef _GL_FSEEK_WARN
+# undef _GL_FSEEK_WARN
+/* Here, either fseek is undefined (but C89 guarantees that it is
+   declared), or it is defined as rpl_fseek (declared above).  */
+_GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
+                 "on 32-bit platforms - "
+                 "use fseeko function for handling of large files");
+#endif
+
+
+/* ftell, ftello.  See the comments on fseek/fseeko.  */
+
+#if @GNULIB_FTELL@
+# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
+#  define _GL_FTELL_WARN /* Category 2, above.  */
+#  undef ftell
+# endif
+# if @REPLACE_FTELL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ftell
+#   define ftell rpl_ftell
+#  endif
+_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
+# else
+_GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
+# endif
+_GL_CXXALIASWARN (ftell);
+#endif
+
+#if @GNULIB_FTELLO@
+# if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
+#  define _GL_FTELL_WARN /* Category 3, above.  */
+#  undef ftell
+# endif
+# if @REPLACE_FTELLO@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ftello
+#   define ftello rpl_ftello
+#  endif
+_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
+# else
+#  if ! @HAVE_FTELLO@
+_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
 # endif
-# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@
-extern int dprintf (int fd, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 2, 3)));
+_GL_CXXALIASWARN (ftello);
+# if (@REPLACE_FTELLO@ || !@HAVE_FTELLO@) && !@GNULIB_FTELL@
+   /* Provide an ftell function that is consistent with ftello.  */
+   /* In order to avoid that ftell gets defined as a macro here, the
+      developer can request the 'ftell' module.  */
+#  undef ftell
+#  define ftell rpl_ftell
+static inline long _GL_ARG_NONNULL ((1))
+rpl_ftell (FILE *f)
+{
+#  if @REPLACE_FTELLO@
+  return rpl_ftello (f);
+#  else
+  return ftello (f);
+#  endif
+}
 # endif
 #elif defined GNULIB_POSIXCHECK
-# undef dprintf
-# define dprintf(d,f,a) \
-    (GL_LINK_WARNING ("dprintf is unportable - " \
-                      "use gnulib module dprintf for portability"), \
-     dprintf (d, f, a))
+# define _GL_FTELL_WARN /* Category 1, above.  */
+# undef ftell
+# undef ftello
+# if HAVE_RAW_DECL_FTELLO
+_GL_WARN_ON_USE (ftello, "ftello is unportable - "
+                 "use gnulib module ftello for portability");
+# endif
 #endif
 
-#if @GNULIB_VDPRINTF@
-# if @REPLACE_VDPRINTF@
-#  define vdprintf rpl_vdprintf
+#ifdef _GL_FTELL_WARN
+# undef _GL_FTELL_WARN
+/* Here, either ftell is undefined (but C89 guarantees that it is
+   declared), or it is defined as rpl_ftell (declared above).  */
+_GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
+                 "on 32-bit platforms - "
+                 "use ftello function for handling of large files");
+#endif
+
+
+#if @GNULIB_FWRITE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fwrite
+#   define fwrite rpl_fwrite
+#  endif
+_GL_FUNCDECL_RPL (fwrite, size_t,
+                  (const void *ptr, size_t s, size_t n, FILE *stream)
+                  _GL_ARG_NONNULL ((1, 4)));
+_GL_CXXALIAS_RPL (fwrite, size_t,
+                  (const void *ptr, size_t s, size_t n, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fwrite, size_t,
+                  (const void *ptr, size_t s, size_t n, FILE *stream));
 # endif
-# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
-extern int vdprintf (int fd, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 2, 0)));
+_GL_CXXALIASWARN (fwrite);
+#endif
+
+#if @GNULIB_GETDELIM@
+/* Read input, up to (and including) the next occurrence of DELIMITER, from
+   STREAM, store it in *LINEPTR (and NUL-terminate it).
+   *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
+   bytes of space.  It is realloc'd as necessary.
+   Return the number of bytes read and stored at *LINEPTR (not including the
+   NUL terminator), or -1 on error or EOF.  */
+# if @REPLACE_GETDELIM@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getdelim
+#   define getdelim rpl_getdelim
+#  endif
+_GL_FUNCDECL_RPL (getdelim, ssize_t,
+                  (char **lineptr, size_t *linesize, int delimiter,
+                   FILE *stream)
+                  _GL_ARG_NONNULL ((1, 2, 4)));
+_GL_CXXALIAS_RPL (getdelim, ssize_t,
+                  (char **lineptr, size_t *linesize, int delimiter,
+                   FILE *stream));
+# else
+#  if !@HAVE_DECL_GETDELIM@
+_GL_FUNCDECL_SYS (getdelim, ssize_t,
+                  (char **lineptr, size_t *linesize, int delimiter,
+                   FILE *stream)
+                  _GL_ARG_NONNULL ((1, 2, 4)));
+#  endif
+_GL_CXXALIAS_SYS (getdelim, ssize_t,
+                  (char **lineptr, size_t *linesize, int delimiter,
+                   FILE *stream));
 # endif
+_GL_CXXALIASWARN (getdelim);
 #elif defined GNULIB_POSIXCHECK
-# undef vdprintf
-# define vdprintf(d,f,a) \
-    (GL_LINK_WARNING ("vdprintf is unportable - " \
-                      "use gnulib module vdprintf for portability"), \
-     vdprintf (d, f, a))
+# undef getdelim
+# if HAVE_RAW_DECL_GETDELIM
+_GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
+                 "use gnulib module getdelim for portability");
+# endif
 #endif
 
-#if @GNULIB_VASPRINTF@
-# if @REPLACE_VASPRINTF@
-#  define asprintf rpl_asprintf
-#  define vasprintf rpl_vasprintf
+#if @GNULIB_GETLINE@
+/* Read a line, up to (and including) the next newline, from STREAM, store it
+   in *LINEPTR (and NUL-terminate it).
+   *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
+   bytes of space.  It is realloc'd as necessary.
+   Return the number of bytes read and stored at *LINEPTR (not including the
+   NUL terminator), or -1 on error or EOF.  */
+# if @REPLACE_GETLINE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getline
+#   define getline rpl_getline
+#  endif
+_GL_FUNCDECL_RPL (getline, ssize_t,
+                  (char **lineptr, size_t *linesize, FILE *stream)
+                  _GL_ARG_NONNULL ((1, 2, 3)));
+_GL_CXXALIAS_RPL (getline, ssize_t,
+                  (char **lineptr, size_t *linesize, FILE *stream));
+# else
+#  if !@HAVE_DECL_GETLINE@
+_GL_FUNCDECL_SYS (getline, ssize_t,
+                  (char **lineptr, size_t *linesize, FILE *stream)
+                  _GL_ARG_NONNULL ((1, 2, 3)));
+#  endif
+_GL_CXXALIAS_SYS (getline, ssize_t,
+                  (char **lineptr, size_t *linesize, FILE *stream));
+# endif
+# if @HAVE_DECL_GETLINE@
+_GL_CXXALIASWARN (getline);
 # endif
-# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
-  /* Write formatted output to a string dynamically allocated with malloc().
-     If the memory allocation succeeds, store the address of the string in
-     *RESULT and return the number of resulting bytes, excluding the trailing
-     NUL.  Upon memory allocation error, or some other error, return -1.  */
-  extern int asprintf (char **result, const char *format, ...)
-    __attribute__ ((__format__ (__printf__, 2, 3)));
-  extern int vasprintf (char **result, const char *format, va_list args)
-    __attribute__ ((__format__ (__printf__, 2, 0)));
+#elif defined GNULIB_POSIXCHECK
+# undef getline
+# if HAVE_RAW_DECL_GETLINE
+_GL_WARN_ON_USE (getline, "getline is unportable - "
+                 "use gnulib module getline for portability");
 # endif
 #endif
 
-#if @GNULIB_OBSTACK_PRINTF@
+#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
+struct obstack;
+/* Grow an obstack with formatted output.  Return the number of
+   bytes added to OBS.  No trailing nul byte is added, and the
+   object should be closed with obstack_finish before use.  Upon
+   memory allocation error, call obstack_alloc_failed_handler.  Upon
+   other error, return -1.  */
 # if @REPLACE_OBSTACK_PRINTF@
-#  define obstack_printf rpl_osbtack_printf
-#  define obstack_vprintf rpl_obstack_vprintf
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define obstack_printf rpl_obstack_printf
+#  endif
+_GL_FUNCDECL_RPL (obstack_printf, int,
+                  (struct obstack *obs, const char *format, ...)
+                  __attribute__ ((__format__ (__printf__, 2, 3)))
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (obstack_printf, int,
+                  (struct obstack *obs, const char *format, ...));
+# else
+#  if !@HAVE_DECL_OBSTACK_PRINTF@
+_GL_FUNCDECL_SYS (obstack_printf, int,
+                  (struct obstack *obs, const char *format, ...)
+                  __attribute__ ((__format__ (__printf__, 2, 3)))
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (obstack_printf, int,
+                  (struct obstack *obs, const char *format, ...));
 # endif
-# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
-  struct obstack;
-  /* Grow an obstack with formatted output.  Return the number of
-     bytes added to OBS.  No trailing nul byte is added, and the
-     object should be closed with obstack_finish before use.  Upon
-     memory allocation error, call obstack_alloc_failed_handler.  Upon
-     other error, return -1.  */
-  extern int obstack_printf (struct obstack *obs, const char *format, ...)
-    __attribute__ ((__format__ (__printf__, 2, 3)));
-  extern int obstack_vprintf (struct obstack *obs, const char *format,
-                             va_list args)
-    __attribute__ ((__format__ (__printf__, 2, 0)));
+_GL_CXXALIASWARN (obstack_printf);
+# if @REPLACE_OBSTACK_PRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define obstack_vprintf rpl_obstack_vprintf
+#  endif
+_GL_FUNCDECL_RPL (obstack_vprintf, int,
+                  (struct obstack *obs, const char *format, va_list args)
+                  __attribute__ ((__format__ (__printf__, 2, 0)))
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (obstack_vprintf, int,
+                  (struct obstack *obs, const char *format, va_list args));
+# else
+#  if !@HAVE_DECL_OBSTACK_PRINTF@
+_GL_FUNCDECL_SYS (obstack_vprintf, int,
+                  (struct obstack *obs, const char *format, va_list args)
+                  __attribute__ ((__format__ (__printf__, 2, 0)))
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (obstack_vprintf, int,
+                  (struct obstack *obs, const char *format, va_list args));
 # endif
+_GL_CXXALIASWARN (obstack_vprintf);
 #endif
 
-#if @GNULIB_FOPEN@
-# if @REPLACE_FOPEN@
-#  undef fopen
-#  define fopen rpl_fopen
-extern FILE * fopen (const char *filename, const char *mode);
+#if @GNULIB_PERROR@
+/* Print a message to standard error, describing the value of ERRNO,
+   (if STRING is not NULL and not empty) prefixed with STRING and ": ",
+   and terminated with a newline.  */
+# if @REPLACE_PERROR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define perror rpl_perror
+#  endif
+_GL_FUNCDECL_RPL (perror, void, (const char *string));
+_GL_CXXALIAS_RPL (perror, void, (const char *string));
+# else
+_GL_CXXALIAS_SYS (perror, void, (const char *string));
 # endif
+_GL_CXXALIASWARN (perror);
 #elif defined GNULIB_POSIXCHECK
-# undef fopen
-# define fopen(f,m) \
-   (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \
-                     "use gnulib module fopen for portability"), \
-    fopen (f, m))
+# undef perror
+/* Assume perror is always declared.  */
+_GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
+                 "use gnulib module perror for portability");
 #endif
 
-#if @GNULIB_FREOPEN@
-# if @REPLACE_FREOPEN@
-#  undef freopen
-#  define freopen rpl_freopen
-extern FILE * freopen (const char *filename, const char *mode, FILE *stream);
+#if @GNULIB_POPEN@
+# if @REPLACE_POPEN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef popen
+#   define popen rpl_popen
+#  endif
+_GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
+                                 _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
+# else
+_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
 # endif
+_GL_CXXALIASWARN (popen);
 #elif defined GNULIB_POSIXCHECK
-# undef freopen
-# define freopen(f,m,s) \
-   (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \
-                     "use gnulib module freopen for portability"), \
-    freopen (f, m, s))
+# undef popen
+# if HAVE_RAW_DECL_POPEN
+_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
+                 "use gnulib module popen or pipe for more portability");
+# endif
 #endif
 
-#if @GNULIB_FSEEKO@
-# if @REPLACE_FSEEKO@
-/* Provide fseek, fseeko functions that are aware of a preceding
-   fflush(), and which detect pipes.  */
-#  define fseeko rpl_fseeko
-extern int fseeko (FILE *fp, off_t offset, int whence);
-#  define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
+#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
+# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
+     || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
+#  if defined __GNUC__
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+/* Don't break __attribute__((format(printf,M,N))).  */
+#    define printf __printf__
+#   endif
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+                    (const char *format, ...)
+                    __asm__ (@ASM_SYMBOL_PREFIX@
+                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+                    __attribute__ ((__format__ (__printf__, 1, 2)))
+                    _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
+#  else
+_GL_FUNCDECL_RPL (printf, int,
+                  (const char *format, ...)
+                  __attribute__ ((__format__ (__printf__, 1, 2)))
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
+#  endif
+#  define GNULIB_overrides_printf 1
+# else
+_GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
 # endif
-#elif defined GNULIB_POSIXCHECK
-# undef fseeko
-# define fseeko(f,o,w) \
-   (GL_LINK_WARNING ("fseeko is unportable - " \
-                     "use gnulib module fseeko for portability"), \
-    fseeko (f, o, w))
+_GL_CXXALIASWARN (printf);
+#endif
+#if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_printf
+#  undef printf
+# endif
+/* Assume printf is always declared.  */
+_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
+                 "use gnulib module printf-posix for portable "
+                 "POSIX compliance");
 #endif
 
-#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
-extern int rpl_fseek (FILE *fp, long offset, int whence);
-# undef fseek
-# if defined GNULIB_POSIXCHECK
-#  define fseek(f,o,w) \
-     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
-                       "on 32-bit platforms - " \
-                       "use fseeko function for handling of large files"), \
-      rpl_fseek (f, o, w))
+#if @GNULIB_PUTC@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putc
+#   define putc rpl_fputc
+#  endif
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
 # else
-#  define fseek rpl_fseek
+_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
 # endif
-#elif defined GNULIB_POSIXCHECK
-# ifndef fseek
-#  define fseek(f,o,w) \
-     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
-                       "on 32-bit platforms - " \
-                       "use fseeko function for handling of large files"), \
-      fseek (f, o, w))
+_GL_CXXALIASWARN (putc);
+#endif
+
+#if @GNULIB_PUTCHAR@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putchar
+#   define putchar rpl_putchar
+#  endif
+_GL_FUNCDECL_RPL (putchar, int, (int c));
+_GL_CXXALIAS_RPL (putchar, int, (int c));
+# else
+_GL_CXXALIAS_SYS (putchar, int, (int c));
 # endif
+_GL_CXXALIASWARN (putchar);
 #endif
 
-#if @GNULIB_FTELLO@
-# if @REPLACE_FTELLO@
-#  define ftello rpl_ftello
-extern off_t ftello (FILE *fp);
-#  define ftell(fp) ftello (fp)
+#if @GNULIB_PUTS@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef puts
+#   define puts rpl_puts
+#  endif
+_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (puts, int, (const char *string));
+# else
+_GL_CXXALIAS_SYS (puts, int, (const char *string));
 # endif
-#elif defined GNULIB_POSIXCHECK
-# undef ftello
-# define ftello(f) \
-   (GL_LINK_WARNING ("ftello is unportable - " \
-                     "use gnulib module ftello for portability"), \
-    ftello (f))
+_GL_CXXALIASWARN (puts);
 #endif
 
-#if @GNULIB_FTELL@ && @REPLACE_FTELL@
-extern long rpl_ftell (FILE *fp);
-# undef ftell
-# if GNULIB_POSIXCHECK
-#  define ftell(f) \
-     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
-                       "on 32-bit platforms - " \
-                       "use ftello function for handling of large files"), \
-      rpl_ftell (f))
+#if @GNULIB_REMOVE@
+# if @REPLACE_REMOVE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef remove
+#   define remove rpl_remove
+#  endif
+_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (remove, int, (const char *name));
 # else
-#  define ftell rpl_ftell
+_GL_CXXALIAS_SYS (remove, int, (const char *name));
 # endif
+_GL_CXXALIASWARN (remove);
 #elif defined GNULIB_POSIXCHECK
-# ifndef ftell
-#  define ftell(f) \
-     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
-                       "on 32-bit platforms - " \
-                       "use ftello function for handling of large files"), \
-      ftell (f))
-# endif
+# undef remove
+/* Assume remove is always declared.  */
+_GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
+                 "use gnulib module remove for more portability");
 #endif
 
-#if @GNULIB_FFLUSH@
-# if @REPLACE_FFLUSH@
-#  define fflush rpl_fflush
-  /* Flush all pending data on STREAM according to POSIX rules.  Both
-     output and seekable input streams are supported.
-     Note! LOSS OF DATA can occur if fflush is applied on an input stream
-     that is _not_seekable_ or on an update stream that is _not_seekable_
-     and in which the most recent operation was input.  Seekability can
-     be tested with lseek(fileno(fp),0,SEEK_CUR).  */
-  extern int fflush (FILE *gl_stream);
+#if @GNULIB_RENAME@
+# if @REPLACE_RENAME@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef rename
+#   define rename rpl_rename
+#  endif
+_GL_FUNCDECL_RPL (rename, int,
+                  (const char *old_filename, const char *new_filename)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (rename, int,
+                  (const char *old_filename, const char *new_filename));
+# else
+_GL_CXXALIAS_SYS (rename, int,
+                  (const char *old_filename, const char *new_filename));
 # endif
+_GL_CXXALIASWARN (rename);
 #elif defined GNULIB_POSIXCHECK
-# undef fflush
-# define fflush(f) \
-   (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
-                     "use gnulib module fflush for portable " \
-                     "POSIX compliance"), \
-    fflush (f))
+# undef rename
+/* Assume rename is always declared.  */
+_GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
+                 "use gnulib module rename for more portability");
 #endif
 
-#if @GNULIB_FCLOSE@
-# if @REPLACE_FCLOSE@
-#  define fclose rpl_fclose
-  /* Close STREAM and its underlying file descriptor.  */
-extern int fclose (FILE *stream);
+#if @GNULIB_RENAMEAT@
+# if @REPLACE_RENAMEAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef renameat
+#   define renameat rpl_renameat
+#  endif
+_GL_FUNCDECL_RPL (renameat, int,
+                  (int fd1, char const *file1, int fd2, char const *file2)
+                  _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (renameat, int,
+                  (int fd1, char const *file1, int fd2, char const *file2));
+# else
+#  if !@HAVE_RENAMEAT@
+_GL_FUNCDECL_SYS (renameat, int,
+                  (int fd1, char const *file1, int fd2, char const *file2)
+                  _GL_ARG_NONNULL ((2, 4)));
+#  endif
+_GL_CXXALIAS_SYS (renameat, int,
+                  (int fd1, char const *file1, int fd2, char const *file2));
 # endif
+_GL_CXXALIASWARN (renameat);
 #elif defined GNULIB_POSIXCHECK
-# undef fclose
-# define fclose(f) \
-   (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \
-                     "use gnulib module fclose for portable " \
-                     "POSIX compliance"), \
-    fclose (f))
+# undef renameat
+# if HAVE_RAW_DECL_RENAMEAT
+_GL_WARN_ON_USE (renameat, "renameat is not portable - "
+                 "use gnulib module renameat for portability");
+# endif
 #endif
 
-#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef fputc
-# define fputc rpl_fputc
-extern int fputc (int c, FILE *stream);
+#if @GNULIB_SNPRINTF@
+# if @REPLACE_SNPRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define snprintf rpl_snprintf
+#  endif
+_GL_FUNCDECL_RPL (snprintf, int,
+                  (char *str, size_t size, const char *format, ...)
+                  __attribute__ ((__format__ (__printf__, 3, 4)))
+                  _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (snprintf, int,
+                  (char *str, size_t size, const char *format, ...));
+# else
+#  if !@HAVE_DECL_SNPRINTF@
+_GL_FUNCDECL_SYS (snprintf, int,
+                  (char *str, size_t size, const char *format, ...)
+                  __attribute__ ((__format__ (__printf__, 3, 4)))
+                  _GL_ARG_NONNULL ((3)));
+#  endif
+_GL_CXXALIAS_SYS (snprintf, int,
+                  (char *str, size_t size, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (snprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef snprintf
+# if HAVE_RAW_DECL_SNPRINTF
+_GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+                 "use gnulib module snprintf for portability");
+# endif
 #endif
 
-#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef putc
-# define putc rpl_fputc
-extern int putc (int c, FILE *stream);
-#endif
+/* Some people would argue that sprintf should be handled like gets
+   (for example, OpenBSD issues a link warning for both functions),
+   since both can cause security holes due to buffer overruns.
+   However, we believe that sprintf can be used safely, and is more
+   efficient than snprintf in those safe cases; and as proof of our
+   belief, we use sprintf in several gnulib modules.  So this header
+   intentionally avoids adding a warning to sprintf except when
+   GNULIB_POSIXCHECK is defined.  */
 
-#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef putchar
-# define putchar rpl_putchar
-extern int putchar (int c);
+#if @GNULIB_SPRINTF_POSIX@
+# if @REPLACE_SPRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define sprintf rpl_sprintf
+#  endif
+_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
+                                __attribute__ ((__format__ (__printf__, 2, 3)))
+                                _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (sprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef sprintf
+/* Assume sprintf is always declared.  */
+_GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
+                 "use gnulib module sprintf-posix for portable "
+                 "POSIX compliance");
 #endif
 
-#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef fputs
-# define fputs rpl_fputs
-extern int fputs (const char *string, FILE *stream);
+#if @GNULIB_TMPFILE@
+# if @REPLACE_TMPFILE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define tmpfile rpl_tmpfile
+#  endif
+_GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
+_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
+# else
+_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
+# endif
+_GL_CXXALIASWARN (tmpfile);
+#elif defined GNULIB_POSIXCHECK
+# undef tmpfile
+# if HAVE_RAW_DECL_TMPFILE
+_GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
+                 "use gnulib module tmpfile for portability");
+# endif
 #endif
 
-#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef puts
-# define puts rpl_puts
-extern int puts (const char *string);
+#if @GNULIB_VASPRINTF@
+/* Write formatted output to a string dynamically allocated with malloc().
+   If the memory allocation succeeds, store the address of the string in
+   *RESULT and return the number of resulting bytes, excluding the trailing
+   NUL.  Upon memory allocation error, or some other error, return -1.  */
+# if @REPLACE_VASPRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define asprintf rpl_asprintf
+#  endif
+_GL_FUNCDECL_RPL (asprintf, int,
+                  (char **result, const char *format, ...)
+                  __attribute__ ((__format__ (__printf__, 2, 3)))
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (asprintf, int,
+                  (char **result, const char *format, ...));
+# else
+#  if !@HAVE_VASPRINTF@
+_GL_FUNCDECL_SYS (asprintf, int,
+                  (char **result, const char *format, ...)
+                  __attribute__ ((__format__ (__printf__, 2, 3)))
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (asprintf, int,
+                  (char **result, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (asprintf);
+# if @REPLACE_VASPRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vasprintf rpl_vasprintf
+#  endif
+_GL_FUNCDECL_RPL (vasprintf, int,
+                  (char **result, const char *format, va_list args)
+                  __attribute__ ((__format__ (__printf__, 2, 0)))
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vasprintf, int,
+                  (char **result, const char *format, va_list args));
+# else
+#  if !@HAVE_VASPRINTF@
+_GL_FUNCDECL_SYS (vasprintf, int,
+                  (char **result, const char *format, va_list args)
+                  __attribute__ ((__format__ (__printf__, 2, 0)))
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (vasprintf, int,
+                  (char **result, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vasprintf);
 #endif
 
-#if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef fwrite
-# define fwrite rpl_fwrite
-extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream);
+#if @GNULIB_VDPRINTF@
+# if @REPLACE_VDPRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vdprintf rpl_vdprintf
+#  endif
+_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
+                                 __attribute__ ((__format__ (__printf__, 2, 0)))
+                                 _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
+# else
+#  if !@HAVE_VDPRINTF@
+_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
+                                 __attribute__ ((__format__ (__printf__, 2, 0)))
+                                 _GL_ARG_NONNULL ((2)));
+#  endif
+/* Need to cast, because on Solaris, the third parameter will likely be
+                                                    __va_list args.  */
+_GL_CXXALIAS_SYS_CAST (vdprintf, int,
+                       (int fd, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vdprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef vdprintf
+# if HAVE_RAW_DECL_VDPRINTF
+_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
+                 "use gnulib module vdprintf for portability");
+# endif
 #endif
 
-#if @GNULIB_GETDELIM@
-# if !@HAVE_DECL_GETDELIM@
-/* Read input, up to (and including) the next occurrence of DELIMITER, from
-   STREAM, store it in *LINEPTR (and NUL-terminate it).
-   *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
-   bytes of space.  It is realloc'd as necessary.
-   Return the number of bytes read and stored at *LINEPTR (not including the
-   NUL terminator), or -1 on error or EOF.  */
-extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
-                        FILE *stream);
+#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
+# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
+     || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vfprintf rpl_vfprintf
+#  endif
+#  define GNULIB_overrides_vfprintf 1
+_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
+                                 __attribute__ ((__format__ (__printf__, 2, 0)))
+                                 _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
+# else
+/* Need to cast, because on Solaris, the third parameter is
+                                                      __va_list args
+   and GCC's fixincludes did not change this to __gnuc_va_list.  */
+_GL_CXXALIAS_SYS_CAST (vfprintf, int,
+                       (FILE *fp, const char *format, va_list args));
 # endif
-#elif defined GNULIB_POSIXCHECK
-# undef getdelim
-# define getdelim(l, s, d, f)                                      \
-  (GL_LINK_WARNING ("getdelim is unportable - "                            \
-                   "use gnulib module getdelim for portability"),  \
-   getdelim (l, s, d, f))
+_GL_CXXALIASWARN (vfprintf);
+#endif
+#if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vfprintf
+#  undef vfprintf
+# endif
+/* Assume vfprintf is always declared.  */
+_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
+                 "use gnulib module vfprintf-posix for portable "
+                      "POSIX compliance");
 #endif
 
-#if @GNULIB_GETLINE@
-# if @REPLACE_GETLINE@
-#  undef getline
-#  define getline rpl_getline
+#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
+# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
+     || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vprintf rpl_vprintf
+#  endif
+#  define GNULIB_overrides_vprintf 1
+_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
+                                __attribute__ ((__format__ (__printf__, 1, 0)))
+                                _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
+# else
+/* Need to cast, because on Solaris, the second parameter is
+                                                          __va_list args
+   and GCC's fixincludes did not change this to __gnuc_va_list.  */
+_GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
 # endif
-# if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@
-/* Read a line, up to (and including) the next newline, from STREAM, store it
-   in *LINEPTR (and NUL-terminate it).
-   *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
-   bytes of space.  It is realloc'd as necessary.
-   Return the number of bytes read and stored at *LINEPTR (not including the
-   NUL terminator), or -1 on error or EOF.  */
-extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream);
+_GL_CXXALIASWARN (vprintf);
+#endif
+#if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vprintf
+#  undef vprintf
 # endif
-#elif defined GNULIB_POSIXCHECK
-# undef getline
-# define getline(l, s, f)                                              \
-  (GL_LINK_WARNING ("getline is unportable - "                         \
-                   "use gnulib module getline for portability"),       \
-   getline (l, s, f))
+/* Assume vprintf is always declared.  */
+_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
+                 "use gnulib module vprintf-posix for portable "
+                 "POSIX compliance");
 #endif
 
-#if @GNULIB_PERROR@
-# if @REPLACE_PERROR@
-#  define perror rpl_perror
-/* Print a message to standard error, describing the value of ERRNO,
-   (if STRING is not NULL and not empty) prefixed with STRING and ": ",
-   and terminated with a newline.  */
-extern void perror (const char *string);
+#if @GNULIB_VSNPRINTF@
+# if @REPLACE_VSNPRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vsnprintf rpl_vsnprintf
+#  endif
+_GL_FUNCDECL_RPL (vsnprintf, int,
+                  (char *str, size_t size, const char *format, va_list args)
+                  __attribute__ ((__format__ (__printf__, 3, 0)))
+                  _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (vsnprintf, int,
+                  (char *str, size_t size, const char *format, va_list args));
+# else
+#  if !@HAVE_DECL_VSNPRINTF@
+_GL_FUNCDECL_SYS (vsnprintf, int,
+                  (char *str, size_t size, const char *format, va_list args)
+                  __attribute__ ((__format__ (__printf__, 3, 0)))
+                  _GL_ARG_NONNULL ((3)));
+#  endif
+_GL_CXXALIAS_SYS (vsnprintf, int,
+                  (char *str, size_t size, const char *format, va_list args));
 # endif
+_GL_CXXALIASWARN (vsnprintf);
 #elif defined GNULIB_POSIXCHECK
-# undef perror
-# define perror(s) \
-    (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
-                      "use gnulib module perror for portability"), \
-     perror (s))
+# undef vsnprintf
+# if HAVE_RAW_DECL_VSNPRINTF
+_GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
+                 "use gnulib module vsnprintf for portability");
+# endif
 #endif
 
-#ifdef __cplusplus
-}
+#if @GNULIB_VSPRINTF_POSIX@
+# if @REPLACE_VSPRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vsprintf rpl_vsprintf
+#  endif
+_GL_FUNCDECL_RPL (vsprintf, int,
+                  (char *str, const char *format, va_list args)
+                  __attribute__ ((__format__ (__printf__, 2, 0)))
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vsprintf, int,
+                  (char *str, const char *format, va_list args));
+# else
+/* Need to cast, because on Solaris, the third parameter is
+                                                       __va_list args
+   and GCC's fixincludes did not change this to __gnuc_va_list.  */
+_GL_CXXALIAS_SYS_CAST (vsprintf, int,
+                       (char *str, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vsprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef vsprintf
+/* Assume vsprintf is always declared.  */
+_GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
+                 "use gnulib module vsprintf-posix for portable "
+                      "POSIX compliance");
 #endif
 
+
 #endif /* _GL_STDIO_H */
 #endif /* _GL_STDIO_H */
 #endif
index f99767f600f6c721671db6f74b5ce79c59c28d1a..d4ac4690305e702548d04ab816ccf66c2056e7b4 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2010 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
 #ifndef _GL_STDLIB_H
 #define _GL_STDLIB_H
 
+/* NetBSD 5.0 mis-defines NULL.  */
+#include <stddef.h>
 
 /* Solaris declares getloadavg() in <sys/loadavg.h>.  */
-#if @GNULIB_GETLOADAVG@ && @HAVE_SYS_LOADAVG_H@
+#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
 # include <sys/loadavg.h>
 #endif
 
 # include <random.h>
 #endif
 
-#if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@
+#if !@HAVE_STRUCT_RANDOM_DATA@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@) \
+    || defined GNULIB_POSIXCHECK
 # include <stdint.h>
 #endif
 
 #if !@HAVE_STRUCT_RANDOM_DATA@
 struct random_data
 {
-  int32_t *fptr;               /* Front pointer.  */
-  int32_t *rptr;               /* Rear pointer.  */
-  int32_t *state;              /* Array of state values.  */
-  int rand_type;               /* Type of random number generator.  */
-  int rand_deg;                        /* Degree of random number generator.  */
-  int rand_sep;                        /* Distance between front and rear.  */
-  int32_t *end_ptr;            /* Pointer behind state table.  */
+  int32_t *fptr;                /* Front pointer.  */
+  int32_t *rptr;                /* Rear pointer.  */
+  int32_t *state;               /* Array of state values.  */
+  int rand_type;                /* Type of random number generator.  */
+  int rand_deg;                 /* Degree of random number generator.  */
+  int rand_sep;                 /* Distance between front and rear.  */
+  int32_t *end_ptr;             /* Pointer behind state table.  */
 };
 #endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+#if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+/* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
+/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
+/* But avoid namespace pollution on glibc systems and native Windows.  */
+# include <unistd.h>
+#endif
+
+#ifndef __attribute__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
+#  define __attribute__(Spec)   /* empty */
+# endif
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 
 /* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
@@ -81,88 +101,101 @@ struct random_data
 #endif
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#if @GNULIB_MALLOC_POSIX@
-# if !@HAVE_MALLOC_POSIX@
-#  undef malloc
-#  define malloc rpl_malloc
-extern void * malloc (size_t size);
+#if @GNULIB__EXIT@
+/* Terminate the current process with the given return code, without running
+   the 'atexit' handlers.  */
+# if !@HAVE__EXIT@
+_GL_FUNCDECL_SYS (_Exit, void, (int status) __attribute__ ((__noreturn__)));
 # endif
+_GL_CXXALIAS_SYS (_Exit, void, (int status));
+_GL_CXXALIASWARN (_Exit);
 #elif defined GNULIB_POSIXCHECK
-# undef malloc
-# define malloc(s) \
-    (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \
-                      "use gnulib module malloc-posix for portability"), \
-     malloc (s))
+# undef _Exit
+# if HAVE_RAW_DECL__EXIT
+_GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
+                 "use gnulib module _Exit for portability");
+# endif
 #endif
 
 
-#if @GNULIB_REALLOC_POSIX@
-# if !@HAVE_REALLOC_POSIX@
-#  undef realloc
-#  define realloc rpl_realloc
-extern void * realloc (void *ptr, size_t size);
+#if @GNULIB_ATOLL@
+/* Parse a signed decimal integer.
+   Returns the value of the integer.  Errors are not detected.  */
+# if !@HAVE_ATOLL@
+_GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
+_GL_CXXALIASWARN (atoll);
 #elif defined GNULIB_POSIXCHECK
-# undef realloc
-# define realloc(p,s) \
-    (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \
-                      "use gnulib module realloc-posix for portability"), \
-     realloc (p, s))
+# undef atoll
+# if HAVE_RAW_DECL_ATOLL
+_GL_WARN_ON_USE (atoll, "atoll is unportable - "
+                 "use gnulib module atoll for portability");
+# endif
 #endif
 
-
 #if @GNULIB_CALLOC_POSIX@
-# if !@HAVE_CALLOC_POSIX@
-#  undef calloc
-#  define calloc rpl_calloc
-extern void * calloc (size_t nmemb, size_t size);
+# if @REPLACE_CALLOC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef calloc
+#   define calloc rpl_calloc
+#  endif
+_GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
+_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
+# else
+_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
 # endif
+_GL_CXXALIASWARN (calloc);
 #elif defined GNULIB_POSIXCHECK
 # undef calloc
-# define calloc(n,s) \
-    (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \
-                      "use gnulib module calloc-posix for portability"), \
-     calloc (n, s))
+/* Assume calloc is always declared.  */
+_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
+                 "use gnulib module calloc-posix for portability");
 #endif
 
-
-#if @GNULIB_ATOLL@
-# if !@HAVE_ATOLL@
-/* Parse a signed decimal integer.
-   Returns the value of the integer.  Errors are not detected.  */
-extern long long atoll (const char *string);
+#if @GNULIB_CANONICALIZE_FILE_NAME@
+# if @REPLACE_CANONICALIZE_FILE_NAME@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define canonicalize_file_name rpl_canonicalize_file_name
+#  endif
+_GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
+                                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
+# else
+#  if !@HAVE_CANONICALIZE_FILE_NAME@
+_GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
+                                                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
 # endif
+_GL_CXXALIASWARN (canonicalize_file_name);
 #elif defined GNULIB_POSIXCHECK
-# undef atoll
-# define atoll(s) \
-    (GL_LINK_WARNING ("atoll is unportable - " \
-                      "use gnulib module atoll for portability"), \
-     atoll (s))
+# undef canonicalize_file_name
+# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
+_GL_WARN_ON_USE (canonicalize_file_name, "canonicalize_file_name is unportable - "
+                 "use gnulib module canonicalize-lgpl for portability");
+# endif
 #endif
 
-
 #if @GNULIB_GETLOADAVG@
-# if !@HAVE_DECL_GETLOADAVG@
 /* Store max(NELEM,3) load average numbers in LOADAVG[].
    The three numbers are the load average of the last 1 minute, the last 5
    minutes, and the last 15 minutes, respectively.
    LOADAVG is an array of NELEM numbers.  */
-extern int getloadavg (double loadavg[], int nelem);
+# if !@HAVE_DECL_GETLOADAVG@
+_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
+                                   _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
+_GL_CXXALIASWARN (getloadavg);
 #elif defined GNULIB_POSIXCHECK
 # undef getloadavg
-# define getloadavg(l,n) \
-    (GL_LINK_WARNING ("getloadavg is not portable - " \
-                      "use gnulib module getloadavg for portability"), \
-     getloadavg (l, n))
+# if HAVE_RAW_DECL_GETLOADAVG
+_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
+                 "use gnulib module getloadavg for portability");
+# endif
 #endif
 
-
 #if @GNULIB_GETSUBOPT@
 /* Assuming *OPTIONP is a comma separated list of elements of the form
    "token" or "token=value", getsubopt parses the first of these elements.
@@ -176,37 +209,133 @@ extern int getloadavg (double loadavg[], int nelem);
    For more details see the POSIX:2001 specification.
    http://www.opengroup.org/susv3xsh/getsubopt.html */
 # if !@HAVE_GETSUBOPT@
-extern int getsubopt (char **optionp, char *const *tokens, char **valuep);
+_GL_FUNCDECL_SYS (getsubopt, int,
+                  (char **optionp, char *const *tokens, char **valuep)
+                  _GL_ARG_NONNULL ((1, 2, 3)));
 # endif
+_GL_CXXALIAS_SYS (getsubopt, int,
+                  (char **optionp, char *const *tokens, char **valuep));
+_GL_CXXALIASWARN (getsubopt);
 #elif defined GNULIB_POSIXCHECK
 # undef getsubopt
-# define getsubopt(o,t,v) \
-    (GL_LINK_WARNING ("getsubopt is unportable - " \
-                      "use gnulib module getsubopt for portability"), \
-     getsubopt (o, t, v))
+# if HAVE_RAW_DECL_GETSUBOPT
+_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
+                 "use gnulib module getsubopt for portability");
+# endif
+#endif
+
+#if @GNULIB_GRANTPT@
+/* Change the ownership and access permission of the slave side of the
+   pseudo-terminal whose master side is specified by FD.  */
+# if !@HAVE_GRANTPT@
+_GL_FUNCDECL_SYS (grantpt, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (grantpt, int, (int fd));
+_GL_CXXALIASWARN (grantpt);
+#elif defined GNULIB_POSIXCHECK
+# undef grantpt
+# if HAVE_RAW_DECL_GRANTPT
+_GL_WARN_ON_USE (ptsname, "grantpt is not portable - "
+                 "use gnulib module grantpt for portability");
+# endif
 #endif
 
+#if @GNULIB_MALLOC_POSIX@
+# if @REPLACE_MALLOC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef malloc
+#   define malloc rpl_malloc
+#  endif
+_GL_FUNCDECL_RPL (malloc, void *, (size_t size));
+_GL_CXXALIAS_RPL (malloc, void *, (size_t size));
+# else
+_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
+# endif
+_GL_CXXALIASWARN (malloc);
+#elif defined GNULIB_POSIXCHECK
+# undef malloc
+/* Assume malloc is always declared.  */
+_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
+                 "use gnulib module malloc-posix for portability");
+#endif
 
 #if @GNULIB_MKDTEMP@
-# if !@HAVE_MKDTEMP@
 /* Create a unique temporary directory from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the directory name unique.
    Returns TEMPLATE, or a null pointer if it cannot get a unique name.
    The directory is created mode 700.  */
-extern char * mkdtemp (char * /*template*/);
+# if !@HAVE_MKDTEMP@
+_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
+_GL_CXXALIASWARN (mkdtemp);
 #elif defined GNULIB_POSIXCHECK
 # undef mkdtemp
-# define mkdtemp(t) \
-    (GL_LINK_WARNING ("mkdtemp is unportable - " \
-                      "use gnulib module mkdtemp for portability"), \
-     mkdtemp (t))
+# if HAVE_RAW_DECL_MKDTEMP
+_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
+                 "use gnulib module mkdtemp for portability");
+# endif
+#endif
+
+#if @GNULIB_MKOSTEMP@
+/* Create a unique temporary file from TEMPLATE.
+   The last six characters of TEMPLATE must be "XXXXXX";
+   they are replaced with a string that makes the file name unique.
+   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+   and O_TEXT, O_BINARY (defined in "binary-io.h").
+   The file is then created, with the specified flags, ensuring it didn't exist
+   before.
+   The file is created read-write (mask at least 0600 & ~umask), but it may be
+   world-readable and world-writable (mask 0666 & ~umask), depending on the
+   implementation.
+   Returns the open file descriptor if successful, otherwise -1 and errno
+   set.  */
+# if !@HAVE_MKOSTEMP@
+_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
+                                 _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
+_GL_CXXALIASWARN (mkostemp);
+#elif defined GNULIB_POSIXCHECK
+# undef mkostemp
+# if HAVE_RAW_DECL_MKOSTEMP
+_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
+                 "use gnulib module mkostemp for portability");
+# endif
 #endif
 
+#if @GNULIB_MKOSTEMPS@
+/* Create a unique temporary file from TEMPLATE.
+   The last six characters of TEMPLATE before a suffix of length
+   SUFFIXLEN must be "XXXXXX";
+   they are replaced with a string that makes the file name unique.
+   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+   and O_TEXT, O_BINARY (defined in "binary-io.h").
+   The file is then created, with the specified flags, ensuring it didn't exist
+   before.
+   The file is created read-write (mask at least 0600 & ~umask), but it may be
+   world-readable and world-writable (mask 0666 & ~umask), depending on the
+   implementation.
+   Returns the open file descriptor if successful, otherwise -1 and errno
+   set.  */
+# if !@HAVE_MKOSTEMPS@
+_GL_FUNCDECL_SYS (mkostemps, int,
+                  (char * /*template*/, int /*suffixlen*/, int /*flags*/)
+                  _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkostemps, int,
+                  (char * /*template*/, int /*suffixlen*/, int /*flags*/));
+_GL_CXXALIASWARN (mkostemps);
+#elif defined GNULIB_POSIXCHECK
+# undef mkostemps
+# if HAVE_RAW_DECL_MKOSTEMPS
+_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
+                 "use gnulib module mkostemps for portability");
+# endif
+#endif
 
 #if @GNULIB_MKSTEMP@
-# if @REPLACE_MKSTEMP@
 /* Create a unique temporary file from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the file name unique.
@@ -216,124 +345,276 @@ extern char * mkdtemp (char * /*template*/);
    implementation.
    Returns the open file descriptor if successful, otherwise -1 and errno
    set.  */
-#  define mkstemp rpl_mkstemp
-extern int mkstemp (char * /*template*/);
+# if @REPLACE_MKSTEMP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mkstemp rpl_mkstemp
+#  endif
+_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
 # else
-/* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
-#  include <unistd.h>
+#  if ! @HAVE_MKSTEMP@
+_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
 # endif
+_GL_CXXALIASWARN (mkstemp);
 #elif defined GNULIB_POSIXCHECK
 # undef mkstemp
-# define mkstemp(t) \
-    (GL_LINK_WARNING ("mkstemp is unportable - " \
-                      "use gnulib module mkstemp for portability"), \
-     mkstemp (t))
+# if HAVE_RAW_DECL_MKSTEMP
+_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
+                 "use gnulib module mkstemp for portability");
+# endif
+#endif
+
+#if @GNULIB_MKSTEMPS@
+/* Create a unique temporary file from TEMPLATE.
+   The last six characters of TEMPLATE prior to a suffix of length
+   SUFFIXLEN must be "XXXXXX";
+   they are replaced with a string that makes the file name unique.
+   The file is then created, ensuring it didn't exist before.
+   The file is created read-write (mask at least 0600 & ~umask), but it may be
+   world-readable and world-writable (mask 0666 & ~umask), depending on the
+   implementation.
+   Returns the open file descriptor if successful, otherwise -1 and errno
+   set.  */
+# if !@HAVE_MKSTEMPS@
+_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
+                                 _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
+_GL_CXXALIASWARN (mkstemps);
+#elif defined GNULIB_POSIXCHECK
+# undef mkstemps
+# if HAVE_RAW_DECL_MKSTEMPS
+_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
+                 "use gnulib module mkstemps for portability");
+# endif
 #endif
 
+#if @GNULIB_PTSNAME@
+/* Return the pathname of the pseudo-terminal slave associated with
+   the master FD is open on, or NULL on errors.  */
+# if !@HAVE_PTSNAME@
+_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
+# endif
+_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
+_GL_CXXALIASWARN (ptsname);
+#elif defined GNULIB_POSIXCHECK
+# undef ptsname
+# if HAVE_RAW_DECL_PTSNAME
+_GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
+                 "use gnulib module ptsname for portability");
+# endif
+#endif
 
 #if @GNULIB_PUTENV@
 # if @REPLACE_PUTENV@
-#  undef putenv
-#  define putenv rpl_putenv
-extern int putenv (char *string);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putenv
+#   define putenv rpl_putenv
+#  endif
+_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (putenv, int, (char *string));
+# else
+_GL_CXXALIAS_SYS (putenv, int, (char *string));
 # endif
+_GL_CXXALIASWARN (putenv);
 #endif
 
 
 #if @GNULIB_RANDOM_R@
 # if !@HAVE_RANDOM_R@
-
 #  ifndef RAND_MAX
 #   define RAND_MAX 2147483647
 #  endif
+# endif
+#endif
 
-int srandom_r (unsigned int seed, struct random_data *rand_state);
-int initstate_r (unsigned int seed, char *buf, size_t buf_size,
-                struct random_data *rand_state);
-int setstate_r (char *arg_state, struct random_data *rand_state);
-int random_r (struct random_data *buf, int32_t *result);
+#if @GNULIB_RANDOM_R@
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
+                                 _GL_ARG_NONNULL ((1, 2)));
 # endif
+_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
+_GL_CXXALIASWARN (random_r);
 #elif defined GNULIB_POSIXCHECK
 # undef random_r
-# define random_r(b,r)                           \
-    (GL_LINK_WARNING ("random_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     random_r (b,r))
-# undef initstate_r
-# define initstate_r(s,b,sz,r)                      \
-    (GL_LINK_WARNING ("initstate_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     initstate_r (s,b,sz,r))
+# if HAVE_RAW_DECL_RANDOM_R
+_GL_WARN_ON_USE (random_r, "random_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (srandom_r, int,
+                  (unsigned int seed, struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (srandom_r, int,
+                  (unsigned int seed, struct random_data *rand_state));
+_GL_CXXALIASWARN (srandom_r);
+#elif defined GNULIB_POSIXCHECK
 # undef srandom_r
-# define srandom_r(s,r)                                   \
-    (GL_LINK_WARNING ("srandom_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     srandom_r (s,r))
+# if HAVE_RAW_DECL_SRANDOM_R
+_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (initstate_r, int,
+                  (unsigned int seed, char *buf, size_t buf_size,
+                   struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((2, 4)));
+# endif
+_GL_CXXALIAS_SYS (initstate_r, int,
+                  (unsigned int seed, char *buf, size_t buf_size,
+                   struct random_data *rand_state));
+_GL_CXXALIASWARN (initstate_r);
+#elif defined GNULIB_POSIXCHECK
+# undef initstate_r
+# if HAVE_RAW_DECL_INITSTATE_R
+_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (setstate_r, int,
+                  (char *arg_state, struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (setstate_r, int,
+                  (char *arg_state, struct random_data *rand_state));
+_GL_CXXALIASWARN (setstate_r);
+#elif defined GNULIB_POSIXCHECK
 # undef setstate_r
-# define setstate_r(a,r)                                   \
-    (GL_LINK_WARNING ("setstate_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     setstate_r (a,r))
+# if HAVE_RAW_DECL_SETSTATE_R
+_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
+#endif
+
+
+#if @GNULIB_REALLOC_POSIX@
+# if @REPLACE_REALLOC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef realloc
+#   define realloc rpl_realloc
+#  endif
+_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
+_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
+# else
+_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
+# endif
+_GL_CXXALIASWARN (realloc);
+#elif defined GNULIB_POSIXCHECK
+# undef realloc
+/* Assume realloc is always declared.  */
+_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
+                 "use gnulib module realloc-posix for portability");
 #endif
 
+#if @GNULIB_REALPATH@
+# if @REPLACE_REALPATH@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define realpath rpl_realpath
+#  endif
+_GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
+                                    _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
+# else
+#  if !@HAVE_REALPATH@
+_GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
+                                    _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
+# endif
+_GL_CXXALIASWARN (realpath);
+#elif defined GNULIB_POSIXCHECK
+# undef realpath
+# if HAVE_RAW_DECL_REALPATH
+_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
+                 "canonicalize or canonicalize-lgpl for portability");
+# endif
+#endif
 
 #if @GNULIB_RPMATCH@
-# if !@HAVE_RPMATCH@
 /* Test a user response to a question.
    Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
-extern int rpmatch (const char *response);
+# if !@HAVE_RPMATCH@
+_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
+_GL_CXXALIASWARN (rpmatch);
 #elif defined GNULIB_POSIXCHECK
 # undef rpmatch
-# define rpmatch(r) \
-    (GL_LINK_WARNING ("rpmatch is unportable - " \
-                      "use gnulib module rpmatch for portability"), \
-     rpmatch (r))
+# if HAVE_RAW_DECL_RPMATCH
+_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
+                 "use gnulib module rpmatch for portability");
+# endif
 #endif
 
-
 #if @GNULIB_SETENV@
-# if !@HAVE_SETENV@
 /* Set NAME to VALUE in the environment.
    If REPLACE is nonzero, overwrite an existing value.  */
-extern int setenv (const char *name, const char *value, int replace);
-# endif
-#endif
-
-
-#if @GNULIB_UNSETENV@
-# if @HAVE_UNSETENV@
-#  if @VOID_UNSETENV@
-/* On some systems, unsetenv() returns void.
-   This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4.  */
-#   define unsetenv(name) ((unsetenv)(name), 0)
+# if @REPLACE_SETENV@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef setenv
+#   define setenv rpl_setenv
 #  endif
+_GL_FUNCDECL_RPL (setenv, int,
+                  (const char *name, const char *value, int replace)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (setenv, int,
+                  (const char *name, const char *value, int replace));
 # else
-/* Remove the variable NAME from the environment.  */
-extern int unsetenv (const char *name);
+#  if !@HAVE_SETENV@
+_GL_FUNCDECL_SYS (setenv, int,
+                  (const char *name, const char *value, int replace)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (setenv, int,
+                  (const char *name, const char *value, int replace));
+# endif
+_GL_CXXALIASWARN (setenv);
+#elif defined GNULIB_POSIXCHECK
+# undef setenv
+# if HAVE_RAW_DECL_SETENV
+_GL_WARN_ON_USE (setenv, "setenv is unportable - "
+                 "use gnulib module setenv for portability");
 # endif
 #endif
 
-
 #if @GNULIB_STRTOD@
-# if @REPLACE_STRTOD@
-#  define strtod rpl_strtod
-# endif
-# if !@HAVE_STRTOD@ || @REPLACE_STRTOD@
  /* Parse a double from STRING, updating ENDP if appropriate.  */
-extern double strtod (const char *str, char **endp);
+# if @REPLACE_STRTOD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strtod rpl_strtod
+#  endif
+_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
+                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
+# else
+#  if !@HAVE_STRTOD@
+_GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
+                                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
 # endif
+_GL_CXXALIASWARN (strtod);
 #elif defined GNULIB_POSIXCHECK
 # undef strtod
-# define strtod(s, e)                           \
-    (GL_LINK_WARNING ("strtod is unportable - " \
-                      "use gnulib module strtod for portability"), \
-     strtod (s, e))
+# if HAVE_RAW_DECL_STRTOD
+_GL_WARN_ON_USE (strtod, "strtod is unportable - "
+                 "use gnulib module strtod for portability");
+# endif
 #endif
 
-
 #if @GNULIB_STRTOLL@
-# if !@HAVE_STRTOLL@
 /* Parse a signed integer whose textual representation starts at STRING.
    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
@@ -342,19 +623,23 @@ extern double strtod (const char *str, char **endp);
    stored in *ENDPTR.
    Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
    to ERANGE.  */
-extern long long strtoll (const char *string, char **endptr, int base);
+# if !@HAVE_STRTOLL@
+_GL_FUNCDECL_SYS (strtoll, long long,
+                  (const char *string, char **endptr, int base)
+                  _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (strtoll, long long,
+                  (const char *string, char **endptr, int base));
+_GL_CXXALIASWARN (strtoll);
 #elif defined GNULIB_POSIXCHECK
 # undef strtoll
-# define strtoll(s,e,b) \
-    (GL_LINK_WARNING ("strtoll is unportable - " \
-                      "use gnulib module strtoll for portability"), \
-     strtoll (s, e, b))
+# if HAVE_RAW_DECL_STRTOLL
+_GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
+                 "use gnulib module strtoll for portability");
+# endif
 #endif
 
-
 #if @GNULIB_STRTOULL@
-# if !@HAVE_STRTOULL@
 /* Parse an unsigned integer whose textual representation starts at STRING.
    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
@@ -363,21 +648,63 @@ extern long long strtoll (const char *string, char **endptr, int base);
    stored in *ENDPTR.
    Upon overflow, the return value is ULLONG_MAX, and errno is set to
    ERANGE.  */
-extern unsigned long long strtoull (const char *string, char **endptr, int base);
+# if !@HAVE_STRTOULL@
+_GL_FUNCDECL_SYS (strtoull, unsigned long long,
+                  (const char *string, char **endptr, int base)
+                  _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (strtoull, unsigned long long,
+                  (const char *string, char **endptr, int base));
+_GL_CXXALIASWARN (strtoull);
 #elif defined GNULIB_POSIXCHECK
 # undef strtoull
-# define strtoull(s,e,b) \
-    (GL_LINK_WARNING ("strtoull is unportable - " \
-                      "use gnulib module strtoull for portability"), \
-     strtoull (s, e, b))
+# if HAVE_RAW_DECL_STRTOULL
+_GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
+                 "use gnulib module strtoull for portability");
+# endif
 #endif
 
+#if @GNULIB_UNLOCKPT@
+/* Unlock the slave side of the pseudo-terminal whose master side is specified
+   by FD, so that it can be opened.  */
+# if !@HAVE_UNLOCKPT@
+_GL_FUNCDECL_SYS (unlockpt, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (unlockpt, int, (int fd));
+_GL_CXXALIASWARN (unlockpt);
+#elif defined GNULIB_POSIXCHECK
+# undef unlockpt
+# if HAVE_RAW_DECL_UNLOCKPT
+_GL_WARN_ON_USE (ptsname, "unlockpt is not portable - "
+                 "use gnulib module unlockpt for portability");
+# endif
+#endif
 
-#ifdef __cplusplus
-}
+#if @GNULIB_UNSETENV@
+/* Remove the variable NAME from the environment.  */
+# if @REPLACE_UNSETENV@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef unsetenv
+#   define unsetenv rpl_unsetenv
+#  endif
+_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
+# else
+#  if !@HAVE_UNSETENV@
+_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
+# endif
+_GL_CXXALIASWARN (unsetenv);
+#elif defined GNULIB_POSIXCHECK
+# undef unsetenv
+# if HAVE_RAW_DECL_UNSETENV
+_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
+                 "use gnulib module unsetenv for portability");
+# endif
 #endif
 
+
 #endif /* _GL_STDLIB_H */
 #endif /* _GL_STDLIB_H */
 #endif
index 80df916321ff1fb7590e7b96821da5e693354928..aa65bb8e11bbc10fc4c749c99df0e6c2dce9f004 100644 (file)
@@ -1,5 +1,5 @@
 /* Optimized string comparison.
-   Copyright (C) 2001-2002, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007, 2009-2010 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
diff --git a/gnulib/string.in.h b/gnulib/string.in.h
new file mode 100644 (file)
index 0000000..97b9db4
--- /dev/null
@@ -0,0 +1,939 @@
+/* A GNU-like <string.h>.
+
+   Copyright (C) 1995-1996, 2001-2010 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 3, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _GL_STRING_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_STRING_H@
+
+#ifndef _GL_STRING_H
+#define _GL_STRING_H
+
+/* NetBSD 5.0 mis-defines NULL.  */
+#include <stddef.h>
+
+/* MirBSD defines mbslen as a macro.  */
+#if @GNULIB_MBSLEN@ && defined __MirBSD__
+# include <wchar.h>
+#endif
+
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later.  */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
+#  define __attribute__(Spec) /* empty */
+# endif
+#endif
+/* The attribute __pure__ was added in gcc 2.96.  */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
+/* Return the first instance of C within N bytes of S, or NULL.  */
+#if @GNULIB_MEMCHR@
+# if @REPLACE_MEMCHR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define memchr rpl_memchr
+#  endif
+_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
+# else
+#  if ! @HAVE_MEMCHR@
+_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1)));
+#  endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C" { const void * std::memchr (const void *, int, size_t); }
+       extern "C++" { void * std::memchr (void *, int, size_t); }  */
+_GL_CXXALIAS_SYS_CAST2 (memchr,
+                        void *, (void const *__s, int __c, size_t __n),
+                        void const *, (void const *__s, int __c, size_t __n));
+# endif
+# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
+_GL_CXXALIASWARN1 (memchr, void const *,
+                   (void const *__s, int __c, size_t __n));
+# else
+_GL_CXXALIASWARN (memchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memchr
+/* Assume memchr is always declared.  */
+_GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
+                 "use gnulib module memchr for portability" );
+#endif
+
+/* Return the first occurrence of NEEDLE in HAYSTACK.  */
+#if @GNULIB_MEMMEM@
+# if @REPLACE_MEMMEM@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define memmem rpl_memmem
+#  endif
+_GL_FUNCDECL_RPL (memmem, void *,
+                  (void const *__haystack, size_t __haystack_len,
+                   void const *__needle, size_t __needle_len)
+                  _GL_ATTRIBUTE_PURE
+                  _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (memmem, void *,
+                  (void const *__haystack, size_t __haystack_len,
+                   void const *__needle, size_t __needle_len));
+# else
+#  if ! @HAVE_DECL_MEMMEM@
+_GL_FUNCDECL_SYS (memmem, void *,
+                  (void const *__haystack, size_t __haystack_len,
+                   void const *__needle, size_t __needle_len)
+                  _GL_ATTRIBUTE_PURE
+                  _GL_ARG_NONNULL ((1, 3)));
+#  endif
+_GL_CXXALIAS_SYS (memmem, void *,
+                  (void const *__haystack, size_t __haystack_len,
+                   void const *__needle, size_t __needle_len));
+# endif
+_GL_CXXALIASWARN (memmem);
+#elif defined GNULIB_POSIXCHECK
+# undef memmem
+# if HAVE_RAW_DECL_MEMMEM
+_GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
+                 "use gnulib module memmem-simple for portability, "
+                 "and module memmem for speed" );
+# endif
+#endif
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+   last written byte.  */
+#if @GNULIB_MEMPCPY@
+# if ! @HAVE_MEMPCPY@
+_GL_FUNCDECL_SYS (mempcpy, void *,
+                  (void *restrict __dest, void const *restrict __src,
+                   size_t __n)
+                  _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (mempcpy, void *,
+                  (void *restrict __dest, void const *restrict __src,
+                   size_t __n));
+_GL_CXXALIASWARN (mempcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef mempcpy
+# if HAVE_RAW_DECL_MEMPCPY
+_GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
+                 "use gnulib module mempcpy for portability");
+# endif
+#endif
+
+/* Search backwards through a block for a byte (specified as an int).  */
+#if @GNULIB_MEMRCHR@
+# if ! @HAVE_DECL_MEMRCHR@
+_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1)));
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" { const void * std::memrchr (const void *, int, size_t); }
+       extern "C++" { void * std::memrchr (void *, int, size_t); }  */
+_GL_CXXALIAS_SYS_CAST2 (memrchr,
+                        void *, (void const *, int, size_t),
+                        void const *, (void const *, int, size_t));
+# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
+_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
+# else
+_GL_CXXALIASWARN (memrchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memrchr
+# if HAVE_RAW_DECL_MEMRCHR
+_GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
+                 "use gnulib module memrchr for portability");
+# endif
+#endif
+
+/* Find the first occurrence of C in S.  More efficient than
+   memchr(S,C,N), at the expense of undefined behavior if C does not
+   occur within N bytes.  */
+#if @GNULIB_RAWMEMCHR@
+# if ! @HAVE_RAWMEMCHR@
+_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
+                                     _GL_ATTRIBUTE_PURE
+                                     _GL_ARG_NONNULL ((1)));
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" { const void * std::rawmemchr (const void *, int); }
+       extern "C++" { void * std::rawmemchr (void *, int); }  */
+_GL_CXXALIAS_SYS_CAST2 (rawmemchr,
+                        void *, (void const *__s, int __c_in),
+                        void const *, (void const *__s, int __c_in));
+# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
+_GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
+# else
+_GL_CXXALIASWARN (rawmemchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rawmemchr
+# if HAVE_RAW_DECL_RAWMEMCHR
+_GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
+                 "use gnulib module rawmemchr for portability");
+# endif
+#endif
+
+/* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
+#if @GNULIB_STPCPY@
+# if ! @HAVE_STPCPY@
+_GL_FUNCDECL_SYS (stpcpy, char *,
+                  (char *restrict __dst, char const *restrict __src)
+                  _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (stpcpy, char *,
+                  (char *restrict __dst, char const *restrict __src));
+_GL_CXXALIASWARN (stpcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef stpcpy
+# if HAVE_RAW_DECL_STPCPY
+_GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
+                 "use gnulib module stpcpy for portability");
+# endif
+#endif
+
+/* Copy no more than N bytes of SRC to DST, returning a pointer past the
+   last non-NUL byte written into DST.  */
+#if @GNULIB_STPNCPY@
+# if @REPLACE_STPNCPY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef stpncpy
+#   define stpncpy rpl_stpncpy
+#  endif
+_GL_FUNCDECL_RPL (stpncpy, char *,
+                  (char *restrict __dst, char const *restrict __src,
+                   size_t __n)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (stpncpy, char *,
+                  (char *restrict __dst, char const *restrict __src,
+                   size_t __n));
+# else
+#  if ! @HAVE_STPNCPY@
+_GL_FUNCDECL_SYS (stpncpy, char *,
+                  (char *restrict __dst, char const *restrict __src,
+                   size_t __n)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (stpncpy, char *,
+                  (char *restrict __dst, char const *restrict __src,
+                   size_t __n));
+# endif
+_GL_CXXALIASWARN (stpncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef stpncpy
+# if HAVE_RAW_DECL_STPNCPY
+_GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
+                 "use gnulib module stpncpy for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strchr() does not work with multibyte strings if the locale encoding is
+   GB18030 and the character to be searched is a digit.  */
+# undef strchr
+/* Assume strchr is always declared.  */
+_GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
+                 "in some multibyte locales - "
+                 "use mbschr if you care about internationalization");
+#endif
+
+/* Find the first occurrence of C in S or the final NUL byte.  */
+#if @GNULIB_STRCHRNUL@
+# if ! @HAVE_STRCHRNUL@
+_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
+                                     _GL_ATTRIBUTE_PURE
+                                     _GL_ARG_NONNULL ((1)));
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" { const char * std::strchrnul (const char *, int); }
+       extern "C++" { char * std::strchrnul (char *, int); }  */
+_GL_CXXALIAS_SYS_CAST2 (strchrnul,
+                        char *, (char const *__s, int __c_in),
+                        char const *, (char const *__s, int __c_in));
+# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
+_GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
+# else
+_GL_CXXALIASWARN (strchrnul);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strchrnul
+# if HAVE_RAW_DECL_STRCHRNUL
+_GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
+                 "use gnulib module strchrnul for portability");
+# endif
+#endif
+
+/* Duplicate S, returning an identical malloc'd string.  */
+#if @GNULIB_STRDUP@
+# if @REPLACE_STRDUP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strdup
+#   define strdup rpl_strdup
+#  endif
+_GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
+# else
+#  if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
+    /* strdup exists as a function and as a macro.  Get rid of the macro.  */
+#   undef strdup
+#  endif
+#  if !(@HAVE_DECL_STRDUP@ || defined strdup)
+_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
+# endif
+_GL_CXXALIASWARN (strdup);
+#elif defined GNULIB_POSIXCHECK
+# undef strdup
+# if HAVE_RAW_DECL_STRDUP
+_GL_WARN_ON_USE (strdup, "strdup is unportable - "
+                 "use gnulib module strdup for portability");
+# endif
+#endif
+
+/* Append no more than N characters from SRC onto DEST.  */
+#if @GNULIB_STRNCAT@
+# if @REPLACE_STRNCAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strncat
+#   define strncat rpl_strncat
+#  endif
+_GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n)
+                                   _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n));
+# else
+_GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n));
+# endif
+_GL_CXXALIASWARN (strncat);
+#elif defined GNULIB_POSIXCHECK
+# undef strncat
+# if HAVE_RAW_DECL_STRNCAT
+_GL_WARN_ON_USE (strncat, "strncat is unportable - "
+                 "use gnulib module strncat for portability");
+# endif
+#endif
+
+/* Return a newly allocated copy of at most N bytes of STRING.  */
+#if @GNULIB_STRNDUP@
+# if @REPLACE_STRNDUP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strndup
+#   define strndup rpl_strndup
+#  endif
+_GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n)
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n));
+# else
+#  if ! @HAVE_DECL_STRNDUP@
+_GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n)
+                                   _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n));
+# endif
+_GL_CXXALIASWARN (strndup);
+#elif defined GNULIB_POSIXCHECK
+# undef strndup
+# if HAVE_RAW_DECL_STRNDUP
+_GL_WARN_ON_USE (strndup, "strndup is unportable - "
+                 "use gnulib module strndup for portability");
+# endif
+#endif
+
+/* Find the length (number of bytes) of STRING, but scan at most
+   MAXLEN bytes.  If no '\0' terminator is found in that many bytes,
+   return MAXLEN.  */
+#if @GNULIB_STRNLEN@
+# if @REPLACE_STRNLEN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strnlen
+#   define strnlen rpl_strnlen
+#  endif
+_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
+# else
+#  if ! @HAVE_DECL_STRNLEN@
+_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen));
+# endif
+_GL_CXXALIASWARN (strnlen);
+#elif defined GNULIB_POSIXCHECK
+# undef strnlen
+# if HAVE_RAW_DECL_STRNLEN
+_GL_WARN_ON_USE (strnlen, "strnlen is unportable - "
+                 "use gnulib module strnlen for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strcspn() assumes the second argument is a list of single-byte characters.
+   Even in this simple case, it does not work with multibyte strings if the
+   locale encoding is GB18030 and one of the characters to be searched is a
+   digit.  */
+# undef strcspn
+/* Assume strcspn is always declared.  */
+_GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbscspn if you care about internationalization");
+#endif
+
+/* Find the first occurrence in S of any character in ACCEPT.  */
+#if @GNULIB_STRPBRK@
+# if ! @HAVE_STRPBRK@
+_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1, 2)));
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C" { const char * strpbrk (const char *, const char *); }
+       extern "C++" { char * strpbrk (char *, const char *); }  */
+_GL_CXXALIAS_SYS_CAST2 (strpbrk,
+                        char *, (char const *__s, char const *__accept),
+                        const char *, (char const *__s, char const *__accept));
+# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
+_GL_CXXALIASWARN1 (strpbrk, char const *,
+                   (char const *__s, char const *__accept));
+# else
+_GL_CXXALIASWARN (strpbrk);
+# endif
+# if defined GNULIB_POSIXCHECK
+/* strpbrk() assumes the second argument is a list of single-byte characters.
+   Even in this simple case, it does not work with multibyte strings if the
+   locale encoding is GB18030 and one of the characters to be searched is a
+   digit.  */
+#  undef strpbrk
+_GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbspbrk if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strpbrk
+# if HAVE_RAW_DECL_STRPBRK
+_GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - "
+                 "use gnulib module strpbrk for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strspn() assumes the second argument is a list of single-byte characters.
+   Even in this simple case, it cannot work with multibyte strings.  */
+# undef strspn
+/* Assume strspn is always declared.  */
+_GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbsspn if you care about internationalization");
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strrchr() does not work with multibyte strings if the locale encoding is
+   GB18030 and the character to be searched is a digit.  */
+# undef strrchr
+/* Assume strrchr is always declared.  */
+_GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings "
+                 "in some multibyte locales - "
+                 "use mbsrchr if you care about internationalization");
+#endif
+
+/* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
+   If one is found, overwrite it with a NUL, and advance *STRINGP
+   to point to the next char after it.  Otherwise, set *STRINGP to NULL.
+   If *STRINGP was already NULL, nothing happens.
+   Return the old value of *STRINGP.
+
+   This is a variant of strtok() that is multithread-safe and supports
+   empty fields.
+
+   Caveat: It modifies the original string.
+   Caveat: These functions cannot be used on constant strings.
+   Caveat: The identity of the delimiting character is lost.
+   Caveat: It doesn't work with multibyte strings unless all of the delimiter
+           characters are ASCII characters < 0x30.
+
+   See also strtok_r().  */
+#if @GNULIB_STRSEP@
+# if ! @HAVE_STRSEP@
+_GL_FUNCDECL_SYS (strsep, char *,
+                  (char **restrict __stringp, char const *restrict __delim)
+                  _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (strsep, char *,
+                  (char **restrict __stringp, char const *restrict __delim));
+_GL_CXXALIASWARN (strsep);
+# if defined GNULIB_POSIXCHECK
+#  undef strsep
+_GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbssep if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strsep
+# if HAVE_RAW_DECL_STRSEP
+_GL_WARN_ON_USE (strsep, "strsep is unportable - "
+                 "use gnulib module strsep for portability");
+# endif
+#endif
+
+#if @GNULIB_STRSTR@
+# if @REPLACE_STRSTR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strstr rpl_strstr
+#  endif
+_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
+# else
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" { const char * strstr (const char *, const char *); }
+       extern "C++" { char * strstr (char *, const char *); }  */
+_GL_CXXALIAS_SYS_CAST2 (strstr,
+                        char *, (const char *haystack, const char *needle),
+                        const char *, (const char *haystack, const char *needle));
+# endif
+# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
+_GL_CXXALIASWARN1 (strstr, const char *,
+                   (const char *haystack, const char *needle));
+# else
+_GL_CXXALIASWARN (strstr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+/* strstr() does not work with multibyte strings if the locale encoding is
+   different from UTF-8:
+   POSIX says that it operates on "strings", and "string" in POSIX is defined
+   as a sequence of bytes, not of characters.  */
+# undef strstr
+/* Assume strstr is always declared.  */
+_GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
+                 "work correctly on character strings in most "
+                 "multibyte locales - "
+                 "use mbsstr if you care about internationalization, "
+                 "or use strstr if you care about speed");
+#endif
+
+/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
+   comparison.  */
+#if @GNULIB_STRCASESTR@
+# if @REPLACE_STRCASESTR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strcasestr rpl_strcasestr
+#  endif
+_GL_FUNCDECL_RPL (strcasestr, char *,
+                  (const char *haystack, const char *needle)
+                  _GL_ATTRIBUTE_PURE
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strcasestr, char *,
+                  (const char *haystack, const char *needle));
+# else
+#  if ! @HAVE_STRCASESTR@
+_GL_FUNCDECL_SYS (strcasestr, char *,
+                  (const char *haystack, const char *needle)
+                  _GL_ATTRIBUTE_PURE
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" { const char * strcasestr (const char *, const char *); }
+       extern "C++" { char * strcasestr (char *, const char *); }  */
+_GL_CXXALIAS_SYS_CAST2 (strcasestr,
+                        char *, (const char *haystack, const char *needle),
+                        const char *, (const char *haystack, const char *needle));
+# endif
+# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
+_GL_CXXALIASWARN1 (strcasestr, const char *,
+                   (const char *haystack, const char *needle));
+# else
+_GL_CXXALIASWARN (strcasestr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+/* strcasestr() does not work with multibyte strings:
+   It is a glibc extension, and glibc implements it only for unibyte
+   locales.  */
+# undef strcasestr
+# if HAVE_RAW_DECL_STRCASESTR
+_GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
+                 "strings in multibyte locales - "
+                 "use mbscasestr if you care about "
+                 "internationalization, or use c-strcasestr if you want "
+                 "a locale independent function");
+# endif
+#endif
+
+/* Parse S into tokens separated by characters in DELIM.
+   If S is NULL, the saved pointer in SAVE_PTR is used as
+   the next starting point.  For example:
+        char s[] = "-abc-=-def";
+        char *sp;
+        x = strtok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
+        x = strtok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
+        x = strtok_r(NULL, "=", &sp);   // x = NULL
+                // s = "abc\0-def\0"
+
+   This is a variant of strtok() that is multithread-safe.
+
+   For the POSIX documentation for this function, see:
+   http://www.opengroup.org/susv3xsh/strtok.html
+
+   Caveat: It modifies the original string.
+   Caveat: These functions cannot be used on constant strings.
+   Caveat: The identity of the delimiting character is lost.
+   Caveat: It doesn't work with multibyte strings unless all of the delimiter
+           characters are ASCII characters < 0x30.
+
+   See also strsep().  */
+#if @GNULIB_STRTOK_R@
+# if @REPLACE_STRTOK_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strtok_r
+#   define strtok_r rpl_strtok_r
+#  endif
+_GL_FUNCDECL_RPL (strtok_r, char *,
+                  (char *restrict s, char const *restrict delim,
+                   char **restrict save_ptr)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (strtok_r, char *,
+                  (char *restrict s, char const *restrict delim,
+                   char **restrict save_ptr));
+# else
+#  if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK
+#   undef strtok_r
+#  endif
+#  if ! @HAVE_DECL_STRTOK_R@
+_GL_FUNCDECL_SYS (strtok_r, char *,
+                  (char *restrict s, char const *restrict delim,
+                   char **restrict save_ptr)
+                  _GL_ARG_NONNULL ((2, 3)));
+#  endif
+_GL_CXXALIAS_SYS (strtok_r, char *,
+                  (char *restrict s, char const *restrict delim,
+                   char **restrict save_ptr));
+# endif
+_GL_CXXALIASWARN (strtok_r);
+# if defined GNULIB_POSIXCHECK
+_GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
+                 "strings in multibyte locales - "
+                 "use mbstok_r if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtok_r
+# if HAVE_RAW_DECL_STRTOK_R
+_GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
+                 "use gnulib module strtok_r for portability");
+# endif
+#endif
+
+
+/* The following functions are not specified by POSIX.  They are gnulib
+   extensions.  */
+
+#if @GNULIB_MBSLEN@
+/* Return the number of multibyte characters in the character string STRING.
+   This considers multibyte characters, unlike strlen, which counts bytes.  */
+# ifdef __MirBSD__  /* MirBSD defines mbslen as a macro.  Override it.  */
+#  undef mbslen
+# endif
+# if @HAVE_MBSLEN@  /* AIX, OSF/1, MirBSD define mbslen already in libc.  */
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mbslen rpl_mbslen
+#  endif
+_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
+# else
+_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
+# endif
+_GL_CXXALIASWARN (mbslen);
+#endif
+
+#if @GNULIB_MBSNLEN@
+/* Return the number of multibyte characters in the character string starting
+   at STRING and ending at STRING + LEN.  */
+_GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
+     _GL_ARG_NONNULL ((1));
+#endif
+
+#if @GNULIB_MBSCHR@
+/* Locate the first single-byte character C in the character string STRING,
+   and return a pointer to it.  Return NULL if C is not found in STRING.
+   Unlike strchr(), this function works correctly in multibyte locales with
+   encodings such as GB18030.  */
+# if defined __hpux
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mbschr rpl_mbschr /* avoid collision with HP-UX function */
+#  endif
+_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
+                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
+# else
+_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
+                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
+# endif
+_GL_CXXALIASWARN (mbschr);
+#endif
+
+#if @GNULIB_MBSRCHR@
+/* Locate the last single-byte character C in the character string STRING,
+   and return a pointer to it.  Return NULL if C is not found in STRING.
+   Unlike strrchr(), this function works correctly in multibyte locales with
+   encodings such as GB18030.  */
+# if defined __hpux
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */
+#  endif
+_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
+# else
+_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
+# endif
+_GL_CXXALIASWARN (mbsrchr);
+#endif
+
+#if @GNULIB_MBSSTR@
+/* Find the first occurrence of the character string NEEDLE in the character
+   string HAYSTACK.  Return NULL if NEEDLE is not found in HAYSTACK.
+   Unlike strstr(), this function works correctly in multibyte locales with
+   encodings different from UTF-8.  */
+_GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
+     _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCASECMP@
+/* Compare the character strings S1 and S2, ignoring case, returning less than,
+   equal to or greater than zero if S1 is lexicographically less than, equal to
+   or greater than S2.
+   Note: This function may, in multibyte locales, return 0 for strings of
+   different lengths!
+   Unlike strcasecmp(), this function works correctly in multibyte locales.  */
+_GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
+     _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSNCASECMP@
+/* Compare the initial segment of the character string S1 consisting of at most
+   N characters with the initial segment of the character string S2 consisting
+   of at most N characters, ignoring case, returning less than, equal to or
+   greater than zero if the initial segment of S1 is lexicographically less
+   than, equal to or greater than the initial segment of S2.
+   Note: This function may, in multibyte locales, return 0 for initial segments
+   of different lengths!
+   Unlike strncasecmp(), this function works correctly in multibyte locales.
+   But beware that N is not a byte count but a character count!  */
+_GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
+     _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSPCASECMP@
+/* Compare the initial segment of the character string STRING consisting of
+   at most mbslen (PREFIX) characters with the character string PREFIX,
+   ignoring case.  If the two match, return a pointer to the first byte
+   after this prefix in STRING.  Otherwise, return NULL.
+   Note: This function may, in multibyte locales, return non-NULL if STRING
+   is of smaller length than PREFIX!
+   Unlike strncasecmp(), this function works correctly in multibyte
+   locales.  */
+_GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
+     _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCASESTR@
+/* Find the first occurrence of the character string NEEDLE in the character
+   string HAYSTACK, using case-insensitive comparison.
+   Note: This function may, in multibyte locales, return success even if
+   strlen (haystack) < strlen (needle) !
+   Unlike strcasestr(), this function works correctly in multibyte locales.  */
+_GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
+     _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCSPN@
+/* Find the first occurrence in the character string STRING of any character
+   in the character string ACCEPT.  Return the number of bytes from the
+   beginning of the string to this occurrence, or to the end of the string
+   if none exists.
+   Unlike strcspn(), this function works correctly in multibyte locales.  */
+_GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
+     _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSPBRK@
+/* Find the first occurrence in the character string STRING of any character
+   in the character string ACCEPT.  Return the pointer to it, or NULL if none
+   exists.
+   Unlike strpbrk(), this function works correctly in multibyte locales.  */
+# if defined __hpux
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
+#  endif
+_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
+                                   _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
+# else
+_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
+                                   _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
+# endif
+_GL_CXXALIASWARN (mbspbrk);
+#endif
+
+#if @GNULIB_MBSSPN@
+/* Find the first occurrence in the character string STRING of any character
+   not in the character string REJECT.  Return the number of bytes from the
+   beginning of the string to this occurrence, or to the end of the string
+   if none exists.
+   Unlike strspn(), this function works correctly in multibyte locales.  */
+_GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
+     _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSSEP@
+/* Search the next delimiter (multibyte character listed in the character
+   string DELIM) starting at the character string *STRINGP.
+   If one is found, overwrite it with a NUL, and advance *STRINGP to point
+   to the next multibyte character after it.  Otherwise, set *STRINGP to NULL.
+   If *STRINGP was already NULL, nothing happens.
+   Return the old value of *STRINGP.
+
+   This is a variant of mbstok_r() that supports empty fields.
+
+   Caveat: It modifies the original string.
+   Caveat: These functions cannot be used on constant strings.
+   Caveat: The identity of the delimiting character is lost.
+
+   See also mbstok_r().  */
+_GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
+     _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSTOK_R@
+/* Parse the character string STRING into tokens separated by characters in
+   the character string DELIM.
+   If STRING is NULL, the saved pointer in SAVE_PTR is used as
+   the next starting point.  For example:
+        char s[] = "-abc-=-def";
+        char *sp;
+        x = mbstok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
+        x = mbstok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
+        x = mbstok_r(NULL, "=", &sp);   // x = NULL
+                // s = "abc\0-def\0"
+
+   Caveat: It modifies the original string.
+   Caveat: These functions cannot be used on constant strings.
+   Caveat: The identity of the delimiting character is lost.
+
+   See also mbssep().  */
+_GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr)
+     _GL_ARG_NONNULL ((2, 3));
+#endif
+
+/* Map any int, typically from errno, into an error message.  */
+#if @GNULIB_STRERROR@
+# if @REPLACE_STRERROR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strerror
+#   define strerror rpl_strerror
+#  endif
+_GL_FUNCDECL_RPL (strerror, char *, (int));
+_GL_CXXALIAS_RPL (strerror, char *, (int));
+# else
+_GL_CXXALIAS_SYS (strerror, char *, (int));
+# endif
+_GL_CXXALIASWARN (strerror);
+#elif defined GNULIB_POSIXCHECK
+# undef strerror
+/* Assume strerror is always declared.  */
+_GL_WARN_ON_USE (strerror, "strerror is unportable - "
+                 "use gnulib module strerror to guarantee non-NULL result");
+#endif
+
+#if @GNULIB_STRSIGNAL@
+# if @REPLACE_STRSIGNAL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strsignal rpl_strsignal
+#  endif
+_GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
+_GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
+# else
+#  if ! @HAVE_DECL_STRSIGNAL@
+_GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
+#  endif
+/* Need to cast, because on Cygwin 1.5.x systems, the return type is
+   'const char *'.  */
+_GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig));
+# endif
+_GL_CXXALIASWARN (strsignal);
+#elif defined GNULIB_POSIXCHECK
+# undef strsignal
+# if HAVE_RAW_DECL_STRSIGNAL
+_GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
+                 "use gnulib module strsignal for portability");
+# endif
+#endif
+
+#if @GNULIB_STRVERSCMP@
+# if !@HAVE_STRVERSCMP@
+_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
+                                   _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
+_GL_CXXALIASWARN (strverscmp);
+#elif defined GNULIB_POSIXCHECK
+# undef strverscmp
+# if HAVE_RAW_DECL_STRVERSCMP
+_GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
+                 "use gnulib module strverscmp for portability");
+# endif
+#endif
+
+
+#endif /* _GL_STRING_H */
+#endif /* _GL_STRING_H */
index 6508bf77e9d865d6b1f62640700e53de3090a96d..fc105e63daa008018d33f80eb83be50c5004fe62 100644 (file)
@@ -1,11 +1,11 @@
 /* Provide a sys/socket header file for systems lacking it (read: MinGW)
    and for systems where it is incomplete.
-   Copyright (C) 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2010 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
    It is intended to provide definitions and prototypes needed by an
    application.  */
 
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
+#if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+/* Special invocation convention:
+   - On Cygwin 1.5.x we have a sequence of nested includes
+     <sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>,
+     and the latter includes <sys/socket.h>.  In this situation, the functions
+     are not yet declared, therefore we cannot provide the C++ aliases.  */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
+
+#else
+/* Normal invocation convention.  */
+
 #ifndef _GL_SYS_SOCKET_H
 
 #if @HAVE_SYS_SOCKET_H@
 
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
+# define _GL_ALREADY_INCLUDING_SYS_SOCKET_H
 
 /* On many platforms, <sys/socket.h> assumes prior inclusion of
    <sys/types.h>.  */
 /* The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
 
+# undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+
 #endif
 
 #ifndef _GL_SYS_SOCKET_H
 #define _GL_SYS_SOCKET_H
 
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+#if !@HAVE_SA_FAMILY_T@
+typedef unsigned short  sa_family_t;
+#endif
+
+#if !@HAVE_STRUCT_SOCKADDR_STORAGE@
+# include <alignof.h>
+/* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
+   2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
+# define __ss_aligntype unsigned long int
+# define _SS_SIZE 256
+# define _SS_PADSIZE \
+    (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype)      \
+                  ? sizeof (sa_family_t)                                \
+                  : alignof (__ss_aligntype))                           \
+                 + sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+{
+  sa_family_t ss_family;      /* Address family, etc.  */
+  __ss_aligntype __ss_align;  /* Force desired alignment.  */
+  char __ss_padding[_SS_PADSIZE];
+};
+#endif
+
 #if @HAVE_SYS_SOCKET_H@
 
 /* A platform that has <sys/socket.h>.  */
 #  define SHUT_RDWR SD_BOTH
 # endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 # if @HAVE_WINSOCK2_H@
 /* Include headers needed by the emulation code.  */
 #  include <sys/types.h>
@@ -111,11 +155,9 @@ typedef int socklen_t;
 
 # endif
 
-# ifdef __cplusplus
-extern "C" {
-# endif
+#endif
 
-# if @HAVE_WINSOCK2_H@
+#if @HAVE_WINSOCK2_H@
 
 /* Re-define FD_ISSET to avoid a WSA call while we are not using
    network sockets.  */
@@ -133,271 +175,454 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
   return 0;
 }
 
-#  undef FD_ISSET
-#  define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
+# undef FD_ISSET
+# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
 
-# endif
+#endif
 
 /* Wrap everything else to use libc file descriptors for sockets.  */
 
-# if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
+#if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #  undef close
 #  define close close_used_without_including_unistd_h
+# else
+   _GL_WARN_ON_USE (close,
+                    "close() used without including <unistd.h>");
 # endif
+#endif
 
-# if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
+#if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #  undef gethostname
 #  define gethostname gethostname_used_without_including_unistd_h
+# else
+   _GL_WARN_ON_USE (gethostname,
+                    "gethostname() used without including <unistd.h>");
 # endif
+#endif
 
-# if @GNULIB_SOCKET@
-#  if @HAVE_WINSOCK2_H@
+#if @GNULIB_SOCKET@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef socket
-#   define socket              rpl_socket
-extern int rpl_socket (int, int, int protocol);
+#   define socket rpl_socket
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef socket
-#  define socket socket_used_without_requesting_gnulib_module_socket
-# elif defined GNULIB_POSIXCHECK
-#  undef socket
-#  define socket(d,t,p) \
-     (GL_LINK_WARNING ("socket is not always POSIX compliant - " \
-                       "use gnulib module socket for portability"), \
-      socket (d, t, p))
-# endif
-
-# if @GNULIB_CONNECT@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol));
+_GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol));
+# else
+_GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol));
+# endif
+_GL_CXXALIASWARN (socket);
+#elif @HAVE_WINSOCK2_H@
+# undef socket
+# define socket socket_used_without_requesting_gnulib_module_socket
+#elif defined GNULIB_POSIXCHECK
+# undef socket
+# if HAVE_RAW_DECL_SOCKET
+_GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
+                 "use gnulib module socket for portability");
+# endif
+#endif
+
+#if @GNULIB_CONNECT@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef connect
-#   define connect             rpl_connect
-extern int rpl_connect (int, struct sockaddr *, int);
+#   define connect rpl_connect
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef connect
-#  define connect socket_used_without_requesting_gnulib_module_connect
-# elif defined GNULIB_POSIXCHECK
-#  undef connect
-#  define connect(s,a,l) \
-     (GL_LINK_WARNING ("connect is not always POSIX compliant - " \
-                       "use gnulib module connect for portability"), \
-      connect (s, a, l))
-# endif
-
-# if @GNULIB_ACCEPT@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (connect, int,
+                  (int fd, const struct sockaddr *addr, socklen_t addrlen)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (connect, int,
+                  (int fd, const struct sockaddr *addr, socklen_t addrlen));
+# else
+_GL_CXXALIAS_SYS (connect, int,
+                  (int fd, const struct sockaddr *addr, socklen_t addrlen));
+# endif
+_GL_CXXALIASWARN (connect);
+#elif @HAVE_WINSOCK2_H@
+# undef connect
+# define connect socket_used_without_requesting_gnulib_module_connect
+#elif defined GNULIB_POSIXCHECK
+# undef connect
+# if HAVE_RAW_DECL_CONNECT
+_GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
+                 "use gnulib module connect for portability");
+# endif
+#endif
+
+#if @GNULIB_ACCEPT@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef accept
-#   define accept              rpl_accept
-extern int rpl_accept (int, struct sockaddr *, int *);
+#   define accept rpl_accept
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef accept
-#  define accept accept_used_without_requesting_gnulib_module_accept
-# elif defined GNULIB_POSIXCHECK
-#  undef accept
-#  define accept(s,a,l) \
-     (GL_LINK_WARNING ("accept is not always POSIX compliant - " \
-                       "use gnulib module accept for portability"), \
-      accept (s, a, l))
-# endif
-
-# if @GNULIB_BIND@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (accept, int,
+                  (int fd, struct sockaddr *addr, socklen_t *addrlen));
+_GL_CXXALIAS_RPL (accept, int,
+                  (int fd, struct sockaddr *addr, socklen_t *addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+                                                       void *addrlen.  */
+_GL_CXXALIAS_SYS_CAST (accept, int,
+                       (int fd, struct sockaddr *addr, socklen_t *addrlen));
+# endif
+_GL_CXXALIASWARN (accept);
+#elif @HAVE_WINSOCK2_H@
+# undef accept
+# define accept accept_used_without_requesting_gnulib_module_accept
+#elif defined GNULIB_POSIXCHECK
+# undef accept
+# if HAVE_RAW_DECL_ACCEPT
+_GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
+                 "use gnulib module accept for portability");
+# endif
+#endif
+
+#if @GNULIB_BIND@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef bind
-#   define bind                        rpl_bind
-extern int rpl_bind (int, struct sockaddr *, int);
+#   define bind rpl_bind
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef bind
-#  define bind bind_used_without_requesting_gnulib_module_bind
-# elif defined GNULIB_POSIXCHECK
-#  undef bind
-#  define bind(s,a,l) \
-     (GL_LINK_WARNING ("bind is not always POSIX compliant - " \
-                       "use gnulib module bind for portability"), \
-      bind (s, a, l))
-# endif
-
-# if @GNULIB_GETPEERNAME@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (bind, int,
+                  (int fd, const struct sockaddr *addr, socklen_t addrlen)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (bind, int,
+                  (int fd, const struct sockaddr *addr, socklen_t addrlen));
+# else
+_GL_CXXALIAS_SYS (bind, int,
+                  (int fd, const struct sockaddr *addr, socklen_t addrlen));
+# endif
+_GL_CXXALIASWARN (bind);
+#elif @HAVE_WINSOCK2_H@
+# undef bind
+# define bind bind_used_without_requesting_gnulib_module_bind
+#elif defined GNULIB_POSIXCHECK
+# undef bind
+# if HAVE_RAW_DECL_BIND
+_GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
+                 "use gnulib module bind for portability");
+# endif
+#endif
+
+#if @GNULIB_GETPEERNAME@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef getpeername
-#   define getpeername         rpl_getpeername
-extern int rpl_getpeername (int, struct sockaddr *, int *);
+#   define getpeername rpl_getpeername
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef getpeername
-#  define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
-# elif defined GNULIB_POSIXCHECK
-#  undef getpeername
-#  define getpeername(s,a,l) \
-     (GL_LINK_WARNING ("getpeername is not always POSIX compliant - " \
-                       "use gnulib module getpeername for portability"), \
-      getpeername (s, a, l))
-# endif
-
-# if @GNULIB_GETSOCKNAME@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (getpeername, int,
+                  (int fd, struct sockaddr *addr, socklen_t *addrlen)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (getpeername, int,
+                  (int fd, struct sockaddr *addr, socklen_t *addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+                                                       void *addrlen.  */
+_GL_CXXALIAS_SYS_CAST (getpeername, int,
+                       (int fd, struct sockaddr *addr, socklen_t *addrlen));
+# endif
+_GL_CXXALIASWARN (getpeername);
+#elif @HAVE_WINSOCK2_H@
+# undef getpeername
+# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
+#elif defined GNULIB_POSIXCHECK
+# undef getpeername
+# if HAVE_RAW_DECL_GETPEERNAME
+_GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
+                 "use gnulib module getpeername for portability");
+# endif
+#endif
+
+#if @GNULIB_GETSOCKNAME@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef getsockname
-#   define getsockname         rpl_getsockname
-extern int rpl_getsockname (int, struct sockaddr *, int *);
+#   define getsockname rpl_getsockname
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef getsockname
-#  define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
-# elif defined GNULIB_POSIXCHECK
-#  undef getsockname
-#  define getsockname(s,a,l) \
-     (GL_LINK_WARNING ("getsockname is not always POSIX compliant - " \
-                       "use gnulib module getsockname for portability"), \
-      getsockname (s, a, l))
-# endif
-
-# if @GNULIB_GETSOCKOPT@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (getsockname, int,
+                  (int fd, struct sockaddr *addr, socklen_t *addrlen)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (getsockname, int,
+                  (int fd, struct sockaddr *addr, socklen_t *addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+                                                       void *addrlen.  */
+_GL_CXXALIAS_SYS_CAST (getsockname, int,
+                       (int fd, struct sockaddr *addr, socklen_t *addrlen));
+# endif
+_GL_CXXALIASWARN (getsockname);
+#elif @HAVE_WINSOCK2_H@
+# undef getsockname
+# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
+#elif defined GNULIB_POSIXCHECK
+# undef getsockname
+# if HAVE_RAW_DECL_GETSOCKNAME
+_GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
+                 "use gnulib module getsockname for portability");
+# endif
+#endif
+
+#if @GNULIB_GETSOCKOPT@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef getsockopt
-#   define getsockopt          rpl_getsockopt
-extern int rpl_getsockopt (int, int, int, void *, socklen_t *);
+#   define getsockopt rpl_getsockopt
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef getsockopt
-#  define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
-# elif defined GNULIB_POSIXCHECK
-#  undef getsockopt
-#  define getsockopt(s,lvl,o,v,l) \
-     (GL_LINK_WARNING ("getsockopt is not always POSIX compliant - " \
-                       "use gnulib module getsockopt for portability"), \
-      getsockopt (s, lvl, o, v, l))
-# endif
-
-# if @GNULIB_LISTEN@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (getsockopt, int, (int fd, int level, int optname,
+                                    void *optval, socklen_t *optlen)
+                                   _GL_ARG_NONNULL ((4, 5)));
+_GL_CXXALIAS_RPL (getsockopt, int, (int fd, int level, int optname,
+                                    void *optval, socklen_t *optlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the fifth parameter is
+                                                       void *optlen.  */
+_GL_CXXALIAS_SYS_CAST (getsockopt, int, (int fd, int level, int optname,
+                                         void *optval, socklen_t *optlen));
+# endif
+_GL_CXXALIASWARN (getsockopt);
+#elif @HAVE_WINSOCK2_H@
+# undef getsockopt
+# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
+#elif defined GNULIB_POSIXCHECK
+# undef getsockopt
+# if HAVE_RAW_DECL_GETSOCKOPT
+_GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
+                 "use gnulib module getsockopt for portability");
+# endif
+#endif
+
+#if @GNULIB_LISTEN@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef listen
-#   define listen              rpl_listen
-extern int rpl_listen (int, int);
+#   define listen rpl_listen
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef listen
-#  define listen listen_used_without_requesting_gnulib_module_listen
-# elif defined GNULIB_POSIXCHECK
-#  undef listen
-#  define listen(s,b) \
-     (GL_LINK_WARNING ("listen is not always POSIX compliant - " \
-                       "use gnulib module listen for portability"), \
-      listen (s, b))
-# endif
-
-# if @GNULIB_RECV@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog));
+_GL_CXXALIAS_RPL (listen, int, (int fd, int backlog));
+# else
+_GL_CXXALIAS_SYS (listen, int, (int fd, int backlog));
+# endif
+_GL_CXXALIASWARN (listen);
+#elif @HAVE_WINSOCK2_H@
+# undef listen
+# define listen listen_used_without_requesting_gnulib_module_listen
+#elif defined GNULIB_POSIXCHECK
+# undef listen
+# if HAVE_RAW_DECL_LISTEN
+_GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
+                 "use gnulib module listen for portability");
+# endif
+#endif
+
+#if @GNULIB_RECV@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef recv
-#   define recv                        rpl_recv
-extern int rpl_recv (int, void *, int, int);
+#   define recv rpl_recv
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef recv
-#  define recv recv_used_without_requesting_gnulib_module_recv
-# elif defined GNULIB_POSIXCHECK
-#  undef recv
-#  define recv(s,b,n,f) \
-     (GL_LINK_WARNING ("recv is not always POSIX compliant - " \
-                       "use gnulib module recv for portability"), \
-      recv (s, b, n, f))
-# endif
-
-# if @GNULIB_SEND@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)
+                                 _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
+# else
+_GL_CXXALIAS_SYS (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
+# endif
+_GL_CXXALIASWARN (recv);
+#elif @HAVE_WINSOCK2_H@
+# undef recv
+# define recv recv_used_without_requesting_gnulib_module_recv
+#elif defined GNULIB_POSIXCHECK
+# undef recv
+# if HAVE_RAW_DECL_RECV
+_GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
+                 "use gnulib module recv for portability");
+# endif
+#endif
+
+#if @GNULIB_SEND@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef send
-#   define send                        rpl_send
-extern int rpl_send (int, const void *, int, int);
+#   define send rpl_send
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef send
-#  define send send_used_without_requesting_gnulib_module_send
-# elif defined GNULIB_POSIXCHECK
-#  undef send
-#  define send(s,b,n,f) \
-     (GL_LINK_WARNING ("send is not always POSIX compliant - " \
-                       "use gnulib module send for portability"), \
-      send (s, b, n, f))
-# endif
-
-# if @GNULIB_RECVFROM@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (send, ssize_t,
+                  (int fd, const void *buf, size_t len, int flags)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (send, ssize_t,
+                  (int fd, const void *buf, size_t len, int flags));
+# else
+_GL_CXXALIAS_SYS (send, ssize_t,
+                  (int fd, const void *buf, size_t len, int flags));
+# endif
+_GL_CXXALIASWARN (send);
+#elif @HAVE_WINSOCK2_H@
+# undef send
+# define send send_used_without_requesting_gnulib_module_send
+#elif defined GNULIB_POSIXCHECK
+# undef send
+# if HAVE_RAW_DECL_SEND
+_GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
+                 "use gnulib module send for portability");
+# endif
+#endif
+
+#if @GNULIB_RECVFROM@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef recvfrom
-#   define recvfrom            rpl_recvfrom
-extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *);
+#   define recvfrom rpl_recvfrom
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef recvfrom
-#  define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
-# elif defined GNULIB_POSIXCHECK
-#  undef recvfrom
-#  define recvfrom(s,b,n,f,a,l) \
-     (GL_LINK_WARNING ("recvfrom is not always POSIX compliant - " \
-                       "use gnulib module recvfrom for portability"), \
-      recvfrom (s, b, n, f, a, l))
-# endif
-
-# if @GNULIB_SENDTO@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (recvfrom, ssize_t,
+                  (int fd, void *buf, size_t len, int flags,
+                   struct sockaddr *from, socklen_t *fromlen)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (recvfrom, ssize_t,
+                  (int fd, void *buf, size_t len, int flags,
+                   struct sockaddr *from, socklen_t *fromlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the sixth parameter is
+                                               void *fromlen.  */
+_GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t,
+                       (int fd, void *buf, size_t len, int flags,
+                        struct sockaddr *from, socklen_t *fromlen));
+# endif
+_GL_CXXALIASWARN (recvfrom);
+#elif @HAVE_WINSOCK2_H@
+# undef recvfrom
+# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
+#elif defined GNULIB_POSIXCHECK
+# undef recvfrom
+# if HAVE_RAW_DECL_RECVFROM
+_GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
+                 "use gnulib module recvfrom for portability");
+# endif
+#endif
+
+#if @GNULIB_SENDTO@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef sendto
-#   define sendto              rpl_sendto
-extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int);
+#   define sendto rpl_sendto
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef sendto
-#  define sendto sendto_used_without_requesting_gnulib_module_sendto
-# elif defined GNULIB_POSIXCHECK
-#  undef sendto
-#  define sendto(s,b,n,f,a,l) \
-     (GL_LINK_WARNING ("sendto is not always POSIX compliant - " \
-                       "use gnulib module sendto for portability"), \
-      sendto (s, b, n, f, a, l))
-# endif
-
-# if @GNULIB_SETSOCKOPT@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (sendto, ssize_t,
+                  (int fd, const void *buf, size_t len, int flags,
+                   const struct sockaddr *to, socklen_t tolen)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (sendto, ssize_t,
+                  (int fd, const void *buf, size_t len, int flags,
+                   const struct sockaddr *to, socklen_t tolen));
+# else
+_GL_CXXALIAS_SYS (sendto, ssize_t,
+                  (int fd, const void *buf, size_t len, int flags,
+                   const struct sockaddr *to, socklen_t tolen));
+# endif
+_GL_CXXALIASWARN (sendto);
+#elif @HAVE_WINSOCK2_H@
+# undef sendto
+# define sendto sendto_used_without_requesting_gnulib_module_sendto
+#elif defined GNULIB_POSIXCHECK
+# undef sendto
+# if HAVE_RAW_DECL_SENDTO
+_GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
+                 "use gnulib module sendto for portability");
+# endif
+#endif
+
+#if @GNULIB_SETSOCKOPT@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef setsockopt
-#   define setsockopt          rpl_setsockopt
-extern int rpl_setsockopt (int, int, int, const void *, socklen_t);
+#   define setsockopt rpl_setsockopt
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef setsockopt
-#  define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
-# elif defined GNULIB_POSIXCHECK
-#  undef setsockopt
-#  define setsockopt(s,lvl,o,v,l) \
-     (GL_LINK_WARNING ("setsockopt is not always POSIX compliant - " \
-                       "use gnulib module setsockopt for portability"), \
-      setsockopt (s, lvl, o, v, l))
-# endif
-
-# if @GNULIB_SHUTDOWN@
-#  if @HAVE_WINSOCK2_H@
+_GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
+                                    const void * optval, socklen_t optlen)
+                                   _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
+                                    const void * optval, socklen_t optlen));
+# else
+_GL_CXXALIAS_SYS (setsockopt, int, (int fd, int level, int optname,
+                                    const void * optval, socklen_t optlen));
+# endif
+_GL_CXXALIASWARN (setsockopt);
+#elif @HAVE_WINSOCK2_H@
+# undef setsockopt
+# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
+#elif defined GNULIB_POSIXCHECK
+# undef setsockopt
+# if HAVE_RAW_DECL_SETSOCKOPT
+_GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
+                 "use gnulib module setsockopt for portability");
+# endif
+#endif
+
+#if @GNULIB_SHUTDOWN@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef shutdown
-#   define shutdown            rpl_shutdown
-extern int rpl_shutdown (int, int);
+#   define shutdown rpl_shutdown
 #  endif
-# elif @HAVE_WINSOCK2_H@
-#  undef shutdown
-#  define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
-# elif defined GNULIB_POSIXCHECK
-#  undef shutdown
-#  define shutdown(s,h) \
-     (GL_LINK_WARNING ("shutdown is not always POSIX compliant - " \
-                       "use gnulib module shutdown for portability"), \
-      shutdown (s, h))
+_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how));
+_GL_CXXALIAS_RPL (shutdown, int, (int fd, int how));
+# else
+_GL_CXXALIAS_SYS (shutdown, int, (int fd, int how));
+# endif
+_GL_CXXALIASWARN (shutdown);
+#elif @HAVE_WINSOCK2_H@
+# undef shutdown
+# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
+#elif defined GNULIB_POSIXCHECK
+# undef shutdown
+# if HAVE_RAW_DECL_SHUTDOWN
+_GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
+                 "use gnulib module shutdown for portability");
 # endif
+#endif
 
-# if @HAVE_WINSOCK2_H@
+#if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #  undef select
-#  define select               select_used_without_including_sys_select_h
+#  define select select_used_without_including_sys_select_h
+# else
+   _GL_WARN_ON_USE (select,
+                    "select() used without including <sys/select.h>");
 # endif
+#endif
 
-# ifdef __cplusplus
-}
+#if @GNULIB_ACCEPT4@
+/* Accept a connection on a socket, with specific opening flags.
+   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+   and O_TEXT, O_BINARY (defined in "binary-io.h").
+   See also the Linux man page at
+   <http://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>.  */
+# if @HAVE_ACCEPT4@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define accept4 rpl_accept4
+#  endif
+_GL_FUNCDECL_RPL (accept4, int,
+                  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+                   int flags));
+_GL_CXXALIAS_RPL (accept4, int,
+                  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+                   int flags));
+# else
+_GL_FUNCDECL_SYS (accept4, int,
+                  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+                   int flags));
+_GL_CXXALIAS_SYS (accept4, int,
+                  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+                   int flags));
 # endif
-
-#endif /* HAVE_SYS_SOCKET_H */
+_GL_CXXALIASWARN (accept4);
+#elif defined GNULIB_POSIXCHECK
+# undef accept4
+# if HAVE_RAW_DECL_ACCEPT4
+_GL_WARN_ON_USE (accept4, "accept4 is unportable - "
+                 "use gnulib module accept4 for portability");
+# endif
+#endif
 
 #endif /* _GL_SYS_SOCKET_H */
 #endif /* _GL_SYS_SOCKET_H */
+#endif
index da965d02704c21ccbf0389a81febb9217f23b8fb..dc7ef51171e8c0b7a22d1a375d4478f930446988 100644 (file)
@@ -1,9 +1,9 @@
 /* Provide a more complete sys/stat header file.
-   Copyright (C) 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 /* Get nlink_t.  */
 #include <sys/types.h>
 
+/* Get struct timespec.  */
+#include <time.h>
+
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
 
 #ifndef _GL_SYS_STAT_H
 #define _GL_SYS_STAT_H
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 /* Before doing "#define mkdir rpl_mkdir" below, we need to include all
    headers that may declare mkdir().  */
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-# include <io.h>
+# include <io.h>     /* mingw32, mingw64 */
+# include <direct.h> /* mingw64 */
 #endif
 
 #ifndef S_IFMT
 # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
 #endif
 
+/* Macros for futimens and utimensat.  */
+#ifndef UTIME_NOW
+# define UTIME_NOW (-1)
+# define UTIME_OMIT (-2)
+#endif
+
+
+#if @GNULIB_FCHMODAT@
+# if !@HAVE_FCHMODAT@
+_GL_FUNCDECL_SYS (fchmodat, int,
+                  (int fd, char const *file, mode_t mode, int flag)
+                  _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (fchmodat, int,
+                  (int fd, char const *file, mode_t mode, int flag));
+_GL_CXXALIASWARN (fchmodat);
+#elif defined GNULIB_POSIXCHECK
+# undef fchmodat
+# if HAVE_RAW_DECL_FCHMODAT
+_GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
+#endif
+
+
+#if @REPLACE_FSTAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  define fstat rpl_fstat
+# endif
+_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
+#else
+_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
+#endif
+_GL_CXXALIASWARN (fstat);
+
+
+#if @GNULIB_FSTATAT@
+# if @REPLACE_FSTATAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fstatat
+#   define fstatat rpl_fstatat
+#  endif
+_GL_FUNCDECL_RPL (fstatat, int,
+                  (int fd, char const *name, struct stat *st, int flags)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (fstatat, int,
+                  (int fd, char const *name, struct stat *st, int flags));
+# else
+#  if !@HAVE_FSTATAT@
+_GL_FUNCDECL_SYS (fstatat, int,
+                  (int fd, char const *name, struct stat *st, int flags)
+                  _GL_ARG_NONNULL ((2, 3)));
+#  endif
+_GL_CXXALIAS_SYS (fstatat, int,
+                  (int fd, char const *name, struct stat *st, int flags));
+# endif
+_GL_CXXALIASWARN (fstatat);
+#elif defined GNULIB_POSIXCHECK
+# undef fstatat
+# if HAVE_RAW_DECL_FSTATAT
+_GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FUTIMENS@
+# if @REPLACE_FUTIMENS@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef futimens
+#   define futimens rpl_futimens
+#  endif
+_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]));
+_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
+# else
+#  if !@HAVE_FUTIMENS@
+_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
+#  endif
+_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
+# endif
+_GL_CXXALIASWARN (futimens);
+#elif defined GNULIB_POSIXCHECK
+# undef futimens
+# if HAVE_RAW_DECL_FUTIMENS
+_GL_WARN_ON_USE (futimens, "futimens is not portable - "
+                 "use gnulib module futimens for portability");
+# endif
+#endif
+
 
-#ifdef __cplusplus
-extern "C" {
+#if @GNULIB_LCHMOD@
+/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
+   denotes a symbolic link.  */
+# if !@HAVE_LCHMOD@
+/* The lchmod replacement follows symbolic links.  Callers should take
+   this into account; lchmod should be applied only to arguments that
+   are known to not be symbolic links.  On hosts that lack lchmod,
+   this can lead to race conditions between the check and the
+   invocation of lchmod, but we know of no workarounds that are
+   reliable in general.  You might try requesting support for lchmod
+   from your operating system supplier.  */
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define lchmod chmod
+#  endif
+/* Need to cast, because on mingw, the second parameter of chmod is
+                                                int mode.  */
+_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int,
+                         (const char *filename, mode_t mode));
+# else
+#  if 0 /* assume already declared */
+_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
+                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
+# endif
+# if @HAVE_LCHMOD@
+_GL_CXXALIASWARN (lchmod);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef lchmod
+# if HAVE_RAW_DECL_LCHMOD
+_GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
+                 "use gnulib module lchmod for portability");
+# endif
 #endif
 
 
@@ -288,29 +418,46 @@ extern "C" {
 # if ! @HAVE_LSTAT@
 /* mingw does not support symlinks, therefore it does not have lstat.  But
    without links, stat does just fine.  */
-#  define lstat stat
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define lstat stat
+#  endif
+_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf));
 # elif @REPLACE_LSTAT@
-#  undef lstat
-#  define lstat rpl_lstat
-extern int rpl_lstat (const char *name, struct stat *buf);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef lstat
+#   define lstat rpl_lstat
+#  endif
+_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf)
+                              _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf));
+# else
+_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf));
+# endif
+# if @HAVE_LSTAT@
+_GL_CXXALIASWARN (lstat);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef lstat
-# define lstat(p,b)                                                    \
-  (GL_LINK_WARNING ("lstat is unportable - "                           \
-                   "use gnulib module lstat for portability"),         \
-   lstat (p, b))
+# if HAVE_RAW_DECL_LSTAT
+_GL_WARN_ON_USE (lstat, "lstat is unportable - "
+                 "use gnulib module lstat for portability");
+# endif
 #endif
 
 
 #if @REPLACE_MKDIR@
-# undef mkdir
-# define mkdir rpl_mkdir
-extern int mkdir (char const *name, mode_t mode);
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  undef mkdir
+#  define mkdir rpl_mkdir
+# endif
+_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
 #else
 /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
    Additionally, it declares _mkdir (and depending on compile flags, an
-   alias mkdir), only in the nonstandard <io.h>, which is included above.  */
+   alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
+   which are included above.  */
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
 static inline int
@@ -319,40 +466,172 @@ rpl_mkdir (char const *name, mode_t mode)
   return _mkdir (name);
 }
 
-#  define mkdir rpl_mkdir
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mkdir rpl_mkdir
+#  endif
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
 # endif
 #endif
+_GL_CXXALIASWARN (mkdir);
 
 
-/* Declare BSD extensions.  */
+#if @GNULIB_MKDIRAT@
+# if !@HAVE_MKDIRAT@
+_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)
+                                _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
+_GL_CXXALIASWARN (mkdirat);
+#elif defined GNULIB_POSIXCHECK
+# undef mkdirat
+# if HAVE_RAW_DECL_MKDIRAT
+_GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
+#endif
 
-#if @GNULIB_LCHMOD@
-/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
-   denotes a symbolic link.  */
-# if !@HAVE_LCHMOD@
-/* The lchmod replacement follows symbolic links.  Callers should take
-   this into account; lchmod should be applied only to arguments that
-   are known to not be symbolic links.  On hosts that lack lchmod,
-   this can lead to race conditions between the check and the
-   invocation of lchmod, but we know of no workarounds that are
-   reliable in general.  You might try requesting support for lchmod
-   from your operating system supplier.  */
-#  define lchmod chmod
+
+#if @GNULIB_MKFIFO@
+# if @REPLACE_MKFIFO@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mkfifo
+#   define mkfifo rpl_mkfifo
+#  endif
+_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
+# else
+#  if !@HAVE_MKFIFO@
+_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode)
+                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkfifo);
+#elif defined GNULIB_POSIXCHECK
+# undef mkfifo
+# if HAVE_RAW_DECL_MKFIFO
+_GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
+                 "use gnulib module mkfifo for portability");
 # endif
-# if 0 /* assume already declared */
-extern int lchmod (const char *filename, mode_t mode);
+#endif
+
+
+#if @GNULIB_MKFIFOAT@
+# if !@HAVE_MKFIFOAT@
+_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
+                                 _GL_ARG_NONNULL ((2)));
 # endif
+_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
+_GL_CXXALIASWARN (mkfifoat);
 #elif defined GNULIB_POSIXCHECK
-# undef lchmod
-# define lchmod(f,m) \
-    (GL_LINK_WARNING ("lchmod is unportable - " \
-                      "use gnulib module lchmod for portability"), \
-     lchmod (f, m))
+# undef mkfifoat
+# if HAVE_RAW_DECL_MKFIFOAT
+_GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
+                 "use gnulib module mkfifoat for portability");
+# endif
 #endif
 
 
-#ifdef __cplusplus
-}
+#if @GNULIB_MKNOD@
+# if @REPLACE_MKNOD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mknod
+#   define mknod rpl_mknod
+#  endif
+_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
+# else
+#  if !@HAVE_MKNOD@
+_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
+                              _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev));
+# endif
+_GL_CXXALIASWARN (mknod);
+#elif defined GNULIB_POSIXCHECK
+# undef mknod
+# if HAVE_RAW_DECL_MKNOD
+_GL_WARN_ON_USE (mknod, "mknod is not portable - "
+                 "use gnulib module mknod for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKNODAT@
+# if !@HAVE_MKNODAT@
+_GL_FUNCDECL_SYS (mknodat, int,
+                  (int fd, char const *file, mode_t mode, dev_t dev)
+                  _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mknodat, int,
+                  (int fd, char const *file, mode_t mode, dev_t dev));
+_GL_CXXALIASWARN (mknodat);
+#elif defined GNULIB_POSIXCHECK
+# undef mknodat
+# if HAVE_RAW_DECL_MKNODAT
+_GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
+                 "use gnulib module mkfifoat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_STAT@
+# if @REPLACE_STAT@
+/* We can't use the object-like #define stat rpl_stat, because of
+   struct stat.  This means that rpl_stat will not be used if the user
+   does (stat)(a,b).  Oh well.  */
+#  undef stat
+#  ifdef _LARGE_FILES
+    /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
+       so we have to replace stat64() instead of stat(). */
+#   define stat stat64
+#   undef stat64
+#   define stat64(name, st) rpl_stat (name, st)
+#  else /* !_LARGE_FILES */
+#   define stat(name, st) rpl_stat (name, st)
+#  endif /* !_LARGE_FILES */
+_GL_EXTERN_C int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef stat
+# if HAVE_RAW_DECL_STAT
+_GL_WARN_ON_USE (stat, "stat is unportable - "
+                 "use gnulib module stat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_UTIMENSAT@
+# if @REPLACE_UTIMENSAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef utimensat
+#   define utimensat rpl_utimensat
+#  endif
+_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
+                                   struct timespec const times[2], int flag)
+                                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
+                                   struct timespec const times[2], int flag));
+# else
+#  if !@HAVE_UTIMENSAT@
+_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
+                                   struct timespec const times[2], int flag)
+                                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
+                                   struct timespec const times[2], int flag));
+# endif
+_GL_CXXALIASWARN (utimensat);
+#elif defined GNULIB_POSIXCHECK
+# undef utimensat
+# if HAVE_RAW_DECL_UTIMENSAT
+_GL_WARN_ON_USE (utimensat, "utimensat is not portable - "
+                 "use gnulib module utimensat for portability");
+# endif
 #endif
 
 
index d9fb361b87d87ca257df661adf36697a65dca915..d7c091cfe38c17d6c24c31284052e9af108ad00f 100644 (file)
@@ -1,10 +1,10 @@
 /* Provide a more complete sys/time.h.
 
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 #  include <time.h>
 # endif
 
-#ifdef __cplusplus
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+# ifdef __cplusplus
 extern "C" {
-#endif
+# endif
 
 # if ! @HAVE_STRUCT_TIMEVAL@
 struct timeval
@@ -51,14 +57,39 @@ struct timeval
 };
 # endif
 
-# if @REPLACE_GETTIMEOFDAY@
-#  undef gettimeofday
-#  define gettimeofday rpl_gettimeofday
-int gettimeofday (struct timeval *restrict, void *restrict);
+# ifdef __cplusplus
+}
 # endif
 
-#ifdef __cplusplus
-}
-#endif
+# if @GNULIB_GETTIMEOFDAY@
+#  if @REPLACE_GETTIMEOFDAY@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef gettimeofday
+#    define gettimeofday rpl_gettimeofday
+#   endif
+_GL_FUNCDECL_RPL (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict));
+#  else
+#   if !@HAVE_GETTIMEOFDAY@
+_GL_FUNCDECL_SYS (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict)
+                  _GL_ARG_NONNULL ((1)));
+#   endif
+/* Need to cast, because on glibc systems, by default, the second argument is
+                                                  struct timezone *.  */
+_GL_CXXALIAS_SYS_CAST (gettimeofday, int,
+                       (struct timeval *restrict, void *restrict));
+#  endif
+_GL_CXXALIASWARN (gettimeofday);
+# elif defined GNULIB_POSIXCHECK
+#  undef gettimeofday
+#  if HAVE_RAW_DECL_GETTIMEOFDAY
+_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
+                 "use gnulib module gettimeofday for portability");
+#  endif
+# endif
 
 #endif /* _GL_SYS_TIME_H */
index 5a3a3260c4e232fc87c3cf6fda9cf7c688932da9..134908b42cdc09d4650478743313c32992e2987f 100644 (file)
@@ -1,8 +1,6 @@
 /* tempname.c - generate the name of a temporary file.
 
-   Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation,
-   Inc.
+   Copyright (C) 1991-2003, 2005-2007, 2009-2010 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
 # define TMP_MAX 238328
 #endif
 #ifndef __GT_FILE
-# define __GT_FILE     0
-# define __GT_BIGFILE  1
-# define __GT_DIR      2
-# define __GT_NOCREATE 3
+# define __GT_FILE      0
+# define __GT_DIR       1
+# define __GT_NOCREATE  2
+#endif
+#if !_LIBC && (GT_FILE != __GT_FILE || GT_DIR != __GT_DIR       \
+               || GT_NOCREATE != __GT_NOCREATE)
+# error report this to bug-gnulib@gnu.org
 #endif
 
 #include <stddef.h>
 
 #if _LIBC
 # define struct_stat64 struct stat64
-# define small_open __open
-# define large_open __open64
 #else
 # define struct_stat64 struct stat
-# define small_open open
-# define large_open open
 # define __gen_tempname gen_tempname
 # define __getpid getpid
 # define __gettimeofday gettimeofday
 # define __mkdir mkdir
+# define __open open
+# define __open64 open
 # define __lxstat64(version, file, buf) lstat (file, buf)
 # define __xstat64(version, file, buf) stat (file, buf)
 #endif
 # include <hp-timing.h>
 # if HP_TIMING_AVAIL
 #  define RANDOM_BITS(Var) \
-  if (__builtin_expect (value == UINT64_C (0), 0))                           \
-    {                                                                        \
-      /* If this is the first time this function is used initialize          \
-        the variable we accumulate the value in to some somewhat             \
-        random value.  If we'd not do this programs at startup time          \
-        might have a reduced set of possible names, at least on slow         \
-        machines.  */                                                        \
-      struct timeval tv;                                                     \
-      __gettimeofday (&tv, NULL);                                            \
-      value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;                     \
-    }                                                                        \
+  if (__builtin_expect (value == UINT64_C (0), 0))                            \
+    {                                                                         \
+      /* If this is the first time this function is used initialize           \
+         the variable we accumulate the value in to some somewhat             \
+         random value.  If we'd not do this programs at startup time          \
+         might have a reduced set of possible names, at least on slow         \
+         machines.  */                                                        \
+      struct timeval tv;                                                      \
+      __gettimeofday (&tv, NULL);                                             \
+      value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;                      \
+    }                                                                         \
   HP_TIMING_NOW (Var)
 # endif
 #endif
@@ -122,7 +121,7 @@ direxists (const char *dir)
    enough space in TMPL. */
 int
 __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
-              int try_tmpdir)
+               int try_tmpdir)
 {
   const char *d;
   size_t dlen, plen;
@@ -136,35 +135,35 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
     {
       plen = strlen (pfx);
       if (plen > 5)
-       plen = 5;
+        plen = 5;
     }
 
   if (try_tmpdir)
     {
       d = __secure_getenv ("TMPDIR");
       if (d != NULL && direxists (d))
-       dir = d;
+        dir = d;
       else if (dir != NULL && direxists (dir))
-       /* nothing */ ;
+        /* nothing */ ;
       else
-       dir = NULL;
+        dir = NULL;
     }
   if (dir == NULL)
     {
       if (direxists (P_tmpdir))
-       dir = P_tmpdir;
+        dir = P_tmpdir;
       else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
-       dir = "/tmp";
+        dir = "/tmp";
       else
-       {
-         __set_errno (ENOENT);
-         return -1;
-       }
+        {
+          __set_errno (ENOENT);
+          return -1;
+        }
     }
 
   dlen = strlen (dir);
   while (dlen > 1 && dir[dlen - 1] == '/')
-    dlen--;                    /* remove trailing slashes */
+    dlen--;                     /* remove trailing slashes */
 
   /* check we have room for "${dir}/${pfx}XXXXXX\0" */
   if (tmpl_len < dlen + 1 + plen + 6 + 1)
@@ -183,21 +182,20 @@ static const char letters[] =
 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
 
 /* Generate a temporary file name based on TMPL.  TMPL must match the
-   rules for mk[s]temp (i.e. end in "XXXXXX").  The name constructed
-   does not exist at the time of the call to __gen_tempname.  TMPL is
-   overwritten with the result.
+   rules for mk[s]temp (i.e. end in "XXXXXX", possibly with a suffix).
+   The name constructed does not exist at the time of the call to
+   __gen_tempname.  TMPL is overwritten with the result.
 
    KIND may be one of:
-   __GT_NOCREATE:      simply verify that the name does not exist
-                       at the time of the call.
-   __GT_FILE:          create the file using open(O_CREAT|O_EXCL)
-                       and return a read-write fd.  The file is mode 0600.
-   __GT_BIGFILE:       same as __GT_FILE but use open64().
-   __GT_DIR:           create a directory, which will be mode 0700.
+   __GT_NOCREATE:       simply verify that the name does not exist
+                        at the time of the call.
+   __GT_FILE:           create the file using open(O_CREAT|O_EXCL)
+                        and return a read-write fd.  The file is mode 0600.
+   __GT_DIR:            create a directory, which will be mode 0700.
 
    We use a clever algorithm to get hard-to-predict names. */
 int
-__gen_tempname (char *tmpl, int kind)
+__gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
 {
   int len;
   char *XXXXXX;
@@ -225,14 +223,14 @@ __gen_tempname (char *tmpl, int kind)
 #endif
 
   len = strlen (tmpl);
-  if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))
+  if (len < 6 + suffixlen || memcmp (&tmpl[len - 6 - suffixlen], "XXXXXX", 6))
     {
       __set_errno (EINVAL);
       return -1;
     }
 
   /* This is where the Xs start.  */
-  XXXXXX = &tmpl[len - 6];
+  XXXXXX = &tmpl[len - 6 - suffixlen];
 
   /* Get some more or less random data.  */
 #ifdef RANDOM_BITS
@@ -264,48 +262,47 @@ __gen_tempname (char *tmpl, int kind)
       XXXXXX[5] = letters[v % 62];
 
       switch (kind)
-       {
-       case __GT_FILE:
-         fd = small_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
-         break;
-
-       case __GT_BIGFILE:
-         fd = large_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
-         break;
-
-       case __GT_DIR:
-         fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
-         break;
-
-       case __GT_NOCREATE:
-         /* This case is backward from the other three.  __gen_tempname
-            succeeds if __xstat fails because the name does not exist.
-            Note the continue to bypass the common logic at the bottom
-            of the loop.  */
-         if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
-           {
-             if (errno == ENOENT)
-               {
-                 __set_errno (save_errno);
-                 return 0;
-               }
-             else
-               /* Give up now. */
-               return -1;
-           }
-         continue;
-
-       default:
-         assert (! "invalid KIND in __gen_tempname");
-       }
+        {
+        case __GT_FILE:
+          fd = __open (tmpl,
+                       (flags & ~O_ACCMODE)
+                       | O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+          break;
+
+        case __GT_DIR:
+          fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
+          break;
+
+        case __GT_NOCREATE:
+          /* This case is backward from the other three.  __gen_tempname
+             succeeds if __xstat fails because the name does not exist.
+             Note the continue to bypass the common logic at the bottom
+             of the loop.  */
+          if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
+            {
+              if (errno == ENOENT)
+                {
+                  __set_errno (save_errno);
+                  return 0;
+                }
+              else
+                /* Give up now. */
+                return -1;
+            }
+          continue;
+
+        default:
+          assert (! "invalid KIND in __gen_tempname");
+          abort ();
+        }
 
       if (fd >= 0)
-       {
-         __set_errno (save_errno);
-         return fd;
-       }
+        {
+          __set_errno (save_errno);
+          return fd;
+        }
       else if (errno != EEXIST)
-       return -1;
+        return -1;
     }
 
   /* We got out of the loop because we ran out of combinations to try.  */
index 74da03b3b29de5c206cdbd42f62f3ce2477d0010..349bc362c46988088fb467da756b01b369ed7e89 100644 (file)
@@ -1,6 +1,6 @@
 /* Create a temporary file or directory.
 
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2010 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
 
 /* header written by Eric Blake */
 
-/* In gnulib, always prefer large files.  GT_FILE maps to
-   __GT_BIGFILE, not __GT_FILE, for a reason.  */
-#define GT_FILE                1
-#define GT_DIR         2
-#define GT_NOCREATE    3
+#ifndef GL_TEMPNAME_H
+# define GL_TEMPNAME_H
+
+# include <stdio.h>
+
+# ifdef __GT_FILE
+#  define GT_FILE     __GT_FILE
+#  define GT_DIR      __GT_DIR
+#  define GT_NOCREATE __GT_NOCREATE
+# else
+#  define GT_FILE     0
+#  define GT_DIR      1
+#  define GT_NOCREATE 2
+# endif
 
 /* Generate a temporary file name based on TMPL.  TMPL must match the
-   rules for mk[s]temp (i.e. end in "XXXXXX").  The name constructed
-   does not exist at the time of the call to gen_tempname.  TMPL is
-   overwritten with the result.
+   rules for mk[s]temp (i.e. end in "XXXXXX", possibly with a suffix).
+   The name constructed does not exist at the time of the call to
+   gen_tempname.  TMPL is overwritten with the result.
 
    KIND may be one of:
-   GT_NOCREATE:                simply verify that the name does not exist
-                       at the time of the call.
-   GT_FILE:            create a large file using open(O_CREAT|O_EXCL)
-                       and return a read-write fd.  The file is mode 0600.
-   GT_DIR:             create a directory, which will be mode 0700.
+   GT_NOCREATE:         simply verify that the name does not exist
+                        at the time of the call.
+   GT_FILE:             create a large file using open(O_CREAT|O_EXCL)
+                        and return a read-write fd.  The file is mode 0600.
+   GT_DIR:              create a directory, which will be mode 0700.
 
    We use a clever algorithm to get hard-to-predict names. */
-extern int gen_tempname (char *tmpl, int kind);
+extern int gen_tempname (char *tmpl, int suffixlen, int flags, int kind);
+
+#endif /* GL_TEMPNAME_H */
diff --git a/gnulib/time.in.h b/gnulib/time.in.h
new file mode 100644 (file)
index 0000000..6fb4fd7
--- /dev/null
@@ -0,0 +1,229 @@
+/* A more-standard <time.h>.
+
+   Copyright (C) 2007-2010 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 3, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
+/* Don't get in the way of glibc when it includes time.h merely to
+   declare a few standard symbols, rather than to declare all the
+   symbols.  Also, Solaris 8 <time.h> eventually includes itself
+   recursively; if that is happening, just include the system <time.h>
+   without adding our own declarations.  */
+#if (defined __need_time_t || defined __need_clock_t \
+     || defined __need_timespec \
+     || defined _GL_TIME_H)
+
+# @INCLUDE_NEXT@ @NEXT_TIME_H@
+
+#else
+
+# define _GL_TIME_H
+
+# @INCLUDE_NEXT@ @NEXT_TIME_H@
+
+/* NetBSD 5.0 mis-defines NULL.  */
+# include <stddef.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
+   Or they define it with the wrong member names or define it in <sys/time.h>
+   (e.g., FreeBSD circa 1997).  Stock Mingw does not define it, but the
+   pthreads-win32 library defines it in <pthread.h>.  */
+# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
+#  if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+#   include <sys/time.h>
+#  elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+#   include <pthread.h>
+/* The pthreads-win32 <pthread.h> also defines a couple of broken macros.  */
+#   undef asctime_r
+#   undef ctime_r
+#   undef gmtime_r
+#   undef localtime_r
+#   undef rand_r
+#   undef strtok_r
+#  else
+
+#   ifdef __cplusplus
+extern "C" {
+#   endif
+
+#   undef timespec
+#   define timespec rpl_timespec
+struct timespec
+{
+  time_t tv_sec;
+  long int tv_nsec;
+};
+
+#   ifdef __cplusplus
+}
+#   endif
+
+#  endif
+# endif
+
+/* Sleep for at least RQTP seconds unless interrupted,  If interrupted,
+   return -1 and store the remaining time into RMTP.  See
+   <http://www.opengroup.org/susv3xsh/nanosleep.html>.  */
+# if @GNULIB_NANOSLEEP@
+#  if @REPLACE_NANOSLEEP@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define nanosleep rpl_nanosleep
+#   endif
+_GL_FUNCDECL_RPL (nanosleep, int,
+                  (struct timespec const *__rqtp, struct timespec *__rmtp)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (nanosleep, int,
+                  (struct timespec const *__rqtp, struct timespec *__rmtp));
+#  else
+#   if ! @HAVE_NANOSLEEP@
+_GL_FUNCDECL_SYS (nanosleep, int,
+                  (struct timespec const *__rqtp, struct timespec *__rmtp)
+                  _GL_ARG_NONNULL ((1)));
+#   endif
+_GL_CXXALIAS_SYS (nanosleep, int,
+                  (struct timespec const *__rqtp, struct timespec *__rmtp));
+#  endif
+_GL_CXXALIASWARN (nanosleep);
+# endif
+
+/* Return the 'time_t' representation of TP and normalize TP.  */
+# if @GNULIB_MKTIME@
+#  if @REPLACE_MKTIME@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define mktime rpl_mktime
+#   endif
+_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
+#  else
+_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
+#  endif
+_GL_CXXALIASWARN (mktime);
+# endif
+
+/* Convert TIMER to RESULT, assuming local time and UTC respectively.  See
+   <http://www.opengroup.org/susv3xsh/localtime_r.html> and
+   <http://www.opengroup.org/susv3xsh/gmtime_r.html>.  */
+# if @GNULIB_TIME_R@
+#  if @REPLACE_LOCALTIME_R@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef localtime_r
+#    define localtime_r rpl_localtime_r
+#   endif
+_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
+                                             struct tm *restrict __result)
+                                            _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
+                                             struct tm *restrict __result));
+#  else
+#   if ! @HAVE_LOCALTIME_R@
+_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
+                                             struct tm *restrict __result)
+                                            _GL_ARG_NONNULL ((1, 2)));
+#   endif
+_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
+                                             struct tm *restrict __result));
+#  endif
+_GL_CXXALIASWARN (localtime_r);
+#  if @REPLACE_LOCALTIME_R@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef gmtime_r
+#    define gmtime_r rpl_gmtime_r
+#   endif
+_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
+                                          struct tm *restrict __result)
+                                         _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
+                                          struct tm *restrict __result));
+#  else
+#   if ! @HAVE_LOCALTIME_R@
+_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
+                                          struct tm *restrict __result)
+                                         _GL_ARG_NONNULL ((1, 2)));
+#   endif
+_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
+                                          struct tm *restrict __result));
+#  endif
+_GL_CXXALIASWARN (gmtime_r);
+# endif
+
+/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
+   the resulting broken-down time into TM.  See
+   <http://www.opengroup.org/susv3xsh/strptime.html>.  */
+# if @GNULIB_STRPTIME@
+#  if ! @HAVE_STRPTIME@
+_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
+                                     char const *restrict __format,
+                                     struct tm *restrict __tm)
+                                    _GL_ARG_NONNULL ((1, 2, 3)));
+#  endif
+_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
+                                     char const *restrict __format,
+                                     struct tm *restrict __tm));
+_GL_CXXALIASWARN (strptime);
+# endif
+
+/* Convert TM to a time_t value, assuming UTC.  */
+# if @GNULIB_TIMEGM@
+#  if @REPLACE_TIMEGM@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef timegm
+#    define timegm rpl_timegm
+#   endif
+_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
+#  else
+#   if ! @HAVE_TIMEGM@
+_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+#   endif
+_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
+#  endif
+_GL_CXXALIASWARN (timegm);
+# endif
+
+/* Encourage applications to avoid unsafe functions that can overrun
+   buffers when given outlandish struct tm values.  Portable
+   applications should use strftime (or even sprintf) instead.  */
+# if defined GNULIB_POSIXCHECK
+#  undef asctime
+_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
+                 "better use strftime (or even sprintf) instead");
+# endif
+# if defined GNULIB_POSIXCHECK
+#  undef asctime_r
+_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - "
+                 "better use strftime (or even sprintf) instead");
+# endif
+# if defined GNULIB_POSIXCHECK
+#  undef ctime
+_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - "
+                 "better use strftime (or even sprintf) instead");
+# endif
+# if defined GNULIB_POSIXCHECK
+#  undef ctime_r
+_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - "
+                 "better use strftime (or even sprintf) instead");
+# endif
+
+#endif
index d8276b1e1885fbb36a5e45d382963ff341ba91c4..26a4cbd6a284ffb34373f67ab00f8ffa54ff32c5 100644 (file)
@@ -1,9 +1,9 @@
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2009 Free Software Foundation, Inc.
+   Copyright (C) 2003-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_UNISTD_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
+/* Special invocation convention:
+   - On mingw, several headers, including <winsock2.h>, include <unistd.h>,
+     but we need to ensure that both the system <unistd.h> and <winsock2.h>
+     are completely included before we replace gethostname.  */
+#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
+  && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H
+/* <unistd.h> is being indirectly included for the first time from
+   <winsock2.h>; avoid declaring any overrides.  */
+# if @HAVE_UNISTD_H@
+#  @INCLUDE_NEXT@ @NEXT_UNISTD_H@
+# else
+#  error unexpected; report this to bug-gnulib@gnu.org
+# endif
+# define _GL_WINSOCK2_H_WITNESS
+
+/* Normal invocation.  */
+#elif !defined _GL_UNISTD_H
+
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_UNISTD_H@
 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
 #endif
 
-#ifndef _GL_UNISTD_H
+/* Get all possible declarations of gethostname().  */
+#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
+  && !defined _GL_INCLUDING_WINSOCK2_H
+# define _GL_INCLUDING_WINSOCK2_H
+# include <winsock2.h>
+# undef _GL_INCLUDING_WINSOCK2_H
+#endif
+
+#if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
 #define _GL_UNISTD_H
 
+/* NetBSD 5.0 mis-defines NULL.  Also get size_t.  */
+#include <stddef.h>
+
 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>.  */
-#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET)
+/* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
+     || (@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK)) \
+    && ! defined __GLIBC__
 # include <stdio.h>
 #endif
 
+/* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__
+# include <fcntl.h>
+#endif
+
 /* mingw fails to declare _exit in <unistd.h>.  */
 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
-#include <stdlib.h>
+/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
+/* But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <stdlib.h>
+#endif
+
+/* mingw declares getcwd in <io.h>, not in <unistd.h>.  */
+#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
+     && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# include <io.h>
+#endif
 
-#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
+#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
+     || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
 /* Get ssize_t.  */
 # include <sys/types.h>
 #endif
 
+/* Get getopt(), optarg, optind, opterr, optopt.
+   But avoid namespace pollution on glibc systems.  */
+#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
+# include <getopt.h>
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
 #if @GNULIB_GETHOSTNAME@
 /* Get all possible declarations of gethostname().  */
 # if @UNISTD_H_HAVE_WINSOCK2_H@
-#  include <winsock2.h>
 #  if !defined _GL_SYS_SOCKET_H
-#   undef socket
-#   define socket              socket_used_without_including_sys_socket_h
-#   undef connect
-#   define connect             connect_used_without_including_sys_socket_h
-#   undef accept
-#   define accept              accept_used_without_including_sys_socket_h
-#   undef bind
-#   define bind                        bind_used_without_including_sys_socket_h
-#   undef getpeername
-#   define getpeername         getpeername_used_without_including_sys_socket_h
-#   undef getsockname
-#   define getsockname         getsockname_used_without_including_sys_socket_h
-#   undef getsockopt
-#   define getsockopt          getsockopt_used_without_including_sys_socket_h
-#   undef listen
-#   define listen              listen_used_without_including_sys_socket_h
-#   undef recv
-#   define recv                        recv_used_without_including_sys_socket_h
-#   undef send
-#   define send                        send_used_without_including_sys_socket_h
-#   undef recvfrom
-#   define recvfrom            recvfrom_used_without_including_sys_socket_h
-#   undef sendto
-#   define sendto              sendto_used_without_including_sys_socket_h
-#   undef setsockopt
-#   define setsockopt          setsockopt_used_without_including_sys_socket_h
-#   undef shutdown
-#   define shutdown            shutdown_used_without_including_sys_socket_h
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef socket
+#    define socket              socket_used_without_including_sys_socket_h
+#    undef connect
+#    define connect             connect_used_without_including_sys_socket_h
+#    undef accept
+#    define accept              accept_used_without_including_sys_socket_h
+#    undef bind
+#    define bind                bind_used_without_including_sys_socket_h
+#    undef getpeername
+#    define getpeername         getpeername_used_without_including_sys_socket_h
+#    undef getsockname
+#    define getsockname         getsockname_used_without_including_sys_socket_h
+#    undef getsockopt
+#    define getsockopt          getsockopt_used_without_including_sys_socket_h
+#    undef listen
+#    define listen              listen_used_without_including_sys_socket_h
+#    undef recv
+#    define recv                recv_used_without_including_sys_socket_h
+#    undef send
+#    define send                send_used_without_including_sys_socket_h
+#    undef recvfrom
+#    define recvfrom            recvfrom_used_without_including_sys_socket_h
+#    undef sendto
+#    define sendto              sendto_used_without_including_sys_socket_h
+#    undef setsockopt
+#    define setsockopt          setsockopt_used_without_including_sys_socket_h
+#    undef shutdown
+#    define shutdown            shutdown_used_without_including_sys_socket_h
+#   else
+     _GL_WARN_ON_USE (socket,
+                      "socket() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (connect,
+                      "connect() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (accept,
+                      "accept() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (bind,
+                      "bind() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (getpeername,
+                      "getpeername() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (getsockname,
+                      "getsockname() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (getsockopt,
+                      "getsockopt() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (listen,
+                      "listen() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (recv,
+                      "recv() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (send,
+                      "send() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (recvfrom,
+                      "recvfrom() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (sendto,
+                      "sendto() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (setsockopt,
+                      "setsockopt() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (shutdown,
+                      "shutdown() used without including <sys/socket.h>");
+#   endif
 #  endif
 #  if !defined _GL_SYS_SELECT_H
-#   undef select
-#   define select              select_used_without_including_sys_select_h
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef select
+#    define select              select_used_without_including_sys_select_h
+#   else
+     _GL_WARN_ON_USE (select,
+                      "select() used without including <sys/select.h>");
+#   endif
 #  endif
 # endif
 #endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 
 /* OS/2 EMX lacks these macros.  */
 #ifndef STDIN_FILENO
 # define STDERR_FILENO 2
 #endif
 
+/* Ensure *_OK macros exist.  */
+#ifndef F_OK
+# define F_OK 0
+# define X_OK 1
+# define W_OK 2
+# define R_OK 4
+#endif
+
+
 /* Declare overridden functions.  */
 
-#ifdef __cplusplus
-extern "C" {
+
+#if defined GNULIB_POSIXCHECK
+/* The access() function is a security risk.  */
+_GL_WARN_ON_USE (access, "the access function is a security risk - "
+                 "use the gnulib module faccessat instead");
 #endif
 
 
 #if @GNULIB_CHOWN@
-# if @REPLACE_CHOWN@
-#  ifndef REPLACE_CHOWN
-#   define REPLACE_CHOWN 1
-#  endif
-#  if REPLACE_CHOWN
 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
    to GID (if GID is not -1).  Follow symbolic links.
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/chown.html>.  */
+# if @REPLACE_CHOWN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef chown
 #   define chown rpl_chown
-extern int chown (const char *file, uid_t uid, gid_t gid);
 #  endif
+_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
+# else
+#  if !@HAVE_CHOWN@
+_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
+                              _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
 # endif
+_GL_CXXALIASWARN (chown);
 #elif defined GNULIB_POSIXCHECK
 # undef chown
-# define chown(f,u,g) \
-    (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \
-                      "doesn't treat a uid or gid of -1 on some systems - " \
-                      "use gnulib module chown for portability"), \
-     chown (f, u, g))
+# if HAVE_RAW_DECL_CHOWN
+_GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
+                 "doesn't treat a uid or gid of -1 on some systems - "
+                 "use gnulib module chown for portability");
+# endif
 #endif
 
 
 #if @GNULIB_CLOSE@
-# if @UNISTD_H_HAVE_WINSOCK2_H@
-/* Need a gnulib internal function.  */
-#  define HAVE__GL_CLOSE_FD_MAYBE_SOCKET 1
-# endif
 # if @REPLACE_CLOSE@
 /* Automatically included by modules that need a replacement for close.  */
-#  undef close
-#  define close rpl_close
-extern int close (int);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef close
+#   define close rpl_close
+#  endif
+_GL_FUNCDECL_RPL (close, int, (int fd));
+_GL_CXXALIAS_RPL (close, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (close, int, (int fd));
 # endif
-#elif @UNISTD_H_HAVE_WINSOCK2_H@
+_GL_CXXALIASWARN (close);
+#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 # undef close
 # define close close_used_without_requesting_gnulib_module_close
 #elif defined GNULIB_POSIXCHECK
 # undef close
-# define close(f) \
-    (GL_LINK_WARNING ("close does not portably work on sockets - " \
-                      "use gnulib module close for portability"), \
-     close (f))
+/* Assume close is always declared.  */
+_GL_WARN_ON_USE (close, "close does not portably work on sockets - "
+                 "use gnulib module close for portability");
 #endif
 
 
+#if @REPLACE_DUP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  define dup rpl_dup
+# endif
+_GL_FUNCDECL_RPL (dup, int, (int oldfd));
+_GL_CXXALIAS_RPL (dup, int, (int oldfd));
+#else
+_GL_CXXALIAS_SYS (dup, int, (int oldfd));
+#endif
+_GL_CXXALIASWARN (dup);
+
+
 #if @GNULIB_DUP2@
-# if !@HAVE_DUP2@
 /* Copy the file descriptor OLDFD into file descriptor NEWFD.  Do nothing if
    NEWFD = OLDFD, otherwise close NEWFD first if it is open.
-   Return 0 if successful, otherwise -1 and errno set.
+   Return newfd if successful, otherwise -1 and errno set.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/dup2.html>.  */
-extern int dup2 (int oldfd, int newfd);
+# if @REPLACE_DUP2@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define dup2 rpl_dup2
+#  endif
+_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
+_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
+# else
+#  if !@HAVE_DUP2@
+_GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd));
+#  endif
+_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
 # endif
+_GL_CXXALIASWARN (dup2);
 #elif defined GNULIB_POSIXCHECK
 # undef dup2
-# define dup2(o,n) \
-    (GL_LINK_WARNING ("dup2 is unportable - " \
-                      "use gnulib module dup2 for portability"), \
-     dup2 (o, n))
+# if HAVE_RAW_DECL_DUP2
+_GL_WARN_ON_USE (dup2, "dup2 is unportable - "
+                 "use gnulib module dup2 for portability");
+# endif
+#endif
+
+
+#if @GNULIB_DUP3@
+/* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
+   specified flags.
+   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+   and O_TEXT, O_BINARY (defined in "binary-io.h").
+   Close NEWFD first if it is open.
+   Return newfd if successful, otherwise -1 and errno set.
+   See the Linux man page at
+   <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>.  */
+# if @HAVE_DUP3@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define dup3 rpl_dup3
+#  endif
+_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
+_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
+# else
+_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
+_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
+# endif
+_GL_CXXALIASWARN (dup3);
+#elif defined GNULIB_POSIXCHECK
+# undef dup3
+# if HAVE_RAW_DECL_DUP3
+_GL_WARN_ON_USE (dup3, "dup3 is unportable - "
+                 "use gnulib module dup3 for portability");
+# endif
 #endif
 
 
@@ -179,55 +344,126 @@ extern int dup2 (int oldfd, int newfd);
 #   include <crt_externs.h>
 #   define environ (*_NSGetEnviron ())
 #  else
+#   ifdef __cplusplus
+extern "C" {
+#   endif
 extern char **environ;
+#   ifdef __cplusplus
+}
+#   endif
 #  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
-# undef environ
-# define environ \
-    (GL_LINK_WARNING ("environ is unportable - " \
-                      "use gnulib module environ for portability"), \
-     environ)
+# if HAVE_RAW_DECL_ENVIRON
+static inline char ***
+rpl_environ (void)
+{
+  return &environ;
+}
+_GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
+                 "use gnulib module environ for portability");
+#  undef environ
+#  define environ (*rpl_environ ())
+# endif
 #endif
 
 
 #if @GNULIB_EUIDACCESS@
-# if !@HAVE_EUIDACCESS@
-/* Like access(), except that is uses the effective user id and group id of
+/* Like access(), except that it uses the effective user id and group id of
    the current process.  */
-extern int euidaccess (const char *filename, int mode);
+# if !@HAVE_EUIDACCESS@
+_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
+                                   _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
+_GL_CXXALIASWARN (euidaccess);
+# if defined GNULIB_POSIXCHECK
+/* Like access(), this function is a security risk.  */
+_GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
+                 "use the gnulib module faccessat instead");
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef euidaccess
-# define euidaccess(f,m) \
-    (GL_LINK_WARNING ("euidaccess is unportable - " \
-                      "use gnulib module euidaccess for portability"), \
-     euidaccess (f, m))
+# if HAVE_RAW_DECL_EUIDACCESS
+_GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
+                 "use gnulib module euidaccess for portability");
+# endif
 #endif
 
 
-#if @GNULIB_FCHDIR@
-# if @REPLACE_FCHDIR@
+#if @GNULIB_FACCESSAT@
+# if !@HAVE_FACCESSAT@
+_GL_FUNCDECL_SYS (faccessat, int,
+                  (int fd, char const *file, int mode, int flag)
+                  _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (faccessat, int,
+                  (int fd, char const *file, int mode, int flag));
+_GL_CXXALIASWARN (faccessat);
+#elif defined GNULIB_POSIXCHECK
+# undef faccessat
+# if HAVE_RAW_DECL_FACCESSAT
+_GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
+                 "use gnulib module faccessat for portability");
+# endif
+#endif
 
+
+#if @GNULIB_FCHDIR@
 /* Change the process' current working directory to the directory on which
    the given file descriptor is open.
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/fchdir.html>.  */
-extern int fchdir (int /*fd*/);
+# if ! @HAVE_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
 
-#  define dup rpl_dup
-extern int dup (int);
-#  define dup2 rpl_dup2
-extern int dup2 (int, int);
+/* Gnulib internal hooks needed to maintain the fchdir metadata.  */
+_GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
+     _GL_ARG_NONNULL ((2));
+_GL_EXTERN_C void _gl_unregister_fd (int fd);
+_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
+_GL_EXTERN_C const char *_gl_directory_name (int fd);
 
 # endif
+_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
+_GL_CXXALIASWARN (fchdir);
 #elif defined GNULIB_POSIXCHECK
 # undef fchdir
-# define fchdir(f) \
-    (GL_LINK_WARNING ("fchdir is unportable - " \
-                      "use gnulib module fchdir for portability"), \
-     fchdir (f))
+# if HAVE_RAW_DECL_FCHDIR
+_GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
+                 "use gnulib module fchdir for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FCHOWNAT@
+# if @REPLACE_FCHOWNAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fchownat
+#   define fchownat rpl_fchownat
+#  endif
+_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
+                                  uid_t owner, gid_t group, int flag)
+                                 _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
+                                  uid_t owner, gid_t group, int flag));
+# else
+#  if !@HAVE_FCHOWNAT@
+_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
+                                  uid_t owner, gid_t group, int flag)
+                                 _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
+                                  uid_t owner, gid_t group, int flag));
+# endif
+_GL_CXXALIASWARN (fchownat);
+#elif defined GNULIB_POSIXCHECK
+# undef fchownat
+# if HAVE_RAW_DECL_FCHOWNAT
+_GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
@@ -237,39 +473,39 @@ extern int dup2 (int, int);
    See POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/fsync.html>.  */
 # if !@HAVE_FSYNC@
-extern int fsync (int fd);
+_GL_FUNCDECL_SYS (fsync, int, (int fd));
 # endif
+_GL_CXXALIAS_SYS (fsync, int, (int fd));
+_GL_CXXALIASWARN (fsync);
 #elif defined GNULIB_POSIXCHECK
 # undef fsync
-# define fsync(fd) \
-    (GL_LINK_WARNING ("fsync is unportable - " \
-                      "use gnulib module fsync for portability"), \
-     fsync (fd))
+# if HAVE_RAW_DECL_FSYNC
+_GL_WARN_ON_USE (fsync, "fsync is unportable - "
+                 "use gnulib module fsync for portability");
+# endif
 #endif
 
 
 #if @GNULIB_FTRUNCATE@
-# if !@HAVE_FTRUNCATE@
 /* Change the size of the file to which FD is opened to become equal to LENGTH.
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/ftruncate.html>.  */
-extern int ftruncate (int fd, off_t length);
+# if !@HAVE_FTRUNCATE@
+_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
 # endif
+_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
+_GL_CXXALIASWARN (ftruncate);
 #elif defined GNULIB_POSIXCHECK
 # undef ftruncate
-# define ftruncate(f,l) \
-    (GL_LINK_WARNING ("ftruncate is unportable - " \
-                      "use gnulib module ftruncate for portability"), \
-     ftruncate (f, l))
+# if HAVE_RAW_DECL_FTRUNCATE
+_GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
+                 "use gnulib module ftruncate for portability");
+# endif
 #endif
 
 
 #if @GNULIB_GETCWD@
-/* Include the headers that might declare getcwd so that they will not
-   cause confusion if included after this file.  */
-# include <stdlib.h>
-# if @REPLACE_GETCWD@
 /* Get the name of the current working directory, and put it in SIZE bytes
    of BUF.
    Return BUF if successful, or NULL if the directory couldn't be determined
@@ -280,15 +516,24 @@ extern int ftruncate (int fd, off_t length);
    extension: If BUF is NULL, an array is allocated with 'malloc'; the array
    is SIZE bytes long, unless SIZE == 0, in which case it is as big as
    necessary.  */
-#  define getcwd rpl_getcwd
-extern char * getcwd (char *buf, size_t size);
+# if @REPLACE_GETCWD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define getcwd rpl_getcwd
+#  endif
+_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
+_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
+# else
+/* Need to cast, because on mingw, the second parameter is
+                                                   int size.  */
+_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
 # endif
+_GL_CXXALIASWARN (getcwd);
 #elif defined GNULIB_POSIXCHECK
 # undef getcwd
-# define getcwd(b,s) \
-    (GL_LINK_WARNING ("getcwd is unportable - " \
-                      "use gnulib module getcwd for portability"), \
-     getcwd (b, s))
+# if HAVE_RAW_DECL_GETCWD
+_GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
+                 "use gnulib module getcwd for portability");
+# endif
 #endif
 
 
@@ -304,28 +549,65 @@ extern char * getcwd (char *buf, size_t size);
    If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
    Return 0 if successful, otherwise set errno and return -1.  */
 # if !@HAVE_GETDOMAINNAME@
-extern int getdomainname(char *name, size_t len);
+_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
+                                      _GL_ARG_NONNULL ((1)));
 # endif
+/* Need to cast, because on MacOS X 10.5 systems, the second parameter is
+                                                        int len.  */
+_GL_CXXALIAS_SYS_CAST (getdomainname, int, (char *name, size_t len));
+_GL_CXXALIASWARN (getdomainname);
 #elif defined GNULIB_POSIXCHECK
 # undef getdomainname
-# define getdomainname(n,l) \
-    (GL_LINK_WARNING ("getdomainname is unportable - " \
-                      "use gnulib module getdomainname for portability"), \
-     getdomainname (n, l))
+# if HAVE_RAW_DECL_GETDOMAINNAME
+_GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
+                 "use gnulib module getdomainname for portability");
+# endif
 #endif
 
 
 #if @GNULIB_GETDTABLESIZE@
+/* Return the maximum number of file descriptors in the current process.
+   In POSIX, this is same as sysconf (_SC_OPEN_MAX).  */
 # if !@HAVE_GETDTABLESIZE@
-/* Return the maximum number of file descriptors in the current process.  */
-extern int getdtablesize (void);
+_GL_FUNCDECL_SYS (getdtablesize, int, (void));
 # endif
+_GL_CXXALIAS_SYS (getdtablesize, int, (void));
+_GL_CXXALIASWARN (getdtablesize);
 #elif defined GNULIB_POSIXCHECK
 # undef getdtablesize
-# define getdtablesize() \
-    (GL_LINK_WARNING ("getdtablesize is unportable - " \
-                      "use gnulib module getdtablesize for portability"), \
-     getdtablesize ())
+# if HAVE_RAW_DECL_GETDTABLESIZE
+_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
+                 "use gnulib module getdtablesize for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETGROUPS@
+/* Return the supplemental groups that the current process belongs to.
+   It is unspecified whether the effective group id is in the list.
+   If N is 0, return the group count; otherwise, N describes how many
+   entries are available in GROUPS.  Return -1 and set errno if N is
+   not 0 and not large enough.  Fails with ENOSYS on some systems.  */
+# if @REPLACE_GETGROUPS@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getgroups
+#   define getgroups rpl_getgroups
+#  endif
+_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
+_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
+# else
+#  if !@HAVE_GETGROUPS@
+_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
+#  endif
+_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
+# endif
+_GL_CXXALIASWARN (getgroups);
+#elif defined GNULIB_POSIXCHECK
+# undef getgroups
+# if HAVE_RAW_DECL_GETGROUPS
+_GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
+                 "use gnulib module getgroups for portability");
+# endif
 #endif
 
 
@@ -338,21 +620,57 @@ extern int getdtablesize (void);
    If the host name is longer than LEN, set errno = EINVAL and return -1.
    Return 0 if successful, otherwise set errno and return -1.  */
 # if @UNISTD_H_HAVE_WINSOCK2_H@
-#  undef gethostname
-#  define gethostname rpl_gethostname
-# endif
-# if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@
-extern int gethostname(char *name, size_t len);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef gethostname
+#   define gethostname rpl_gethostname
+#  endif
+_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
+                                    _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
+# else
+#  if !@HAVE_GETHOSTNAME@
+_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
+                                    _GL_ARG_NONNULL ((1)));
+#  endif
+/* Need to cast, because on Solaris 10 systems, the second parameter is
+                                                      int len.  */
+_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
 # endif
+_GL_CXXALIASWARN (gethostname);
 #elif @UNISTD_H_HAVE_WINSOCK2_H@
 # undef gethostname
 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
 #elif defined GNULIB_POSIXCHECK
 # undef gethostname
-# define gethostname(n,l) \
-    (GL_LINK_WARNING ("gethostname is unportable - " \
-                      "use gnulib module gethostname for portability"), \
-     gethostname (n, l))
+# if HAVE_RAW_DECL_GETHOSTNAME
+_GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
+                 "use gnulib module gethostname for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETLOGIN@
+/* Returns the user's login name, or NULL if it cannot be found.  Upon error,
+   returns NULL with errno set.
+
+   See <http://www.opengroup.org/susv3xsh/getlogin.html>.
+
+   Most programs don't need to use this function, because the information is
+   available through environment variables:
+     ${LOGNAME-$USER}        on Unix platforms,
+     $USERNAME               on native Windows platforms.
+ */
+# if !@HAVE_GETLOGIN@
+_GL_FUNCDECL_SYS (getlogin, char *, (void));
+# endif
+_GL_CXXALIAS_SYS (getlogin, char *, (void));
+_GL_CXXALIASWARN (getlogin);
+#elif defined GNULIB_POSIXCHECK
+# undef getlogin
+# if HAVE_RAW_DECL_GETLOGIN
+_GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
+                 "use gnulib module getlogin for portability");
+# endif
 #endif
 
 
@@ -365,124 +683,184 @@ extern int gethostname(char *name, size_t len);
    provided (this case is hopefully rare but is left open by the POSIX spec).
 
    See <http://www.opengroup.org/susv3xsh/getlogin.html>.
+
+   Most programs don't need to use this function, because the information is
+   available through environment variables:
+     ${LOGNAME-$USER}        on Unix platforms,
+     $USERNAME               on native Windows platforms.
  */
 # if !@HAVE_DECL_GETLOGIN_R@
-#  include <stddef.h>
-extern int getlogin_r (char *name, size_t size);
+_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
+                                   _GL_ARG_NONNULL ((1)));
 # endif
+/* Need to cast, because on Solaris 10 systems, the second argument is
+                                                     int size.  */
+_GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
+_GL_CXXALIASWARN (getlogin_r);
 #elif defined GNULIB_POSIXCHECK
 # undef getlogin_r
-# define getlogin_r(n,s) \
-    (GL_LINK_WARNING ("getlogin_r is unportable - " \
-                      "use gnulib module getlogin_r for portability"), \
-     getlogin_r (n, s))
+# if HAVE_RAW_DECL_GETLOGIN_R
+_GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
+                 "use gnulib module getlogin_r for portability");
+# endif
 #endif
 
 
 #if @GNULIB_GETPAGESIZE@
 # if @REPLACE_GETPAGESIZE@
-#  define getpagesize rpl_getpagesize
-extern int getpagesize (void);
-# elif !@HAVE_GETPAGESIZE@
-/* This is for POSIX systems.  */
-#  if !defined getpagesize && defined _SC_PAGESIZE
-#   if ! (defined __VMS && __VMS_VER < 70000000)
-#    define getpagesize() sysconf (_SC_PAGESIZE)
-#   endif
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define getpagesize rpl_getpagesize
 #  endif
+_GL_FUNCDECL_RPL (getpagesize, int, (void));
+_GL_CXXALIAS_RPL (getpagesize, int, (void));
+# else
+#  if !@HAVE_GETPAGESIZE@
+#   if !defined getpagesize
+/* This is for POSIX systems.  */
+#    if !defined _gl_getpagesize && defined _SC_PAGESIZE
+#     if ! (defined __VMS && __VMS_VER < 70000000)
+#      define _gl_getpagesize() sysconf (_SC_PAGESIZE)
+#     endif
+#    endif
 /* This is for older VMS.  */
-#  if !defined getpagesize && defined __VMS
-#   ifdef __ALPHA
-#    define getpagesize() 8192
-#   else
-#    define getpagesize() 512
-#   endif
-#  endif
+#    if !defined _gl_getpagesize && defined __VMS
+#     ifdef __ALPHA
+#      define _gl_getpagesize() 8192
+#     else
+#      define _gl_getpagesize() 512
+#     endif
+#    endif
 /* This is for BeOS.  */
-#  if !defined getpagesize && @HAVE_OS_H@
-#   include <OS.h>
-#   if defined B_PAGE_SIZE
-#    define getpagesize() B_PAGE_SIZE
-#   endif
-#  endif
+#    if !defined _gl_getpagesize && @HAVE_OS_H@
+#     include <OS.h>
+#     if defined B_PAGE_SIZE
+#      define _gl_getpagesize() B_PAGE_SIZE
+#     endif
+#    endif
 /* This is for AmigaOS4.0.  */
-#  if !defined getpagesize && defined __amigaos4__
-#   define getpagesize() 2048
-#  endif
+#    if !defined _gl_getpagesize && defined __amigaos4__
+#     define _gl_getpagesize() 2048
+#    endif
 /* This is for older Unix systems.  */
-#  if !defined getpagesize && @HAVE_SYS_PARAM_H@
-#   include <sys/param.h>
-#   ifdef EXEC_PAGESIZE
-#    define getpagesize() EXEC_PAGESIZE
-#   else
-#    ifdef NBPG
-#     ifndef CLSIZE
-#      define CLSIZE 1
+#    if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
+#     include <sys/param.h>
+#     ifdef EXEC_PAGESIZE
+#      define _gl_getpagesize() EXEC_PAGESIZE
+#     else
+#      ifdef NBPG
+#       ifndef CLSIZE
+#        define CLSIZE 1
+#       endif
+#       define _gl_getpagesize() (NBPG * CLSIZE)
+#      else
+#       ifdef NBPC
+#        define _gl_getpagesize() NBPC
+#       endif
+#      endif
 #     endif
-#     define getpagesize() (NBPG * CLSIZE)
+#    endif
+#    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#     define getpagesize() _gl_getpagesize ()
 #    else
-#     ifdef NBPC
-#      define getpagesize() NBPC
-#     endif
+static inline int
+getpagesize ()
+{
+  return _gl_getpagesize ();
+}
 #    endif
 #   endif
 #  endif
+/* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t.  */
+_GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
+# endif
+# if @HAVE_DECL_GETPAGESIZE@
+_GL_CXXALIASWARN (getpagesize);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getpagesize
-# define getpagesize() \
-    (GL_LINK_WARNING ("getpagesize is unportable - " \
-                      "use gnulib module getpagesize for portability"), \
-     getpagesize ())
+# if HAVE_RAW_DECL_GETPAGESIZE
+_GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
+                 "use gnulib module getpagesize for portability");
+# endif
 #endif
 
 
 #if @GNULIB_GETUSERSHELL@
-# if !@HAVE_GETUSERSHELL@
 /* Return the next valid login shell on the system, or NULL when the end of
    the list has been reached.  */
-extern char *getusershell (void);
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (getusershell, char *, (void));
+# endif
+_GL_CXXALIAS_SYS (getusershell, char *, (void));
+_GL_CXXALIASWARN (getusershell);
+#elif defined GNULIB_POSIXCHECK
+# undef getusershell
+# if HAVE_RAW_DECL_GETUSERSHELL
+_GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
+                 "use gnulib module getusershell for portability");
+# endif
+#endif
+
+#if @GNULIB_GETUSERSHELL@
 /* Rewind to pointer that is advanced at each getusershell() call.  */
-extern void setusershell (void);
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (setusershell, void, (void));
+# endif
+_GL_CXXALIAS_SYS (setusershell, void, (void));
+_GL_CXXALIASWARN (setusershell);
+#elif defined GNULIB_POSIXCHECK
+# undef setusershell
+# if HAVE_RAW_DECL_SETUSERSHELL
+_GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
+                 "use gnulib module getusershell for portability");
+# endif
+#endif
+
+#if @GNULIB_GETUSERSHELL@
 /* Free the pointer that is advanced at each getusershell() call and
    associated resources.  */
-extern void endusershell (void);
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (endusershell, void, (void));
 # endif
+_GL_CXXALIAS_SYS (endusershell, void, (void));
+_GL_CXXALIASWARN (endusershell);
 #elif defined GNULIB_POSIXCHECK
-# undef getusershell
-# define getusershell() \
-    (GL_LINK_WARNING ("getusershell is unportable - " \
-                      "use gnulib module getusershell for portability"), \
-     getusershell ())
-# undef setusershell
-# define setusershell() \
-    (GL_LINK_WARNING ("setusershell is unportable - " \
-                      "use gnulib module getusershell for portability"), \
-     setusershell ())
 # undef endusershell
-# define endusershell() \
-    (GL_LINK_WARNING ("endusershell is unportable - " \
-                      "use gnulib module getusershell for portability"), \
-     endusershell ())
+# if HAVE_RAW_DECL_ENDUSERSHELL
+_GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
+                 "use gnulib module getusershell for portability");
+# endif
 #endif
 
 
 #if @GNULIB_LCHOWN@
-# if @REPLACE_LCHOWN@
 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
    to GID (if GID is not -1).  Do not follow symbolic links.
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/lchown.html>.  */
-#  define lchown rpl_lchown
-extern int lchown (char const *file, uid_t owner, gid_t group);
+# if @REPLACE_LCHOWN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef lchown
+#   define lchown rpl_lchown
+#  endif
+_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
+# else
+#  if !@HAVE_LCHOWN@
+_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
+                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
 # endif
+_GL_CXXALIASWARN (lchown);
 #elif defined GNULIB_POSIXCHECK
 # undef lchown
-# define lchown(f,u,g) \
-    (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \
-                      "systems - use gnulib module lchown for portability"), \
-     lchown (f, u, g))
+# if HAVE_RAW_DECL_LCHOWN
+_GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
+                 "use gnulib module lchown for portability");
+# endif
 #endif
 
 
@@ -491,33 +869,184 @@ extern int lchown (char const *file, uid_t owner, gid_t group);
    Return 0 if successful, otherwise -1 and errno set.
    See POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/link.html>.  */
-# if !@HAVE_LINK@
-extern int link (const char *path1, const char *path2);
+# if @REPLACE_LINK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define link rpl_link
+#  endif
+_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
+                             _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
+# else
+#  if !@HAVE_LINK@
+_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
+                             _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
 # endif
+_GL_CXXALIASWARN (link);
 #elif defined GNULIB_POSIXCHECK
 # undef link
-# define link(path1,path2) \
-    (GL_LINK_WARNING ("link is unportable - " \
-                      "use gnulib module link for portability"), \
-     link (path1, path2))
+# if HAVE_RAW_DECL_LINK
+_GL_WARN_ON_USE (link, "link is unportable - "
+                 "use gnulib module link for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LINKAT@
+/* Create a new hard link for an existing file, relative to two
+   directories.  FLAG controls whether symlinks are followed.
+   Return 0 if successful, otherwise -1 and errno set.  */
+# if @REPLACE_LINKAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef linkat
+#   define linkat rpl_linkat
+#  endif
+_GL_FUNCDECL_RPL (linkat, int,
+                  (int fd1, const char *path1, int fd2, const char *path2,
+                   int flag)
+                  _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (linkat, int,
+                  (int fd1, const char *path1, int fd2, const char *path2,
+                   int flag));
+# else
+#  if !@HAVE_LINKAT@
+_GL_FUNCDECL_SYS (linkat, int,
+                  (int fd1, const char *path1, int fd2, const char *path2,
+                   int flag)
+                  _GL_ARG_NONNULL ((2, 4)));
+#  endif
+_GL_CXXALIAS_SYS (linkat, int,
+                  (int fd1, const char *path1, int fd2, const char *path2,
+                   int flag));
+# endif
+_GL_CXXALIASWARN (linkat);
+#elif defined GNULIB_POSIXCHECK
+# undef linkat
+# if HAVE_RAW_DECL_LINKAT
+_GL_WARN_ON_USE (linkat, "linkat is unportable - "
+                 "use gnulib module linkat for portability");
+# endif
 #endif
 
 
 #if @GNULIB_LSEEK@
-# if @REPLACE_LSEEK@
 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
    Return the new offset if successful, otherwise -1 and errno set.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/lseek.html>.  */
-#  define lseek rpl_lseek
-   extern off_t lseek (int fd, off_t offset, int whence);
+# if @REPLACE_LSEEK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define lseek rpl_lseek
+#  endif
+_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
+_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
+# else
+_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
 # endif
+_GL_CXXALIASWARN (lseek);
 #elif defined GNULIB_POSIXCHECK
 # undef lseek
-# define lseek(f,o,w) \
-    (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \
-                      "systems - use gnulib module lseek for portability"), \
-     lseek (f, o, w))
+# if HAVE_RAW_DECL_LSEEK
+_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
+                 "systems - use gnulib module lseek for portability");
+# endif
+#endif
+
+
+#if @GNULIB_PIPE2@
+/* Create a pipe, applying the given flags when opening the read-end of the
+   pipe and the write-end of the pipe.
+   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+   and O_TEXT, O_BINARY (defined in "binary-io.h").
+   Store the read-end as fd[0] and the write-end as fd[1].
+   Return 0 upon success, or -1 with errno set upon failure.
+   See also the Linux man page at
+   <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>.  */
+# if @HAVE_PIPE2@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define pipe2 rpl_pipe2
+#  endif
+_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
+# else
+_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
+# endif
+_GL_CXXALIASWARN (pipe2);
+#elif defined GNULIB_POSIXCHECK
+# undef pipe2
+# if HAVE_RAW_DECL_PIPE2
+_GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
+                 "use gnulib module pipe2 for portability");
+# endif
+#endif
+
+
+#if @GNULIB_PREAD@
+/* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
+   Return the number of bytes placed into BUF if successful, otherwise
+   set errno and return -1.  0 indicates EOF.  See the POSIX:2001
+   specification <http://www.opengroup.org/susv3xsh/pread.html>.  */
+# if @REPLACE_PREAD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define pread rpl_pread
+#  endif
+_GL_FUNCDECL_RPL (pread, ssize_t,
+                  (int fd, void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pread, ssize_t,
+                  (int fd, void *buf, size_t bufsize, off_t offset));
+# else
+#  if !@HAVE_PREAD@
+_GL_FUNCDECL_SYS (pread, ssize_t,
+                  (int fd, void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (pread, ssize_t,
+                  (int fd, void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pread);
+#elif defined GNULIB_POSIXCHECK
+# undef pread
+# if HAVE_RAW_DECL_PREAD
+_GL_WARN_ON_USE (pread, "pread is unportable - "
+                 "use gnulib module pread for portability");
+# endif
+#endif
+
+
+#if @GNULIB_PWRITE@
+/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
+   Return the number of bytes written if successful, otherwise
+   set errno and return -1.  0 indicates nothing written.  See the
+   POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/pwrite.html>.  */
+# if @REPLACE_PWRITE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define pwrite rpl_pwrite
+#  endif
+_GL_FUNCDECL_RPL (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset));
+# else
+#  if !@HAVE_PWRITE@
+_GL_FUNCDECL_SYS (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pwrite);
+#elif defined GNULIB_POSIXCHECK
+# undef pwrite
+# if HAVE_RAW_DECL_PWRITE
+_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
+                 "use gnulib module pwrite for portability");
+# endif
 #endif
 
 
@@ -527,16 +1056,70 @@ extern int link (const char *path1, const char *path2);
    successful, otherwise -1 and errno set.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/readlink.html>.  */
-# if !@HAVE_READLINK@
-#  include <stddef.h>
-extern int readlink (const char *file, char *buf, size_t bufsize);
+# if @REPLACE_READLINK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define readlink rpl_readlink
+#  endif
+_GL_FUNCDECL_RPL (readlink, ssize_t,
+                  (const char *file, char *buf, size_t bufsize)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (readlink, ssize_t,
+                  (const char *file, char *buf, size_t bufsize));
+# else
+#  if !@HAVE_READLINK@
+_GL_FUNCDECL_SYS (readlink, ssize_t,
+                  (const char *file, char *buf, size_t bufsize)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (readlink, ssize_t,
+                  (const char *file, char *buf, size_t bufsize));
 # endif
+_GL_CXXALIASWARN (readlink);
 #elif defined GNULIB_POSIXCHECK
 # undef readlink
-# define readlink(f,b,s) \
-    (GL_LINK_WARNING ("readlink is unportable - " \
-                      "use gnulib module readlink for portability"), \
-     readlink (f, b, s))
+# if HAVE_RAW_DECL_READLINK
+_GL_WARN_ON_USE (readlink, "readlink is unportable - "
+                 "use gnulib module readlink for portability");
+# endif
+#endif
+
+
+#if @GNULIB_READLINKAT@
+# if !@HAVE_READLINKAT@
+_GL_FUNCDECL_SYS (readlinkat, ssize_t,
+                  (int fd, char const *file, char *buf, size_t len)
+                  _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (readlinkat, ssize_t,
+                  (int fd, char const *file, char *buf, size_t len));
+_GL_CXXALIASWARN (readlinkat);
+#elif defined GNULIB_POSIXCHECK
+# undef readlinkat
+# if HAVE_RAW_DECL_READLINKAT
+_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
+                 "use gnulib module readlinkat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RMDIR@
+/* Remove the directory DIR.  */
+# if @REPLACE_RMDIR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define rmdir rpl_rmdir
+#  endif
+_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (rmdir, int, (char const *name));
+# else
+_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
+# endif
+_GL_CXXALIASWARN (rmdir);
+#elif defined GNULIB_POSIXCHECK
+# undef rmdir
+# if HAVE_RAW_DECL_RMDIR
+_GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
+                 "use gnulib module rmdir for portability");
+# endif
 #endif
 
 
@@ -545,36 +1128,197 @@ extern int readlink (const char *file, char *buf, size_t bufsize);
    Returns the number of seconds left to sleep.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/sleep.html>.  */
-# if !@HAVE_SLEEP@
-extern unsigned int sleep (unsigned int n);
+# if @REPLACE_SLEEP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef sleep
+#   define sleep rpl_sleep
+#  endif
+_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
+_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
+# else
+#  if !@HAVE_SLEEP@
+_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
+#  endif
+_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
 # endif
+_GL_CXXALIASWARN (sleep);
 #elif defined GNULIB_POSIXCHECK
 # undef sleep
-# define sleep(n) \
-    (GL_LINK_WARNING ("sleep is unportable - " \
-                      "use gnulib module sleep for portability"), \
-     sleep (n))
+# if HAVE_RAW_DECL_SLEEP
+_GL_WARN_ON_USE (sleep, "sleep is unportable - "
+                 "use gnulib module sleep for portability");
+# endif
 #endif
 
 
-#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
-/* Write up to COUNT bytes starting at BUF to file descriptor FD.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/write.html>.  */
-# undef write
-# define write rpl_write
-extern ssize_t write (int fd, const void *buf, size_t count);
+#if @GNULIB_SYMLINK@
+# if @REPLACE_SYMLINK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef symlink
+#   define symlink rpl_symlink
+#  endif
+_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
+                                _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
+# else
+#  if !@HAVE_SYMLINK@
+_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
+                                _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
+# endif
+_GL_CXXALIASWARN (symlink);
+#elif defined GNULIB_POSIXCHECK
+# undef symlink
+# if HAVE_RAW_DECL_SYMLINK
+_GL_WARN_ON_USE (symlink, "symlink is not portable - "
+                 "use gnulib module symlink for portability");
+# endif
 #endif
 
 
-#ifdef FCHDIR_REPLACEMENT
-/* gnulib internal function.  */
-extern void _gl_unregister_fd (int fd);
+#if @GNULIB_SYMLINKAT@
+# if !@HAVE_SYMLINKAT@
+_GL_FUNCDECL_SYS (symlinkat, int,
+                  (char const *contents, int fd, char const *file)
+                  _GL_ARG_NONNULL ((1, 3)));
+# endif
+_GL_CXXALIAS_SYS (symlinkat, int,
+                  (char const *contents, int fd, char const *file));
+_GL_CXXALIASWARN (symlinkat);
+#elif defined GNULIB_POSIXCHECK
+# undef symlinkat
+# if HAVE_RAW_DECL_SYMLINKAT
+_GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
+                 "use gnulib module symlinkat for portability");
+# endif
 #endif
 
 
-#ifdef __cplusplus
-}
+#if @GNULIB_TTYNAME_R@
+/* Store at most BUFLEN characters of the pathname of the terminal FD is
+   open on in BUF.  Return 0 on success, otherwise an error number.  */
+# if @REPLACE_TTYNAME_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ttyname_r
+#   define ttyname_r rpl_ttyname_r
+#  endif
+_GL_FUNCDECL_RPL (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen));
+# else
+#  if !@HAVE_TTYNAME_R@
+_GL_FUNCDECL_SYS (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen));
+# endif
+_GL_CXXALIASWARN (ttyname_r);
+#elif defined GNULIB_POSIXCHECK
+# undef ttyname_r
+# if HAVE_RAW_DECL_TTYNAME_R
+_GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
+                 "use gnulib module ttyname_r for portability");
+# endif
+#endif
+
+
+#if @GNULIB_UNLINK@
+# if @REPLACE_UNLINK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef unlink
+#   define unlink rpl_unlink
+#  endif
+_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (unlink, int, (char const *file));
+# else
+_GL_CXXALIAS_SYS (unlink, int, (char const *file));
+# endif
+_GL_CXXALIASWARN (unlink);
+#elif defined GNULIB_POSIXCHECK
+# undef unlink
+# if HAVE_RAW_DECL_UNLINK
+_GL_WARN_ON_USE (unlink, "unlink is not portable - "
+                 "use gnulib module unlink for portability");
+# endif
+#endif
+
+
+#if @GNULIB_UNLINKAT@
+# if @REPLACE_UNLINKAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef unlinkat
+#   define unlinkat rpl_unlinkat
+#  endif
+_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
+                                 _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
+# else
+#  if !@HAVE_UNLINKAT@
+_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
+                                 _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
+# endif
+_GL_CXXALIASWARN (unlinkat);
+#elif defined GNULIB_POSIXCHECK
+# undef unlinkat
+# if HAVE_RAW_DECL_UNLINKAT
+_GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_USLEEP@
+/* Pause the execution of the current thread for N microseconds.
+   Returns 0 on completion, or -1 on range error.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/sleep.html>.  */
+# if @REPLACE_USLEEP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef usleep
+#   define usleep rpl_usleep
+#  endif
+_GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
+_GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
+# else
+#  if !@HAVE_USLEEP@
+_GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
+#  endif
+_GL_CXXALIAS_SYS (usleep, int, (useconds_t n));
+# endif
+_GL_CXXALIASWARN (usleep);
+#elif defined GNULIB_POSIXCHECK
+# undef usleep
+# if HAVE_RAW_DECL_USLEEP
+_GL_WARN_ON_USE (usleep, "usleep is unportable - "
+                 "use gnulib module usleep for portability");
+# endif
+#endif
+
+
+#if @GNULIB_WRITE@
+/* Write up to COUNT bytes starting at BUF to file descriptor FD.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/write.html>.  */
+# if @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef write
+#   define write rpl_write
+#  endif
+_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
+                                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
+# else
+/* Need to cast, because on mingw, the third parameter is
+                                                             unsigned int count
+   and the return type is 'int'.  */
+_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (write);
 #endif
 
 
index fa43ca636578cbdffbe9e4711a139e12aed21756..e618901ba282161a0b067e087782939049e4fa3a 100644 (file)
@@ -1,9 +1,9 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 # endif
 #endif
 
-#include <locale.h>    /* localeconv() */
-#include <stdio.h>     /* snprintf(), sprintf() */
-#include <stdlib.h>    /* abort(), malloc(), realloc(), free() */
-#include <string.h>    /* memcpy(), strlen() */
-#include <errno.h>     /* errno */
-#include <limits.h>    /* CHAR_BIT */
-#include <float.h>     /* DBL_MAX_EXP, LDBL_MAX_EXP */
+#include <locale.h>     /* localeconv() */
+#include <stdio.h>      /* snprintf(), sprintf() */
+#include <stdlib.h>     /* abort(), malloc(), realloc(), free() */
+#include <string.h>     /* memcpy(), strlen() */
+#include <errno.h>      /* errno */
+#include <limits.h>     /* CHAR_BIT */
+#include <float.h>      /* DBL_MAX_EXP, LDBL_MAX_EXP */
 #if HAVE_NL_LANGINFO
 # include <langinfo.h>
 #endif
 # define USE_SNPRINTF 1
 # if HAVE_DECL__SNWPRINTF
    /* On Windows, the function swprintf() has a different signature than
-      on Unix; we use the _snwprintf() function instead.  */
-#  define SNPRINTF _snwprintf
+      on Unix; we use the function _snwprintf() or - on mingw - snwprintf()
+      instead.  The mingw function snwprintf() has fewer bugs than the
+      MSVCRT function _snwprintf(), so prefer that.  */
+#  if defined __MINGW32__
+#   define SNPRINTF snwprintf
+#  else
+#   define SNPRINTF _snwprintf
+#  endif
 # else
    /* Unix.  */
 #  define SNPRINTF swprintf
 #  define USE_SNPRINTF 0
 # endif
 # if HAVE_DECL__SNPRINTF
-   /* Windows.  */
-#  define SNPRINTF _snprintf
+   /* Windows.  The mingw function snprintf() has fewer bugs than the MSVCRT
+      function _snprintf(), so prefer that.  */
+#  if defined __MINGW32__
+#   define SNPRINTF snprintf
+    /* Here we need to call the native snprintf, not rpl_snprintf.  */
+#   undef snprintf
+#  else
+#   define SNPRINTF _snprintf
+#  endif
 # else
    /* Unix.  */
 #  define SNPRINTF snprintf
 #undef remainder
 #define remainder rem
 
-#if !USE_SNPRINTF && !WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && !WIDE_CHAR_VERSION
 # if (HAVE_STRNLEN && !defined _AIX)
 #  define local_strnlen strnlen
 # else
@@ -210,7 +223,7 @@ local_strnlen (const char *string, size_t maxlen)
 # endif
 #endif
 
-#if (!USE_SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T && (WIDE_CHAR_VERSION || DCHAR_IS_TCHAR)
+#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T
 # if HAVE_WCSLEN
 #  define local_wcslen wcslen
 # else
@@ -233,7 +246,7 @@ local_wcslen (const wchar_t *s)
 # endif
 #endif
 
-#if !USE_SNPRINTF && HAVE_WCHAR_T && WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && HAVE_WCHAR_T && WIDE_CHAR_VERSION
 # if HAVE_WCSNLEN
 #  define local_wcsnlen wcsnlen
 # else
@@ -257,14 +270,14 @@ local_wcsnlen (const wchar_t *s, size_t maxlen)
 # ifndef decimal_point_char_defined
 #  define decimal_point_char_defined 1
 static char
-decimal_point_char ()
+decimal_point_char (void)
 {
   const char *point;
   /* Determine it in a multithread-safe way.  We know nl_langinfo is
-     multithread-safe on glibc systems, but is not required to be multithread-
-     safe by POSIX.  sprintf(), however, is multithread-safe.  localeconv()
-     is rarely multithread-safe.  */
-#  if HAVE_NL_LANGINFO && __GLIBC__
+     multithread-safe on glibc systems and MacOS X systems, but is not required
+     to be multithread-safe by POSIX.  sprintf(), however, is multithread-safe.
+     localeconv() is rarely multithread-safe.  */
+#  if HAVE_NL_LANGINFO && (__GLIBC__ || (defined __APPLE__ && defined __MACH__))
   point = nl_langinfo (RADIXCHAR);
 #  elif 1
   char pointbuf[5];
@@ -364,26 +377,26 @@ multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
       dlen = len1 + len2;
       dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t));
       if (dp == NULL)
-       return NULL;
+        return NULL;
       for (k = len2; k > 0; )
-       dp[--k] = 0;
+        dp[--k] = 0;
       for (i = 0; i < len1; i++)
-       {
-         mp_limb_t digit1 = p1[i];
-         mp_twolimb_t carry = 0;
-         for (j = 0; j < len2; j++)
-           {
-             mp_limb_t digit2 = p2[j];
-             carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
-             carry += dp[i + j];
-             dp[i + j] = (mp_limb_t) carry;
-             carry = carry >> GMP_LIMB_BITS;
-           }
-         dp[i + len2] = (mp_limb_t) carry;
-       }
+        {
+          mp_limb_t digit1 = p1[i];
+          mp_twolimb_t carry = 0;
+          for (j = 0; j < len2; j++)
+            {
+              mp_limb_t digit2 = p2[j];
+              carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
+              carry += dp[i + j];
+              dp[i + j] = (mp_limb_t) carry;
+              carry = carry >> GMP_LIMB_BITS;
+            }
+          dp[i + len2] = (mp_limb_t) carry;
+        }
       /* Normalise.  */
       while (dlen > 0 && dp[dlen - 1] == 0)
-       dlen--;
+        dlen--;
       dest->nlimbs = dlen;
       dest->limbs = dp;
     }
@@ -413,7 +426,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
        Normalise [q[m-1],...,q[0]], yields q.
      If m>=n>1, perform a multiple-precision division:
        We have a/b < beta^(m-n+1).
-       s:=intDsize-1-(hightest bit in b[n-1]), 0<=s<intDsize.
+       s:=intDsize-1-(highest bit in b[n-1]), 0<=s<intDsize.
        Shift a and b left by s bits, copying them. r:=a.
        r=[r[m],...,r[0]], b=[b[n-1],...,b[0]] with b[n-1]>=beta/2.
        For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).}
@@ -477,12 +490,12 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
   for (;;)
     {
       if (b_len == 0)
-       /* Division by zero.  */
-       abort ();
+        /* Division by zero.  */
+        abort ();
       if (b_ptr[b_len - 1] == 0)
-       b_len--;
+        b_len--;
       else
-       break;
+        break;
     }
 
   /* Here m = a_len >= 0 and n = b_len > 0.  */
@@ -499,261 +512,261 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
   else if (b_len == 1)
     {
       /* n=1: single precision division.
-        beta^(m-1) <= a < beta^m  ==>  beta^(m-2) <= a/b < beta^m  */
+         beta^(m-1) <= a < beta^m  ==>  beta^(m-2) <= a/b < beta^m  */
       r_ptr = roomptr;
       q_ptr = roomptr + 1;
       {
-       mp_limb_t den = b_ptr[0];
-       mp_limb_t remainder = 0;
-       const mp_limb_t *sourceptr = a_ptr + a_len;
-       mp_limb_t *destptr = q_ptr + a_len;
-       size_t count;
-       for (count = a_len; count > 0; count--)
-         {
-           mp_twolimb_t num =
-             ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr;
-           *--destptr = num / den;
-           remainder = num % den;
-         }
-       /* Normalise and store r.  */
-       if (remainder > 0)
-         {
-           r_ptr[0] = remainder;
-           r_len = 1;
-         }
-       else
-         r_len = 0;
-       /* Normalise q.  */
-       q_len = a_len;
-       if (q_ptr[q_len - 1] == 0)
-         q_len--;
+        mp_limb_t den = b_ptr[0];
+        mp_limb_t remainder = 0;
+        const mp_limb_t *sourceptr = a_ptr + a_len;
+        mp_limb_t *destptr = q_ptr + a_len;
+        size_t count;
+        for (count = a_len; count > 0; count--)
+          {
+            mp_twolimb_t num =
+              ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr;
+            *--destptr = num / den;
+            remainder = num % den;
+          }
+        /* Normalise and store r.  */
+        if (remainder > 0)
+          {
+            r_ptr[0] = remainder;
+            r_len = 1;
+          }
+        else
+          r_len = 0;
+        /* Normalise q.  */
+        q_len = a_len;
+        if (q_ptr[q_len - 1] == 0)
+          q_len--;
       }
     }
   else
     {
       /* n>1: multiple precision division.
-        beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n  ==>
-        beta^(m-n-1) <= a/b < beta^(m-n+1).  */
+         beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n  ==>
+         beta^(m-n-1) <= a/b < beta^(m-n+1).  */
       /* Determine s.  */
       size_t s;
       {
-       mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
-       s = 31;
-       if (msd >= 0x10000)
-         {
-           msd = msd >> 16;
-           s -= 16;
-         }
-       if (msd >= 0x100)
-         {
-           msd = msd >> 8;
-           s -= 8;
-         }
-       if (msd >= 0x10)
-         {
-           msd = msd >> 4;
-           s -= 4;
-         }
-       if (msd >= 0x4)
-         {
-           msd = msd >> 2;
-           s -= 2;
-         }
-       if (msd >= 0x2)
-         {
-           msd = msd >> 1;
-           s -= 1;
-         }
+        mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
+        s = 31;
+        if (msd >= 0x10000)
+          {
+            msd = msd >> 16;
+            s -= 16;
+          }
+        if (msd >= 0x100)
+          {
+            msd = msd >> 8;
+            s -= 8;
+          }
+        if (msd >= 0x10)
+          {
+            msd = msd >> 4;
+            s -= 4;
+          }
+        if (msd >= 0x4)
+          {
+            msd = msd >> 2;
+            s -= 2;
+          }
+        if (msd >= 0x2)
+          {
+            msd = msd >> 1;
+            s -= 1;
+          }
       }
       /* 0 <= s < GMP_LIMB_BITS.
-        Copy b, shifting it left by s bits.  */
+         Copy b, shifting it left by s bits.  */
       if (s > 0)
-       {
-         tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t));
-         if (tmp_roomptr == NULL)
-           {
-             free (roomptr);
-             return NULL;
-           }
-         {
-           const mp_limb_t *sourceptr = b_ptr;
-           mp_limb_t *destptr = tmp_roomptr;
-           mp_twolimb_t accu = 0;
-           size_t count;
-           for (count = b_len; count > 0; count--)
-             {
-               accu += (mp_twolimb_t) *sourceptr++ << s;
-               *destptr++ = (mp_limb_t) accu;
-               accu = accu >> GMP_LIMB_BITS;
-             }
-           /* accu must be zero, since that was how s was determined.  */
-           if (accu != 0)
-             abort ();
-         }
-         b_ptr = tmp_roomptr;
-       }
+        {
+          tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t));
+          if (tmp_roomptr == NULL)
+            {
+              free (roomptr);
+              return NULL;
+            }
+          {
+            const mp_limb_t *sourceptr = b_ptr;
+            mp_limb_t *destptr = tmp_roomptr;
+            mp_twolimb_t accu = 0;
+            size_t count;
+            for (count = b_len; count > 0; count--)
+              {
+                accu += (mp_twolimb_t) *sourceptr++ << s;
+                *destptr++ = (mp_limb_t) accu;
+                accu = accu >> GMP_LIMB_BITS;
+              }
+            /* accu must be zero, since that was how s was determined.  */
+            if (accu != 0)
+              abort ();
+          }
+          b_ptr = tmp_roomptr;
+        }
       /* Copy a, shifting it left by s bits, yields r.
-        Memory layout:
-        At the beginning: r = roomptr[0..a_len],
-        at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len]  */
+         Memory layout:
+         At the beginning: r = roomptr[0..a_len],
+         at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len]  */
       r_ptr = roomptr;
       if (s == 0)
-       {
-         memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
-         r_ptr[a_len] = 0;
-       }
+        {
+          memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
+          r_ptr[a_len] = 0;
+        }
       else
-       {
-         const mp_limb_t *sourceptr = a_ptr;
-         mp_limb_t *destptr = r_ptr;
-         mp_twolimb_t accu = 0;
-         size_t count;
-         for (count = a_len; count > 0; count--)
-           {
-             accu += (mp_twolimb_t) *sourceptr++ << s;
-             *destptr++ = (mp_limb_t) accu;
-             accu = accu >> GMP_LIMB_BITS;
-           }
-         *destptr++ = (mp_limb_t) accu;
-       }
+        {
+          const mp_limb_t *sourceptr = a_ptr;
+          mp_limb_t *destptr = r_ptr;
+          mp_twolimb_t accu = 0;
+          size_t count;
+          for (count = a_len; count > 0; count--)
+            {
+              accu += (mp_twolimb_t) *sourceptr++ << s;
+              *destptr++ = (mp_limb_t) accu;
+              accu = accu >> GMP_LIMB_BITS;
+            }
+          *destptr++ = (mp_limb_t) accu;
+        }
       q_ptr = roomptr + b_len;
       q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */
       {
-       size_t j = a_len - b_len; /* m-n */
-       mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */
-       mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */
-       mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */
-         ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd;
-       /* Division loop, traversed m-n+1 times.
-          j counts down, b is unchanged, beta/2 <= b[n-1] < beta.  */
-       for (;;)
-         {
-           mp_limb_t q_star;
-           mp_limb_t c1;
-           if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */
-             {
-               /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow.  */
-               mp_twolimb_t num =
-                 ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS)
-                 | r_ptr[j + b_len - 1];
-               q_star = num / b_msd;
-               c1 = num % b_msd;
-             }
-           else
-             {
-               /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1].  */
-               q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */
-               /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta
-                  <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta
-                  <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta)
-                       {<= beta !}.
-                  If yes, jump directly to the subtraction loop.
-                  (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta
-                   <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */
-               if (r_ptr[j + b_len] > b_msd
-                   || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd)
-                 /* r[j+n] >= b[n-1]+1 or
-                    r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a
-                    carry.  */
-                 goto subtract;
-             }
-           /* q_star = q*,
-              c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, <beta).  */
-           {
-             mp_twolimb_t c2 = /* c1*beta+r[j+n-2] */
-               ((mp_twolimb_t) c1 << GMP_LIMB_BITS) | r_ptr[j + b_len - 2];
-             mp_twolimb_t c3 = /* b[n-2] * q* */
-               (mp_twolimb_t) b_2msd * (mp_twolimb_t) q_star;
-             /* While c2 < c3, increase c2 and decrease c3.
-                Consider c3-c2.  While it is > 0, decrease it by
-                b[n-1]*beta+b[n-2].  Because of b[n-1]*beta+b[n-2] >= beta^2/2
-                this can happen only twice.  */
-             if (c3 > c2)
-               {
-                 q_star = q_star - 1; /* q* := q* - 1 */
-                 if (c3 - c2 > b_msdd)
-                   q_star = q_star - 1; /* q* := q* - 1 */
-               }
-           }
-           if (q_star > 0)
-             subtract:
-             {
-               /* Subtract r := r - b * q* * beta^j.  */
-               mp_limb_t cr;
-               {
-                 const mp_limb_t *sourceptr = b_ptr;
-                 mp_limb_t *destptr = r_ptr + j;
-                 mp_twolimb_t carry = 0;
-                 size_t count;
-                 for (count = b_len; count > 0; count--)
-                   {
-                     /* Here 0 <= carry <= q*.  */
-                     carry =
-                       carry
-                       + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++
-                       + (mp_limb_t) ~(*destptr);
-                     /* Here 0 <= carry <= beta*q* + beta-1.  */
-                     *destptr++ = ~(mp_limb_t) carry;
-                     carry = carry >> GMP_LIMB_BITS; /* <= q* */
-                   }
-                 cr = (mp_limb_t) carry;
-               }
-               /* Subtract cr from r_ptr[j + b_len], then forget about
-                  r_ptr[j + b_len].  */
-               if (cr > r_ptr[j + b_len])
-                 {
-                   /* Subtraction gave a carry.  */
-                   q_star = q_star - 1; /* q* := q* - 1 */
-                   /* Add b back.  */
-                   {
-                     const mp_limb_t *sourceptr = b_ptr;
-                     mp_limb_t *destptr = r_ptr + j;
-                     mp_limb_t carry = 0;
-                     size_t count;
-                     for (count = b_len; count > 0; count--)
-                       {
-                         mp_limb_t source1 = *sourceptr++;
-                         mp_limb_t source2 = *destptr;
-                         *destptr++ = source1 + source2 + carry;
-                         carry =
-                           (carry
-                            ? source1 >= (mp_limb_t) ~source2
-                            : source1 > (mp_limb_t) ~source2);
-                       }
-                   }
-                   /* Forget about the carry and about r[j+n].  */
-                 }
-             }
-           /* q* is determined.  Store it as q[j].  */
-           q_ptr[j] = q_star;
-           if (j == 0)
-             break;
-           j--;
-         }
+        size_t j = a_len - b_len; /* m-n */
+        mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */
+        mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */
+        mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */
+          ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd;
+        /* Division loop, traversed m-n+1 times.
+           j counts down, b is unchanged, beta/2 <= b[n-1] < beta.  */
+        for (;;)
+          {
+            mp_limb_t q_star;
+            mp_limb_t c1;
+            if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */
+              {
+                /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow.  */
+                mp_twolimb_t num =
+                  ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS)
+                  | r_ptr[j + b_len - 1];
+                q_star = num / b_msd;
+                c1 = num % b_msd;
+              }
+            else
+              {
+                /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1].  */
+                q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */
+                /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta
+                   <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta
+                   <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta)
+                        {<= beta !}.
+                   If yes, jump directly to the subtraction loop.
+                   (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta
+                    <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */
+                if (r_ptr[j + b_len] > b_msd
+                    || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd)
+                  /* r[j+n] >= b[n-1]+1 or
+                     r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a
+                     carry.  */
+                  goto subtract;
+              }
+            /* q_star = q*,
+               c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, <beta).  */
+            {
+              mp_twolimb_t c2 = /* c1*beta+r[j+n-2] */
+                ((mp_twolimb_t) c1 << GMP_LIMB_BITS) | r_ptr[j + b_len - 2];
+              mp_twolimb_t c3 = /* b[n-2] * q* */
+                (mp_twolimb_t) b_2msd * (mp_twolimb_t) q_star;
+              /* While c2 < c3, increase c2 and decrease c3.
+                 Consider c3-c2.  While it is > 0, decrease it by
+                 b[n-1]*beta+b[n-2].  Because of b[n-1]*beta+b[n-2] >= beta^2/2
+                 this can happen only twice.  */
+              if (c3 > c2)
+                {
+                  q_star = q_star - 1; /* q* := q* - 1 */
+                  if (c3 - c2 > b_msdd)
+                    q_star = q_star - 1; /* q* := q* - 1 */
+                }
+            }
+            if (q_star > 0)
+              subtract:
+              {
+                /* Subtract r := r - b * q* * beta^j.  */
+                mp_limb_t cr;
+                {
+                  const mp_limb_t *sourceptr = b_ptr;
+                  mp_limb_t *destptr = r_ptr + j;
+                  mp_twolimb_t carry = 0;
+                  size_t count;
+                  for (count = b_len; count > 0; count--)
+                    {
+                      /* Here 0 <= carry <= q*.  */
+                      carry =
+                        carry
+                        + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++
+                        + (mp_limb_t) ~(*destptr);
+                      /* Here 0 <= carry <= beta*q* + beta-1.  */
+                      *destptr++ = ~(mp_limb_t) carry;
+                      carry = carry >> GMP_LIMB_BITS; /* <= q* */
+                    }
+                  cr = (mp_limb_t) carry;
+                }
+                /* Subtract cr from r_ptr[j + b_len], then forget about
+                   r_ptr[j + b_len].  */
+                if (cr > r_ptr[j + b_len])
+                  {
+                    /* Subtraction gave a carry.  */
+                    q_star = q_star - 1; /* q* := q* - 1 */
+                    /* Add b back.  */
+                    {
+                      const mp_limb_t *sourceptr = b_ptr;
+                      mp_limb_t *destptr = r_ptr + j;
+                      mp_limb_t carry = 0;
+                      size_t count;
+                      for (count = b_len; count > 0; count--)
+                        {
+                          mp_limb_t source1 = *sourceptr++;
+                          mp_limb_t source2 = *destptr;
+                          *destptr++ = source1 + source2 + carry;
+                          carry =
+                            (carry
+                             ? source1 >= (mp_limb_t) ~source2
+                             : source1 > (mp_limb_t) ~source2);
+                        }
+                    }
+                    /* Forget about the carry and about r[j+n].  */
+                  }
+              }
+            /* q* is determined.  Store it as q[j].  */
+            q_ptr[j] = q_star;
+            if (j == 0)
+              break;
+            j--;
+          }
       }
       r_len = b_len;
       /* Normalise q.  */
       if (q_ptr[q_len - 1] == 0)
-       q_len--;
+        q_len--;
 # if 0 /* Not needed here, since we need r only to compare it with b/2, and
-         b is shifted left by s bits.  */
+          b is shifted left by s bits.  */
       /* Shift r right by s bits.  */
       if (s > 0)
-       {
-         mp_limb_t ptr = r_ptr + r_len;
-         mp_twolimb_t accu = 0;
-         size_t count;
-         for (count = r_len; count > 0; count--)
-           {
-             accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS;
-             accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s);
-             *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS);
-           }
-       }
+        {
+          mp_limb_t ptr = r_ptr + r_len;
+          mp_twolimb_t accu = 0;
+          size_t count;
+          for (count = r_len; count > 0; count--)
+            {
+              accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS;
+              accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s);
+              *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS);
+            }
+        }
 # endif
       /* Normalise r.  */
       while (r_len > 0 && r_ptr[r_len - 1] == 0)
-       r_len--;
+        r_len--;
     }
   /* Compare r << 1 with b.  */
   if (r_len > b_len)
@@ -762,17 +775,17 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
     size_t i;
     for (i = b_len;;)
       {
-       mp_limb_t r_i =
-         (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0)
-         | (i < r_len ? r_ptr[i] << 1 : 0);
-       mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0);
-       if (r_i > b_i)
-         goto increment_q;
-       if (r_i < b_i)
-         goto keep_q;
-       if (i == 0)
-         break;
-       i--;
+        mp_limb_t r_i =
+          (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0)
+          | (i < r_len ? r_ptr[i] << 1 : 0);
+        mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0);
+        if (r_i > b_i)
+          goto increment_q;
+        if (r_i < b_i)
+          goto keep_q;
+        if (i == 0)
+          break;
+        i--;
       }
   }
   if (q_len > 0 && ((q_ptr[0] & 1) != 0))
@@ -781,8 +794,8 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
     {
       size_t i;
       for (i = 0; i < q_len; i++)
-       if (++(q_ptr[i]) != 0)
-         goto keep_q;
+        if (++(q_ptr[i]) != 0)
+          goto keep_q;
       q_ptr[q_len++] = 1;
     }
   keep_q:
@@ -811,36 +824,36 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes)
     {
       char *d_ptr = c_ptr;
       for (; extra_zeroes > 0; extra_zeroes--)
-       *d_ptr++ = '0';
+        *d_ptr++ = '0';
       while (a_len > 0)
-       {
-         /* Divide a by 10^9, in-place.  */
-         mp_limb_t remainder = 0;
-         mp_limb_t *ptr = a_ptr + a_len;
-         size_t count;
-         for (count = a_len; count > 0; count--)
-           {
-             mp_twolimb_t num =
-               ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr;
-             *ptr = num / 1000000000;
-             remainder = num % 1000000000;
-           }
-         /* Store the remainder as 9 decimal digits.  */
-         for (count = 9; count > 0; count--)
-           {
-             *d_ptr++ = '0' + (remainder % 10);
-             remainder = remainder / 10;
-           }
-         /* Normalize a.  */
-         if (a_ptr[a_len - 1] == 0)
-           a_len--;
-       }
+        {
+          /* Divide a by 10^9, in-place.  */
+          mp_limb_t remainder = 0;
+          mp_limb_t *ptr = a_ptr + a_len;
+          size_t count;
+          for (count = a_len; count > 0; count--)
+            {
+              mp_twolimb_t num =
+                ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr;
+              *ptr = num / 1000000000;
+              remainder = num % 1000000000;
+            }
+          /* Store the remainder as 9 decimal digits.  */
+          for (count = 9; count > 0; count--)
+            {
+              *d_ptr++ = '0' + (remainder % 10);
+              remainder = remainder / 10;
+            }
+          /* Normalize a.  */
+          if (a_ptr[a_len - 1] == 0)
+            a_len--;
+        }
       /* Remove leading zeroes.  */
       while (d_ptr > c_ptr && d_ptr[-1] == '0')
-       d_ptr--;
+        d_ptr--;
       /* But keep at least one zero.  */
       if (d_ptr == c_ptr)
-       *d_ptr++ = '0';
+        *d_ptr++ = '0';
       /* Terminate the string.  */
       *d_ptr = '\0';
     }
@@ -885,12 +898,12 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
       hi = (int) y;
       y -= hi;
       if (!(y >= 0.0L && y < 1.0L))
-       abort ();
+        abort ();
       y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
       lo = (int) y;
       y -= lo;
       if (!(y >= 0.0L && y < 1.0L))
-       abort ();
+        abort ();
       m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
     }
 #   else
@@ -900,7 +913,7 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
       d = (int) y;
       y -= d;
       if (!(y >= 0.0L && y < 1.0L))
-       abort ();
+        abort ();
       m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d;
     }
 #   endif
@@ -912,12 +925,12 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
       hi = (int) y;
       y -= hi;
       if (!(y >= 0.0L && y < 1.0L))
-       abort ();
+        abort ();
       y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
       lo = (int) y;
       y -= lo;
       if (!(y >= 0.0L && y < 1.0L))
-       abort ();
+        abort ();
       m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
     }
 #if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess
@@ -973,12 +986,12 @@ decode_double (double x, int *ep, mpn_t *mp)
       hi = (int) y;
       y -= hi;
       if (!(y >= 0.0 && y < 1.0))
-       abort ();
+        abort ();
       y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
       lo = (int) y;
       y -= lo;
       if (!(y >= 0.0 && y < 1.0))
-       abort ();
+        abort ();
       m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
     }
 #   else
@@ -988,7 +1001,7 @@ decode_double (double x, int *ep, mpn_t *mp)
       d = (int) y;
       y -= d;
       if (!(y >= 0.0 && y < 1.0))
-       abort ();
+        abort ();
       m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d;
     }
 #   endif
@@ -1000,12 +1013,12 @@ decode_double (double x, int *ep, mpn_t *mp)
       hi = (int) y;
       y -= hi;
       if (!(y >= 0.0 && y < 1.0))
-       abort ();
+        abort ();
       y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
       lo = (int) y;
       y -= lo;
       if (!(y >= 0.0 && y < 1.0))
-       abort ();
+        abort ();
       m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
     }
   if (!(y == 0.0))
@@ -1063,8 +1076,8 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
   abs_n = (n >= 0 ? n : -n);
   abs_s = (s >= 0 ? s : -s);
   pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1
-                                   + abs_s / GMP_LIMB_BITS + 1)
-                                  * sizeof (mp_limb_t));
+                                    + abs_s / GMP_LIMB_BITS + 1)
+                                   * sizeof (mp_limb_t));
   if (pow5_ptr == NULL)
     {
       free (memory);
@@ -1077,26 +1090,26 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
   if (abs_n > 0)
     {
       static mp_limb_t const small_pow5[13 + 1] =
-       {
-         1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625,
-         48828125, 244140625, 1220703125
-       };
+        {
+          1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625,
+          48828125, 244140625, 1220703125
+        };
       unsigned int n13;
       for (n13 = 0; n13 <= abs_n; n13 += 13)
-       {
-         mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13];
-         size_t j;
-         mp_twolimb_t carry = 0;
-         for (j = 0; j < pow5_len; j++)
-           {
-             mp_limb_t digit2 = pow5_ptr[j];
-             carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
-             pow5_ptr[j] = (mp_limb_t) carry;
-             carry = carry >> GMP_LIMB_BITS;
-           }
-         if (carry > 0)
-           pow5_ptr[pow5_len++] = (mp_limb_t) carry;
-       }
+        {
+          mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13];
+          size_t j;
+          mp_twolimb_t carry = 0;
+          for (j = 0; j < pow5_len; j++)
+            {
+              mp_limb_t digit2 = pow5_ptr[j];
+              carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
+              pow5_ptr[j] = (mp_limb_t) carry;
+              carry = carry >> GMP_LIMB_BITS;
+            }
+          if (carry > 0)
+            pow5_ptr[pow5_len++] = (mp_limb_t) carry;
+        }
     }
   s_limbs = abs_s / GMP_LIMB_BITS;
   s_bits = abs_s % GMP_LIMB_BITS;
@@ -1104,129 +1117,129 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
     {
       /* Multiply with 2^|s|.  */
       if (s_bits > 0)
-       {
-         mp_limb_t *ptr = pow5_ptr;
-         mp_twolimb_t accu = 0;
-         size_t count;
-         for (count = pow5_len; count > 0; count--)
-           {
-             accu += (mp_twolimb_t) *ptr << s_bits;
-             *ptr++ = (mp_limb_t) accu;
-             accu = accu >> GMP_LIMB_BITS;
-           }
-         if (accu > 0)
-           {
-             *ptr = (mp_limb_t) accu;
-             pow5_len++;
-           }
-       }
+        {
+          mp_limb_t *ptr = pow5_ptr;
+          mp_twolimb_t accu = 0;
+          size_t count;
+          for (count = pow5_len; count > 0; count--)
+            {
+              accu += (mp_twolimb_t) *ptr << s_bits;
+              *ptr++ = (mp_limb_t) accu;
+              accu = accu >> GMP_LIMB_BITS;
+            }
+          if (accu > 0)
+            {
+              *ptr = (mp_limb_t) accu;
+              pow5_len++;
+            }
+        }
       if (s_limbs > 0)
-       {
-         size_t count;
-         for (count = pow5_len; count > 0;)
-           {
-             count--;
-             pow5_ptr[s_limbs + count] = pow5_ptr[count];
-           }
-         for (count = s_limbs; count > 0;)
-           {
-             count--;
-             pow5_ptr[count] = 0;
-           }
-         pow5_len += s_limbs;
-       }
+        {
+          size_t count;
+          for (count = pow5_len; count > 0;)
+            {
+              count--;
+              pow5_ptr[s_limbs + count] = pow5_ptr[count];
+            }
+          for (count = s_limbs; count > 0;)
+            {
+              count--;
+              pow5_ptr[count] = 0;
+            }
+          pow5_len += s_limbs;
+        }
       pow5.limbs = pow5_ptr;
       pow5.nlimbs = pow5_len;
       if (n >= 0)
-       {
-         /* Multiply m with pow5.  No division needed.  */
-         z_memory = multiply (m, pow5, &z);
-       }
+        {
+          /* Multiply m with pow5.  No division needed.  */
+          z_memory = multiply (m, pow5, &z);
+        }
       else
-       {
-         /* Divide m by pow5 and round.  */
-         z_memory = divide (m, pow5, &z);
-       }
+        {
+          /* Divide m by pow5 and round.  */
+          z_memory = divide (m, pow5, &z);
+        }
     }
   else
     {
       pow5.limbs = pow5_ptr;
       pow5.nlimbs = pow5_len;
       if (n >= 0)
-       {
-         /* n >= 0, s < 0.
-            Multiply m with pow5, then divide by 2^|s|.  */
-         mpn_t numerator;
-         mpn_t denominator;
-         void *tmp_memory;
-         tmp_memory = multiply (m, pow5, &numerator);
-         if (tmp_memory == NULL)
-           {
-             free (pow5_ptr);
-             free (memory);
-             return NULL;
-           }
-         /* Construct 2^|s|.  */
-         {
-           mp_limb_t *ptr = pow5_ptr + pow5_len;
-           size_t i;
-           for (i = 0; i < s_limbs; i++)
-             ptr[i] = 0;
-           ptr[s_limbs] = (mp_limb_t) 1 << s_bits;
-           denominator.limbs = ptr;
-           denominator.nlimbs = s_limbs + 1;
-         }
-         z_memory = divide (numerator, denominator, &z);
-         free (tmp_memory);
-       }
+        {
+          /* n >= 0, s < 0.
+             Multiply m with pow5, then divide by 2^|s|.  */
+          mpn_t numerator;
+          mpn_t denominator;
+          void *tmp_memory;
+          tmp_memory = multiply (m, pow5, &numerator);
+          if (tmp_memory == NULL)
+            {
+              free (pow5_ptr);
+              free (memory);
+              return NULL;
+            }
+          /* Construct 2^|s|.  */
+          {
+            mp_limb_t *ptr = pow5_ptr + pow5_len;
+            size_t i;
+            for (i = 0; i < s_limbs; i++)
+              ptr[i] = 0;
+            ptr[s_limbs] = (mp_limb_t) 1 << s_bits;
+            denominator.limbs = ptr;
+            denominator.nlimbs = s_limbs + 1;
+          }
+          z_memory = divide (numerator, denominator, &z);
+          free (tmp_memory);
+        }
       else
-       {
-         /* n < 0, s > 0.
-            Multiply m with 2^s, then divide by pow5.  */
-         mpn_t numerator;
-         mp_limb_t *num_ptr;
-         num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1)
-                                         * sizeof (mp_limb_t));
-         if (num_ptr == NULL)
-           {
-             free (pow5_ptr);
-             free (memory);
-             return NULL;
-           }
-         {
-           mp_limb_t *destptr = num_ptr;
-           {
-             size_t i;
-             for (i = 0; i < s_limbs; i++)
-               *destptr++ = 0;
-           }
-           if (s_bits > 0)
-             {
-               const mp_limb_t *sourceptr = m.limbs;
-               mp_twolimb_t accu = 0;
-               size_t count;
-               for (count = m.nlimbs; count > 0; count--)
-                 {
-                   accu += (mp_twolimb_t) *sourceptr++ << s_bits;
-                   *destptr++ = (mp_limb_t) accu;
-                   accu = accu >> GMP_LIMB_BITS;
-                 }
-               if (accu > 0)
-                 *destptr++ = (mp_limb_t) accu;
-             }
-           else
-             {
-               const mp_limb_t *sourceptr = m.limbs;
-               size_t count;
-               for (count = m.nlimbs; count > 0; count--)
-                 *destptr++ = *sourceptr++;
-             }
-           numerator.limbs = num_ptr;
-           numerator.nlimbs = destptr - num_ptr;
-         }
-         z_memory = divide (numerator, pow5, &z);
-         free (num_ptr);
-       }
+        {
+          /* n < 0, s > 0.
+             Multiply m with 2^s, then divide by pow5.  */
+          mpn_t numerator;
+          mp_limb_t *num_ptr;
+          num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1)
+                                          * sizeof (mp_limb_t));
+          if (num_ptr == NULL)
+            {
+              free (pow5_ptr);
+              free (memory);
+              return NULL;
+            }
+          {
+            mp_limb_t *destptr = num_ptr;
+            {
+              size_t i;
+              for (i = 0; i < s_limbs; i++)
+                *destptr++ = 0;
+            }
+            if (s_bits > 0)
+              {
+                const mp_limb_t *sourceptr = m.limbs;
+                mp_twolimb_t accu = 0;
+                size_t count;
+                for (count = m.nlimbs; count > 0; count--)
+                  {
+                    accu += (mp_twolimb_t) *sourceptr++ << s_bits;
+                    *destptr++ = (mp_limb_t) accu;
+                    accu = accu >> GMP_LIMB_BITS;
+                  }
+                if (accu > 0)
+                  *destptr++ = (mp_limb_t) accu;
+              }
+            else
+              {
+                const mp_limb_t *sourceptr = m.limbs;
+                size_t count;
+                for (count = m.nlimbs; count > 0; count--)
+                  *destptr++ = *sourceptr++;
+              }
+            numerator.limbs = num_ptr;
+            numerator.nlimbs = destptr - num_ptr;
+          }
+          z_memory = divide (numerator, pow5, &z);
+          free (num_ptr);
+        }
     }
   free (pow5_ptr);
   free (memory);
@@ -1298,35 +1311,35 @@ floorlog10l (long double x)
   if (y < 0.5L)
     {
       while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
-       {
-         y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
-         exp -= GMP_LIMB_BITS;
-       }
+        {
+          y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
+          exp -= GMP_LIMB_BITS;
+        }
       if (y < (1.0L / (1 << 16)))
-       {
-         y *= 1.0L * (1 << 16);
-         exp -= 16;
-       }
+        {
+          y *= 1.0L * (1 << 16);
+          exp -= 16;
+        }
       if (y < (1.0L / (1 << 8)))
-       {
-         y *= 1.0L * (1 << 8);
-         exp -= 8;
-       }
+        {
+          y *= 1.0L * (1 << 8);
+          exp -= 8;
+        }
       if (y < (1.0L / (1 << 4)))
-       {
-         y *= 1.0L * (1 << 4);
-         exp -= 4;
-       }
+        {
+          y *= 1.0L * (1 << 4);
+          exp -= 4;
+        }
       if (y < (1.0L / (1 << 2)))
-       {
-         y *= 1.0L * (1 << 2);
-         exp -= 2;
-       }
+        {
+          y *= 1.0L * (1 << 2);
+          exp -= 2;
+        }
       if (y < (1.0L / (1 << 1)))
-       {
-         y *= 1.0L * (1 << 1);
-         exp -= 1;
-       }
+        {
+          y *= 1.0L * (1 << 1);
+          exp -= 1;
+        }
     }
   if (!(y >= 0.5L && y < 1.0L))
     abort ();
@@ -1389,35 +1402,35 @@ floorlog10 (double x)
   if (y < 0.5)
     {
       while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
-       {
-         y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
-         exp -= GMP_LIMB_BITS;
-       }
+        {
+          y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
+          exp -= GMP_LIMB_BITS;
+        }
       if (y < (1.0 / (1 << 16)))
-       {
-         y *= 1.0 * (1 << 16);
-         exp -= 16;
-       }
+        {
+          y *= 1.0 * (1 << 16);
+          exp -= 16;
+        }
       if (y < (1.0 / (1 << 8)))
-       {
-         y *= 1.0 * (1 << 8);
-         exp -= 8;
-       }
+        {
+          y *= 1.0 * (1 << 8);
+          exp -= 8;
+        }
       if (y < (1.0 / (1 << 4)))
-       {
-         y *= 1.0 * (1 << 4);
-         exp -= 4;
-       }
+        {
+          y *= 1.0 * (1 << 4);
+          exp -= 4;
+        }
       if (y < (1.0 / (1 << 2)))
-       {
-         y *= 1.0 * (1 << 2);
-         exp -= 2;
-       }
+        {
+          y *= 1.0 * (1 << 2);
+          exp -= 2;
+        }
       if (y < (1.0 / (1 << 1)))
-       {
-         y *= 1.0 * (1 << 1);
-         exp -= 1;
-       }
+        {
+          y *= 1.0 * (1 << 1);
+          exp -= 1;
+        }
     }
   if (!(y >= 0.5 && y < 1.0))
     abort ();
@@ -1474,9 +1487,261 @@ is_borderline (const char *digits, size_t precision)
 
 #endif
 
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99
+
+/* Use a different function name, to make it possible that the 'wchar_t'
+   parametrization and the 'char' parametrization get compiled in the same
+   translation unit.  */
+# if WIDE_CHAR_VERSION
+#  define MAX_ROOM_NEEDED wmax_room_needed
+# else
+#  define MAX_ROOM_NEEDED max_room_needed
+# endif
+
+/* Returns the number of TCHAR_T units needed as temporary space for the result
+   of sprintf or SNPRINTF of a single conversion directive.  */
+static inline size_t
+MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
+                 arg_type type, int flags, size_t width, int has_precision,
+                 size_t precision, int pad_ourselves)
+{
+  size_t tmp_length;
+
+  switch (conversion)
+    {
+    case 'd': case 'i': case 'u':
+# if HAVE_LONG_LONG_INT
+      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+                          * 0.30103 /* binary -> decimal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+# endif
+      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+                          * 0.30103 /* binary -> decimal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+        tmp_length =
+          (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+                          * 0.30103 /* binary -> decimal */
+                         )
+          + 1; /* turn floor into ceil */
+      if (tmp_length < precision)
+        tmp_length = precision;
+      /* Multiply by 2, as an estimate for FLAG_GROUP.  */
+      tmp_length = xsum (tmp_length, tmp_length);
+      /* Add 1, to account for a leading sign.  */
+      tmp_length = xsum (tmp_length, 1);
+      break;
+
+    case 'o':
+# if HAVE_LONG_LONG_INT
+      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+                          * 0.333334 /* binary -> octal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+# endif
+      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+                          * 0.333334 /* binary -> octal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+        tmp_length =
+          (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+                          * 0.333334 /* binary -> octal */
+                         )
+          + 1; /* turn floor into ceil */
+      if (tmp_length < precision)
+        tmp_length = precision;
+      /* Add 1, to account for a leading sign.  */
+      tmp_length = xsum (tmp_length, 1);
+      break;
+
+    case 'x': case 'X':
+# if HAVE_LONG_LONG_INT
+      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+                          * 0.25 /* binary -> hexadecimal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+# endif
+      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+                          * 0.25 /* binary -> hexadecimal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+        tmp_length =
+          (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+                          * 0.25 /* binary -> hexadecimal */
+                         )
+          + 1; /* turn floor into ceil */
+      if (tmp_length < precision)
+        tmp_length = precision;
+      /* Add 2, to account for a leading sign or alternate form.  */
+      tmp_length = xsum (tmp_length, 2);
+      break;
+
+    case 'f': case 'F':
+      if (type == TYPE_LONGDOUBLE)
+        tmp_length =
+          (unsigned int) (LDBL_MAX_EXP
+                          * 0.30103 /* binary -> decimal */
+                          * 2 /* estimate for FLAG_GROUP */
+                         )
+          + 1 /* turn floor into ceil */
+          + 10; /* sign, decimal point etc. */
+      else
+        tmp_length =
+          (unsigned int) (DBL_MAX_EXP
+                          * 0.30103 /* binary -> decimal */
+                          * 2 /* estimate for FLAG_GROUP */
+                         )
+          + 1 /* turn floor into ceil */
+          + 10; /* sign, decimal point etc. */
+      tmp_length = xsum (tmp_length, precision);
+      break;
+
+    case 'e': case 'E': case 'g': case 'G':
+      tmp_length =
+        12; /* sign, decimal point, exponent etc. */
+      tmp_length = xsum (tmp_length, precision);
+      break;
+
+    case 'a': case 'A':
+      if (type == TYPE_LONGDOUBLE)
+        tmp_length =
+          (unsigned int) (LDBL_DIG
+                          * 0.831 /* decimal -> hexadecimal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+        tmp_length =
+          (unsigned int) (DBL_DIG
+                          * 0.831 /* decimal -> hexadecimal */
+                         )
+          + 1; /* turn floor into ceil */
+      if (tmp_length < precision)
+        tmp_length = precision;
+      /* Account for sign, decimal point etc. */
+      tmp_length = xsum (tmp_length, 12);
+      break;
+
+    case 'c':
+# if HAVE_WINT_T && !WIDE_CHAR_VERSION
+      if (type == TYPE_WIDE_CHAR)
+        tmp_length = MB_CUR_MAX;
+      else
+# endif
+        tmp_length = 1;
+      break;
+
+    case 's':
+# if HAVE_WCHAR_T
+      if (type == TYPE_WIDE_STRING)
+        {
+#  if WIDE_CHAR_VERSION
+          /* ISO C says about %ls in fwprintf:
+               "If the precision is not specified or is greater than the size
+                of the array, the array shall contain a null wide character."
+             So if there is a precision, we must not use wcslen.  */
+          const wchar_t *arg = ap->arg[arg_index].a.a_wide_string;
+
+          if (has_precision)
+            tmp_length = local_wcsnlen (arg, precision);
+          else
+            tmp_length = local_wcslen (arg);
+#  else
+          /* ISO C says about %ls in fprintf:
+               "If a precision is specified, no more than that many bytes are
+                written (including shift sequences, if any), and the array
+                shall contain a null wide character if, to equal the multibyte
+                character sequence length given by the precision, the function
+                would need to access a wide character one past the end of the
+                array."
+             So if there is a precision, we must not use wcslen.  */
+          /* This case has already been handled separately in VASNPRINTF.  */
+          abort ();
+#  endif
+        }
+      else
+# endif
+        {
+# if WIDE_CHAR_VERSION
+          /* ISO C says about %s in fwprintf:
+               "If the precision is not specified or is greater than the size
+                of the converted array, the converted array shall contain a
+                null wide character."
+             So if there is a precision, we must not use strlen.  */
+          /* This case has already been handled separately in VASNPRINTF.  */
+          abort ();
+# else
+          /* ISO C says about %s in fprintf:
+               "If the precision is not specified or greater than the size of
+                the array, the array shall contain a null character."
+             So if there is a precision, we must not use strlen.  */
+          const char *arg = ap->arg[arg_index].a.a_string;
+
+          if (has_precision)
+            tmp_length = local_strnlen (arg, precision);
+          else
+            tmp_length = strlen (arg);
+# endif
+        }
+      break;
+
+    case 'p':
+      tmp_length =
+        (unsigned int) (sizeof (void *) * CHAR_BIT
+                        * 0.25 /* binary -> hexadecimal */
+                       )
+          + 1 /* turn floor into ceil */
+          + 2; /* account for leading 0x */
+      break;
+
+    default:
+      abort ();
+    }
+
+  if (!pad_ourselves)
+    {
+# if ENABLE_UNISTDIO
+      /* Padding considers the number of characters, therefore the number of
+         elements after padding may be
+           > max (tmp_length, width)
+         but is certainly
+           <= tmp_length + width.  */
+      tmp_length = xsum (tmp_length, width);
+# else
+      /* Padding considers the number of elements, says POSIX.  */
+      if (tmp_length < width)
+        tmp_length = width;
+# endif
+    }
+
+  tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+  return tmp_length;
+}
+
+#endif
+
 DCHAR_T *
 VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
-           const FCHAR_T *format, va_list args)
+            const FCHAR_T *format, va_list args)
 {
   DIRECTIVES d;
   arguments a;
@@ -1486,8 +1751,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
     return NULL;
 
 #define CLEANUP() \
-  free (d.dir);                                                                \
-  if (a.arg)                                                           \
+  free (d.dir);                                                         \
+  if (a.arg)                                                            \
     free (a.arg);
 
   if (PRINTF_FETCHARGS (args, &a) < 0)
@@ -1516,30 +1781,30 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #if HAVE_ALLOCA
     if (buf_neededlength < 4000 / sizeof (TCHAR_T))
       {
-       buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T));
-       buf_malloced = NULL;
+        buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T));
+        buf_malloced = NULL;
       }
     else
 #endif
       {
-       size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T));
-       if (size_overflow_p (buf_memsize))
-         goto out_of_memory_1;
-       buf = (TCHAR_T *) malloc (buf_memsize);
-       if (buf == NULL)
-         goto out_of_memory_1;
-       buf_malloced = buf;
+        size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T));
+        if (size_overflow_p (buf_memsize))
+          goto out_of_memory_1;
+        buf = (TCHAR_T *) malloc (buf_memsize);
+        if (buf == NULL)
+          goto out_of_memory_1;
+        buf_malloced = buf;
       }
 
     if (resultbuf != NULL)
       {
-       result = resultbuf;
-       allocated = *lengthp;
+        result = resultbuf;
+        allocated = *lengthp;
       }
     else
       {
-       result = NULL;
-       allocated = 0;
+        result = NULL;
+        allocated = 0;
       }
     length = 0;
     /* Invariants:
@@ -1549,3883 +1814,3694 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
     /* Ensures that allocated >= needed.  Aborts through a jump to
        out_of_memory if needed is SIZE_MAX or otherwise too big.  */
 #define ENSURE_ALLOCATION(needed) \
-    if ((needed) > allocated)                                               \
-      {                                                                             \
-       size_t memory_size;                                                  \
-       DCHAR_T *memory;                                                     \
-                                                                            \
-       allocated = (allocated > 0 ? xtimes (allocated, 2) : 12);            \
-       if ((needed) > allocated)                                            \
-         allocated = (needed);                                              \
-       memory_size = xtimes (allocated, sizeof (DCHAR_T));                  \
-       if (size_overflow_p (memory_size))                                   \
-         goto out_of_memory;                                                \
-       if (result == resultbuf || result == NULL)                           \
-         memory = (DCHAR_T *) malloc (memory_size);                         \
-       else                                                                 \
-         memory = (DCHAR_T *) realloc (result, memory_size);                \
-       if (memory == NULL)                                                  \
-         goto out_of_memory;                                                \
-       if (result == resultbuf && length > 0)                               \
-         DCHAR_CPY (memory, result, length);                                \
-       result = memory;                                                     \
+    if ((needed) > allocated)                                                \
+      {                                                                      \
+        size_t memory_size;                                                  \
+        DCHAR_T *memory;                                                     \
+                                                                             \
+        allocated = (allocated > 0 ? xtimes (allocated, 2) : 12);            \
+        if ((needed) > allocated)                                            \
+          allocated = (needed);                                              \
+        memory_size = xtimes (allocated, sizeof (DCHAR_T));                  \
+        if (size_overflow_p (memory_size))                                   \
+          goto out_of_memory;                                                \
+        if (result == resultbuf || result == NULL)                           \
+          memory = (DCHAR_T *) malloc (memory_size);                         \
+        else                                                                 \
+          memory = (DCHAR_T *) realloc (result, memory_size);                \
+        if (memory == NULL)                                                  \
+          goto out_of_memory;                                                \
+        if (result == resultbuf && length > 0)                               \
+          DCHAR_CPY (memory, result, length);                                \
+        result = memory;                                                     \
       }
 
     for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
       {
-       if (cp != dp->dir_start)
-         {
-           size_t n = dp->dir_start - cp;
-           size_t augmented_length = xsum (length, n);
-
-           ENSURE_ALLOCATION (augmented_length);
-           /* This copies a piece of FCHAR_T[] into a DCHAR_T[].  Here we
-              need that the format string contains only ASCII characters
-              if FCHAR_T and DCHAR_T are not the same type.  */
-           if (sizeof (FCHAR_T) == sizeof (DCHAR_T))
-             {
-               DCHAR_CPY (result + length, (const DCHAR_T *) cp, n);
-               length = augmented_length;
-             }
-           else
-             {
-               do
-                 result[length++] = (unsigned char) *cp++;
-               while (--n > 0);
-             }
-         }
-       if (i == d.count)
-         break;
-
-       /* Execute a single directive.  */
-       if (dp->conversion == '%')
-         {
-           size_t augmented_length;
-
-           if (!(dp->arg_index == ARG_NONE))
-             abort ();
-           augmented_length = xsum (length, 1);
-           ENSURE_ALLOCATION (augmented_length);
-           result[length] = '%';
-           length = augmented_length;
-         }
-       else
-         {
-           if (!(dp->arg_index != ARG_NONE))
-             abort ();
-
-           if (dp->conversion == 'n')
-             {
-               switch (a.arg[dp->arg_index].type)
-                 {
-                 case TYPE_COUNT_SCHAR_POINTER:
-                   *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
-                   break;
-                 case TYPE_COUNT_SHORT_POINTER:
-                   *a.arg[dp->arg_index].a.a_count_short_pointer = length;
-                   break;
-                 case TYPE_COUNT_INT_POINTER:
-                   *a.arg[dp->arg_index].a.a_count_int_pointer = length;
-                   break;
-                 case TYPE_COUNT_LONGINT_POINTER:
-                   *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
-                   break;
+        if (cp != dp->dir_start)
+          {
+            size_t n = dp->dir_start - cp;
+            size_t augmented_length = xsum (length, n);
+
+            ENSURE_ALLOCATION (augmented_length);
+            /* This copies a piece of FCHAR_T[] into a DCHAR_T[].  Here we
+               need that the format string contains only ASCII characters
+               if FCHAR_T and DCHAR_T are not the same type.  */
+            if (sizeof (FCHAR_T) == sizeof (DCHAR_T))
+              {
+                DCHAR_CPY (result + length, (const DCHAR_T *) cp, n);
+                length = augmented_length;
+              }
+            else
+              {
+                do
+                  result[length++] = (unsigned char) *cp++;
+                while (--n > 0);
+              }
+          }
+        if (i == d.count)
+          break;
+
+        /* Execute a single directive.  */
+        if (dp->conversion == '%')
+          {
+            size_t augmented_length;
+
+            if (!(dp->arg_index == ARG_NONE))
+              abort ();
+            augmented_length = xsum (length, 1);
+            ENSURE_ALLOCATION (augmented_length);
+            result[length] = '%';
+            length = augmented_length;
+          }
+        else
+          {
+            if (!(dp->arg_index != ARG_NONE))
+              abort ();
+
+            if (dp->conversion == 'n')
+              {
+                switch (a.arg[dp->arg_index].type)
+                  {
+                  case TYPE_COUNT_SCHAR_POINTER:
+                    *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
+                    break;
+                  case TYPE_COUNT_SHORT_POINTER:
+                    *a.arg[dp->arg_index].a.a_count_short_pointer = length;
+                    break;
+                  case TYPE_COUNT_INT_POINTER:
+                    *a.arg[dp->arg_index].a.a_count_int_pointer = length;
+                    break;
+                  case TYPE_COUNT_LONGINT_POINTER:
+                    *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
+                    break;
 #if HAVE_LONG_LONG_INT
-                 case TYPE_COUNT_LONGLONGINT_POINTER:
-                   *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
-                   break;
+                  case TYPE_COUNT_LONGLONGINT_POINTER:
+                    *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
+                    break;
 #endif
-                 default:
-                   abort ();
-                 }
-             }
+                  default:
+                    abort ();
+                  }
+              }
 #if ENABLE_UNISTDIO
-           /* The unistdio extensions.  */
-           else if (dp->conversion == 'U')
-             {
-               arg_type type = a.arg[dp->arg_index].type;
-               int flags = dp->flags;
-               int has_width;
-               size_t width;
-               int has_precision;
-               size_t precision;
-
-               has_width = 0;
-               width = 0;
-               if (dp->width_start != dp->width_end)
-                 {
-                   if (dp->width_arg_index != ARG_NONE)
-                     {
-                       int arg;
-
-                       if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
-                         abort ();
-                       arg = a.arg[dp->width_arg_index].a.a_int;
-                       if (arg < 0)
-                         {
-                           /* "A negative field width is taken as a '-' flag
-                               followed by a positive field width."  */
-                           flags |= FLAG_LEFT;
-                           width = (unsigned int) (-arg);
-                         }
-                       else
-                         width = arg;
-                     }
-                   else
-                     {
-                       const FCHAR_T *digitp = dp->width_start;
-
-                       do
-                         width = xsum (xtimes (width, 10), *digitp++ - '0');
-                       while (digitp != dp->width_end);
-                     }
-                   has_width = 1;
-                 }
-
-               has_precision = 0;
-               precision = 0;
-               if (dp->precision_start != dp->precision_end)
-                 {
-                   if (dp->precision_arg_index != ARG_NONE)
-                     {
-                       int arg;
-
-                       if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
-                         abort ();
-                       arg = a.arg[dp->precision_arg_index].a.a_int;
-                       /* "A negative precision is taken as if the precision
-                           were omitted."  */
-                       if (arg >= 0)
-                         {
-                           precision = arg;
-                           has_precision = 1;
-                         }
-                     }
-                   else
-                     {
-                       const FCHAR_T *digitp = dp->precision_start + 1;
-
-                       precision = 0;
-                       while (digitp != dp->precision_end)
-                         precision = xsum (xtimes (precision, 10), *digitp++ - '0');
-                       has_precision = 1;
-                     }
-                 }
-
-               switch (type)
-                 {
-                 case TYPE_U8_STRING:
-                   {
-                     const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string;
-                     const uint8_t *arg_end;
-                     size_t characters;
-
-                     if (has_precision)
-                       {
-                         /* Use only PRECISION characters, from the left.  */
-                         arg_end = arg;
-                         characters = 0;
-                         for (; precision > 0; precision--)
-                           {
-                             int count = u8_strmblen (arg_end);
-                             if (count == 0)
-                               break;
-                             if (count < 0)
-                               {
-                                 if (!(result == resultbuf || result == NULL))
-                                   free (result);
-                                 if (buf_malloced != NULL)
-                                   free (buf_malloced);
-                                 CLEANUP ();
-                                 errno = EILSEQ;
-                                 return NULL;
-                               }
-                             arg_end += count;
-                             characters++;
-                           }
-                       }
-                     else if (has_width)
-                       {
-                         /* Use the entire string, and count the number of
-                            characters.  */
-                         arg_end = arg;
-                         characters = 0;
-                         for (;;)
-                           {
-                             int count = u8_strmblen (arg_end);
-                             if (count == 0)
-                               break;
-                             if (count < 0)
-                               {
-                                 if (!(result == resultbuf || result == NULL))
-                                   free (result);
-                                 if (buf_malloced != NULL)
-                                   free (buf_malloced);
-                                 CLEANUP ();
-                                 errno = EILSEQ;
-                                 return NULL;
-                               }
-                             arg_end += count;
-                             characters++;
-                           }
-                       }
-                     else
-                       {
-                         /* Use the entire string.  */
-                         arg_end = arg + u8_strlen (arg);
-                         /* The number of characters doesn't matter.  */
-                         characters = 0;
-                       }
-
-                     if (has_width && width > characters
-                         && !(dp->flags & FLAG_LEFT))
-                       {
-                         size_t n = width - characters;
-                         ENSURE_ALLOCATION (xsum (length, n));
-                         DCHAR_SET (result + length, ' ', n);
-                         length += n;
-                       }
+            /* The unistdio extensions.  */
+            else if (dp->conversion == 'U')
+              {
+                arg_type type = a.arg[dp->arg_index].type;
+                int flags = dp->flags;
+                int has_width;
+                size_t width;
+                int has_precision;
+                size_t precision;
+
+                has_width = 0;
+                width = 0;
+                if (dp->width_start != dp->width_end)
+                  {
+                    if (dp->width_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->width_arg_index].a.a_int;
+                        if (arg < 0)
+                          {
+                            /* "A negative field width is taken as a '-' flag
+                                followed by a positive field width."  */
+                            flags |= FLAG_LEFT;
+                            width = (unsigned int) (-arg);
+                          }
+                        else
+                          width = arg;
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->width_start;
+
+                        do
+                          width = xsum (xtimes (width, 10), *digitp++ - '0');
+                        while (digitp != dp->width_end);
+                      }
+                    has_width = 1;
+                  }
+
+                has_precision = 0;
+                precision = 0;
+                if (dp->precision_start != dp->precision_end)
+                  {
+                    if (dp->precision_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->precision_arg_index].a.a_int;
+                        /* "A negative precision is taken as if the precision
+                            were omitted."  */
+                        if (arg >= 0)
+                          {
+                            precision = arg;
+                            has_precision = 1;
+                          }
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->precision_start + 1;
+
+                        precision = 0;
+                        while (digitp != dp->precision_end)
+                          precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+                        has_precision = 1;
+                      }
+                  }
+
+                switch (type)
+                  {
+                  case TYPE_U8_STRING:
+                    {
+                      const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string;
+                      const uint8_t *arg_end;
+                      size_t characters;
+
+                      if (has_precision)
+                        {
+                          /* Use only PRECISION characters, from the left.  */
+                          arg_end = arg;
+                          characters = 0;
+                          for (; precision > 0; precision--)
+                            {
+                              int count = u8_strmblen (arg_end);
+                              if (count == 0)
+                                break;
+                              if (count < 0)
+                                {
+                                  if (!(result == resultbuf || result == NULL))
+                                    free (result);
+                                  if (buf_malloced != NULL)
+                                    free (buf_malloced);
+                                  CLEANUP ();
+                                  errno = EILSEQ;
+                                  return NULL;
+                                }
+                              arg_end += count;
+                              characters++;
+                            }
+                        }
+                      else if (has_width)
+                        {
+                          /* Use the entire string, and count the number of
+                             characters.  */
+                          arg_end = arg;
+                          characters = 0;
+                          for (;;)
+                            {
+                              int count = u8_strmblen (arg_end);
+                              if (count == 0)
+                                break;
+                              if (count < 0)
+                                {
+                                  if (!(result == resultbuf || result == NULL))
+                                    free (result);
+                                  if (buf_malloced != NULL)
+                                    free (buf_malloced);
+                                  CLEANUP ();
+                                  errno = EILSEQ;
+                                  return NULL;
+                                }
+                              arg_end += count;
+                              characters++;
+                            }
+                        }
+                      else
+                        {
+                          /* Use the entire string.  */
+                          arg_end = arg + u8_strlen (arg);
+                          /* The number of characters doesn't matter.  */
+                          characters = 0;
+                        }
+
+                      if (has_width && width > characters
+                          && !(dp->flags & FLAG_LEFT))
+                        {
+                          size_t n = width - characters;
+                          ENSURE_ALLOCATION (xsum (length, n));
+                          DCHAR_SET (result + length, ' ', n);
+                          length += n;
+                        }
 
 # if DCHAR_IS_UINT8_T
-                     {
-                       size_t n = arg_end - arg;
-                       ENSURE_ALLOCATION (xsum (length, n));
-                       DCHAR_CPY (result + length, arg, n);
-                       length += n;
-                     }
+                      {
+                        size_t n = arg_end - arg;
+                        ENSURE_ALLOCATION (xsum (length, n));
+                        DCHAR_CPY (result + length, arg, n);
+                        length += n;
+                      }
 # else
-                     { /* Convert.  */
-                       DCHAR_T *converted = result + length;
-                       size_t converted_len = allocated - length;
+                      { /* Convert.  */
+                        DCHAR_T *converted = result + length;
+                        size_t converted_len = allocated - length;
 #  if DCHAR_IS_TCHAR
-                       /* Convert from UTF-8 to locale encoding.  */
-                       if (u8_conv_to_encoding (locale_charset (),
-                                                iconveh_question_mark,
-                                                arg, arg_end - arg, NULL,
-                                                &converted, &converted_len)
-                           < 0)
+                        /* Convert from UTF-8 to locale encoding.  */
+                        converted =
+                          u8_conv_to_encoding (locale_charset (),
+                                               iconveh_question_mark,
+                                               arg, arg_end - arg, NULL,
+                                               converted, &converted_len);
 #  else
-                       /* Convert from UTF-8 to UTF-16/UTF-32.  */
-                       converted =
-                         U8_TO_DCHAR (arg, arg_end - arg,
-                                      converted, &converted_len);
-                       if (converted == NULL)
+                        /* Convert from UTF-8 to UTF-16/UTF-32.  */
+                        converted =
+                          U8_TO_DCHAR (arg, arg_end - arg,
+                                       converted, &converted_len);
 #  endif
-                         {
-                           int saved_errno = errno;
-                           if (!(result == resultbuf || result == NULL))
-                             free (result);
-                           if (buf_malloced != NULL)
-                             free (buf_malloced);
-                           CLEANUP ();
-                           errno = saved_errno;
-                           return NULL;
-                         }
-                       if (converted != result + length)
-                         {
-                           ENSURE_ALLOCATION (xsum (length, converted_len));
-                           DCHAR_CPY (result + length, converted, converted_len);
-                           free (converted);
-                         }
-                       length += converted_len;
-                     }
+                        if (converted == NULL)
+                          {
+                            int saved_errno = errno;
+                            if (!(result == resultbuf || result == NULL))
+                              free (result);
+                            if (buf_malloced != NULL)
+                              free (buf_malloced);
+                            CLEANUP ();
+                            errno = saved_errno;
+                            return NULL;
+                          }
+                        if (converted != result + length)
+                          {
+                            ENSURE_ALLOCATION (xsum (length, converted_len));
+                            DCHAR_CPY (result + length, converted, converted_len);
+                            free (converted);
+                          }
+                        length += converted_len;
+                      }
 # endif
 
-                     if (has_width && width > characters
-                         && (dp->flags & FLAG_LEFT))
-                       {
-                         size_t n = width - characters;
-                         ENSURE_ALLOCATION (xsum (length, n));
-                         DCHAR_SET (result + length, ' ', n);
-                         length += n;
-                       }
-                   }
-                   break;
-
-                 case TYPE_U16_STRING:
-                   {
-                     const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string;
-                     const uint16_t *arg_end;
-                     size_t characters;
-
-                     if (has_precision)
-                       {
-                         /* Use only PRECISION characters, from the left.  */
-                         arg_end = arg;
-                         characters = 0;
-                         for (; precision > 0; precision--)
-                           {
-                             int count = u16_strmblen (arg_end);
-                             if (count == 0)
-                               break;
-                             if (count < 0)
-                               {
-                                 if (!(result == resultbuf || result == NULL))
-                                   free (result);
-                                 if (buf_malloced != NULL)
-                                   free (buf_malloced);
-                                 CLEANUP ();
-                                 errno = EILSEQ;
-                                 return NULL;
-                               }
-                             arg_end += count;
-                             characters++;
-                           }
-                       }
-                     else if (has_width)
-                       {
-                         /* Use the entire string, and count the number of
-                            characters.  */
-                         arg_end = arg;
-                         characters = 0;
-                         for (;;)
-                           {
-                             int count = u16_strmblen (arg_end);
-                             if (count == 0)
-                               break;
-                             if (count < 0)
-                               {
-                                 if (!(result == resultbuf || result == NULL))
-                                   free (result);
-                                 if (buf_malloced != NULL)
-                                   free (buf_malloced);
-                                 CLEANUP ();
-                                 errno = EILSEQ;
-                                 return NULL;
-                               }
-                             arg_end += count;
-                             characters++;
-                           }
-                       }
-                     else
-                       {
-                         /* Use the entire string.  */
-                         arg_end = arg + u16_strlen (arg);
-                         /* The number of characters doesn't matter.  */
-                         characters = 0;
-                       }
-
-                     if (has_width && width > characters
-                         && !(dp->flags & FLAG_LEFT))
-                       {
-                         size_t n = width - characters;
-                         ENSURE_ALLOCATION (xsum (length, n));
-                         DCHAR_SET (result + length, ' ', n);
-                         length += n;
-                       }
+                      if (has_width && width > characters
+                          && (dp->flags & FLAG_LEFT))
+                        {
+                          size_t n = width - characters;
+                          ENSURE_ALLOCATION (xsum (length, n));
+                          DCHAR_SET (result + length, ' ', n);
+                          length += n;
+                        }
+                    }
+                    break;
+
+                  case TYPE_U16_STRING:
+                    {
+                      const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string;
+                      const uint16_t *arg_end;
+                      size_t characters;
+
+                      if (has_precision)
+                        {
+                          /* Use only PRECISION characters, from the left.  */
+                          arg_end = arg;
+                          characters = 0;
+                          for (; precision > 0; precision--)
+                            {
+                              int count = u16_strmblen (arg_end);
+                              if (count == 0)
+                                break;
+                              if (count < 0)
+                                {
+                                  if (!(result == resultbuf || result == NULL))
+                                    free (result);
+                                  if (buf_malloced != NULL)
+                                    free (buf_malloced);
+                                  CLEANUP ();
+                                  errno = EILSEQ;
+                                  return NULL;
+                                }
+                              arg_end += count;
+                              characters++;
+                            }
+                        }
+                      else if (has_width)
+                        {
+                          /* Use the entire string, and count the number of
+                             characters.  */
+                          arg_end = arg;
+                          characters = 0;
+                          for (;;)
+                            {
+                              int count = u16_strmblen (arg_end);
+                              if (count == 0)
+                                break;
+                              if (count < 0)
+                                {
+                                  if (!(result == resultbuf || result == NULL))
+                                    free (result);
+                                  if (buf_malloced != NULL)
+                                    free (buf_malloced);
+                                  CLEANUP ();
+                                  errno = EILSEQ;
+                                  return NULL;
+                                }
+                              arg_end += count;
+                              characters++;
+                            }
+                        }
+                      else
+                        {
+                          /* Use the entire string.  */
+                          arg_end = arg + u16_strlen (arg);
+                          /* The number of characters doesn't matter.  */
+                          characters = 0;
+                        }
+
+                      if (has_width && width > characters
+                          && !(dp->flags & FLAG_LEFT))
+                        {
+                          size_t n = width - characters;
+                          ENSURE_ALLOCATION (xsum (length, n));
+                          DCHAR_SET (result + length, ' ', n);
+                          length += n;
+                        }
 
 # if DCHAR_IS_UINT16_T
-                     {
-                       size_t n = arg_end - arg;
-                       ENSURE_ALLOCATION (xsum (length, n));
-                       DCHAR_CPY (result + length, arg, n);
-                       length += n;
-                     }
+                      {
+                        size_t n = arg_end - arg;
+                        ENSURE_ALLOCATION (xsum (length, n));
+                        DCHAR_CPY (result + length, arg, n);
+                        length += n;
+                      }
 # else
-                     { /* Convert.  */
-                       DCHAR_T *converted = result + length;
-                       size_t converted_len = allocated - length;
+                      { /* Convert.  */
+                        DCHAR_T *converted = result + length;
+                        size_t converted_len = allocated - length;
 #  if DCHAR_IS_TCHAR
-                       /* Convert from UTF-16 to locale encoding.  */
-                       if (u16_conv_to_encoding (locale_charset (),
-                                                 iconveh_question_mark,
-                                                 arg, arg_end - arg, NULL,
-                                                 &converted, &converted_len)
-                           < 0)
+                        /* Convert from UTF-16 to locale encoding.  */
+                        converted =
+                          u16_conv_to_encoding (locale_charset (),
+                                                iconveh_question_mark,
+                                                arg, arg_end - arg, NULL,
+                                                converted, &converted_len);
 #  else
-                       /* Convert from UTF-16 to UTF-8/UTF-32.  */
-                       converted =
-                         U16_TO_DCHAR (arg, arg_end - arg,
-                                       converted, &converted_len);
-                       if (converted == NULL)
+                        /* Convert from UTF-16 to UTF-8/UTF-32.  */
+                        converted =
+                          U16_TO_DCHAR (arg, arg_end - arg,
+                                        converted, &converted_len);
 #  endif
-                         {
-                           int saved_errno = errno;
-                           if (!(result == resultbuf || result == NULL))
-                             free (result);
-                           if (buf_malloced != NULL)
-                             free (buf_malloced);
-                           CLEANUP ();
-                           errno = saved_errno;
-                           return NULL;
-                         }
-                       if (converted != result + length)
-                         {
-                           ENSURE_ALLOCATION (xsum (length, converted_len));
-                           DCHAR_CPY (result + length, converted, converted_len);
-                           free (converted);
-                         }
-                       length += converted_len;
-                     }
+                        if (converted == NULL)
+                          {
+                            int saved_errno = errno;
+                            if (!(result == resultbuf || result == NULL))
+                              free (result);
+                            if (buf_malloced != NULL)
+                              free (buf_malloced);
+                            CLEANUP ();
+                            errno = saved_errno;
+                            return NULL;
+                          }
+                        if (converted != result + length)
+                          {
+                            ENSURE_ALLOCATION (xsum (length, converted_len));
+                            DCHAR_CPY (result + length, converted, converted_len);
+                            free (converted);
+                          }
+                        length += converted_len;
+                      }
 # endif
 
-                     if (has_width && width > characters
-                         && (dp->flags & FLAG_LEFT))
-                       {
-                         size_t n = width - characters;
-                         ENSURE_ALLOCATION (xsum (length, n));
-                         DCHAR_SET (result + length, ' ', n);
-                         length += n;
-                       }
-                   }
-                   break;
-
-                 case TYPE_U32_STRING:
-                   {
-                     const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string;
-                     const uint32_t *arg_end;
-                     size_t characters;
-
-                     if (has_precision)
-                       {
-                         /* Use only PRECISION characters, from the left.  */
-                         arg_end = arg;
-                         characters = 0;
-                         for (; precision > 0; precision--)
-                           {
-                             int count = u32_strmblen (arg_end);
-                             if (count == 0)
-                               break;
-                             if (count < 0)
-                               {
-                                 if (!(result == resultbuf || result == NULL))
-                                   free (result);
-                                 if (buf_malloced != NULL)
-                                   free (buf_malloced);
-                                 CLEANUP ();
-                                 errno = EILSEQ;
-                                 return NULL;
-                               }
-                             arg_end += count;
-                             characters++;
-                           }
-                       }
-                     else if (has_width)
-                       {
-                         /* Use the entire string, and count the number of
-                            characters.  */
-                         arg_end = arg;
-                         characters = 0;
-                         for (;;)
-                           {
-                             int count = u32_strmblen (arg_end);
-                             if (count == 0)
-                               break;
-                             if (count < 0)
-                               {
-                                 if (!(result == resultbuf || result == NULL))
-                                   free (result);
-                                 if (buf_malloced != NULL)
-                                   free (buf_malloced);
-                                 CLEANUP ();
-                                 errno = EILSEQ;
-                                 return NULL;
-                               }
-                             arg_end += count;
-                             characters++;
-                           }
-                       }
-                     else
-                       {
-                         /* Use the entire string.  */
-                         arg_end = arg + u32_strlen (arg);
-                         /* The number of characters doesn't matter.  */
-                         characters = 0;
-                       }
-
-                     if (has_width && width > characters
-                         && !(dp->flags & FLAG_LEFT))
-                       {
-                         size_t n = width - characters;
-                         ENSURE_ALLOCATION (xsum (length, n));
-                         DCHAR_SET (result + length, ' ', n);
-                         length += n;
-                       }
+                      if (has_width && width > characters
+                          && (dp->flags & FLAG_LEFT))
+                        {
+                          size_t n = width - characters;
+                          ENSURE_ALLOCATION (xsum (length, n));
+                          DCHAR_SET (result + length, ' ', n);
+                          length += n;
+                        }
+                    }
+                    break;
+
+                  case TYPE_U32_STRING:
+                    {
+                      const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string;
+                      const uint32_t *arg_end;
+                      size_t characters;
+
+                      if (has_precision)
+                        {
+                          /* Use only PRECISION characters, from the left.  */
+                          arg_end = arg;
+                          characters = 0;
+                          for (; precision > 0; precision--)
+                            {
+                              int count = u32_strmblen (arg_end);
+                              if (count == 0)
+                                break;
+                              if (count < 0)
+                                {
+                                  if (!(result == resultbuf || result == NULL))
+                                    free (result);
+                                  if (buf_malloced != NULL)
+                                    free (buf_malloced);
+                                  CLEANUP ();
+                                  errno = EILSEQ;
+                                  return NULL;
+                                }
+                              arg_end += count;
+                              characters++;
+                            }
+                        }
+                      else if (has_width)
+                        {
+                          /* Use the entire string, and count the number of
+                             characters.  */
+                          arg_end = arg;
+                          characters = 0;
+                          for (;;)
+                            {
+                              int count = u32_strmblen (arg_end);
+                              if (count == 0)
+                                break;
+                              if (count < 0)
+                                {
+                                  if (!(result == resultbuf || result == NULL))
+                                    free (result);
+                                  if (buf_malloced != NULL)
+                                    free (buf_malloced);
+                                  CLEANUP ();
+                                  errno = EILSEQ;
+                                  return NULL;
+                                }
+                              arg_end += count;
+                              characters++;
+                            }
+                        }
+                      else
+                        {
+                          /* Use the entire string.  */
+                          arg_end = arg + u32_strlen (arg);
+                          /* The number of characters doesn't matter.  */
+                          characters = 0;
+                        }
+
+                      if (has_width && width > characters
+                          && !(dp->flags & FLAG_LEFT))
+                        {
+                          size_t n = width - characters;
+                          ENSURE_ALLOCATION (xsum (length, n));
+                          DCHAR_SET (result + length, ' ', n);
+                          length += n;
+                        }
 
 # if DCHAR_IS_UINT32_T
-                     {
-                       size_t n = arg_end - arg;
-                       ENSURE_ALLOCATION (xsum (length, n));
-                       DCHAR_CPY (result + length, arg, n);
-                       length += n;
-                     }
+                      {
+                        size_t n = arg_end - arg;
+                        ENSURE_ALLOCATION (xsum (length, n));
+                        DCHAR_CPY (result + length, arg, n);
+                        length += n;
+                      }
 # else
-                     { /* Convert.  */
-                       DCHAR_T *converted = result + length;
-                       size_t converted_len = allocated - length;
+                      { /* Convert.  */
+                        DCHAR_T *converted = result + length;
+                        size_t converted_len = allocated - length;
 #  if DCHAR_IS_TCHAR
-                       /* Convert from UTF-32 to locale encoding.  */
-                       if (u32_conv_to_encoding (locale_charset (),
-                                                 iconveh_question_mark,
-                                                 arg, arg_end - arg, NULL,
-                                                 &converted, &converted_len)
-                           < 0)
+                        /* Convert from UTF-32 to locale encoding.  */
+                        converted =
+                          u32_conv_to_encoding (locale_charset (),
+                                                iconveh_question_mark,
+                                                arg, arg_end - arg, NULL,
+                                                converted, &converted_len);
 #  else
-                       /* Convert from UTF-32 to UTF-8/UTF-16.  */
-                       converted =
-                         U32_TO_DCHAR (arg, arg_end - arg,
-                                       converted, &converted_len);
-                       if (converted == NULL)
+                        /* Convert from UTF-32 to UTF-8/UTF-16.  */
+                        converted =
+                          U32_TO_DCHAR (arg, arg_end - arg,
+                                        converted, &converted_len);
 #  endif
-                         {
-                           int saved_errno = errno;
-                           if (!(result == resultbuf || result == NULL))
-                             free (result);
-                           if (buf_malloced != NULL)
-                             free (buf_malloced);
-                           CLEANUP ();
-                           errno = saved_errno;
-                           return NULL;
-                         }
-                       if (converted != result + length)
-                         {
-                           ENSURE_ALLOCATION (xsum (length, converted_len));
-                           DCHAR_CPY (result + length, converted, converted_len);
-                           free (converted);
-                         }
-                       length += converted_len;
-                     }
+                        if (converted == NULL)
+                          {
+                            int saved_errno = errno;
+                            if (!(result == resultbuf || result == NULL))
+                              free (result);
+                            if (buf_malloced != NULL)
+                              free (buf_malloced);
+                            CLEANUP ();
+                            errno = saved_errno;
+                            return NULL;
+                          }
+                        if (converted != result + length)
+                          {
+                            ENSURE_ALLOCATION (xsum (length, converted_len));
+                            DCHAR_CPY (result + length, converted, converted_len);
+                            free (converted);
+                          }
+                        length += converted_len;
+                      }
 # endif
 
-                     if (has_width && width > characters
-                         && (dp->flags & FLAG_LEFT))
-                       {
-                         size_t n = width - characters;
-                         ENSURE_ALLOCATION (xsum (length, n));
-                         DCHAR_SET (result + length, ' ', n);
-                         length += n;
-                       }
-                   }
-                   break;
-
-                 default:
-                   abort ();
-                 }
-             }
+                      if (has_width && width > characters
+                          && (dp->flags & FLAG_LEFT))
+                        {
+                          size_t n = width - characters;
+                          ENSURE_ALLOCATION (xsum (length, n));
+                          DCHAR_SET (result + length, ' ', n);
+                          length += n;
+                        }
+                    }
+                    break;
+
+                  default:
+                    abort ();
+                  }
+              }
 #endif
-#if (!USE_SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T
-           else if (dp->conversion == 's'
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T
+            else if (dp->conversion == 's'
 # if WIDE_CHAR_VERSION
-                    && a.arg[dp->arg_index].type != TYPE_WIDE_STRING
+                     && a.arg[dp->arg_index].type != TYPE_WIDE_STRING
 # else
-                    && a.arg[dp->arg_index].type == TYPE_WIDE_STRING
+                     && a.arg[dp->arg_index].type == TYPE_WIDE_STRING
 # endif
-                   )
-             {
-               /* The normal handling of the 's' directive below requires
-                  allocating a temporary buffer.  The determination of its
-                  length (tmp_length), in the case when a precision is
-                  specified, below requires a conversion between a char[]
-                  string and a wchar_t[] wide string.  It could be done, but
-                  we have no guarantee that the implementation of sprintf will
-                  use the exactly same algorithm.  Without this guarantee, it
-                  is possible to have buffer overrun bugs.  In order to avoid
-                  such bugs, we implement the entire processing of the 's'
-                  directive ourselves.  */
-               int flags = dp->flags;
-               int has_width;
-               size_t width;
-               int has_precision;
-               size_t precision;
-
-               has_width = 0;
-               width = 0;
-               if (dp->width_start != dp->width_end)
-                 {
-                   if (dp->width_arg_index != ARG_NONE)
-                     {
-                       int arg;
-
-                       if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
-                         abort ();
-                       arg = a.arg[dp->width_arg_index].a.a_int;
-                       if (arg < 0)
-                         {
-                           /* "A negative field width is taken as a '-' flag
-                               followed by a positive field width."  */
-                           flags |= FLAG_LEFT;
-                           width = (unsigned int) (-arg);
-                         }
-                       else
-                         width = arg;
-                     }
-                   else
-                     {
-                       const FCHAR_T *digitp = dp->width_start;
-
-                       do
-                         width = xsum (xtimes (width, 10), *digitp++ - '0');
-                       while (digitp != dp->width_end);
-                     }
-                   has_width = 1;
-                 }
-
-               has_precision = 0;
-               precision = 6;
-               if (dp->precision_start != dp->precision_end)
-                 {
-                   if (dp->precision_arg_index != ARG_NONE)
-                     {
-                       int arg;
-
-                       if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
-                         abort ();
-                       arg = a.arg[dp->precision_arg_index].a.a_int;
-                       /* "A negative precision is taken as if the precision
-                           were omitted."  */
-                       if (arg >= 0)
-                         {
-                           precision = arg;
-                           has_precision = 1;
-                         }
-                     }
-                   else
-                     {
-                       const FCHAR_T *digitp = dp->precision_start + 1;
-
-                       precision = 0;
-                       while (digitp != dp->precision_end)
-                         precision = xsum (xtimes (precision, 10), *digitp++ - '0');
-                       has_precision = 1;
-                     }
-                 }
+                    )
+              {
+                /* The normal handling of the 's' directive below requires
+                   allocating a temporary buffer.  The determination of its
+                   length (tmp_length), in the case when a precision is
+                   specified, below requires a conversion between a char[]
+                   string and a wchar_t[] wide string.  It could be done, but
+                   we have no guarantee that the implementation of sprintf will
+                   use the exactly same algorithm.  Without this guarantee, it
+                   is possible to have buffer overrun bugs.  In order to avoid
+                   such bugs, we implement the entire processing of the 's'
+                   directive ourselves.  */
+                int flags = dp->flags;
+                int has_width;
+                size_t width;
+                int has_precision;
+                size_t precision;
+
+                has_width = 0;
+                width = 0;
+                if (dp->width_start != dp->width_end)
+                  {
+                    if (dp->width_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->width_arg_index].a.a_int;
+                        if (arg < 0)
+                          {
+                            /* "A negative field width is taken as a '-' flag
+                                followed by a positive field width."  */
+                            flags |= FLAG_LEFT;
+                            width = (unsigned int) (-arg);
+                          }
+                        else
+                          width = arg;
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->width_start;
+
+                        do
+                          width = xsum (xtimes (width, 10), *digitp++ - '0');
+                        while (digitp != dp->width_end);
+                      }
+                    has_width = 1;
+                  }
+
+                has_precision = 0;
+                precision = 6;
+                if (dp->precision_start != dp->precision_end)
+                  {
+                    if (dp->precision_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->precision_arg_index].a.a_int;
+                        /* "A negative precision is taken as if the precision
+                            were omitted."  */
+                        if (arg >= 0)
+                          {
+                            precision = arg;
+                            has_precision = 1;
+                          }
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->precision_start + 1;
+
+                        precision = 0;
+                        while (digitp != dp->precision_end)
+                          precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+                        has_precision = 1;
+                      }
+                  }
 
 # if WIDE_CHAR_VERSION
-               /* %s in vasnwprintf.  See the specification of fwprintf.  */
-               {
-                 const char *arg = a.arg[dp->arg_index].a.a_string;
-                 const char *arg_end;
-                 size_t characters;
-
-                 if (has_precision)
-                   {
-                     /* Use only as many bytes as needed to produce PRECISION
-                        wide characters, from the left.  */
+                /* %s in vasnwprintf.  See the specification of fwprintf.  */
+                {
+                  const char *arg = a.arg[dp->arg_index].a.a_string;
+                  const char *arg_end;
+                  size_t characters;
+
+                  if (has_precision)
+                    {
+                      /* Use only as many bytes as needed to produce PRECISION
+                         wide characters, from the left.  */
 #  if HAVE_MBRTOWC
-                     mbstate_t state;
-                     memset (&state, '\0', sizeof (mbstate_t));
+                      mbstate_t state;
+                      memset (&state, '\0', sizeof (mbstate_t));
 #  endif
-                     arg_end = arg;
-                     characters = 0;
-                     for (; precision > 0; precision--)
-                       {
-                         int count;
+                      arg_end = arg;
+                      characters = 0;
+                      for (; precision > 0; precision--)
+                        {
+                          int count;
 #  if HAVE_MBRTOWC
-                         count = mbrlen (arg_end, MB_CUR_MAX, &state);
+                          count = mbrlen (arg_end, MB_CUR_MAX, &state);
 #  else
-                         count = mblen (arg_end, MB_CUR_MAX);
+                          count = mblen (arg_end, MB_CUR_MAX);
 #  endif
-                         if (count == 0)
-                           /* Found the terminating NUL.  */
-                           break;
-                         if (count < 0)
-                           {
-                             /* Invalid or incomplete multibyte character.  */
-                             if (!(result == resultbuf || result == NULL))
-                               free (result);
-                             if (buf_malloced != NULL)
-                               free (buf_malloced);
-                             CLEANUP ();
-                             errno = EILSEQ;
-                             return NULL;
-                           }
-                         arg_end += count;
-                         characters++;
-                       }
-                   }
-                 else if (has_width)
-                   {
-                     /* Use the entire string, and count the number of wide
-                        characters.  */
+                          if (count == 0)
+                            /* Found the terminating NUL.  */
+                            break;
+                          if (count < 0)
+                            {
+                              /* Invalid or incomplete multibyte character.  */
+                              if (!(result == resultbuf || result == NULL))
+                                free (result);
+                              if (buf_malloced != NULL)
+                                free (buf_malloced);
+                              CLEANUP ();
+                              errno = EILSEQ;
+                              return NULL;
+                            }
+                          arg_end += count;
+                          characters++;
+                        }
+                    }
+                  else if (has_width)
+                    {
+                      /* Use the entire string, and count the number of wide
+                         characters.  */
 #  if HAVE_MBRTOWC
-                     mbstate_t state;
-                     memset (&state, '\0', sizeof (mbstate_t));
+                      mbstate_t state;
+                      memset (&state, '\0', sizeof (mbstate_t));
 #  endif
-                     arg_end = arg;
-                     characters = 0;
-                     for (;;)
-                       {
-                         int count;
+                      arg_end = arg;
+                      characters = 0;
+                      for (;;)
+                        {
+                          int count;
 #  if HAVE_MBRTOWC
-                         count = mbrlen (arg_end, MB_CUR_MAX, &state);
+                          count = mbrlen (arg_end, MB_CUR_MAX, &state);
 #  else
-                         count = mblen (arg_end, MB_CUR_MAX);
+                          count = mblen (arg_end, MB_CUR_MAX);
 #  endif
-                         if (count == 0)
-                           /* Found the terminating NUL.  */
-                           break;
-                         if (count < 0)
-                           {
-                             /* Invalid or incomplete multibyte character.  */
-                             if (!(result == resultbuf || result == NULL))
-                               free (result);
-                             if (buf_malloced != NULL)
-                               free (buf_malloced);
-                             CLEANUP ();
-                             errno = EILSEQ;
-                             return NULL;
-                           }
-                         arg_end += count;
-                         characters++;
-                       }
-                   }
-                 else
-                   {
-                     /* Use the entire string.  */
-                     arg_end = arg + strlen (arg);
-                     /* The number of characters doesn't matter.  */
-                     characters = 0;
-                   }
-
-                 if (has_width && width > characters
-                     && !(dp->flags & FLAG_LEFT))
-                   {
-                     size_t n = width - characters;
-                     ENSURE_ALLOCATION (xsum (length, n));
-                     DCHAR_SET (result + length, ' ', n);
-                     length += n;
-                   }
-
-                 if (has_precision || has_width)
-                   {
-                     /* We know the number of wide characters in advance.  */
-                     size_t remaining;
+                          if (count == 0)
+                            /* Found the terminating NUL.  */
+                            break;
+                          if (count < 0)
+                            {
+                              /* Invalid or incomplete multibyte character.  */
+                              if (!(result == resultbuf || result == NULL))
+                                free (result);
+                              if (buf_malloced != NULL)
+                                free (buf_malloced);
+                              CLEANUP ();
+                              errno = EILSEQ;
+                              return NULL;
+                            }
+                          arg_end += count;
+                          characters++;
+                        }
+                    }
+                  else
+                    {
+                      /* Use the entire string.  */
+                      arg_end = arg + strlen (arg);
+                      /* The number of characters doesn't matter.  */
+                      characters = 0;
+                    }
+
+                  if (has_width && width > characters
+                      && !(dp->flags & FLAG_LEFT))
+                    {
+                      size_t n = width - characters;
+                      ENSURE_ALLOCATION (xsum (length, n));
+                      DCHAR_SET (result + length, ' ', n);
+                      length += n;
+                    }
+
+                  if (has_precision || has_width)
+                    {
+                      /* We know the number of wide characters in advance.  */
+                      size_t remaining;
 #  if HAVE_MBRTOWC
-                     mbstate_t state;
-                     memset (&state, '\0', sizeof (mbstate_t));
+                      mbstate_t state;
+                      memset (&state, '\0', sizeof (mbstate_t));
 #  endif
-                     ENSURE_ALLOCATION (xsum (length, characters));
-                     for (remaining = characters; remaining > 0; remaining--)
-                       {
-                         wchar_t wc;
-                         int count;
+                      ENSURE_ALLOCATION (xsum (length, characters));
+                      for (remaining = characters; remaining > 0; remaining--)
+                        {
+                          wchar_t wc;
+                          int count;
 #  if HAVE_MBRTOWC
-                         count = mbrtowc (&wc, arg, arg_end - arg, &state);
+                          count = mbrtowc (&wc, arg, arg_end - arg, &state);
 #  else
-                         count = mbtowc (&wc, arg, arg_end - arg);
+                          count = mbtowc (&wc, arg, arg_end - arg);
 #  endif
-                         if (count <= 0)
-                           /* mbrtowc not consistent with mbrlen, or mbtowc
-                              not consistent with mblen.  */
-                           abort ();
-                         result[length++] = wc;
-                         arg += count;
-                       }
-                     if (!(arg == arg_end))
-                       abort ();
-                   }
-                 else
-                   {
+                          if (count <= 0)
+                            /* mbrtowc not consistent with mbrlen, or mbtowc
+                               not consistent with mblen.  */
+                            abort ();
+                          result[length++] = wc;
+                          arg += count;
+                        }
+                      if (!(arg == arg_end))
+                        abort ();
+                    }
+                  else
+                    {
 #  if HAVE_MBRTOWC
-                     mbstate_t state;
-                     memset (&state, '\0', sizeof (mbstate_t));
+                      mbstate_t state;
+                      memset (&state, '\0', sizeof (mbstate_t));
 #  endif
-                     while (arg < arg_end)
-                       {
-                         wchar_t wc;
-                         int count;
+                      while (arg < arg_end)
+                        {
+                          wchar_t wc;
+                          int count;
 #  if HAVE_MBRTOWC
-                         count = mbrtowc (&wc, arg, arg_end - arg, &state);
+                          count = mbrtowc (&wc, arg, arg_end - arg, &state);
 #  else
-                         count = mbtowc (&wc, arg, arg_end - arg);
+                          count = mbtowc (&wc, arg, arg_end - arg);
 #  endif
-                         if (count <= 0)
-                           /* mbrtowc not consistent with mbrlen, or mbtowc
-                              not consistent with mblen.  */
-                           abort ();
-                         ENSURE_ALLOCATION (xsum (length, 1));
-                         result[length++] = wc;
-                         arg += count;
-                       }
-                   }
-
-                 if (has_width && width > characters
-                     && (dp->flags & FLAG_LEFT))
-                   {
-                     size_t n = width - characters;
-                     ENSURE_ALLOCATION (xsum (length, n));
-                     DCHAR_SET (result + length, ' ', n);
-                     length += n;
-                   }
-               }
+                          if (count <= 0)
+                            /* mbrtowc not consistent with mbrlen, or mbtowc
+                               not consistent with mblen.  */
+                            abort ();
+                          ENSURE_ALLOCATION (xsum (length, 1));
+                          result[length++] = wc;
+                          arg += count;
+                        }
+                    }
+
+                  if (has_width && width > characters
+                      && (dp->flags & FLAG_LEFT))
+                    {
+                      size_t n = width - characters;
+                      ENSURE_ALLOCATION (xsum (length, n));
+                      DCHAR_SET (result + length, ' ', n);
+                      length += n;
+                    }
+                }
 # else
-               /* %ls in vasnprintf.  See the specification of fprintf.  */
-               {
-                 const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
-                 const wchar_t *arg_end;
-                 size_t characters;
+                /* %ls in vasnprintf.  See the specification of fprintf.  */
+                {
+                  const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
+                  const wchar_t *arg_end;
+                  size_t characters;
 #  if !DCHAR_IS_TCHAR
-                 /* This code assumes that TCHAR_T is 'char'.  */
-                 typedef int TCHAR_T_verify[2 * (sizeof (TCHAR_T) == 1) - 1];
-                 TCHAR_T *tmpsrc;
-                 DCHAR_T *tmpdst;
-                 size_t tmpdst_len;
+                  /* This code assumes that TCHAR_T is 'char'.  */
+                  typedef int TCHAR_T_verify[2 * (sizeof (TCHAR_T) == 1) - 1];
+                  TCHAR_T *tmpsrc;
+                  DCHAR_T *tmpdst;
+                  size_t tmpdst_len;
 #  endif
-                 size_t w;
-
-                 if (has_precision)
-                   {
-                     /* Use only as many wide characters as needed to produce
-                        at most PRECISION bytes, from the left.  */
-#  if HAVE_WCRTOMB
-                     mbstate_t state;
-                     memset (&state, '\0', sizeof (mbstate_t));
+                  size_t w;
+
+                  if (has_precision)
+                    {
+                      /* Use only as many wide characters as needed to produce
+                         at most PRECISION bytes, from the left.  */
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                      mbstate_t state;
+                      memset (&state, '\0', sizeof (mbstate_t));
 #  endif
-                     arg_end = arg;
-                     characters = 0;
-                     while (precision > 0)
-                       {
-                         char buf[64]; /* Assume MB_CUR_MAX <= 64.  */
-                         int count;
-
-                         if (*arg_end == 0)
-                           /* Found the terminating null wide character.  */
-                           break;
-#  if HAVE_WCRTOMB
-                         count = wcrtomb (buf, *arg_end, &state);
+                      arg_end = arg;
+                      characters = 0;
+                      while (precision > 0)
+                        {
+                          char cbuf[64]; /* Assume MB_CUR_MAX <= 64.  */
+                          int count;
+
+                          if (*arg_end == 0)
+                            /* Found the terminating null wide character.  */
+                            break;
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                          count = wcrtomb (cbuf, *arg_end, &state);
 #  else
-                         count = wctomb (buf, *arg_end);
+                          count = wctomb (cbuf, *arg_end);
 #  endif
-                         if (count < 0)
-                           {
-                             /* Cannot convert.  */
-                             if (!(result == resultbuf || result == NULL))
-                               free (result);
-                             if (buf_malloced != NULL)
-                               free (buf_malloced);
-                             CLEANUP ();
-                             errno = EILSEQ;
-                             return NULL;
-                           }
-                         if (precision < count)
-                           break;
-                         arg_end++;
-                         characters += count;
-                         precision -= count;
-                       }
-                   }
+                          if (count < 0)
+                            {
+                              /* Cannot convert.  */
+                              if (!(result == resultbuf || result == NULL))
+                                free (result);
+                              if (buf_malloced != NULL)
+                                free (buf_malloced);
+                              CLEANUP ();
+                              errno = EILSEQ;
+                              return NULL;
+                            }
+                          if (precision < count)
+                            break;
+                          arg_end++;
+                          characters += count;
+                          precision -= count;
+                        }
+                    }
 #  if DCHAR_IS_TCHAR
-                 else if (has_width)
+                  else if (has_width)
 #  else
-                 else
+                  else
 #  endif
-                   {
-                     /* Use the entire string, and count the number of
-                        bytes.  */
-#  if HAVE_WCRTOMB
-                     mbstate_t state;
-                     memset (&state, '\0', sizeof (mbstate_t));
+                    {
+                      /* Use the entire string, and count the number of
+                         bytes.  */
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                      mbstate_t state;
+                      memset (&state, '\0', sizeof (mbstate_t));
 #  endif
-                     arg_end = arg;
-                     characters = 0;
-                     for (;;)
-                       {
-                         char buf[64]; /* Assume MB_CUR_MAX <= 64.  */
-                         int count;
-
-                         if (*arg_end == 0)
-                           /* Found the terminating null wide character.  */
-                           break;
-#  if HAVE_WCRTOMB
-                         count = wcrtomb (buf, *arg_end, &state);
+                      arg_end = arg;
+                      characters = 0;
+                      for (;;)
+                        {
+                          char cbuf[64]; /* Assume MB_CUR_MAX <= 64.  */
+                          int count;
+
+                          if (*arg_end == 0)
+                            /* Found the terminating null wide character.  */
+                            break;
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                          count = wcrtomb (cbuf, *arg_end, &state);
 #  else
-                         count = wctomb (buf, *arg_end);
+                          count = wctomb (cbuf, *arg_end);
 #  endif
-                         if (count < 0)
-                           {
-                             /* Cannot convert.  */
-                             if (!(result == resultbuf || result == NULL))
-                               free (result);
-                             if (buf_malloced != NULL)
-                               free (buf_malloced);
-                             CLEANUP ();
-                             errno = EILSEQ;
-                             return NULL;
-                           }
-                         arg_end++;
-                         characters += count;
-                       }
-                   }
+                          if (count < 0)
+                            {
+                              /* Cannot convert.  */
+                              if (!(result == resultbuf || result == NULL))
+                                free (result);
+                              if (buf_malloced != NULL)
+                                free (buf_malloced);
+                              CLEANUP ();
+                              errno = EILSEQ;
+                              return NULL;
+                            }
+                          arg_end++;
+                          characters += count;
+                        }
+                    }
 #  if DCHAR_IS_TCHAR
-                 else
-                   {
-                     /* Use the entire string.  */
-                     arg_end = arg + local_wcslen (arg);
-                     /* The number of bytes doesn't matter.  */
-                     characters = 0;
-                   }
+                  else
+                    {
+                      /* Use the entire string.  */
+                      arg_end = arg + local_wcslen (arg);
+                      /* The number of bytes doesn't matter.  */
+                      characters = 0;
+                    }
 #  endif
 
 #  if !DCHAR_IS_TCHAR
-                 /* Convert the string into a piece of temporary memory.  */
-                 tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T));
-                 if (tmpsrc == NULL)
-                   goto out_of_memory;
-                 {
-                   TCHAR_T *tmpptr = tmpsrc;
-                   size_t remaining;
-#   if HAVE_WCRTOMB
-                   mbstate_t state;
-                   memset (&state, '\0', sizeof (mbstate_t));
+                  /* Convert the string into a piece of temporary memory.  */
+                  tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T));
+                  if (tmpsrc == NULL)
+                    goto out_of_memory;
+                  {
+                    TCHAR_T *tmpptr = tmpsrc;
+                    size_t remaining;
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                    mbstate_t state;
+                    memset (&state, '\0', sizeof (mbstate_t));
 #   endif
-                   for (remaining = characters; remaining > 0; )
-                     {
-                       char buf[64]; /* Assume MB_CUR_MAX <= 64.  */
-                       int count;
-
-                       if (*arg == 0)
-                         abort ();
-#   if HAVE_WCRTOMB
-                       count = wcrtomb (buf, *arg, &state);
+                    for (remaining = characters; remaining > 0; )
+                      {
+                        char cbuf[64]; /* Assume MB_CUR_MAX <= 64.  */
+                        int count;
+
+                        if (*arg == 0)
+                          abort ();
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                        count = wcrtomb (cbuf, *arg, &state);
 #   else
-                       count = wctomb (buf, *arg);
+                        count = wctomb (cbuf, *arg);
 #   endif
-                       if (count <= 0)
-                         /* Inconsistency.  */
-                         abort ();
-                       memcpy (tmpptr, buf, count);
-                       tmpptr += count;
-                       arg++;
-                       remaining -= count;
-                     }
-                   if (!(arg == arg_end))
-                     abort ();
-                 }
-
-                 /* Convert from TCHAR_T[] to DCHAR_T[].  */
-                 tmpdst = NULL;
-                 tmpdst_len = 0;
-                 if (DCHAR_CONV_FROM_ENCODING (locale_charset (),
-                                               iconveh_question_mark,
-                                               tmpsrc, characters,
-                                               NULL,
-                                               &tmpdst, &tmpdst_len)
-                     < 0)
-                   {
-                     int saved_errno = errno;
-                     free (tmpsrc);
-                     if (!(result == resultbuf || result == NULL))
-                       free (result);
-                     if (buf_malloced != NULL)
-                       free (buf_malloced);
-                     CLEANUP ();
-                     errno = saved_errno;
-                     return NULL;
-                   }
-                 free (tmpsrc);
+                        if (count <= 0)
+                          /* Inconsistency.  */
+                          abort ();
+                        memcpy (tmpptr, cbuf, count);
+                        tmpptr += count;
+                        arg++;
+                        remaining -= count;
+                      }
+                    if (!(arg == arg_end))
+                      abort ();
+                  }
+
+                  /* Convert from TCHAR_T[] to DCHAR_T[].  */
+                  tmpdst =
+                    DCHAR_CONV_FROM_ENCODING (locale_charset (),
+                                              iconveh_question_mark,
+                                              tmpsrc, characters,
+                                              NULL,
+                                              NULL, &tmpdst_len);
+                  if (tmpdst == NULL)
+                    {
+                      int saved_errno = errno;
+                      free (tmpsrc);
+                      if (!(result == resultbuf || result == NULL))
+                        free (result);
+                      if (buf_malloced != NULL)
+                        free (buf_malloced);
+                      CLEANUP ();
+                      errno = saved_errno;
+                      return NULL;
+                    }
+                  free (tmpsrc);
 #  endif
 
-                 if (has_width)
-                   {
+                  if (has_width)
+                    {
 #  if ENABLE_UNISTDIO
-                     /* Outside POSIX, it's preferrable to compare the width
-                        against the number of _characters_ of the converted
-                        value.  */
-                     w = DCHAR_MBSNLEN (result + length, characters);
+                      /* Outside POSIX, it's preferrable to compare the width
+                         against the number of _characters_ of the converted
+                         value.  */
+                      w = DCHAR_MBSNLEN (result + length, characters);
 #  else
-                     /* The width is compared against the number of _bytes_
-                        of the converted value, says POSIX.  */
-                     w = characters;
+                      /* The width is compared against the number of _bytes_
+                         of the converted value, says POSIX.  */
+                      w = characters;
 #  endif
-                   }
-                 else
-                   /* w doesn't matter.  */
-                   w = 0;
-
-                 if (has_width && width > w
-                     && !(dp->flags & FLAG_LEFT))
-                   {
-                     size_t n = width - w;
-                     ENSURE_ALLOCATION (xsum (length, n));
-                     DCHAR_SET (result + length, ' ', n);
-                     length += n;
-                   }
+                    }
+                  else
+                    /* w doesn't matter.  */
+                    w = 0;
+
+                  if (has_width && width > w
+                      && !(dp->flags & FLAG_LEFT))
+                    {
+                      size_t n = width - w;
+                      ENSURE_ALLOCATION (xsum (length, n));
+                      DCHAR_SET (result + length, ' ', n);
+                      length += n;
+                    }
 
 #  if DCHAR_IS_TCHAR
-                 if (has_precision || has_width)
-                   {
-                     /* We know the number of bytes in advance.  */
-                     size_t remaining;
-#   if HAVE_WCRTOMB
-                     mbstate_t state;
-                     memset (&state, '\0', sizeof (mbstate_t));
+                  if (has_precision || has_width)
+                    {
+                      /* We know the number of bytes in advance.  */
+                      size_t remaining;
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                      mbstate_t state;
+                      memset (&state, '\0', sizeof (mbstate_t));
 #   endif
-                     ENSURE_ALLOCATION (xsum (length, characters));
-                     for (remaining = characters; remaining > 0; )
-                       {
-                         char buf[64]; /* Assume MB_CUR_MAX <= 64.  */
-                         int count;
-
-                         if (*arg == 0)
-                           abort ();
-#   if HAVE_WCRTOMB
-                         count = wcrtomb (buf, *arg, &state);
+                      ENSURE_ALLOCATION (xsum (length, characters));
+                      for (remaining = characters; remaining > 0; )
+                        {
+                          char cbuf[64]; /* Assume MB_CUR_MAX <= 64.  */
+                          int count;
+
+                          if (*arg == 0)
+                            abort ();
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                          count = wcrtomb (cbuf, *arg, &state);
 #   else
-                         count = wctomb (buf, *arg);
+                          count = wctomb (cbuf, *arg);
 #   endif
-                         if (count <= 0)
-                           /* Inconsistency.  */
-                           abort ();
-                         memcpy (result + length, buf, count);
-                         length += count;
-                         arg++;
-                         remaining -= count;
-                       }
-                     if (!(arg == arg_end))
-                       abort ();
-                   }
-                 else
-                   {
-#   if HAVE_WCRTOMB
-                     mbstate_t state;
-                     memset (&state, '\0', sizeof (mbstate_t));
+                          if (count <= 0)
+                            /* Inconsistency.  */
+                            abort ();
+                          memcpy (result + length, cbuf, count);
+                          length += count;
+                          arg++;
+                          remaining -= count;
+                        }
+                      if (!(arg == arg_end))
+                        abort ();
+                    }
+                  else
+                    {
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                      mbstate_t state;
+                      memset (&state, '\0', sizeof (mbstate_t));
 #   endif
-                     while (arg < arg_end)
-                       {
-                         char buf[64]; /* Assume MB_CUR_MAX <= 64.  */
-                         int count;
-
-                         if (*arg == 0)
-                           abort ();
-#   if HAVE_WCRTOMB
-                         count = wcrtomb (buf, *arg, &state);
+                      while (arg < arg_end)
+                        {
+                          char cbuf[64]; /* Assume MB_CUR_MAX <= 64.  */
+                          int count;
+
+                          if (*arg == 0)
+                            abort ();
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                          count = wcrtomb (cbuf, *arg, &state);
 #   else
-                         count = wctomb (buf, *arg);
+                          count = wctomb (cbuf, *arg);
 #   endif
-                         if (count <= 0)
-                           /* Inconsistency.  */
-                           abort ();
-                         ENSURE_ALLOCATION (xsum (length, count));
-                         memcpy (result + length, buf, count);
-                         length += count;
-                         arg++;
-                       }
-                   }
+                          if (count <= 0)
+                            {
+                              /* Cannot convert.  */
+                              if (!(result == resultbuf || result == NULL))
+                                free (result);
+                              if (buf_malloced != NULL)
+                                free (buf_malloced);
+                              CLEANUP ();
+                              errno = EILSEQ;
+                              return NULL;
+                            }
+                          ENSURE_ALLOCATION (xsum (length, count));
+                          memcpy (result + length, cbuf, count);
+                          length += count;
+                          arg++;
+                        }
+                    }
 #  else
-                 ENSURE_ALLOCATION (xsum (length, tmpdst_len));
-                 DCHAR_CPY (result + length, tmpdst, tmpdst_len);
-                 free (tmpdst);
-                 length += tmpdst_len;
+                  ENSURE_ALLOCATION (xsum (length, tmpdst_len));
+                  DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+                  free (tmpdst);
+                  length += tmpdst_len;
 #  endif
 
-                 if (has_width && width > w
-                     && (dp->flags & FLAG_LEFT))
-                   {
-                     size_t n = width - w;
-                     ENSURE_ALLOCATION (xsum (length, n));
-                     DCHAR_SET (result + length, ' ', n);
-                     length += n;
-                   }
-               }
-             }
+                  if (has_width && width > w
+                      && (dp->flags & FLAG_LEFT))
+                    {
+                      size_t n = width - w;
+                      ENSURE_ALLOCATION (xsum (length, n));
+                      DCHAR_SET (result + length, ' ', n);
+                      length += n;
+                    }
+                }
 # endif
+              }
 #endif
 #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
-           else if ((dp->conversion == 'a' || dp->conversion == 'A')
+            else if ((dp->conversion == 'a' || dp->conversion == 'A')
 # if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE))
-                    && (0
+                     && (0
 #  if NEED_PRINTF_DOUBLE
-                        || a.arg[dp->arg_index].type == TYPE_DOUBLE
+                         || a.arg[dp->arg_index].type == TYPE_DOUBLE
 #  endif
 #  if NEED_PRINTF_LONG_DOUBLE
-                        || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+                         || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
 #  endif
-                       )
+                        )
 # endif
-                   )
-             {
-               arg_type type = a.arg[dp->arg_index].type;
-               int flags = dp->flags;
-               int has_width;
-               size_t width;
-               int has_precision;
-               size_t precision;
-               size_t tmp_length;
-               DCHAR_T tmpbuf[700];
-               DCHAR_T *tmp;
-               DCHAR_T *pad_ptr;
-               DCHAR_T *p;
-
-               has_width = 0;
-               width = 0;
-               if (dp->width_start != dp->width_end)
-                 {
-                   if (dp->width_arg_index != ARG_NONE)
-                     {
-                       int arg;
-
-                       if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
-                         abort ();
-                       arg = a.arg[dp->width_arg_index].a.a_int;
-                       if (arg < 0)
-                         {
-                           /* "A negative field width is taken as a '-' flag
-                               followed by a positive field width."  */
-                           flags |= FLAG_LEFT;
-                           width = (unsigned int) (-arg);
-                         }
-                       else
-                         width = arg;
-                     }
-                   else
-                     {
-                       const FCHAR_T *digitp = dp->width_start;
-
-                       do
-                         width = xsum (xtimes (width, 10), *digitp++ - '0');
-                       while (digitp != dp->width_end);
-                     }
-                   has_width = 1;
-                 }
-
-               has_precision = 0;
-               precision = 0;
-               if (dp->precision_start != dp->precision_end)
-                 {
-                   if (dp->precision_arg_index != ARG_NONE)
-                     {
-                       int arg;
-
-                       if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
-                         abort ();
-                       arg = a.arg[dp->precision_arg_index].a.a_int;
-                       /* "A negative precision is taken as if the precision
-                           were omitted."  */
-                       if (arg >= 0)
-                         {
-                           precision = arg;
-                           has_precision = 1;
-                         }
-                     }
-                   else
-                     {
-                       const FCHAR_T *digitp = dp->precision_start + 1;
-
-                       precision = 0;
-                       while (digitp != dp->precision_end)
-                         precision = xsum (xtimes (precision, 10), *digitp++ - '0');
-                       has_precision = 1;
-                     }
-                 }
-
-               /* Allocate a temporary buffer of sufficient size.  */
-               if (type == TYPE_LONGDOUBLE)
-                 tmp_length =
-                   (unsigned int) ((LDBL_DIG + 1)
-                                   * 0.831 /* decimal -> hexadecimal */
-                                  )
-                   + 1; /* turn floor into ceil */
-               else
-                 tmp_length =
-                   (unsigned int) ((DBL_DIG + 1)
-                                   * 0.831 /* decimal -> hexadecimal */
-                                  )
-                   + 1; /* turn floor into ceil */
-               if (tmp_length < precision)
-                 tmp_length = precision;
-               /* Account for sign, decimal point etc. */
-               tmp_length = xsum (tmp_length, 12);
-
-               if (tmp_length < width)
-                 tmp_length = width;
-
-               tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
-
-               if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
-                 tmp = tmpbuf;
-               else
-                 {
-                   size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
-
-                   if (size_overflow_p (tmp_memsize))
-                     /* Overflow, would lead to out of memory.  */
-                     goto out_of_memory;
-                   tmp = (DCHAR_T *) malloc (tmp_memsize);
-                   if (tmp == NULL)
-                     /* Out of memory.  */
-                     goto out_of_memory;
-                 }
-
-               pad_ptr = NULL;
-               p = tmp;
-               if (type == TYPE_LONGDOUBLE)
-                 {
+                    )
+              {
+                arg_type type = a.arg[dp->arg_index].type;
+                int flags = dp->flags;
+                int has_width;
+                size_t width;
+                int has_precision;
+                size_t precision;
+                size_t tmp_length;
+                DCHAR_T tmpbuf[700];
+                DCHAR_T *tmp;
+                DCHAR_T *pad_ptr;
+                DCHAR_T *p;
+
+                has_width = 0;
+                width = 0;
+                if (dp->width_start != dp->width_end)
+                  {
+                    if (dp->width_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->width_arg_index].a.a_int;
+                        if (arg < 0)
+                          {
+                            /* "A negative field width is taken as a '-' flag
+                                followed by a positive field width."  */
+                            flags |= FLAG_LEFT;
+                            width = (unsigned int) (-arg);
+                          }
+                        else
+                          width = arg;
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->width_start;
+
+                        do
+                          width = xsum (xtimes (width, 10), *digitp++ - '0');
+                        while (digitp != dp->width_end);
+                      }
+                    has_width = 1;
+                  }
+
+                has_precision = 0;
+                precision = 0;
+                if (dp->precision_start != dp->precision_end)
+                  {
+                    if (dp->precision_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->precision_arg_index].a.a_int;
+                        /* "A negative precision is taken as if the precision
+                            were omitted."  */
+                        if (arg >= 0)
+                          {
+                            precision = arg;
+                            has_precision = 1;
+                          }
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->precision_start + 1;
+
+                        precision = 0;
+                        while (digitp != dp->precision_end)
+                          precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+                        has_precision = 1;
+                      }
+                  }
+
+                /* Allocate a temporary buffer of sufficient size.  */
+                if (type == TYPE_LONGDOUBLE)
+                  tmp_length =
+                    (unsigned int) ((LDBL_DIG + 1)
+                                    * 0.831 /* decimal -> hexadecimal */
+                                   )
+                    + 1; /* turn floor into ceil */
+                else
+                  tmp_length =
+                    (unsigned int) ((DBL_DIG + 1)
+                                    * 0.831 /* decimal -> hexadecimal */
+                                   )
+                    + 1; /* turn floor into ceil */
+                if (tmp_length < precision)
+                  tmp_length = precision;
+                /* Account for sign, decimal point etc. */
+                tmp_length = xsum (tmp_length, 12);
+
+                if (tmp_length < width)
+                  tmp_length = width;
+
+                tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+                if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+                  tmp = tmpbuf;
+                else
+                  {
+                    size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+
+                    if (size_overflow_p (tmp_memsize))
+                      /* Overflow, would lead to out of memory.  */
+                      goto out_of_memory;
+                    tmp = (DCHAR_T *) malloc (tmp_memsize);
+                    if (tmp == NULL)
+                      /* Out of memory.  */
+                      goto out_of_memory;
+                  }
+
+                pad_ptr = NULL;
+                p = tmp;
+                if (type == TYPE_LONGDOUBLE)
+                  {
 # if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE
-                   long double arg = a.arg[dp->arg_index].a.a_longdouble;
-
-                   if (isnanl (arg))
-                     {
-                       if (dp->conversion == 'A')
-                         {
-                           *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
-                         }
-                       else
-                         {
-                           *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
-                         }
-                     }
-                   else
-                     {
-                       int sign = 0;
-                       DECL_LONG_DOUBLE_ROUNDING
-
-                       BEGIN_LONG_DOUBLE_ROUNDING ();
-
-                       if (signbit (arg)) /* arg < 0.0L or negative zero */
-                         {
-                           sign = -1;
-                           arg = -arg;
-                         }
-
-                       if (sign < 0)
-                         *p++ = '-';
-                       else if (flags & FLAG_SHOWSIGN)
-                         *p++ = '+';
-                       else if (flags & FLAG_SPACE)
-                         *p++ = ' ';
-
-                       if (arg > 0.0L && arg + arg == arg)
-                         {
-                           if (dp->conversion == 'A')
-                             {
-                               *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
-                             }
-                           else
-                             {
-                               *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
-                             }
-                         }
-                       else
-                         {
-                           int exponent;
-                           long double mantissa;
-
-                           if (arg > 0.0L)
-                             mantissa = printf_frexpl (arg, &exponent);
-                           else
-                             {
-                               exponent = 0;
-                               mantissa = 0.0L;
-                             }
-
-                           if (has_precision
-                               && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1)
-                             {
-                               /* Round the mantissa.  */
-                               long double tail = mantissa;
-                               size_t q;
-
-                               for (q = precision; ; q--)
-                                 {
-                                   int digit = (int) tail;
-                                   tail -= digit;
-                                   if (q == 0)
-                                     {
-                                       if (digit & 1 ? tail >= 0.5L : tail > 0.5L)
-                                         tail = 1 - tail;
-                                       else
-                                         tail = - tail;
-                                       break;
-                                     }
-                                   tail *= 16.0L;
-                                 }
-                               if (tail != 0.0L)
-                                 for (q = precision; q > 0; q--)
-                                   tail *= 0.0625L;
-                               mantissa += tail;
-                             }
-
-                           *p++ = '0';
-                           *p++ = dp->conversion - 'A' + 'X';
-                           pad_ptr = p;
-                           {
-                             int digit;
-
-                             digit = (int) mantissa;
-                             mantissa -= digit;
-                             *p++ = '0' + digit;
-                             if ((flags & FLAG_ALT)
-                                 || mantissa > 0.0L || precision > 0)
-                               {
-                                 *p++ = decimal_point_char ();
-                                 /* This loop terminates because we assume
-                                    that FLT_RADIX is a power of 2.  */
-                                 while (mantissa > 0.0L)
-                                   {
-                                     mantissa *= 16.0L;
-                                     digit = (int) mantissa;
-                                     mantissa -= digit;
-                                     *p++ = digit
-                                            + (digit < 10
-                                               ? '0'
-                                               : dp->conversion - 10);
-                                     if (precision > 0)
-                                       precision--;
-                                   }
-                                 while (precision > 0)
-                                   {
-                                     *p++ = '0';
-                                     precision--;
-                                   }
-                               }
-                             }
-                             *p++ = dp->conversion - 'A' + 'P';
+                    long double arg = a.arg[dp->arg_index].a.a_longdouble;
+
+                    if (isnanl (arg))
+                      {
+                        if (dp->conversion == 'A')
+                          {
+                            *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+                          }
+                        else
+                          {
+                            *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+                          }
+                      }
+                    else
+                      {
+                        int sign = 0;
+                        DECL_LONG_DOUBLE_ROUNDING
+
+                        BEGIN_LONG_DOUBLE_ROUNDING ();
+
+                        if (signbit (arg)) /* arg < 0.0L or negative zero */
+                          {
+                            sign = -1;
+                            arg = -arg;
+                          }
+
+                        if (sign < 0)
+                          *p++ = '-';
+                        else if (flags & FLAG_SHOWSIGN)
+                          *p++ = '+';
+                        else if (flags & FLAG_SPACE)
+                          *p++ = ' ';
+
+                        if (arg > 0.0L && arg + arg == arg)
+                          {
+                            if (dp->conversion == 'A')
+                              {
+                                *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+                              }
+                            else
+                              {
+                                *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+                              }
+                          }
+                        else
+                          {
+                            int exponent;
+                            long double mantissa;
+
+                            if (arg > 0.0L)
+                              mantissa = printf_frexpl (arg, &exponent);
+                            else
+                              {
+                                exponent = 0;
+                                mantissa = 0.0L;
+                              }
+
+                            if (has_precision
+                                && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1)
+                              {
+                                /* Round the mantissa.  */
+                                long double tail = mantissa;
+                                size_t q;
+
+                                for (q = precision; ; q--)
+                                  {
+                                    int digit = (int) tail;
+                                    tail -= digit;
+                                    if (q == 0)
+                                      {
+                                        if (digit & 1 ? tail >= 0.5L : tail > 0.5L)
+                                          tail = 1 - tail;
+                                        else
+                                          tail = - tail;
+                                        break;
+                                      }
+                                    tail *= 16.0L;
+                                  }
+                                if (tail != 0.0L)
+                                  for (q = precision; q > 0; q--)
+                                    tail *= 0.0625L;
+                                mantissa += tail;
+                              }
+
+                            *p++ = '0';
+                            *p++ = dp->conversion - 'A' + 'X';
+                            pad_ptr = p;
+                            {
+                              int digit;
+
+                              digit = (int) mantissa;
+                              mantissa -= digit;
+                              *p++ = '0' + digit;
+                              if ((flags & FLAG_ALT)
+                                  || mantissa > 0.0L || precision > 0)
+                                {
+                                  *p++ = decimal_point_char ();
+                                  /* This loop terminates because we assume
+                                     that FLT_RADIX is a power of 2.  */
+                                  while (mantissa > 0.0L)
+                                    {
+                                      mantissa *= 16.0L;
+                                      digit = (int) mantissa;
+                                      mantissa -= digit;
+                                      *p++ = digit
+                                             + (digit < 10
+                                                ? '0'
+                                                : dp->conversion - 10);
+                                      if (precision > 0)
+                                        precision--;
+                                    }
+                                  while (precision > 0)
+                                    {
+                                      *p++ = '0';
+                                      precision--;
+                                    }
+                                }
+                              }
+                              *p++ = dp->conversion - 'A' + 'P';
 #  if WIDE_CHAR_VERSION
-                             {
-                               static const wchar_t decimal_format[] =
-                                 { '%', '+', 'd', '\0' };
-                               SNPRINTF (p, 6 + 1, decimal_format, exponent);
-                             }
-                             while (*p != '\0')
-                               p++;
+                              {
+                                static const wchar_t decimal_format[] =
+                                  { '%', '+', 'd', '\0' };
+                                SNPRINTF (p, 6 + 1, decimal_format, exponent);
+                              }
+                              while (*p != '\0')
+                                p++;
 #  else
-                             if (sizeof (DCHAR_T) == 1)
-                               {
-                                 sprintf ((char *) p, "%+d", exponent);
-                                 while (*p != '\0')
-                                   p++;
-                               }
-                             else
-                               {
-                                 char expbuf[6 + 1];
-                                 const char *ep;
-                                 sprintf (expbuf, "%+d", exponent);
-                                 for (ep = expbuf; (*p = *ep) != '\0'; ep++)
-                                   p++;
-                               }
+                              if (sizeof (DCHAR_T) == 1)
+                                {
+                                  sprintf ((char *) p, "%+d", exponent);
+                                  while (*p != '\0')
+                                    p++;
+                                }
+                              else
+                                {
+                                  char expbuf[6 + 1];
+                                  const char *ep;
+                                  sprintf (expbuf, "%+d", exponent);
+                                  for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+                                    p++;
+                                }
 #  endif
-                         }
+                          }
 
-                       END_LONG_DOUBLE_ROUNDING ();
-                     }
+                        END_LONG_DOUBLE_ROUNDING ();
+                      }
 # else
-                   abort ();
+                    abort ();
 # endif
-                 }
-               else
-                 {
+                  }
+                else
+                  {
 # if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE
-                   double arg = a.arg[dp->arg_index].a.a_double;
-
-                   if (isnand (arg))
-                     {
-                       if (dp->conversion == 'A')
-                         {
-                           *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
-                         }
-                       else
-                         {
-                           *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
-                         }
-                     }
-                   else
-                     {
-                       int sign = 0;
-
-                       if (signbit (arg)) /* arg < 0.0 or negative zero */
-                         {
-                           sign = -1;
-                           arg = -arg;
-                         }
-
-                       if (sign < 0)
-                         *p++ = '-';
-                       else if (flags & FLAG_SHOWSIGN)
-                         *p++ = '+';
-                       else if (flags & FLAG_SPACE)
-                         *p++ = ' ';
-
-                       if (arg > 0.0 && arg + arg == arg)
-                         {
-                           if (dp->conversion == 'A')
-                             {
-                               *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
-                             }
-                           else
-                             {
-                               *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
-                             }
-                         }
-                       else
-                         {
-                           int exponent;
-                           double mantissa;
-
-                           if (arg > 0.0)
-                             mantissa = printf_frexp (arg, &exponent);
-                           else
-                             {
-                               exponent = 0;
-                               mantissa = 0.0;
-                             }
-
-                           if (has_precision
-                               && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1)
-                             {
-                               /* Round the mantissa.  */
-                               double tail = mantissa;
-                               size_t q;
-
-                               for (q = precision; ; q--)
-                                 {
-                                   int digit = (int) tail;
-                                   tail -= digit;
-                                   if (q == 0)
-                                     {
-                                       if (digit & 1 ? tail >= 0.5 : tail > 0.5)
-                                         tail = 1 - tail;
-                                       else
-                                         tail = - tail;
-                                       break;
-                                     }
-                                   tail *= 16.0;
-                                 }
-                               if (tail != 0.0)
-                                 for (q = precision; q > 0; q--)
-                                   tail *= 0.0625;
-                               mantissa += tail;
-                             }
-
-                           *p++ = '0';
-                           *p++ = dp->conversion - 'A' + 'X';
-                           pad_ptr = p;
-                           {
-                             int digit;
-
-                             digit = (int) mantissa;
-                             mantissa -= digit;
-                             *p++ = '0' + digit;
-                             if ((flags & FLAG_ALT)
-                                 || mantissa > 0.0 || precision > 0)
-                               {
-                                 *p++ = decimal_point_char ();
-                                 /* This loop terminates because we assume
-                                    that FLT_RADIX is a power of 2.  */
-                                 while (mantissa > 0.0)
-                                   {
-                                     mantissa *= 16.0;
-                                     digit = (int) mantissa;
-                                     mantissa -= digit;
-                                     *p++ = digit
-                                            + (digit < 10
-                                               ? '0'
-                                               : dp->conversion - 10);
-                                     if (precision > 0)
-                                       precision--;
-                                   }
-                                 while (precision > 0)
-                                   {
-                                     *p++ = '0';
-                                     precision--;
-                                   }
-                               }
-                             }
-                             *p++ = dp->conversion - 'A' + 'P';
+                    double arg = a.arg[dp->arg_index].a.a_double;
+
+                    if (isnand (arg))
+                      {
+                        if (dp->conversion == 'A')
+                          {
+                            *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+                          }
+                        else
+                          {
+                            *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+                          }
+                      }
+                    else
+                      {
+                        int sign = 0;
+
+                        if (signbit (arg)) /* arg < 0.0 or negative zero */
+                          {
+                            sign = -1;
+                            arg = -arg;
+                          }
+
+                        if (sign < 0)
+                          *p++ = '-';
+                        else if (flags & FLAG_SHOWSIGN)
+                          *p++ = '+';
+                        else if (flags & FLAG_SPACE)
+                          *p++ = ' ';
+
+                        if (arg > 0.0 && arg + arg == arg)
+                          {
+                            if (dp->conversion == 'A')
+                              {
+                                *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+                              }
+                            else
+                              {
+                                *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+                              }
+                          }
+                        else
+                          {
+                            int exponent;
+                            double mantissa;
+
+                            if (arg > 0.0)
+                              mantissa = printf_frexp (arg, &exponent);
+                            else
+                              {
+                                exponent = 0;
+                                mantissa = 0.0;
+                              }
+
+                            if (has_precision
+                                && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1)
+                              {
+                                /* Round the mantissa.  */
+                                double tail = mantissa;
+                                size_t q;
+
+                                for (q = precision; ; q--)
+                                  {
+                                    int digit = (int) tail;
+                                    tail -= digit;
+                                    if (q == 0)
+                                      {
+                                        if (digit & 1 ? tail >= 0.5 : tail > 0.5)
+                                          tail = 1 - tail;
+                                        else
+                                          tail = - tail;
+                                        break;
+                                      }
+                                    tail *= 16.0;
+                                  }
+                                if (tail != 0.0)
+                                  for (q = precision; q > 0; q--)
+                                    tail *= 0.0625;
+                                mantissa += tail;
+                              }
+
+                            *p++ = '0';
+                            *p++ = dp->conversion - 'A' + 'X';
+                            pad_ptr = p;
+                            {
+                              int digit;
+
+                              digit = (int) mantissa;
+                              mantissa -= digit;
+                              *p++ = '0' + digit;
+                              if ((flags & FLAG_ALT)
+                                  || mantissa > 0.0 || precision > 0)
+                                {
+                                  *p++ = decimal_point_char ();
+                                  /* This loop terminates because we assume
+                                     that FLT_RADIX is a power of 2.  */
+                                  while (mantissa > 0.0)
+                                    {
+                                      mantissa *= 16.0;
+                                      digit = (int) mantissa;
+                                      mantissa -= digit;
+                                      *p++ = digit
+                                             + (digit < 10
+                                                ? '0'
+                                                : dp->conversion - 10);
+                                      if (precision > 0)
+                                        precision--;
+                                    }
+                                  while (precision > 0)
+                                    {
+                                      *p++ = '0';
+                                      precision--;
+                                    }
+                                }
+                              }
+                              *p++ = dp->conversion - 'A' + 'P';
 #  if WIDE_CHAR_VERSION
-                             {
-                               static const wchar_t decimal_format[] =
-                                 { '%', '+', 'd', '\0' };
-                               SNPRINTF (p, 6 + 1, decimal_format, exponent);
-                             }
-                             while (*p != '\0')
-                               p++;
+                              {
+                                static const wchar_t decimal_format[] =
+                                  { '%', '+', 'd', '\0' };
+                                SNPRINTF (p, 6 + 1, decimal_format, exponent);
+                              }
+                              while (*p != '\0')
+                                p++;
 #  else
-                             if (sizeof (DCHAR_T) == 1)
-                               {
-                                 sprintf ((char *) p, "%+d", exponent);
-                                 while (*p != '\0')
-                                   p++;
-                               }
-                             else
-                               {
-                                 char expbuf[6 + 1];
-                                 const char *ep;
-                                 sprintf (expbuf, "%+d", exponent);
-                                 for (ep = expbuf; (*p = *ep) != '\0'; ep++)
-                                   p++;
-                               }
+                              if (sizeof (DCHAR_T) == 1)
+                                {
+                                  sprintf ((char *) p, "%+d", exponent);
+                                  while (*p != '\0')
+                                    p++;
+                                }
+                              else
+                                {
+                                  char expbuf[6 + 1];
+                                  const char *ep;
+                                  sprintf (expbuf, "%+d", exponent);
+                                  for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+                                    p++;
+                                }
 #  endif
-                         }
-                     }
+                          }
+                      }
 # else
-                   abort ();
+                    abort ();
 # endif
-                 }
-               /* The generated string now extends from tmp to p, with the
-                  zero padding insertion point being at pad_ptr.  */
-               if (has_width && p - tmp < width)
-                 {
-                   size_t pad = width - (p - tmp);
-                   DCHAR_T *end = p + pad;
-
-                   if (flags & FLAG_LEFT)
-                     {
-                       /* Pad with spaces on the right.  */
-                       for (; pad > 0; pad--)
-                         *p++ = ' ';
-                     }
-                   else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
-                     {
-                       /* Pad with zeroes.  */
-                       DCHAR_T *q = end;
-
-                       while (p > pad_ptr)
-                         *--q = *--p;
-                       for (; pad > 0; pad--)
-                         *p++ = '0';
-                     }
-                   else
-                     {
-                       /* Pad with spaces on the left.  */
-                       DCHAR_T *q = end;
-
-                       while (p > tmp)
-                         *--q = *--p;
-                       for (; pad > 0; pad--)
-                         *p++ = ' ';
-                     }
-
-                   p = end;
-                 }
-
-               {
-                 size_t count = p - tmp;
-
-                 if (count >= tmp_length)
-                   /* tmp_length was incorrectly calculated - fix the
-                      code above!  */
-                   abort ();
-
-                 /* Make room for the result.  */
-                 if (count >= allocated - length)
-                   {
-                     size_t n = xsum (length, count);
-
-                     ENSURE_ALLOCATION (n);
-                   }
-
-                 /* Append the result.  */
-                 memcpy (result + length, tmp, count * sizeof (DCHAR_T));
-                 if (tmp != tmpbuf)
-                   free (tmp);
-                 length += count;
-               }
-             }
+                  }
+                /* The generated string now extends from tmp to p, with the
+                   zero padding insertion point being at pad_ptr.  */
+                if (has_width && p - tmp < width)
+                  {
+                    size_t pad = width - (p - tmp);
+                    DCHAR_T *end = p + pad;
+
+                    if (flags & FLAG_LEFT)
+                      {
+                        /* Pad with spaces on the right.  */
+                        for (; pad > 0; pad--)
+                          *p++ = ' ';
+                      }
+                    else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+                      {
+                        /* Pad with zeroes.  */
+                        DCHAR_T *q = end;
+
+                        while (p > pad_ptr)
+                          *--q = *--p;
+                        for (; pad > 0; pad--)
+                          *p++ = '0';
+                      }
+                    else
+                      {
+                        /* Pad with spaces on the left.  */
+                        DCHAR_T *q = end;
+
+                        while (p > tmp)
+                          *--q = *--p;
+                        for (; pad > 0; pad--)
+                          *p++ = ' ';
+                      }
+
+                    p = end;
+                  }
+
+                {
+                  size_t count = p - tmp;
+
+                  if (count >= tmp_length)
+                    /* tmp_length was incorrectly calculated - fix the
+                       code above!  */
+                    abort ();
+
+                  /* Make room for the result.  */
+                  if (count >= allocated - length)
+                    {
+                      size_t n = xsum (length, count);
+
+                      ENSURE_ALLOCATION (n);
+                    }
+
+                  /* Append the result.  */
+                  memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+                  if (tmp != tmpbuf)
+                    free (tmp);
+                  length += count;
+                }
+              }
 #endif
 #if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
-           else if ((dp->conversion == 'f' || dp->conversion == 'F'
-                     || dp->conversion == 'e' || dp->conversion == 'E'
-                     || dp->conversion == 'g' || dp->conversion == 'G'
-                     || dp->conversion == 'a' || dp->conversion == 'A')
-                    && (0
+            else if ((dp->conversion == 'f' || dp->conversion == 'F'
+                      || dp->conversion == 'e' || dp->conversion == 'E'
+                      || dp->conversion == 'g' || dp->conversion == 'G'
+                      || dp->conversion == 'a' || dp->conversion == 'A')
+                     && (0
 # if NEED_PRINTF_DOUBLE
-                        || a.arg[dp->arg_index].type == TYPE_DOUBLE
+                         || a.arg[dp->arg_index].type == TYPE_DOUBLE
 # elif NEED_PRINTF_INFINITE_DOUBLE
-                        || (a.arg[dp->arg_index].type == TYPE_DOUBLE
-                            /* The systems (mingw) which produce wrong output
-                               for Inf, -Inf, and NaN also do so for -0.0.
-                               Therefore we treat this case here as well.  */
-                            && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double))
+                         || (a.arg[dp->arg_index].type == TYPE_DOUBLE
+                             /* The systems (mingw) which produce wrong output
+                                for Inf, -Inf, and NaN also do so for -0.0.
+                                Therefore we treat this case here as well.  */
+                             && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double))
 # endif
 # if NEED_PRINTF_LONG_DOUBLE
-                        || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+                         || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
 # elif NEED_PRINTF_INFINITE_LONG_DOUBLE
-                        || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
-                            /* Some systems produce wrong output for Inf,
-                               -Inf, and NaN.  Some systems in this category
-                               (IRIX 5.3) also do so for -0.0.  Therefore we
-                               treat this case here as well.  */
-                            && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble))
+                         || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+                             /* Some systems produce wrong output for Inf,
+                                -Inf, and NaN.  Some systems in this category
+                                (IRIX 5.3) also do so for -0.0.  Therefore we
+                                treat this case here as well.  */
+                             && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble))
 # endif
-                       ))
-             {
+                        ))
+              {
 # if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE)
-               arg_type type = a.arg[dp->arg_index].type;
+                arg_type type = a.arg[dp->arg_index].type;
 # endif
-               int flags = dp->flags;
-               int has_width;
-               size_t width;
-               int has_precision;
-               size_t precision;
-               size_t tmp_length;
-               DCHAR_T tmpbuf[700];
-               DCHAR_T *tmp;
-               DCHAR_T *pad_ptr;
-               DCHAR_T *p;
-
-               has_width = 0;
-               width = 0;
-               if (dp->width_start != dp->width_end)
-                 {
-                   if (dp->width_arg_index != ARG_NONE)
-                     {
-                       int arg;
-
-                       if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
-                         abort ();
-                       arg = a.arg[dp->width_arg_index].a.a_int;
-                       if (arg < 0)
-                         {
-                           /* "A negative field width is taken as a '-' flag
-                               followed by a positive field width."  */
-                           flags |= FLAG_LEFT;
-                           width = (unsigned int) (-arg);
-                         }
-                       else
-                         width = arg;
-                     }
-                   else
-                     {
-                       const FCHAR_T *digitp = dp->width_start;
-
-                       do
-                         width = xsum (xtimes (width, 10), *digitp++ - '0');
-                       while (digitp != dp->width_end);
-                     }
-                   has_width = 1;
-                 }
-
-               has_precision = 0;
-               precision = 0;
-               if (dp->precision_start != dp->precision_end)
-                 {
-                   if (dp->precision_arg_index != ARG_NONE)
-                     {
-                       int arg;
-
-                       if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
-                         abort ();
-                       arg = a.arg[dp->precision_arg_index].a.a_int;
-                       /* "A negative precision is taken as if the precision
-                           were omitted."  */
-                       if (arg >= 0)
-                         {
-                           precision = arg;
-                           has_precision = 1;
-                         }
-                     }
-                   else
-                     {
-                       const FCHAR_T *digitp = dp->precision_start + 1;
-
-                       precision = 0;
-                       while (digitp != dp->precision_end)
-                         precision = xsum (xtimes (precision, 10), *digitp++ - '0');
-                       has_precision = 1;
-                     }
-                 }
-
-               /* POSIX specifies the default precision to be 6 for %f, %F,
-                  %e, %E, but not for %g, %G.  Implementations appear to use
-                  the same default precision also for %g, %G.  But for %a, %A,
-                  the default precision is 0.  */
-               if (!has_precision)
-                 if (!(dp->conversion == 'a' || dp->conversion == 'A'))
-                   precision = 6;
-
-               /* Allocate a temporary buffer of sufficient size.  */
+                int flags = dp->flags;
+                int has_width;
+                size_t width;
+                int has_precision;
+                size_t precision;
+                size_t tmp_length;
+                DCHAR_T tmpbuf[700];
+                DCHAR_T *tmp;
+                DCHAR_T *pad_ptr;
+                DCHAR_T *p;
+
+                has_width = 0;
+                width = 0;
+                if (dp->width_start != dp->width_end)
+                  {
+                    if (dp->width_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->width_arg_index].a.a_int;
+                        if (arg < 0)
+                          {
+                            /* "A negative field width is taken as a '-' flag
+                                followed by a positive field width."  */
+                            flags |= FLAG_LEFT;
+                            width = (unsigned int) (-arg);
+                          }
+                        else
+                          width = arg;
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->width_start;
+
+                        do
+                          width = xsum (xtimes (width, 10), *digitp++ - '0');
+                        while (digitp != dp->width_end);
+                      }
+                    has_width = 1;
+                  }
+
+                has_precision = 0;
+                precision = 0;
+                if (dp->precision_start != dp->precision_end)
+                  {
+                    if (dp->precision_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->precision_arg_index].a.a_int;
+                        /* "A negative precision is taken as if the precision
+                            were omitted."  */
+                        if (arg >= 0)
+                          {
+                            precision = arg;
+                            has_precision = 1;
+                          }
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->precision_start + 1;
+
+                        precision = 0;
+                        while (digitp != dp->precision_end)
+                          precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+                        has_precision = 1;
+                      }
+                  }
+
+                /* POSIX specifies the default precision to be 6 for %f, %F,
+                   %e, %E, but not for %g, %G.  Implementations appear to use
+                   the same default precision also for %g, %G.  But for %a, %A,
+                   the default precision is 0.  */
+                if (!has_precision)
+                  if (!(dp->conversion == 'a' || dp->conversion == 'A'))
+                    precision = 6;
+
+                /* Allocate a temporary buffer of sufficient size.  */
 # if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE
-               tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1);
+                tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1);
 # elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE
-               tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0);
+                tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0);
 # elif NEED_PRINTF_LONG_DOUBLE
-               tmp_length = LDBL_DIG + 1;
+                tmp_length = LDBL_DIG + 1;
 # elif NEED_PRINTF_DOUBLE
-               tmp_length = DBL_DIG + 1;
+                tmp_length = DBL_DIG + 1;
 # else
-               tmp_length = 0;
+                tmp_length = 0;
 # endif
-               if (tmp_length < precision)
-                 tmp_length = precision;
+                if (tmp_length < precision)
+                  tmp_length = precision;
 # if NEED_PRINTF_LONG_DOUBLE
 #  if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
-               if (type == TYPE_LONGDOUBLE)
+                if (type == TYPE_LONGDOUBLE)
 #  endif
-                 if (dp->conversion == 'f' || dp->conversion == 'F')
-                   {
-                     long double arg = a.arg[dp->arg_index].a.a_longdouble;
-                     if (!(isnanl (arg) || arg + arg == arg))
-                       {
-                         /* arg is finite and nonzero.  */
-                         int exponent = floorlog10l (arg < 0 ? -arg : arg);
-                         if (exponent >= 0 && tmp_length < exponent + precision)
-                           tmp_length = exponent + precision;
-                       }
-                   }
+                  if (dp->conversion == 'f' || dp->conversion == 'F')
+                    {
+                      long double arg = a.arg[dp->arg_index].a.a_longdouble;
+                      if (!(isnanl (arg) || arg + arg == arg))
+                        {
+                          /* arg is finite and nonzero.  */
+                          int exponent = floorlog10l (arg < 0 ? -arg : arg);
+                          if (exponent >= 0 && tmp_length < exponent + precision)
+                            tmp_length = exponent + precision;
+                        }
+                    }
 # endif
 # if NEED_PRINTF_DOUBLE
 #  if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
-               if (type == TYPE_DOUBLE)
+                if (type == TYPE_DOUBLE)
 #  endif
-                 if (dp->conversion == 'f' || dp->conversion == 'F')
-                   {
-                     double arg = a.arg[dp->arg_index].a.a_double;
-                     if (!(isnand (arg) || arg + arg == arg))
-                       {
-                         /* arg is finite and nonzero.  */
-                         int exponent = floorlog10 (arg < 0 ? -arg : arg);
-                         if (exponent >= 0 && tmp_length < exponent + precision)
-                           tmp_length = exponent + precision;
-                       }
-                   }
+                  if (dp->conversion == 'f' || dp->conversion == 'F')
+                    {
+                      double arg = a.arg[dp->arg_index].a.a_double;
+                      if (!(isnand (arg) || arg + arg == arg))
+                        {
+                          /* arg is finite and nonzero.  */
+                          int exponent = floorlog10 (arg < 0 ? -arg : arg);
+                          if (exponent >= 0 && tmp_length < exponent + precision)
+                            tmp_length = exponent + precision;
+                        }
+                    }
 # endif
-               /* Account for sign, decimal point etc. */
-               tmp_length = xsum (tmp_length, 12);
+                /* Account for sign, decimal point etc. */
+                tmp_length = xsum (tmp_length, 12);
 
-               if (tmp_length < width)
-                 tmp_length = width;
+                if (tmp_length < width)
+                  tmp_length = width;
 
-               tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+                tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
 
-               if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
-                 tmp = tmpbuf;
-               else
-                 {
-                   size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+                if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+                  tmp = tmpbuf;
+                else
+                  {
+                    size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
 
-                   if (size_overflow_p (tmp_memsize))
-                     /* Overflow, would lead to out of memory.  */
-                     goto out_of_memory;
-                   tmp = (DCHAR_T *) malloc (tmp_memsize);
-                   if (tmp == NULL)
-                     /* Out of memory.  */
-                     goto out_of_memory;
-                 }
+                    if (size_overflow_p (tmp_memsize))
+                      /* Overflow, would lead to out of memory.  */
+                      goto out_of_memory;
+                    tmp = (DCHAR_T *) malloc (tmp_memsize);
+                    if (tmp == NULL)
+                      /* Out of memory.  */
+                      goto out_of_memory;
+                  }
 
-               pad_ptr = NULL;
-               p = tmp;
+                pad_ptr = NULL;
+                p = tmp;
 
 # if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
 #  if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
-               if (type == TYPE_LONGDOUBLE)
+                if (type == TYPE_LONGDOUBLE)
 #  endif
-                 {
-                   long double arg = a.arg[dp->arg_index].a.a_longdouble;
-
-                   if (isnanl (arg))
-                     {
-                       if (dp->conversion >= 'A' && dp->conversion <= 'Z')
-                         {
-                           *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
-                         }
-                       else
-                         {
-                           *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
-                         }
-                     }
-                   else
-                     {
-                       int sign = 0;
-                       DECL_LONG_DOUBLE_ROUNDING
-
-                       BEGIN_LONG_DOUBLE_ROUNDING ();
-
-                       if (signbit (arg)) /* arg < 0.0L or negative zero */
-                         {
-                           sign = -1;
-                           arg = -arg;
-                         }
-
-                       if (sign < 0)
-                         *p++ = '-';
-                       else if (flags & FLAG_SHOWSIGN)
-                         *p++ = '+';
-                       else if (flags & FLAG_SPACE)
-                         *p++ = ' ';
-
-                       if (arg > 0.0L && arg + arg == arg)
-                         {
-                           if (dp->conversion >= 'A' && dp->conversion <= 'Z')
-                             {
-                               *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
-                             }
-                           else
-                             {
-                               *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
-                             }
-                         }
-                       else
-                         {
+                  {
+                    long double arg = a.arg[dp->arg_index].a.a_longdouble;
+
+                    if (isnanl (arg))
+                      {
+                        if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+                          {
+                            *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+                          }
+                        else
+                          {
+                            *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+                          }
+                      }
+                    else
+                      {
+                        int sign = 0;
+                        DECL_LONG_DOUBLE_ROUNDING
+
+                        BEGIN_LONG_DOUBLE_ROUNDING ();
+
+                        if (signbit (arg)) /* arg < 0.0L or negative zero */
+                          {
+                            sign = -1;
+                            arg = -arg;
+                          }
+
+                        if (sign < 0)
+                          *p++ = '-';
+                        else if (flags & FLAG_SHOWSIGN)
+                          *p++ = '+';
+                        else if (flags & FLAG_SPACE)
+                          *p++ = ' ';
+
+                        if (arg > 0.0L && arg + arg == arg)
+                          {
+                            if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+                              {
+                                *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+                              }
+                            else
+                              {
+                                *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+                              }
+                          }
+                        else
+                          {
 #  if NEED_PRINTF_LONG_DOUBLE
-                           pad_ptr = p;
-
-                           if (dp->conversion == 'f' || dp->conversion == 'F')
-                             {
-                               char *digits;
-                               size_t ndigits;
-
-                               digits =
-                                 scale10_round_decimal_long_double (arg, precision);
-                               if (digits == NULL)
-                                 {
-                                   END_LONG_DOUBLE_ROUNDING ();
-                                   goto out_of_memory;
-                                 }
-                               ndigits = strlen (digits);
-
-                               if (ndigits > precision)
-                                 do
-                                   {
-                                     --ndigits;
-                                     *p++ = digits[ndigits];
-                                   }
-                                 while (ndigits > precision);
-                               else
-                                 *p++ = '0';
-                               /* Here ndigits <= precision.  */
-                               if ((flags & FLAG_ALT) || precision > 0)
-                                 {
-                                   *p++ = decimal_point_char ();
-                                   for (; precision > ndigits; precision--)
-                                     *p++ = '0';
-                                   while (ndigits > 0)
-                                     {
-                                       --ndigits;
-                                       *p++ = digits[ndigits];
-                                     }
-                                 }
-
-                               free (digits);
-                             }
-                           else if (dp->conversion == 'e' || dp->conversion == 'E')
-                             {
-                               int exponent;
-
-                               if (arg == 0.0L)
-                                 {
-                                   exponent = 0;
-                                   *p++ = '0';
-                                   if ((flags & FLAG_ALT) || precision > 0)
-                                     {
-                                       *p++ = decimal_point_char ();
-                                       for (; precision > 0; precision--)
-                                         *p++ = '0';
-                                     }
-                                 }
-                               else
-                                 {
-                                   /* arg > 0.0L.  */
-                                   int adjusted;
-                                   char *digits;
-                                   size_t ndigits;
-
-                                   exponent = floorlog10l (arg);
-                                   adjusted = 0;
-                                   for (;;)
-                                     {
-                                       digits =
-                                         scale10_round_decimal_long_double (arg,
-                                                                            (int)precision - exponent);
-                                       if (digits == NULL)
-                                         {
-                                           END_LONG_DOUBLE_ROUNDING ();
-                                           goto out_of_memory;
-                                         }
-                                       ndigits = strlen (digits);
-
-                                       if (ndigits == precision + 1)
-                                         break;
-                                       if (ndigits < precision
-                                           || ndigits > precision + 2)
-                                         /* The exponent was not guessed
-                                            precisely enough.  */
-                                         abort ();
-                                       if (adjusted)
-                                         /* None of two values of exponent is
-                                            the right one.  Prevent an endless
-                                            loop.  */
-                                         abort ();
-                                       free (digits);
-                                       if (ndigits == precision)
-                                         exponent -= 1;
-                                       else
-                                         exponent += 1;
-                                       adjusted = 1;
-                                     }
-                                   /* Here ndigits = precision+1.  */
-                                   if (is_borderline (digits, precision))
-                                     {
-                                       /* Maybe the exponent guess was too high
-                                          and a smaller exponent can be reached
-                                          by turning a 10...0 into 9...9x.  */
-                                       char *digits2 =
-                                         scale10_round_decimal_long_double (arg,
-                                                                            (int)precision - exponent + 1);
-                                       if (digits2 == NULL)
-                                         {
-                                           free (digits);
-                                           END_LONG_DOUBLE_ROUNDING ();
-                                           goto out_of_memory;
-                                         }
-                                       if (strlen (digits2) == precision + 1)
-                                         {
-                                           free (digits);
-                                           digits = digits2;
-                                           exponent -= 1;
-                                         }
-                                       else
-                                         free (digits2);
-                                     }
-                                   /* Here ndigits = precision+1.  */
-
-                                   *p++ = digits[--ndigits];
-                                   if ((flags & FLAG_ALT) || precision > 0)
-                                     {
-                                       *p++ = decimal_point_char ();
-                                       while (ndigits > 0)
-                                         {
-                                           --ndigits;
-                                           *p++ = digits[ndigits];
-                                         }
-                                     }
-
-                                   free (digits);
-                                 }
-
-                               *p++ = dp->conversion; /* 'e' or 'E' */
+                            pad_ptr = p;
+
+                            if (dp->conversion == 'f' || dp->conversion == 'F')
+                              {
+                                char *digits;
+                                size_t ndigits;
+
+                                digits =
+                                  scale10_round_decimal_long_double (arg, precision);
+                                if (digits == NULL)
+                                  {
+                                    END_LONG_DOUBLE_ROUNDING ();
+                                    goto out_of_memory;
+                                  }
+                                ndigits = strlen (digits);
+
+                                if (ndigits > precision)
+                                  do
+                                    {
+                                      --ndigits;
+                                      *p++ = digits[ndigits];
+                                    }
+                                  while (ndigits > precision);
+                                else
+                                  *p++ = '0';
+                                /* Here ndigits <= precision.  */
+                                if ((flags & FLAG_ALT) || precision > 0)
+                                  {
+                                    *p++ = decimal_point_char ();
+                                    for (; precision > ndigits; precision--)
+                                      *p++ = '0';
+                                    while (ndigits > 0)
+                                      {
+                                        --ndigits;
+                                        *p++ = digits[ndigits];
+                                      }
+                                  }
+
+                                free (digits);
+                              }
+                            else if (dp->conversion == 'e' || dp->conversion == 'E')
+                              {
+                                int exponent;
+
+                                if (arg == 0.0L)
+                                  {
+                                    exponent = 0;
+                                    *p++ = '0';
+                                    if ((flags & FLAG_ALT) || precision > 0)
+                                      {
+                                        *p++ = decimal_point_char ();
+                                        for (; precision > 0; precision--)
+                                          *p++ = '0';
+                                      }
+                                  }
+                                else
+                                  {
+                                    /* arg > 0.0L.  */
+                                    int adjusted;
+                                    char *digits;
+                                    size_t ndigits;
+
+                                    exponent = floorlog10l (arg);
+                                    adjusted = 0;
+                                    for (;;)
+                                      {
+                                        digits =
+                                          scale10_round_decimal_long_double (arg,
+                                                                             (int)precision - exponent);
+                                        if (digits == NULL)
+                                          {
+                                            END_LONG_DOUBLE_ROUNDING ();
+                                            goto out_of_memory;
+                                          }
+                                        ndigits = strlen (digits);
+
+                                        if (ndigits == precision + 1)
+                                          break;
+                                        if (ndigits < precision
+                                            || ndigits > precision + 2)
+                                          /* The exponent was not guessed
+                                             precisely enough.  */
+                                          abort ();
+                                        if (adjusted)
+                                          /* None of two values of exponent is
+                                             the right one.  Prevent an endless
+                                             loop.  */
+                                          abort ();
+                                        free (digits);
+                                        if (ndigits == precision)
+                                          exponent -= 1;
+                                        else
+                                          exponent += 1;
+                                        adjusted = 1;
+                                      }
+                                    /* Here ndigits = precision+1.  */
+                                    if (is_borderline (digits, precision))
+                                      {
+                                        /* Maybe the exponent guess was too high
+                                           and a smaller exponent can be reached
+                                           by turning a 10...0 into 9...9x.  */
+                                        char *digits2 =
+                                          scale10_round_decimal_long_double (arg,
+                                                                             (int)precision - exponent + 1);
+                                        if (digits2 == NULL)
+                                          {
+                                            free (digits);
+                                            END_LONG_DOUBLE_ROUNDING ();
+                                            goto out_of_memory;
+                                          }
+                                        if (strlen (digits2) == precision + 1)
+                                          {
+                                            free (digits);
+                                            digits = digits2;
+                                            exponent -= 1;
+                                          }
+                                        else
+                                          free (digits2);
+                                      }
+                                    /* Here ndigits = precision+1.  */
+
+                                    *p++ = digits[--ndigits];
+                                    if ((flags & FLAG_ALT) || precision > 0)
+                                      {
+                                        *p++ = decimal_point_char ();
+                                        while (ndigits > 0)
+                                          {
+                                            --ndigits;
+                                            *p++ = digits[ndigits];
+                                          }
+                                      }
+
+                                    free (digits);
+                                  }
+
+                                *p++ = dp->conversion; /* 'e' or 'E' */
 #   if WIDE_CHAR_VERSION
-                               {
-                                 static const wchar_t decimal_format[] =
-                                   { '%', '+', '.', '2', 'd', '\0' };
-                                 SNPRINTF (p, 6 + 1, decimal_format, exponent);
-                               }
-                               while (*p != '\0')
-                                 p++;
+                                {
+                                  static const wchar_t decimal_format[] =
+                                    { '%', '+', '.', '2', 'd', '\0' };
+                                  SNPRINTF (p, 6 + 1, decimal_format, exponent);
+                                }
+                                while (*p != '\0')
+                                  p++;
 #   else
-                               if (sizeof (DCHAR_T) == 1)
-                                 {
-                                   sprintf ((char *) p, "%+.2d", exponent);
-                                   while (*p != '\0')
-                                     p++;
-                                 }
-                               else
-                                 {
-                                   char expbuf[6 + 1];
-                                   const char *ep;
-                                   sprintf (expbuf, "%+.2d", exponent);
-                                   for (ep = expbuf; (*p = *ep) != '\0'; ep++)
-                                     p++;
-                                 }
+                                if (sizeof (DCHAR_T) == 1)
+                                  {
+                                    sprintf ((char *) p, "%+.2d", exponent);
+                                    while (*p != '\0')
+                                      p++;
+                                  }
+                                else
+                                  {
+                                    char expbuf[6 + 1];
+                                    const char *ep;
+                                    sprintf (expbuf, "%+.2d", exponent);
+                                    for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+                                      p++;
+                                  }
 #   endif
-                             }
-                           else if (dp->conversion == 'g' || dp->conversion == 'G')
-                             {
-                               if (precision == 0)
-                                 precision = 1;
-                               /* precision >= 1.  */
-
-                               if (arg == 0.0L)
-                                 /* The exponent is 0, >= -4, < precision.
-                                    Use fixed-point notation.  */
-                                 {
-                                   size_t ndigits = precision;
-                                   /* Number of trailing zeroes that have to be
-                                      dropped.  */
-                                   size_t nzeroes =
-                                     (flags & FLAG_ALT ? 0 : precision - 1);
-
-                                   --ndigits;
-                                   *p++ = '0';
-                                   if ((flags & FLAG_ALT) || ndigits > nzeroes)
-                                     {
-                                       *p++ = decimal_point_char ();
-                                       while (ndigits > nzeroes)
-                                         {
-                                           --ndigits;
-                                           *p++ = '0';
-                                         }
-                                     }
-                                 }
-                               else
-                                 {
-                                   /* arg > 0.0L.  */
-                                   int exponent;
-                                   int adjusted;
-                                   char *digits;
-                                   size_t ndigits;
-                                   size_t nzeroes;
-
-                                   exponent = floorlog10l (arg);
-                                   adjusted = 0;
-                                   for (;;)
-                                     {
-                                       digits =
-                                         scale10_round_decimal_long_double (arg,
-                                                                            (int)(precision - 1) - exponent);
-                                       if (digits == NULL)
-                                         {
-                                           END_LONG_DOUBLE_ROUNDING ();
-                                           goto out_of_memory;
-                                         }
-                                       ndigits = strlen (digits);
-
-                                       if (ndigits == precision)
-                                         break;
-                                       if (ndigits < precision - 1
-                                           || ndigits > precision + 1)
-                                         /* The exponent was not guessed
-                                            precisely enough.  */
-                                         abort ();
-                                       if (adjusted)
-                                         /* None of two values of exponent is
-                                            the right one.  Prevent an endless
-                                            loop.  */
-                                         abort ();
-                                       free (digits);
-                                       if (ndigits < precision)
-                                         exponent -= 1;
-                                       else
-                                         exponent += 1;
-                                       adjusted = 1;
-                                     }
-                                   /* Here ndigits = precision.  */
-                                   if (is_borderline (digits, precision - 1))
-                                     {
-                                       /* Maybe the exponent guess was too high
-                                          and a smaller exponent can be reached
-                                          by turning a 10...0 into 9...9x.  */
-                                       char *digits2 =
-                                         scale10_round_decimal_long_double (arg,
-                                                                            (int)(precision - 1) - exponent + 1);
-                                       if (digits2 == NULL)
-                                         {
-                                           free (digits);
-                                           END_LONG_DOUBLE_ROUNDING ();
-                                           goto out_of_memory;
-                                         }
-                                       if (strlen (digits2) == precision)
-                                         {
-                                           free (digits);
-                                           digits = digits2;
-                                           exponent -= 1;
-                                         }
-                                       else
-                                         free (digits2);
-                                     }
-                                   /* Here ndigits = precision.  */
-
-                                   /* Determine the number of trailing zeroes
-                                      that have to be dropped.  */
-                                   nzeroes = 0;
-                                   if ((flags & FLAG_ALT) == 0)
-                                     while (nzeroes < ndigits
-                                            && digits[nzeroes] == '0')
-                                       nzeroes++;
-
-                                   /* The exponent is now determined.  */
-                                   if (exponent >= -4
-                                       && exponent < (long)precision)
-                                     {
-                                       /* Fixed-point notation:
-                                          max(exponent,0)+1 digits, then the
-                                          decimal point, then the remaining
-                                          digits without trailing zeroes.  */
-                                       if (exponent >= 0)
-                                         {
-                                           size_t count = exponent + 1;
-                                           /* Note: count <= precision = ndigits.  */
-                                           for (; count > 0; count--)
-                                             *p++ = digits[--ndigits];
-                                           if ((flags & FLAG_ALT) || ndigits > nzeroes)
-                                             {
-                                               *p++ = decimal_point_char ();
-                                               while (ndigits > nzeroes)
-                                                 {
-                                                   --ndigits;
-                                                   *p++ = digits[ndigits];
-                                                 }
-                                             }
-                                         }
-                                       else
-                                         {
-                                           size_t count = -exponent - 1;
-                                           *p++ = '0';
-                                           *p++ = decimal_point_char ();
-                                           for (; count > 0; count--)
-                                             *p++ = '0';
-                                           while (ndigits > nzeroes)
-                                             {
-                                               --ndigits;
-                                               *p++ = digits[ndigits];
-                                             }
-                                         }
-                                     }
-                                   else
-                                     {
-                                       /* Exponential notation.  */
-                                       *p++ = digits[--ndigits];
-                                       if ((flags & FLAG_ALT) || ndigits > nzeroes)
-                                         {
-                                           *p++ = decimal_point_char ();
-                                           while (ndigits > nzeroes)
-                                             {
-                                               --ndigits;
-                                               *p++ = digits[ndigits];
-                                             }
-                                         }
-                                       *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
+                              }
+                            else if (dp->conversion == 'g' || dp->conversion == 'G')
+                              {
+                                if (precision == 0)
+                                  precision = 1;
+                                /* precision >= 1.  */
+
+                                if (arg == 0.0L)
+                                  /* The exponent is 0, >= -4, < precision.
+                                     Use fixed-point notation.  */
+                                  {
+                                    size_t ndigits = precision;
+                                    /* Number of trailing zeroes that have to be
+                                       dropped.  */
+                                    size_t nzeroes =
+                                      (flags & FLAG_ALT ? 0 : precision - 1);
+
+                                    --ndigits;
+                                    *p++ = '0';
+                                    if ((flags & FLAG_ALT) || ndigits > nzeroes)
+                                      {
+                                        *p++ = decimal_point_char ();
+                                        while (ndigits > nzeroes)
+                                          {
+                                            --ndigits;
+                                            *p++ = '0';
+                                          }
+                                      }
+                                  }
+                                else
+                                  {
+                                    /* arg > 0.0L.  */
+                                    int exponent;
+                                    int adjusted;
+                                    char *digits;
+                                    size_t ndigits;
+                                    size_t nzeroes;
+
+                                    exponent = floorlog10l (arg);
+                                    adjusted = 0;
+                                    for (;;)
+                                      {
+                                        digits =
+                                          scale10_round_decimal_long_double (arg,
+                                                                             (int)(precision - 1) - exponent);
+                                        if (digits == NULL)
+                                          {
+                                            END_LONG_DOUBLE_ROUNDING ();
+                                            goto out_of_memory;
+                                          }
+                                        ndigits = strlen (digits);
+
+                                        if (ndigits == precision)
+                                          break;
+                                        if (ndigits < precision - 1
+                                            || ndigits > precision + 1)
+                                          /* The exponent was not guessed
+                                             precisely enough.  */
+                                          abort ();
+                                        if (adjusted)
+                                          /* None of two values of exponent is
+                                             the right one.  Prevent an endless
+                                             loop.  */
+                                          abort ();
+                                        free (digits);
+                                        if (ndigits < precision)
+                                          exponent -= 1;
+                                        else
+                                          exponent += 1;
+                                        adjusted = 1;
+                                      }
+                                    /* Here ndigits = precision.  */
+                                    if (is_borderline (digits, precision - 1))
+                                      {
+                                        /* Maybe the exponent guess was too high
+                                           and a smaller exponent can be reached
+                                           by turning a 10...0 into 9...9x.  */
+                                        char *digits2 =
+                                          scale10_round_decimal_long_double (arg,
+                                                                             (int)(precision - 1) - exponent + 1);
+                                        if (digits2 == NULL)
+                                          {
+                                            free (digits);
+                                            END_LONG_DOUBLE_ROUNDING ();
+                                            goto out_of_memory;
+                                          }
+                                        if (strlen (digits2) == precision)
+                                          {
+                                            free (digits);
+                                            digits = digits2;
+                                            exponent -= 1;
+                                          }
+                                        else
+                                          free (digits2);
+                                      }
+                                    /* Here ndigits = precision.  */
+
+                                    /* Determine the number of trailing zeroes
+                                       that have to be dropped.  */
+                                    nzeroes = 0;
+                                    if ((flags & FLAG_ALT) == 0)
+                                      while (nzeroes < ndigits
+                                             && digits[nzeroes] == '0')
+                                        nzeroes++;
+
+                                    /* The exponent is now determined.  */
+                                    if (exponent >= -4
+                                        && exponent < (long)precision)
+                                      {
+                                        /* Fixed-point notation:
+                                           max(exponent,0)+1 digits, then the
+                                           decimal point, then the remaining
+                                           digits without trailing zeroes.  */
+                                        if (exponent >= 0)
+                                          {
+                                            size_t count = exponent + 1;
+                                            /* Note: count <= precision = ndigits.  */
+                                            for (; count > 0; count--)
+                                              *p++ = digits[--ndigits];
+                                            if ((flags & FLAG_ALT) || ndigits > nzeroes)
+                                              {
+                                                *p++ = decimal_point_char ();
+                                                while (ndigits > nzeroes)
+                                                  {
+                                                    --ndigits;
+                                                    *p++ = digits[ndigits];
+                                                  }
+                                              }
+                                          }
+                                        else
+                                          {
+                                            size_t count = -exponent - 1;
+                                            *p++ = '0';
+                                            *p++ = decimal_point_char ();
+                                            for (; count > 0; count--)
+                                              *p++ = '0';
+                                            while (ndigits > nzeroes)
+                                              {
+                                                --ndigits;
+                                                *p++ = digits[ndigits];
+                                              }
+                                          }
+                                      }
+                                    else
+                                      {
+                                        /* Exponential notation.  */
+                                        *p++ = digits[--ndigits];
+                                        if ((flags & FLAG_ALT) || ndigits > nzeroes)
+                                          {
+                                            *p++ = decimal_point_char ();
+                                            while (ndigits > nzeroes)
+                                              {
+                                                --ndigits;
+                                                *p++ = digits[ndigits];
+                                              }
+                                          }
+                                        *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
 #   if WIDE_CHAR_VERSION
-                                       {
-                                         static const wchar_t decimal_format[] =
-                                           { '%', '+', '.', '2', 'd', '\0' };
-                                         SNPRINTF (p, 6 + 1, decimal_format, exponent);
-                                       }
-                                       while (*p != '\0')
-                                         p++;
+                                        {
+                                          static const wchar_t decimal_format[] =
+                                            { '%', '+', '.', '2', 'd', '\0' };
+                                          SNPRINTF (p, 6 + 1, decimal_format, exponent);
+                                        }
+                                        while (*p != '\0')
+                                          p++;
 #   else
-                                       if (sizeof (DCHAR_T) == 1)
-                                         {
-                                           sprintf ((char *) p, "%+.2d", exponent);
-                                           while (*p != '\0')
-                                             p++;
-                                         }
-                                       else
-                                         {
-                                           char expbuf[6 + 1];
-                                           const char *ep;
-                                           sprintf (expbuf, "%+.2d", exponent);
-                                           for (ep = expbuf; (*p = *ep) != '\0'; ep++)
-                                             p++;
-                                         }
+                                        if (sizeof (DCHAR_T) == 1)
+                                          {
+                                            sprintf ((char *) p, "%+.2d", exponent);
+                                            while (*p != '\0')
+                                              p++;
+                                          }
+                                        else
+                                          {
+                                            char expbuf[6 + 1];
+                                            const char *ep;
+                                            sprintf (expbuf, "%+.2d", exponent);
+                                            for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+                                              p++;
+                                          }
 #   endif
-                                     }
+                                      }
 
-                                   free (digits);
-                                 }
-                             }
-                           else
-                             abort ();
+                                    free (digits);
+                                  }
+                              }
+                            else
+                              abort ();
 #  else
-                           /* arg is finite.  */
-                           if (!(arg == 0.0L))
-                             abort ();
-
-                           pad_ptr = p;
-
-                           if (dp->conversion == 'f' || dp->conversion == 'F')
-                             {
-                               *p++ = '0';
-                               if ((flags & FLAG_ALT) || precision > 0)
-                                 {
-                                   *p++ = decimal_point_char ();
-                                   for (; precision > 0; precision--)
-                                     *p++ = '0';
-                                 }
-                             }
-                           else if (dp->conversion == 'e' || dp->conversion == 'E')
-                             {
-                               *p++ = '0';
-                               if ((flags & FLAG_ALT) || precision > 0)
-                                 {
-                                   *p++ = decimal_point_char ();
-                                   for (; precision > 0; precision--)
-                                     *p++ = '0';
-                                 }
-                               *p++ = dp->conversion; /* 'e' or 'E' */
-                               *p++ = '+';
-                               *p++ = '0';
-                               *p++ = '0';
-                             }
-                           else if (dp->conversion == 'g' || dp->conversion == 'G')
-                             {
-                               *p++ = '0';
-                               if (flags & FLAG_ALT)
-                                 {
-                                   size_t ndigits =
-                                     (precision > 0 ? precision - 1 : 0);
-                                   *p++ = decimal_point_char ();
-                                   for (; ndigits > 0; --ndigits)
-                                     *p++ = '0';
-                                 }
-                             }
-                           else if (dp->conversion == 'a' || dp->conversion == 'A')
-                             {
-                               *p++ = '0';
-                               *p++ = dp->conversion - 'A' + 'X';
-                               pad_ptr = p;
-                               *p++ = '0';
-                               if ((flags & FLAG_ALT) || precision > 0)
-                                 {
-                                   *p++ = decimal_point_char ();
-                                   for (; precision > 0; precision--)
-                                     *p++ = '0';
-                                 }
-                               *p++ = dp->conversion - 'A' + 'P';
-                               *p++ = '+';
-                               *p++ = '0';
-                             }
-                           else
-                             abort ();
+                            /* arg is finite.  */
+                            if (!(arg == 0.0L))
+                              abort ();
+
+                            pad_ptr = p;
+
+                            if (dp->conversion == 'f' || dp->conversion == 'F')
+                              {
+                                *p++ = '0';
+                                if ((flags & FLAG_ALT) || precision > 0)
+                                  {
+                                    *p++ = decimal_point_char ();
+                                    for (; precision > 0; precision--)
+                                      *p++ = '0';
+                                  }
+                              }
+                            else if (dp->conversion == 'e' || dp->conversion == 'E')
+                              {
+                                *p++ = '0';
+                                if ((flags & FLAG_ALT) || precision > 0)
+                                  {
+                                    *p++ = decimal_point_char ();
+                                    for (; precision > 0; precision--)
+                                      *p++ = '0';
+                                  }
+                                *p++ = dp->conversion; /* 'e' or 'E' */
+                                *p++ = '+';
+                                *p++ = '0';
+                                *p++ = '0';
+                              }
+                            else if (dp->conversion == 'g' || dp->conversion == 'G')
+                              {
+                                *p++ = '0';
+                                if (flags & FLAG_ALT)
+                                  {
+                                    size_t ndigits =
+                                      (precision > 0 ? precision - 1 : 0);
+                                    *p++ = decimal_point_char ();
+                                    for (; ndigits > 0; --ndigits)
+                                      *p++ = '0';
+                                  }
+                              }
+                            else if (dp->conversion == 'a' || dp->conversion == 'A')
+                              {
+                                *p++ = '0';
+                                *p++ = dp->conversion - 'A' + 'X';
+                                pad_ptr = p;
+                                *p++ = '0';
+                                if ((flags & FLAG_ALT) || precision > 0)
+                                  {
+                                    *p++ = decimal_point_char ();
+                                    for (; precision > 0; precision--)
+                                      *p++ = '0';
+                                  }
+                                *p++ = dp->conversion - 'A' + 'P';
+                                *p++ = '+';
+                                *p++ = '0';
+                              }
+                            else
+                              abort ();
 #  endif
-                         }
+                          }
 
-                       END_LONG_DOUBLE_ROUNDING ();
-                     }
-                 }
+                        END_LONG_DOUBLE_ROUNDING ();
+                      }
+                  }
 #  if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
-               else
+                else
 #  endif
 # endif
 # if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
-                 {
-                   double arg = a.arg[dp->arg_index].a.a_double;
-
-                   if (isnand (arg))
-                     {
-                       if (dp->conversion >= 'A' && dp->conversion <= 'Z')
-                         {
-                           *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
-                         }
-                       else
-                         {
-                           *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
-                         }
-                     }
-                   else
-                     {
-                       int sign = 0;
-
-                       if (signbit (arg)) /* arg < 0.0 or negative zero */
-                         {
-                           sign = -1;
-                           arg = -arg;
-                         }
-
-                       if (sign < 0)
-                         *p++ = '-';
-                       else if (flags & FLAG_SHOWSIGN)
-                         *p++ = '+';
-                       else if (flags & FLAG_SPACE)
-                         *p++ = ' ';
-
-                       if (arg > 0.0 && arg + arg == arg)
-                         {
-                           if (dp->conversion >= 'A' && dp->conversion <= 'Z')
-                             {
-                               *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
-                             }
-                           else
-                             {
-                               *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
-                             }
-                         }
-                       else
-                         {
+                  {
+                    double arg = a.arg[dp->arg_index].a.a_double;
+
+                    if (isnand (arg))
+                      {
+                        if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+                          {
+                            *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+                          }
+                        else
+                          {
+                            *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+                          }
+                      }
+                    else
+                      {
+                        int sign = 0;
+
+                        if (signbit (arg)) /* arg < 0.0 or negative zero */
+                          {
+                            sign = -1;
+                            arg = -arg;
+                          }
+
+                        if (sign < 0)
+                          *p++ = '-';
+                        else if (flags & FLAG_SHOWSIGN)
+                          *p++ = '+';
+                        else if (flags & FLAG_SPACE)
+                          *p++ = ' ';
+
+                        if (arg > 0.0 && arg + arg == arg)
+                          {
+                            if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+                              {
+                                *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+                              }
+                            else
+                              {
+                                *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+                              }
+                          }
+                        else
+                          {
 #  if NEED_PRINTF_DOUBLE
-                           pad_ptr = p;
-
-                           if (dp->conversion == 'f' || dp->conversion == 'F')
-                             {
-                               char *digits;
-                               size_t ndigits;
-
-                               digits =
-                                 scale10_round_decimal_double (arg, precision);
-                               if (digits == NULL)
-                                 goto out_of_memory;
-                               ndigits = strlen (digits);
-
-                               if (ndigits > precision)
-                                 do
-                                   {
-                                     --ndigits;
-                                     *p++ = digits[ndigits];
-                                   }
-                                 while (ndigits > precision);
-                               else
-                                 *p++ = '0';
-                               /* Here ndigits <= precision.  */
-                               if ((flags & FLAG_ALT) || precision > 0)
-                                 {
-                                   *p++ = decimal_point_char ();
-                                   for (; precision > ndigits; precision--)
-                                     *p++ = '0';
-                                   while (ndigits > 0)
-                                     {
-                                       --ndigits;
-                                       *p++ = digits[ndigits];
-                                     }
-                                 }
-
-                               free (digits);
-                             }
-                           else if (dp->conversion == 'e' || dp->conversion == 'E')
-                             {
-                               int exponent;
-
-                               if (arg == 0.0)
-                                 {
-                                   exponent = 0;
-                                   *p++ = '0';
-                                   if ((flags & FLAG_ALT) || precision > 0)
-                                     {
-                                       *p++ = decimal_point_char ();
-                                       for (; precision > 0; precision--)
-                                         *p++ = '0';
-                                     }
-                                 }
-                               else
-                                 {
-                                   /* arg > 0.0.  */
-                                   int adjusted;
-                                   char *digits;
-                                   size_t ndigits;
-
-                                   exponent = floorlog10 (arg);
-                                   adjusted = 0;
-                                   for (;;)
-                                     {
-                                       digits =
-                                         scale10_round_decimal_double (arg,
-                                                                       (int)precision - exponent);
-                                       if (digits == NULL)
-                                         goto out_of_memory;
-                                       ndigits = strlen (digits);
-
-                                       if (ndigits == precision + 1)
-                                         break;
-                                       if (ndigits < precision
-                                           || ndigits > precision + 2)
-                                         /* The exponent was not guessed
-                                            precisely enough.  */
-                                         abort ();
-                                       if (adjusted)
-                                         /* None of two values of exponent is
-                                            the right one.  Prevent an endless
-                                            loop.  */
-                                         abort ();
-                                       free (digits);
-                                       if (ndigits == precision)
-                                         exponent -= 1;
-                                       else
-                                         exponent += 1;
-                                       adjusted = 1;
-                                     }
-                                   /* Here ndigits = precision+1.  */
-                                   if (is_borderline (digits, precision))
-                                     {
-                                       /* Maybe the exponent guess was too high
-                                          and a smaller exponent can be reached
-                                          by turning a 10...0 into 9...9x.  */
-                                       char *digits2 =
-                                         scale10_round_decimal_double (arg,
-                                                                       (int)precision - exponent + 1);
-                                       if (digits2 == NULL)
-                                         {
-                                           free (digits);
-                                           goto out_of_memory;
-                                         }
-                                       if (strlen (digits2) == precision + 1)
-                                         {
-                                           free (digits);
-                                           digits = digits2;
-                                           exponent -= 1;
-                                         }
-                                       else
-                                         free (digits2);
-                                     }
-                                   /* Here ndigits = precision+1.  */
-
-                                   *p++ = digits[--ndigits];
-                                   if ((flags & FLAG_ALT) || precision > 0)
-                                     {
-                                       *p++ = decimal_point_char ();
-                                       while (ndigits > 0)
-                                         {
-                                           --ndigits;
-                                           *p++ = digits[ndigits];
-                                         }
-                                     }
-
-                                   free (digits);
-                                 }
-
-                               *p++ = dp->conversion; /* 'e' or 'E' */
+                            pad_ptr = p;
+
+                            if (dp->conversion == 'f' || dp->conversion == 'F')
+                              {
+                                char *digits;
+                                size_t ndigits;
+
+                                digits =
+                                  scale10_round_decimal_double (arg, precision);
+                                if (digits == NULL)
+                                  goto out_of_memory;
+                                ndigits = strlen (digits);
+
+                                if (ndigits > precision)
+                                  do
+                                    {
+                                      --ndigits;
+                                      *p++ = digits[ndigits];
+                                    }
+                                  while (ndigits > precision);
+                                else
+                                  *p++ = '0';
+                                /* Here ndigits <= precision.  */
+                                if ((flags & FLAG_ALT) || precision > 0)
+                                  {
+                                    *p++ = decimal_point_char ();
+                                    for (; precision > ndigits; precision--)
+                                      *p++ = '0';
+                                    while (ndigits > 0)
+                                      {
+                                        --ndigits;
+                                        *p++ = digits[ndigits];
+                                      }
+                                  }
+
+                                free (digits);
+                              }
+                            else if (dp->conversion == 'e' || dp->conversion == 'E')
+                              {
+                                int exponent;
+
+                                if (arg == 0.0)
+                                  {
+                                    exponent = 0;
+                                    *p++ = '0';
+                                    if ((flags & FLAG_ALT) || precision > 0)
+                                      {
+                                        *p++ = decimal_point_char ();
+                                        for (; precision > 0; precision--)
+                                          *p++ = '0';
+                                      }
+                                  }
+                                else
+                                  {
+                                    /* arg > 0.0.  */
+                                    int adjusted;
+                                    char *digits;
+                                    size_t ndigits;
+
+                                    exponent = floorlog10 (arg);
+                                    adjusted = 0;
+                                    for (;;)
+                                      {
+                                        digits =
+                                          scale10_round_decimal_double (arg,
+                                                                        (int)precision - exponent);
+                                        if (digits == NULL)
+                                          goto out_of_memory;
+                                        ndigits = strlen (digits);
+
+                                        if (ndigits == precision + 1)
+                                          break;
+                                        if (ndigits < precision
+                                            || ndigits > precision + 2)
+                                          /* The exponent was not guessed
+                                             precisely enough.  */
+                                          abort ();
+                                        if (adjusted)
+                                          /* None of two values of exponent is
+                                             the right one.  Prevent an endless
+                                             loop.  */
+                                          abort ();
+                                        free (digits);
+                                        if (ndigits == precision)
+                                          exponent -= 1;
+                                        else
+                                          exponent += 1;
+                                        adjusted = 1;
+                                      }
+                                    /* Here ndigits = precision+1.  */
+                                    if (is_borderline (digits, precision))
+                                      {
+                                        /* Maybe the exponent guess was too high
+                                           and a smaller exponent can be reached
+                                           by turning a 10...0 into 9...9x.  */
+                                        char *digits2 =
+                                          scale10_round_decimal_double (arg,
+                                                                        (int)precision - exponent + 1);
+                                        if (digits2 == NULL)
+                                          {
+                                            free (digits);
+                                            goto out_of_memory;
+                                          }
+                                        if (strlen (digits2) == precision + 1)
+                                          {
+                                            free (digits);
+                                            digits = digits2;
+                                            exponent -= 1;
+                                          }
+                                        else
+                                          free (digits2);
+                                      }
+                                    /* Here ndigits = precision+1.  */
+
+                                    *p++ = digits[--ndigits];
+                                    if ((flags & FLAG_ALT) || precision > 0)
+                                      {
+                                        *p++ = decimal_point_char ();
+                                        while (ndigits > 0)
+                                          {
+                                            --ndigits;
+                                            *p++ = digits[ndigits];
+                                          }
+                                      }
+
+                                    free (digits);
+                                  }
+
+                                *p++ = dp->conversion; /* 'e' or 'E' */
 #   if WIDE_CHAR_VERSION
-                               {
-                                 static const wchar_t decimal_format[] =
-                                   /* Produce the same number of exponent digits
-                                      as the native printf implementation.  */
+                                {
+                                  static const wchar_t decimal_format[] =
+                                    /* Produce the same number of exponent digits
+                                       as the native printf implementation.  */
 #    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-                                   { '%', '+', '.', '3', 'd', '\0' };
+                                    { '%', '+', '.', '3', 'd', '\0' };
 #    else
-                                   { '%', '+', '.', '2', 'd', '\0' };
+                                    { '%', '+', '.', '2', 'd', '\0' };
 #    endif
-                                 SNPRINTF (p, 6 + 1, decimal_format, exponent);
-                               }
-                               while (*p != '\0')
-                                 p++;
+                                  SNPRINTF (p, 6 + 1, decimal_format, exponent);
+                                }
+                                while (*p != '\0')
+                                  p++;
 #   else
-                               {
-                                 static const char decimal_format[] =
-                                   /* Produce the same number of exponent digits
-                                      as the native printf implementation.  */
+                                {
+                                  static const char decimal_format[] =
+                                    /* Produce the same number of exponent digits
+                                       as the native printf implementation.  */
 #    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-                                   "%+.3d";
+                                    "%+.3d";
 #    else
-                                   "%+.2d";
+                                    "%+.2d";
 #    endif
-                                 if (sizeof (DCHAR_T) == 1)
-                                   {
-                                     sprintf ((char *) p, decimal_format, exponent);
-                                     while (*p != '\0')
-                                       p++;
-                                   }
-                                 else
-                                   {
-                                     char expbuf[6 + 1];
-                                     const char *ep;
-                                     sprintf (expbuf, decimal_format, exponent);
-                                     for (ep = expbuf; (*p = *ep) != '\0'; ep++)
-                                       p++;
-                                   }
-                               }
+                                  if (sizeof (DCHAR_T) == 1)
+                                    {
+                                      sprintf ((char *) p, decimal_format, exponent);
+                                      while (*p != '\0')
+                                        p++;
+                                    }
+                                  else
+                                    {
+                                      char expbuf[6 + 1];
+                                      const char *ep;
+                                      sprintf (expbuf, decimal_format, exponent);
+                                      for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+                                        p++;
+                                    }
+                                }
 #   endif
-                             }
-                           else if (dp->conversion == 'g' || dp->conversion == 'G')
-                             {
-                               if (precision == 0)
-                                 precision = 1;
-                               /* precision >= 1.  */
-
-                               if (arg == 0.0)
-                                 /* The exponent is 0, >= -4, < precision.
-                                    Use fixed-point notation.  */
-                                 {
-                                   size_t ndigits = precision;
-                                   /* Number of trailing zeroes that have to be
-                                      dropped.  */
-                                   size_t nzeroes =
-                                     (flags & FLAG_ALT ? 0 : precision - 1);
-
-                                   --ndigits;
-                                   *p++ = '0';
-                                   if ((flags & FLAG_ALT) || ndigits > nzeroes)
-                                     {
-                                       *p++ = decimal_point_char ();
-                                       while (ndigits > nzeroes)
-                                         {
-                                           --ndigits;
-                                           *p++ = '0';
-                                         }
-                                     }
-                                 }
-                               else
-                                 {
-                                   /* arg > 0.0.  */
-                                   int exponent;
-                                   int adjusted;
-                                   char *digits;
-                                   size_t ndigits;
-                                   size_t nzeroes;
-
-                                   exponent = floorlog10 (arg);
-                                   adjusted = 0;
-                                   for (;;)
-                                     {
-                                       digits =
-                                         scale10_round_decimal_double (arg,
-                                                                       (int)(precision - 1) - exponent);
-                                       if (digits == NULL)
-                                         goto out_of_memory;
-                                       ndigits = strlen (digits);
-
-                                       if (ndigits == precision)
-                                         break;
-                                       if (ndigits < precision - 1
-                                           || ndigits > precision + 1)
-                                         /* The exponent was not guessed
-                                            precisely enough.  */
-                                         abort ();
-                                       if (adjusted)
-                                         /* None of two values of exponent is
-                                            the right one.  Prevent an endless
-                                            loop.  */
-                                         abort ();
-                                       free (digits);
-                                       if (ndigits < precision)
-                                         exponent -= 1;
-                                       else
-                                         exponent += 1;
-                                       adjusted = 1;
-                                     }
-                                   /* Here ndigits = precision.  */
-                                   if (is_borderline (digits, precision - 1))
-                                     {
-                                       /* Maybe the exponent guess was too high
-                                          and a smaller exponent can be reached
-                                          by turning a 10...0 into 9...9x.  */
-                                       char *digits2 =
-                                         scale10_round_decimal_double (arg,
-                                                                       (int)(precision - 1) - exponent + 1);
-                                       if (digits2 == NULL)
-                                         {
-                                           free (digits);
-                                           goto out_of_memory;
-                                         }
-                                       if (strlen (digits2) == precision)
-                                         {
-                                           free (digits);
-                                           digits = digits2;
-                                           exponent -= 1;
-                                         }
-                                       else
-                                         free (digits2);
-                                     }
-                                   /* Here ndigits = precision.  */
-
-                                   /* Determine the number of trailing zeroes
-                                      that have to be dropped.  */
-                                   nzeroes = 0;
-                                   if ((flags & FLAG_ALT) == 0)
-                                     while (nzeroes < ndigits
-                                            && digits[nzeroes] == '0')
-                                       nzeroes++;
-
-                                   /* The exponent is now determined.  */
-                                   if (exponent >= -4
-                                       && exponent < (long)precision)
-                                     {
-                                       /* Fixed-point notation:
-                                          max(exponent,0)+1 digits, then the
-                                          decimal point, then the remaining
-                                          digits without trailing zeroes.  */
-                                       if (exponent >= 0)
-                                         {
-                                           size_t count = exponent + 1;
-                                           /* Note: count <= precision = ndigits.  */
-                                           for (; count > 0; count--)
-                                             *p++ = digits[--ndigits];
-                                           if ((flags & FLAG_ALT) || ndigits > nzeroes)
-                                             {
-                                               *p++ = decimal_point_char ();
-                                               while (ndigits > nzeroes)
-                                                 {
-                                                   --ndigits;
-                                                   *p++ = digits[ndigits];
-                                                 }
-                                             }
-                                         }
-                                       else
-                                         {
-                                           size_t count = -exponent - 1;
-                                           *p++ = '0';
-                                           *p++ = decimal_point_char ();
-                                           for (; count > 0; count--)
-                                             *p++ = '0';
-                                           while (ndigits > nzeroes)
-                                             {
-                                               --ndigits;
-                                               *p++ = digits[ndigits];
-                                             }
-                                         }
-                                     }
-                                   else
-                                     {
-                                       /* Exponential notation.  */
-                                       *p++ = digits[--ndigits];
-                                       if ((flags & FLAG_ALT) || ndigits > nzeroes)
-                                         {
-                                           *p++ = decimal_point_char ();
-                                           while (ndigits > nzeroes)
-                                             {
-                                               --ndigits;
-                                               *p++ = digits[ndigits];
-                                             }
-                                         }
-                                       *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
+                              }
+                            else if (dp->conversion == 'g' || dp->conversion == 'G')
+                              {
+                                if (precision == 0)
+                                  precision = 1;
+                                /* precision >= 1.  */
+
+                                if (arg == 0.0)
+                                  /* The exponent is 0, >= -4, < precision.
+                                     Use fixed-point notation.  */
+                                  {
+                                    size_t ndigits = precision;
+                                    /* Number of trailing zeroes that have to be
+                                       dropped.  */
+                                    size_t nzeroes =
+                                      (flags & FLAG_ALT ? 0 : precision - 1);
+
+                                    --ndigits;
+                                    *p++ = '0';
+                                    if ((flags & FLAG_ALT) || ndigits > nzeroes)
+                                      {
+                                        *p++ = decimal_point_char ();
+                                        while (ndigits > nzeroes)
+                                          {
+                                            --ndigits;
+                                            *p++ = '0';
+                                          }
+                                      }
+                                  }
+                                else
+                                  {
+                                    /* arg > 0.0.  */
+                                    int exponent;
+                                    int adjusted;
+                                    char *digits;
+                                    size_t ndigits;
+                                    size_t nzeroes;
+
+                                    exponent = floorlog10 (arg);
+                                    adjusted = 0;
+                                    for (;;)
+                                      {
+                                        digits =
+                                          scale10_round_decimal_double (arg,
+                                                                        (int)(precision - 1) - exponent);
+                                        if (digits == NULL)
+                                          goto out_of_memory;
+                                        ndigits = strlen (digits);
+
+                                        if (ndigits == precision)
+                                          break;
+                                        if (ndigits < precision - 1
+                                            || ndigits > precision + 1)
+                                          /* The exponent was not guessed
+                                             precisely enough.  */
+                                          abort ();
+                                        if (adjusted)
+                                          /* None of two values of exponent is
+                                             the right one.  Prevent an endless
+                                             loop.  */
+                                          abort ();
+                                        free (digits);
+                                        if (ndigits < precision)
+                                          exponent -= 1;
+                                        else
+                                          exponent += 1;
+                                        adjusted = 1;
+                                      }
+                                    /* Here ndigits = precision.  */
+                                    if (is_borderline (digits, precision - 1))
+                                      {
+                                        /* Maybe the exponent guess was too high
+                                           and a smaller exponent can be reached
+                                           by turning a 10...0 into 9...9x.  */
+                                        char *digits2 =
+                                          scale10_round_decimal_double (arg,
+                                                                        (int)(precision - 1) - exponent + 1);
+                                        if (digits2 == NULL)
+                                          {
+                                            free (digits);
+                                            goto out_of_memory;
+                                          }
+                                        if (strlen (digits2) == precision)
+                                          {
+                                            free (digits);
+                                            digits = digits2;
+                                            exponent -= 1;
+                                          }
+                                        else
+                                          free (digits2);
+                                      }
+                                    /* Here ndigits = precision.  */
+
+                                    /* Determine the number of trailing zeroes
+                                       that have to be dropped.  */
+                                    nzeroes = 0;
+                                    if ((flags & FLAG_ALT) == 0)
+                                      while (nzeroes < ndigits
+                                             && digits[nzeroes] == '0')
+                                        nzeroes++;
+
+                                    /* The exponent is now determined.  */
+                                    if (exponent >= -4
+                                        && exponent < (long)precision)
+                                      {
+                                        /* Fixed-point notation:
+                                           max(exponent,0)+1 digits, then the
+                                           decimal point, then the remaining
+                                           digits without trailing zeroes.  */
+                                        if (exponent >= 0)
+                                          {
+                                            size_t count = exponent + 1;
+                                            /* Note: count <= precision = ndigits.  */
+                                            for (; count > 0; count--)
+                                              *p++ = digits[--ndigits];
+                                            if ((flags & FLAG_ALT) || ndigits > nzeroes)
+                                              {
+                                                *p++ = decimal_point_char ();
+                                                while (ndigits > nzeroes)
+                                                  {
+                                                    --ndigits;
+                                                    *p++ = digits[ndigits];
+                                                  }
+                                              }
+                                          }
+                                        else
+                                          {
+                                            size_t count = -exponent - 1;
+                                            *p++ = '0';
+                                            *p++ = decimal_point_char ();
+                                            for (; count > 0; count--)
+                                              *p++ = '0';
+                                            while (ndigits > nzeroes)
+                                              {
+                                                --ndigits;
+                                                *p++ = digits[ndigits];
+                                              }
+                                          }
+                                      }
+                                    else
+                                      {
+                                        /* Exponential notation.  */
+                                        *p++ = digits[--ndigits];
+                                        if ((flags & FLAG_ALT) || ndigits > nzeroes)
+                                          {
+                                            *p++ = decimal_point_char ();
+                                            while (ndigits > nzeroes)
+                                              {
+                                                --ndigits;
+                                                *p++ = digits[ndigits];
+                                              }
+                                          }
+                                        *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
 #   if WIDE_CHAR_VERSION
-                                       {
-                                         static const wchar_t decimal_format[] =
-                                           /* Produce the same number of exponent digits
-                                              as the native printf implementation.  */
+                                        {
+                                          static const wchar_t decimal_format[] =
+                                            /* Produce the same number of exponent digits
+                                               as the native printf implementation.  */
 #    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-                                           { '%', '+', '.', '3', 'd', '\0' };
+                                            { '%', '+', '.', '3', 'd', '\0' };
 #    else
-                                           { '%', '+', '.', '2', 'd', '\0' };
+                                            { '%', '+', '.', '2', 'd', '\0' };
 #    endif
-                                         SNPRINTF (p, 6 + 1, decimal_format, exponent);
-                                       }
-                                       while (*p != '\0')
-                                         p++;
+                                          SNPRINTF (p, 6 + 1, decimal_format, exponent);
+                                        }
+                                        while (*p != '\0')
+                                          p++;
 #   else
-                                       {
-                                         static const char decimal_format[] =
-                                           /* Produce the same number of exponent digits
-                                              as the native printf implementation.  */
+                                        {
+                                          static const char decimal_format[] =
+                                            /* Produce the same number of exponent digits
+                                               as the native printf implementation.  */
 #    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-                                           "%+.3d";
+                                            "%+.3d";
 #    else
-                                           "%+.2d";
+                                            "%+.2d";
 #    endif
-                                         if (sizeof (DCHAR_T) == 1)
-                                           {
-                                             sprintf ((char *) p, decimal_format, exponent);
-                                             while (*p != '\0')
-                                               p++;
-                                           }
-                                         else
-                                           {
-                                             char expbuf[6 + 1];
-                                             const char *ep;
-                                             sprintf (expbuf, decimal_format, exponent);
-                                             for (ep = expbuf; (*p = *ep) != '\0'; ep++)
-                                               p++;
-                                           }
-                                       }
+                                          if (sizeof (DCHAR_T) == 1)
+                                            {
+                                              sprintf ((char *) p, decimal_format, exponent);
+                                              while (*p != '\0')
+                                                p++;
+                                            }
+                                          else
+                                            {
+                                              char expbuf[6 + 1];
+                                              const char *ep;
+                                              sprintf (expbuf, decimal_format, exponent);
+                                              for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+                                                p++;
+                                            }
+                                        }
 #   endif
-                                     }
+                                      }
 
-                                   free (digits);
-                                 }
-                             }
-                           else
-                             abort ();
+                                    free (digits);
+                                  }
+                              }
+                            else
+                              abort ();
 #  else
-                           /* arg is finite.  */
-                           if (!(arg == 0.0))
-                             abort ();
-
-                           pad_ptr = p;
-
-                           if (dp->conversion == 'f' || dp->conversion == 'F')
-                             {
-                               *p++ = '0';
-                               if ((flags & FLAG_ALT) || precision > 0)
-                                 {
-                                   *p++ = decimal_point_char ();
-                                   for (; precision > 0; precision--)
-                                     *p++ = '0';
-                                 }
-                             }
-                           else if (dp->conversion == 'e' || dp->conversion == 'E')
-                             {
-                               *p++ = '0';
-                               if ((flags & FLAG_ALT) || precision > 0)
-                                 {
-                                   *p++ = decimal_point_char ();
-                                   for (; precision > 0; precision--)
-                                     *p++ = '0';
-                                 }
-                               *p++ = dp->conversion; /* 'e' or 'E' */
-                               *p++ = '+';
-                               /* Produce the same number of exponent digits as
-                                  the native printf implementation.  */
+                            /* arg is finite.  */
+                            if (!(arg == 0.0))
+                              abort ();
+
+                            pad_ptr = p;
+
+                            if (dp->conversion == 'f' || dp->conversion == 'F')
+                              {
+                                *p++ = '0';
+                                if ((flags & FLAG_ALT) || precision > 0)
+                                  {
+                                    *p++ = decimal_point_char ();
+                                    for (; precision > 0; precision--)
+                                      *p++ = '0';
+                                  }
+                              }
+                            else if (dp->conversion == 'e' || dp->conversion == 'E')
+                              {
+                                *p++ = '0';
+                                if ((flags & FLAG_ALT) || precision > 0)
+                                  {
+                                    *p++ = decimal_point_char ();
+                                    for (; precision > 0; precision--)
+                                      *p++ = '0';
+                                  }
+                                *p++ = dp->conversion; /* 'e' or 'E' */
+                                *p++ = '+';
+                                /* Produce the same number of exponent digits as
+                                   the native printf implementation.  */
 #   if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-                               *p++ = '0';
+                                *p++ = '0';
 #   endif
-                               *p++ = '0';
-                               *p++ = '0';
-                             }
-                           else if (dp->conversion == 'g' || dp->conversion == 'G')
-                             {
-                               *p++ = '0';
-                               if (flags & FLAG_ALT)
-                                 {
-                                   size_t ndigits =
-                                     (precision > 0 ? precision - 1 : 0);
-                                   *p++ = decimal_point_char ();
-                                   for (; ndigits > 0; --ndigits)
-                                     *p++ = '0';
-                                 }
-                             }
-                           else
-                             abort ();
+                                *p++ = '0';
+                                *p++ = '0';
+                              }
+                            else if (dp->conversion == 'g' || dp->conversion == 'G')
+                              {
+                                *p++ = '0';
+                                if (flags & FLAG_ALT)
+                                  {
+                                    size_t ndigits =
+                                      (precision > 0 ? precision - 1 : 0);
+                                    *p++ = decimal_point_char ();
+                                    for (; ndigits > 0; --ndigits)
+                                      *p++ = '0';
+                                  }
+                              }
+                            else
+                              abort ();
 #  endif
-                         }
-                     }
-                 }
+                          }
+                      }
+                  }
 # endif
 
-               /* The generated string now extends from tmp to p, with the
-                  zero padding insertion point being at pad_ptr.  */
-               if (has_width && p - tmp < width)
-                 {
-                   size_t pad = width - (p - tmp);
-                   DCHAR_T *end = p + pad;
-
-                   if (flags & FLAG_LEFT)
-                     {
-                       /* Pad with spaces on the right.  */
-                       for (; pad > 0; pad--)
-                         *p++ = ' ';
-                     }
-                   else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
-                     {
-                       /* Pad with zeroes.  */
-                       DCHAR_T *q = end;
-
-                       while (p > pad_ptr)
-                         *--q = *--p;
-                       for (; pad > 0; pad--)
-                         *p++ = '0';
-                     }
-                   else
-                     {
-                       /* Pad with spaces on the left.  */
-                       DCHAR_T *q = end;
-
-                       while (p > tmp)
-                         *--q = *--p;
-                       for (; pad > 0; pad--)
-                         *p++ = ' ';
-                     }
-
-                   p = end;
-                 }
-
-               {
-                 size_t count = p - tmp;
-
-                 if (count >= tmp_length)
-                   /* tmp_length was incorrectly calculated - fix the
-                      code above!  */
-                   abort ();
-
-                 /* Make room for the result.  */
-                 if (count >= allocated - length)
-                   {
-                     size_t n = xsum (length, count);
-
-                     ENSURE_ALLOCATION (n);
-                   }
-
-                 /* Append the result.  */
-                 memcpy (result + length, tmp, count * sizeof (DCHAR_T));
-                 if (tmp != tmpbuf)
-                   free (tmp);
-                 length += count;
-               }
-             }
+                /* The generated string now extends from tmp to p, with the
+                   zero padding insertion point being at pad_ptr.  */
+                if (has_width && p - tmp < width)
+                  {
+                    size_t pad = width - (p - tmp);
+                    DCHAR_T *end = p + pad;
+
+                    if (flags & FLAG_LEFT)
+                      {
+                        /* Pad with spaces on the right.  */
+                        for (; pad > 0; pad--)
+                          *p++ = ' ';
+                      }
+                    else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+                      {
+                        /* Pad with zeroes.  */
+                        DCHAR_T *q = end;
+
+                        while (p > pad_ptr)
+                          *--q = *--p;
+                        for (; pad > 0; pad--)
+                          *p++ = '0';
+                      }
+                    else
+                      {
+                        /* Pad with spaces on the left.  */
+                        DCHAR_T *q = end;
+
+                        while (p > tmp)
+                          *--q = *--p;
+                        for (; pad > 0; pad--)
+                          *p++ = ' ';
+                      }
+
+                    p = end;
+                  }
+
+                {
+                  size_t count = p - tmp;
+
+                  if (count >= tmp_length)
+                    /* tmp_length was incorrectly calculated - fix the
+                       code above!  */
+                    abort ();
+
+                  /* Make room for the result.  */
+                  if (count >= allocated - length)
+                    {
+                      size_t n = xsum (length, count);
+
+                      ENSURE_ALLOCATION (n);
+                    }
+
+                  /* Append the result.  */
+                  memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+                  if (tmp != tmpbuf)
+                    free (tmp);
+                  length += count;
+                }
+              }
 #endif
-           else
-             {
-               arg_type type = a.arg[dp->arg_index].type;
-               int flags = dp->flags;
-#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
-               int has_width;
-               size_t width;
+            else
+              {
+                arg_type type = a.arg[dp->arg_index].type;
+                int flags = dp->flags;
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+                int has_width;
+                size_t width;
 #endif
-#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
-               int has_precision;
-               size_t precision;
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION
+                int has_precision;
+                size_t precision;
 #endif
 #if NEED_PRINTF_UNBOUNDED_PRECISION
-               int prec_ourselves;
+                int prec_ourselves;
 #else
-#              define prec_ourselves 0
+#               define prec_ourselves 0
 #endif
 #if NEED_PRINTF_FLAG_LEFTADJUST
-#              define pad_ourselves 1
+#               define pad_ourselves 1
 #elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
-               int pad_ourselves;
+                int pad_ourselves;
 #else
-#              define pad_ourselves 0
+#               define pad_ourselves 0
 #endif
-               TCHAR_T *fbp;
-               unsigned int prefix_count;
-               int prefixes[2] IF_LINT (= { 0 });
+                TCHAR_T *fbp;
+                unsigned int prefix_count;
+                int prefixes[2] IF_LINT (= { 0 });
 #if !USE_SNPRINTF
-               size_t tmp_length;
-               TCHAR_T tmpbuf[700];
-               TCHAR_T *tmp;
+                size_t tmp_length;
+                TCHAR_T tmpbuf[700];
+                TCHAR_T *tmp;
 #endif
 
-#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
-               has_width = 0;
-               width = 0;
-               if (dp->width_start != dp->width_end)
-                 {
-                   if (dp->width_arg_index != ARG_NONE)
-                     {
-                       int arg;
-
-                       if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
-                         abort ();
-                       arg = a.arg[dp->width_arg_index].a.a_int;
-                       if (arg < 0)
-                         {
-                           /* "A negative field width is taken as a '-' flag
-                               followed by a positive field width."  */
-                           flags |= FLAG_LEFT;
-                           width = (unsigned int) (-arg);
-                         }
-                       else
-                         width = arg;
-                     }
-                   else
-                     {
-                       const FCHAR_T *digitp = dp->width_start;
-
-                       do
-                         width = xsum (xtimes (width, 10), *digitp++ - '0');
-                       while (digitp != dp->width_end);
-                     }
-                   has_width = 1;
-                 }
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+                has_width = 0;
+                width = 0;
+                if (dp->width_start != dp->width_end)
+                  {
+                    if (dp->width_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->width_arg_index].a.a_int;
+                        if (arg < 0)
+                          {
+                            /* "A negative field width is taken as a '-' flag
+                                followed by a positive field width."  */
+                            flags |= FLAG_LEFT;
+                            width = (unsigned int) (-arg);
+                          }
+                        else
+                          width = arg;
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->width_start;
+
+                        do
+                          width = xsum (xtimes (width, 10), *digitp++ - '0');
+                        while (digitp != dp->width_end);
+                      }
+                    has_width = 1;
+                  }
 #endif
 
-#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
-               has_precision = 0;
-               precision = 6;
-               if (dp->precision_start != dp->precision_end)
-                 {
-                   if (dp->precision_arg_index != ARG_NONE)
-                     {
-                       int arg;
-
-                       if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
-                         abort ();
-                       arg = a.arg[dp->precision_arg_index].a.a_int;
-                       /* "A negative precision is taken as if the precision
-                           were omitted."  */
-                       if (arg >= 0)
-                         {
-                           precision = arg;
-                           has_precision = 1;
-                         }
-                     }
-                   else
-                     {
-                       const FCHAR_T *digitp = dp->precision_start + 1;
-
-                       precision = 0;
-                       while (digitp != dp->precision_end)
-                         precision = xsum (xtimes (precision, 10), *digitp++ - '0');
-                       has_precision = 1;
-                     }
-                 }
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION
+                has_precision = 0;
+                precision = 6;
+                if (dp->precision_start != dp->precision_end)
+                  {
+                    if (dp->precision_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->precision_arg_index].a.a_int;
+                        /* "A negative precision is taken as if the precision
+                            were omitted."  */
+                        if (arg >= 0)
+                          {
+                            precision = arg;
+                            has_precision = 1;
+                          }
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->precision_start + 1;
+
+                        precision = 0;
+                        while (digitp != dp->precision_end)
+                          precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+                        has_precision = 1;
+                      }
+                  }
 #endif
 
-               /* Decide whether to handle the precision ourselves.  */
+                /* Decide whether to handle the precision ourselves.  */
 #if NEED_PRINTF_UNBOUNDED_PRECISION
-               switch (dp->conversion)
-                 {
-                 case 'd': case 'i': case 'u':
-                 case 'o':
-                 case 'x': case 'X': case 'p':
-                   prec_ourselves = has_precision && (precision > 0);
-                   break;
-                 default:
-                   prec_ourselves = 0;
-                   break;
-                 }
+                switch (dp->conversion)
+                  {
+                  case 'd': case 'i': case 'u':
+                  case 'o':
+                  case 'x': case 'X': case 'p':
+                    prec_ourselves = has_precision && (precision > 0);
+                    break;
+                  default:
+                    prec_ourselves = 0;
+                    break;
+                  }
 #endif
 
-               /* Decide whether to perform the padding ourselves.  */
+                /* Decide whether to perform the padding ourselves.  */
 #if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
-               switch (dp->conversion)
-                 {
+                switch (dp->conversion)
+                  {
 # if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
-                 /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
-                    to perform the padding after this conversion.  Functions
-                    with unistdio extensions perform the padding based on
-                    character count rather than element count.  */
-                 case 'c': case 's':
+                  /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
+                     to perform the padding after this conversion.  Functions
+                     with unistdio extensions perform the padding based on
+                     character count rather than element count.  */
+                  case 'c': case 's':
 # endif
 # if NEED_PRINTF_FLAG_ZERO
-                 case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
-                 case 'a': case 'A':
+                  case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+                  case 'a': case 'A':
 # endif
-                   pad_ourselves = 1;
-                   break;
-                 default:
-                   pad_ourselves = prec_ourselves;
-                   break;
-                 }
+                    pad_ourselves = 1;
+                    break;
+                  default:
+                    pad_ourselves = prec_ourselves;
+                    break;
+                  }
 #endif
 
 #if !USE_SNPRINTF
-               /* Allocate a temporary buffer of sufficient size for calling
-                  sprintf.  */
-               {
-                 switch (dp->conversion)
-                   {
-
-                   case 'd': case 'i': case 'u':
-# if HAVE_LONG_LONG_INT
-                     if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
-                       tmp_length =
-                         (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
-                                         * 0.30103 /* binary -> decimal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     else
-# endif
-                     if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
-                       tmp_length =
-                         (unsigned int) (sizeof (unsigned long) * CHAR_BIT
-                                         * 0.30103 /* binary -> decimal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     else
-                       tmp_length =
-                         (unsigned int) (sizeof (unsigned int) * CHAR_BIT
-                                         * 0.30103 /* binary -> decimal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     if (tmp_length < precision)
-                       tmp_length = precision;
-                     /* Multiply by 2, as an estimate for FLAG_GROUP.  */
-                     tmp_length = xsum (tmp_length, tmp_length);
-                     /* Add 1, to account for a leading sign.  */
-                     tmp_length = xsum (tmp_length, 1);
-                     break;
-
-                   case 'o':
-# if HAVE_LONG_LONG_INT
-                     if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
-                       tmp_length =
-                         (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
-                                         * 0.333334 /* binary -> octal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     else
-# endif
-                     if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
-                       tmp_length =
-                         (unsigned int) (sizeof (unsigned long) * CHAR_BIT
-                                         * 0.333334 /* binary -> octal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     else
-                       tmp_length =
-                         (unsigned int) (sizeof (unsigned int) * CHAR_BIT
-                                         * 0.333334 /* binary -> octal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     if (tmp_length < precision)
-                       tmp_length = precision;
-                     /* Add 1, to account for a leading sign.  */
-                     tmp_length = xsum (tmp_length, 1);
-                     break;
-
-                   case 'x': case 'X':
-# if HAVE_LONG_LONG_INT
-                     if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
-                       tmp_length =
-                         (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
-                                         * 0.25 /* binary -> hexadecimal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     else
-# endif
-                     if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
-                       tmp_length =
-                         (unsigned int) (sizeof (unsigned long) * CHAR_BIT
-                                         * 0.25 /* binary -> hexadecimal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     else
-                       tmp_length =
-                         (unsigned int) (sizeof (unsigned int) * CHAR_BIT
-                                         * 0.25 /* binary -> hexadecimal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     if (tmp_length < precision)
-                       tmp_length = precision;
-                     /* Add 2, to account for a leading sign or alternate form.  */
-                     tmp_length = xsum (tmp_length, 2);
-                     break;
-
-                   case 'f': case 'F':
-                     if (type == TYPE_LONGDOUBLE)
-                       tmp_length =
-                         (unsigned int) (LDBL_MAX_EXP
-                                         * 0.30103 /* binary -> decimal */
-                                         * 2 /* estimate for FLAG_GROUP */
-                                        )
-                         + 1 /* turn floor into ceil */
-                         + 10; /* sign, decimal point etc. */
-                     else
-                       tmp_length =
-                         (unsigned int) (DBL_MAX_EXP
-                                         * 0.30103 /* binary -> decimal */
-                                         * 2 /* estimate for FLAG_GROUP */
-                                        )
-                         + 1 /* turn floor into ceil */
-                         + 10; /* sign, decimal point etc. */
-                     tmp_length = xsum (tmp_length, precision);
-                     break;
-
-                   case 'e': case 'E': case 'g': case 'G':
-                     tmp_length =
-                       12; /* sign, decimal point, exponent etc. */
-                     tmp_length = xsum (tmp_length, precision);
-                     break;
-
-                   case 'a': case 'A':
-                     if (type == TYPE_LONGDOUBLE)
-                       tmp_length =
-                         (unsigned int) (LDBL_DIG
-                                         * 0.831 /* decimal -> hexadecimal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     else
-                       tmp_length =
-                         (unsigned int) (DBL_DIG
-                                         * 0.831 /* decimal -> hexadecimal */
-                                        )
-                         + 1; /* turn floor into ceil */
-                     if (tmp_length < precision)
-                       tmp_length = precision;
-                     /* Account for sign, decimal point etc. */
-                     tmp_length = xsum (tmp_length, 12);
-                     break;
-
-                   case 'c':
-# if HAVE_WINT_T && !WIDE_CHAR_VERSION
-                     if (type == TYPE_WIDE_CHAR)
-                       tmp_length = MB_CUR_MAX;
-                     else
-# endif
-                       tmp_length = 1;
-                     break;
-
-                   case 's':
-# if HAVE_WCHAR_T
-                     if (type == TYPE_WIDE_STRING)
-                       {
-#  if WIDE_CHAR_VERSION
-                         /* ISO C says about %ls in fwprintf:
-                              "If the precision is not specified or is greater
-                               than the size of the array, the array shall
-                               contain a null wide character."
-                            So if there is a precision, we must not use
-                            wcslen.  */
-                         const wchar_t *arg =
-                           a.arg[dp->arg_index].a.a_wide_string;
-
-                         if (has_precision)
-                           tmp_length = local_wcsnlen (arg, precision);
-                         else
-                           tmp_length = local_wcslen (arg);
-#  else
-                         /* ISO C says about %ls in fprintf:
-                              "If a precision is specified, no more than that
-                               many bytes are written (including shift
-                               sequences, if any), and the array shall contain
-                               a null wide character if, to equal the
-                               multibyte character sequence length given by
-                               the precision, the function would need to
-                               access a wide character one past the end of the
-                               array."
-                            So if there is a precision, we must not use
-                            wcslen.  */
-                         /* This case has already been handled above.  */
-                         abort ();
-#  endif
-                       }
-                     else
-# endif
-                       {
-# if WIDE_CHAR_VERSION
-                         /* ISO C says about %s in fwprintf:
-                              "If the precision is not specified or is greater
-                               than the size of the converted array, the
-                               converted array shall contain a null wide
-                               character."
-                            So if there is a precision, we must not use
-                            strlen.  */
-                         /* This case has already been handled above.  */
-                         abort ();
-# else
-                         /* ISO C says about %s in fprintf:
-                              "If the precision is not specified or greater
-                               than the size of the array, the array shall
-                               contain a null character."
-                            So if there is a precision, we must not use
-                            strlen.  */
-                         const char *arg = a.arg[dp->arg_index].a.a_string;
-
-                         if (has_precision)
-                           tmp_length = local_strnlen (arg, precision);
-                         else
-                           tmp_length = strlen (arg);
-# endif
-                       }
-                     break;
-
-                   case 'p':
-                     tmp_length =
-                       (unsigned int) (sizeof (void *) * CHAR_BIT
-                                       * 0.25 /* binary -> hexadecimal */
-                                      )
-                         + 1 /* turn floor into ceil */
-                         + 2; /* account for leading 0x */
-                     break;
-
-                   default:
-                     abort ();
-                   }
-
-                 if (!pad_ourselves)
-                   {
-# if ENABLE_UNISTDIO
-                     /* Padding considers the number of characters, therefore
-                        the number of elements after padding may be
-                          > max (tmp_length, width)
-                        but is certainly
-                          <= tmp_length + width.  */
-                     tmp_length = xsum (tmp_length, width);
-# else
-                     /* Padding considers the number of elements,
-                        says POSIX.  */
-                     if (tmp_length < width)
-                       tmp_length = width;
-# endif
-                   }
-
-                 tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
-               }
-
-               if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T))
-                 tmp = tmpbuf;
-               else
-                 {
-                   size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T));
-
-                   if (size_overflow_p (tmp_memsize))
-                     /* Overflow, would lead to out of memory.  */
-                     goto out_of_memory;
-                   tmp = (TCHAR_T *) malloc (tmp_memsize);
-                   if (tmp == NULL)
-                     /* Out of memory.  */
-                     goto out_of_memory;
-                 }
+                /* Allocate a temporary buffer of sufficient size for calling
+                   sprintf.  */
+                tmp_length =
+                  MAX_ROOM_NEEDED (&a, dp->arg_index, dp->conversion, type,
+                                   flags, width, has_precision, precision,
+                                   pad_ourselves);
+
+                if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T))
+                  tmp = tmpbuf;
+                else
+                  {
+                    size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T));
+
+                    if (size_overflow_p (tmp_memsize))
+                      /* Overflow, would lead to out of memory.  */
+                      goto out_of_memory;
+                    tmp = (TCHAR_T *) malloc (tmp_memsize);
+                    if (tmp == NULL)
+                      /* Out of memory.  */
+                      goto out_of_memory;
+                  }
 #endif
 
-               /* Construct the format string for calling snprintf or
-                  sprintf.  */
-               fbp = buf;
-               *fbp++ = '%';
+                /* Construct the format string for calling snprintf or
+                   sprintf.  */
+                fbp = buf;
+                *fbp++ = '%';
 #if NEED_PRINTF_FLAG_GROUPING
-               /* The underlying implementation doesn't support the ' flag.
-                  Produce no grouping characters in this case; this is
-                  acceptable because the grouping is locale dependent.  */
+                /* The underlying implementation doesn't support the ' flag.
+                   Produce no grouping characters in this case; this is
+                   acceptable because the grouping is locale dependent.  */
 #else
-               if (flags & FLAG_GROUP)
-                 *fbp++ = '\'';
+                if (flags & FLAG_GROUP)
+                  *fbp++ = '\'';
 #endif
-               if (flags & FLAG_LEFT)
-                 *fbp++ = '-';
-               if (flags & FLAG_SHOWSIGN)
-                 *fbp++ = '+';
-               if (flags & FLAG_SPACE)
-                 *fbp++ = ' ';
-               if (flags & FLAG_ALT)
-                 *fbp++ = '#';
-               if (!pad_ourselves)
-                 {
-                   if (flags & FLAG_ZERO)
-                     *fbp++ = '0';
-                   if (dp->width_start != dp->width_end)
-                     {
-                       size_t n = dp->width_end - dp->width_start;
-                       /* The width specification is known to consist only
-                          of standard ASCII characters.  */
-                       if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
-                         {
-                           memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T));
-                           fbp += n;
-                         }
-                       else
-                         {
-                           const FCHAR_T *mp = dp->width_start;
-                           do
-                             *fbp++ = (unsigned char) *mp++;
-                           while (--n > 0);
-                         }
-                     }
-                 }
-               if (!prec_ourselves)
-                 {
-                   if (dp->precision_start != dp->precision_end)
-                     {
-                       size_t n = dp->precision_end - dp->precision_start;
-                       /* The precision specification is known to consist only
-                          of standard ASCII characters.  */
-                       if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
-                         {
-                           memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T));
-                           fbp += n;
-                         }
-                       else
-                         {
-                           const FCHAR_T *mp = dp->precision_start;
-                           do
-                             *fbp++ = (unsigned char) *mp++;
-                           while (--n > 0);
-                         }
-                     }
-                 }
-
-               switch (type)
-                 {
+                if (flags & FLAG_LEFT)
+                  *fbp++ = '-';
+                if (flags & FLAG_SHOWSIGN)
+                  *fbp++ = '+';
+                if (flags & FLAG_SPACE)
+                  *fbp++ = ' ';
+                if (flags & FLAG_ALT)
+                  *fbp++ = '#';
+                if (!pad_ourselves)
+                  {
+                    if (flags & FLAG_ZERO)
+                      *fbp++ = '0';
+                    if (dp->width_start != dp->width_end)
+                      {
+                        size_t n = dp->width_end - dp->width_start;
+                        /* The width specification is known to consist only
+                           of standard ASCII characters.  */
+                        if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
+                          {
+                            memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T));
+                            fbp += n;
+                          }
+                        else
+                          {
+                            const FCHAR_T *mp = dp->width_start;
+                            do
+                              *fbp++ = (unsigned char) *mp++;
+                            while (--n > 0);
+                          }
+                      }
+                  }
+                if (!prec_ourselves)
+                  {
+                    if (dp->precision_start != dp->precision_end)
+                      {
+                        size_t n = dp->precision_end - dp->precision_start;
+                        /* The precision specification is known to consist only
+                           of standard ASCII characters.  */
+                        if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
+                          {
+                            memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T));
+                            fbp += n;
+                          }
+                        else
+                          {
+                            const FCHAR_T *mp = dp->precision_start;
+                            do
+                              *fbp++ = (unsigned char) *mp++;
+                            while (--n > 0);
+                          }
+                      }
+                  }
+
+                switch (type)
+                  {
 #if HAVE_LONG_LONG_INT
-                 case TYPE_LONGLONGINT:
-                 case TYPE_ULONGLONGINT:
+                  case TYPE_LONGLONGINT:
+                  case TYPE_ULONGLONGINT:
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-                   *fbp++ = 'I';
-                   *fbp++ = '6';
-                   *fbp++ = '4';
-                   break;
+                    *fbp++ = 'I';
+                    *fbp++ = '6';
+                    *fbp++ = '4';
+                    break;
 # else
-                   *fbp++ = 'l';
-                   /*FALLTHROUGH*/
+                    *fbp++ = 'l';
+                    /*FALLTHROUGH*/
 # endif
 #endif
-                 case TYPE_LONGINT:
-                 case TYPE_ULONGINT:
+                  case TYPE_LONGINT:
+                  case TYPE_ULONGINT:
 #if HAVE_WINT_T
-                 case TYPE_WIDE_CHAR:
+                  case TYPE_WIDE_CHAR:
 #endif
 #if HAVE_WCHAR_T
-                 case TYPE_WIDE_STRING:
+                  case TYPE_WIDE_STRING:
 #endif
-                   *fbp++ = 'l';
-                   break;
-                 case TYPE_LONGDOUBLE:
-                   *fbp++ = 'L';
-                   break;
-                 default:
-                   break;
-                 }
+                    *fbp++ = 'l';
+                    break;
+                  case TYPE_LONGDOUBLE:
+                    *fbp++ = 'L';
+                    break;
+                  default:
+                    break;
+                  }
 #if NEED_PRINTF_DIRECTIVE_F
-               if (dp->conversion == 'F')
-                 *fbp = 'f';
-               else
+                if (dp->conversion == 'F')
+                  *fbp = 'f';
+                else
 #endif
-                 *fbp = dp->conversion;
+                  *fbp = dp->conversion;
 #if USE_SNPRINTF
 # if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
-               fbp[1] = '%';
-               fbp[2] = 'n';
-               fbp[3] = '\0';
+                fbp[1] = '%';
+                fbp[2] = 'n';
+                fbp[3] = '\0';
 # else
-               /* On glibc2 systems from glibc >= 2.3 - probably also older
-                  ones - we know that snprintf's returns value conforms to
-                  ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
-                  Therefore we can avoid using %n in this situation.
-                  On glibc2 systems from 2004-10-18 or newer, the use of %n
-                  in format strings in writable memory may crash the program
-                  (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
-                  in this situation.  */
-               /* On native Win32 systems (such as mingw), we can avoid using
-                  %n because:
-                    - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
-                      snprintf does not write more than the specified number
-                      of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes
-                      '4', '5', '6' into buf, not '4', '5', '\0'.)
-                    - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
-                      allows us to recognize the case of an insufficient
-                      buffer size: it returns -1 in this case.
-                  On native Win32 systems (such as mingw) where the OS is
-                  Windows Vista, the use of %n in format strings by default
-                  crashes the program. See
-                    <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
-                    <http://msdn2.microsoft.com/en-us/library/ms175782(VS.80).aspx>
-                  So we should avoid %n in this situation.  */
-               fbp[1] = '\0';
+                /* On glibc2 systems from glibc >= 2.3 - probably also older
+                   ones - we know that snprintf's returns value conforms to
+                   ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
+                   Therefore we can avoid using %n in this situation.
+                   On glibc2 systems from 2004-10-18 or newer, the use of %n
+                   in format strings in writable memory may crash the program
+                   (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
+                   in this situation.  */
+                /* On native Win32 systems (such as mingw), we can avoid using
+                   %n because:
+                     - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
+                       snprintf does not write more than the specified number
+                       of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes
+                       '4', '5', '6' into buf, not '4', '5', '\0'.)
+                     - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
+                       allows us to recognize the case of an insufficient
+                       buffer size: it returns -1 in this case.
+                   On native Win32 systems (such as mingw) where the OS is
+                   Windows Vista, the use of %n in format strings by default
+                   crashes the program. See
+                     <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
+                     <http://msdn2.microsoft.com/en-us/library/ms175782(VS.80).aspx>
+                   So we should avoid %n in this situation.  */
+                fbp[1] = '\0';
 # endif
 #else
-               fbp[1] = '\0';
+                fbp[1] = '\0';
 #endif
 
-               /* Construct the arguments for calling snprintf or sprintf.  */
-               prefix_count = 0;
-               if (!pad_ourselves && dp->width_arg_index != ARG_NONE)
-                 {
-                   if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
-                     abort ();
-                   prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
-                 }
-               if (!prec_ourselves && dp->precision_arg_index != ARG_NONE)
-                 {
-                   if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
-                     abort ();
-                   prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
-                 }
+                /* Construct the arguments for calling snprintf or sprintf.  */
+                prefix_count = 0;
+                if (!pad_ourselves && dp->width_arg_index != ARG_NONE)
+                  {
+                    if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                      abort ();
+                    prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
+                  }
+                if (!prec_ourselves && dp->precision_arg_index != ARG_NONE)
+                  {
+                    if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                      abort ();
+                    prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
+                  }
 
 #if USE_SNPRINTF
-               /* The SNPRINTF result is appended after result[0..length].
-                  The latter is an array of DCHAR_T; SNPRINTF appends an
-                  array of TCHAR_T to it.  This is possible because
-                  sizeof (TCHAR_T) divides sizeof (DCHAR_T) and
-                  alignof (TCHAR_T) <= alignof (DCHAR_T).  */
+                /* The SNPRINTF result is appended after result[0..length].
+                   The latter is an array of DCHAR_T; SNPRINTF appends an
+                   array of TCHAR_T to it.  This is possible because
+                   sizeof (TCHAR_T) divides sizeof (DCHAR_T) and
+                   alignof (TCHAR_T) <= alignof (DCHAR_T).  */
 # define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T))
-               /* Ensure that maxlen below will be >= 2.  Needed on BeOS,
-                  where an snprintf() with maxlen==1 acts like sprintf().  */
-               ENSURE_ALLOCATION (xsum (length,
-                                        (2 + TCHARS_PER_DCHAR - 1)
-                                        / TCHARS_PER_DCHAR));
-               /* Prepare checking whether snprintf returns the count
-                  via %n.  */
-               *(TCHAR_T *) (result + length) = '\0';
+                /* Ensure that maxlen below will be >= 2.  Needed on BeOS,
+                   where an snprintf() with maxlen==1 acts like sprintf().  */
+                ENSURE_ALLOCATION (xsum (length,
+                                         (2 + TCHARS_PER_DCHAR - 1)
+                                         / TCHARS_PER_DCHAR));
+                /* Prepare checking whether snprintf returns the count
+                   via %n.  */
+                *(TCHAR_T *) (result + length) = '\0';
 #endif
 
-               for (;;)
-                 {
-                   int count = -1;
+                for (;;)
+                  {
+                    int count = -1;
 
 #if USE_SNPRINTF
-                   int retcount = 0;
-                   size_t maxlen = allocated - length;
-                   /* SNPRINTF can fail if its second argument is
-                      > INT_MAX.  */
-                   if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
-                     maxlen = INT_MAX / TCHARS_PER_DCHAR;
-                   maxlen = maxlen * TCHARS_PER_DCHAR;
+                    int retcount = 0;
+                    size_t maxlen = allocated - length;
+                    /* SNPRINTF can fail if its second argument is
+                       > INT_MAX.  */
+                    if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
+                      maxlen = INT_MAX / TCHARS_PER_DCHAR;
+                    maxlen = maxlen * TCHARS_PER_DCHAR;
 # define SNPRINTF_BUF(arg) \
-                   switch (prefix_count)                                   \
-                     {                                                     \
-                     case 0:                                               \
-                       retcount = SNPRINTF ((TCHAR_T *) (result + length), \
-                                            maxlen, buf,                   \
-                                            arg, &count);                  \
-                       break;                                              \
-                     case 1:                                               \
-                       retcount = SNPRINTF ((TCHAR_T *) (result + length), \
-                                            maxlen, buf,                   \
-                                            prefixes[0], arg, &count);     \
-                       break;                                              \
-                     case 2:                                               \
-                       retcount = SNPRINTF ((TCHAR_T *) (result + length), \
-                                            maxlen, buf,                   \
-                                            prefixes[0], prefixes[1], arg, \
-                                            &count);                       \
-                       break;                                              \
-                     default:                                              \
-                       abort ();                                           \
-                     }
+                    switch (prefix_count)                                   \
+                      {                                                     \
+                      case 0:                                               \
+                        retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+                                             maxlen, buf,                   \
+                                             arg, &count);                  \
+                        break;                                              \
+                      case 1:                                               \
+                        retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+                                             maxlen, buf,                   \
+                                             prefixes[0], arg, &count);     \
+                        break;                                              \
+                      case 2:                                               \
+                        retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+                                             maxlen, buf,                   \
+                                             prefixes[0], prefixes[1], arg, \
+                                             &count);                       \
+                        break;                                              \
+                      default:                                              \
+                        abort ();                                           \
+                      }
 #else
 # define SNPRINTF_BUF(arg) \
-                   switch (prefix_count)                                   \
-                     {                                                     \
-                     case 0:                                               \
-                       count = sprintf (tmp, buf, arg);                    \
-                       break;                                              \
-                     case 1:                                               \
-                       count = sprintf (tmp, buf, prefixes[0], arg);       \
-                       break;                                              \
-                     case 2:                                               \
-                       count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
-                                        arg);                              \
-                       break;                                              \
-                     default:                                              \
-                       abort ();                                           \
-                     }
+                    switch (prefix_count)                                   \
+                      {                                                     \
+                      case 0:                                               \
+                        count = sprintf (tmp, buf, arg);                    \
+                        break;                                              \
+                      case 1:                                               \
+                        count = sprintf (tmp, buf, prefixes[0], arg);       \
+                        break;                                              \
+                      case 2:                                               \
+                        count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
+                                         arg);                              \
+                        break;                                              \
+                      default:                                              \
+                        abort ();                                           \
+                      }
 #endif
 
-                   switch (type)
-                     {
-                     case TYPE_SCHAR:
-                       {
-                         int arg = a.arg[dp->arg_index].a.a_schar;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     case TYPE_UCHAR:
-                       {
-                         unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     case TYPE_SHORT:
-                       {
-                         int arg = a.arg[dp->arg_index].a.a_short;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     case TYPE_USHORT:
-                       {
-                         unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     case TYPE_INT:
-                       {
-                         int arg = a.arg[dp->arg_index].a.a_int;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     case TYPE_UINT:
-                       {
-                         unsigned int arg = a.arg[dp->arg_index].a.a_uint;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     case TYPE_LONGINT:
-                       {
-                         long int arg = a.arg[dp->arg_index].a.a_longint;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     case TYPE_ULONGINT:
-                       {
-                         unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
+                    errno = 0;
+                    switch (type)
+                      {
+                      case TYPE_SCHAR:
+                        {
+                          int arg = a.arg[dp->arg_index].a.a_schar;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      case TYPE_UCHAR:
+                        {
+                          unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      case TYPE_SHORT:
+                        {
+                          int arg = a.arg[dp->arg_index].a.a_short;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      case TYPE_USHORT:
+                        {
+                          unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      case TYPE_INT:
+                        {
+                          int arg = a.arg[dp->arg_index].a.a_int;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      case TYPE_UINT:
+                        {
+                          unsigned int arg = a.arg[dp->arg_index].a.a_uint;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      case TYPE_LONGINT:
+                        {
+                          long int arg = a.arg[dp->arg_index].a.a_longint;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      case TYPE_ULONGINT:
+                        {
+                          unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
 #if HAVE_LONG_LONG_INT
-                     case TYPE_LONGLONGINT:
-                       {
-                         long long int arg = a.arg[dp->arg_index].a.a_longlongint;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     case TYPE_ULONGLONGINT:
-                       {
-                         unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
+                      case TYPE_LONGLONGINT:
+                        {
+                          long long int arg = a.arg[dp->arg_index].a.a_longlongint;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      case TYPE_ULONGLONGINT:
+                        {
+                          unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
 #endif
-                     case TYPE_DOUBLE:
-                       {
-                         double arg = a.arg[dp->arg_index].a.a_double;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     case TYPE_LONGDOUBLE:
-                       {
-                         long double arg = a.arg[dp->arg_index].a.a_longdouble;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     case TYPE_CHAR:
-                       {
-                         int arg = a.arg[dp->arg_index].a.a_char;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
+                      case TYPE_DOUBLE:
+                        {
+                          double arg = a.arg[dp->arg_index].a.a_double;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      case TYPE_LONGDOUBLE:
+                        {
+                          long double arg = a.arg[dp->arg_index].a.a_longdouble;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      case TYPE_CHAR:
+                        {
+                          int arg = a.arg[dp->arg_index].a.a_char;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
 #if HAVE_WINT_T
-                     case TYPE_WIDE_CHAR:
-                       {
-                         wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
+                      case TYPE_WIDE_CHAR:
+                        {
+                          wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
 #endif
-                     case TYPE_STRING:
-                       {
-                         const char *arg = a.arg[dp->arg_index].a.a_string;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
+                      case TYPE_STRING:
+                        {
+                          const char *arg = a.arg[dp->arg_index].a.a_string;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
 #if HAVE_WCHAR_T
-                     case TYPE_WIDE_STRING:
-                       {
-                         const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
+                      case TYPE_WIDE_STRING:
+                        {
+                          const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
 #endif
-                     case TYPE_POINTER:
-                       {
-                         void *arg = a.arg[dp->arg_index].a.a_pointer;
-                         SNPRINTF_BUF (arg);
-                       }
-                       break;
-                     default:
-                       abort ();
-                     }
+                      case TYPE_POINTER:
+                        {
+                          void *arg = a.arg[dp->arg_index].a.a_pointer;
+                          SNPRINTF_BUF (arg);
+                        }
+                        break;
+                      default:
+                        abort ();
+                      }
 
 #if USE_SNPRINTF
-                   /* Portability: Not all implementations of snprintf()
-                      are ISO C 99 compliant.  Determine the number of
-                      bytes that snprintf() has produced or would have
-                      produced.  */
-                   if (count >= 0)
-                     {
-                       /* Verify that snprintf() has NUL-terminated its
-                          result.  */
-                       if (count < maxlen
-                           && ((TCHAR_T *) (result + length)) [count] != '\0')
-                         abort ();
-                       /* Portability hack.  */
-                       if (retcount > count)
-                         count = retcount;
-                     }
-                   else
-                     {
-                       /* snprintf() doesn't understand the '%n'
-                          directive.  */
-                       if (fbp[1] != '\0')
-                         {
-                           /* Don't use the '%n' directive; instead, look
-                              at the snprintf() return value.  */
-                           fbp[1] = '\0';
-                           continue;
-                         }
-                       else
-                         {
-                           /* Look at the snprintf() return value.  */
-                           if (retcount < 0)
-                             {
-                               /* HP-UX 10.20 snprintf() is doubly deficient:
-                                  It doesn't understand the '%n' directive,
-                                  *and* it returns -1 (rather than the length
-                                  that would have been required) when the
-                                  buffer is too small.  */
-                               size_t bigger_need =
-                                 xsum (xtimes (allocated, 2), 12);
-                               ENSURE_ALLOCATION (bigger_need);
-                               continue;
-                             }
-                           else
-                             count = retcount;
-                         }
-                     }
+                    /* Portability: Not all implementations of snprintf()
+                       are ISO C 99 compliant.  Determine the number of
+                       bytes that snprintf() has produced or would have
+                       produced.  */
+                    if (count >= 0)
+                      {
+                        /* Verify that snprintf() has NUL-terminated its
+                           result.  */
+                        if (count < maxlen
+                            && ((TCHAR_T *) (result + length)) [count] != '\0')
+                          abort ();
+                        /* Portability hack.  */
+                        if (retcount > count)
+                          count = retcount;
+                      }
+                    else
+                      {
+                        /* snprintf() doesn't understand the '%n'
+                           directive.  */
+                        if (fbp[1] != '\0')
+                          {
+                            /* Don't use the '%n' directive; instead, look
+                               at the snprintf() return value.  */
+                            fbp[1] = '\0';
+                            continue;
+                          }
+                        else
+                          {
+                            /* Look at the snprintf() return value.  */
+                            if (retcount < 0)
+                              {
+# if !HAVE_SNPRINTF_RETVAL_C99
+                                /* HP-UX 10.20 snprintf() is doubly deficient:
+                                   It doesn't understand the '%n' directive,
+                                   *and* it returns -1 (rather than the length
+                                   that would have been required) when the
+                                   buffer is too small.
+                                   But a failure at this point can also come
+                                   from other reasons than a too small buffer,
+                                   such as an invalid wide string argument to
+                                   the %ls directive, or possibly an invalid
+                                   floating-point argument.  */
+                                size_t tmp_length =
+                                  MAX_ROOM_NEEDED (&a, dp->arg_index,
+                                                   dp->conversion, type, flags,
+                                                   width, has_precision,
+                                                   precision, pad_ourselves);
+
+                                if (maxlen < tmp_length)
+                                  {
+                                    /* Make more room.  But try to do through
+                                       this reallocation only once.  */
+                                    size_t bigger_need =
+                                      xsum (length,
+                                            xsum (tmp_length,
+                                                  TCHARS_PER_DCHAR - 1)
+                                            / TCHARS_PER_DCHAR);
+                                    /* And always grow proportionally.
+                                       (There may be several arguments, each
+                                       needing a little more room than the
+                                       previous one.)  */
+                                    size_t bigger_need2 =
+                                      xsum (xtimes (allocated, 2), 12);
+                                    if (bigger_need < bigger_need2)
+                                      bigger_need = bigger_need2;
+                                    ENSURE_ALLOCATION (bigger_need);
+                                    continue;
+                                  }
+# endif
+                              }
+                            else
+                              count = retcount;
+                          }
+                      }
 #endif
 
-                   /* Attempt to handle failure.  */
-                   if (count < 0)
-                     {
-                       if (!(result == resultbuf || result == NULL))
-                         free (result);
-                       if (buf_malloced != NULL)
-                         free (buf_malloced);
-                       CLEANUP ();
-                       errno = EINVAL;
-                       return NULL;
-                     }
+                    /* Attempt to handle failure.  */
+                    if (count < 0)
+                      {
+                        /* SNPRINTF or sprintf failed.  Save and use the errno
+                           that it has set, if any.  */
+                        int saved_errno = errno;
+
+                        if (!(result == resultbuf || result == NULL))
+                          free (result);
+                        if (buf_malloced != NULL)
+                          free (buf_malloced);
+                        CLEANUP ();
+                        errno =
+                          (saved_errno != 0
+                           ? saved_errno
+                           : (dp->conversion == 'c' || dp->conversion == 's'
+                              ? EILSEQ
+                              : EINVAL));
+                        return NULL;
+                      }
 
 #if USE_SNPRINTF
-                   /* Handle overflow of the allocated buffer.
-                      If such an overflow occurs, a C99 compliant snprintf()
-                      returns a count >= maxlen.  However, a non-compliant
-                      snprintf() function returns only count = maxlen - 1.  To
-                      cover both cases, test whether count >= maxlen - 1.  */
-                   if ((unsigned int) count + 1 >= maxlen)
-                     {
-                       /* If maxlen already has attained its allowed maximum,
-                          allocating more memory will not increase maxlen.
-                          Instead of looping, bail out.  */
-                       if (maxlen == INT_MAX / TCHARS_PER_DCHAR)
-                         goto overflow;
-                       else
-                         {
-                           /* Need at least (count + 1) * sizeof (TCHAR_T)
-                              bytes.  (The +1 is for the trailing NUL.)
-                              But ask for (count + 2) * sizeof (TCHAR_T)
-                              bytes, so that in the next round, we likely get
-                                maxlen > (unsigned int) count + 1
-                              and so we don't get here again.
-                              And allocate proportionally, to avoid looping
-                              eternally if snprintf() reports a too small
-                              count.  */
-                           size_t n =
-                             xmax (xsum (length,
-                                         ((unsigned int) count + 2
-                                          + TCHARS_PER_DCHAR - 1)
-                                         / TCHARS_PER_DCHAR),
-                                   xtimes (allocated, 2));
-
-                           ENSURE_ALLOCATION (n);
-                           continue;
-                         }
-                     }
+                    /* Handle overflow of the allocated buffer.
+                       If such an overflow occurs, a C99 compliant snprintf()
+                       returns a count >= maxlen.  However, a non-compliant
+                       snprintf() function returns only count = maxlen - 1.  To
+                       cover both cases, test whether count >= maxlen - 1.  */
+                    if ((unsigned int) count + 1 >= maxlen)
+                      {
+                        /* If maxlen already has attained its allowed maximum,
+                           allocating more memory will not increase maxlen.
+                           Instead of looping, bail out.  */
+                        if (maxlen == INT_MAX / TCHARS_PER_DCHAR)
+                          goto overflow;
+                        else
+                          {
+                            /* Need at least (count + 1) * sizeof (TCHAR_T)
+                               bytes.  (The +1 is for the trailing NUL.)
+                               But ask for (count + 2) * sizeof (TCHAR_T)
+                               bytes, so that in the next round, we likely get
+                                 maxlen > (unsigned int) count + 1
+                               and so we don't get here again.
+                               And allocate proportionally, to avoid looping
+                               eternally if snprintf() reports a too small
+                               count.  */
+                            size_t n =
+                              xmax (xsum (length,
+                                          ((unsigned int) count + 2
+                                           + TCHARS_PER_DCHAR - 1)
+                                          / TCHARS_PER_DCHAR),
+                                    xtimes (allocated, 2));
+
+                            ENSURE_ALLOCATION (n);
+                            continue;
+                          }
+                      }
 #endif
 
 #if NEED_PRINTF_UNBOUNDED_PRECISION
-                   if (prec_ourselves)
-                     {
-                       /* Handle the precision.  */
-                       TCHAR_T *prec_ptr =
+                    if (prec_ourselves)
+                      {
+                        /* Handle the precision.  */
+                        TCHAR_T *prec_ptr =
 # if USE_SNPRINTF
-                         (TCHAR_T *) (result + length);
+                          (TCHAR_T *) (result + length);
 # else
-                         tmp;
+                          tmp;
 # endif
-                       size_t prefix_count;
-                       size_t move;
-
-                       prefix_count = 0;
-                       /* Put the additional zeroes after the sign.  */
-                       if (count >= 1
-                           && (*prec_ptr == '-' || *prec_ptr == '+'
-                               || *prec_ptr == ' '))
-                         prefix_count = 1;
-                       /* Put the additional zeroes after the 0x prefix if
-                          (flags & FLAG_ALT) || (dp->conversion == 'p').  */
-                       else if (count >= 2
-                                && prec_ptr[0] == '0'
-                                && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X'))
-                         prefix_count = 2;
-
-                       move = count - prefix_count;
-                       if (precision > move)
-                         {
-                           /* Insert zeroes.  */
-                           size_t insert = precision - move;
-                           TCHAR_T *prec_end;
+                        size_t prefix_count;
+                        size_t move;
+
+                        prefix_count = 0;
+                        /* Put the additional zeroes after the sign.  */
+                        if (count >= 1
+                            && (*prec_ptr == '-' || *prec_ptr == '+'
+                                || *prec_ptr == ' '))
+                          prefix_count = 1;
+                        /* Put the additional zeroes after the 0x prefix if
+                           (flags & FLAG_ALT) || (dp->conversion == 'p').  */
+                        else if (count >= 2
+                                 && prec_ptr[0] == '0'
+                                 && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X'))
+                          prefix_count = 2;
+
+                        move = count - prefix_count;
+                        if (precision > move)
+                          {
+                            /* Insert zeroes.  */
+                            size_t insert = precision - move;
+                            TCHAR_T *prec_end;
 
 # if USE_SNPRINTF
-                           size_t n =
-                             xsum (length,
-                                   (count + insert + TCHARS_PER_DCHAR - 1)
-                                   / TCHARS_PER_DCHAR);
-                           length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
-                           ENSURE_ALLOCATION (n);
-                           length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
-                           prec_ptr = (TCHAR_T *) (result + length);
+                            size_t n =
+                              xsum (length,
+                                    (count + insert + TCHARS_PER_DCHAR - 1)
+                                    / TCHARS_PER_DCHAR);
+                            length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
+                            ENSURE_ALLOCATION (n);
+                            length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
+                            prec_ptr = (TCHAR_T *) (result + length);
 # endif
 
-                           prec_end = prec_ptr + count;
-                           prec_ptr += prefix_count;
+                            prec_end = prec_ptr + count;
+                            prec_ptr += prefix_count;
 
-                           while (prec_end > prec_ptr)
-                             {
-                               prec_end--;
-                               prec_end[insert] = prec_end[0];
-                             }
+                            while (prec_end > prec_ptr)
+                              {
+                                prec_end--;
+                                prec_end[insert] = prec_end[0];
+                              }
 
-                           prec_end += insert;
-                           do
-                             *--prec_end = '0';
-                           while (prec_end > prec_ptr);
+                            prec_end += insert;
+                            do
+                              *--prec_end = '0';
+                            while (prec_end > prec_ptr);
 
-                           count += insert;
-                         }
-                     }
+                            count += insert;
+                          }
+                      }
 #endif
 
 #if !USE_SNPRINTF
-                   if (count >= tmp_length)
-                     /* tmp_length was incorrectly calculated - fix the
-                        code above!  */
-                     abort ();
+                    if (count >= tmp_length)
+                      /* tmp_length was incorrectly calculated - fix the
+                         code above!  */
+                      abort ();
 #endif
 
 #if !DCHAR_IS_TCHAR
-                   /* Convert from TCHAR_T[] to DCHAR_T[].  */
-                   if (dp->conversion == 'c' || dp->conversion == 's')
-                     {
-                       /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING
-                          TYPE_WIDE_STRING.
-                          The result string is not certainly ASCII.  */
-                       const TCHAR_T *tmpsrc;
-                       DCHAR_T *tmpdst;
-                       size_t tmpdst_len;
-                       /* This code assumes that TCHAR_T is 'char'.  */
-                       typedef int TCHAR_T_verify
-                                   [2 * (sizeof (TCHAR_T) == 1) - 1];
+                    /* Convert from TCHAR_T[] to DCHAR_T[].  */
+                    if (dp->conversion == 'c' || dp->conversion == 's')
+                      {
+                        /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING
+                           TYPE_WIDE_STRING.
+                           The result string is not certainly ASCII.  */
+                        const TCHAR_T *tmpsrc;
+                        DCHAR_T *tmpdst;
+                        size_t tmpdst_len;
+                        /* This code assumes that TCHAR_T is 'char'.  */
+                        typedef int TCHAR_T_verify
+                                    [2 * (sizeof (TCHAR_T) == 1) - 1];
 # if USE_SNPRINTF
-                       tmpsrc = (TCHAR_T *) (result + length);
+                        tmpsrc = (TCHAR_T *) (result + length);
 # else
-                       tmpsrc = tmp;
+                        tmpsrc = tmp;
 # endif
-                       tmpdst = NULL;
-                       tmpdst_len = 0;
-                       if (DCHAR_CONV_FROM_ENCODING (locale_charset (),
-                                                     iconveh_question_mark,
-                                                     tmpsrc, count,
-                                                     NULL,
-                                                     &tmpdst, &tmpdst_len)
-                           < 0)
-                         {
-                           int saved_errno = errno;
-                           if (!(result == resultbuf || result == NULL))
-                             free (result);
-                           if (buf_malloced != NULL)
-                             free (buf_malloced);
-                           CLEANUP ();
-                           errno = saved_errno;
-                           return NULL;
-                         }
-                       ENSURE_ALLOCATION (xsum (length, tmpdst_len));
-                       DCHAR_CPY (result + length, tmpdst, tmpdst_len);
-                       free (tmpdst);
-                       count = tmpdst_len;
-                     }
-                   else
-                     {
-                       /* The result string is ASCII.
-                          Simple 1:1 conversion.  */
+                        tmpdst =
+                          DCHAR_CONV_FROM_ENCODING (locale_charset (),
+                                                    iconveh_question_mark,
+                                                    tmpsrc, count,
+                                                    NULL,
+                                                    NULL, &tmpdst_len);
+                        if (tmpdst == NULL)
+                          {
+                            int saved_errno = errno;
+                            if (!(result == resultbuf || result == NULL))
+                              free (result);
+                            if (buf_malloced != NULL)
+                              free (buf_malloced);
+                            CLEANUP ();
+                            errno = saved_errno;
+                            return NULL;
+                          }
+                        ENSURE_ALLOCATION (xsum (length, tmpdst_len));
+                        DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+                        free (tmpdst);
+                        count = tmpdst_len;
+                      }
+                    else
+                      {
+                        /* The result string is ASCII.
+                           Simple 1:1 conversion.  */
 # if USE_SNPRINTF
-                       /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a
-                          no-op conversion, in-place on the array starting
-                          at (result + length).  */
-                       if (sizeof (DCHAR_T) != sizeof (TCHAR_T))
+                        /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a
+                           no-op conversion, in-place on the array starting
+                           at (result + length).  */
+                        if (sizeof (DCHAR_T) != sizeof (TCHAR_T))
 # endif
-                         {
-                           const TCHAR_T *tmpsrc;
-                           DCHAR_T *tmpdst;
-                           size_t n;
+                          {
+                            const TCHAR_T *tmpsrc;
+                            DCHAR_T *tmpdst;
+                            size_t n;
 
 # if USE_SNPRINTF
-                           if (result == resultbuf)
-                             {
-                               tmpsrc = (TCHAR_T *) (result + length);
-                               /* ENSURE_ALLOCATION will not move tmpsrc
-                                  (because it's part of resultbuf).  */
-                               ENSURE_ALLOCATION (xsum (length, count));
-                             }
-                           else
-                             {
-                               /* ENSURE_ALLOCATION will move the array
-                                  (because it uses realloc().  */
-                               ENSURE_ALLOCATION (xsum (length, count));
-                               tmpsrc = (TCHAR_T *) (result + length);
-                             }
+                            if (result == resultbuf)
+                              {
+                                tmpsrc = (TCHAR_T *) (result + length);
+                                /* ENSURE_ALLOCATION will not move tmpsrc
+                                   (because it's part of resultbuf).  */
+                                ENSURE_ALLOCATION (xsum (length, count));
+                              }
+                            else
+                              {
+                                /* ENSURE_ALLOCATION will move the array
+                                   (because it uses realloc().  */
+                                ENSURE_ALLOCATION (xsum (length, count));
+                                tmpsrc = (TCHAR_T *) (result + length);
+                              }
 # else
-                           tmpsrc = tmp;
-                           ENSURE_ALLOCATION (xsum (length, count));
+                            tmpsrc = tmp;
+                            ENSURE_ALLOCATION (xsum (length, count));
 # endif
-                           tmpdst = result + length;
-                           /* Copy backwards, because of overlapping.  */
-                           tmpsrc += count;
-                           tmpdst += count;
-                           for (n = count; n > 0; n--)
-                             *--tmpdst = (unsigned char) *--tmpsrc;
-                         }
-                     }
+                            tmpdst = result + length;
+                            /* Copy backwards, because of overlapping.  */
+                            tmpsrc += count;
+                            tmpdst += count;
+                            for (n = count; n > 0; n--)
+                              *--tmpdst = (unsigned char) *--tmpsrc;
+                          }
+                      }
 #endif
 
 #if DCHAR_IS_TCHAR && !USE_SNPRINTF
-                   /* Make room for the result.  */
-                   if (count > allocated - length)
-                     {
-                       /* Need at least count elements.  But allocate
-                          proportionally.  */
-                       size_t n =
-                         xmax (xsum (length, count), xtimes (allocated, 2));
-
-                       ENSURE_ALLOCATION (n);
-                     }
+                    /* Make room for the result.  */
+                    if (count > allocated - length)
+                      {
+                        /* Need at least count elements.  But allocate
+                           proportionally.  */
+                        size_t n =
+                          xmax (xsum (length, count), xtimes (allocated, 2));
+
+                        ENSURE_ALLOCATION (n);
+                      }
 #endif
 
-                   /* Here count <= allocated - length.  */
+                    /* Here count <= allocated - length.  */
 
-                   /* Perform padding.  */
+                    /* Perform padding.  */
 #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
-                   if (pad_ourselves && has_width)
-                     {
-                       size_t w;
+                    if (pad_ourselves && has_width)
+                      {
+                        size_t w;
 # if ENABLE_UNISTDIO
-                       /* Outside POSIX, it's preferrable to compare the width
-                          against the number of _characters_ of the converted
-                          value.  */
-                       w = DCHAR_MBSNLEN (result + length, count);
+                        /* Outside POSIX, it's preferrable to compare the width
+                           against the number of _characters_ of the converted
+                           value.  */
+                        w = DCHAR_MBSNLEN (result + length, count);
 # else
-                       /* The width is compared against the number of _bytes_
-                          of the converted value, says POSIX.  */
-                       w = count;
+                        /* The width is compared against the number of _bytes_
+                           of the converted value, says POSIX.  */
+                        w = count;
 # endif
-                       if (w < width)
-                         {
-                           size_t pad = width - w;
-
-                           /* Make room for the result.  */
-                           if (xsum (count, pad) > allocated - length)
-                             {
-                               /* Need at least count + pad elements.  But
-                                  allocate proportionally.  */
-                               size_t n =
-                                 xmax (xsum3 (length, count, pad),
-                                       xtimes (allocated, 2));
+                        if (w < width)
+                          {
+                            size_t pad = width - w;
+
+                            /* Make room for the result.  */
+                            if (xsum (count, pad) > allocated - length)
+                              {
+                                /* Need at least count + pad elements.  But
+                                   allocate proportionally.  */
+                                size_t n =
+                                  xmax (xsum3 (length, count, pad),
+                                        xtimes (allocated, 2));
 
 # if USE_SNPRINTF
-                               length += count;
-                               ENSURE_ALLOCATION (n);
-                               length -= count;
+                                length += count;
+                                ENSURE_ALLOCATION (n);
+                                length -= count;
 # else
-                               ENSURE_ALLOCATION (n);
+                                ENSURE_ALLOCATION (n);
 # endif
-                             }
-                           /* Here count + pad <= allocated - length.  */
+                              }
+                            /* Here count + pad <= allocated - length.  */
 
-                           {
+                            {
 # if !DCHAR_IS_TCHAR || USE_SNPRINTF
-                             DCHAR_T * const rp = result + length;
+                              DCHAR_T * const rp = result + length;
 # else
-                             DCHAR_T * const rp = tmp;
+                              DCHAR_T * const rp = tmp;
 # endif
-                             DCHAR_T *p = rp + count;
-                             DCHAR_T *end = p + pad;
-                             DCHAR_T *pad_ptr;
+                              DCHAR_T *p = rp + count;
+                              DCHAR_T *end = p + pad;
+                              DCHAR_T *pad_ptr;
 # if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
-                             if (dp->conversion == 'c'
-                                 || dp->conversion == 's')
-                               /* No zero-padding for string directives.  */
-                               pad_ptr = NULL;
-                             else
+                              if (dp->conversion == 'c'
+                                  || dp->conversion == 's')
+                                /* No zero-padding for string directives.  */
+                                pad_ptr = NULL;
+                              else
 # endif
-                               {
-                                 pad_ptr = (*rp == '-' ? rp + 1 : rp);
-                                 /* No zero-padding of "inf" and "nan".  */
-                                 if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z')
-                                     || (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
-                                   pad_ptr = NULL;
-                               }
-                             /* The generated string now extends from rp to p,
-                                with the zero padding insertion point being at
-                                pad_ptr.  */
-
-                             count = count + pad; /* = end - rp */
-
-                             if (flags & FLAG_LEFT)
-                               {
-                                 /* Pad with spaces on the right.  */
-                                 for (; pad > 0; pad--)
-                                   *p++ = ' ';
-                               }
-                             else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
-                               {
-                                 /* Pad with zeroes.  */
-                                 DCHAR_T *q = end;
-
-                                 while (p > pad_ptr)
-                                   *--q = *--p;
-                                 for (; pad > 0; pad--)
-                                   *p++ = '0';
-                               }
-                             else
-                               {
-                                 /* Pad with spaces on the left.  */
-                                 DCHAR_T *q = end;
-
-                                 while (p > rp)
-                                   *--q = *--p;
-                                 for (; pad > 0; pad--)
-                                   *p++ = ' ';
-                               }
-                           }
-                         }
-                     }
+                                {
+                                  pad_ptr = (*rp == '-' ? rp + 1 : rp);
+                                  /* No zero-padding of "inf" and "nan".  */
+                                  if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z')
+                                      || (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
+                                    pad_ptr = NULL;
+                                }
+                              /* The generated string now extends from rp to p,
+                                 with the zero padding insertion point being at
+                                 pad_ptr.  */
+
+                              count = count + pad; /* = end - rp */
+
+                              if (flags & FLAG_LEFT)
+                                {
+                                  /* Pad with spaces on the right.  */
+                                  for (; pad > 0; pad--)
+                                    *p++ = ' ';
+                                }
+                              else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+                                {
+                                  /* Pad with zeroes.  */
+                                  DCHAR_T *q = end;
+
+                                  while (p > pad_ptr)
+                                    *--q = *--p;
+                                  for (; pad > 0; pad--)
+                                    *p++ = '0';
+                                }
+                              else
+                                {
+                                  /* Pad with spaces on the left.  */
+                                  DCHAR_T *q = end;
+
+                                  while (p > rp)
+                                    *--q = *--p;
+                                  for (; pad > 0; pad--)
+                                    *p++ = ' ';
+                                }
+                            }
+                          }
+                      }
 #endif
 
-                   /* Here still count <= allocated - length.  */
+                    /* Here still count <= allocated - length.  */
 
 #if !DCHAR_IS_TCHAR || USE_SNPRINTF
-                   /* The snprintf() result did fit.  */
+                    /* The snprintf() result did fit.  */
 #else
-                   /* Append the sprintf() result.  */
-                   memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+                    /* Append the sprintf() result.  */
+                    memcpy (result + length, tmp, count * sizeof (DCHAR_T));
 #endif
 #if !USE_SNPRINTF
-                   if (tmp != tmpbuf)
-                     free (tmp);
+                    if (tmp != tmpbuf)
+                      free (tmp);
 #endif
 
 #if NEED_PRINTF_DIRECTIVE_F
-                   if (dp->conversion == 'F')
-                     {
-                       /* Convert the %f result to upper case for %F.  */
-                       DCHAR_T *rp = result + length;
-                       size_t rc;
-                       for (rc = count; rc > 0; rc--, rp++)
-                         if (*rp >= 'a' && *rp <= 'z')
-                           *rp = *rp - 'a' + 'A';
-                     }
+                    if (dp->conversion == 'F')
+                      {
+                        /* Convert the %f result to upper case for %F.  */
+                        DCHAR_T *rp = result + length;
+                        size_t rc;
+                        for (rc = count; rc > 0; rc--, rp++)
+                          if (*rp >= 'a' && *rp <= 'z')
+                            *rp = *rp - 'a' + 'A';
+                      }
 #endif
 
-                   length += count;
-                   break;
-                 }
-             }
-         }
+                    length += count;
+                    break;
+                  }
+#undef pad_ourselves
+#undef prec_ourselves
+              }
+          }
       }
 
     /* Add the final NUL.  */
@@ -5434,12 +5510,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 
     if (result != resultbuf && length + 1 < allocated)
       {
-       /* Shrink the allocated memory if possible.  */
-       DCHAR_T *memory;
+        /* Shrink the allocated memory if possible.  */
+        DCHAR_T *memory;
 
-       memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T));
-       if (memory != NULL)
-         result = memory;
+        memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T));
+        if (memory != NULL)
+          result = memory;
       }
 
     if (buf_malloced != NULL)
@@ -5475,9 +5551,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
   }
 }
 
+#undef MAX_ROOM_NEEDED
 #undef TCHARS_PER_DCHAR
 #undef SNPRINTF
 #undef USE_SNPRINTF
+#undef DCHAR_SET
 #undef DCHAR_CPY
 #undef PRINTF_PARSE
 #undef DIRECTIVES
index c56353e9fdb8c45306e721a86cab3b40326dbc39..a689bad25af61a0cb3e33334fd6f5df831a98440 100644 (file)
@@ -1,9 +1,9 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 #include <stddef.h>
 
 #ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-#  define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
-   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+   The __-protected variants of the attributes 'format' and 'printf' are
+   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
+   We enable __attribute__ only if these are supported too, because
+   gnulib and libintl do '#define printf __printf__' when they override
+   the 'printf' function.  */
 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-#  define __format__ format
-#  define __printf__ printf
+#  define __attribute__(Spec)   /* empty */
 # endif
 #endif
 
index fac53f6fc4ac94e4452f9d1ee63712dd3d04c14f..4ad780c8fa00839fe66d5202edf8afc9165af3a4 100644 (file)
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2010 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
      if the entity names are not disambiguated.  A workaround is to
      attach the current line number to the entity name:
 
-       #define GL_CONCAT0(x, y) x##y
-       #define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
-       extern struct {...} * GL_CONCAT(dummy,__LINE__);
+       #define _GL_CONCAT0(x, y) x##y
+       #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+       extern struct {...} * _GL_CONCAT (dummy, __LINE__);
 
      But this has the problem that two invocations of verify from
      within the same macro would collide, since the __LINE__ value
-     would be the same for both invocations.
+     would be the same for both invocations.  (The GCC __COUNTER__
+     macro solves this problem, but is not portable.)
 
      A solution is to use the sizeof operator.  It yields a number,
      getting rid of the identity of the type.  Declarations like
 
        extern int (*dummy (void)) [sizeof (struct {...})];
 
+   * GCC warns about duplicate declarations of the dummy function if
+     -Wredundant_decls is used.  GCC 4.3 and later have a builtin
+     __COUNTER__ macro that can let us generate unique identifiers for
+     each dummy function, to suppress this warning.
+
    * This implementation exploits the fact that GCC does not warn about
      the last declaration mentioned above.  If a future version of GCC
      introduces a warning for this, the problem could be worked around
-     by using code specialized to GCC, e.g.,:
+     by using code specialized to GCC, just as __COUNTER__ is already
+     being used if available.
 
        #if 4 <= __GNUC__
-       # define verify(R) \
-          extern int (* verify_function__ (void)) \
-                     [__builtin_constant_p (R) && (R) ? 1 : -1]
+       # define verify(R) [another version to keep GCC happy]
        #endif
 
    * In C++, any struct definition inside sizeof is invalid.
      Use a template type to work around the problem.  */
 
+/* Concatenate two preprocessor tokens.  */
+# define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+# define _GL_CONCAT0(x, y) x##y
+
+/* _GL_COUNTER is an integer, preferably one that changes each time we
+   use it.  Use __COUNTER__ if it works, falling back on __LINE__
+   otherwise.  __LINE__ isn't perfect, but it's better than a
+   constant.  */
+# if defined __COUNTER__ && __COUNTER__ != __COUNTER__
+#  define _GL_COUNTER __COUNTER__
+# else
+#  define _GL_COUNTER __LINE__
+# endif
+
+/* Generate a symbol with the given prefix, making it unique if
+   possible.  */
+# define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
 
 /* Verify requirement R at compile-time, as an integer constant expression.
    Return 1.  */
@@ -135,6 +157,7 @@ template <int w>
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  */
 
-# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)]
+# define verify(R) \
+    extern int (* _GL_GENSYM (verify_function) (void)) [verify_true (R)]
 
 #endif
index 3c6cd7b891e38b75c21c6584951748164b8aa105..88d47dbc09c1404bb582b1acf8ddc79a2b59f922 100644 (file)
@@ -1,10 +1,10 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -30,9 +30,9 @@
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
-#if defined __need_mbstate_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
+#if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
 /* Special invocation convention:
-   - Inside uClibc header files.
+   - Inside glibc and uClibc header files.
    - On HP-UX 11.00 we have a sequence of nested includes
      <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
      once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-   included before <wchar.h>.  */
-#include <stddef.h>
-#include <stdio.h>
-#include <time.h>
+   included before <wchar.h>.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
 
 /* Include the original <wchar.h> if it exists.
    Some builds of uClibc lack it.  */
 #ifndef _GL_WCHAR_H
 #define _GL_WCHAR_H
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+/* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
-/* Define wint_t.  (Also done in wctype.in.h.)  */
+
+/* Define wint_t and WEOF.  (Also done in wctype.in.h.)  */
 #if !@HAVE_WINT_T@ && !defined wint_t
 # define wint_t int
 # ifndef WEOF
 #  define WEOF -1
 # endif
+#else
+# ifndef WEOF
+#  define WEOF ((wint_t) -1)
+# endif
 #endif
 
 
@@ -102,205 +109,320 @@ typedef int rpl_mbstate_t;
 /* Convert a single-byte character to a wide character.  */
 #if @GNULIB_BTOWC@
 # if @REPLACE_BTOWC@
-#  undef btowc
-#  define btowc rpl_btowc
-# endif
-# if !@HAVE_BTOWC@ || @REPLACE_BTOWC@
-extern wint_t btowc (int c);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef btowc
+#   define btowc rpl_btowc
+#  endif
+_GL_FUNCDECL_RPL (btowc, wint_t, (int c));
+_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
+# else
+#  if !@HAVE_BTOWC@
+_GL_FUNCDECL_SYS (btowc, wint_t, (int c));
+#  endif
+_GL_CXXALIAS_SYS (btowc, wint_t, (int c));
 # endif
+_GL_CXXALIASWARN (btowc);
 #elif defined GNULIB_POSIXCHECK
 # undef btowc
-# define btowc(c) \
-    (GL_LINK_WARNING ("btowc is unportable - " \
-                      "use gnulib module btowc for portability"), \
-     btowc (c))
+# if HAVE_RAW_DECL_BTOWC
+_GL_WARN_ON_USE (btowc, "btowc is unportable - "
+                 "use gnulib module btowc for portability");
+# endif
 #endif
 
 
 /* Convert a wide character to a single-byte character.  */
 #if @GNULIB_WCTOB@
 # if @REPLACE_WCTOB@
-#  undef wctob
-#  define wctob rpl_wctob
-# endif
-# if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wctob
+#   define wctob rpl_wctob
+#  endif
+_GL_FUNCDECL_RPL (wctob, int, (wint_t wc));
+_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
+# else
+#  if !defined wctob && !@HAVE_DECL_WCTOB@
 /* wctob is provided by gnulib, or wctob exists but is not declared.  */
-extern int wctob (wint_t wc);
+_GL_FUNCDECL_SYS (wctob, int, (wint_t wc));
+#  endif
+_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
 # endif
+_GL_CXXALIASWARN (wctob);
 #elif defined GNULIB_POSIXCHECK
 # undef wctob
-# define wctob(w) \
-    (GL_LINK_WARNING ("wctob is unportable - " \
-                      "use gnulib module wctob for portability"), \
-     wctob (w))
+# if HAVE_RAW_DECL_WCTOB
+_GL_WARN_ON_USE (wctob, "wctob is unportable - "
+                 "use gnulib module wctob for portability");
+# endif
 #endif
 
 
 /* Test whether *PS is in the initial state.  */
 #if @GNULIB_MBSINIT@
 # if @REPLACE_MBSINIT@
-#  undef mbsinit
-#  define mbsinit rpl_mbsinit
-# endif
-# if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@
-extern int mbsinit (const mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbsinit
+#   define mbsinit rpl_mbsinit
+#  endif
+_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
+_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
+# else
+#  if !@HAVE_MBSINIT@
+_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
+#  endif
+_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (mbsinit);
 #elif defined GNULIB_POSIXCHECK
 # undef mbsinit
-# define mbsinit(p) \
-    (GL_LINK_WARNING ("mbsinit is unportable - " \
-                      "use gnulib module mbsinit for portability"), \
-     mbsinit (p))
+# if HAVE_RAW_DECL_MBSINIT
+_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
+                 "use gnulib module mbsinit for portability");
+# endif
 #endif
 
 
 /* Convert a multibyte character to a wide character.  */
 #if @GNULIB_MBRTOWC@
 # if @REPLACE_MBRTOWC@
-#  undef mbrtowc
-#  define mbrtowc rpl_mbrtowc
-# endif
-# if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@
-extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbrtowc
+#   define mbrtowc rpl_mbrtowc
+#  endif
+_GL_FUNCDECL_RPL (mbrtowc, size_t,
+                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+_GL_CXXALIAS_RPL (mbrtowc, size_t,
+                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+# else
+#  if !@HAVE_MBRTOWC@
+_GL_FUNCDECL_SYS (mbrtowc, size_t,
+                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+#  endif
+_GL_CXXALIAS_SYS (mbrtowc, size_t,
+                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (mbrtowc);
 #elif defined GNULIB_POSIXCHECK
 # undef mbrtowc
-# define mbrtowc(w,s,n,p) \
-    (GL_LINK_WARNING ("mbrtowc is unportable - " \
-                      "use gnulib module mbrtowc for portability"), \
-     mbrtowc (w, s, n, p))
+# if HAVE_RAW_DECL_MBRTOWC
+_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
+                 "use gnulib module mbrtowc for portability");
+# endif
 #endif
 
 
 /* Recognize a multibyte character.  */
 #if @GNULIB_MBRLEN@
 # if @REPLACE_MBRLEN@
-#  undef mbrlen
-#  define mbrlen rpl_mbrlen
-# endif
-# if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@
-extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbrlen
+#   define mbrlen rpl_mbrlen
+#  endif
+_GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+_GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+# else
+#  if !@HAVE_MBRLEN@
+_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+#  endif
+_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (mbrlen);
 #elif defined GNULIB_POSIXCHECK
 # undef mbrlen
-# define mbrlen(s,n,p) \
-    (GL_LINK_WARNING ("mbrlen is unportable - " \
-                      "use gnulib module mbrlen for portability"), \
-     mbrlen (s, n, p))
+# if HAVE_RAW_DECL_MBRLEN
+_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
+                 "use gnulib module mbrlen for portability");
+# endif
 #endif
 
 
 /* Convert a string to a wide string.  */
 #if @GNULIB_MBSRTOWCS@
 # if @REPLACE_MBSRTOWCS@
-#  undef mbsrtowcs
-#  define mbsrtowcs rpl_mbsrtowcs
-# endif
-# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@
-extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbsrtowcs
+#   define mbsrtowcs rpl_mbsrtowcs
+#  endif
+_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t len,
+                   mbstate_t *ps));
+# else
+#  if !@HAVE_MBSRTOWCS@
+_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t len,
+                   mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (mbsrtowcs);
 #elif defined GNULIB_POSIXCHECK
 # undef mbsrtowcs
-# define mbsrtowcs(d,s,l,p) \
-    (GL_LINK_WARNING ("mbsrtowcs is unportable - " \
-                      "use gnulib module mbsrtowcs for portability"), \
-     mbsrtowcs (d, s, l, p))
+# if HAVE_RAW_DECL_MBSRTOWCS
+_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
+                 "use gnulib module mbsrtowcs for portability");
+# endif
 #endif
 
 
 /* Convert a string to a wide string.  */
 #if @GNULIB_MBSNRTOWCS@
 # if @REPLACE_MBSNRTOWCS@
-#  undef mbsnrtowcs
-#  define mbsnrtowcs rpl_mbsnrtowcs
-# endif
-# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@
-extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbsnrtowcs
+#   define mbsnrtowcs rpl_mbsnrtowcs
+#  endif
+_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps));
+# else
+#  if !@HAVE_MBSNRTOWCS@
+_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (mbsnrtowcs);
 #elif defined GNULIB_POSIXCHECK
 # undef mbsnrtowcs
-# define mbsnrtowcs(d,s,n,l,p) \
-    (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \
-                      "use gnulib module mbsnrtowcs for portability"), \
-     mbsnrtowcs (d, s, n, l, p))
+# if HAVE_RAW_DECL_MBSNRTOWCS
+_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
+                 "use gnulib module mbsnrtowcs for portability");
+# endif
 #endif
 
 
 /* Convert a wide character to a multibyte character.  */
 #if @GNULIB_WCRTOMB@
 # if @REPLACE_WCRTOMB@
-#  undef wcrtomb
-#  define wcrtomb rpl_wcrtomb
-# endif
-# if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@
-extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcrtomb
+#   define wcrtomb rpl_wcrtomb
+#  endif
+_GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+_GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+# else
+#  if !@HAVE_WCRTOMB@
+_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+#  endif
+_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (wcrtomb);
 #elif defined GNULIB_POSIXCHECK
 # undef wcrtomb
-# define wcrtomb(s,w,p) \
-    (GL_LINK_WARNING ("wcrtomb is unportable - " \
-                      "use gnulib module wcrtomb for portability"), \
-     wcrtomb (s, w, p))
+# if HAVE_RAW_DECL_WCRTOMB
+_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
+                 "use gnulib module wcrtomb for portability");
+# endif
 #endif
 
 
 /* Convert a wide string to a string.  */
 #if @GNULIB_WCSRTOMBS@
 # if @REPLACE_WCSRTOMBS@
-#  undef wcsrtombs
-#  define wcsrtombs rpl_wcsrtombs
-# endif
-# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@
-extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcsrtombs
+#   define wcsrtombs rpl_wcsrtombs
+#  endif
+_GL_FUNCDECL_RPL (wcsrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (wcsrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t len,
+                   mbstate_t *ps));
+# else
+#  if !@HAVE_WCSRTOMBS@
+_GL_FUNCDECL_SYS (wcsrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (wcsrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t len,
+                   mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (wcsrtombs);
 #elif defined GNULIB_POSIXCHECK
 # undef wcsrtombs
-# define wcsrtombs(d,s,l,p) \
-    (GL_LINK_WARNING ("wcsrtombs is unportable - " \
-                      "use gnulib module wcsrtombs for portability"), \
-     wcsrtombs (d, s, l, p))
+# if HAVE_RAW_DECL_WCSRTOMBS
+_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
+                 "use gnulib module wcsrtombs for portability");
+# endif
 #endif
 
 
 /* Convert a wide string to a string.  */
 #if @GNULIB_WCSNRTOMBS@
-# if !@HAVE_WCSNRTOMBS@
-extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps);
+# if @REPLACE_WCSNRTOMBS@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcsnrtombs
+#   define wcsnrtombs rpl_wcsnrtombs
+#  endif
+_GL_FUNCDECL_RPL (wcsnrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps));
+# else
+#  if !@HAVE_WCSNRTOMBS@
+_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (wcsnrtombs);
 #elif defined GNULIB_POSIXCHECK
 # undef wcsnrtombs
-# define wcsnrtombs(d,s,n,l,p) \
-    (GL_LINK_WARNING ("wcsnrtombs is unportable - " \
-                      "use gnulib module wcsnrtombs for portability"), \
-     wcsnrtombs (d, s, n, l, p))
+# if HAVE_RAW_DECL_WCSNRTOMBS
+_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
+                 "use gnulib module wcsnrtombs for portability");
+# endif
 #endif
 
 
 /* Return the number of screen columns needed for WC.  */
 #if @GNULIB_WCWIDTH@
 # if @REPLACE_WCWIDTH@
-#  undef wcwidth
-#  define wcwidth rpl_wcwidth
-extern int wcwidth (wchar_t);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcwidth
+#   define wcwidth rpl_wcwidth
+#  endif
+_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
+_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 # else
-#  if !defined wcwidth && !@HAVE_DECL_WCWIDTH@
+#  if !@HAVE_DECL_WCWIDTH@
 /* wcwidth exists but is not declared.  */
-extern int wcwidth (int /* actually wchar_t */);
+_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
 #  endif
+_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
 # endif
+_GL_CXXALIASWARN (wcwidth);
 #elif defined GNULIB_POSIXCHECK
 # undef wcwidth
-# define wcwidth(w) \
-    (GL_LINK_WARNING ("wcwidth is unportable - " \
-                      "use gnulib module wcwidth for portability"), \
-     wcwidth (w))
+# if HAVE_RAW_DECL_WCWIDTH
+_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
+                 "use gnulib module wcwidth for portability");
+# endif
 #endif
 
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _GL_WCHAR_H */
 #endif /* _GL_WCHAR_H */
 #endif
index 79df99f23559452ad85056c9919b1b0abfa4368d..e7345f698f8c52fddb7517df207d060c5d56cd47 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert wide character to multibyte character.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -43,11 +43,11 @@ wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
       int ret = wctomb (s, wc);
 
       if (ret >= 0)
-       return ret;
+        return ret;
       else
-       {
-         errno = EILSEQ;
-         return (size_t)(-1);
-       }
+        {
+          errno = EILSEQ;
+          return (size_t)(-1);
+        }
     }
 }
index bcd0151d2f20be0280855d4bdc088b6c05cb66f7..12c8975fecd22a329a65bd90b7430cf12212a84d 100644 (file)
@@ -1,10 +1,10 @@
 /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
 
-   Copyright (C) 2006-2008 Free Software Foundation, Inc.
+   Copyright (C) 2006-2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
 #ifndef _GL_WCTYPE_H
 #define _GL_WCTYPE_H
 
-/* Define wint_t.  (Also done in wchar.in.h.)  */
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+/* Define wint_t and WEOF.  (Also done in wchar.in.h.)  */
 #if !@HAVE_WINT_T@ && !defined wint_t
 # define wint_t int
 # ifndef WEOF
 #  define WEOF -1
 # endif
+#else
+# ifndef WEOF
+#  define WEOF ((wint_t) -1)
+# endif
 #endif
 
+
 /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
    Linux libc5 has <wctype.h> and the functions but they are broken.
-   Assume all 12 functions are implemented the same way, or not at all.  */
+   Assume all 11 functions (all isw* except iswblank) are implemented the
+   same way, or not at all.  */
 #if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
 
 /* IRIX 5.3 has macros but no functions, its isw* macros refer to an
    refer to system functions like _iswctype that are not in the
    standard C library.  Rather than try to get ancient buggy
    implementations like this to work, just disable them.  */
-#  undef iswalnum
-#  undef iswalpha
-#  undef iswblank
-#  undef iswcntrl
-#  undef iswdigit
-#  undef iswgraph
-#  undef iswlower
-#  undef iswprint
-#  undef iswpunct
-#  undef iswspace
-#  undef iswupper
-#  undef iswxdigit
+# undef iswalnum
+# undef iswalpha
+# undef iswblank
+# undef iswcntrl
+# undef iswdigit
+# undef iswgraph
+# undef iswlower
+# undef iswprint
+# undef iswpunct
+# undef iswspace
+# undef iswupper
+# undef iswxdigit
+# undef towlower
+# undef towupper
 
 /* Linux libc5 has <wctype.h> and the functions but they are broken.  */
-#  if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define iswalnum rpl_iswalnum
 #   define iswalpha rpl_iswalpha
 #   define iswblank rpl_iswblank
 #   define iswspace rpl_iswspace
 #   define iswupper rpl_iswupper
 #   define iswxdigit rpl_iswxdigit
+#   define towlower rpl_towlower
+#   define towupper rpl_towupper
 #  endif
+# endif
 
 static inline int
-iswalnum (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswalnum
+# else
+iswalnum
+# endif
+         (wint_t wc)
 {
   return ((wc >= '0' && wc <= '9')
-         || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
+          || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
 }
 
 static inline int
-iswalpha (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswalpha
+# else
+iswalpha
+# endif
+         (wint_t wc)
 {
   return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
 }
 
 static inline int
-iswblank (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswblank
+# else
+iswblank
+# endif
+         (wint_t wc)
 {
   return wc == ' ' || wc == '\t';
 }
 
 static inline int
-iswcntrl (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswcntrl
+# else
+iswcntrl
+# endif
+        (wint_t wc)
 {
   return (wc & ~0x1f) == 0 || wc == 0x7f;
 }
 
 static inline int
-iswdigit (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswdigit
+# else
+iswdigit
+# endif
+         (wint_t wc)
 {
   return wc >= '0' && wc <= '9';
 }
 
 static inline int
-iswgraph (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswgraph
+# else
+iswgraph
+# endif
+         (wint_t wc)
 {
   return wc >= '!' && wc <= '~';
 }
 
 static inline int
-iswlower (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswlower
+# else
+iswlower
+# endif
+         (wint_t wc)
 {
   return wc >= 'a' && wc <= 'z';
 }
 
 static inline int
-iswprint (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswprint
+# else
+iswprint
+# endif
+         (wint_t wc)
 {
   return wc >= ' ' && wc <= '~';
 }
 
 static inline int
-iswpunct (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswpunct
+# else
+iswpunct
+# endif
+         (wint_t wc)
 {
   return (wc >= '!' && wc <= '~'
-         && !((wc >= '0' && wc <= '9')
-              || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
+          && !((wc >= '0' && wc <= '9')
+               || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
 }
 
 static inline int
-iswspace (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswspace
+# else
+iswspace
+# endif
+         (wint_t wc)
 {
   return (wc == ' ' || wc == '\t'
-         || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
+          || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
 }
 
 static inline int
-iswupper (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswupper
+# else
+iswupper
+# endif
+         (wint_t wc)
 {
   return wc >= 'A' && wc <= 'Z';
 }
 
 static inline int
-iswxdigit (wint_t wc)
+# if @REPLACE_ISWCNTRL@
+rpl_iswxdigit
+# else
+iswxdigit
+# endif
+          (wint_t wc)
 {
   return ((wc >= '0' && wc <= '9')
-         || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
+          || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
+}
+
+static inline wint_t
+# if @REPLACE_ISWCNTRL@
+rpl_towlower
+# else
+towlower
+# endif
+         (wint_t wc)
+{
+  return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
 }
 
-# endif /* ! HAVE_ISWCNTRL */
+static inline wint_t
+# if @REPLACE_ISWCNTRL@
+rpl_towupper
+# else
+towupper
+# endif
+         (wint_t wc)
+{
+  return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
+}
+
+#elif ! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@
+/* Only the iswblank function is missing.  */
+
+# if @REPLACE_ISWBLANK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define iswblank rpl_iswblank
+#  endif
+# endif
+
+static inline int
+# if @REPLACE_ISWBLANK@
+rpl_iswblank
+# else
+iswblank
+# endif
+         (wint_t wc)
+{
+  return wc == ' ' || wc == '\t';
+}
+
+#endif
+
+#if defined __MINGW32__
+
+/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
+   The functions towlower and towupper are implemented in the MSVCRT library
+   to take a wchar_t argument and return a wchar_t result.  mingw declares
+   these functions to take a wint_t argument and return a wint_t result.
+   This means that:
+   1. When the user passes an argument outside the range 0x0000..0xFFFF, the
+      function will look only at the lower 16 bits.  This is allowed according
+      to POSIX.
+   2. The return value is returned in the lower 16 bits of the result register.
+      The upper 16 bits are random: whatever happened to be in that part of the
+      result register.  We need to fix this by adding a zero-extend from
+      wchar_t to wint_t after the call.  */
+
+static inline wint_t
+rpl_towlower (wint_t wc)
+{
+  return (wint_t) (wchar_t) towlower (wc);
+}
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  define towlower rpl_towlower
+# endif
+
+static inline wint_t
+rpl_towupper (wint_t wc)
+{
+  return (wint_t) (wchar_t) towupper (wc);
+}
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  define towupper rpl_towupper
+# endif
+
+#endif /* __MINGW32__ */
+
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
+# if @REPLACE_ISWBLANK@
+_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
+# else
+_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
+# endif
+_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
+#endif
+_GL_CXXALIASWARN (iswalnum);
+_GL_CXXALIASWARN (iswalpha);
+_GL_CXXALIASWARN (iswblank);
+_GL_CXXALIASWARN (iswcntrl);
+_GL_CXXALIASWARN (iswdigit);
+_GL_CXXALIASWARN (iswgraph);
+_GL_CXXALIASWARN (iswlower);
+_GL_CXXALIASWARN (iswprint);
+_GL_CXXALIASWARN (iswpunct);
+_GL_CXXALIASWARN (iswspace);
+_GL_CXXALIASWARN (iswupper);
+_GL_CXXALIASWARN (iswxdigit);
+
+#if @REPLACE_ISWCNTRL@ || defined __MINGW32__
+_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
+_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (towlower, wint_t, (wint_t wc));
+_GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc));
+#endif
+_GL_CXXALIASWARN (towlower);
+_GL_CXXALIASWARN (towupper);
+
 
 #endif /* _GL_WCTYPE_H */
 #endif /* _GL_WCTYPE_H */
index 250b5cc8fd4b30ee6f874d487127612a1d2fc801..3a98f24f94ea0e7cae3db92c0f1b3d3c87c13388 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX compatible write() function.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -46,14 +46,14 @@ rpl_write (int fd, const void *buf, size_t count)
   if (ret < 0)
     {
       if (GetLastError () == ERROR_NO_DATA
-         && GetFileType (_get_osfhandle (fd)) == FILE_TYPE_PIPE)
-       {
-         /* Try to raise signal SIGPIPE.  */
-         raise (SIGPIPE);
-         /* If it is currently blocked or ignored, change errno from EINVAL
-            to EPIPE.  */
-         errno = EPIPE;
-       }
+          && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE)
+        {
+          /* Try to raise signal SIGPIPE.  */
+          raise (SIGPIPE);
+          /* If it is currently blocked or ignored, change errno from EINVAL
+             to EPIPE.  */
+          errno = EPIPE;
+        }
     }
   return ret;
 }
index 2d99a6b14dada690ad41eec16c52de6e2a176ab2..fbd63290d6c84cb687654e444ae1539e88f14f96 100644 (file)
@@ -1,10 +1,10 @@
 /* xsize.h -- Checked size_t computations.
 
-   Copyright (C) 2003, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008, 2009, 2010 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)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
index a626e7370af878a86b1c6886a519a0ab23e6da67..910d459cdea9ed0b54faf4438083e4c72feee8b6 100644 (file)
@@ -20,6 +20,7 @@ use Test::More tests => 47;
 use File::Path;
 use Data::Dumper;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
index 5d786d0a2d60894fc92f26338e3bbc43af467180..fc6d9ad0831054bd3979720bb310ffc77484389a 100644 (file)
@@ -337,7 +337,7 @@ try_run_changer(
 ## check chg-disk
 
 # Installcheck::Run sets up the whole chg-disk thing for us
-$testconf = Installcheck::Run->setup();
+$testconf = Installcheck::Run::setup();
 $testconf->write();
 
 $cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF');
index 138fe93b692348e5df25e9e9036fb6d09756ff2e..4c666662c263ae333fa6ffdfeae10390d5795019 100644 (file)
@@ -380,26 +380,20 @@ Amanda::MainLoop::run();
                f_type => undef, label => undef,
                reserved => 0 },
              { slot => 2, state => Amanda::Changer::SLOT_FULL,
-               device_status => ($DEVICE_STATUS_DEVICE_ERROR |
-                                 $DEVICE_STATUS_VOLUME_UNLABELED |
-                                 $DEVICE_STATUS_VOLUME_ERROR),
-               f_type => undef, label => undef,
+               device_status => $DEVICE_STATUS_VOLUME_UNLABELED,
+               f_type => $Amanda::Header::F_EMPTY, label => undef,
                reserved => 0 },
              { slot => 3, state => Amanda::Changer::SLOT_FULL,
-               device_status => ($DEVICE_STATUS_DEVICE_ERROR |
-                                 $DEVICE_STATUS_VOLUME_UNLABELED |
-                                 $DEVICE_STATUS_VOLUME_ERROR),
-               f_type => undef, label => undef,
+               device_status => $DEVICE_STATUS_VOLUME_UNLABELED,
+               f_type => $Amanda::Header::F_EMPTY, label => undef,
                reserved => 0 },
              { slot => 4, state => Amanda::Changer::SLOT_FULL,
                device_status => $DEVICE_STATUS_SUCCESS,
                f_type => $Amanda::Header::F_TAPESTART, label => "FOO?BAR",
                reserved => 0, current => 1 },
              { slot => 5, state => Amanda::Changer::SLOT_FULL,
-               device_status => ($DEVICE_STATUS_DEVICE_ERROR |
-                                 $DEVICE_STATUS_VOLUME_UNLABELED |
-                                 $DEVICE_STATUS_VOLUME_ERROR),
-               f_type => undef, label => undef,
+               device_status => $DEVICE_STATUS_VOLUME_UNLABELED,
+               f_type => $Amanda::Header::F_EMPTY, label => undef,
                reserved => 0 },
                ], "inventory finds the labeled tape");
 
index 895c2473a1f333661259ce810d1fe5f16e28a1ed..a04ac2b181041c7fae14719be64544ce6ca74159 100644 (file)
@@ -20,6 +20,7 @@ use Test::More tests => 165;
 use File::Path;
 use Data::Dumper;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
index dad5e8a3aed6370495e8246ec7216e51cd8bc3d1..342bb07eb60b58d95eea1a7fbeeb2e49073d9be1 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 use Test::More tests => 4;
 use File::Path;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
index 37df0f380cf2a8820b02af0a5c47f995d70aa53a..1b2618765b2fb799137e80f166e5ec3981cc793a 100644 (file)
@@ -20,6 +20,7 @@ use Test::More tests => 42;
 use File::Path;
 use Data::Dumper;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
index 763395fa20922a2862d03201ec7a686c77a877e0..e280375775e33a4d5452b347079b71df02344763 100644 (file)
@@ -20,6 +20,7 @@ use Test::More tests => 321;
 use File::Path;
 use Data::Dumper;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
@@ -1176,18 +1177,15 @@ sub test_changer {
 
     step moved4 => sub {
        my ($err) = @_;
+       die "$err" if $err;
 
-       chg_err_like($err,
-           { message => "slot 4 is currently loaded",
-             reason => 'invalid',
-             type => 'failed' },
-           "$pfx: moving from a loaded slot is an error");
+       pass("$pfx: move of a loaded volume succeeds");
 
        $steps->{'move5'}->();
     };
 
     step move5 => sub {
-       $chg->move(from_slot => 2, to_slot => 5, finished_cb => $steps->{'inventory7'});
+       $chg->move(from_slot => 2, to_slot => 4, finished_cb => $steps->{'inventory7'});
     };
 
 
@@ -1210,13 +1208,13 @@ sub test_changer {
              barcode => '33333', loaded_in => 1,
              device_status => undef, f_type => undef, label => 'TAPE-3' },
            { slot => 4, state => Amanda::Changer::SLOT_FULL,
-             barcode => '44444', loaded_in => 0, current => 1,
+             barcode => '22222', current => 1,
              device_status => $DEVICE_STATUS_SUCCESS,
-             f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
+             f_type => $Amanda::Header::F_TAPESTART, label => 'SURPRISE!' },
            { slot => 5, state => Amanda::Changer::SLOT_FULL,
-             barcode => '22222',
+             barcode => '44444',
              device_status => $DEVICE_STATUS_SUCCESS,
-             f_type => $Amanda::Header::F_TAPESTART, label => 'SURPRISE!' },
+             f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
        ], "$pfx: inventory reflects the move");
     };
 
@@ -1262,22 +1260,22 @@ sub test_changer {
                "$pfx: scanning with except_slots works");
        check_inventory($chg, $mtx_config->{'barcodes'} > 0, $steps->{'update_unknown'}, [
            { slot => 1, state => Amanda::Changer::SLOT_FULL,
-             barcode => '11111', loaded_in => 0,
+             barcode => '11111', loaded_in => 1,
              device_status => $DEVICE_STATUS_SUCCESS,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1' },
            { slot => 2, state => Amanda::Changer::SLOT_EMPTY,
              device_status => undef, f_type => undef, label => undef },
            { slot => 3, state => Amanda::Changer::SLOT_FULL,
-             barcode => '33333', loaded_in => 1,
+             barcode => '33333', loaded_in => 0,
              device_status => undef, f_type => undef, label => 'TAPE-3' },
            { slot => 4, state => Amanda::Changer::SLOT_FULL,
-             barcode => '44444', current => 1,
+             barcode => '22222', current => 1,
              device_status => $DEVICE_STATUS_SUCCESS,
-             f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
+             f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-2' },
            { slot => 5, state => Amanda::Changer::SLOT_FULL,
-             barcode => '22222',
+             barcode => '44444',
              device_status => $DEVICE_STATUS_SUCCESS,
-             f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-2' },
+             f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
        ], "$pfx: inventory before updates with unknown state");
     };
 
@@ -1292,41 +1290,41 @@ sub test_changer {
        if ($mtx_config->{'barcodes'} > 0) {
            check_inventory($chg, $mtx_config->{'barcodes'} > 0, $steps->{'quit'}, [
                { slot => 1, state => Amanda::Changer::SLOT_FULL,
-                 barcode => '11111', loaded_in => 0,
+                 barcode => '11111', loaded_in => 1,
                  device_status => $DEVICE_STATUS_SUCCESS,
                  f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1' },
                { slot => 2, state => Amanda::Changer::SLOT_EMPTY,
                  device_status => undef, f_type => undef, label => undef },
                { slot => 3, state => Amanda::Changer::SLOT_FULL,
-                 barcode => '33333', loaded_in => 1,
+                 barcode => '33333', loaded_in => 0,
                  device_status => undef, f_type => undef, label => 'TAPE-3' },
                { slot => 4, state => Amanda::Changer::SLOT_FULL,
-                 barcode => '44444', current => 1,
+                 barcode => '22222', current => 1,
                  device_status => $DEVICE_STATUS_SUCCESS,
-                 f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
+                 f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-2' },
                { slot => 5, state => Amanda::Changer::SLOT_FULL,
-                 barcode => '22222',
+                 barcode => '44444',
                  device_status => $DEVICE_STATUS_SUCCESS,
-                 f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-2' },
+                 f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
            ], "$pfx: inventory reflects updates with unknown state with barcodes");
        } else {
            check_inventory($chg, $mtx_config->{'barcodes'} > 0, $steps->{'quit'}, [
                { slot => 1, state => Amanda::Changer::SLOT_FULL,
-                 barcode => '11111', loaded_in => 0,
+                 barcode => '11111', loaded_in => 1,
                  device_status => $DEVICE_STATUS_SUCCESS,
                  f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1' },
                { slot => 2, state => Amanda::Changer::SLOT_EMPTY,
                  device_status => undef, f_type => undef, label => undef },
                { slot => 3, state => Amanda::Changer::SLOT_FULL,
-                 barcode => '33333', loaded_in => 1,
+                 barcode => '33333', loaded_in => 0,
                  device_status => undef, f_type => undef, label => undef },
                { slot => 4, state => Amanda::Changer::SLOT_FULL,
-                 barcode => '44444', current => 1,
+                 barcode => '22222', current => 1,
                  device_status => undef, f_type => undef, label => undef },
                { slot => 5, state => Amanda::Changer::SLOT_FULL,
-                 barcode => '22222',
+                 barcode => '44444',
                  device_status => $DEVICE_STATUS_SUCCESS,
-                 f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-2' },
+                 f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
            ], "$pfx: inventory reflects updates with unknown state without barcodes");
        }
     };
index 80da868e38ca9f63d0e17263af0a0948659a3427..f2c42cf5f4879e52651994789d59824f6df815c3 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 use Test::More tests => 6;
 use File::Path;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
@@ -46,7 +47,8 @@ if ($cfg_result != $CFGERR_OK) {
     die(join "\n", @errors);
 }
 
-my $chg = Amanda::Changer->new("chg-single:tape:/foo");
+my $chg = Amanda::Changer->new("chg-single:null:/foo");
+die "$chg" if $chg->isa("Amanda::Changer::Error");
 
 {
     my ($held_res);
@@ -72,7 +74,7 @@ my $chg = Amanda::Changer->new("chg-single:tape:/foo");
        my ($err, $res) = @_;
        ok(!$err, "no error loading relative slot 'current'")
            or diag($err);
-       is($res->{'device'}->device_name(), 'tape:/foo',
+       is($res->{'device'}->device_name(), 'null:/foo',
            "returns correct device name");
 
        $held_res = $res; # hang onto it while loading another slot
@@ -84,7 +86,7 @@ my $chg = Amanda::Changer->new("chg-single:tape:/foo");
     $got_second_res = make_cb('got_second_res' => sub {
        my ($err, $res) = @_;
        chg_err_like($err,
-           { message => qr{'tape:/foo' is already reserved},
+           { message => qr{'null:/foo' is already reserved},
              type => 'failed',
              reason => 'volinuse' },
            "second simultaneous reservation rejected");
index 441028f3a79ffff962e114932261a895c30d36dd..e752fc7a2c5850b3e0e6bc17903ebb8eb79929a4 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2007,2008 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2007, 2008, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 42;
+use Test::More tests => 43;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Amanda::Paths;
 use Amanda::Cmdline qw( header_matches_dumpspecs );
 use Amanda::Header;
 
+my @specs;
+my $hdr;
+
 # convert a dumpspec_t object to an array, for easy is_deeply() comparisons
 sub ds2av {
     my ($ds) = @_;
@@ -31,65 +36,67 @@ sub ds2av {
        $ds->{'disk'},
        $ds->{'datestamp'},
        $ds->{'level'},
+       $ds->{'write_timestamp'},
     );
 }
 
 # test dumpspec_t objects
 
-is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", "di", "ds", "l")) ],
-         [ "h", "di", "ds", "l" ],
+is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", "di", "ds", "l", undef)) ],
+         [ "h", "di", "ds", "l", undef ],
          "dumpspec_t constructor returns a valid dumpspec");
 
-is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", "di", "ds", undef)) ],
-         [ "h", "di", "ds", undef ],
+is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", "di", "ds", undef, undef)) ],
+         [ "h", "di", "ds", undef, undef ],
          "dumpspec_t constructor returns a valid dumpspec with only 3 args");
 
-is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", "di", undef, undef)) ],
-         [ "h", "di", undef, undef ],
+is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", "di", undef, undef, undef)) ],
+         [ "h", "di", undef, undef, undef ],
          "dumpspec_t constructor returns a valid dumpspec with only 2 args");
 
-is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", undef, undef, undef)) ],
-         [ "h", undef, undef, undef ],
+is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", undef, undef, undef, undef)) ],
+         [ "h", undef, undef, undef, undef ],
          "dumpspec_t constructor returns a valid dumpspec with only 1 arg");
 
-# TODO: test parse_dumpspecs
-my @specs;
+is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, undef, "wt")) ],
+         [ undef, undef, undef, undef, "wt" ],
+         "dumpspec_t constructor returns a valid dumpspec with only write_timestamp arg");
 
 @specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1", "h2", "d2"], 0);
 is(@specs, 2, "parse of four elements with no flags yields 2 specs");
-is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", undef, undef ], "..first spec is correct");
-is_deeply([ ds2av($specs[1]) ], [ "h2", "d2", undef, undef ], "..second spec is correct");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", undef, undef, undef ], "..first spec is correct");
+is_deeply([ ds2av($specs[1]) ], [ "h2", "d2", undef, undef, undef ], "..second spec is correct");
 
 @specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1", "ds1", "h2", "d2", "ds2" ], $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP);
 is(@specs, 2, "parse of six elements with CMDLINE_PARSE_DATESTAMP yields 2 specs");
-is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", undef ], "..first spec is correct");
-is_deeply([ ds2av($specs[1]) ], [ "h2", "d2", "ds2", undef ], "..second spec is correct");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", undef, undef ], "..first spec is correct");
+is_deeply([ ds2av($specs[1]) ], [ "h2", "d2", "ds2", undef, undef ], "..second spec is correct");
 
 @specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1", "ds1", "lv1", "h2", "d2", "ds2", "lv2" ],
                $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
 is(@specs, 2, "parse of eight elements with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields 2 specs");
-is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", "lv1" ], "..first spec is correct");
-is_deeply([ ds2av($specs[1]) ], [ "h2", "d2", "ds2", "lv2" ], "..second spec is correct");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", "lv1", undef ], "..first spec is correct");
+is_deeply([ ds2av($specs[1]) ], [ "h2", "d2", "ds2", "lv2", undef ], "..second spec is correct");
 
 @specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1", "ds1", "lv1" ],
                $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
 is(@specs, 1, "parse of four elements with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields one spec");
-is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", "lv1" ], "..which is correct");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", "lv1", undef ], "..which is correct");
 
 @specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1", "ds1" ],
                $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
 is(@specs, 1, "parse of three elements with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields one spec");
-is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", undef ], "..which is correct");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", undef, undef ], "..which is correct");
 
 @specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1" ],
                $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
 is(@specs, 1, "parse of two elements with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields one spec");
-is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", undef, undef ], "..which is correct");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", undef, undef, undef ], "..which is correct");
 
 @specs = Amanda::Cmdline::parse_dumpspecs(["h1" ],
                $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
 is(@specs, 1, "parse of one element with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields one spec");
-is_deeply([ ds2av($specs[0]) ], [ "h1", undef, undef, undef ], "..which is correct");
+is_deeply([ ds2av($specs[0]) ], [ "h1", undef, undef, undef, undef ], "..which is correct");
 
 @specs = Amanda::Cmdline::parse_dumpspecs([],
                $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
@@ -116,47 +123,47 @@ $hdr->{'type'} = $Amanda::Header::F_DUMPFILE;
 
 ok(!header_matches_dumpspecs($hdr, []), "header doesn't match empty list of dumpspecs");
 
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new('foo.bar.baz', undef, undef, undef)]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new('foo.bar.baz', undef, undef, undef, undef)]),
    'header matches exact host dumpspec');
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new('foo', undef, undef, undef)]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new('foo', undef, undef, undef, undef)]),
    'header matches partial host dumpspec');
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new('?a*', undef, undef, undef)]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new('?a*', undef, undef, undef, undef)]),
    'header matches host pattern dumpspec');
 
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, '/foo/bar/baz', undef, undef)]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, '/foo/bar/baz', undef, undef, undef)]),
    'header matches exact disk dumpspec');
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, 'bar', undef, undef)]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, 'bar', undef, undef, undef)]),
    'header matches partial disk dumpspec');
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, '*a?', undef, undef)]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, '*a?', undef, undef, undef)]),
    'header matches disk pattern dumpspec');
 
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, '20090102030405', undef)]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, '20090102030405', undef, undef)]),
    'header matches exact datestamp dumpspec');
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, '2009', undef)]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, '2009', undef, undef)]),
    'header matches partial datestamp dumpspec');
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, '20090102030404-20090102030406', undef)]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, '20090102030404-20090102030406', undef, undef)]),
    'header matches datestamp range dumpspec');
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, '2009-2010', undef)]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, '2009-2010', undef, undef)]),
    'header matches datestamp year-only range dumpspec');
-ok(!header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, '20090102030406-20090102030407', undef)]),
+ok(!header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, '20090102030406-20090102030407', undef, undef)]),
    "header doesn't match datestamp range dumpspec that it's outside of");
 
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, '31')]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, '31', undef)]),
    'header matches exact level dumpspec');
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, '30-32')]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, '30-32', undef)]),
    'header matches small level range dumpspec');
-ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, '4-50')]),
+ok(header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, '4-50', undef)]),
    'header matches large level range dumpspec');
-ok(!header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, '32-50')]),
+ok(!header_matches_dumpspecs($hdr, [Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, '32-50', undef)]),
    "header doesn't match level range it's outside of");
 
 ok(header_matches_dumpspecs($hdr, [
-    Amanda::Cmdline::dumpspec_t->new('foo.bar.baz', undef, undef, undef),
-    Amanda::Cmdline::dumpspec_t->new(undef, '/foo/bar/baz', undef, undef),
+    Amanda::Cmdline::dumpspec_t->new('foo.bar.baz', undef, undef, undef, undef),
+    Amanda::Cmdline::dumpspec_t->new(undef, '/foo/bar/baz', undef, undef, undef),
   ]),
   'header matches when two dumpspecs are possible matches');
 ok(!header_matches_dumpspecs($hdr, [
-    Amanda::Cmdline::dumpspec_t->new(undef, undef, '20090102030406-20090102030407', undef),
-    Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, '32-50'),
+    Amanda::Cmdline::dumpspec_t->new(undef, undef, '20090102030406-20090102030407', undef, undef),
+    Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, '32-50', undef),
   ]),
   'header matches when two dumpspecs are given and neither should match');
index fece651687c31076a8fcc33d4b850f461dd5c365..ef2ea7b23893541273b0fd3ab8a7c28b68c2c53f 100644 (file)
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 176;
+use Test::More tests => 204;
 use strict;
+use warnings;
+use Data::Dumper;
 
 use lib "@amperldir@";
 use Installcheck::Config;
 use Amanda::Paths;
 use Amanda::Tests;
-use Amanda::Config qw( :init :getconf string_to_boolean );
+use Amanda::Config qw( :init :getconf string_to_boolean amandaify_property_name );
 use Amanda::Debug;
 
 my $testconf;
@@ -64,7 +66,7 @@ is(getconf($CNF_TAPEDEV), "null:TEST",
 # Check out error handling
 
 $testconf = Installcheck::Config->new();
-$testconf->add_param('tapebufs', '13'); # a deprecated keyword -> warning
+$testconf->add_param('label_new_tapes', '"xx"'); # a deprecated keyword -> warning
 $testconf->write();
 
 {
@@ -97,6 +99,8 @@ $testconf = Installcheck::Config->new();
 $testconf->add_client_param('property', '"client-prop" "yep"');
 $testconf->add_client_param('property', 'priority "clIent-prop1" "foo"');
 $testconf->add_client_param('property', 'append "clieNt-prop" "bar"');
+$testconf->add_client_param('property', '"ANotHer_prOp" "baz"');
+$testconf->add_client_param('property', 'append "ANOTHER-prop" "boo"');
 $testconf->write();
 
 my $cfg_result = config_init($CONFIG_INIT_CLIENT, undef);
@@ -109,7 +113,10 @@ is_deeply(getconf($CNF_PROPERTY), { "client-prop1" => { priority => 1,
                                                        values => [ "foo" ]},
                                    "client-prop" => { priority => 0,
                                                       append   => 1,
-                                                      values => [ "yep", "bar" ] }},
+                                                      values => [ "yep", "bar" ] },
+                                   "another-prop" => { priority => 0,
+                                                       append   => 1,
+                                                       values => [ "baz", "boo" ] }},
     "Client PROPERTY parameter parsed correctly");
 
 ##
@@ -143,6 +150,10 @@ $testconf->add_param('debug_auth', '1');
 $testconf->add_tapetype('mytapetype', [
     'comment' => '"mine"',
     'length' => '128 M',
+    'part_size' => '100M',
+    'part_cache_type' => 'disk',
+    'part_cache_dir' => '"/usr/bin"',
+    'part_cache_max_size' => '50M',
 ]);
 $testconf->add_dumptype('mydump-type', [    # note dash
     'comment' => '"mine"',
@@ -163,7 +174,9 @@ $testconf->add_dumptype('mydump-type', [    # note dash
     'include file optional' => '"rhyme"',
     'property' => '"prop" "erty"',
     'property' => '"DROP" "qwerty" "asdfg"',
-    'estimate' => 'server calcsize client'
+    'estimate' => 'server calcsize client',
+    'allow_split' => 'no',
+    'allow_split' => 'no',
 ]);
 $testconf->add_dumptype('second_dumptype', [ # note underscore
     '' => 'mydump-type',
@@ -172,6 +185,7 @@ $testconf->add_dumptype('second_dumptype', [ # note underscore
 $testconf->add_dumptype('third_dumptype', [
     '' => 'second_dumptype',
     'comment' => '"refers to second_dumptype with an underscore"',
+    'recovery-limit' => '"left" same-host "right"',
 ]);
 $testconf->add_interface('ethernet', [
     'comment' => '"mine"',
@@ -204,6 +218,7 @@ $testconf->add_device('my_device', [
   'comment' => '"my device is mine, not yours"',
   'tapedev' => '"tape:/dev/nst0"',
   'device_property' => '"BLOCK_SIZE" "128k"',
+  'device_property' => '"CoMmENT" "what up?"',
 ]);
 $testconf->add_changer('my_changer', [
   'comment' => '"my changer is mine, not yours"',
@@ -217,305 +232,288 @@ $testconf->add_changer('my_changer', [
 $testconf->write();
 
 $cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF');
-is($cfg_result, $CFGERR_OK,
-    "Load test configuration")
-    or diag_config_errors();
-
-SKIP: {
-    skip "error loading config", 3 unless $cfg_result == $CFGERR_OK;
-
-    is(Amanda::Config::get_config_name(), "TESTCONF", 
-       "config_name set");
-    is(Amanda::Config::get_config_dir(), "$CONFIG_DIR/TESTCONF", 
-       "config_dir set");
-    is(Amanda::Config::get_config_filename(),
-       "$CONFIG_DIR/TESTCONF/amanda.conf", 
-       "config_filename set");
-}
-
-SKIP: { # global parameters
-    skip "error loading config", 13 unless $cfg_result == $CFGERR_OK;
-
-    is(getconf($CNF_RESERVE), 75,
-       "integer global confparm");
-    is(getconf($CNF_BUMPSIZE), $int64_num+0,
-       "int64 global confparm");
-    is(getconf($CNF_TAPEDEV), "/dev/foo",
-       "string global confparm");
-    is(getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE), $size_t_num+0,
-       "size global confparm");
-    ok(getconf($CNF_AUTOFLUSH),
-       "boolean global confparm");
-    is(getconf($CNF_USETIMESTAMPS), 0,
-       "boolean global confparm, passing an integer (0)");
-    is(getconf($CNF_TAPERALGO), $Amanda::Config::ALGO_LAST,
-       "taperalgo global confparam");
-    is_deeply([getconf($CNF_RESERVED_UDP_PORT)], [100,200],
-       "intrange global confparm");
-    is(getconf($CNF_DISPLAYUNIT), "M",
-       "displayunit is correctly uppercased");
-    is_deeply(getconf($CNF_DEVICE_PROPERTY),
-             { "foo" => { priority => 0, append => 0, values => ["bar"]},
-               "blue" => { priority => 0, append => 0,
-                           values => ["car", "tar"]} },
-           "proplist global confparm");
-    is_deeply(getconf($CNF_AUTOLABEL),
-           { template => undef, other_config => '',
-             non_amanda => 1, volume_error => '', empty => 1 },
-           "'autolabel non-amanda empty' represented correctly");
-    ok(getconf_seen($CNF_TAPEDEV),
-       "'tapedev' parm was seen");
-    ok(!getconf_seen($CNF_CHANGERFILE),
-       "'changerfile' parm was not seen");
-}
-
-SKIP: { # derived values
-    skip "error loading config", 3 unless $cfg_result == $CFGERR_OK;
-
-    is(Amanda::Config::getconf_unit_divisor(), 1024, 
-       "correct unit divisor (from displayunit -> KB)");
-    ok($Amanda::Config::debug_auth, 
-       "debug_auth setting reflected in global variable");
-    ok(!$Amanda::Config::debug_amandad, 
-       "debug_amandad defaults to false");
-}
-
-SKIP: { # tapetypes
-    skip "error loading config", 6 unless $cfg_result == $CFGERR_OK;
-    my $ttyp = lookup_tapetype("mytapetype");
-    ok($ttyp, "found mytapetype");
-    is(tapetype_getconf($ttyp, $TAPETYPE_COMMENT), 'mine', 
-       "tapetype comment");
-    is(tapetype_getconf($ttyp, $TAPETYPE_LENGTH), 128 * 1024, 
-       "tapetype comment");
-
-    ok(tapetype_seen($ttyp, $TAPETYPE_COMMENT),
-       "tapetype comment was seen");
-    ok(!tapetype_seen($ttyp, $TAPETYPE_LBL_TEMPL),
-       "tapetype lbl_templ was not seen");
-
-    is_deeply([ sort(+getconf_list("tapetype")) ],
-             [ sort("mytapetype", "TEST-TAPE") ],
-       "getconf_list lists all tapetypes");
-}
-
-SKIP: { # dumptypes
-    skip "error loading config", 18 unless $cfg_result == $CFGERR_OK;
-
-    my $dtyp = lookup_dumptype("mydump-type");
-    ok($dtyp, "found mydump-type");
-    is(dumptype_getconf($dtyp, $DUMPTYPE_COMMENT), 'mine', 
-       "dumptype string");
-    is(dumptype_getconf($dtyp, $DUMPTYPE_PRIORITY), 2, 
-       "dumptype priority");
-    is(dumptype_getconf($dtyp, $DUMPTYPE_BUMPSIZE), $int64_num+0,
-       "dumptype size");
-    is(dumptype_getconf($dtyp, $DUMPTYPE_BUMPMULT), 1.75,
-       "dumptype real");
-    is(dumptype_getconf($dtyp, $DUMPTYPE_STARTTIME), 1829,
-       "dumptype time");
-    is(dumptype_getconf($dtyp, $DUMPTYPE_HOLDINGDISK), $HOLD_REQUIRED,
-       "dumptype holdingdisk");
-    is(dumptype_getconf($dtyp, $DUMPTYPE_COMPRESS), $COMP_BEST,
-       "dumptype compress");
-    is(dumptype_getconf($dtyp, $DUMPTYPE_ENCRYPT), $ENCRYPT_SERV_CUST,
-       "dumptype encrypt");
-    is(dumptype_getconf($dtyp, $DUMPTYPE_STRATEGY), $DS_INCRONLY,
-       "dumptype strategy");
-    is_deeply([dumptype_getconf($dtyp, $DUMPTYPE_COMPRATE)], [0.25, 0.75],
-       "dumptype comprate");
-    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_INCLUDE),
-       { 'file' => [ 'rhyme' ],
-         'list' => [ 'bing', 'ting', 'string', 'fling' ],
-         'optional' => 1 },
-       "dumptype include list");
-    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_EXCLUDE),
-       { 'file' => [ 'foolist' ],
-         'list' => [ 'foo', 'bar', 'true', 'star' ],
-         'optional' => 0 },
-       "dumptype exclude list");
-    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_ESTIMATELIST),
-             [ $ES_SERVER, $ES_CALCSIZE, $ES_CLIENT ],
-       "dumptype estimate list");
-    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_PROPERTY),
-             { "prop" => { priority => 0, append => 0, values => ["erty"]},
-               "drop" => { priority => 0, append => 0,
-                           values => ["qwerty", "asdfg"] }},
-           "dumptype proplist");
-
-    ok(dumptype_seen($dtyp, $DUMPTYPE_EXCLUDE),
-       "'exclude' parm was seen");
-    ok(!dumptype_seen($dtyp, $DUMPTYPE_RECORD),
-       "'record' parm was not seen");
-
-    is_deeply([ sort(+getconf_list("dumptype")) ],
-             [ sort(qw(
-               mydump-type second_dumptype third_dumptype 
-               NO-COMPRESS COMPRESS-FAST COMPRESS-BEST COMPRESS-CUST
-               SRVCOMPRESS BSD-AUTH NO-RECORD NO-HOLD
-               NO-FULL
-               )) ],
-       "getconf_list lists all dumptypes (including defaults)");
-}
-
-SKIP: { # interfaces
-    skip "error loading config", 8 unless $cfg_result == $CFGERR_OK;
-    my $iface = lookup_interface("ethernet");
-    ok($iface, "found ethernet");
-    is(interface_name($iface), "ethernet",
-       "interface knows its name");
-    is(interface_getconf($iface, $INTER_COMMENT), 'mine', 
-       "interface comment");
-    is(interface_getconf($iface, $INTER_MAXUSAGE), 100, 
-       "interface maxusage");
-
-    $iface = lookup_interface("nic");
-    ok($iface, "found nic");
-    ok(interface_seen($iface, $INTER_COMMENT),
-       "seen set for parameters that appeared");
-    ok(!interface_seen($iface, $INTER_MAXUSAGE),
-       "seen not set for parameters that did not appear");
-
-    is_deeply([ sort(+getconf_list("interface")) ],
-             [ sort('ethernet', 'nic', 'default') ],
-       "getconf_list lists all interfaces (in any order)");
-}
-
-SKIP: { # holdingdisks
-    skip "error loading config", 13 unless $cfg_result == $CFGERR_OK;
-    my $hdisk = lookup_holdingdisk("hd1");
-    ok($hdisk, "found hd1");
-    is(holdingdisk_name($hdisk), "hd1",
-       "hd1 knows its name");
-    is(holdingdisk_getconf($hdisk, $HOLDING_COMMENT), 'mine', 
-       "holdingdisk comment");
-    is(holdingdisk_getconf($hdisk, $HOLDING_DISKDIR), '/mnt/hd1',
-       "holdingdisk diskdir (directory)");
-    is(holdingdisk_getconf($hdisk, $HOLDING_DISKSIZE), 100*1024, 
-       "holdingdisk disksize (use)");
-    is(holdingdisk_getconf($hdisk, $HOLDING_CHUNKSIZE), 1024, 
-       "holdingdisk chunksize");
-
-    $hdisk = lookup_holdingdisk("hd2");
-    ok($hdisk, "found hd2");
-    ok(holdingdisk_seen($hdisk, $HOLDING_COMMENT),
-       "seen set for parameters that appeared");
-    ok(!holdingdisk_seen($hdisk, $HOLDING_CHUNKSIZE),
-       "seen not set for parameters that did not appear");
-
-    # only holdingdisks have this linked-list structure
-    # exposed
-    my $hdisklist = getconf($CNF_HOLDINGDISK);
-    my $first_disk = @$hdisklist[0];
-    $hdisk = lookup_holdingdisk($first_disk);
-    like(holdingdisk_name($hdisk), qr/hd[12]/,
-       "one disk is first in list of holdingdisks");
-    $hdisk = lookup_holdingdisk(@$hdisklist[1]);
-    like(holdingdisk_name($hdisk), qr/hd[12]/,
-       "another is second in list of holdingdisks");
-    ok($#$hdisklist == 1,
-       "no third holding disk");
-
-    is_deeply([ sort(+getconf_list("holdingdisk")) ],
-             [ sort('hd1', 'hd2') ],
-       "getconf_list lists all holdingdisks (in any order)");
-}
-
-SKIP: { # application
-    skip "error loading config", 5 unless $cfg_result == $CFGERR_OK;
-    my $app = lookup_application("my_app");
-    ok($app, "found my_app");
-    is(application_name($app), "my_app",
-       "my_app knows its name");
-    is(application_getconf($app, $APPLICATION_COMMENT), 'my_app_comment', 
-       "application comment");
-    is(application_getconf($app, $APPLICATION_PLUGIN), 'amgtar',
-       "application plugin (amgtar)");
-
-    is_deeply([ sort(+getconf_list("application-tool")) ],
-             [ sort("my_app") ],
-       "getconf_list lists all applications");
-    # test backward compatibility
-    is_deeply([ sort(+getconf_list("application")) ],
-             [ sort("my_app") ],
-       "getconf_list works for 'application-tool', too");
-}
-
-SKIP: { # script
-    skip "error loading config", 7 unless $cfg_result == $CFGERR_OK;
-    my $sc = lookup_pp_script("my_script");
-    ok($sc, "found my_script");
-    is(pp_script_name($sc), "my_script",
-       "my_script knows its name");
-    is(pp_script_getconf($sc, $PP_SCRIPT_COMMENT), 'my_script_comment', 
-       "script comment");
-    is(pp_script_getconf($sc, $PP_SCRIPT_PLUGIN), 'script-email',
-       "script plugin (script-email)");
-    is(pp_script_getconf($sc, $PP_SCRIPT_EXECUTE_WHERE), $ES_CLIENT,
-       "script execute_where (client)");
-    is(pp_script_getconf($sc, $PP_SCRIPT_EXECUTE_ON),
-       $EXECUTE_ON_PRE_HOST_BACKUP|$EXECUTE_ON_POST_HOST_BACKUP,
-       "script execute_on");
-
-    is_deeply([ sort(+getconf_list("script")) ],
-             [ sort("my_script") ],
-       "getconf_list lists all script");
-
-    is_deeply([ sort(+getconf_list("script-tool")) ],
-             [ sort("my_script") ],
-       "getconf_list works for 'script-tool', too");
+if (!is($cfg_result, $CFGERR_OK,
+    "Load test configuration")) {
+    diag_config_errors();
+    die "aborting after config errors";
 }
 
-SKIP: { # device
-    skip "error loading config", 6 unless $cfg_result == $CFGERR_OK;
-    my $dc = lookup_device_config("my_device");
-    ok($dc, "found my_device");
-    is(device_config_name($dc), "my_device",
-       "my_device knows its name");
-    is(device_config_getconf($dc, $DEVICE_CONFIG_COMMENT), 'my device is mine, not yours',
-       "device comment");
-    is(device_config_getconf($dc, $DEVICE_CONFIG_TAPEDEV), 'tape:/dev/nst0',
-       "device tapedev");
-    # TODO do we really need all of this equipment for device properties?
-    is_deeply(device_config_getconf($dc, $DEVICE_CONFIG_DEVICE_PROPERTY),
-          { "block_size" => { 'priority' => 0, 'values' => ["128k"], 'append' => 0 }, },
-        "device config proplist");
-
-    is_deeply([ sort(+getconf_list("device")) ],
-             [ sort("my_device") ],
-       "getconf_list lists all devices");
-}
-
-SKIP: { # changer
-    skip "error loading config", 7 unless $cfg_result == $CFGERR_OK;
-    my $dc = lookup_changer_config("my_changer");
-    ok($dc, "found my_changer");
-    is(changer_config_name($dc), "my_changer",
-       "my_changer knows its name");
-    is(changer_config_getconf($dc, $CHANGER_CONFIG_COMMENT), 'my changer is mine, not yours',
-       "changer comment");
-    is(changer_config_getconf($dc, $CHANGER_CONFIG_CHANGERDEV), '/dev/sg0',
-       "changer tapedev");
-    is_deeply(changer_config_getconf($dc, $CHANGER_CONFIG_PROPERTY),
-       { 'testprop' => {
-               'priority' => 0,
-               'values' => [ 'testval' ],
-               'append' => 0,
-           }
-        }, "changer properties represented correctly");
-
-    is_deeply(changer_config_getconf($dc, $CHANGER_CONFIG_DEVICE_PROPERTY),
-       { 'testdprop' => {
-               'priority' => 0,
-               'values' => [ 'testdval' ],
-               'append' => 0,
-           }
-        }, "changer device properties represented correctly");
-
-    is_deeply([ sort(+getconf_list("changer")) ],
-             [ sort("my_changer") ],
-       "getconf_list lists all changers");
-}
+is(Amanda::Config::get_config_name(), "TESTCONF",
+    "config_name set");
+is(Amanda::Config::get_config_dir(), "$CONFIG_DIR/TESTCONF",
+    "config_dir set");
+is(Amanda::Config::get_config_filename(),
+    "$CONFIG_DIR/TESTCONF/amanda.conf",
+    "config_filename set");
+
+is(getconf($CNF_RESERVE), 75,
+    "integer global confparm");
+is(getconf($CNF_BUMPSIZE), $int64_num+0,
+    "int64 global confparm");
+is(getconf($CNF_TAPEDEV), "/dev/foo",
+    "string global confparm");
+is(getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE), $size_t_num+0,
+    "size global confparm");
+ok(getconf($CNF_AUTOFLUSH),
+    "boolean global confparm");
+is(getconf($CNF_USETIMESTAMPS), 0,
+    "boolean global confparm, passing an integer (0)");
+is(getconf($CNF_TAPERALGO), $Amanda::Config::ALGO_LAST,
+    "taperalgo global confparam");
+is_deeply([getconf($CNF_RESERVED_UDP_PORT)], [100,200],
+    "intrange global confparm");
+is(getconf($CNF_DISPLAYUNIT), "M",
+    "displayunit is correctly uppercased");
+is_deeply(getconf($CNF_DEVICE_PROPERTY),
+         { "foo" => { priority => 0, append => 0, values => ["bar"]},
+           "blue" => { priority => 0, append => 0,
+                       values => ["car", "tar"]} },
+       "proplist global confparm");
+is_deeply(getconf($CNF_AUTOLABEL),
+       { template => undef, other_config => '',
+         non_amanda => 1, volume_error => '', empty => 1 },
+       "'autolabel non-amanda empty' represented correctly");
+ok(getconf_seen($CNF_TAPEDEV),
+    "'tapedev' parm was seen");
+ok(!getconf_seen($CNF_CHANGERFILE),
+    "'changerfile' parm was not seen");
+
+is(Amanda::Config::getconf_unit_divisor(), 1024,
+    "correct unit divisor (from displayunit -> KB)");
+ok($Amanda::Config::debug_auth,
+    "debug_auth setting reflected in global variable");
+ok(!$Amanda::Config::debug_amandad,
+    "debug_amandad defaults to false");
+
+my $ttyp = lookup_tapetype("mytapetype");
+ok($ttyp, "found mytapetype");
+is(tapetype_getconf($ttyp, $TAPETYPE_COMMENT), 'mine',
+    "tapetype comment");
+is(tapetype_getconf($ttyp, $TAPETYPE_LENGTH), 128 * 1024,
+    "tapetype comment");
+
+ok(tapetype_seen($ttyp, $TAPETYPE_COMMENT),
+    "tapetype comment was seen");
+ok(!tapetype_seen($ttyp, $TAPETYPE_LBL_TEMPL),
+    "tapetype lbl_templ was not seen");
+
+is(tapetype_getconf($ttyp, $TAPETYPE_PART_SIZE), 100*1024,
+    "tapetype part_size");
+is(tapetype_getconf($ttyp, $TAPETYPE_PART_CACHE_TYPE), $PART_CACHE_TYPE_DISK,
+    "tapetype part_cache_type");
+is(tapetype_getconf($ttyp, $TAPETYPE_PART_CACHE_DIR), "/usr/bin",
+    "tapetype part_cache_dir");
+is(tapetype_getconf($ttyp, $TAPETYPE_PART_CACHE_MAX_SIZE), 50*1024,
+    "tapetype part_cache_max_size");
+
+is_deeply([ sort(+getconf_list("tapetype")) ],
+         [ sort("mytapetype", "TEST-TAPE") ],
+    "getconf_list lists all tapetypes");
+
+my $dtyp = lookup_dumptype("mydump-type");
+ok($dtyp, "found mydump-type");
+is(dumptype_getconf($dtyp, $DUMPTYPE_COMMENT), 'mine',
+    "dumptype string");
+is(dumptype_getconf($dtyp, $DUMPTYPE_PRIORITY), 2,
+    "dumptype priority");
+is(dumptype_getconf($dtyp, $DUMPTYPE_BUMPSIZE), $int64_num+0,
+    "dumptype size");
+is(dumptype_getconf($dtyp, $DUMPTYPE_BUMPMULT), 1.75,
+    "dumptype real");
+is(dumptype_getconf($dtyp, $DUMPTYPE_STARTTIME), 1829,
+    "dumptype time");
+is(dumptype_getconf($dtyp, $DUMPTYPE_HOLDINGDISK), $HOLD_REQUIRED,
+    "dumptype holdingdisk");
+is(dumptype_getconf($dtyp, $DUMPTYPE_COMPRESS), $COMP_BEST,
+    "dumptype compress");
+is(dumptype_getconf($dtyp, $DUMPTYPE_ENCRYPT), $ENCRYPT_SERV_CUST,
+    "dumptype encrypt");
+is(dumptype_getconf($dtyp, $DUMPTYPE_STRATEGY), $DS_INCRONLY,
+    "dumptype strategy");
+is_deeply([dumptype_getconf($dtyp, $DUMPTYPE_COMPRATE)], [0.25, 0.75],
+    "dumptype comprate");
+is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_INCLUDE),
+    { 'file' => [ 'rhyme' ],
+      'list' => [ 'bing', 'ting', 'string', 'fling' ],
+      'optional' => 1 },
+    "dumptype include list");
+is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_EXCLUDE),
+    { 'file' => [ 'foolist' ],
+      'list' => [ 'foo', 'bar', 'true', 'star' ],
+      'optional' => 0 },
+    "dumptype exclude list");
+is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_ESTIMATELIST),
+         [ $ES_SERVER, $ES_CALCSIZE, $ES_CLIENT ],
+    "dumptype estimate list");
+is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_PROPERTY),
+         { "prop" => { priority => 0, append => 0, values => ["erty"]},
+           "drop" => { priority => 0, append => 0,
+                       values => ["qwerty", "asdfg"] }},
+       "dumptype proplist");
+is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_RECOVERY_LIMIT),
+    [],
+    "dumptype recovery limit with no limit specified => empty");
+
+ok(dumptype_seen($dtyp, $DUMPTYPE_EXCLUDE),
+    "'exclude' parm was seen");
+ok(!dumptype_seen($dtyp, $DUMPTYPE_RECORD),
+    "'record' parm was not seen");
+
+is_deeply([ sort(+getconf_list("dumptype")) ],
+         [ sort(qw(
+           mydump-type second_dumptype third_dumptype
+           NO-COMPRESS COMPRESS-FAST COMPRESS-BEST COMPRESS-CUST
+           SRVCOMPRESS BSD-AUTH NO-RECORD NO-HOLD
+           NO-FULL
+           )) ],
+    "getconf_list lists all dumptypes (including defaults)");
+is(dumptype_getconf($dtyp, $DUMPTYPE_ALLOW_SPLIT), 0,
+    "dumptype allow_split");
+
+my $iface = lookup_interface("ethernet");
+ok($iface, "found ethernet");
+is(interface_name($iface), "ethernet",
+    "interface knows its name");
+is(interface_getconf($iface, $INTER_COMMENT), 'mine',
+    "interface comment");
+is(interface_getconf($iface, $INTER_MAXUSAGE), 100,
+    "interface maxusage");
+
+$iface = lookup_interface("nic");
+ok($iface, "found nic");
+ok(interface_seen($iface, $INTER_COMMENT),
+    "seen set for parameters that appeared");
+ok(!interface_seen($iface, $INTER_MAXUSAGE),
+    "seen not set for parameters that did not appear");
+
+is_deeply([ sort(+getconf_list("interface")) ],
+         [ sort('ethernet', 'nic', 'default') ],
+    "getconf_list lists all interfaces (in any order)");
+
+skip "error loading config", 13 unless $cfg_result == $CFGERR_OK;
+my $hdisk = lookup_holdingdisk("hd1");
+ok($hdisk, "found hd1");
+is(holdingdisk_name($hdisk), "hd1",
+    "hd1 knows its name");
+is(holdingdisk_getconf($hdisk, $HOLDING_COMMENT), 'mine',
+    "holdingdisk comment");
+is(holdingdisk_getconf($hdisk, $HOLDING_DISKDIR), '/mnt/hd1',
+    "holdingdisk diskdir (directory)");
+is(holdingdisk_getconf($hdisk, $HOLDING_DISKSIZE), 100*1024,
+    "holdingdisk disksize (use)");
+is(holdingdisk_getconf($hdisk, $HOLDING_CHUNKSIZE), 1024,
+    "holdingdisk chunksize");
+
+$hdisk = lookup_holdingdisk("hd2");
+ok($hdisk, "found hd2");
+ok(holdingdisk_seen($hdisk, $HOLDING_COMMENT),
+    "seen set for parameters that appeared");
+ok(!holdingdisk_seen($hdisk, $HOLDING_CHUNKSIZE),
+    "seen not set for parameters that did not appear");
+
+# only holdingdisks have this linked-list structure
+# exposed
+my $hdisklist = getconf($CNF_HOLDINGDISK);
+my $first_disk = @$hdisklist[0];
+$hdisk = lookup_holdingdisk($first_disk);
+like(holdingdisk_name($hdisk), qr/hd[12]/,
+    "one disk is first in list of holdingdisks");
+$hdisk = lookup_holdingdisk(@$hdisklist[1]);
+like(holdingdisk_name($hdisk), qr/hd[12]/,
+    "another is second in list of holdingdisks");
+ok($#$hdisklist == 1,
+    "no third holding disk");
+
+is_deeply([ sort(+getconf_list("holdingdisk")) ],
+         [ sort('hd1', 'hd2') ],
+    "getconf_list lists all holdingdisks (in any order)");
+
+skip "error loading config", 5 unless $cfg_result == $CFGERR_OK;
+my $app = lookup_application("my_app");
+ok($app, "found my_app");
+is(application_name($app), "my_app",
+    "my_app knows its name");
+is(application_getconf($app, $APPLICATION_COMMENT), 'my_app_comment',
+    "application comment");
+is(application_getconf($app, $APPLICATION_PLUGIN), 'amgtar',
+    "application plugin (amgtar)");
+
+is_deeply([ sort(+getconf_list("application-tool")) ],
+         [ sort("my_app") ],
+    "getconf_list lists all applications");
+# test backward compatibility
+is_deeply([ sort(+getconf_list("application")) ],
+         [ sort("my_app") ],
+    "getconf_list works for 'application-tool', too");
+
+my $sc = lookup_pp_script("my_script");
+ok($sc, "found my_script");
+is(pp_script_name($sc), "my_script",
+    "my_script knows its name");
+is(pp_script_getconf($sc, $PP_SCRIPT_COMMENT), 'my_script_comment',
+    "script comment");
+is(pp_script_getconf($sc, $PP_SCRIPT_PLUGIN), 'script-email',
+    "script plugin (script-email)");
+is(pp_script_getconf($sc, $PP_SCRIPT_EXECUTE_WHERE), $ES_CLIENT,
+    "script execute_where (client)");
+is(pp_script_getconf($sc, $PP_SCRIPT_EXECUTE_ON),
+    $EXECUTE_ON_PRE_HOST_BACKUP|$EXECUTE_ON_POST_HOST_BACKUP,
+    "script execute_on");
+
+is_deeply([ sort(+getconf_list("script")) ],
+         [ sort("my_script") ],
+    "getconf_list lists all script");
+
+is_deeply([ sort(+getconf_list("script-tool")) ],
+         [ sort("my_script") ],
+    "getconf_list works for 'script-tool', too");
+
+my $dc = lookup_device_config("my_device");
+ok($dc, "found my_device");
+is(device_config_name($dc), "my_device",
+    "my_device knows its name");
+is(device_config_getconf($dc, $DEVICE_CONFIG_COMMENT), 'my device is mine, not yours',
+    "device comment");
+is(device_config_getconf($dc, $DEVICE_CONFIG_TAPEDEV), 'tape:/dev/nst0',
+    "device tapedev");
+# TODO do we really need all of this equipment for device properties?
+is_deeply(device_config_getconf($dc, $DEVICE_CONFIG_DEVICE_PROPERTY),
+      { "block-size" => { 'priority' => 0, 'values' => ["128k"], 'append' => 0 },
+        "comment" => { 'priority' => 0, 'values' => ["what up?"], 'append' => 0 }, },
+    "device config proplist");
+
+is_deeply([ sort(+getconf_list("device")) ],
+         [ sort("my_device") ],
+    "getconf_list lists all devices");
+
+skip "error loading config", 7 unless $cfg_result == $CFGERR_OK;
+$dc = lookup_changer_config("my_changer");
+ok($dc, "found my_changer");
+is(changer_config_name($dc), "my_changer",
+    "my_changer knows its name");
+is(changer_config_getconf($dc, $CHANGER_CONFIG_COMMENT), 'my changer is mine, not yours',
+    "changer comment");
+is(changer_config_getconf($dc, $CHANGER_CONFIG_CHANGERDEV), '/dev/sg0',
+    "changer tapedev");
+is_deeply(changer_config_getconf($dc, $CHANGER_CONFIG_PROPERTY),
+    { 'testprop' => {
+           'priority' => 0,
+           'values' => [ 'testval' ],
+           'append' => 0,
+       }
+    }, "changer properties represented correctly");
+
+is_deeply(changer_config_getconf($dc, $CHANGER_CONFIG_DEVICE_PROPERTY),
+    { 'testdprop' => {
+           'priority' => 0,
+           'values' => [ 'testdval' ],
+           'append' => 0,
+       }
+    }, "changer device properties represented correctly");
+
+is_deeply([ sort(+getconf_list("changer")) ],
+         [ sort("my_changer") ],
+    "getconf_list lists all changers");
 
 ##
 # Test config overwrites (using the config from above)
@@ -585,6 +583,8 @@ like($dump, qr/INCLUDE\s+LIST OPTIONAL "bing" "ting" "string" "fling"/i,
     "INCLUDE LIST is in the dump");
 like($dump, qr/INCLUDE\s+FILE OPTIONAL "rhyme"/i,
     "INCLUDE FILE is in the dump");
+like($dump, qr/RECOVERY_LIMIT.*SAME-HOST/i,
+    "RECOVERY-LIST is in the dump");
 
 ##
 # Test nested definitions inside a dumptype
@@ -661,6 +661,58 @@ SKIP: {
        "'optional' has no effect when not on the last occurrence");
 }
 
+##
+# Check out recovery-limit parsing
+
+$testconf = Installcheck::Config->new();
+$testconf->add_param('recovery-limit', '"foo" "bar"');
+$testconf->add_dumptype('rl1', [
+    'recovery-limit' => 'same-host',
+]);
+$testconf->add_dumptype('rl2', [
+    'recovery-limit' => '"somehost"',
+]);
+$testconf->add_dumptype('rl3', [
+    'recovery-limit' => 'same-host "somehost"',
+]);
+$testconf->add_dumptype('rl4', [
+    'recovery-limit' => '"foohost" same-host',
+]);
+$testconf->write();
+
+$cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+is($cfg_result, $CFGERR_OK,
+    "recovery-limit config loaded")
+    or diag_config_errors();
+SKIP: {
+    skip "error loading config", 5 unless $cfg_result == $CFGERR_OK;
+    my $dtyp;
+
+    is_deeply(getconf($CNF_RECOVERY_LIMIT),
+       [ 'foo', 'bar' ],
+       "global recovery-limit parameter");
+
+    $dtyp = lookup_dumptype("rl1");
+    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_RECOVERY_LIMIT),
+       [ undef ],
+       "same-host => undef in list");
+
+    $dtyp = lookup_dumptype("rl2");
+    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_RECOVERY_LIMIT),
+       [ "somehost" ],
+       "hostname => match pattern");
+
+    $dtyp = lookup_dumptype("rl3");
+    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_RECOVERY_LIMIT),
+       [ undef, "somehost" ],
+       "hostname and same-host parsed correctly");
+
+    $dtyp = lookup_dumptype("rl4");
+    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_RECOVERY_LIMIT),
+       [ undef, "foohost" ], # note that the order is an implementation detail
+       ".. even if same-host comes last");
+}
+
 ##
 # Try an autolabel with a template and 'any'
 
@@ -949,3 +1001,40 @@ for my $bv (@boolean_vals) {
     is(string_to_boolean($bv->{'val'}), $bv->{'expected'},
         "string_to_boolean('$bv->{'val'}') is right");
 }
+
+my @prop_names = (
+    {'val' => '', 'expected' => ''},
+    {'val' => 'prop-name', 'expected' => 'prop-name'},
+    {'val' => 'PRoP-NaME', 'expected' => 'prop-name'},
+    {'val' => 'prop_name', 'expected' => 'prop-name'},
+    {'val' => 'FaNCy_ProP', 'expected' => 'fancy-prop'},
+    {'val' => '_under_', 'expected' => '-under-'},
+    {'val' => '-dash-', 'expected' => '-dash-'},
+    {'val' => '-', 'expected' => '-'},
+    {'val' => '_', 'expected' => '-'},
+    );
+
+for my $pn (@prop_names) {
+    is(amandaify_property_name($pn->{'val'}), $pn->{'expected'},
+       "amandaify_property_name('$pn->{'val'}') is right");
+}
+
+$testconf = Installcheck::Config->new();
+$testconf->add_param('property', '"PrOP_nAme" "VALUE"');
+$testconf->write();
+config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+my $properties = getconf($CNF_PROPERTY);
+
+@prop_names = (
+    {'val' => 'prop-name'},
+    {'val' => 'PRoP-NaME'},
+    {'val' => 'prop_name'},
+    {'val' => 'PROP_NAME'},
+    {'val' => 'PRoP-NaME'},
+    {'val' => 'prop_name'},
+    );
+
+for my $pn (@prop_names) {
+    is_deeply($properties->{$pn->{'val'}}->{values}, [ "VALUE" ]);
+}
+
diff --git a/installcheck/Amanda_Config_FoldingHash.pl b/installcheck/Amanda_Config_FoldingHash.pl
new file mode 100644 (file)
index 0000000..582e497
--- /dev/null
@@ -0,0 +1,72 @@
+# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use Test::More tests => 22;
+use strict;
+use warnings;
+
+use lib "@amperldir@";
+use Amanda::Config::FoldingHash;
+use Data::Dumper;
+
+my $h = Amanda::Config::FoldingHash->new();
+ok(!(exists $h->{'key'}), "key doesn't exist in new hash");
+is_deeply([sort(keys(%$h))], [], "hash starts out with no keys");
+
+$h->{'key'} = 3;
+ok((exists $h->{'key'}), "key exists after assignment");
+is($h->{'key'}, 3, "can fetch value stored in simple key");
+is($h->{'kEy'}, 3, "can fetch value stored in key via fold");
+
+$h->{'key'} = 4;
+is($h->{'key'}, 4, "updating the one key works");
+is_deeply([sort(keys(%$h))], [sort(qw(key))], "hash now has the one key");
+
+delete $h->{'key'};
+ok(!(exists $h->{'key'}), "key doesn't exist after deletion");
+is($h->{'key'}, undef, "got undef fetching deleted key");
+
+$h->{'kEY'} = 20;
+ok((exists $h->{'kEY'}), "unfolded key exists after assignment");
+ok((exists $h->{'key'}), "folded key exists after assignment");
+is($h->{'key'}, 20, "can fetch value stored in folded key");
+is_deeply([sort(keys(%$h))], [sort(qw(key))], "key is folded in list");
+
+$h->{'key'} = 92;
+is($h->{'key'}, 92, "updated folded key");
+
+$h->{'Key'} = 37;
+is($h->{'key'}, 37, "updated key via fold");
+
+$h->{'_some-OTHER_kEy_'} = undef;
+ok((exists $h->{'_some-OTHER_kEy_'}), "longer key exists after assigning undef");
+ok((exists $h->{'-some-other-key-'}), "longer folded key exists too");
+ok((exists $h->{'-SOME_other_key_'}), "longer key exists via fold");
+is_deeply([sort(keys(%$h))], [sort(qw(key -some-other-key-))], "keys list as folded");
+
+delete $h->{'KeY'};
+ok(!(exists $h->{'key'}), "key doesn't exist after deletion via fold");
+is($h->{'key'}, undef, "got undef fetching folded deleted key");
+
+for my $k (qw(_ __ a-B Cf_ __g-h i__j-k L)) {
+    $h->{$k} = $k;
+}
+
+is_deeply([sort(keys(%$h))], [sort(qw(-some-other-key- - -- a-b cf- --g-h i--j-k l))],
+   "various keys are listed as folded");
+
index b3f62b534f89c6548ed04429abe978e0e54052a1..465b4d53ecd349190c913e59eef7aa9e5be294e0 100644 (file)
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
+use Test::More tests => 18;
 use strict;
+use warnings;
 
-use Test::More tests => 18;
 use File::Path qw(mkpath);
 use Data::Dumper;
 
index e412f21da41c5a56713fdb1deb3891dad5775851..e42cc4fbedaaa26a75d70c693f5a78e0beea0827 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 76;
+use Test::More tests => 85;
 use File::Path;
 use Data::Dumper;
 use strict;
@@ -25,6 +25,7 @@ use warnings;
 use lib "@amperldir@";
 use Installcheck;
 use Installcheck::Run;
+use Installcheck::Catalogs;
 use Amanda::Config qw( :init :getconf config_dir_relative );
 use Amanda::DB::Catalog;
 use Amanda::Cmdline;
@@ -48,183 +49,35 @@ is_deeply([ Amanda::DB::Catalog::get_write_timestamps() ], [],
 is_deeply(Amanda::DB::Catalog::get_latest_write_timestamp(), undef,
     "No latest write_timestamp in an empty catalog");
 
+is_deeply(Amanda::DB::Catalog::get_latest_write_timestamp(type => 'amvault'), undef,
+    "No latest write_timestamp in an empty catalog, even of a specific type");
+
 is_deeply([ Amanda::DB::Catalog::get_parts() ], [],
     "No parts in an empty catalog");
 
 # and add some logfiles to query, and a corresponding tapelist, while also gathering
 # a list of parts and dumps for comparison with the results from Amanda::DB::Catalog.
 # also add some files to holding disk
-my $logdir = config_dir_relative(getconf($CNF_LOGDIR));
-my $tapelist_fn = config_dir_relative(getconf($CNF_TAPELIST));
-my $holdingdir = "$Installcheck::TMP/holding";
-my $output;
-my $write_timestamp;
-my (%parts, %dumps, $last_dump);
 my @dumpspecs;
 
-sub make_holding_file {
-    my ($dump) = @_;
-
-    my $dir = "$holdingdir/$dump->{dump_timestamp}";
-    my $safe_disk = $dump->{'diskname'};
-    $safe_disk =~ tr{/}{_};
-    my $filename = "$dir/$dump->{hostname}.$safe_disk";
-    mkpath($dir);
-
-    # (note that multi-chunk holding files are not used at this point)
-    my $hdr = Amanda::Header->new();
-    $hdr->{'type'} = $Amanda::Header::F_DUMPFILE;
-    $hdr->{'datestamp'} = $dump->{'dump_timestamp'};
-    $hdr->{'dumplevel'} = $dump->{'level'};
-    $hdr->{'name'} = $dump->{'hostname'};
-    $hdr->{'disk'} = $dump->{'diskname'};
-    $hdr->{'program'} = "INSTALLCHECK";
-    $hdr->{'is_partial'} = ($dump->{'status'} ne 'OK');
-
-    open(my $fh, ">", $filename) or die("opening '$filename': $!");
-    print $fh $hdr->to_string(32768,32768);
-
-    # transfer some data to that file
-    my $xfer = Amanda::Xfer->new([
-       Amanda::Xfer::Source::Pattern->new(1024*$dump->{'kb'}, "+-+-+-+-"),
-       Amanda::Xfer::Dest::Fd->new($fh),
-    ]);
-
-    $xfer->start(sub {
-       my ($src, $msg, $xfer) = @_;
-       if ($msg->{type} == $XMSG_ERROR) {
-           die $msg->{elt} . " failed: " . $msg->{message};
-       } elsif ($msg->{'type'} == $XMSG_DONE) {
-           $src->remove();
-           Amanda::MainLoop::quit();
-       }
-    });
-    Amanda::MainLoop::run();
-    close($fh);
-
-    return $filename;
-}
-
-open (my $tapelist, ">", $tapelist_fn);
-while (<DATA>) {
-    # skip comments
-    next if (/^#/ or /^\S*$/);
-
-    # add to tapelist
-    if (/^:tapelist (\d+) (\S+)\s*$/) {
-       print $tapelist "$1 $2 reuse\n";
-       next;
-    }
-    
-    # new logfile
-    if (/^::: (.*)/) {
-       open $output, ">", "$logdir/$1" or die("Could not open $1 for writing: $!");
-       next;
-    }
-
-    # write_timestamp
-    if (/^:timestamp (\d+)/) {
-       $write_timestamp = $1;
-       next;
-    }
-
-    # new dump
-    if (/^:dump (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) (\S+) (\d+) (\S+) (\d+) (\d+)/) {
-       $last_dump = $dumps{$1} = {
-           'dump_timestamp' => $2,     'hostname' => $3,           'diskname' => $4,
-           'level' => $5+0,            'status' => $6,             'message' => $7,
-           'nparts' => $8,             'sec' => $9+0.0,            'kb' => $10,
-           'orig_kb' => $11,
-           'write_timestamp' => $write_timestamp,
-       };
-       $last_dump->{'message'} = ''
-           if $last_dump->{'message'} eq '""';
-       next;
-    } elsif (/^:dump (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) (\S+) (\d+) (\S+) (\d+)/) {
-       $last_dump = $dumps{$1} = {
-           'dump_timestamp' => $2,     'hostname' => $3,           'diskname' => $4,
-           'level' => $5+0,            'status' => $6,             'message' => $7,
-           'nparts' => $8,             'sec' => $9+0.0,            'kb' => $10,
-           'orig_kb' => 0,
-           'write_timestamp' => $write_timestamp,
-       };
-       $last_dump->{'message'} = ''
-           if $last_dump->{'message'} eq '""';
-       next;
-    }
-
-    # new holding-disk file
-    if (/^:holding (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) (\d+)/) {
-       $last_dump = $dumps{$1} = {
-           'dump_timestamp' => $2,     'hostname' => $3,           'diskname' => $4,
-           'level' => $5+0,            'status' => $6,             'kb' => $7,
-           'orig_kb' => 0,
-           'write_timestamp' => '00000000000000',
-           'message' => '',
-           'nparts' => 1,
-           'sec' => 0.0,
-       };
-       $parts{$1} = {
-           holding_file => make_holding_file($last_dump),
-           dump => $last_dump,
-           status => $last_dump->{'status'},
-           sec => 0.0,
-           kb => $last_dump->{'kb'},
-           orig_kb => 0,
-           partnum => 1,
-       };
-       $last_dump->{'parts'} = [ undef, $parts{$1}, ];
-       next;
-    }
-
-    # new part
-    if (/^:part (\S+) (\S+) (\S+) (\d+) (\d+) (\S+) (\S+) (\d+) (\d+)/) {
-       $parts{$1} = {
-           'dump' => $dumps{$2},       'label' => $3,              'filenum' => $4,
-           'partnum' => $5,            'status' => $6,             'sec' => $7+0.0,
-           'kb' => $8,                 'orig_kb' => $9 
-       };
-       $last_dump->{'parts'}->[$parts{$1}->{'partnum'}] = $parts{$1};
-       next;
-    } elsif (/^:part (\S+) (\S+) (\S+) (\d+) (\d+) (\S+) (\S+) (\d+)/) {
-       $parts{$1} = {
-           'dump' => $dumps{$2},       'label' => $3,              'filenum' => $4,
-           'partnum' => $5,            'status' => $6,             'sec' => $7+0.0,
-           'kb' => $8,                 'orig_kb' => 0
-       };
-       $last_dump->{'parts'}->[$parts{$1}->{'partnum'}] = $parts{$1};
-       next;
-    }
+# install the bigdb catalog
+my $cat = Installcheck::Catalogs::load("bigdb");
+$cat->install();
+my %dumps = $cat->get_dumps();
+my %parts = $cat->get_parts();
 
-    die("syntax error") if (/^:/);
-
-    print $output $_;
-}
-close($output);
-close($tapelist);
 Amanda::DB::Catalog::_clear_cache();
 
-##
-# Test the timestamps
-
-is_deeply([ Amanda::DB::Catalog::get_write_timestamps(), ],
-    [ '20080111000000', '20080222222222', '20080313133333', '20080414144444', '20080515155555', '20080616166666' ],
-    "get_write_timestamps returns all logfile datestamps in proper order, with zero-padding");
-
-is(Amanda::DB::Catalog::get_latest_write_timestamp(), '20080616166666',
-    "get_latest_write_timestamp correctly returns the latest write timestamp");
-
-##
-# test get_parts and sort_parts
-
 sub partstr {
     my ($part) = @_;
     if (exists $part->{'holding_file'}) {
        return "$part->{holding_file}: " .
-              "$part->{dump}->{hostname} $part->{dump}->{diskname}";
+              "$part->{dump}->{hostname} $part->{dump}->{diskname} " .
+              "w$part->{dump}->{write_timestamp} d$part->{dump}->{dump_timestamp}";
    } else {
        return "$part->{label}:$part->{filenum}: " .
-              "$part->{dump}->{hostname} $part->{dump}->{diskname} $part->{dump}->{orig_kb}";
+              "$part->{dump}->{hostname} $part->{dump}->{diskname} $part->{dump}->{orig_kb} " .
+              "w$part->{dump}->{write_timestamp} d$part->{dump}->{dump_timestamp}";
    }
 }
 
@@ -257,12 +110,17 @@ sub got_parts {
     # filter recursive references to avoid confusing old is_deeply instances
     if (!is_deeply(filter_parts($got), filter_parts($exp), $msg)) {
        diag("got parts:");
+       my $i = 0;
        for (@$got) {
-           diag("  " . partstr($_));
+           diag(" [$i]  " . partstr($_));
+           $i++;
        }
+
        diag("expected parts:");
+       $i = 0;
        for (@$exp) {
-           diag("  " . partstr($_));
+           diag(" [$i]  " . partstr($_));
+           $i++;
        }
        return '';
     }
@@ -393,7 +251,39 @@ sub sortdumps {
     @_;
 }
 
-### test part selecting
+##
+# Test the timestamps
+
+is_deeply([ Amanda::DB::Catalog::get_write_timestamps(), ],
+    [ '20080111000000', '20080222222222', '20080313133333',
+      '20080414144444', '20080515155555', '20080616166666',
+      '20100722000000' ],
+    "get_write_timestamps returns all logfile datestamps in proper order, with zero-padding");
+
+is(Amanda::DB::Catalog::get_latest_write_timestamp(), '20100722000000',
+    "get_latest_write_timestamp correctly returns the latest write timestamp");
+
+is(Amanda::DB::Catalog::get_latest_write_timestamp(type => 'amdump'), '20100722000000',
+    "get_latest_write_timestamp correctly returns the latest write timestamp of type amdump");
+
+is(Amanda::DB::Catalog::get_latest_write_timestamp(type => 'amflush'), '20080111000000',
+    "get_latest_write_timestamp correctly returns the latest write timestamp of type amflush");
+
+is(Amanda::DB::Catalog::get_latest_write_timestamp(types => [qw(amvault amflush)]),
+    '20080222222222',
+    "get_latest_write_timestamp correctly returns the latest write timestamp of a set of ts's");
+
+is(Amanda::DB::Catalog::get_run_type('20080222222222'), "amvault",
+    "get_run_type detects amvault");
+
+is(Amanda::DB::Catalog::get_run_type('20080111'), "amflush",
+    "get_run_type detects amflush (short ts)");
+
+is(Amanda::DB::Catalog::get_run_type('20080111000000'), "amflush",
+    "get_run_type detects amflush (long ts)");
+
+##
+# test get_parts and sort_parts
 
 got_parts([ sortparts Amanda::DB::Catalog::get_parts() ],
     [ sortparts parts_named qr/.*/ ],
@@ -717,6 +607,11 @@ got_dumps([ sortdumps Amanda::DB::Catalog::get_dumps(dumpspecs => [ @dumpspecs ]
     "get_dumps parameter dumpspecs with a dumpspec that matches nothing",
     zero_dumps_expected => 1);
 
+@dumpspecs = Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, undef, '20080222222222');
+got_dumps([ sortdumps Amanda::DB::Catalog::get_dumps(dumpspecs => [ @dumpspecs ]) ],
+    [ sortdumps dumps_matching { $_->{'write_timestamp'} eq '20080222222222' }],
+    "get_dumps parameter dumpspecs with write_timestamp");
+
 ## test dump sorting
 
 got_dumps([ Amanda::DB::Catalog::sort_dumps(['write_timestamp'],
@@ -770,254 +665,24 @@ got_dumps([ Amanda::DB::Catalog::sort_dumps(['-level'],
 got_dumps([ Amanda::DB::Catalog::sort_dumps(['dump_timestamp'],
                @dumps{
                    'somebox_lib_20080313133333', # dts=20080313133333
-                   'otherbox_usr_bin_20080313133333', # dts=20080311131133
+                   'otherbox_usr_bin_20080313133333_1', # dts=20080311131133
                    }) ],
              [ @dumps{
-                   'otherbox_usr_bin_20080313133333', # dts=20080311131133
+                   'otherbox_usr_bin_20080313133333_1', # dts=20080311131133
                    'somebox_lib_20080313133333', # dts=20080313133333
                    } ],
                "sort dumps by write_timestamp");
 
-__DATA__
-# a short-datestamp logfile with only a single, single-part file in it
-::: log.20080111.0
-:tapelist 20080111 Conf-001
-:timestamp 20080111000000
-DISK planner somebox /lib
-START planner date 20080111
-START driver date 20080111
-STATS driver hostname somebox
-STATS driver startup time 0.051
-FINISH planner date 20080111 time 82.721
-START taper datestamp 20080111 label Conf-001 tape 1
-SUCCESS dumper somebox /lib 20080111 0 [sec 0.209 kb 1970 kps 9382.2 orig-kb 1970]
-SUCCESS chunker somebox /lib 20080111 0 [sec 0.305 kb 420 kps 1478.7]
-STATS driver estimate somebox /lib 20080111 0 [sec 1 nkb 2002 ckb 480 kps 385]
-:dump somebox_lib_20080111 20080111000000 somebox /lib 0 OK "" 1 4.813543 419
-:part somebox_lib_20080111 somebox_lib_20080111 Conf-001 1 1 OK 4.813543 419
-PART taper Conf-001 1 somebox /lib 20080111 1/1 0 [sec 4.813543 kb 419 kps 87.133307]
-DONE taper somebox /lib 20080111 1 0 [sec 4.813543 kb 419 kps 87.133307]
-FINISH driver date 20080111 time 2167.581
-
-# a long-datestamp logfile, also fairly simple
-::: log.20080222222222.0
-:tapelist 20080222222222 Conf-002
-:timestamp 20080222222222
-DISK planner somebox /lib
-START planner date 20080222222222
-START driver date 20080222222222
-STATS driver hostname somebox
-STATS driver startup time 0.051
-FINISH planner date 20080222222222 time 0.102
-SUCCESS dumper somebox /lib 20080222222222 0 [sec 0.012 kb 100 kps 8115.6 orig-kb 100]
-SUCCESS chunker somebox /lib 20080222222222 0 [sec 5.075 kb 100 kps 26.0]
-STATS driver estimate somebox /lib 20080222222222 0 [sec 0 nkb 132 ckb 160 kps 1024]
-START taper datestamp 20080222222222 label Conf-002 tape 1
-:dump somebox_lib_20080222222222 20080222222222 somebox /lib 0 OK "" 2 0.001161 172
-:part somebox_lib_20080222222222_p1 somebox_lib_20080222222222 Conf-002 1 1 OK 0.000733 100
-PART taper Conf-002 1 somebox /lib 20080222222222 1/2 0 [sec 0.000733 kb 100 kps 136425.648022]
-:part somebox_lib_20080222222222_p2 somebox_lib_20080222222222 Conf-002 2 2 OK 0.000428 72
-PART taper Conf-002 2 somebox /lib 20080222222222 2/2 0 [sec 0.000428 kb 72 kps 136425.648022]
-DONE taper somebox /lib 20080222222222 2 0 [sec 0.001161 kb 172 kps 136425.648022]
-FINISH driver date 20080222222222 time 6.206
-
-# a logfile with several dumps in it, one of which comes in many parts, and one of which is
-# from a previous run
-::: log.20080313133333.0
-:tapelist 20080313133333 Conf-003
-:timestamp 20080313133333
-DISK planner somebox /usr/bin
-DISK planner somebox /lib
-DISK planner otherbox /lib
-DISK planner otherbox /usr/bin
-START planner date 20080313133333
-START driver date 20080313133333
-STATS driver hostname somebox
-STATS driver startup time 0.059
-INFO planner Full dump of somebox:/lib promoted from 2 days ahead.
-FINISH planner date 20080313133333 time 0.286
-SUCCESS dumper somebox /usr/bin 20080313133333 1 [sec 0.001 kb 20 kps 10352.0 orig-kb 20]
-SUCCESS chunker somebox /usr/bin 20080313133333 1 [sec 1.023 kb 20 kps 50.8]
-STATS driver estimate somebox /usr/bin 20080313133333 1 [sec 0 nkb 52 ckb 64 kps 1024]
-START taper datestamp 20080313133333 label Conf-003 tape 1
-:dump somebox_usr_bin_20080313133333 20080313133333 somebox /usr/bin 1 OK "" 1 0.000370 20
-:part somebox_usr_bin_20080313133333 somebox_usr_bin_20080313133333 Conf-003 1 1 OK 0.000370 20
-PART taper Conf-003 1 somebox /usr/bin 20080313133333 1/1 1 [sec 0.000370 kb 20 kps 54054.054054]
-DONE taper somebox /usr/bin 20080313133333 1 1 [sec 0.000370 kb 20 kps 54054.054054]
-# a multi-part dump
-SUCCESS dumper somebox /lib 20080313133333 0 [sec 0.189 kb 3156 kps 50253.1 orig-kb 3156]
-SUCCESS chunker somebox /lib 20080313133333 0 [sec 5.250 kb 3156 kps 1815.5]
-STATS driver estimate somebox /lib 20080313133333 0 [sec 1 nkb 3156 ckb 3156 kps 9500]
-:dump somebox_lib_20080313133333 20080313133333 somebox /lib 0 OK "" 10 0.051436 3156
-:part somebox_lib_20080313133333_p1 somebox_lib_20080313133333 Conf-003 2 1 OK 0.005621 1024
-PART taper Conf-003 2 somebox /lib 20080313133333 1/10 0 [sec 0.005621 kb 1024 kps 182173.990393]
-:part somebox_lib_20080313133333_p2 somebox_lib_20080313133333 Conf-003 3 2 OK 0.006527 1024
-PART taper Conf-003 3 somebox /lib 20080313133333 2/10 0 [sec 0.006527 kb 1024 kps 156886.777999]
-:part somebox_lib_20080313133333_p3 somebox_lib_20080313133333 Conf-003 4 3 OK 0.005854 1024
-PART taper Conf-003 4 somebox /lib 20080313133333 3/10 0 [sec 0.005854 kb 1024 kps 174923.129484]
-:part somebox_lib_20080313133333_p4 somebox_lib_20080313133333 Conf-003 5 4 OK 0.007344 1024
-PART taper Conf-003 5 somebox /lib 20080313133333 4/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-:part somebox_lib_20080313133333_p5 somebox_lib_20080313133333 Conf-003 6 5 OK 0.007344 1024
-PART taper Conf-003 6 somebox /lib 20080313133333 5/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-:part somebox_lib_20080313133333_p6 somebox_lib_20080313133333 Conf-003 7 6 OK 0.007344 1024
-PART taper Conf-003 7 somebox /lib 20080313133333 6/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-:part somebox_lib_20080313133333_p7 somebox_lib_20080313133333 Conf-003 8 7 OK 0.007344 1024
-PART taper Conf-003 8 somebox /lib 20080313133333 7/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-:part somebox_lib_20080313133333_p8 somebox_lib_20080313133333 Conf-003 9 8 OK 0.007344 1024
-PART taper Conf-003 9 somebox /lib 20080313133333 8/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-:part somebox_lib_20080313133333_p9 somebox_lib_20080313133333 Conf-003 10 9 OK 0.007344 1024
-PART taper Conf-003 10 somebox /lib 20080313133333 9/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-:part somebox_lib_20080313133333_p10 somebox_lib_20080313133333 Conf-003 11 10 OK 0.001919 284
-PART taper Conf-003 11 somebox /lib 20080313133333 10/10 0 [sec 0.001919 kb 284 kps 147993.746743]
-DONE taper somebox /lib 20080313133333 10 0 [sec 0.051436 kb 3156 kps 184695.543977]
-SUCCESS dumper otherbox /lib 20080313133333 0 [sec 0.001 kb 190 kps 10352.0 orig-kb 20]
-SUCCESS chunker otherbox /lib 20080313133333 0 [sec 1.023 kb 190 kps 50.8]
-STATS driver estimate otherbox /lib 20080313133333 0 [sec 0 nkb 190 ckb 190 kps 1024]
-# this dump is from a previous run, with an older dump_timestamp
-:dump otherbox_usr_bin_20080313133333 20080311131133 otherbox /usr/bin 0 OK "" 1 0.002733 240
-:part otherbox_usr_bin_20080313133333 otherbox_usr_bin_20080313133333 Conf-003 12 1 OK 0.002733 240
-PART taper Conf-003 12 otherbox /usr/bin 20080311131133 1/1 0 [sec 0.002733 kb 240 kps 136425.648022]
-DONE taper otherbox /usr/bin 20080311131133 1 0 [sec 0.002733 kb 240 kps 136425.648022]
-:dump otherbox_lib_20080313133333 20080313133333 otherbox /lib 0 OK "" 1 0.001733 190
-:part otherbox_lib_20080313133333 otherbox_lib_20080313133333 Conf-003 13 1 OK 0.001733 190
-PART taper Conf-003 13 otherbox /lib 20080313133333 1/1 0 [sec 0.001733 kb 190 kps 136425.648022]
-DONE taper otherbox /lib 20080313133333 1 0 [sec 0.001733 kb 190 kps 136425.648022]
-FINISH driver date 20080313133333 time 24.777
-
-# A logfile with some partial parts (PARTPARTIAL) in it
-::: log.20080414144444.0
-:tapelist 20080414144444 Conf-004
-:tapelist 20080414144444 Conf-005
-:timestamp 20080414144444
-DISK planner otherbox /lib
-START planner date 20080414144444
-START driver date 20080414144444
-STATS driver hostname otherbox
-STATS driver startup time 0.075
-INFO taper Will write new label `Conf-004' to new (previously non-amanda) tape
-FINISH planner date 20080414144444 time 2.139
-SUCCESS dumper otherbox /lib 20080414144444 1 [sec 0.003 kb 60 kps 16304.3 orig-kb 60]
-SUCCESS chunker otherbox /lib 20080414144444 1 [sec 1.038 kb 60 kps 88.5]
-STATS driver estimate otherbox /lib 20080414144444 1 [sec 0 nkb 92 ckb 96 kps 1024]
-START taper datestamp 20080414144444 label Conf-004 tape 1
-:dump otherbox_lib_20080414144444 20080414144444 otherbox /lib 1 PARTIAL full-up 0 0.000540 32
-:part otherbox_lib_20080414144444_try1 otherbox_lib_20080414144444 Conf-004 1 1 PARTIAL 0.000707 32
-PARTPARTIAL taper Conf-004 1 otherbox /lib 20080414144444 1/1 1 [sec 0.000707 kb 32 kps 45261.669024] ""
-INFO taper Will request retry of failed split part.
-INFO taper Will write new label `Conf-005' to new (previously non-amanda) tape
-START taper datestamp 20080414144444 label Conf-005 tape 2
-:part otherbox_lib_20080414144444_try2 otherbox_lib_20080414144444 Conf-005 1 1 PARTIAL 0.000540 32
-PARTPARTIAL taper Conf-005 1 otherbox /lib 20080414144444 1/1 1 [sec 0.000540 kb 32 kps 59259.259259] ""
-INFO taper Will request retry of failed split part.
-WARNING driver Out of tapes; going into degraded mode.
-PARTIAL taper otherbox /lib 20080414144444 1 1 [sec 0.000540 kb 32 kps 59259.259259] "full-up"
-# a completely failed dump
-:dump otherbox_boot_20080414144444 20080414144444 otherbox /boot 0 FAIL no-space 0 0.0 0
-FAIL taper otherbox /boot 20080414144444 0 "no-space"
-FINISH driver date 20080414144444 time 6.959
-
-# holding-disk
-:holding otherbox_lib_20080414144444_holding 20080414144444 otherbox /lib 1 OK 256
-:holding oldbox_opt_20080414144444_holding 20080414144444 oldbox /opt 0 OK 1298
-
-# A logfile with orig-kb in taper line
-::: log.20080515155555.0
-:tapelist 20080515155555 Conf-006
-:timestamp 20080515155555
-DISK planner somebox /usr/bin
-DISK planner somebox /lib
-DISK planner otherbox /lib
-DISK planner otherbox /usr/bin
-START planner date 20080515155555
-START driver date 20080515155555
-STATS driver hostname somebox
-STATS driver startup time 0.059
-INFO planner Full dump of somebox:/lib promoted from 2 days ahead.
-FINISH planner date 20080515155555 time 0.286
-SUCCESS dumper somebox /usr/bin 20080515155555 1 [sec 0.001 kb 20 kps 10352.0 orig-kb 20]
-SUCCESS chunker somebox /usr/bin 20080515155555 1 [sec 1.023 kb 20 kps 50.8]
-STATS driver estimate somebox /usr/bin 20080515155555 1 [sec 0 nkb 52 ckb 64 kps 1024]
-START taper datestamp 20080515155555 label Conf-006 tape 1
-:dump somebox_usr_bin_20080515155555 20080515155555 somebox /usr/bin 1 OK "" 1 0.000370 20 20
-:part somebox_usr_bin_20080515155555 somebox_usr_bin_20080515155555 Conf-006 1 1 OK 0.000370 20 20
-PART taper Conf-006 1 somebox /usr/bin 20080515155555 1/1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
-DONE taper somebox /usr/bin 20080515155555 1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
-# a multi-part dump
-SUCCESS dumper somebox /lib 20080515155555 0 [sec 0.189 kb 3156 kps 50253.1 orig-kb 3156]
-SUCCESS chunker somebox /lib 20080515155555 0 [sec 5.250 kb 3156 kps 1815.5]
-STATS driver estimate somebox /lib 20080515155555 0 [sec 1 nkb 3156 ckb 3156 kps 9500]
-:dump somebox_lib_20080515155555 20080515155555 somebox /lib 0 OK "" 10 0.051436 3156 3156
-:part somebox_lib_20080515155555_p1 somebox_lib_20080515155555 Conf-006 2 1 OK 0.005621 1024 3156
-PART taper Conf-006 2 somebox /lib 20080515155555 1/10 0 [sec 0.005621 kb 1024 kps 182173.990393 orig-kb 3156]
-:part somebox_lib_20080515155555_p2 somebox_lib_20080515155555 Conf-006 3 2 OK 0.006527 1024 3156
-PART taper Conf-006 3 somebox /lib 20080515155555 2/10 0 [sec 0.006527 kb 1024 kps 156886.777999 orig-kb 3156]
-:part somebox_lib_20080515155555_p3 somebox_lib_20080515155555 Conf-006 4 3 OK 0.005854 1024 3156
-PART taper Conf-006 4 somebox /lib 20080515155555 3/10 0 [sec 0.005854 kb 1024 kps 174923.129484 orig-kb 3156]
-:part somebox_lib_20080515155555_p4 somebox_lib_20080515155555 Conf-006 5 4 OK 0.007344 1024 3156
-PART taper Conf-006 5 somebox /lib 20080515155555 4/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
-:part somebox_lib_20080515155555_p5 somebox_lib_20080515155555 Conf-006 6 5 OK 0.007344 1024 3156
-PART taper Conf-006 6 somebox /lib 20080515155555 5/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
-:part somebox_lib_20080515155555_p6 somebox_lib_20080515155555 Conf-006 7 6 OK 0.007344 1024 3156
-PART taper Conf-006 7 somebox /lib 20080515155555 6/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
-:part somebox_lib_20080515155555_p7 somebox_lib_20080515155555 Conf-006 8 7 OK 0.007344 1024 3156
-PART taper Conf-006 8 somebox /lib 20080515155555 7/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
-:part somebox_lib_20080515155555_p8 somebox_lib_20080515155555 Conf-006 9 8 OK 0.007344 1024 3156
-PART taper Conf-006 9 somebox /lib 20080515155555 8/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
-:part somebox_lib_20080515155555_p9 somebox_lib_20080515155555 Conf-006 10 9 OK 0.007344 1024 3156
-PART taper Conf-006 10 somebox /lib 20080515155555 9/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
-:part somebox_lib_20080515155555_p10 somebox_lib_20080515155555 Conf-006 11 10 OK 0.001919 284 3156
-PART taper Conf-006 11 somebox /lib 20080515155555 10/10 0 [sec 0.001919 kb 284 kps 147993.746743 orig-kb 3156]
-DONE taper somebox /lib 20080515155555 10 0 [sec 0.051436 kb 3156 kps 184695.543977 orig-kb 3156]
-SUCCESS dumper otherbox /lib 20080515155555 0 [sec 0.001 kb 190 kps 10352.0 orig-kb 20]
-SUCCESS chunker otherbox /lib 20080515155555 0 [sec 1.023 kb 190 kps 50.8]
-STATS driver estimate otherbox /lib 20080515155555 0 [sec 0 nkb 190 ckb 190 kps 1024]
-# this dump is from a previous run, with an older dump_timestamp
-:dump otherbox_usr_bin_20080515155555 20080511151155 otherbox /usr/bin 0 OK "" 1 0.002733 240 240
-:part otherbox_usr_bin_20080515155555 otherbox_usr_bin_20080515155555 Conf-006 12 1 OK 0.002733 240 240
-PART taper Conf-006 12 otherbox /usr/bin 20080511151155 1/1 0 [sec 0.002733 kb 240 kps 136425.648022 orig-kb 240]
-DONE taper otherbox /usr/bin 20080511151155 1 0 [sec 0.002733 kb 240 kps 136425.648022 orig-kb 240]
-:dump otherbox_lib_20080515155555 20080511151555 otherbox /lib 0 OK "" 1 0.001733 190 190
-:part otherbox_lib_20080515155555 otherbox_lib_20080515155555 Conf-006 13 1 OK 0.001733 190 190
-PART taper Conf-006 13 otherbox /lib 20080511151555 1/1 0 [sec 0.001733 kb 190 kps 136425.648022 orig-kb 190]
-DONE taper otherbox /lib 20080515155555 1 0 [sec 0.001733 kb 190 kps 136425.648022 orig-kb 190]
-# this dump is a direct to tape
-:dump otherbox_direct_20080515155555 20080515155555 otherbox /direct 0 OK "" 1 0.001 190 350
-:part otherbox_direct_20080515155555 otherbox_direct_20080515155555 Conf-006 14 1 OK 0.001 190 350
-SUCCESS dumper otherbox /direct 20080515155555 0 [sec 0.001 kb 190 kps 10352.0 orig-kb 350]
-PART taper Conf-006 14 otherbox /direct 20080515155555 1/1 0 [sec 0.001 kb 190 kps 10352.0]
-DONE taper otherbox /direct 20080515155555 1 0 [sec 0.001 kb 190 kps 10352.0 orig-kb 350]
-FINISH driver date 20080515155555 time 24.777
-
-# A logfile with removed tape-kb in taper line
-::: log.20080616166666.0
-:tapelist 20080616166666 Conf-007
-# this tape is removed
-#:tapelist 20080616166666 Conf-007
-:timestamp 20080616166666
-DISK planner somebox /usr/bin
-DISK planner somebox /lib
-DISK planner otherbox /lib
-START planner date 20080616166666
-START driver date 20080616166666
-STATS driver hostname somebox
-STATS driver startup time 0.059
-FINISH planner date 20080616166666 time 0.286
-SUCCESS dumper somebox /usr/bin 20080616166666 1 [sec 0.001 kb 20 kps 10352.0 orig-kb 20]
-SUCCESS chunker somebox /usr/bin 20080616166666 1 [sec 1.023 kb 20 kps 50.8]
-STATS driver estimate somebox /usr/bin 20080616166666 1 [sec 0 nkb 52 ckb 64 kps 1024]
-START taper datestamp 20080616166666 label Conf-007 tape 1
-:dump somebox_usr_bin_20080616166666 20080616166666 somebox /usr/bin 1 OK "" 1 0.000370 20 20
-:part somebox_usr_bin_20080616166666 somebox_usr_bin_20080616166666 Conf-007 1 1 OK 0.000370 20 20
-PART taper Conf-007 1 somebox /usr/bin 20080616166666 1/1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
-DONE taper somebox /usr/bin 20080616166666 1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
-SUCCESS dumper somebox /lib 20080616166666 1 [sec 0.001 kb 20 kps 10352.0 orig-kb 20]
-SUCCESS chunker somebox /lib 20080616166666 1 [sec 1.023 kb 20 kps 50.8]
-:dump somebox_lib_20080616166666 20080616166666 somebox /lib 1 FAIL "" 1 0.000370 20 20
-:part somebox_lib_20080616166666 somebox_lib_20080616166666 Conf-007 2 1 OK 0.000370 20 20
-PART taper Conf-007 2 somebox /lib 20080616166666 1/2 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
-STATS driver estimate somebox /lib 20080616166666 1 [sec 0 nkb 52 ckb 64 kps 1024]
-START taper datestamp 20080616166666 label Conf-008 tape 1
-# this tape is removed
-#:part somebox_lib_20080616166666 somebox_lib_20080616166666 Conf-008 1 1 OK 0.000370 20 20
-PART taper Conf-008 1 somebox /lib 20080616166666 2/2 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
-DONE taper somebox /lib 20080616166666 1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
+
+# install the multi-taper catalog
+$cat = Installcheck::Catalogs::load("multi-taper");
+$cat->install();
+%dumps = $cat->get_dumps();
+%parts = $cat->get_parts();
+
+Amanda::DB::Catalog::_clear_cache();
+
+got_parts([ sortparts Amanda::DB::Catalog::get_parts() ],
+       [ sortparts parts_named qr/.*/ ],
+       "get_parts returns all parts when given no parameters");
+
index 502195f1f4b9a0e423cce9d24c176ecc506cf7ba..d6dee29c03237133583c20b0a148acf1faf242aa 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 use Test::More tests => 9;
 use File::Path;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Amanda::Debug qw( :logging );
index b01879a055e42b7b486aa7d711e741e90ce50f51..c5f8520cd173ab5fd44169e45b8dab20c7fc55d2 100644 (file)
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 482;
+use Test::More tests => 505;
 use File::Path qw( mkpath rmtree );
 use Sys::Hostname;
 use Carp;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
@@ -32,7 +33,6 @@ use Amanda::Config qw( :getconf :init );
 use Amanda::Xfer qw( :constants );
 use Amanda::Header qw( :constants );
 use Amanda::Paths;
-use Amanda::Tests;
 use Amanda::Util;
 use Amanda::MainLoop;
 use IO::Socket;
@@ -44,7 +44,6 @@ my ($input_filename, $output_filename) =
     ( "$Installcheck::TMP/input.tmp", "$Installcheck::TMP/output.tmp" );
 my $taperoot = "$Installcheck::TMP/Amanda_Device_test_tapes";
 my $testconf;
-my $queue_fd;
 
 # we'll need some vtapes..
 sub mkvtape {
@@ -67,22 +66,10 @@ $dumpfile->{name} = "localhost";
 $dumpfile->{disk} = "/home";
 $dumpfile->{program} = "INSTALLCHECK";
 
-# function to set up a queue_fd for a filename
-sub make_queue_fd {
-    my ($filename, $mode) = @_;
-
-    open(my $fd, $mode, $filename) or die("Could not open $filename: $!");
-    return $fd, Amanda::Device::queue_fd_t->new($fd);
-}
-
 my $write_file_count = 5;
 sub write_file {
     my ($seed, $length, $filenum) = @_;
 
-    croak ("selected file size $length is *way* too big")
-       unless ($length < 1024*1024*10);
-    Amanda::Tests::write_random_file($seed, $length, $input_filename);
-
     $dumpfile->{'datestamp'} = "2000010101010$filenum";
 
     ok($dev->start_file($dumpfile),
@@ -92,11 +79,10 @@ sub write_file {
     is($dev->file(), $filenum,
        "Device has correct filenum");
 
-    my ($input, $queue_fd) = make_queue_fd($input_filename, "<");
-    ok($dev->write_from_fd($queue_fd),
-       "write some data")
-       or diag($dev->error_or_status());
-    close($input) or die("Error closing $input_filename");
+    croak ("selected file size $length is *way* too big")
+       unless ($length < 1024*1024*10);
+    ok(Amanda::Device::write_random_to_device($seed, $length, $dev),
+       "write random data");
 
     if(ok($dev->in_file(),
        "still in_file")) {
@@ -108,7 +94,7 @@ sub write_file {
     }
 }
 
-my $verify_file_count = 5;
+my $verify_file_count = 4;
 sub verify_file {
     my ($seed, $length, $filenum) = @_;
 
@@ -120,14 +106,7 @@ sub verify_file {
     ok(header_for($read_dumpfile, $filenum),
        "header is correct")
        or diag($dev->error_or_status());
-
-    my ($output, $queue_fd) = make_queue_fd($output_filename, ">");
-    ok($dev->read_to_fd($queue_fd),
-       "read data from file $filenum")
-       or diag($dev->error_or_status());
-    close($output) or die("Error closing $output_filename");
-
-    ok(Amanda::Tests::verify_random_file($seed, $length, $output_filename, 0),
+    ok(Amanda::Device::verify_random_from_device($seed, $length, $dev),
        "verified file contents");
 }
 
@@ -349,6 +328,84 @@ ok($dev->finish(),
    "finish device after erase")
     or diag($dev->error_or_status());
 
+# test monitor_free_space property (testing the monitoring would require a
+# dedicated partition for the tests - it's not worth it)
+
+ok($dev->property_get("monitor_free_space"),
+    "monitor_free_space property is set by default");
+
+ok($dev->property_set("monitor_free_space", 0),
+    "monitor_free_space property can be set to false");
+
+ok(!$dev->property_get("monitor_free_space"),
+    "monitor_free_space property value 'sticks'");
+
+# test the LEOM functionality
+
+$dev = undef;
+$dev = Amanda::Device->new($dev_name);
+is($dev->status(), $DEVICE_STATUS_SUCCESS,
+    "$dev_name: re-create successful")
+    or diag($dev->error_or_status());
+ok($dev->property_set("MAX_VOLUME_USAGE", "512k"),
+    "set MAX_VOLUME_USAGE to test LEOM");
+ok($dev->property_set("LEOM", 1),
+    "set LEOM");
+
+ok($dev->start($ACCESS_WRITE, 'TESTCONF23', undef),
+    "start in write mode")
+    or diag($dev->error_or_status());
+
+ok($dev->start_file($dumpfile),
+    "start file 1")
+    or diag($dev->error_or_status());
+
+ok(!$dev->is_eom,
+    "device does not indicate LEOM before writing");
+
+ok(Amanda::Device::write_random_to_device(0xCAFE, 440*1024, $dev),
+    "write random data into the early-warning zone");
+
+ok($dev->is_eom,
+    "device indicates LEOM after writing");
+
+ok($dev->finish_file(),
+    "..but a finish_file is allowed to complete")
+    or diag($dev->error_or_status());
+
+ok($dev->finish(),
+   "finish device after LEOM test")
+    or diag($dev->error_or_status());
+
+$dev = undef;
+$dev = Amanda::Device->new($dev_name);
+is($dev->status(), $DEVICE_STATUS_SUCCESS,
+    "$dev_name: re-create successful")
+    or diag($dev->error_or_status());
+ok($dev->property_set("MAX_VOLUME_USAGE", "160k"),
+    "set MAX_VOLUME_USAGE to test LEOM while writing the first header");
+ok($dev->property_set("LEOM", 1),
+    "set LEOM");
+
+ok($dev->start($ACCESS_WRITE, 'TESTCONF23', undef),
+    "start in write mode")
+    or diag($dev->error_or_status());
+
+ok($dev->start_file($dumpfile),
+    "start file 1")
+    or diag($dev->error_or_status());
+
+ok($dev->is_eom,
+    "device indicates LEOM after writing first header");
+
+ok($dev->finish_file(),
+    "..but a finish_file is allowed to complete")
+    or diag($dev->error_or_status());
+
+ok($dev->finish(),
+   "finish device after LEOM test")
+    or diag($dev->error_or_status());
+
 ####
 ## Test a RAIT device of two vfs devices.
 
@@ -374,6 +431,12 @@ ok($dev->property_set("block_size", 32768*16),
 is($dev->property_get("block_size"), 32768*16,
     "..and remembers it");
 
+ok($dev->property_set("max_volume_usage", 32768*1000),
+    "rait device accepts property MAX_VOLUME_USAGE");
+
+is($dev->property_get("max_volume_usage"), 32768*1000,
+    "..and remembers it");
+
 $dev->read_label();
 ok($dev->status() & $DEVICE_STATUS_VOLUME_UNLABELED,
    "initially unlabeled")
@@ -542,7 +605,7 @@ my $run_s3_tests = defined $S3_SECRET_KEY && defined $S3_ACCESS_KEY;
 my $run_devpay_tests = defined $DEVPAY_SECRET_KEY &&
     defined $DEVPAY_ACCESS_KEY && $DEVPAY_USER_TOKEN;
 
-my $s3_make_device_count = 6;
+my $s3_make_device_count = 7;
 sub s3_make_device($$) {
     my ($dev_name, $kind) = @_;
     $dev = Amanda::Device->new($dev_name);
@@ -559,6 +622,11 @@ sub s3_make_device($$) {
        "set block size")
        or diag($dev->error_or_status());
 
+    # might as well save a few cents while testing this property..
+    ok($dev->property_set('S3_STORAGE_CLASS', 'REDUCED_REDUNDANCY'),
+       "set storage class")
+       or diag($dev->error_or_status());
+
     if ($kind eq "s3") {
         # use regular S3 credentials
         ok($dev->property_set('S3_ACCESS_KEY', $S3_ACCESS_KEY),
@@ -593,7 +661,7 @@ my $base_name;
 
 SKIP: {
     skip "define \$INSTALLCHECK_S3_{SECRET,ACCESS}_KEY to run S3 tests",
-            67 +
+            71 +
             1 * $verify_file_count +
             4 * $write_file_count +
             10 * $s3_make_device_count
@@ -610,6 +678,9 @@ SKIP: {
     ok($dev->property_get("full_deletion"),
        "property_get(full_deletion) on s3 device");
 
+    ok($dev->property_get("leom"),
+       "property_get(leom) on s3 device");
+
     # test parsing of boolean values
     # (s3 is the only device driver that has a writable boolean property at the
     # moment)
@@ -741,7 +812,8 @@ SKIP: {
 
     ok($dev->finish(),
        "finish device after read")
-        or diag($dev->error_or_status());    # (note: we don't use write_max_size here, as the maximum for S3 is very large)
+        or diag($dev->error_or_status());    # (note: we don't use write_max_size here,
+                                            # as the maximum for S3 is very large)
 
     ok($dev->erase(),
        "erase device")
@@ -780,6 +852,12 @@ SKIP: {
        "status is either OK or possibly unlabeled")
         or diag($dev->error_or_status());
 
+    $dev->finish();
+
+    ok($dev->erase(),
+       "erase device")
+       or diag($dev->error_or_status());
+
     # try a eu-constrained bucket
     $dev_name = lc("s3:$base_name-s3-eu");
     $dev = s3_make_device($dev_name, "s3");
@@ -797,6 +875,10 @@ SKIP: {
 
     $dev->finish();
 
+    ok($dev->erase(),
+       "erase device")
+       or diag($dev->error_or_status());
+
     # try a wildcard-constrained bucket
     $dev_name = lc("s3:$base_name-s3-wild");
     $dev = s3_make_device($dev_name, "s3");
@@ -840,7 +922,7 @@ SKIP: {
     SKIP: {
        skip "SSL not supported; can't check SSL_CA_INFO", 4
            unless $dev->property_get('S3_SSL');
-       ok($dev->property_set('SSL_CA_INFO', 'data/aws-bundle.crt'),
+       ok($dev->property_set('SSL_CA_INFO', "$srcdir/data/aws-bundle.crt"),
           "set our own SSL/TLS CA certificate bundle")
            or diag($dev->error_or_status());
 
@@ -855,8 +937,14 @@ SKIP: {
         is($dev->status(), $DEVICE_STATUS_SUCCESS,
            "status is OK")
             or diag($dev->error_or_status());
+
+       $dev->finish();
     }
 
+    ok($dev->erase(),
+       "erase device")
+       or diag($dev->error_or_status());
+
     # bucket names incompatible with location constraint
     $dev_name = "s3:-$base_name-s3-eu";
     $dev = s3_make_device($dev_name, "s3");
@@ -1050,7 +1138,7 @@ SKIP: {
 }
 
 SKIP: {
-    skip "not built with ndmp and server", 77 unless
+    skip "not built with ndmp and server", 78 unless
        Amanda::Util::built_with_component("ndmp") and
        Amanda::Util::built_with_component("server");
 
@@ -1111,6 +1199,15 @@ SKIP: {
     $dev->property_set("ndmp_username", "ndmp");
     $dev->property_set("ndmp_password", "ndmp");
 
+    # use a big read_block_size, checking that it's also settable
+    # via read_buffer_size
+    ok($dev->property_set("read_block_size", 256*1024),
+    "can set read_block_size");
+    is($dev->property_get("read_block_size"), 256*1024,
+    "and its value is reflected");
+    ok($dev->property_set("read_block_size", 64*1024),
+    "set read_block_size back to something smaller");
+
     # ok, let's fire the thing up
     ok($dev->start($ACCESS_WRITE, "TEST1", "20090915000000"),
        "start device in write mode")
@@ -1122,7 +1219,7 @@ SKIP: {
     {   # write to the file
        my $xfer = Amanda::Xfer->new([
                Amanda::Xfer::Source::Random->new(32768*21, 0xBEEFEE00),
-               Amanda::Xfer::Dest::Device->new($dev, 32768*5) ]);
+               Amanda::Xfer::Dest::Device->new($dev, 0) ]);
        $xfer->start(make_cb(xmsg_cb => sub {
            my ($src, $msg, $xfer) = @_;
            if ($msg->{'type'} == $XMSG_ERROR) {
@@ -1187,16 +1284,23 @@ SKIP: {
     # test the directtcp-target implementation
     #
 
-    {
-       ok($dev->directtcp_supported(), "is a directtcp target");
-
-       my $addrs = $dev->listen(1);
-       ok($addrs, "listen returns successfully") or die($dev->error_or_status());
-
-       # set up an xfer to write to the device
-       my $xfer = Amanda::Xfer->new([
+    ok($dev->directtcp_supported(), "is a directtcp target");
+    for my $dev_use ('initiator', 'listener') {
+       my ($xfer, $addrs, $dest_elt);
+       if ($dev_use eq 'listener') {
+           $addrs = $dev->listen(1);
+           ok($addrs, "listen returns successfully") or die($dev->error_or_status());
+
+           # set up an xfer to write to the device
+           $dest_elt = Amanda::Xfer::Dest::DirectTCPConnect->new($addrs);
+       } else {
+           # set up an xfer to write to the device
+           $dest_elt = Amanda::Xfer::Dest::DirectTCPListen->new();
+       }
+       $xfer = Amanda::Xfer->new([
                Amanda::Xfer::Source::Random->new(32768*34, 0xB00),
-               Amanda::Xfer::Dest::DirectTCPConnect->new($addrs) ]);
+               $dest_elt,
+           ]);
 
        my @messages;
        $xfer->start(make_cb(xmsg_cb => sub {
@@ -1211,122 +1315,20 @@ SKIP: {
        # write files from the connection until EOF
        my $num_files;
        my $conn;
-       my ($call_accept, $start_device, $write_file_cb);
-
-       $call_accept = make_cb(call_accept => sub {
-           $conn = $dev->accept();
-           Amanda::MainLoop::call_later($start_device);
-       });
-
-       $start_device = make_cb(start_device => sub {
-           ok($dev->start($ACCESS_WRITE, "TEST2", "20090915000000"),
-               "start device in write mode")
-               or diag $dev->error_or_status();
-
-           Amanda::MainLoop::call_later($write_file_cb);
-       });
-
-       $write_file_cb = make_cb(write_file_cb => sub {
-           ++$num_files < 20 or die "I seem to be in a loop!";
-
-           ok($dev->start_file($hdr), "start file $num_files for writing");
-           is($dev->file, $num_files, "..file number is correct");
-
-           my ($ok, $size) = $dev->write_from_connection(32768*15);
-           push @messages, sprintf("WRITE-%s-%d-%s-%s",
-               $ok?"OK":"ERR", $size,
-               $dev->is_eof()? "EOF":"!eof",
-               $dev->is_eom()? "EOM":"!eom");
-           ok($ok, "..write from connection succeeds");
-           my $eof = $dev->is_eof();
+       my ($finish_connection, $start_device, $write_file_cb);
 
-           ok($dev->finish_file(), "..finish file after writing");
 
-           if (!$eof) {
-               Amanda::MainLoop::call_later($write_file_cb);
+       $finish_connection = make_cb(finish_connection => sub {
+           if ($dev_use eq 'listener') {
+               $conn = $dev->accept();
+           } else {
+               $addrs = $dest_elt->get_addrs();
+               $conn = $dev->connect(1, $addrs);
            }
-       });
-
-       Amanda::MainLoop::call_later($call_accept);
-       Amanda::MainLoop::run();
-       is_deeply([@messages], [
-               'WRITE-OK-491520-!eof-!eom',
-               'WRITE-OK-491520-!eof-!eom',
-               'WRITE-OK-131072-EOF-!eom',
-           ],
-           "a sequence of write_from_connection calls works correctly");
-
-       $dev->finish();
-
-       if (my $err = $conn->close()) {
-           die $err;
-       }
-    }
-
-    #
-    # Test indirecttcp
-    #
-
-    {
-       ok($dev->directtcp_supported(), "is a directtcp target");
-
-       $dev->property_set("_force_indirecttcp", 1);
-
-       my $addrs = $dev->listen(1);
-       is_deeply([ scalar @$addrs, $addrs->[0][0] ],
-           [ 1, '255.255.255.255' ],
-           "listen returns successfully with indirecttcp sentinel")
-           or die($dev->error_or_status());
-
-       # fork off to evaluate the indirecttcp addresses and then set up an
-       # xfer to write to the device
-       if (POSIX::fork() == 0) {
-           # NOTE: do not use IO::Socket in normal Amanda code - it is diabolically
-           # not threadsafe!  It's OK here since this is just a test script and
-           # since we're in a subprocess
-           use IO::Socket;
-           my $sock = new IO::Socket::INET(
-                   PeerAddr => '127.0.0.1',
-                   PeerPort => $addrs->[0][1],
-                   Proto => 'tcp')
-               or die("Could not create connecting socket");
-           $sock->shutdown(1); # send EOF
-           my $sockresult = <$sock>;
-           $sock->close();
-
-           my @sockresult = map { [ split(/:/, $_) ] } split(/ /, $sockresult);
-           $addrs = [ map { $_->[1] = int($_->[1]); $_ } @sockresult ];
-
-           my $xfer = Amanda::Xfer->new([
-                   Amanda::Xfer::Source::Random->new(32768*34, 0xB00),
-                   Amanda::Xfer::Dest::DirectTCPConnect->new($addrs) ]);
-
-           $xfer->start(make_cb(xmsg_cb => sub {
-               my ($src, $msg, $xfer) = @_;
-               if ($msg->{'type'} == $XMSG_ERROR) {
-                   die $msg->{'elt'} . " failed: " . $msg->{'message'};
-               } elsif ($msg->{'type'} == $XMSG_DONE) {
-                   Amanda::MainLoop::quit();
-               }
-           }));
-
-           Amanda::MainLoop::run();
-
-           # exit without doing any of perl's cleanup
-           POSIX::_exit(0);
-       }
-
-       # write files from the connection until EOF
-       my @messages;
-       my $num_files;
-       my $conn;
-       my ($call_accept, $start_device, $write_file_cb);
-
-       $call_accept = make_cb(call_accept => sub {
-           $conn = $dev->accept();
            Amanda::MainLoop::call_later($start_device);
        });
 
+
        $start_device = make_cb(start_device => sub {
            ok($dev->start($ACCESS_WRITE, "TEST2", "20090915000000"),
                "start device in write mode")
@@ -1353,12 +1355,10 @@ SKIP: {
 
            if (!$eof) {
                Amanda::MainLoop::call_later($write_file_cb);
-           } else {
-               Amanda::MainLoop::quit();
            }
        });
 
-       Amanda::MainLoop::call_later($call_accept);
+       Amanda::MainLoop::call_later($finish_connection);
        Amanda::MainLoop::run();
        is_deeply([@messages], [
                'WRITE-OK-491520-!eof-!eom',
index 278d83d33925c87272b7700bd0be73f5031282bb..e64e3caed23ffcc1773cb3670fcac39e2fd151fb 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 13;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Amanda::Config qw( :init :getconf );
index af2cdcebae50a9f0ec3ad7a0f27f44794034ebf4..7940f0536dc8bd31b8639339b1456b9f07318b39 100644 (file)
@@ -18,6 +18,7 @@
 
 use Test::More tests => 31;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Amanda::Feature;
index 9936cbfc9022bb14a3280674ce5b3cd577a37134..a09134ff4563ef57d0e8ef5e791184b1cb863305 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -16,8 +16,9 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 7;
+use Test::More tests => 55;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Amanda::Header;
@@ -28,24 +29,152 @@ use Installcheck;
 Amanda::Debug::dbopen("installcheck");
 Installcheck::log_test_output();
 
-# Not much to test, but we can at least exercise the constructor and destructor,
-# and the SWIG getters and setters:
-ok(my $hdr = Amanda::Header->new(), "can create a dumpfile_t");
-is($hdr->{'datestamp'}, '', "newly created dumpfile_t has empty datestamp");
-ok($hdr->{'name'} = "TAPE17", "can write to a string in the header");
-is($hdr->{'name'}, "TAPE17", "..and get it back");
+# Test all of the setters and getters, as well as to_string and from_string, by
+# constructing a header and converting it to a string and back.  This is a little
+# tricky, because of the various restrictions on combinations of fields in the
+# header, so we use multple headers.
 
-# set some other attributes so to_string will work
-$hdr->{'type'} = $Amanda::Header::F_TAPESTART;
-$hdr->{'datestamp'} = '20090102030405';
+my $hdr1 = Amanda::Header->new();
+$hdr1->{'type'} = $Amanda::Header::F_DUMPFILE;
+$hdr1->{'datestamp'} = '20090102030405';
+$hdr1->{'dumplevel'} = 6;
+$hdr1->{'compressed'} = 1;
+$hdr1->{'encrypted'} = 1;
+$hdr1->{'comp_suffix'} = '.TEENSY';
+$hdr1->{'encrypt_suffix'} = 'E';
+$hdr1->{'name'} = 'schlitz';
+$hdr1->{'disk'} = '/pbr';
+$hdr1->{'program'} = 'GNUTAR';
+$hdr1->{'application'} = 'amnot';
+$hdr1->{'srvcompprog'} = 'scp';
+$hdr1->{'srv_encrypt'} = 'se';
+$hdr1->{'recover_cmd'} = 'rec |';
+$hdr1->{'uncompress_cmd'} = 'unc |';
+$hdr1->{'decrypt_cmd'} = 'dec |';
+$hdr1->{'srv_decrypt_opt'} = '-dos';
+$hdr1->{'cont_filename'} = '/path/to/cont';
+$hdr1->{'dle_str'} = "D\nL\nE";
+$hdr1->{'is_partial'} = 1;
+$hdr1->{'blocksize'} = 32000;
+$hdr1->{'orig_size'} = 10240;
 
-my $block = $hdr->to_string(32768, 32768);
-like($block,
+my $hdr2 = Amanda::Header->new();
+$hdr2->{'type'} = $Amanda::Header::F_SPLIT_DUMPFILE;
+$hdr2->{'datestamp'} = '20090102030405';
+$hdr2->{'dumplevel'} = 6;
+$hdr2->{'compressed'} = 1;
+$hdr2->{'encrypted'} = 1;
+$hdr2->{'comp_suffix'} = '.TEENSY';
+$hdr2->{'encrypt_suffix'} = 'E';
+$hdr2->{'name'} = 'schlitz';
+$hdr2->{'disk'} = '/pbr';
+$hdr2->{'program'} = 'GNUTAR';
+$hdr2->{'application'} = 'amnot';
+$hdr2->{'clntcompprog'} = 'ccp';
+$hdr2->{'clnt_encrypt'} = 'ce';
+$hdr2->{'recover_cmd'} = 'rec |';
+$hdr2->{'uncompress_cmd'} = 'unc |';
+$hdr2->{'decrypt_cmd'} = 'dec |';
+$hdr2->{'clnt_decrypt_opt'} = '-doc';
+$hdr2->{'cont_filename'} = '/path/to/cont';
+$hdr2->{'dle_str'} = "D\nL\nE";
+$hdr2->{'is_partial'} = 1;
+$hdr2->{'partnum'} = 13;
+$hdr2->{'totalparts'} = 14;
+$hdr2->{'blocksize'} = 32000;
+$hdr2->{'orig_size'} = 10240;
+
+my $hdr3 = Amanda::Header->new();
+$hdr3->{'type'} = $Amanda::Header::F_TAPESTART;
+$hdr3->{'name'} = 'TAPE17';
+$hdr3->{'datestamp'} = '20090102030405';
+
+my $string1 = $hdr1->to_string(32768, 32768);
+my $string2 = $hdr2->to_string(65536, 65536);
+my $string3 = $hdr3->to_string(32768, 32768);
+
+is(length($string1), 32768, "generated header 1 has correct length");
+is(length($string2), 65536, "generated header 2 has correct length");
+
+like($string3,
      qr/^AMANDA: TAPESTART DATE 20090102030405 TAPE TAPE17/,
-     "generated header looks OK");
-is(length($block), 32768, "generated header has correct length");
+     "generated tapestart header looks OK");
+
+$hdr1 = Amanda::Header->from_string($string1);
+$hdr2 = Amanda::Header->from_string($string2);
+$hdr3 = Amanda::Header->from_string($string3);
+
+is($hdr1->{'type'}, $Amanda::Header::F_DUMPFILE, "'type' for hdr1");
+is($hdr1->{'datestamp'}, '20090102030405', "'datestamp' for hdr1");
+is($hdr1->{'dumplevel'}, 6, "'dumplevel' for hdr1");
+is($hdr1->{'compressed'}, 1, "'compressed' for hdr1");
+is($hdr1->{'encrypted'}, 1, "'encrypted' for hdr1");
+is($hdr1->{'comp_suffix'}, '.TEENSY', "'comp_suffix' for hdr1");
+is($hdr1->{'encrypt_suffix'}, 'E', "'encrypt_suffix' for hdr1");
+is($hdr1->{'name'}, 'schlitz', "'name' for hdr1");
+is($hdr1->{'disk'}, '/pbr', "'disk' for hdr1");
+is($hdr1->{'program'}, 'GNUTAR', "'program' for hdr1");
+is($hdr1->{'application'}, 'amnot', "'application' for hdr1");
+is($hdr1->{'srvcompprog'}, 'scp', "'srvcompprog' for hdr1");
+is($hdr1->{'srv_encrypt'}, 'se', "'srv_encrypt' for hdr1");
+is($hdr1->{'recover_cmd'}, 'rec |', "'recover_cmd' for hdr1");
+is($hdr1->{'uncompress_cmd'}, 'unc |', "'uncompress_cmd' for hdr1");
+is($hdr1->{'decrypt_cmd'}, 'dec |', "'decrypt_cmd' for hdr1");
+is($hdr1->{'srv_decrypt_opt'}, '-dos', "'srv_decrypt_opt' for hdr1");
+is($hdr1->{'cont_filename'}, '/path/to/cont', "'cont_filename' for hdr1");
+is($hdr1->{'dle_str'}, "D\nL\nE", "'dle_str' for hdr0");
+is($hdr1->{'is_partial'}, 1, "'is_partial' for hdr1");
+# no partnum for F_DUMPFILE
+# no numparts for F_DUMPFILE
+is($hdr1->{'blocksize'}, 0, "'blocksize' for hdr1 (not re-read; defaults to 0)");
+is($hdr1->{'orig_size'}, 10240, "'orig_size' for hdr1");
+
+is($hdr2->{'type'}, $Amanda::Header::F_SPLIT_DUMPFILE, "'type' for hdr2");
+is($hdr2->{'datestamp'}, '20090102030405', "'datestamp' for hdr2");
+is($hdr2->{'dumplevel'}, 6, "'dumplevel' for hdr2");
+is($hdr2->{'compressed'}, 1, "'compressed' for hdr2");
+is($hdr2->{'encrypted'}, 1, "'encrypted' for hdr2");
+is($hdr2->{'comp_suffix'}, '.TEENSY', "'comp_suffix' for hdr2");
+is($hdr2->{'encrypt_suffix'}, 'E', "'encrypt_suffix' for hdr2");
+is($hdr2->{'name'}, 'schlitz', "'name' for hdr2");
+is($hdr2->{'disk'}, '/pbr', "'disk' for hdr2");
+is($hdr2->{'program'}, 'GNUTAR', "'program' for hdr2");
+is($hdr2->{'application'}, 'amnot', "'application' for hdr2");
+is($hdr2->{'clntcompprog'}, 'ccp', "'clntcompprog' for hdr2");
+is($hdr2->{'clnt_encrypt'}, 'ce', "'clnt_encrypt' for hdr2");
+is($hdr2->{'recover_cmd'}, 'rec |', "'recover_cmd' for hdr2");
+is($hdr2->{'uncompress_cmd'}, 'unc |', "'uncompress_cmd' for hdr2");
+is($hdr2->{'decrypt_cmd'}, 'dec |', "'decrypt_cmd' for hdr2");
+is($hdr2->{'clnt_decrypt_opt'}, '-doc', "'clnt_decrypt_opt' for hdr2");
+is($hdr2->{'cont_filename'}, '/path/to/cont', "'cont_filename' for hdr2");
+is($hdr2->{'dle_str'}, "D\nL\nE", "'dle_str' for hdr0");
+is($hdr2->{'is_partial'}, 1, "'is_partial' for hdr2");
+is($hdr2->{'partnum'}, 13, "'partnum' for hdr2");
+is($hdr2->{'totalparts'}, 14, "'totalparts' for hdr2");
+is($hdr2->{'blocksize'}, 0, "'blocksize' for hdr2 (not re-read; defaults to 0)");
+is($hdr2->{'orig_size'}, 10240, "'orig_size' for hdr2");
+
+is($hdr3->{'type'}, $Amanda::Header::F_TAPESTART, "'type' for hdr3");
+is($hdr3->{'datestamp'}, "20090102030405", "'datestamp' for F_TAPESTART");
+is($hdr3->{'name'}, "TAPE17", "'name' for F_TAPESTART");
+
+# test out the other methods
 
-$hdr = Amanda::Header->from_string($block);
-is($hdr->{'name'}, "TAPE17",
-   "from_string gives a reasonable-looking object");
+# debug_dump just shouldn't crash, please
+$hdr1->debug_dump();
+$hdr2->debug_dump();
+$hdr3->debug_dump();
 
+is($hdr1->summary(),
+      "FILE: date 20090102030405 host schlitz disk /pbr lev 6 comp .TEENSY "
+    . "program GNUTAR server_custom_compress scp server_encrypt se "
+    . "server_decrypt_option -dos",
+    "hdr1 summary");
+is($hdr2->summary(),
+      "split dumpfile: date 20090102030405 host schlitz disk /pbr part 13/14 lev 6 comp .TEENSY "
+    . "program GNUTAR client_custom_compress ccp client_encrypt ce "
+    . "client_decrypt_option -doc",
+    "hdr2 summary");
+is($hdr3->summary(),
+    "start of tape: date 20090102030405 label TAPE17",
+    "hdr3 summary");
index 094d13356125b5a96c73037cbe252c03ea9776ef..9aaf3049fdc48fd68435dfee7ebf42f951bfcad8 100644 (file)
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 35;
+use Test::More tests => 39;
 use File::Path;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
@@ -190,12 +191,21 @@ my $logdir = $testconf->{'logdir'};
 
     -f "$filename" and unlink("$filename");
     log_add($L_INFO, "This is my info");
+    log_add($L_START, "blah blah blah date 20300405060708 blah blah");
 
     open(my $fh, "<", $filename) or die("open $filename: $!");
     my $logdata = do { local $/; <$fh> };
     close($fh);
 
     like($logdata, qr/^INFO Amanda_Logfile This is my info/, "log_add works");
+
+    is(Amanda::Logfile::get_current_log_timestamp(), "20300405060708",
+       "get_current_log_timestamp finds a timestamp");
+
+    Amanda::Logfile::log_rename("20300405060708");
+
+    ok(! -f $filename, "after log_rename, /log is gone");
+    ok(-f "$filename.20300405060708.0", "..and log.20300405060708.0 exists");
 }
 
 # set up and read the tapelist (we don't use Amanda::Tapelist to write this,
@@ -208,7 +218,7 @@ print $tlf "20071109010002 TESTCONF003 reuse\n";
 print $tlf "20071109010002 TESTCONF002 reuse\n";
 print $tlf "20071108010001 TESTCONF001 reuse\n";
 close $tlf;
-Amanda::Tapelist::read_tapelist($tapelist);
+Amanda::Tapelist->new($tapelist);
 
 # set up a number of logfiles in logdir.
 my $logf;
@@ -249,7 +259,7 @@ PART taper TESTCONF002 10 thatbox /u_lose 20071109010002 2/4 2 [multi-part failu
 PARTPARTIAL taper TESTCONF002 11 thatbox /u_lose 20071109010002  3/4 2 [multi-part retry]
 START taper datestamp 20071109010002 label TESTCONF003 tape 1
 PART taper TESTCONF003 1 thatbox /u_lose 20071109010002 3/4 2 [multi-part failure]
-FAIL taper thatbox /u_lose 20071109010002 2 "Oh no!"
+FAIL taper thatbox /u_lose 20071109010002 2 error "Oh no!"
 PART taper TESTCONF003 2 thatbox /u_win 20071109010002 1/4 3 [multi-part retry]
 PART taper TESTCONF003 3 thatbox /u_win 20071109010002 2/4 3 [multi-part retry]
 PARTPARTIAL taper TESTCONF003 4 thatbox /u_win 20071109010002  3/4 3 [multi-part retry]
@@ -391,6 +401,23 @@ is_deeply([ map { res2arr($_) } @filtered ],
          [ '20071109010002', 'thatbox', '/u_win',    3, 'TESTCONF004', 2,  'OK',      'OK'  , '',         4, 4 ],
        ], "filter with dumpspecs '.* /var thatbox' (union of two overlapping sets includes dupes)");
 
+@dumpspecs = Amanda::Cmdline::dumpspec_t->new('thatbox', undef, undef, undef, '20071109010002');
+@filtered = Amanda::Logfile::dumps_match_dumpspecs([@results], [@dumpspecs], 0);
+@filtered = sort { $a->{'label'} cmp $b->{'label'} ||
+                  $a->{'filenum'} <=> $b->{'filenum'} } @filtered;
+is_deeply([ map { res2arr($_) } @filtered ],
+       [
+         [ '20071109010002', 'thatbox', '/var',      1, 'TESTCONF002', 3,  'OK',      'OK'  , '',         1, 1 ],
+         [ '20071109010002', 'thatbox', '/u_lose',   2, 'TESTCONF002', 9,  'OK',      'FAIL', '"Oh no!"', 1, 4 ],
+         [ '20071109010002', 'thatbox', '/u_lose',   2, 'TESTCONF002', 10, 'OK',      'FAIL', '"Oh no!"', 2, 4 ],
+         [ '20071109010002', 'thatbox', '/u_lose',   2, 'TESTCONF002', 11, 'PARTIAL', 'FAIL', '"Oh no!"', 3, 4 ],
+         [ '20071109010002', 'thatbox', '/u_lose',   2, 'TESTCONF003', 1,  'OK',      'FAIL', '"Oh no!"', 3, 4 ],
+         [ '20071109010002', 'thatbox', '/u_win',    3, 'TESTCONF003', 2,  'OK',      'OK'  , '',         1, 4 ],
+         [ '20071109010002', 'thatbox', '/u_win',    3, 'TESTCONF003', 3,  'OK',      'OK'  , '',         2, 4 ],
+         [ '20071109010002', 'thatbox', '/u_win',    3, 'TESTCONF003', 4,  'PARTIAL', 'OK'  , '',         3, 4 ],
+         [ '20071109010002', 'thatbox', '/u_win',    3, 'TESTCONF004', 1,  'OK',      'OK'  , '',         3, 4 ],
+         [ '20071109010002', 'thatbox', '/u_win',    3, 'TESTCONF004', 2,  'OK',      'OK'  , '',         4, 4 ],
+       ], "filter with dumpspecs with host 'thatbox' and a write_timestamp");
 unlink($log_filename);
 
 # search_holding_disk and match_* are tested via Amanda::DB::Catalog's installcheck
index 2383b3d181c38fb4ba06d2015b9769548ae61f69..25e80c127c0d6e9267596bf2db523a89fcc4e1bd 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 use Test::More tests => 11;
 use IO::Socket;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
index 628c238fc513da7ded54765105751de5eb5a4a1e..da943463bad9ff22ba0041f74e2835edf6685231 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 use Test::More tests => 11;
 use File::Path;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
index 22bdc84069d2ce84a255c9ab7a189cf0b3029bab..ec3727f894806d7935e04e09cc72b3eb7358f251 100644 (file)
@@ -60,7 +60,7 @@ my $taperoot = "$Installcheck::TMP/Amanda_Recovery_Clerk";
 my $datestamp = "20100101010203";
 
 # set up a 2-tape disk changer with some spanned dumps in it, and add those
-# dumps to the catalog, too.  To avoid re-implementing Amanda::Taper::Scan, this
+# dumps to the catalog, too.  To avoid re-implementing Amanda::Taper::Scribe, this
 # uses individual transfers for each part.
 sub setup_changer {
     my ($finished_cb, $chg_name, $to_write, $part_len) = @_;
@@ -126,7 +126,8 @@ sub setup_changer {
        my $name = $xfer_info->[2];
 
        my $hdr = Amanda::Header->new();
-       $hdr->{'type'} = $Amanda::Header::F_SPLIT_DUMPFILE;
+       # if the partnum is 0, write a DUMPFILE like Amanda < 3.1 did
+       $hdr->{'type'} = $partnum? $Amanda::Header::F_SPLIT_DUMPFILE : $Amanda::Header::F_DUMPFILE;
        $hdr->{'datestamp'} = $datestamp;
        $hdr->{'dumplevel'} = 0;
        $hdr->{'name'} = $name;
@@ -144,7 +145,7 @@ sub setup_changer {
        my $key = $xfer_info->[1];
 
        my $xsrc = Amanda::Xfer::Source::Random->new($len, $key);
-       my $xdst = Amanda::Xfer::Dest::Device->new($dev, 1024*256);
+       my $xdst = Amanda::Xfer::Dest::Device->new($dev, 0);
        my $xfer = Amanda::Xfer->new([$xsrc, $xdst]);
 
        $xfer->start(sub {
@@ -167,7 +168,8 @@ sub setup_changer {
                        diskname => "/$name",
                        level => 0,
                        status => "OK",
-                       partnum => $partnum,
+                       # get the partnum right, even if this wasn't split
+                       partnum => $partnum? $partnum : ($partnum+1),
                        nparts => -1,
                        kb => $len / 1024,
                        sec => 1.2,
@@ -213,7 +215,7 @@ sub setup_changer {
     );
     my @to_write = (
        # slot xfer             partnum
-       [ 1,   $xfer_info[0],   1 ],
+       [ 1,   $xfer_info[0],   0 ], # partnum 0 => old non-split header
        [ 1,   $xfer_info[1],   1 ],
        [ 1,   $xfer_info[1],   2 ],
        [ 2,   $xfer_info[1],   3 ],
@@ -308,13 +310,13 @@ sub new {
     return bless \%params, $class;
 }
 
-sub notif_part {
+sub clerk_notif_part {
     my $self = shift;
 
-    if (exists $self->{'notif_part'}) {
-       $self->{'notif_part'}->(@_);
+    if (exists $self->{'clerk_notif_part'}) {
+       $self->{'clerk_notif_part'}->(@_);
     } else {
-       $self->SUPER::notif_part(@_);
+       $self->SUPER::clerk_notif_part(@_);
     }
 }
 
@@ -457,7 +459,7 @@ sub quit_clerk {
 
 my $clerk;
 my $feedback;
-my @notif_parts;
+my @clerk_notif_parts;
 my $chg = Amanda::Changer->new("chg-disk:$taperoot");
 my $scan = Amanda::Recovery::Scan->new(chg => $chg);
 
@@ -485,10 +487,10 @@ quit_clerk($clerk);
 
 # recover from TESTCONF02, then 01, and then 02 again
 
-@notif_parts = ();
+@clerk_notif_parts = ();
 $feedback = main::Feedback->new(
-    notif_part => sub {
-       push @notif_parts, [ $_[0], $_[1] ],
+    clerk_notif_part => sub {
+       push @clerk_notif_parts, [ $_[0], $_[1] ],
     },
 );
 
@@ -504,10 +506,10 @@ try_recovery(
     ),
     msg => "two-part recovery from second tape successful");
 
-is_deeply([ @notif_parts ], [
+is_deeply([ @clerk_notif_parts ], [
     [ 'TESTCONF02', 2 ],
     [ 'TESTCONF02', 3 ],
-    ], "..and notif_part calls are correct");
+    ], "..and clerk_notif_part calls are correct");
 
 try_recovery(
     clerk => $clerk,
@@ -623,7 +625,7 @@ SKIP: {
     }
 
     my $tapelist = Amanda::Config::config_dir_relative("tapelist");
-    my $tl = Amanda::Tapelist::read_tapelist($tapelist);
+    my $tl = Amanda::Tapelist->new($tapelist);
 
     my $chg = Amanda::Changer->new();
     my $scan = Amanda::Recovery::Scan->new(chg => $chg);
@@ -647,10 +649,11 @@ SKIP: {
        [ 1024*160,     0xB000, "home" ],
     );
     my @to_write = (
+       # (note that slots 1 and 2 are i/e slots, and are initially empty)
        # slot xfer             partnum
-       [ 4,   $xfer_info[0],   1 ],
-       [ 5,   $xfer_info[0],   2 ],
-       [ 5,   $xfer_info[0],   3 ],
+       [ 3,   $xfer_info[0],   1 ],
+       [ 4,   $xfer_info[0],   2 ],
+       [ 4,   $xfer_info[0],   3 ],
     );
 
     setup_changer(\&Amanda::MainLoop::quit, "ndmp_server", \@to_write, 64*1024);
@@ -665,9 +668,9 @@ SKIP: {
        clerk => $clerk,
        seed => 0xB000,
        dump => fake_dump("home", "/home", $datestamp, 0,
+           { label => 'TESTCONF03', filenum => 1 },
            { label => 'TESTCONF04', filenum => 1 },
-           { label => 'TESTCONF05', filenum => 1 },
-           { label => 'TESTCONF05', filenum => 2 },
+           { label => 'TESTCONF04', filenum => 2 },
        ),
        msg => "multi-part ndmp recovery successful",
        expect_directtcp_supported => 1);
index fd8e3148fd21714469bb631617aabfb5c7176b57..3e382c4e124ffff5286293719949d988f05e0676 100644 (file)
@@ -24,6 +24,7 @@ use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Run;
+use Installcheck::Catalogs;
 use Amanda::Config qw( :init :getconf config_dir_relative );
 use Amanda::Changer;
 use Amanda::Debug;
@@ -33,7 +34,7 @@ use Amanda::MainLoop;
 use Amanda::Header;
 use Amanda::Xfer qw( :constants );
 
-# and disable Debug's die() and warn() overrides
+# disable Debug's die() and warn() overrides
 Amanda::Debug::disable_die_override();
 
 # put the debug messages somewhere
@@ -44,103 +45,16 @@ my $testconf;
 $testconf = Installcheck::Run->setup();
 $testconf->write();
 
+# install the 'bigdb' catalog to test against
+my $cat = Installcheck::Catalogs::load("bigdb");
+$cat->install();
+
 my $cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF');
 if ($cfg_result != $CFGERR_OK) {
     my ($level, @errors) = Amanda::Config::config_errors();
     die(join "\n", @errors);
 }
 
-##
-# Fill in some fake logfiles
-
-my $logdir = config_dir_relative(getconf($CNF_LOGDIR));
-my $tapelist_fn = config_dir_relative(getconf($CNF_TAPELIST));
-my $holdingdir = "$Installcheck::TMP/holding";
-my %holding_filenames;
-my $write_timestamp;
-my $output;
-
-sub make_holding_file {
-    my ($name, $dump) = @_;
-
-    my $dir = "$holdingdir/$dump->{dump_timestamp}";
-    my $safe_disk = $dump->{'diskname'};
-    $safe_disk =~ tr{/}{_};
-    my $filename = "$dir/$dump->{hostname}.$safe_disk";
-    mkpath($dir);
-
-    # save the filename for later
-    $holding_filenames{$name} = $filename;
-
-    # (note that multi-chunk holding files are not used at this point)
-    my $hdr = Amanda::Header->new();
-    $hdr->{'type'} = $Amanda::Header::F_DUMPFILE;
-    $hdr->{'datestamp'} = $dump->{'dump_timestamp'};
-    $hdr->{'dumplevel'} = $dump->{'level'};
-    $hdr->{'name'} = $dump->{'hostname'};
-    $hdr->{'disk'} = $dump->{'diskname'};
-    $hdr->{'program'} = "INSTALLCHECK";
-    $hdr->{'is_partial'} = ($dump->{'status'} ne 'OK');
-
-    open(my $fh, ">", $filename) or die("opening '$filename': $!");
-    print $fh $hdr->to_string(32768,32768);
-
-    # transfer some data to that file
-    my $xfer = Amanda::Xfer->new([
-       Amanda::Xfer::Source::Pattern->new(1024*$dump->{'kb'}, "+-+-+-+-"),
-       Amanda::Xfer::Dest::Fd->new($fh),
-    ]);
-
-    $xfer->start(sub {
-       my ($src, $msg, $xfer) = @_;
-       if ($msg->{type} == $XMSG_ERROR) {
-           die $msg->{elt} . " failed: " . $msg->{message};
-       } elsif ($msg->{'type'} == $XMSG_DONE) {
-           $src->remove();
-           Amanda::MainLoop::quit();
-       }
-    });
-    Amanda::MainLoop::run();
-    close($fh);
-
-    return $filename;
-}
-
-open (my $tapelist, ">", $tapelist_fn);
-while (<DATA>) {
-    # skip comments
-    next if (/^#/ or /^\S*$/);
-
-    # add to tapelist
-    if (/^:tapelist (\d+) (\S+)\s*$/) {
-       print $tapelist "$1 $2 reuse\n";
-       next;
-    }
-
-    # new logfile
-    if (/^::: (.*)/) {
-       open $output, ">", "$logdir/$1" or die("Could not open $1 for writing: $!");
-       next;
-    }
-
-    # new holding-disk file
-    if (/^:holding (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) (\d+)/) {
-       my $dump = {
-           'dump_timestamp' => $2,     'hostname' => $3,           'diskname' => $4,
-           'level' => $5+0,            'status' => $6,             'kb' => $7,
-       };
-       make_holding_file($1, $dump);
-       next;
-    }
-
-
-    die("syntax error") if (/^:/);
-
-    print $output $_;
-}
-close($output);
-close($tapelist);
-
 ##
 ## Tests!
 ###
@@ -161,7 +75,7 @@ sub make_plan_sync {
 }
 
 sub ds {
-    return Amanda::Cmdline::dumpspec_t->new($_[0], $_[1], $_[2], $_[3]);
+    return Amanda::Cmdline::dumpspec_t->new($_[0], $_[1], $_[2], $_[3], undef);
 }
 
 sub is_plan {
@@ -230,28 +144,23 @@ is_plan(make_plan_sync(
     "simple plan for just one dump");
 
 is_plan(make_plan_sync(
-           dumpspec => ds("somebox", "^/lib"),
+           dumpspec => ds("somebox", "^/usr/bin"),
            changer => $changer),
     [
-       [   "somebox", "/lib", "20080111000000", 0, [
-               'Conf-001' => 1,
+        [   'somebox', '/usr/bin', '20080313133333', 1, [
+               'Conf-003' => 1,
            ],
-       ],
-       [   "somebox", "/lib", "20080313133333", 0, [
-               'Conf-003' => 2,
-               'Conf-003' => 3,
-               'Conf-003' => 4,
-               'Conf-003' => 5,
-               'Conf-003' => 6,
-               'Conf-003' => 7,
-               'Conf-003' => 8,
-               'Conf-003' => 9,
-               'Conf-003' => 10,
-               'Conf-003' => 11,
+        ],
+        [   'somebox', '/usr/bin', '20080515155555', 1, [
+               'Conf-006' => 1,
+           ]
+        ],
+        [   'somebox', '/usr/bin', '20080616166666', 1, [
+               'Conf-007' => 1,
            ],
-       ],
+        ],
     ],
-    "plan for two dumps, in order by tape write time");
+    "plan for three dumps, in order by tape write time");
 
 is_plan(make_plan_sync(
            dumpspec => ds("otherbox", "^/lib"),
@@ -261,17 +170,21 @@ is_plan(make_plan_sync(
                '20080414144444/otherbox._lib',
            ],
        ],
-       [   "otherbox", "/lib", "20080313133333", 0, [
-               'Conf-003', 13,
+       [   'otherbox', '/lib', '20080313133333', 0, [
+               'Conf-003' => 14,
+           ],
+       ],
+       [   "otherbox", "/lib", "20080511151555", 0, [
+               'Conf-006', 13,
            ],
        ],
     ],
-    "plan for a two dumps, one on holding disk; holding dumps prioritized first");
+    "plan for three dumps, one on holding disk; holding dumps prioritized first");
 
 is_plan(make_plan_sync(
            dumpspecs => [
                ds("somebox", "^/lib", "20080111"),
-               ds("euclid", "/home/dustin/code/backuppc"),
+               ds("somebox", "^/lib", "20080222"),
            ],
            changer => $changer),
     [
@@ -279,13 +192,9 @@ is_plan(make_plan_sync(
                'Conf-001' => 1,
            ],
        ],
-       [   "euclid", "/home/dustin/code/backuppc", "20100127172011", 0, [
-               'Conf-013' => 1,
-               'Conf-013' => 2,
-               'Conf-013' => 3,
-               'Conf-014' => 1,
-               'Conf-014' => 2,
-               'Conf-014' => 3,
+       [       'somebox', '/lib', '20080222222222', 0, [
+               'Conf-002' => 1,
+               'Conf-002' => 2,
            ],
        ],
     ],
@@ -341,7 +250,7 @@ is_plan(make_plan_sync(
 
 is_plan(make_plan_sync(
            dumpspec => ds("oldbox", "^/opt", "20080414144444"),
-           holding_file => $holding_filenames{'oldbox_opt_20080414144444_holding'}),
+           holding_file => $cat->holding_filename('oldbox_opt_20080414144444_holding')),
     [
        [   "oldbox", "/opt", "20080414144444", 0, [
                '20080414144444/oldbox._opt',
@@ -351,7 +260,7 @@ is_plan(make_plan_sync(
     "make_plan creates an appropriate plan for an explicit holding-disk recovery");
 
 is_plan(make_plan_sync(
-           holding_file => $holding_filenames{'oldbox_opt_20080414144444_holding'}),
+           holding_file => $cat->holding_filename('oldbox_opt_20080414144444_holding')),
     [
        [   "oldbox", "/opt", "20080414144444", 0, [
                '20080414144444/oldbox._opt',
@@ -361,20 +270,24 @@ is_plan(make_plan_sync(
     "same, without a dumpspec");
 
 is_plan(make_plan_sync(
-           dumpspec => ds("euclid", "/home/dustin/code/backuppc"),
+           dumpspec => ds("somebox", "/lib", "20080515155555"),
            filelist => [
-               'Conf-013' => [1, 2, 3],
-               'Conf-014' => [1, 2, 3],
+               'Conf-006' => [2, 3, 4, 5,       8, 9, 10, 11],
+               #  (make_plan should fill in files 6 and 7)
            ],
            changer => $changer),
     [
-       [   "euclid", "/home/dustin/code/backuppc", "20100127172011", 0, [
-               'Conf-013' => 1,
-               'Conf-013' => 2,
-               'Conf-013' => 3,
-               'Conf-014' => 1,
-               'Conf-014' => 2,
-               'Conf-014' => 3,
+       [   'somebox', '/lib', '20080515155555', 0, [
+               'Conf-006' => 2,
+               'Conf-006' => 3,
+               'Conf-006' => 4,
+               'Conf-006' => 5,
+               'Conf-006' => 6,
+               'Conf-006' => 7,
+               'Conf-006' => 8,
+               'Conf-006' => 9,
+               'Conf-006' => 10,
+               'Conf-006' => 11,
            ],
        ],
     ],
@@ -382,163 +295,23 @@ is_plan(make_plan_sync(
 
 is_plan(make_plan_sync(
            filelist => [
-               'Conf-013' => [1, 2, 3],
-               'Conf-014' => [1, 2, 3],
+               'Conf-006' => [2, 3, 4, 5,       8, 9, 10, 11],
+               #  (make_plan should fill in files 6 and 7)
            ],
            changer => $changer),
     [
-       [   "euclid", "/home/dustin/code/backuppc", "20100127172011", 0, [
-               'Conf-013' => 1,
-               'Conf-013' => 2,
-               'Conf-013' => 3,
-               'Conf-014' => 1,
-               'Conf-014' => 2,
-               'Conf-014' => 3,
+       [   'somebox', '/lib', '20080515155555', 0, [
+               'Conf-006' => 2,
+               'Conf-006' => 3,
+               'Conf-006' => 4,
+               'Conf-006' => 5,
+               'Conf-006' => 6,
+               'Conf-006' => 7,
+               'Conf-006' => 8,
+               'Conf-006' => 9,
+               'Conf-006' => 10,
+               'Conf-006' => 11,
            ],
        ],
     ],
     "plan based on filelist, without a dumpspec");
-
-__DATA__
-# a short-datestamp logfile with only a single, single-part file in it
-::: log.20080111.0
-:tapelist 20080111 Conf-001
-DISK planner somebox /lib
-START planner date 20080111
-START driver date 20080111
-STATS driver hostname somebox
-STATS driver startup time 0.051
-FINISH planner date 20080111 time 82.721
-START taper datestamp 20080111 label Conf-001 tape 1
-SUCCESS dumper somebox /lib 20080111 0 [sec 0.209 kb 1970 kps 9382.2 orig-kb 1970]
-SUCCESS chunker somebox /lib 20080111 0 [sec 0.305 kb 420 kps 1478.7]
-STATS driver estimate somebox /lib 20080111 0 [sec 1 nkb 2002 ckb 480 kps 385]
-PART taper Conf-001 1 somebox /lib 20080111 1/1 0 [sec 4.813543 kb 419 kps 87.133307]
-DONE taper somebox /lib 20080111 1 0 [sec 4.813543 kb 419 kps 87.133307]
-FINISH driver date 20080111 time 2167.581
-
-# a logfile with several dumps in it, one of which comes in many parts, and one of which is
-# from a previous run
-::: log.20080313133333.0
-:tapelist 20080313133333 Conf-003
-DISK planner somebox /usr/bin
-DISK planner somebox /lib
-DISK planner otherbox /lib
-DISK planner otherbox /usr/bin
-START planner date 20080313133333
-START driver date 20080313133333
-STATS driver hostname somebox
-STATS driver startup time 0.059
-INFO planner Full dump of somebox:/lib promoted from 2 days ahead.
-FINISH planner date 20080313133333 time 0.286
-SUCCESS dumper somebox /usr/bin 20080313133333 1 [sec 0.001 kb 20 kps 10352.0 orig-kb 20]
-SUCCESS chunker somebox /usr/bin 20080313133333 1 [sec 1.023 kb 20 kps 50.8]
-STATS driver estimate somebox /usr/bin 20080313133333 1 [sec 0 nkb 52 ckb 64 kps 1024]
-START taper datestamp 20080313133333 label Conf-003 tape 1
-PART taper Conf-003 1 somebox /usr/bin 20080313133333 1/1 1 [sec 0.000370 kb 20 kps 54054.054054]
-DONE taper somebox /usr/bin 20080313133333 1 1 [sec 0.000370 kb 20 kps 54054.054054]
-# a multi-part dump
-SUCCESS dumper somebox /lib 20080313133333 0 [sec 0.189 kb 3156 kps 50253.1 orig-kb 3156]
-SUCCESS chunker somebox /lib 20080313133333 0 [sec 5.250 kb 3156 kps 1815.5]
-STATS driver estimate somebox /lib 20080313133333 0 [sec 1 nkb 3156 ckb 3156 kps 9500]
-PART taper Conf-003 2 somebox /lib 20080313133333 1/10 0 [sec 0.005621 kb 1024 kps 182173.990393]
-PART taper Conf-003 3 somebox /lib 20080313133333 2/10 0 [sec 0.006527 kb 1024 kps 156886.777999]
-PART taper Conf-003 4 somebox /lib 20080313133333 3/10 0 [sec 0.005854 kb 1024 kps 174923.129484]
-PART taper Conf-003 5 somebox /lib 20080313133333 4/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-PART taper Conf-003 6 somebox /lib 20080313133333 5/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-PART taper Conf-003 7 somebox /lib 20080313133333 6/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-PART taper Conf-003 8 somebox /lib 20080313133333 7/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-PART taper Conf-003 9 somebox /lib 20080313133333 8/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-PART taper Conf-003 10 somebox /lib 20080313133333 9/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
-PART taper Conf-003 11 somebox /lib 20080313133333 10/10 0 [sec 0.001919 kb 284 kps 147993.746743]
-DONE taper somebox /lib 20080313133333 10 0 [sec 0.051436 kb 3156 kps 184695.543977]
-SUCCESS dumper otherbox /lib 20080313133333 0 [sec 0.001 kb 190 kps 10352.0 orig-kb 20]
-SUCCESS chunker otherbox /lib 20080313133333 0 [sec 1.023 kb 190 kps 50.8]
-STATS driver estimate otherbox /lib 20080313133333 0 [sec 0 nkb 190 ckb 190 kps 1024]
-# this dump is from a previous run, with an older dump_timestamp
-PART taper Conf-003 12 otherbox /usr/bin 20080311131133 1/1 0 [sec 0.002733 kb 240 kps 136425.648022]
-DONE taper otherbox /usr/bin 20080311131133 1 0 [sec 0.002733 kb 240 kps 136425.648022]
-PART taper Conf-003 13 otherbox /lib 20080313133333 1/1 0 [sec 0.001733 kb 190 kps 136425.648022]
-DONE taper otherbox /lib 20080313133333 1 0 [sec 0.001733 kb 190 kps 136425.648022]
-FINISH driver date 20080313133333 time 24.777
-
-# A logfile with some partial parts (PARTPARTIAL) in it
-::: log.20080414144444.0
-:tapelist 20080414144444 Conf-004
-:tapelist 20080414144444 Conf-005
-DISK planner otherbox /lib
-START planner date 20080414144444
-START driver date 20080414144444
-STATS driver hostname otherbox
-STATS driver startup time 0.075
-INFO taper Will write new label `Conf-004' to new (previously non-amanda) tape
-FINISH planner date 20080414144444 time 2.139
-SUCCESS dumper otherbox /lib 20080414144444 1 [sec 0.003 kb 60 kps 16304.3 orig-kb 60]
-SUCCESS chunker otherbox /lib 20080414144444 1 [sec 1.038 kb 60 kps 88.5]
-STATS driver estimate otherbox /lib 20080414144444 1 [sec 0 nkb 92 ckb 96 kps 1024]
-START taper datestamp 20080414144444 label Conf-004 tape 1
-PARTPARTIAL taper Conf-004 1 otherbox /lib 20080414144444 1/1 1 [sec 0.000707 kb 32 kps 45261.669024] ""
-INFO taper Will request retry of failed split part.
-INFO taper Will write new label `Conf-005' to new (previously non-amanda) tape
-START taper datestamp 20080414144444 label Conf-005 tape 2
-PARTPARTIAL taper Conf-005 1 otherbox /lib 20080414144444 1/1 1 [sec 0.000540 kb 32 kps 59259.259259] ""
-INFO taper Will request retry of failed split part.
-WARNING driver Out of tapes; going into degraded mode.
-PARTIAL taper otherbox /lib 20080414144444 1 1 [sec 0.000540 kb 32 kps 59259.259259] "full-up"
-# a completely failed dump
-FAIL taper otherbox /boot 20080414144444 0 "no-space"
-FINISH driver date 20080414144444 time 6.959
-
-# a spanned dump (yep, a real dump)
-::: log.20100127172011.0
-:tapelist 20100127172011 Conf-013
-:tapelist 20100127172011 Conf-014
-INFO amdump amdump pid 30186
-INFO planner planner pid 30207
-START planner date 20100127172011
-DISK planner euclid /home/dustin/code/backuppc
-INFO planner Adding new disk euclid:/home/dustin/code/backuppc.
-INFO driver driver pid 30208
-START driver date 20100127172011
-STATS driver hostname euclid
-INFO dumper dumper pid 30220
-STATS driver startup time 0.097
-INFO dumper dumper pid 30222
-INFO dumper dumper pid 30221
-INFO dumper dumper pid 30213
-INFO taper taper pid 30210
-FINISH planner date 20100127172011 time 1.224
-INFO planner pid-done 30207
-INFO taper Will write new label `Conf-013' to new tape
-INFO chunker chunker pid 30255
-INFO dumper gzip pid 30259
-SUCCESS dumper euclid /home/dustin/code/backuppc 20100127172011 0 [sec 0.933 kb 2770 kps 2968.5 orig-kb 2770]
-SUCCESS chunker euclid /home/dustin/code/backuppc 20100127172011 0 [sec 0.943 kb 2770 kps 2970.1]
-INFO chunker pid-done 30255
-STATS driver estimate euclid /home/dustin/code/backuppc 20100127172011 0 [sec 2 nkb 2802 ckb 2816 kps 1024]
-INFO dumper pid-done 30259
-START taper datestamp 20100127172011 label Conf-013 tape 1
-PART taper Conf-013 1 euclid /home/dustin/code/backuppc 20100127172011 1/-1 0 [sec 0.000763 kb 512 kps 670972.950092]
-PART taper Conf-013 2 euclid /home/dustin/code/backuppc 20100127172011 2/-1 0 [sec 0.000770 kb 512 kps 664770.167400]
-PART taper Conf-013 3 euclid /home/dustin/code/backuppc 20100127172011 3/-1 0 [sec 0.000877 kb 512 kps 583952.261903]
-PARTPARTIAL taper Conf-013 4 euclid /home/dustin/code/backuppc 20100127172011 4/-1 0 [sec 0.000689 kb 352 kps 510888.307044] "No space left on device"
-INFO taper Will request retry of failed split part.
-INFO taper tape Conf-013 kb 1536 fm 4 [OK]
-INFO taper Will write new label `Conf-014' to new tape
-START taper datestamp 20100127172011 label Conf-014 tape 2
-PART taper Conf-014 1 euclid /home/dustin/code/backuppc 20100127172011 4/-1 0 [sec 0.001346 kb 512 kps 380377.004130]
-PART taper Conf-014 2 euclid /home/dustin/code/backuppc 20100127172011 5/-1 0 [sec 0.001338 kb 512 kps 382524.888399]
-PART taper Conf-014 3 euclid /home/dustin/code/backuppc 20100127172011 6/-1 0 [sec 0.000572 kb 210 kps 367336.443449]
-DONE taper euclid /home/dustin/code/backuppc 20100127172011 6 0 [sec 0.005666 kb 2770 kps 488860.596548]
-INFO dumper pid-done 30213
-INFO dumper pid-done 30220
-INFO dumper pid-done 30222
-INFO taper tape Conf-014 kb 1234 fm 3 [OK]
-INFO dumper pid-done 30221
-INFO taper pid-done 30210
-FINISH driver date 20100127172011 time 4.197
-INFO driver pid-done 30208
-
-# holding-disk
-:holding otherbox_lib_20080414144444_holding 20080414144444 otherbox /lib 1 OK 256
-:holding oldbox_opt_20080414144444_holding 20080414144444 oldbox /opt 0 OK 1298
index 3c475c5b104cab10cf3e49310d8861884f7ea155..40cf557332bb67a998a286cbf51d5b9033724760 100644 (file)
@@ -20,6 +20,7 @@ use Test::More tests => 95;
 use File::Path;
 use Data::Dumper;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
index 60637a4670de3b9b19cb70de59a1acd492af2019..f30e985ad63cc963a9b0fbbafea350067c4f1bf5 100755 (executable)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
 
-use Test::More tests => 34;
+use Test::More tests => 58;
 use strict;
 use warnings;
 
@@ -62,6 +62,9 @@ EOF
 
 $LogfileFlags{planner} = {
     normal_run => 1,
+    results_missing => 1,
+    dump_failed => 0,
+    dump_strange => 0
 };
 
 $LogfileData{planner} = {
@@ -70,15 +73,15 @@ $LogfileData{planner} = {
         localhost => {
             "/root" => {
                 estimate => undef,
-                tries    => [],
+                dumps    => {},
             },
             "/etc" => {
                 estimate => undef,
-                tries    => [],
+                dumps    => {},
             },
             "/var/log" => {
                 estimate => undef,
-                tries    => [],
+                dumps    => {},
             },
         },
     },
@@ -106,6 +109,9 @@ EOF
 $LogfileFlags{driver} = {
     got_finish => 1,
     normal_run => 1,
+    results_missing => 1,
+    dump_failed => 0,
+    dump_strange => 0
 };
 
 $LogfileData{driver} = {
@@ -127,7 +133,7 @@ $LogfileData{driver} = {
                     ckb   => "64",
                     kps   => "1024",
                 },
-                tries => [],
+                dumps => {},
             },
             "/etc" => {
                 estimate => {
@@ -137,7 +143,7 @@ $LogfileData{driver} = {
                     ckb   => "64",
                     kps   => "1024",
                 },
-                tries => [],
+                dumps => {},
             },
             "/home" => {
                 estimate => {
@@ -147,7 +153,7 @@ $LogfileData{driver} = {
                     ckb   => "64",
                     kps   => "1024",
                 },
-                tries => [],
+                dumps => {},
             },
         },
     },
@@ -177,6 +183,9 @@ EOF
 $LogfileFlags{dumper} = {
     got_finish => 1,
     normal_run => 1,
+    results_missing => 0,
+    dump_failed => 1,
+    dump_strange => 0
 };
 
 $LogfileData{dumper} = {
@@ -199,7 +208,8 @@ $LogfileData{dumper} = {
                     ckb   => "64",
                     kps   => "1024",
                 },
-                tries => [
+                dumps => {
+                 '20090728122430' => [
                     {
                         dumper => {
                             date      => "20090728122430",
@@ -211,7 +221,8 @@ $LogfileData{dumper} = {
                             orig_kb   => "42",
                         },
                     },
-                ],
+                 ]
+                },
             },
             "/etc" => {
                 estimate => {
@@ -221,7 +232,8 @@ $LogfileData{dumper} = {
                     ckb   => "64",
                     kps   => "1024",
                 },
-                tries => [
+                dumps => {
+                 '20090728122430' => [
                     {
                         dumper => {
                             date      => "20090728122430",
@@ -233,7 +245,8 @@ $LogfileData{dumper} = {
                             orig_kb   => "2048",
                         },
                     },
-                ],
+                 ]
+                },
             },
             "/home" => {
                 estimate => {
@@ -243,7 +256,8 @@ $LogfileData{dumper} = {
                     ckb   => "64",
                     kps   => "1024",
                 },
-                tries => [
+                dumps => {
+                 '20090728122430' => [
                     {
                         dumper => {
                             date      => "20090728122430",
@@ -255,7 +269,8 @@ $LogfileData{dumper} = {
                             orig_kb   => "4096",
                         },
                     },
-                ],
+                 ]
+                },
             },
         },
     },
@@ -290,6 +305,9 @@ EOF
 $LogfileFlags{chunker} = {
     got_finish => 1,
     normal_run => 1,
+    results_missing => 0,
+    dump_failed => 1,
+    dump_strange => 0
 };
 
 $LogfileData{chunker} = {
@@ -313,7 +331,8 @@ $LogfileData{chunker} = {
                     ckb   => "64",
                     kps   => "1024",
                 },
-                tries => [
+                dumps => {
+                 '20090728122430' => [
                     {
                         dumper => {
                             date      => "20090728122430",
@@ -333,7 +352,8 @@ $LogfileData{chunker} = {
                             kps    => "2100",
                         },
                     },
-                ],
+                 ]
+                },
             },
             "/etc" => {
                 estimate => {
@@ -343,7 +363,8 @@ $LogfileData{chunker} = {
                     ckb   => "64",
                     kps   => "1024",
                 },
-                tries => [
+                dumps => {
+                 '20090728122430' => [
                     {
                         dumper => {
                             date      => "20090728122430",
@@ -363,7 +384,8 @@ $LogfileData{chunker} = {
                             kps    => "2592.40506",
                         },
                     },
-                ],
+                  ]
+               },
             },
             "/home" => {
                 estimate => {
@@ -373,7 +395,8 @@ $LogfileData{chunker} = {
                     ckb   => "64",
                     kps   => "1024",
                 },
-                tries => [
+                dumps => {
+                 '20090728122430' => [
                     {
                         dumper => {
                             date      => "20090728122430",
@@ -393,7 +416,8 @@ $LogfileData{chunker} = {
                             kps    => "3087.80488"
                         },
                     },
-                ],
+                  ]
+               },
             },
         },
     },
@@ -411,7 +435,6 @@ SUCCESS dumper somebox /lib 20080111 0 [sec 0.209 kb 1970 kps 9382.2 orig-kb 197
 SUCCESS chunker somebox /lib 20080111 0 [sec 0.305 kb 420 kps 1478.7]
 STATS driver estimate somebox /lib 20080111 0 [sec 1 nkb 2002 ckb 480 kps 385]
 INFO taper taper pid 28023
-INFO taper Will write new label `TESTCONF01' to new tape
 START taper datestamp 20080111 label TESTCONF01 tape 1
 PART taper TESTCONF01 1 somebox /lib 20080111 1/-1 0 [sec 0.004722 kb 640 kps 135535.789920]
 PART taper TESTCONF01 2 somebox /lib 20080111 2/-1 0 [sec 0.003438 kb 640 kps 186154.741129]
@@ -426,6 +449,9 @@ EOF
 $LogfileFlags{taper} = {
     got_finish => 1,
     normal_run => 1,
+    results_missing => 0,
+    dump_failed => 0,
+    dump_strange => 0
 };
 
 $LogfileData{taper} = {
@@ -444,7 +470,6 @@ $LogfileData{taper} = {
         taper   => {
             start => '20080111',
             notes => [
-                "Will write new label `TESTCONF01' to new tape",
                 "tape TESTCONF01 kb 2016 fm 4 [OK]"
             ],
             tapes => {
@@ -470,7 +495,8 @@ $LogfileData{taper} = {
                     ckb   => "480",
                     kps   => "385",
                 },
-                tries => [
+                dumps => {
+                 '20080111' => [
                     {
                         dumper => {
                             status  => "success",
@@ -537,7 +563,8 @@ $LogfileData{taper} = {
                             error   => '',
                         },
                     },
-                ],
+                  ]
+               },
             },
         },
     },
@@ -563,6 +590,9 @@ EOF
 $LogfileFlags{simple} = {
     got_finish => 1,
     normal_run => 1,
+    results_missing => 0,
+    dump_failed => 0,
+    dump_strange => 0
 };
 
 $LogfileData{simple} = {
@@ -603,7 +633,8 @@ $LogfileData{simple} = {
                     level => "0",
                     sec   => "1"
                 },
-                tries => [
+                dumps => {
+                 '20080111' => [
                     {
                         dumper => {
                             status  => "success",
@@ -642,7 +673,8 @@ $LogfileData{simple} = {
                             kps    => "1478.7",
                         },
                     },
-                ],
+                  ]
+               },
             },
         },
     },
@@ -706,11 +738,14 @@ INFO dumper pid-done 11816
 PART taper FullBackup-14 4 hostname.example.org / 20081002040002 1/1 1 [sec 0.088934 kb 8392 kps 94368.875374]
 DONE taper hostname.example.org / 20081002040002 1 1 [sec 0.088934 kb 8392 kps 94368.875374]
 INFO dumper gzip pid 11861
-SUCCESS dumper hostname.example.org /somedir2 20081002040002 0 [sec 372.700 kb 28776940 kps 77212.0 orig-kb 28776940]
+STRANGE dumper hostname.example.org /somedir2 0 [sec 372.700 kb 28776940 kps 77212.0 orig-kb 28776940]
+  ! strange data
 PART taper FullBackup-14 5 hostname.example.org /somedir2 20081002040002 1/1 0 [sec 370.382399 kb 28776940 kps 77695.214669]
 DONE taper hostname.example.org /somedir2 20081002040002 1 0 [sec 370.382399 kb 28776940 kps 77695.214669]
 INFO dumper pid-done 11861
 STATS driver estimate hostname.example.org /somedir2 20081002040002 0 [sec 28776940 nkb 28776972 ckb 28776992 kps 1]
+PART taper FullBackup-14 6 hostname.example.org /somedir2 20081002030002 1/1 0 [sec 370.382399 kb 28776940 kps 77695.214669]
+DONE taper hostname.example.org /somedir2 20081002030002 1 0 [sec 370.382399 kb 28776940 kps 77695.214669]
 INFO dumper pid-done 9315
 INFO dumper pid-done 9317
 INFO dumper pid-done 9316
@@ -724,6 +759,9 @@ EOF
 $LogfileFlags{fullExample} = {
     got_finish => 1,
     normal_run => 1,
+    results_missing => 0,
+    dump_failed => 0,
+    dump_strange => 1
 };
 
 $LogfileData{fullExample} = {
@@ -745,11 +783,11 @@ $LogfileData{fullExample} = {
             tapes => {
                 "FullBackup-14" => {
                     'label' => 'FullBackup-14',
-                    'files' => 5,
-                    'time'  => '370.548573',
+                    'files' => 6,
+                    'time'  => '740.930972',
                     'date'  => '20081002040002',
-                    'kb'    => 28791982,
-                    'dle'   => 5
+                    'kb'    => 57568922,
+                    'dle'   => 6
                 },
             },
             tape_labels => ["FullBackup-14"],
@@ -765,7 +803,8 @@ $LogfileData{fullExample} = {
                     kps   => "1024",
                     ckb   => "40288",
                 },
-                tries => [
+                dumps => {
+                 '20081002040002' => [
                     {
                         chunker => {
                             status => "success",
@@ -804,7 +843,8 @@ $LogfileData{fullExample} = {
                             orig_kb => "82380"
                         },
                     },
-                ],
+                  ]
+               },
             },
             "/somedir2" => {
                 estimate => {
@@ -814,16 +854,19 @@ $LogfileData{fullExample} = {
                     level => "0",
                     sec   => "28776940"
                 },
-                tries => [
+                dumps => {
+                 "20081002040002" => [
                     {
                         dumper => {
                             kps     => "77212.0",
                             level   => "0",
                             sec     => "372.700",
-                            status  => "success",
-                            date    => "20081002040002",
+                            status  => "strange",
+                            #date    => "20081002040002",
                             kb      => "28776940",
                             orig_kb => "28776940",
+                           nb_stranges => 1,
+                           stranges => [ "! strange data" ],
                         },
                         taper => {
                             kps    => "77695.214669",
@@ -845,7 +888,31 @@ $LogfileData{fullExample} = {
                             orig_kb => undef
                         },
                     },
-                ],
+                  ],
+                 "20081002030002" => [
+                   {
+                        taper => {
+                            kps    => "77695.214669",
+                            level  => "0",
+                            sec    => "370.382399",
+                            status => "done",
+                            parts  => [
+                                {
+                                    label => 'FullBackup-14',
+                                    date  => '20081002030002',
+                                    kps   => '77695.214669',
+                                    sec   => '370.382399',
+                                    partnum  => '1',
+                                    file  => '6',
+                                    kb    => '28776940',
+                                }
+                            ],
+                            kb      => "28776940",
+                            orig_kb => undef
+                        },
+                   },
+                 ]
+               },
             },
             "/moreapps" => {
                 estimate => {
@@ -855,7 +922,8 @@ $LogfileData{fullExample} = {
                     level => "1",
                     sec   => "0"
                 },
-                'tries' => [
+                dumps => {
+                 '20081002040002' => [
                     {
                         'chunker' => {
                             'kps'    => '8.3',
@@ -893,8 +961,9 @@ $LogfileData{fullExample} = {
                             'kb'     => '10',
                             orig_kb  => '10'
                         },
-                    }
-                ],
+                    },
+                 ]
+                },
             },
             "/apps" => {
                 estimate => {
@@ -904,7 +973,8 @@ $LogfileData{fullExample} = {
                     level => "1",
                     sec   => "6"
                 },
-                tries => [
+                dumps => {
+                 '20081002040002' => [
                     {
                         chunker => {
                             kps    => "1226.3",
@@ -943,7 +1013,8 @@ $LogfileData{fullExample} = {
                             orig_kb => "6630"
                         },
                     },
-                ],
+                 ]
+                },
             },
             "/somedir" => {
                 estimate => {
@@ -953,7 +1024,8 @@ $LogfileData{fullExample} = {
                     level => "1",
                     sec   => "0"
                 },
-                tries => [
+                dumps => {
+                 "20081002040002" => [
                     {
                         chunker => {
                             kps    => "8.3",
@@ -992,7 +1064,8 @@ $LogfileData{fullExample} = {
                             orig_kb => "10",
                         },
                     },
-                ],
+                 ]
+                },
             },
         },
     },
@@ -1025,6 +1098,9 @@ EOF
 $LogfileFlags{amflushExample} = {
     got_finish  => 1,
     amflush_run => 1,
+    results_missing => 0,
+    dump_failed => 0,
+    dump_strange => 0
 };
 
 $LogfileData{amflushExample} = {
@@ -1054,7 +1130,8 @@ $LogfileData{amflushExample} = {
         'localhost' => {
             '/etc' => {
                 estimate => undef,
-                'tries'  => [
+                dumps => {
+                 '20090620020002' => [
                     {
                         'taper' => {
                             'kps'    => '14766.518895',
@@ -1076,15 +1153,17 @@ $LogfileData{amflushExample} = {
                             orig_kb  => undef
                         },
                     },
-                ],
+                 ]
+                },
             },
             '/backups/oracle' => {
                 estimate => undef,
-                'tries'  => [],
+                dumps    => {},
             },
             '/usr/local/bin' => {
                 estimate => undef,
-                'tries'  => [
+                dumps    => {
+                   '20090620020002' => [
                     {
                         'taper' => {
                             'kps'    => '184.632684',
@@ -1105,16 +1184,16 @@ $LogfileData{amflushExample} = {
                             'kb'     => '309',
                             orig_kb  => undef
                         },
-                    },
-                ],
+                    }]
+                },
             },
             '/home' => {
                 estimate => undef,
-                'tries'  => [],
+                dumps    => {},
             },
             '/backups/mysql' => {
                 estimate => undef,
-                'tries'  => [],
+                dumps    => {},
             },
         },
     },
@@ -1176,7 +1255,8 @@ is_deeply(
             level => "1",
             sec   => "6"
         },
-        tries => [
+        dumps => {
+         '20081002040002' => [
             {
                 chunker => {
                     kps    => "1226.3",
@@ -1215,7 +1295,8 @@ is_deeply(
                     orig_kb => "6630"
                 },
             },
-        ],
+         ]
+        },
     },
     'check: Amanda::Report::get_dle_info($hostname, $disk)'
 );
index bb4be1d73e94db05a720793bf9dd8a4dba0322d2..1b8bb0fb6fb77c2474b582791659ec0ef79b5de3 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 20;
+use Test::More tests => 24;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
 use Amanda::Tapelist;
 use Amanda::Config qw( :init :getconf config_dir_relative );
+use POSIX ":sys_wait_h";
+
+# put the debug messages somewhere
+Amanda::Debug::dbopen("installcheck");
+Installcheck::log_test_output();
 
 my $tl;
 my $tl_ok;
@@ -63,8 +69,11 @@ sub readtapelist {
 );
 mktapelist($tapelist, @lines);
 
-$tl = Amanda::Tapelist::read_tapelist($tapelist);
-$tl_ok = is_deeply($tl,        [
+$tl = Amanda::Tapelist->new($tapelist);
+$tl_ok = is_deeply($tl,        {
+ filename => $tapelist,
+ lockname => $tapelist . ".lock",
+ tles => [
   { 'datestamp' => '20071111010002', 'label' => 'TESTCONF004',
     'reuse' => 1, 'position' => 1, 'comment' => undef },
   { 'datestamp' => '20071110010002', 'label' => 'TESTCONF003',
@@ -73,7 +82,7 @@ $tl_ok = is_deeply($tl,       [
     'reuse' => 1, 'position' => 3, 'comment' => 'comment 2' },
   { 'datestamp' => '20071108010001', 'label' => 'TESTCONF001',
     'reuse' => '', 'position' => 4, 'comment' => 'comment 1' },
-], "A simple tapelist is parsed correctly");
+] }, "A simple tapelist is parsed correctly");
 
 SKIP: {
     skip "Tapelist is parsed incorrectly, so these tests are unlikely to work", 15,
@@ -109,8 +118,8 @@ SKIP: {
        "lookup_tapedate returns undef on an unknown datestamp");
 
     # try some edits
-    $tl->add_tapelabel("20080112010203", "TESTCONF007", "seven");
-    is(scalar @$tl, 5, "add_tapelabel adds a new element to the tapelist");
+    $tl->add_tapelabel("20080112010203", "TESTCONF007", "seven", 1);
+    is(scalar @{$tl->{'tles'}}, 5, "add_tapelabel adds a new element to the tapelist");
 
     is_deeply($tl->lookup_tapepos(1),
        { 'datestamp' => '20080112010203', 'label' => 'TESTCONF007',
@@ -127,8 +136,20 @@ SKIP: {
          'reuse' => 1, 'position' => 1, 'comment' => 'seven' },
        ".. lookup_tapedate finds it");
 
+    # try some edits
+    $tl->add_tapelabel("20080112010204", "TESTCONF008", "eight", 0);
+    is(scalar @{$tl->{'tles'}}, 6, "add_tapelabel adds a new element to the tapelist no-reuse");
+
+    is_deeply($tl->lookup_tapelabel("TESTCONF008"),
+       { 'datestamp' => '20080112010204', 'label' => 'TESTCONF008',
+         'reuse' => 0, 'position' => 1, 'comment' => 'eight' },
+       ".. lookup_tapelabel finds it no-reuse");
+
+    $tl->remove_tapelabel("TESTCONF008");
+    is(scalar @{$tl->{'tles'}}, 5, "remove_tapelabel removes an element from the tapelist, no-reuse");
+
     $tl->remove_tapelabel("TESTCONF002");
-    is(scalar @$tl, 4, "remove_tapelabel removes an element from the tapelist");
+    is(scalar @{$tl->{'tles'}}, 4, "remove_tapelabel removes an element from the tapelist");
 
     is_deeply($tl->lookup_tapepos(4), # used to be in position 5
        { 'datestamp' => '20071108010001', 'label' => 'TESTCONF001',
@@ -167,12 +188,27 @@ SKIP: {
 );
 mktapelist($tapelist, @lines);
 
-$tl = Amanda::Tapelist::read_tapelist($tapelist);
-is_deeply($tl, [
+$tl = Amanda::Tapelist->new($tapelist);
+is_deeply($tl, {
+  filename => $tapelist,
+  lockname => $tapelist . ".lock",
+  tles => [
   { 'datestamp' => '2006123456', 'label' => 'FOO',
     'reuse' => 1, 'position' => 1, 'comment' => undef },
-], "Invalid lines are ignored");
+] }, "Invalid lines are ignored");
 
 # make sure clear_tapelist is empty
-$tl = Amanda::Tapelist::clear_tapelist();
-is_deeply($tl, [ ], "clear_tapelist returns an empty tapelist");
+$tl->clear_tapelist();
+is_deeply($tl, { filename => $tapelist,
+                  lockname => $tapelist . ".lock",
+                 tles => [] }, "clear_tapelist returns an empty tapelist");
+
+$tl->reload();
+is_deeply($tl, {
+  filename => $tapelist,
+  lockname => $tapelist . ".lock",
+  tles => [
+  { 'datestamp' => '2006123456', 'label' => 'FOO',
+    'reuse' => 1, 'position' => 1, 'comment' => undef },
+] }, "reload works");
+
index 2d8e36e10c1fcd6dc36af5476c7b620bba3d69aa..0aeb002014293cca75d8d16a8d911433ccc9601d 100644 (file)
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 10;
+use Test::More tests => 29;
 use File::Path;
 use Data::Dumper;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
@@ -29,7 +30,7 @@ use Amanda::Device qw( :constants );
 use Amanda::Debug;
 use Amanda::Header;
 use Amanda::Xfer;
-use Amanda::Taper::Scribe;
+use Amanda::Taper::Scribe qw( get_splitting_args_from_config );
 use Amanda::MainLoop;
 
 # and disable Debug's die() and warn() overrides
@@ -102,10 +103,18 @@ use Amanda::MainLoop;
 
 sub new {
     my $class = shift;
-    my @slots = @_;
+    my %params = @_;
+    my @slots = @{ $params{'slots'} || [] };
     my $chg =  Amanda::Changer->new("chg-disk:$taperoot");
     die $chg if $chg->isa("Amanda::Changer::Error");
 
+    # wedge in an extra device property to disable LEOM support, if requested
+    if ($params{'disable_leom'}) {
+       $chg->{'config'}->{'device_properties'}->{'leom'}->{'values'} = [ 0 ];
+    } else {
+       $chg->{'config'}->{'device_properties'}->{'leom'}->{'values'} = [ 1 ];
+    }
+
     return bless {
        chg => $chg,
        slots => [ @slots ],
@@ -113,6 +122,10 @@ sub new {
     }, $class;
 }
 
+sub make_new_tape_label {
+    return "FAKELABEL";
+}
+
 sub scan {
     my $self = shift;
     my %params = @_;
@@ -147,6 +160,9 @@ sub scan {
 
 package Mock::Feedback;
 use base qw( Amanda::Taper::Scribe::Feedback );
+use Test::More;
+use Data::Dumper;
+use Installcheck::Config;
 
 sub new {
     my $class = shift;
@@ -161,27 +177,37 @@ sub request_volume_permission {
     my %params = @_;
     my $answer = shift @{$self->{'rq_answers'}};
     main::event("request_volume_permission", "answer:", $answer);
-    $params{'perm_cb'}->($answer);
+    $main::scribe->start_scan();
+    $params{'perm_cb'}->(%{$answer});
 }
 
-sub notif_new_tape {
+sub scribe_notif_new_tape {
     my $self = shift;
     my %params = @_;
 
-    main::event("notif_new_tape",
+    main::event("scribe_notif_new_tape",
        main::undef_or_str($params{'error'}), $params{'volume_label'});
 }
 
-sub notif_part_done {
+sub scribe_notif_part_done {
     my $self = shift;
     my %params = @_;
 
     # this omits $duration, as it's not constant
-    main::event("notif_part_done",
+    main::event("scribe_notif_part_done",
        $params{'partnum'}, $params{'fileno'},
        $params{'successful'}, $params{'size'});
 }
 
+sub scribe_notif_tape_done {
+    my $self = shift;
+    my %params = @_;
+
+    main::event("scribe_notif_tape_done",
+       $params{'volume_label'}, $params{'num_files'},
+       $params{'size'});
+}
+
 
 ##
 ## test DevHandling
@@ -189,6 +215,8 @@ sub notif_part_done {
 
 package main;
 
+my $scribe;
+
 # utility fn to stringify changer errors (earlier perls' Test::More's
 # fail to do this automatically)
 sub undef_or_str { (defined $_[0])? "".$_[0] : undef; }
@@ -199,9 +227,10 @@ sub run_devh {
     reset_events();
 
     reset_taperoot($nruns);
-    $devh = Amanda::Taper::Scribe::DevHandling->new(
+    $main::scribe = Amanda::Taper::Scribe->new(
        taperscan => $taperscan,
        feedback => $feedback);
+    $devh = $main::scribe->{'devhandling'};
 
     my ($start, $get_volume, $got_volume, $quit);
 
@@ -228,14 +257,15 @@ sub run_devh {
     });
 
     $got_volume = make_cb(got_volume => sub {
-       my ($scan_error, $request_denied_reason, $reservation, $volume_label, $access_mode) = @_;
+       my ($scan_error, $config_denial_message, $error_denial_message,
+           $reservation, $volume_label, $access_mode) = @_;
 
        event("got_volume",
            undef_or_str($scan_error),
-           $request_denied_reason,
+           $config_denial_message, $error_denial_message,
            $reservation? ("slot: ".$reservation->{'this_slot'}) : undef);
 
-       if ($scan_error or $request_denied_reason) {
+       if ($scan_error or $config_denial_message or $error_denial_message) {
            $quit->();
            return;
        }
@@ -261,72 +291,87 @@ sub run_devh {
 }
 
 reset_taperoot(1);
-run_devh(3, Mock::Taperscan->new(), Mock::Feedback->new());
+run_devh(3, Mock::Taperscan->new(), Mock::Feedback->new({allow => 1}, {allow => 1}, {allow => 1}));
 is_deeply([ @events ], [
       [ 'start' ],
       [ 'scan' ], # scan starts *before* get_volume
 
       [ 'get_volume' ],
-      [ 'request_volume_permission', 'answer:', undef ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 }, ],
       [ 'scan-finished', undef, "slot: 1" ],
-      [ 'got_volume', undef, undef, "slot: 1" ],
+      [ 'got_volume', undef, undef, undef, "slot: 1" ],
       [ 'release', undef ],
 
       [ 'get_volume' ],
-      [ 'scan' ], # scan starts *after* get_volume this time
-      [ 'request_volume_permission', 'answer:', undef ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scan' ], # scan starts *after* request_volume_permission
       [ 'scan-finished', undef, "slot: 2" ],
-      [ 'got_volume', undef, undef, "slot: 2" ],
+      [ 'got_volume', undef, undef, undef, "slot: 2" ],
       [ 'release', undef ],
 
       [ 'get_volume' ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
       [ 'scan' ],
-      [ 'request_volume_permission', 'answer:', undef ],
       [ 'scan-finished', undef, "slot: 3" ],
-      [ 'got_volume', undef, undef, "slot: 3" ],
+      [ 'got_volume', undef, undef, undef, "slot: 3" ],
       [ 'release', undef ],
 
       [ 'quit' ],
     ], "correct event sequence for basic run of DevHandling")
     or diag(Dumper([@events]));
 
-run_devh(1, Mock::Taperscan->new(), Mock::Feedback->new('no-can-do'));
+run_devh(1, Mock::Taperscan->new(), Mock::Feedback->new({cause => 'config', message => 'no-can-do'}));
 is_deeply([ @events ], [
       [ 'start' ],
       [ 'scan' ],
 
       [ 'get_volume' ],
-      [ 'request_volume_permission', 'answer:', 'no-can-do' ],
+      [ 'request_volume_permission', 'answer:', { cause => 'config', message => 'no-can-do' } ],
       [ 'scan-finished', undef, "slot: 1" ],
-      [ 'got_volume', undef, 'no-can-do', undef ],
+      [ 'got_volume', undef, 'no-can-do', undef, undef ],
 
       [ 'quit' ],
     ], "correct event sequence for a run without permission")
     or diag(Dumper([@events]));
 
-run_devh(1, Mock::Taperscan->new("bogus"), Mock::Feedback->new());
+run_devh(1, Mock::Taperscan->new(slots => ["bogus"]), Mock::Feedback->new({allow => 1}));
 is_deeply([ @events ], [
       [ 'start' ],
       [ 'scan' ],
 
       [ 'get_volume' ],
-      [ 'request_volume_permission', 'answer:', undef ],
+      [ 'request_volume_permission', 'answer:', { allow => 1} ],
       [ 'scan-finished', "Slot bogus not found", "slot: none" ],
-      [ 'got_volume', 'Slot bogus not found', undef, undef ],
+      [ 'got_volume', 'Slot bogus not found', undef, undef, undef ],
 
       [ 'quit' ],
     ], "correct event sequence for a run with a changer error")
     or diag(Dumper([@events]));
 
-run_devh(1, Mock::Taperscan->new("bogus"), Mock::Feedback->new("not this time"));
+run_devh(1, Mock::Taperscan->new(slots => ["bogus"]),
+           Mock::Feedback->new({cause => 'config', message => "not this time"}));
+is_deeply([ @events ], [
+      [ 'start' ],
+      [ 'scan' ],
+
+      [ 'get_volume' ],
+      [ 'request_volume_permission', 'answer:', {cause => 'config', message =>'not this time'} ],
+      [ 'scan-finished', "Slot bogus not found", "slot: none" ],
+      [ 'got_volume', 'Slot bogus not found', 'not this time', undef, undef ],
+
+      [ 'quit' ],
+    ], "correct event sequence for a run with no permission AND a changer config denial")
+    or diag(Dumper([@events]));
+
+run_devh(1, Mock::Taperscan->new(slots => ["bogus"]), Mock::Feedback->new({cause => 'error', message => "frobnicator exploded!"}));
 is_deeply([ @events ], [
       [ 'start' ],
       [ 'scan' ],
 
       [ 'get_volume' ],
-      [ 'request_volume_permission', 'answer:', 'not this time' ],
+      [ 'request_volume_permission', 'answer:', {cause => 'error', message => "frobnicator exploded!"} ],
       [ 'scan-finished', "Slot bogus not found", "slot: none" ],
-      [ 'got_volume', 'Slot bogus not found', 'not this time', undef ],
+      [ 'got_volume', 'Slot bogus not found', undef, "frobnicator exploded!", undef ],
 
       [ 'quit' ],
     ], "correct event sequence for a run with no permission AND a changer error")
@@ -360,9 +405,8 @@ sub run_scribe_xfer_async {
        # set up a transfer
        my $xdt = $scribe->get_xfer_dest(
            max_memory => 1024 * 64,
-            split_method => ($params{'split_method'} or 'memory'),
-           part_size => 1024 * 128,
-           use_mem_cache => 1,
+           part_size => (defined $params{'part_size'})? $params{'part_size'} : (1024 * 128),
+            part_cache_type => $params{'part_cache_type'} || 'memory',
            disk_cache_dirname => undef);
 
         die "$err" if $err;
@@ -396,7 +440,8 @@ sub run_scribe_xfer_async {
 
        main::event("dump_cb",
            $params{'result'},
-           [ map { undef_or_str($_) } @{ $params{'device_errors'} } ],
+           [ map { "$_" } @{$params{'device_errors'}} ],
+           $params{'config_denial_message'},
            $params{'size'});
 
        $finished_cb->();
@@ -425,43 +470,71 @@ sub quit_scribe {
     Amanda::MainLoop::run();
 }
 
-my $scribe;
 my $experr;
 
-# write less than a tape full
+# write less than a tape full, without LEOM
 
 reset_taperoot(1);
-$scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(),
-    feedback => Mock::Feedback->new());
+$main::scribe = Amanda::Taper::Scribe->new(
+    taperscan => Mock::Taperscan->new(disable_leom => 1),
+    feedback => Mock::Feedback->new({allow => 1}));
 
 reset_events();
-run_scribe_xfer(1024*300, $scribe,
-           start_scribe => { dump_timestamp => "20010203040506" });
+run_scribe_xfer(1024*200, $main::scribe,
+           part_size => 96*1024,
+           start_scribe => { write_timestamp => "20010203040506" });
 
 is_deeply([ @events ], [
       [ 'scan' ],
       [ 'scan-finished', undef, 'slot: 1' ],
-      [ 'request_volume_permission', 'answer:', undef ],
-      [ 'notif_new_tape', undef, 'FAKELABEL' ],
-      [ 'notif_part_done', bi(1), bi(1), 1, bi(131072) ],
-      [ 'notif_part_done', bi(2), bi(2), 1, bi(131072) ],
-      [ 'notif_part_done', bi(3), bi(3), 1, bi(45056) ],
-      [ 'dump_cb', 'DONE', [], bi(307200) ],
-    ], "correct event sequence for a multipart scribe of less than a whole volume")
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
+      [ 'scribe_notif_part_done', bi(1), bi(1), 1, bi(98304) ],
+      [ 'scribe_notif_part_done', bi(2), bi(2), 1, bi(98304) ],
+      [ 'scribe_notif_part_done', bi(3), bi(3), 1, bi(8192) ],
+      [ 'dump_cb', 'DONE', [], undef, bi(204800) ],
+    ], "correct event sequence for a multipart scribe of less than a whole volume, without LEOM")
     or diag(Dumper([@events]));
 
-# pick up where we left off, writing just a tiny bit more
+# pick up where we left off, writing just a tiny bit more, and then quit
 reset_events();
-run_scribe_xfer(1024*30, $scribe);
+run_scribe_xfer(1024*30, $main::scribe);
+
+quit_scribe($main::scribe);
 
 is_deeply([ @events ], [
-      [ 'notif_part_done', bi(1), bi(4), 1, bi(30720) ],
-      [ 'dump_cb', 'DONE', [], bi(30720) ],
+      [ 'scribe_notif_part_done', bi(1), bi(4), 1, bi(30720) ],
+      [ 'dump_cb', 'DONE', [], undef, bi(30720) ],
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(4), bi(235520) ],
     ], "correct event sequence for a subsequent single-part scribe, still on the same volume")
     or diag(Dumper([@events]));
 
-quit_scribe($scribe);
+# write less than a tape full, *with* LEOM (should look the same as above)
+
+reset_taperoot(1);
+$main::scribe = Amanda::Taper::Scribe->new(
+    taperscan => Mock::Taperscan->new(),
+    feedback => Mock::Feedback->new({ allow => 1 }));
+
+reset_events();
+run_scribe_xfer(1024*200, $main::scribe,
+           part_size => 96*1024,
+           start_scribe => { write_timestamp => "20010203040506" });
+
+quit_scribe($main::scribe);
+
+is_deeply([ @events ], [
+      [ 'scan' ],
+      [ 'scan-finished', undef, 'slot: 1' ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
+      [ 'scribe_notif_part_done', bi(1), bi(1), 1, bi(98304) ],
+      [ 'scribe_notif_part_done', bi(2), bi(2), 1, bi(98304) ],
+      [ 'scribe_notif_part_done', bi(3), bi(3), 1, bi(8192) ],
+      [ 'dump_cb', 'DONE', [], undef, bi(204800) ],
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(3), bi(204800) ],
+    ], "correct event sequence for a multipart scribe of less than a whole volume, with LEOM")
+    or diag(Dumper([@events]));
 
 # start over again and try a multivolume write
 #
@@ -470,129 +543,356 @@ quit_scribe($scribe);
 # data.  This is a much less common error path, so it's good to test it.
 
 reset_taperoot(2);
-$scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(),
-    feedback => Mock::Feedback->new());
+$main::scribe = Amanda::Taper::Scribe->new(
+    taperscan => Mock::Taperscan->new(disable_leom => 1),
+    feedback => Mock::Feedback->new({ allow => 1 }, { allow => 1 }));
 
 reset_events();
-run_scribe_xfer($volume_length + $volume_length / 4, $scribe,
-           start_scribe => { dump_timestamp => "20010203040506" });
+run_scribe_xfer($volume_length + $volume_length / 4, $main::scribe,
+           start_scribe => { write_timestamp => "20010203040506" });
+
+quit_scribe($main::scribe);
 
 is_deeply([ @events ], [
       [ 'scan' ],
       [ 'scan-finished', undef, 'slot: 1' ],
-      [ 'request_volume_permission', 'answer:', undef ],
-      [ 'notif_new_tape', undef, 'FAKELABEL' ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
 
-      [ 'notif_part_done', bi(1), bi(1), 1, bi(131072) ],
-      [ 'notif_part_done', bi(2), bi(2), 1, bi(131072) ],
-      [ 'notif_part_done', bi(3), bi(3), 1, bi(131072) ],
-      [ 'notif_part_done', bi(4), bi(0), 0, bi(0) ],
+      [ 'scribe_notif_part_done', bi(1), bi(1), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(2), bi(2), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(3), bi(3), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(4), bi(0), 0, bi(0) ],
 
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(3), bi(393216) ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
       [ 'scan' ],
-      [ 'request_volume_permission', 'answer:', undef ],
       [ 'scan-finished', undef, 'slot: 2' ],
-      [ 'notif_new_tape', undef, 'FAKELABEL' ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
 
-      [ 'notif_part_done', bi(4), bi(1), 1, bi(131072) ],
-      [ 'notif_part_done', bi(5), bi(2), 1, bi(131072) ],
-      # empty part is written but not notified
+      [ 'scribe_notif_part_done', bi(4), bi(1), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(5), bi(2), 1, bi(131072) ],
+      # empty part is written but not notified, although it is counted
+      # in scribe_notif_tape_done
 
-      [ 'dump_cb', 'DONE', [], bi(655360) ],
-    ], "correct event sequence for a multipart scribe of more than a whole volume")
+      [ 'dump_cb', 'DONE', [], undef, bi(655360) ],
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(3), bi(262144) ],
+    ], "correct event sequence for a multipart scribe of more than a whole volume, without LEOM")
     or print (Dumper([@events]));
 
-quit_scribe($scribe);
+# same test, but with LEOM support
+
+reset_taperoot(2);
+$main::scribe = Amanda::Taper::Scribe->new(
+    taperscan => Mock::Taperscan->new(),
+    feedback => Mock::Feedback->new({ allow => 1 },{ allow => 1 }));
+
+reset_events();
+run_scribe_xfer(1024*520, $main::scribe,
+           start_scribe => { write_timestamp => "20010203040506" });
+
+quit_scribe($main::scribe);
+
+is_deeply([ @events ], [
+      [ 'scan' ],
+      [ 'scan-finished', undef, 'slot: 1' ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
+
+      [ 'scribe_notif_part_done', bi(1), bi(1), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(2), bi(2), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(3), bi(3), 1, bi(32768) ], # LEOM comes earlier than PEOM did
+
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(3), bi(294912) ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scan' ],
+      [ 'scan-finished', undef, 'slot: 2' ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
+
+      [ 'scribe_notif_part_done', bi(4), bi(1), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(5), bi(2), 1, bi(106496) ],
+
+      [ 'dump_cb', 'DONE', [], undef, bi(532480) ],
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(2), bi(237568) ],
+    ], "correct event sequence for a multipart scribe of more than a whole volume, with LEOM")
+    or print (Dumper([@events]));
 
 # now a multivolume write where the second volume gives a changer error
 
 reset_taperoot(1);
-$scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new("1", "bogus"),
-    feedback => Mock::Feedback->new());
+$main::scribe = Amanda::Taper::Scribe->new(
+    taperscan => Mock::Taperscan->new(slots => ["1", "bogus"], disable_leom => 1),
+    feedback => Mock::Feedback->new({ allow => 1 },{ allow => 1 }));
 
 reset_events();
-run_scribe_xfer($volume_length + $volume_length / 4, $scribe,
-           start_scribe => { dump_timestamp => "20010203040507" });
+run_scribe_xfer($volume_length + $volume_length / 4, $main::scribe,
+           start_scribe => { write_timestamp => "20010203040507" });
+
+quit_scribe($main::scribe);
 
 $experr = 'Slot bogus not found';
 is_deeply([ @events ], [
       [ 'scan' ],
       [ 'scan-finished', undef, 'slot: 1' ],
-      [ 'request_volume_permission', 'answer:', undef ],
-      [ 'notif_new_tape', undef, 'FAKELABEL' ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
 
-      [ 'notif_part_done', bi(1), bi(1), 1, bi(131072) ],
-      [ 'notif_part_done', bi(2), bi(2), 1, bi(131072) ],
-      [ 'notif_part_done', bi(3), bi(3), 1, bi(131072) ],
-      [ 'notif_part_done', bi(4), bi(0), 0, bi(0) ],
+      [ 'scribe_notif_part_done', bi(1), bi(1), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(2), bi(2), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(3), bi(3), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(4), bi(0), 0, bi(0) ],
 
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(3), bi(393216) ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
       [ 'scan' ],
-      [ 'request_volume_permission', 'answer:', undef ],
       [ 'scan-finished', $experr, 'slot: none' ],
-      [ 'notif_new_tape', $experr, undef ],
+      [ 'scribe_notif_new_tape', $experr, undef ],
 
-      [ 'dump_cb', 'PARTIAL', [$experr], bi(393216) ],
-    ], "correct event sequence for a multivolume scribe where the second volume isn't found")
+      [ 'dump_cb', 'PARTIAL', [$experr], undef, bi(393216) ],
+      # (no scribe_notif_tape_done)
+    ], "correct event sequence for a multivolume scribe with no second vol, without LEOM")
     or print (Dumper([@events]));
 
-quit_scribe($scribe);
+reset_taperoot(1);
+$main::scribe = Amanda::Taper::Scribe->new(
+    taperscan => Mock::Taperscan->new(slots => ["1", "bogus"]),
+    feedback => Mock::Feedback->new({ allow => 1 }, { allow => 1 }));
+
+reset_events();
+run_scribe_xfer($volume_length + $volume_length / 4, $main::scribe,
+           start_scribe => { write_timestamp => "20010203040507" });
+
+quit_scribe($main::scribe);
+
+$experr = 'Slot bogus not found';
+is_deeply([ @events ], [
+      [ 'scan' ],
+      [ 'scan-finished', undef, 'slot: 1' ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
+
+      [ 'scribe_notif_part_done', bi(1), bi(1), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(2), bi(2), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(3), bi(3), 1, bi(32768) ], # LEOM comes long before PEOM
+
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(3), bi(294912) ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scan' ],
+      [ 'scan-finished', $experr, 'slot: none' ],
+      [ 'scribe_notif_new_tape', $experr, undef ],
+
+      [ 'dump_cb', 'PARTIAL', [$experr], undef, bi(294912) ],
+      # (no scribe_notif_tape_done)
+    ], "correct event sequence for a multivolume scribe with no second vol, with LEOM")
+    or print (Dumper([@events]));
 
 # now a multivolume write where the second volume does not have permission
 
 reset_taperoot(2);
-$scribe = Amanda::Taper::Scribe->new(
+$main::scribe = Amanda::Taper::Scribe->new(
     taperscan => Mock::Taperscan->new(),
-    feedback => Mock::Feedback->new(undef, "sorry!"));
+    feedback => Mock::Feedback->new({ allow => 1 }, { cause => 'config', message => "sorry!" }));
 
 reset_events();
-run_scribe_xfer($volume_length + $volume_length / 4, $scribe,
-           start_scribe => { dump_timestamp => "20010203040507" });
+run_scribe_xfer($volume_length + $volume_length / 4, $main::scribe,
+           start_scribe => { write_timestamp => "20010203040507" });
+
+quit_scribe($main::scribe);
 
 is_deeply([ @events ], [
       [ 'scan' ],
       [ 'scan-finished', undef, 'slot: 1' ],
-      [ 'request_volume_permission', 'answer:', undef ],
-      [ 'notif_new_tape', undef, 'FAKELABEL' ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
 
-      [ 'notif_part_done', bi(1), bi(1), 1, bi(131072) ],
-      [ 'notif_part_done', bi(2), bi(2), 1, bi(131072) ],
-      [ 'notif_part_done', bi(3), bi(3), 1, bi(131072) ],
-      [ 'notif_part_done', bi(4), bi(0), 0, bi(0) ],
+      [ 'scribe_notif_part_done', bi(1), bi(1), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(2), bi(2), 1, bi(131072) ],
+      [ 'scribe_notif_part_done', bi(3), bi(3), 1, bi(32768) ],
 
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(3), bi(294912) ],
+      [ 'request_volume_permission', 'answer:', { cause => 'config', message => "sorry!" } ],
       [ 'scan' ],
-      [ 'request_volume_permission', 'answer:', "sorry!" ],
       [ 'scan-finished', undef, 'slot: 2' ],
 
-      [ 'dump_cb', 'PARTIAL', ["sorry!"], bi(393216) ],
-    ], "correct event sequence for a multivolume scribe where the second volume isn't permitted")
+      [ 'dump_cb', 'PARTIAL', [], "sorry!", bi(294912) ],
+    ], "correct event sequence for a multivolume scribe with next vol denied")
     or print (Dumper([@events]));
 
-quit_scribe($scribe);
-
 # a non-splitting xfer on a single volume
 
 reset_taperoot(2);
-$scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(),
-    feedback => Mock::Feedback->new());
+$main::scribe = Amanda::Taper::Scribe->new(
+    taperscan => Mock::Taperscan->new(disable_leom => 1),
+    feedback => Mock::Feedback->new({ allow => 1 }));
 
 reset_events();
-run_scribe_xfer(1024*300, $scribe, split_method => 'none',
-           start_scribe => { dump_timestamp => "20010203040506" });
+run_scribe_xfer(1024*300, $main::scribe, part_size => 0, part_cache_type => 'none',
+           start_scribe => { write_timestamp => "20010203040506" });
+
+quit_scribe($main::scribe);
 
 is_deeply([ @events ], [
       [ 'scan' ],
       [ 'scan-finished', undef, 'slot: 1' ],
-      [ 'request_volume_permission', 'answer:', undef ],
-      [ 'notif_new_tape', undef, 'FAKELABEL' ],
-      [ 'notif_part_done', bi(1), bi(1), 1, bi(307200) ],
-      [ 'dump_cb', 'DONE', [], bi(307200) ],
-    ], "correct event sequence for a non-splitting scribe of less than a whole volume")
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
+      [ 'scribe_notif_part_done', bi(1), bi(1), 1, bi(307200) ],
+      [ 'dump_cb', 'DONE', [], undef, bi(307200) ],
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(1), bi(307200) ],
+    ], "correct event sequence for a non-splitting scribe of less than a whole volume, without LEOM")
     or diag(Dumper([@events]));
 
-quit_scribe($scribe);
+reset_taperoot(2);
+$main::scribe = Amanda::Taper::Scribe->new(
+    taperscan => Mock::Taperscan->new(),
+    feedback => Mock::Feedback->new({ allow => 1 }));
+$Amanda::Config::debug_taper = 9;
+reset_events();
+run_scribe_xfer(1024*300, $main::scribe, part_size => 0, part_cache_type => 'none',
+           start_scribe => { write_timestamp => "20010203040506" });
+
+quit_scribe($main::scribe);
+
+is_deeply([ @events ], [
+      [ 'scan' ],
+      [ 'scan-finished', undef, 'slot: 1' ],
+      [ 'request_volume_permission', 'answer:', { allow => 1 } ],
+      [ 'scribe_notif_new_tape', undef, 'FAKELABEL' ],
+      [ 'scribe_notif_part_done', bi(1), bi(1), 1, bi(307200) ],
+      [ 'dump_cb', 'DONE', [], undef, bi(307200) ],
+      [ 'scribe_notif_tape_done', 'FAKELABEL', bi(1), bi(307200) ],
+    ], "correct event sequence for a non-splitting scribe of less than a whole volume, with LEOM")
+    or diag(Dumper([@events]));
 
 # DirectTCP support is tested through the taper installcheck
 
+# test get_splitting_args_from_config thoroughly
+my $maxint64 = Math::BigInt->new("9223372036854775808");
+
+is_deeply(
+    { get_splitting_args_from_config(
+    ) },
+    { },
+    "default is no params");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       dle_tape_splitsize => 0,
+       dle_split_diskbuffer => $Installcheck::TMP,
+       dle_fallback_splitsize => 100,
+    ) },
+    { part_size => 0, part_cache_type => 'none' },
+    "tape_splitsize = 0 indicates no splitting");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       dle_allow_split => 0,
+       part_size => 100,
+       part_cache_dir => "/tmp",
+    ) },
+    { },
+    "default if dle_allow_split is false, no splitting");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       dle_tape_splitsize => 200,
+       dle_fallback_splitsize => 150,
+    ) },
+    { part_cache_type => 'memory', part_size => 200, part_cache_max_size => 150 },
+    "when cache_inform is available, tape_splitsize is used, not fallback");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       dle_tape_splitsize => 200,
+    ) },
+    { part_size => 200, part_cache_type => 'memory', part_cache_max_size => 1024*1024*10, },
+    "no split_diskbuffer and no fallback_splitsize, fall back to default (10M)");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       dle_tape_splitsize => 200,
+       dle_split_diskbuffer => "$Installcheck::TMP/does!not!exist!",
+       dle_fallback_splitsize => 150,
+    ) },
+    { part_size => 200, part_cache_type => 'memory', part_cache_max_size => 150 },
+    "invalid split_diskbuffer => fall back (silently)");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       dle_tape_splitsize => 200,
+       dle_split_diskbuffer => "$Installcheck::TMP/does!not!exist!",
+    ) },
+    { part_size => 200, part_cache_type => 'memory', part_cache_max_size => 1024*1024*10 },
+    ".. even to the default fallback (10M)");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       dle_tape_splitsize => $maxint64,
+       dle_split_diskbuffer => "$Installcheck::TMP",
+       dle_fallback_splitsize => 250,
+    ) },
+    { part_size => $maxint64, part_cache_type => 'memory', part_cache_max_size => 250,
+      warning => "falling back to memory buffer for splitting: " .
+                "insufficient space in disk cache directory" },
+    "not enough space in split_diskbuffer => fall back (with warning)");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       can_cache_inform => 0,
+       dle_tape_splitsize => 200,
+       dle_split_diskbuffer => "$Installcheck::TMP",
+       dle_fallback_splitsize => 150,
+    ) },
+    { part_size => 200, part_cache_type => 'disk', part_cache_dir => "$Installcheck::TMP" },
+    "if split_diskbuffer exists and splitsize is nonzero, use it");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       dle_tape_splitsize => 0,
+       dle_split_diskbuffer => "$Installcheck::TMP",
+       dle_fallback_splitsize => 250,
+    ) },
+    { part_size => 0, part_cache_type => 'none' },
+    ".. but if splitsize is zero, no splitting");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       dle_split_diskbuffer => "$Installcheck::TMP",
+       dle_fallback_splitsize => 250,
+    ) },
+    { part_size => 0, part_cache_type => 'none' },
+    ".. and if splitsize is missing, no splitting");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       part_size => 300,
+       part_cache_type => 'none',
+    ) },
+    { part_size => 300, part_cache_type => 'none' },
+    "part_* parameters handled correctly when missing");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       part_size => 300,
+       part_cache_type => 'disk',
+       part_cache_dir => $Installcheck::TMP,
+       part_cache_max_size => 250,
+    ) },
+    { part_size => 300, part_cache_type => 'disk',
+      part_cache_dir => $Installcheck::TMP, part_cache_max_size => 250, },
+    "part_* parameters handled correctly when specified");
+
+is_deeply(
+    { get_splitting_args_from_config(
+       part_size => 300,
+       part_cache_type => 'disk',
+       part_cache_dir => "$Installcheck::TMP/does!not!exist!",
+       part_cache_max_size => 250,
+    ) },
+    { part_size => 300, part_cache_type => 'none',
+      part_cache_max_size => 250,
+      warning => "part-cache-dir '$Installcheck::TMP/does!not!exist! does not exist; "
+              . "using part cache type 'none'"},
+    "part_* parameters handled correctly when specified");
+
 rmtree($taperoot);
index 3551927563b0356d6f69d0f147baaac7ce032e98..352e2574d335e075b38579bb770bcb6e3cbb69ee 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 114;
+use Test::More tests => 130;
 
 use lib "@amperldir@";
 use warnings;
@@ -95,13 +95,37 @@ for my $a (keys %unquote_checks) {
     }
 }
 
-{
-    my ($a, $b) = Amanda::Util::skip_quoted_string("foobar");
-    is($a, "foobar",
-       "skip_quoted_string with one quoted string (first argument)");
-    is($b, undef,
-       "skip_quoted_string with one quoted string (second argument)");
-}
+is_deeply([ Amanda::Util::skip_quoted_string("foobar") ],
+         [ "foobar", undef ],
+   "skip_quoted_string with one quoted string");
+
+is_deeply([ Amanda::Util::skip_quoted_string("foo  bar") ],
+         [ "foo", " bar" ],
+   "skip_quoted_string with two spaces keeps second space");
+
+is_deeply([ Amanda::Util::skip_quoted_string("foo\tbar") ],
+         [ "foo", "bar" ],
+   "skip_quoted_string with a tab still splits");
+
+is_deeply([ Amanda::Util::split_quoted_string_friendly("a b c d") ],
+         [ qw(a b c d) ],
+         "split_quoted_string_friendly with a basic split");
+
+is_deeply([ Amanda::Util::split_quoted_string_friendly("\ta   b\nc \t \td   ") ],
+         [ qw(a b c d) ],
+         "split_quoted_string_friendly with extra whitespace");
+
+is_deeply([ Amanda::Util::split_quoted_string_friendly("") ],
+         [ ],
+         "split_quoted_string_friendly with empty string");
+
+is_deeply([ Amanda::Util::split_quoted_string_friendly("\n\t ") ],
+         [ ],
+         "split_quoted_string_friendly with just whitespace");
+
+is_deeply([ Amanda::Util::split_quoted_string_friendly("\n\"hi there\"\t ") ],
+         [ 'hi there' ],
+         "split_quoted_string_friendly with one string (containing whitespace)");
 
 my @try_bracing = (
     [ 'abc' ],
@@ -126,6 +150,56 @@ for my $strs (@try_bracing) {
              "round-trip of " . Dumper($strs));
 }
 
+is_deeply(
+    [ Amanda::Util::expand_braced_alternates("t{0..3,5}") ],
+    [ qw(t0 t1 t2 t3 t5) ],
+    "expand_braced_alternates('t{0..3,5}')");
+
+is_deeply(
+    [ Amanda::Util::expand_braced_alternates("t{13..12}") ],
+    [ qw(t13..12) ],
+    "expand_braced_alternates('t{13..12}') (sequence not parsed)");
+
+is_deeply(
+    [ Amanda::Util::expand_braced_alternates("t{999..999}") ],
+    [ qw(t999) ],
+    "expand_braced_alternates('t{999..999}')");
+
+is_deeply(
+    [ Amanda::Util::expand_braced_alternates("t{0..3}") ],
+    [ qw(t0 t1 t2 t3) ],
+    "expand_braced_alternates('t{0..3}')");
+
+is_deeply(
+    [ Amanda::Util::expand_braced_alternates("t{10..13}") ],
+    [ qw(t10 t11 t12 t13) ],
+    "expand_braced_alternates('t{10..13}')");
+
+is_deeply(
+    [ Amanda::Util::expand_braced_alternates("t{9..13}") ],
+    [ qw(t9 t10 t11 t12 t13) ],
+    "expand_braced_alternates('t{9..13}')");
+
+is_deeply(
+    [ Amanda::Util::expand_braced_alternates("t{09..13}") ],
+    [ qw(t09 t10 t11 t12 t13) ],
+    "expand_braced_alternates('t{09..13}')");
+
+is_deeply(
+    [ Amanda::Util::expand_braced_alternates("t{009..13}") ],
+    [ qw(t009 t010 t011 t012 t013) ],
+    "expand_braced_alternates('t{009..13}') (ldigits > rdigits)");
+
+is_deeply(
+    [ sort(+Amanda::Util::expand_braced_alternates("x{001..004}y{1..2}z")) ],
+    [ sort(qw( x001y1z x002y1z x003y1z x004y1z x001y2z x002y2z x003y2z x004y2z )) ],
+    "expand_braced_alternates('x{001..004}y{1..2}z')");
+
+is_deeply(
+    [ Amanda::Util::expand_braced_alternates("t{1..100}e") ],
+    [ map { "t$_"."e" } (1 .. 100) ],
+    "expand_braced_alternates('t{1..100}e')");
+
 my @try_sanitise = (
     [ '', '' ],
     [ 'foo', 'foo' ],
@@ -246,7 +320,8 @@ DONE taper somebox /lib 20080111 1 0 [sec 4.813543 kb 419 kps 87.133307]
 FINISH driver date 20080111 time 2167.581
 EOF
 
-ok(safe_overwrite_file($burp_corpus_fname, $sof_data));
+ok(safe_overwrite_file($burp_corpus_fname, $sof_data),
+    "safe_overwrite_file success");
 is(slurp($burp_corpus_fname), $sof_data,
     "safe_overwrite_file round-trip check");
 
index da845b378b067e451d2ada4ef289d5e54bda9ddc..e2359b7e2403adf478e64e2a897cea5108bd739a 100644 (file)
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 37;
+use Test::More tests => 46;
 use File::Path;
 use Data::Dumper;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
@@ -266,9 +267,9 @@ pass("Two simultaneous transfers run to completion");
     my $xfer = Amanda::Xfer->new([
        Amanda::Xfer::Source::Random->new(1024*1024, $RANDOM_SEED),
        Amanda::Xfer::Filter::Process->new(
-           [ $Amanda::Constants::COMPRESS_PATH, $Amanda::Constants::COMPRESS_BEST_OPT ], 0),
+           [ $Amanda::Constants::COMPRESS_PATH, $Amanda::Constants::COMPRESS_BEST_OPT ], 0, 1),
        Amanda::Xfer::Filter::Process->new(
-           [ $Amanda::Constants::UNCOMPRESS_PATH, $Amanda::Constants::UNCOMPRESS_OPT ], 0),
+           [ $Amanda::Constants::UNCOMPRESS_PATH, $Amanda::Constants::UNCOMPRESS_OPT ], 0, 1),
        Amanda::Xfer::Dest::Null->new($RANDOM_SEED),
     ]);
 
@@ -298,7 +299,7 @@ pass("Two simultaneous transfers run to completion");
     my $xfer = Amanda::Xfer->new([
        Amanda::Xfer::Source::Fd->new($zerofd),
        Amanda::Xfer::Filter::Process->new(
-           [ $Amanda::Constants::COMPRESS_PATH, $Amanda::Constants::COMPRESS_BEST_OPT ], 0),
+           [ $Amanda::Constants::COMPRESS_PATH, $Amanda::Constants::COMPRESS_BEST_OPT ], 0, 1),
        Amanda::Xfer::Dest::Null->new(0),
     ]);
 
@@ -373,7 +374,7 @@ pass("Two simultaneous transfers run to completion");
 }
 
 SKIP: {
-    skip "not built with server", 17 unless Amanda::Util::built_with_component("server");
+    skip "not built with server", 25 unless Amanda::Util::built_with_component("server");
 
     my $disk_cache_dir = "$Installcheck::TMP";
     my $RANDOM_SEED = 0xFACADE;
@@ -415,7 +416,7 @@ SKIP: {
 
        $xfer = Amanda::Xfer->new([
            Amanda::Xfer::Source::Random->new(1024*1024, $RANDOM_SEED),
-           Amanda::Xfer::Dest::Device->new($device, $device->block_size() * 10),
+           Amanda::Xfer::Dest::Device->new($device, 0),
        ]);
 
        $xfer->start($quit_cb);
@@ -467,15 +468,16 @@ SKIP: {
        $device = Amanda::Device->new("file:" . Installcheck::Run::load_vtape($vtape_num++));
        die("Could not open VFS device: " . $device->error())
            unless ($device->status() == $Amanda::Device::DEVICE_STATUS_SUCCESS);
-       $device->start($Amanda::Device::ACCESS_WRITE, "TESTCONF01", "20080102030405");
        $device->property_set("MAX_VOLUME_USAGE", 1024*1024*2.5);
+       $device->property_set("LEOM", $params{'disable_leom'}? 0 : 1);
+       $device->start($Amanda::Device::ACCESS_WRITE, "TESTCONF01", "20080102030405");
        my $dest = $dest_sub->($device);
 
        # and create the xfer
        $xfer = Amanda::Xfer->new([ $src, $dest ]);
 
        my $start_new_part = sub {
-           my ($successful, $eof, $partnum) = @_;
+           my ($successful, $eof, $partnum, $eom) = @_;
 
            if (exists $params{'cancel_after_partnum'}
                    and $params{'cancel_after_partnum'} == $partnum) {
@@ -484,15 +486,16 @@ SKIP: {
                return;
            }
 
-           if (!$device || !$successful) {
+           if (!$device || $eom) {
                # set up a device and start writing a part to it
                $device->finish() if $device;
                $device = Amanda::Device->new("file:" . Installcheck::Run::load_vtape($vtape_num++));
                die("Could not open VFS device: " . $device->error())
                    unless ($device->status() == $Amanda::Device::DEVICE_STATUS_SUCCESS);
                $dest->use_device($device);
-               $device->start($Amanda::Device::ACCESS_WRITE, "TESTCONF01", "20080102030405");
+               $device->property_set("LEOM", $params{'disable_leom'}? 0 : 1);
                $device->property_set("MAX_VOLUME_USAGE", 1024*1024*2.5);
+               $device->start($Amanda::Device::ACCESS_WRITE, "TESTCONF01", "20080102030405");
            }
 
            # bail out if we shouldn't retry this part
@@ -518,7 +521,8 @@ SKIP: {
                die $msg->{'elt'} . " failed: " . $msg->{'message'};
            } elsif ($msg->{'type'} == $XMSG_PART_DONE) {
                push @messages, "PART-" . $msg->{'partnum'} . '-' . ($msg->{'successful'}? "OK" : "FAILED");
-               $start_new_part->($msg->{'successful'}, $msg->{'eof'}, $msg->{'partnum'});
+               push @messages, "EOM" if $msg->{'eom'};
+               $start_new_part->($msg->{'successful'}, $msg->{'eof'}, $msg->{'partnum'}, $msg->{'eom'});
            } elsif ($msg->{'type'} == $XMSG_DONE) {
                push @messages, "DONE";
                Amanda::MainLoop::quit();
@@ -673,18 +677,129 @@ SKIP: {
        return "$holding_base/file0";
     }
 
-    # run this test in each of a few different cache permutations
+    # first, test the simpler Splitter class
     test_taper_dest(
-       Amanda::Xfer::Source::Random->new(1024*1024*4.1, $RANDOM_SEED),
+       Amanda::Xfer::Source::Random->new(1024*1951, $RANDOM_SEED),
+       sub {
+           my ($first_dev) = @_;
+           Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024,
+                                                    520*1024, 0);
+       },
+       [ "PART-1-OK", "PART-2-OK", "PART-3-OK", "PART-4-OK",
+         "DONE" ],
+       "Amanda::Xfer::Dest::Taper::Splitter - simple splitting");
+    test_recovery_source(
+       Amanda::Xfer::Dest::Null->new($RANDOM_SEED),
+       [ 1 => [ 1, 2, 3, 4 ], ],
+       [
+         'READY',
+         'PART',
+         'KB-544',
+         'PART',
+         'KB-544',
+         'PART',
+         'KB-544',
+         'PART',
+         'KB-319',
+         'DONE'
+       ]);
+
+    test_taper_dest(
+       Amanda::Xfer::Source::Random->new(1024*1024*3.1, $RANDOM_SEED),
+       sub {
+           my ($first_dev) = @_;
+           Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024,
+                                                    1024*1024, 0);
+       },
+       [ "PART-1-OK", "PART-2-OK", "PART-3-OK", "EOM",
+         "PART-4-OK",
+         "DONE" ],
+       "Amanda::Xfer::Dest::Taper::Splitter - splitting and spanning with LEOM");
+    test_recovery_source(
+       Amanda::Xfer::Dest::Null->new($RANDOM_SEED),
+       [ 1 => [ 1, 2, 3 ], 2 => [ 1, ], ],
+       [
+         'READY',
+         'PART',
+         'KB-1024',
+         'PART',
+         'KB-1024',
+         'PART',
+         'KB-288',
+         'PART',
+         'KB-838',
+         'DONE'
+       ]);
+
+    test_taper_dest(
+       Amanda::Xfer::Source::Random->new(1024*1024*1.5, $RANDOM_SEED),
+       sub {
+           my ($first_dev) = @_;
+           Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024,
+                                                    0, 0);
+       },
+       [ "PART-1-OK",
+         "DONE" ],
+       "Amanda::Xfer::Dest::Taper::Splitter - no splitting");
+    test_recovery_source(
+       Amanda::Xfer::Dest::Null->new($RANDOM_SEED),
+       [ 1 => [ 1, ], ],
+       [
+         'READY',
+         'PART',
+         'KB-1536',
+         'DONE'
+       ]);
+
+    test_taper_dest(
+       Amanda::Xfer::Source::Random->new(1024*1024*3.1, $RANDOM_SEED),
        sub {
            my ($first_dev) = @_;
            Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024,
+                                                    2368*1024, 0);
+       },
+       [ "PART-1-OK", "PART-2-OK", "EOM",
+         "PART-3-OK",
+         "DONE" ],
+       "Amanda::Xfer::Dest::Taper::Splitter - LEOM hits in file 2 header");
+    test_recovery_source(
+       Amanda::Xfer::Dest::Null->new($RANDOM_SEED),
+       [ 1 => [ 1, 2 ], 2 => [ 1, ], ],
+       [
+         'READY',
+         'PART',
+         'KB-2368',
+         'PART',
+         'KB-0', # this wouldn't be in the catalog, but it's on the vtape
+         'PART',
+         'KB-806',
+         'DONE'
+       ]);
+
+    test_taper_dest(
+       Amanda::Xfer::Source::Random->new(1024*1024*3.1, $RANDOM_SEED),
+       sub {
+           my ($first_dev) = @_;
+           Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024,
+                                                    2368*1024, 0);
+       },
+       [ "PART-1-OK", "PART-2-FAILED", "EOM",
+         "NOT-RETRYING", "CANCELLED", "DONE" ],
+       "Amanda::Xfer::Dest::Taper::Splitter - LEOM fails, PEOM => failure",
+       disable_leom => 1, do_not_retry => 1);
+
+    # run A::X::Dest::Taper::Cacher test in each of a few different cache permutations
+    test_taper_dest(
+       Amanda::Xfer::Source::Random->new(1024*1024*4.1, $RANDOM_SEED),
+       sub {
+           my ($first_dev) = @_;
+           Amanda::Xfer::Dest::Taper::Cacher->new($first_dev, 128*1024,
                                                     1024*1024, 1, undef),
        },
-       [ "PART-1-OK", "PART-2-OK", "PART-3-FAILED",
+       [ "PART-1-OK", "PART-2-OK", "PART-3-FAILED", "EOM",
          "PART-3-OK", "PART-4-OK", "PART-5-OK",
          "DONE" ],
-       "mem cache");
+       "Amanda::Xfer::Dest::Taper::Cacher - mem cache");
     test_recovery_source(
        Amanda::Xfer::Dest::Null->new($RANDOM_SEED),
        [ 1 => [ 1, 2 ], 2 => [ 1, 2, 3 ], ],
@@ -707,13 +822,13 @@ SKIP: {
        Amanda::Xfer::Source::Random->new(1024*1024*4.1, $RANDOM_SEED),
        sub {
            my ($first_dev) = @_;
-           Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024,
+           Amanda::Xfer::Dest::Taper::Cacher->new($first_dev, 128*1024,
                                              1024*1024, 0, $disk_cache_dir),
        },
-       [ "PART-1-OK", "PART-2-OK", "PART-3-FAILED",
+       [ "PART-1-OK", "PART-2-OK", "PART-3-FAILED", "EOM",
          "PART-3-OK", "PART-4-OK", "PART-5-OK",
          "DONE" ],
-       "disk cache");
+       "Amanda::Xfer::Dest::Taper::Cacher - disk cache");
     test_recovery_source(
        Amanda::Xfer::Dest::Null->new($RANDOM_SEED),
        [ 1 => [ 1, 2 ], 2 => [ 1, 2, 3 ], ],
@@ -736,12 +851,12 @@ SKIP: {
        Amanda::Xfer::Source::Random->new(1024*1024*2, $RANDOM_SEED),
        sub {
            my ($first_dev) = @_;
-           Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024,
+           Amanda::Xfer::Dest::Taper::Cacher->new($first_dev, 128*1024,
                                                    1024*1024, 0, undef),
        },
        [ "PART-1-OK", "PART-2-OK", "PART-3-OK",
          "DONE" ],
-       "no cache (no failed parts; exact multiple of part size)");
+       "Amanda::Xfer::Dest::Taper::Cacher - no cache (no failed parts; exact multiple of part size)");
     test_recovery_source(
        Amanda::Xfer::Dest::Null->new($RANDOM_SEED),
        [ 1 => [ 1, 2, 3 ], ],
@@ -760,10 +875,10 @@ SKIP: {
        Amanda::Xfer::Source::Random->new(1024*1024*2, $RANDOM_SEED),
        sub {
            my ($first_dev) = @_;
-           Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024, 0, 0, undef),
+           Amanda::Xfer::Dest::Taper::Cacher->new($first_dev, 128*1024, 0, 0, undef),
        },
        [ "PART-1-OK", "DONE" ],
-       "no splitting (fits on volume)");
+       "Amanda::Xfer::Dest::Taper::Cacher - no splitting (fits on volume)");
     test_recovery_source(
        Amanda::Xfer::Dest::Null->new($RANDOM_SEED),
        [ 1 => [ 1 ], ],
@@ -778,44 +893,49 @@ SKIP: {
        Amanda::Xfer::Source::Random->new(1024*1024*4.1, $RANDOM_SEED),
        sub {
            my ($first_dev) = @_;
-           Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024, 0, 0, undef),
+           Amanda::Xfer::Dest::Taper::Cacher->new($first_dev, 128*1024, 0, 0, undef),
        },
-       [ "PART-1-FAILED", "NOT-RETRYING", "CANCELLED", "DONE" ],
-       "no splitting (doesn't fit on volume -> fails)",
+       [ "PART-1-FAILED", "EOM",
+         "NOT-RETRYING", "CANCELLED", "DONE" ],
+       "Amanda::Xfer::Dest::Taper::Cacher - no splitting (doesn't fit on volume -> fails)",
        do_not_retry => 1);
 
     test_taper_dest(
        Amanda::Xfer::Source::Random->new(1024*1024*4.1, $RANDOM_SEED),
        sub {
            my ($first_dev) = @_;
-           Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024,
+           Amanda::Xfer::Dest::Taper::Cacher->new($first_dev, 128*1024,
                                            1024*1024, 0, $disk_cache_dir),
        },
-       [ "PART-1-OK", "PART-2-OK", "PART-3-FAILED",
+       [ "PART-1-OK", "PART-2-OK", "PART-3-FAILED", "EOM",
          "PART-3-OK", "PART-4-OK", "CANCEL",
          "CANCELLED", "DONE" ],
-       "cancellation after success",
+       "Amanda::Xfer::Dest::Taper::Cacher - cancellation after success",
        cancel_after_partnum => 4);
 
     # set up a few holding chunks and read from those
+
     $holding_file = make_holding_files(3);
+
     test_taper_dest(
        Amanda::Xfer::Source::Holding->new($holding_file),
        sub {
            my ($first_dev) = @_;
            Amanda::Xfer::Dest::Taper::Splitter->new($first_dev, 128*1024,
-                                           1024*1024, 0, undef),
+                                           1024*1024, 1);
        },
-       [ "PART-1-OK", "PART-2-OK", "PART-3-FAILED",
-         "PART-3-OK", "PART-4-OK", "PART-5-FAILED",
+       [ "PART-1-OK", "PART-2-OK", "PART-3-FAILED", "EOM",
+         "PART-3-OK", "PART-4-OK", "PART-5-FAILED", "EOM",
          "PART-5-OK", "PART-6-OK", "PART-7-OK",
          "DONE" ],
-       "Amanda::Xfer::Source::Holding acts as a source and supplies cache_inform");
+       "Amanda::Xfer::Dest::Taper::Splitter - Amanda::Xfer::Source::Holding "
+       . "acts as a source and supplies cache_inform",
+       disable_leom => 1);
 
     ##
     # test the cache_inform method
 
-    sub test_taper_dest_cache_inform {
+    sub test_taper_dest_splitter_cache_inform {
        my %params = @_;
        my $xfer;
        my $device;
@@ -846,26 +966,24 @@ SKIP: {
        # create a list of holding chuunks, some slab-aligned, some part-aligned,
        # some not
        my @holding_chunks;
-       if (!$params{'omit_chunks'}) {
-           my $offset = 0;
-           my $do_chunk = sub {
-               my ($break) = @_;
-               die unless $break > $offset;
-               push @holding_chunks, [ $cache_file, $offset, $break - $offset ];
-               $offset = $break;
-           };
-           $do_chunk->(277);
-           $do_chunk->($part_size);
-           $do_chunk->($part_size+128*1024);
-           $do_chunk->($part_size*3);
-           $do_chunk->($part_size*3+1024);
-           $do_chunk->($part_size*3+1024*2);
-           $do_chunk->($part_size*3+1024*3);
-           $do_chunk->($part_size*4);
-           $do_chunk->($part_size*4 + 77);
-           $do_chunk->($file_size - 1);
-           $do_chunk->($file_size);
-       }
+       my $offset = 0;
+       my $do_chunk = sub {
+           my ($break) = @_;
+           die unless $break > $offset;
+           push @holding_chunks, [ $cache_file, $offset, $break - $offset ];
+           $offset = $break;
+       };
+       $do_chunk->(277);
+       $do_chunk->($part_size);
+       $do_chunk->($part_size+128*1024);
+       $do_chunk->($part_size*3);
+       $do_chunk->($part_size*3+1024);
+       $do_chunk->($part_size*3+1024*2);
+       $do_chunk->($part_size*3+1024*3);
+       $do_chunk->($part_size*4);
+       $do_chunk->($part_size*4 + 77);
+       $do_chunk->($file_size - 1);
+       $do_chunk->($file_size);
 
        # set up vtapes
        my $testconf = Installcheck::Run::setup();
@@ -885,11 +1003,12 @@ SKIP: {
        $device = Amanda::Device->new("file:" . Installcheck::Run::load_vtape($vtape_num++));
        die("Could not open VFS device: " . $device->error())
            unless ($device->status() == $Amanda::Device::DEVICE_STATUS_SUCCESS);
-       $device->start($Amanda::Device::ACCESS_WRITE, "TESTCONF01", "20080102030405");
        $device->property_set("MAX_VOLUME_USAGE", 1024*1024*2.5);
+       $device->property_set("LEOM", 0);
+       $device->start($Amanda::Device::ACCESS_WRITE, "TESTCONF01", "20080102030405");
 
        my $dest = Amanda::Xfer::Dest::Taper::Splitter->new($device, 128*1024,
-                                                   1024*1024, 0, undef);
+                                                   1024*1024, 1);
        $xfer = Amanda::Xfer->new([
            Amanda::Xfer::Source::Fd->new(fileno($fh)),
            $dest,
@@ -905,8 +1024,9 @@ SKIP: {
                die("Could not open VFS device: " . $device->error())
                    unless ($device->status() == $Amanda::Device::DEVICE_STATUS_SUCCESS);
                $dest->use_device($device);
-               $device->start($Amanda::Device::ACCESS_WRITE, "TESTCONF01", "20080102030405");
+               $device->property_set("LEOM", 0);
                $device->property_set("MAX_VOLUME_USAGE", 1024*1024*2.5);
+               $device->start($Amanda::Device::ACCESS_WRITE, "TESTCONF01", "20080102030405");
            }
 
            # feed enough chunks to cache_inform
@@ -952,17 +1072,11 @@ SKIP: {
        return @messages;
     }
 
-    is_deeply([ test_taper_dest_cache_inform() ],
+    is_deeply([ test_taper_dest_splitter_cache_inform() ],
        [ "PART-OK", "PART-OK", "PART-FAILED",
          "PART-OK", "PART-OK", "PART-OK",
          "DONE" ],
-       "cache_inform: element produces the correct series of messages");
-
-    is_deeply([ test_taper_dest_cache_inform(omit_chunks => 1) ],
-       [ "PART-OK", "PART-OK", "PART-FAILED",
-         "ERROR: Failed part was not cached; cannot retry", "CANCELLED",
-         "DONE" ],
-       "cache_inform: element produces the correct series of messages when a chunk is missing");
+       "cache_inform: splitter element produces the correct series of messages");
 
     rmtree($holding_base);
 }
@@ -1008,7 +1122,8 @@ SKIP: {
 
        # and create the xfer
        my $src = Amanda::Xfer::Source::Random->new(32768*34-7, $RANDOM_SEED);
-       my $dest = Amanda::Xfer::Dest::Taper::DirectTCP->new($dev, 32768*16);
+       # note we ask for slightly less than 15 blocks; the dest should round up
+       my $dest = Amanda::Xfer::Dest::Taper::DirectTCP->new($dev, 32768*16-99);
        $xfer = Amanda::Xfer->new([ $src, $dest ]);
 
        my $start_new_part; # forward declaration
@@ -1169,6 +1284,33 @@ SKIP: {
     pass("Three xfers interlinked via DirectTCP complete successfully");
 }
 
+# try cancelling a DirectTCP xfer while it's waiting in accept()
+{
+    my $xfer_src = Amanda::Xfer::Source::DirectTCPListen->new();
+    my $xfer_dst = Amanda::Xfer::Dest::Null->new(0);
+    my $xfer = Amanda::Xfer->new([ $xfer_src, $xfer_dst ]);
+
+    # start up the transfer, which starts a thread which will accept
+    # soon after that.
+    $xfer->start(sub {
+       my ($src, $msg, $xfer) = @_;
+       if ($msg->{'type'} == $XMSG_DONE) {
+           Amanda::MainLoop::quit();
+       }
+    });
+
+    sleep(1);
+
+    # Now, ideally we'd wait until the accept() is running, maybe testing it
+    # with a SYN or something like that.  This is not terribly critical,
+    # because the element glue does not check for cancellation before it begins
+    # accepting.
+    $xfer->cancel();
+
+    Amanda::MainLoop::run();
+    pass("A DirectTCP accept operation can be cancelled");
+}
+
 # test element comparison
 {
     my $a = Amanda::Xfer::Filter::Xor->new(0);
index 291ef932e37542f16858578b9719488c94948536..7d8cf361ecc6119ec2952eb539a148b3d81888bc 100644 (file)
@@ -64,11 +64,18 @@ eventual use.
 use strict;
 use warnings;
 use Socket;
+require Exporter;
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw( $srcdir );
 
 use Amanda::Util;
 
 our $TMP = "$AMANDA_TMPDIR/installchecks";
 
+# the Makefile provides srcdir to us in most cases; if not, assume it's "."
+our $srcdir = $ENV{'srcdir'} || '.';
+
 # run this just before the script actually executes
 # (not during syntax checks)
 INIT {
diff --git a/installcheck/Installcheck/Catalogs.pm b/installcheck/Installcheck/Catalogs.pm
new file mode 100644 (file)
index 0000000..5c38b1b
--- /dev/null
@@ -0,0 +1,394 @@
+# Copyright (c) 2010 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+package Installcheck::Catalogs;
+
+=head1 NAME
+
+Installcheck::Catalogs - manage catalog info that can be used to test
+tools that do not need access to actual vtapes
+
+=head1 SYNOPSIS
+
+  use Installcheck::Catalogs;
+  my $cat = Installcheck::Catalogs::load("skipped");
+  $cat->install();
+  my @tags = $cat->get_tags();
+
+=head1 DESCRIPTION
+
+The C<load> method loads a named set of catalog information from catalog files.
+
+The resulting object just decodes the catalog information into a perl
+structure.  To actually write the catalog to disk, use the C<install> method of
+the resulting object.
+
+Note that many test catalogs require a configuration to be loaded; this package
+does not handle loading configurations.  However, the C<install> method does
+take care of erasing the C<logs> subdirectory of the configuration directory as
+well as any stray holding-disk files.
+
+A catalog can have multiple, named snippets of text attached, as well.  These
+are accessed via the C<get_text($name)> method.
+
+=head2 Database Results
+
+The C<%H>, C<%P>, and C<%D> directives set up a "shadow database" of dumps and
+parts that are represented by the catalog.  These are available in two hashes,
+one for dumps and one for parts, available from methods C<get_dumps> and
+C<get_parts>.  The hashes are keyed by "tags", which are arbitrary strings.
+The dumps and parts are built to look like those produced by
+L<Amanda::DB::Catalog>; in particular, a dump has keys
+
+  parts (list of parts indexed by partnum)
+  dump_timestamp
+  hostname
+  diskname
+  level
+  status
+  kb
+  orig_kb
+  write_timestamp
+  message
+  nparts
+  sec
+
+while a part has keys
+
+  dump (points to the parent dump)
+  status
+  sec
+  kb
+  orig_kb
+  partnum
+
+a part will also have a C<holding_file> key if it is, indeed, a holding
+file.  The C<holding_filename($tag)> method will return the filename of a
+holding file.
+
+=head2 Catalog Files
+
+Each file in C<installcheck/catalogs> with the suffix C<.cat> represents a
+cached catalog.  Since the Amanda catalog consists of many files (curinfo,
+trace logs, index, disklist, tapelist, etc.), each catalog acts as a
+container for several other named files.  The file is parsed in a line-based
+fashion, with the following conventions:
+
+=over 4
+
+=item A line beginning with C<#> is a comment, and is ignored
+
+=item A line beginning with C<%F> begins a new output file, with the rest of
+the line (after whitespace) interpreted as a filename relative to the TESTCONF
+configuration directory.  Any intervening directories required will be created.
+
+=item A line beginning with C<%T> begins a new text section.  This is simliar
+to C<%F>, but instead of a filename, the rest of the line specifies a text
+handle.  The text will not be written to the filesystem on C<install>.
+
+=item A line beginning with C<%H> specifies a holding-disk file.  The rest of
+the line is a space-separated list:
+
+  %H tag datestamp hostname pathname level status size
+
+A single-chunk holding-disk file of the appropriate size will be created,
+filled with garbage, and the corresponding entries will be made in the dump and
+part hashes.
+
+=item A line beginning with C<%D> specifies a dump.  The format, all on one line, is:
+
+  %D tag dump_timestamp write_timestamp hostname diskname level status
+    message nparts sec kb orig_kb
+
+=item A line beginning with C<%P> specifies a part.  The format, again all on
+one line, is:
+
+  %P tag dumptag label filenum partnum status sec kb orig_kb
+
+where C<dumptag> is the tag of the dump of which this is a part.
+
+=item A line beginning with C<%%> is a custom tag, intended for use by scripts
+to define their expectations of the logfile.  The results are available from
+the C<get_tags> method.
+
+=item A line beginning with C<\> is copied literally into the current output
+file, without the leading C<\>.
+
+=item Blank lines are ignored.
+
+=back
+
+=cut
+
+sub load {
+    my ($name) = @_;
+
+    return Installcheck::Catalogs::Catalog->new($name);
+}
+
+package Installcheck::Catalogs::Catalog;
+
+use warnings;
+use strict;
+
+use Installcheck;
+use Amanda::Util;
+use Amanda::Paths;
+use Amanda::Xfer qw( :constants );
+use File::Path qw( mkpath rmtree );
+
+my $holdingdir = "$Installcheck::TMP/holding";
+
+sub new {
+    my $class = shift;
+    my ($name) = @_;
+
+    my $filename = "$srcdir/catalogs/$name.cat";
+    die "no catalog file '$filename'" unless -f $filename;
+
+    my $self = bless {
+       files => {},
+       texts => {},
+       tags => [],
+       holding_files => {},
+       dumps => {},
+       parts => {},
+    }, $class;
+
+    $self->_parse($filename);
+
+    return $self;
+}
+
+sub _parse {
+    my $self = shift;
+    my ($filename) = @_;
+    my $write_timestamp;
+    my $fileref;
+
+    open(my $fh, "<", $filename) or die "could not open '$filename'";
+    while (<$fh>) {
+       ## comment or blank
+       if (/^#/ or /^$/) {
+           next;
+
+       ## new output file
+       } elsif (/^(%[TF])\s*(.*)$/) {
+           my $cur_filename = $2;
+           my $kind = ($1 eq '%F')? 'files' : 'texts';
+           die "duplicate file '$cur_filename'"
+               if exists $self->{$kind}{$cur_filename};
+           $self->{$kind}{$cur_filename} = '';
+           $fileref = \$self->{$kind}{$cur_filename};
+
+       # holding file
+       } elsif (/^%H (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) (\d+)$/) {
+
+           die "dump tag $1 already exists" if exists $self->{'dumps'}{$1};
+           die "part tag $1 already exists" if exists $self->{'parts'}{$1};
+
+           my $safe_disk = $4;
+           $safe_disk =~ tr{/}{_};
+           my $hfile = "$holdingdir/$2/$3.$safe_disk";
+
+           $self->{'holding_files'}->{$1} = [ $hfile, $2, $3, $4, $5, $6, $7 ];
+
+           my $dump = $self->{'dumps'}{$1} = {
+               dump_timestamp => $2,
+               hostname => $3,
+               diskname => $4,
+               level => $5+0,
+               status => $6,
+               kb => $7,
+               orig_kb => 0,
+               write_timestamp => '00000000000000',
+               message => '',
+               nparts => 1,
+               sec => 0.0,
+           };
+           my $part = $self->{'parts'}{$1} = {
+               holding_file => $hfile,
+               dump => $dump,
+               status => $dump->{'status'},
+               sec => 0.0,
+               kb => $dump->{'kb'},
+               orig_kb => 0,
+               partnum => 1,
+           };
+           $dump->{'parts'} = [ undef, $part ];
+
+       # dump
+       } elsif (/^%D (\S+) (\d+) (\d+) (\S+) (\S+) (\d+) (\S+) (\S+) (\d+) (\S+) (\d+) (\d+)/) {
+           die "dump tag $1 already exists" if exists $self->{'dumps'}{$1};
+           my $dump = $self->{'dumps'}{$1} = {
+               dump_timestamp => $2,
+               write_timestamp => $3,
+               hostname => $4,
+               diskname => $5,
+               level => $6+0,
+               status => $7,
+               message => $8,
+               nparts => $9,
+               sec => $10+0.0,
+               kb => $11,
+               orig_kb => $12,
+               parts => [ undef ],
+           };
+           # translate "" to an empty string
+           $dump->{'message'} = '' if $dump->{'message'} eq '""';
+
+       # part
+       } elsif (/^%P (\S+) (\S+) (\S+) (\d+) (\d+) (\S+) (\S+) (\d+) (\d+)/) {
+           die "part tag $1 already exists" if exists $self->{'parts'}{$1};
+           die "dump tag $2 does not exist" unless exists $self->{'dumps'}{$2};
+
+           my $part = $self->{'parts'}{$1} = {
+               dump => $self->{dumps}{$2},
+               label => $3,
+               filenum => $4,
+               partnum => $5,
+               status => $6,
+               sec => $7+0.0,
+               kb => $8,
+               orig_kb => $9
+           };
+           $self->{'dumps'}->{$2}->{'parts'}->[$5] = $part;
+
+       # processing tag
+       } elsif (/^%%\s*(.*)$/) {
+           push @{$self->{'tags'}}, $1;
+
+       # bogus directive
+       } elsif (/^%/) {
+           chomp;
+           die "invalid processing instruction '$_'";
+
+       # contents of the file (\-escaped)
+       } elsif (/^\\/) {
+           s/^\\//;
+           $$fileref .= $_;
+
+       # contents of the file (copy)
+       } else {
+           $$fileref .= $_;
+       }
+    }
+}
+
+sub _make_holding_file {
+    my ($filename, $datestamp, $hostname, $diskname, $level, $status, $size) = @_;
+
+    # make the parent dir
+    my $dir = $filename;
+    $dir =~ s{/[^/]*$}{};
+    mkpath($dir);
+
+    # (note that multi-chunk holding files are not used at this point)
+    my $hdr = Amanda::Header->new();
+    $hdr->{'type'} = $Amanda::Header::F_DUMPFILE;
+    $hdr->{'datestamp'} = $datestamp;
+    $hdr->{'dumplevel'} = $level+0;
+    $hdr->{'name'} = $hostname;
+    $hdr->{'disk'} = $diskname;
+    $hdr->{'program'} = "INSTALLCHECK";
+    $hdr->{'is_partial'} = ($status ne 'OK');
+
+    open(my $fh, ">", $filename) or die("opening '$filename': $!");
+    $fh->syswrite($hdr->to_string(32768,32768));
+
+    # transfer some data to that file
+    my $xfer = Amanda::Xfer->new([
+       Amanda::Xfer::Source::Pattern->new(1024*$size, "+-+-+-+-"),
+       Amanda::Xfer::Dest::Fd->new($fh),
+    ]);
+
+    $xfer->start(sub {
+       my ($src, $msg, $xfer) = @_;
+       if ($msg->{type} == $XMSG_ERROR) {
+           die $msg->{elt} . " failed: " . $msg->{message};
+       } elsif ($msg->{'type'} == $XMSG_DONE) {
+           $src->remove();
+           Amanda::MainLoop::quit();
+       }
+    });
+    Amanda::MainLoop::run();
+    close($fh);
+}
+
+sub install {
+    my $self = shift;
+
+    # first, remove the logdir
+    my $logdir = "$Amanda::Paths::CONFIG_DIR/TESTCONF/log";
+    rmtree($logdir) if -e $logdir;
+
+    # write the new config files
+    for my $filename (keys %{$self->{'files'}}) {
+       my $pathname = "$Amanda::Paths::CONFIG_DIR/TESTCONF/$filename";
+       my $dirname = $pathname;
+       $dirname =~ s{/[^/]+$}{};
+
+       mkpath($dirname) unless -d $dirname;
+       Amanda::Util::burp($pathname, $self->{'files'}{$filename});
+    }
+
+    # erase holding and create some new holding files
+    rmtree($holdingdir);
+    for my $hldinfo (values %{$self->{'holding_files'}}) {
+       _make_holding_file(@$hldinfo);
+    }
+}
+
+sub get_tags {
+    my $self = shift;
+    return @{$self->{'tags'}};
+}
+
+sub get_dumps {
+    my $self = shift;
+    return %{$self->{'dumps'}};
+}
+
+sub get_parts {
+    my $self = shift;
+    return %{$self->{'parts'}};
+}
+
+sub get_text {
+    my $self = shift;
+    my ($name) = @_;
+
+    return $self->{'texts'}->{$name};
+}
+
+sub get_file {
+    my $self = shift;
+    my ($name) = @_;
+
+    return $self->{'files'}->{$name};
+}
+
+sub holding_filename {
+    my $self = shift;
+    my ($tag) = @_;
+
+    my $fn = $self->{'holding_files'}{$tag}[0];
+    return $fn;
+}
+
+1;
index 942921a5d0ef0ea0b835b7f493cb06b16919d1bf..92b98dfab50ae9a98bb381c90a449ea6a1154810 100644 (file)
@@ -37,6 +37,7 @@ sendbackup or selfcheck.
                            service => 'amindexd',
                            emulate => 'amandad',
                            auth => 'bsdtcp',
+                           auth_peer => 'localhost',
                            process_done => $process_done);
     # or
     $service = Installcheck::ClientService->new(
@@ -84,7 +85,8 @@ the name of the service to run.  The C<emulate> parameter determines how the
 service is invoked.  The C<args> and C<auth> parameters are described above.
 The C<process_done> parameter gives a sub which is called with the service's
 wait status when the service exits and all of its file descriptors have been
-drained.
+drained.  The C<auth_peer> parameter gives the value for
+C<$AMANDA_AUTHENTICATED_PEER> when emulating amandad.
 
 =head2 Killing Subprocess
 
@@ -181,6 +183,7 @@ sub new {
        process_done => $params{'process_done'},
        auth => $params{'auth'} || 'bsdtcp',
        args => $params{'args'} || [],
+       auth_peer => $params{'auth_peer'},
 
        # all hashes keyed by stream name
        stream_fds => {},
@@ -375,6 +378,9 @@ sub _start_process_amandad {
            POSIX::close($in_c);
        }
 
+       delete $ENV{'AMANDA_AUTHENTICATED_PEER'};
+       $ENV{'AMANDA_AUTHENTICATED_PEER'} = $self->{'auth_peer'} if $self->{'auth_peer'};
+
        # finally, execute!
        # braces avoid warning
        { exec { $service } $service, 'amandad', $self->{'auth'}; }
index 94a59146eb3ebd0bdbd7ff2a8ad0d2d278490806..784d6f9356381f39d59cfcb07f219a9c153787d5 100644 (file)
@@ -179,12 +179,12 @@ $flavors{'parts'} = sub {
     my $testconf = Installcheck::Run::setup();
     basic_settings($testconf);
     use_new_chg_disk($testconf);
-    $testconf->add_dumptype("installcheck-test-parts", [
-       "installcheck-test", "",
-       "tape_splitsize", "128k",
-       "fallback_splitsize", "128k",
+    $testconf->add_tapetype("TEST-TAPE", [
+       "length", "50M",
+       "part_size", "128k",
+       "part_cache_type", "memory",
     ]);
-    $testconf->add_dle("localhost $diskname installcheck-test-parts");
+    $testconf->add_dle("localhost $diskname installcheck-test");
     $testconf->write();
 
     ok(Installcheck::Run::run('amdump', 'TESTCONF'), "amdump for 'parts'"),
index f87e85b770e1ae79311f50ea766664b68f925d54..5bf1b1067ec260090ce11e3a036fcac3b113688b 100644 (file)
@@ -189,10 +189,15 @@ our $taperoot = "$Installcheck::TMP/vtapes";
 our $holdingdir ="$Installcheck::TMP/holding";
 
 sub setup {
+    my $new_vtapes = shift;
     my $testconf = Installcheck::Config->new();
 
     (-d $diskname) or setup_backmeup();
-    setup_vtapes($testconf, 3);
+    if ($new_vtapes) {
+       setup_new_vtapes($testconf, 3);
+    } else {
+       setup_vtapes($testconf, 3);
+    }
     setup_holding($testconf, 25);
     setup_disklist($testconf);
 
@@ -289,6 +294,32 @@ sub setup_vtapes {
     ]);
 }
 
+sub setup_new_vtapes {
+    my ($testconf, $ntapes) = @_;
+    if (-d $taperoot) {
+       rmtree($taperoot);
+    }
+
+    # make each of the tape directories
+    for (my $i = 1; $i < $ntapes+1; $i++) {
+       my $tapepath = "$taperoot/slot$i";
+       mkpath("$tapepath");
+    }
+
+    load_vtape(1);
+
+    # set up the appropriate configuration
+    $testconf->add_param("tpchanger", "\"chg-disk:$taperoot\"");
+    $testconf->add_param("labelstr", "\"TESTCONF[0-9][0-9]\"");
+    $testconf->add_param("tapecycle", "$ntapes");
+
+    # this overwrites the existing TEST-TAPE tapetype
+    $testconf->add_tapetype('TEST-TAPE', [
+       'length' => '30 mbytes',
+       'filemark' => '4 kbytes',
+    ]);
+}
+
 sub setup_holding {
     my ($testconf, $mbytes) = @_;
 
index a3d14a221d5cfa5b73c4e0190cbd2d372dfefae6..2611f48785908ea6209df6c2861b8512524d09ef 100644 (file)
@@ -5,6 +5,7 @@ all_tests =
 common_tests = \
        Amanda_Archive \
        Amanda_Config \
+       Amanda_Config_FoldingHash \
        Amanda_ClientService \
        Amanda_Debug \
        Amanda_Feature \
@@ -14,7 +15,8 @@ common_tests = \
        Amanda_Header \
        Amanda_Util \
        Amanda_Xfer \
-       amarchiver
+       amarchiver \
+       gnutar
 all_tests += $(common_tests)
 
 client_tests = \
@@ -55,21 +57,26 @@ server_tests = \
        amgetconf \
         amtape \
         amlabel \
-       amtapetype
+       amtapetype \
+       chunker
 all_tests += $(server_tests)
 
 full_tests = \
        =setupcache \
+       amadmin \
        amcheck \
-       amdump \
-       amdevcheck \
        amcheckdump \
+       amdevcheck \
+       amdump \
+       amflush \
+       amoverview \
+       amreport \
        amrmtape \
+       amserverconfig \
        amservice \
        amstatus \
-       amreport \
-       amadmin \
        amvault \
+       example \
        pp-scripts
 all_tests += $(full_tests)
 
@@ -148,6 +155,7 @@ endif
 # require configure-variable substitution) here:
 test_utils = \
        Installcheck.pm \
+       Installcheck/Catalogs.pm \
        Installcheck/Config.pm \
        Installcheck/ClientService.pm \
        Installcheck/Mock.pm \
@@ -157,6 +165,34 @@ test_utils = \
        Installcheck/Changer.pm
 EXTRA_DIST += $(test_utils)
 
+# the catalogs themselves
+catalogs = \
+       catalogs/amflush.cat \
+       catalogs/bigdb.cat \
+       catalogs/bigestimate.cat \
+       catalogs/chunker-partial.cat \
+       catalogs/doublefailure.cat \
+       catalogs/fatal.cat \
+       catalogs/filesystemstaped.cat \
+       catalogs/flush-noorigsize.cat \
+       catalogs/flush-origsize.cat \
+       catalogs/longstrange.cat \
+       catalogs/multi-taper.cat \
+       catalogs/normal.cat \
+       catalogs/plannerfail.cat \
+       catalogs/quoted.cat \
+       catalogs/resultsmissing.cat \
+       catalogs/retried.cat \
+       catalogs/retried-nofinish.cat \
+       catalogs/retried-strange.cat \
+       catalogs/shortstrange.cat \
+       catalogs/skipped.cat \
+       catalogs/spanned.cat \
+       catalogs/strontium.cat \
+       catalogs/taperr.cat
+EXTRA_DIST += $(catalogs)
+
+
 # and finally some development utilities
 noinst_SCRIPTS = \
        run-ndmp
@@ -166,6 +202,9 @@ CHECK_PERL_FLAGS=-I$(top_srcdir)/installcheck
 SCRIPTS_PERL = $(tests) $(mocks) $(noinst_SCRIPTS)
 SCRIPTS_EXTRA_DIST = $(all_tests)
 
+# skip syntax checks on these files, since we're about to run all of them
+SKIP_CHECKS = yes
+
 .PHONY: clobber_my_config_is_ok
 clobber_my_config_is_ok:
        @if test "$(CONFIG_CLOBBER_MY_CONFIG)" != "OK" -a \
@@ -183,13 +222,16 @@ clobber_my_config_is_ok:
                exit 1; \
        fi
 
+# newer Test::Harness (v3.18-3.21) implementations get confused by executable
+# test scripts, so this rule chmod a-x's them first
 installcheck-local: clobber_my_config_is_ok $(SCRIPTS_PERL)
        rm -rf "$(AMANDA_TMPDIR)/installchecks"
        $(mkdir_p) "$(AMANDA_TMPDIR)/installchecks"
        @if test -f "$(CONFIG_DIR)/amanda-client.conf" -a ! -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \
            cp "$(CONFIG_DIR)/amanda-client.conf" "$(CONFIG_DIR)/amanda-client.conf.install-backup"; \
        fi 
-       $(PERL) -I$(srcdir) -I. -e 'use Test::Harness qw(&runtests); runtests(sort @ARGV);' $(tests)
+       for f in $(tests); do chmod a-x $$f; done
+       srcdir="$(srcdir)" $(PERL) -I$(srcdir) -I. -e 'use Test::Harness qw(&runtests); runtests(sort @ARGV);' $(tests)
        rm -rf "$(CONFIG_DIR)/TESTCONF"
        @if test -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \
            mv -f "$(CONFIG_DIR)/amanda-client.conf.install-backup" "$(CONFIG_DIR)/amanda-client.conf"; \
index ad4b743576c952a7bcedc7e27b4e931ac4c2770f..b011d6733ae97a1d0b3e4572c9717fdabe23bd12 100644 (file)
@@ -165,7 +165,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -193,7 +192,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -206,10 +204,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -223,7 +225,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -236,10 +240,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -251,21 +258,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -319,7 +330,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -339,10 +350,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -398,78 +406,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -480,12 +543,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -500,17 +592,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -519,60 +615,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -580,13 +735,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -595,9 +756,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -633,7 +797,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -642,7 +805,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -650,19 +812,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -688,47 +873,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -736,6 +977,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -758,19 +1000,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -780,13 +1024,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -830,6 +1071,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -860,7 +1102,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUFFIXES = 
-EXTRA_DIST = $(test_data) $(test_utils)
+EXTRA_DIST = $(test_data) $(test_utils) $(catalogs)
 BUILT_SOURCES = 
 MOSTLYCLEANFILES = 
 
@@ -877,6 +1119,7 @@ all_tests = $(common_tests) $(client_tests) $(server_tests) \
 common_tests = \
        Amanda_Archive \
        Amanda_Config \
+       Amanda_Config_FoldingHash \
        Amanda_ClientService \
        Amanda_Debug \
        Amanda_Feature \
@@ -886,7 +1129,8 @@ common_tests = \
        Amanda_Header \
        Amanda_Util \
        Amanda_Xfer \
-       amarchiver
+       amarchiver \
+       gnutar
 
 client_tests = \
         noop \
@@ -925,20 +1169,25 @@ server_tests = \
        amgetconf \
         amtape \
         amlabel \
-       amtapetype
+       amtapetype \
+       chunker
 
 full_tests = \
        =setupcache \
+       amadmin \
        amcheck \
-       amdump \
-       amdevcheck \
        amcheckdump \
+       amdevcheck \
+       amdump \
+       amflush \
+       amoverview \
+       amreport \
        amrmtape \
+       amserverconfig \
        amservice \
        amstatus \
-       amreport \
-       amadmin \
        amvault \
+       example \
        pp-scripts
 
 restore_tests = \
@@ -978,6 +1227,7 @@ tests = $(common_tests) $(mock_tests) $(am__append_1) $(am__append_2) \
 # require configure-variable substitution) here:
 test_utils = \
        Installcheck.pm \
+       Installcheck/Catalogs.pm \
        Installcheck/Config.pm \
        Installcheck/ClientService.pm \
        Installcheck/Mock.pm \
@@ -987,6 +1237,33 @@ test_utils = \
        Installcheck/Changer.pm
 
 
+# the catalogs themselves
+catalogs = \
+       catalogs/amflush.cat \
+       catalogs/bigdb.cat \
+       catalogs/bigestimate.cat \
+       catalogs/chunker-partial.cat \
+       catalogs/doublefailure.cat \
+       catalogs/fatal.cat \
+       catalogs/filesystemstaped.cat \
+       catalogs/flush-noorigsize.cat \
+       catalogs/flush-origsize.cat \
+       catalogs/longstrange.cat \
+       catalogs/multi-taper.cat \
+       catalogs/normal.cat \
+       catalogs/plannerfail.cat \
+       catalogs/quoted.cat \
+       catalogs/resultsmissing.cat \
+       catalogs/retried.cat \
+       catalogs/retried-nofinish.cat \
+       catalogs/retried-strange.cat \
+       catalogs/shortstrange.cat \
+       catalogs/skipped.cat \
+       catalogs/spanned.cat \
+       catalogs/strontium.cat \
+       catalogs/taperr.cat
+
+
 # and finally some development utilities
 noinst_SCRIPTS = \
        run-ndmp
@@ -994,6 +1271,9 @@ noinst_SCRIPTS = \
 CHECK_PERL_FLAGS = -I$(top_srcdir)/installcheck
 SCRIPTS_PERL = $(tests) $(mocks) $(noinst_SCRIPTS)
 SCRIPTS_EXTRA_DIST = $(all_tests)
+
+# skip syntax checks on these files, since we're about to run all of them
+SKIP_CHECKS = yes
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -1075,6 +1355,7 @@ distdir: $(DISTFILES)
        $(MAKE) $(AM_MAKEFLAGS) \
          top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-hook
+@SYNTAX_CHECKS_FALSE@check-local:
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-local
 check: $(BUILT_SOURCES)
@@ -1197,11 +1478,13 @@ uninstall-am:
 %: %.pl $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          rm $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  fi
+@SYNTAX_CHECKS_TRUE@   @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+@SYNTAX_CHECKS_TRUE@           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
+@SYNTAX_CHECKS_TRUE@           rm $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@   else \
+@SYNTAX_CHECKS_TRUE@           echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
+@SYNTAX_CHECKS_TRUE@   fi
 
 %.pl: %.pl.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
@@ -1225,33 +1508,22 @@ uninstall-am:
 %.awk: %.awk.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
 
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
 check-perl: $(SCRIPTS_PERL)
        @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
            test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-           if test -n "$(PERL)"; then \
-                   for perlobj in $$SCRIPTS_PERL; do \
-                           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
-                           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
-                           rm $$perlobj.nouselib; \
-                   done; \
-           fi \
-       fi
-check-local: check-perl
-
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
-       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
-       if test x"$(SKIP_CHECKS)" = x"" && \
-           test -n "$(PERL)"; then \
-               for perlobj in $$SCRIPTS_PERL; do \
-                       $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
-               done; \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
        fi
-installcheck-local: installcheck-perl
+@SYNTAX_CHECKS_TRUE@check-local: check-perl
 
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
 check-shell: $(SCRIPTS_SHELL)
        @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
@@ -1269,7 +1541,7 @@ check-shell: $(SCRIPTS_SHELL)
                        echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
        fi
-check-local: check-shell
+@SYNTAX_CHECKS_TRUE@check-local: check-shell
 
 # make sure that the sources for all shell and perl scripts get included
 # in the distribution
@@ -1323,13 +1595,16 @@ clobber_my_config_is_ok:
                exit 1; \
        fi
 
+# newer Test::Harness (v3.18-3.21) implementations get confused by executable
+# test scripts, so this rule chmod a-x's them first
 installcheck-local: clobber_my_config_is_ok $(SCRIPTS_PERL)
        rm -rf "$(AMANDA_TMPDIR)/installchecks"
        $(mkdir_p) "$(AMANDA_TMPDIR)/installchecks"
        @if test -f "$(CONFIG_DIR)/amanda-client.conf" -a ! -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \
            cp "$(CONFIG_DIR)/amanda-client.conf" "$(CONFIG_DIR)/amanda-client.conf.install-backup"; \
        fi 
-       $(PERL) -I$(srcdir) -I. -e 'use Test::Harness qw(&runtests); runtests(sort @ARGV);' $(tests)
+       for f in $(tests); do chmod a-x $$f; done
+       srcdir="$(srcdir)" $(PERL) -I$(srcdir) -I. -e 'use Test::Harness qw(&runtests); runtests(sort @ARGV);' $(tests)
        rm -rf "$(CONFIG_DIR)/TESTCONF"
        @if test -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \
            mv -f "$(CONFIG_DIR)/amanda-client.conf.install-backup" "$(CONFIG_DIR)/amanda-client.conf"; \
index 84d364ba07d8103ba09583bee894e1699cdf7926..800748554d07980174808cf4933404cad292833c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 16;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
index 04cef994d29bf7aeb87125b84de75eb997b1bc45..0c58e30fb07e6ba02dac1c856b89c2cd629dc7b8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 18;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
index 3c9f8b1f5997c090bace32a227b4f35633689700..552790d9c7d9e45d0d9a03dd54d84835526cbb8e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 3;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Run qw(run run_get);
@@ -37,7 +39,7 @@ like(run_get("$amlibexecdir/amcheck-device", "TESTCONF"),
     qr/Will write label 'TESTCONF01' to new volume/,
     "a run of amcheck-device on a new config succeeds");
 
-ok(!run("$amlibexecdir/amcheck-device", "TESTCONF", "-o", "label_new_tapes="),
+ok(!run("$amlibexecdir/amcheck-device", "TESTCONF", "-o", "autolabel="),
     "accepts config_overrides, returns exit status on failure");
 
 like(run_get("$amlibexecdir/amcheck-device", "TESTCONF", "-w"),
index 1c4c4dddb71c0bc302994e97259c1825923bab8f..f186d25812d2a2598658b5626aa5ded3d91710e7 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2007,2008 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2007, 2008, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 12;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
index e4c28e7afc8134f7e005a900ef3734a1b8cc903b..21fbdd501bbb445177f7e22ae58a10cc05218390 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2007,2008 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2007, 2008, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 9;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
@@ -72,7 +74,7 @@ like(run_get('amcheckdump', 'TESTCONF'), qr(Validating),
 
 my $vtape1 = Installcheck::Run::vtape_dir(1);
 opendir(my $vtape_dir, $vtape1) || die "can't opendir $vtape1: $!";
-@dump1 = grep { /^0+1/ } readdir($vtape_dir);
+my @dump1 = grep { /^0+1/ } readdir($vtape_dir);
 closedir $vtape_dir;
 
 for my $dumpfile (@dump1) {
index 15cffe1c2102f1c1b9f082debbb0971fc0ee8b4b..23184ffe67cd8d96427ff68f835b9645aa3be2fb 100644 (file)
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 17;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
@@ -42,14 +44,14 @@ like(run_err('amdevcheck', 'this-probably-doesnt-exist'), qr(could not open conf
 
 # this is re-created for each test
 $testconf = Installcheck::Config->new();
-$testconf->add_param("tapedev", '"/dev/null"');
+$testconf->add_param("tapedev", '"null:null"');
 $testconf->write();
 
 # test some defaults
-ok(run('amdevcheck', 'TESTCONF'), "run succeeds with a /dev/null tapedev");
+ok(run('amdevcheck', 'TESTCONF'), "run succeeds with a null tapedev");
 is_deeply([ sort split "\n", $Installcheck::Run::stdout],
-         [ sort "MESSAGE File /dev/null is not a tape device", "DEVICE_ERROR"],
-         "Fail with correct message for a /dev/null tapedev");
+         [ sort "MESSAGE Can't open NULL device for reading or appending.", "DEVICE_ERROR"],
+         "Fail with correct message for a null tapedev");
 
 ##
 # Now use a config with a vtape
@@ -62,7 +64,7 @@ $testconf->write();
 
 ok(run('amdevcheck', 'TESTCONF'), "run succeeds with an unlabeled tape");
 is_deeply([ sort split "\n", $Installcheck::Run::stdout],
-         [ sort "MESSAGE Error loading device header -- unlabeled volume?", "VOLUME_UNLABELED", "DEVICE_ERROR", "VOLUME_ERROR"],
+         [ sort "MESSAGE File 0 not found", "VOLUME_UNLABELED"],
          "..and output is correct");
 
 ok(run('amdevcheck', 'TESTCONF', "--properties"),
@@ -87,10 +89,10 @@ is_deeply([ sort split "\n", $Installcheck::Run::stdout],
                 "CANONICAL_NAME=file:" . Installcheck::Run::vtape_dir() ],
     ".. with correct results");
 
-ok(run('amdevcheck', 'TESTCONF', '/dev/null'),
+ok(run('amdevcheck', 'TESTCONF', 'null:null'),
     "can override device on the command line");
 is_deeply([ sort split "\n", $Installcheck::Run::stdout],
-         [ sort "MESSAGE File /dev/null is not a tape device", "DEVICE_ERROR"],
+         [ sort "MESSAGE Can't open NULL device for reading or appending.", "DEVICE_ERROR"],
     ".. and produce a corresponding error message");
 
 Installcheck::Dumpcache::load("basic");
index b685eba7d35c0fd36d3e3e0ef096cb37a2860238..603d45978ae698d6d7bfc480842082425843042f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 4;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Dumpcache;
diff --git a/installcheck/amflush.pl b/installcheck/amflush.pl
new file mode 100644 (file)
index 0000000..526b92e
--- /dev/null
@@ -0,0 +1,95 @@
+# Copyright (c) 2010 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use Test::More tests => 4;
+use strict;
+use warnings;
+
+use lib "@amperldir@";
+use File::Path;
+use Data::Dumper;
+use Installcheck;
+use Installcheck::Config;
+use Installcheck::Run qw(run run_err $diskname);
+use Amanda::Paths;
+use Amanda::Header;
+use Amanda::Debug;
+
+Amanda::Debug::dbopen("installcheck");
+
+my $testconf;
+my $vtape_dir;
+
+# write a fake holding file to holding disk, for amflush to flush
+sub write_holding_file {
+    my ($host, $disk) = @_;
+
+    my $datestamp = "20100102030405";
+    my $filename = "$Installcheck::Run::holdingdir/$datestamp/$host-somefile";
+
+    my $hdr = Amanda::Header->new();
+    $hdr->{'type'} = $Amanda::Header::F_DUMPFILE;
+    $hdr->{'datestamp'} = $datestamp;
+    $hdr->{'dumplevel'} = 0;
+    $hdr->{'name'} = $host;
+    $hdr->{'disk'} = $disk;
+    $hdr->{'program'} = "INSTALLCHECK";
+
+    mkpath($Installcheck::Run::holdingdir);
+    mkpath("$Installcheck::Run::holdingdir/$datestamp");
+    open(my $fh, ">", $filename) or die("opening '$filename': $!");
+    print $fh $hdr->to_string(32768,32768);
+    print $fh "some data!\n";
+    close($fh);
+}
+
+Installcheck::Run::cleanup();
+$testconf = Installcheck::Run::setup();
+$testconf->add_param("autolabel", '"TESTCONF%%" any');
+$testconf->add_dle("localhost $diskname installcheck-test");
+$testconf->write();
+
+# add a holding file that's in the disklist
+write_holding_file("localhost", $Installcheck::Run::diskname);
+
+ok(run("$sbindir/amflush", '-f', '-b', 'TESTCONF'),
+    "amflush runs successfully")
+    or diag($Installcheck::Run::stderr);
+
+# check that there's a vtape file where we expect to see one
+$vtape_dir = Installcheck::Run::vtape_dir(1);
+ok(<$vtape_dir/00001.*>, "..and dump appears on vtapes");
+
+Installcheck::Run::cleanup();
+$testconf = Installcheck::Run::setup();
+$testconf->add_param("autolabel", '"TESTCONF%%" any');
+# don't add anything to the disklist; it should still flush it
+$testconf->write();
+
+# add a holding file that's not in the disklist
+write_holding_file("localhost", $Installcheck::Run::diskname);
+
+ok(run("$sbindir/amflush", '-f', '-b', 'TESTCONF'),
+    "amflush runs successfully")
+    or diag($Installcheck::Run::stderr);
+
+# check that there's a vtape file where we expect to see one
+$vtape_dir = Installcheck::Run::vtape_dir(1);
+ok(<$vtape_dir/00001.*>, "..and dump appears on vtapes");
+
+#Installcheck::Run::cleanup();
index 01b88a2a8f96360920c1a5c2ab00d6b8479ea7f3..3d7f8d8ff02af0ae6b8812eb32b96b3b12649391 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 82;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
index 91058a1ae0c3d6af9323b140e067875b7af75ed8..e6ebc65564ac01abdc104ced3137aa82dece3421 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 103;
+use Test::More tests => 105;
 
 use strict;
 use warnings;
@@ -34,7 +34,8 @@ use Amanda::Debug;
 use Amanda::MainLoop;
 use Amanda::Header;
 use Amanda::Feature;
-use Amanda::Util;
+use Amanda::Paths;
+use Amanda::Util qw( slurp burp );
 
 Amanda::Debug::dbopen("installcheck");
 Installcheck::log_test_output();
@@ -56,12 +57,13 @@ my $debug = !exists $ENV{'HARNESS_ACTIVE'};
 #   bad_auth - send incorrect auth in OPTIONS (amandad only)
 #   holding_err - 'could not open' error from bogus holding file
 #   holding_no_colon_zero - do not append a :0 to the holding filename in DEVICE=
-#   no_config - do not send CONFIG=
 #   no_tapespec - do not send a tapespec in LABEL=, and send the first partnum in FSF=
 #      no_fsf - or don't send the first partnum in FSF= and leave amidxtaped to guess
 #   ndmp - using NDMP device (so expect directtcp connection)
 #   bad_cmd - send a bogus command line and expect an error
 #   bad_quoting - send a bogus DISK= without fe_amrecover_correct_disk_quoting
+#   recovery_limit - set a non-matching recovery-limit config
+#   no_peer_name - do not set AMANDA_AUTHENTICATED_PEER
 sub run_amidxtaped {
     my %params = @_;
     my $service;
@@ -72,6 +74,8 @@ sub run_amidxtaped {
     my $testmsg;
     my ($data_stream, $cmd_stream);
     my @events;
+    my $old_disklist;
+    my $disklist_file = "$CONFIG_DIR/TESTCONF/disklist";
 
     my $event = sub {
        my ($evt) = @_;
@@ -109,7 +113,6 @@ sub run_amidxtaped {
        return $params{'finished_cb'}->()
            if ($params{'holding_no_colon_zero'} and not $params{'holding'});
 
-
        $expect_error = ($params{'bad_auth'}
                         or $params{'holding_err'}
                         or $params{'bad_cmd'});
@@ -138,17 +141,29 @@ sub run_amidxtaped {
        $testmsg .= $params{'holding_err'}? "holding_err " : "";
        $testmsg .= $params{'ndmp'}? "ndmp " : "";
        $testmsg .= $params{'holding_no_colon_zero'}? "holding-no-:0 " : "";
-       $testmsg .= $params{'no_config'}? "no-config " : "";
        $testmsg .= $params{'no_tapespec'}? "no-tapespec " : "";
        $testmsg .= $params{'no_fsf'}? "no-fsf " : "";
        $testmsg .= $params{'bad_cmd'}? "bad_cmd " : "";
        $testmsg .= $params{'bad_quoting'}? "bad_quoting " : "";
+       $testmsg .= $params{'recovery_limit'}? "recovery_limit " : "";
+       $testmsg .= $params{'no_peer_name'}? "no_peer_name " : "";
+
+       # "hack" the disklist to check recovery_limit
+       if ($params{'recovery_limit'}) {
+           $old_disklist = slurp($disklist_file);
+           my $new_disklist = "localhost $diskname {\n installcheck-test\n".
+                   "recovery-limit \"some-other-host\"\n}\n";
+           burp($disklist_file, $new_disklist);
+       }
 
        diag("starting $testmsg") if $debug;
 
        $service = Installcheck::ClientService->new(
                emulate => $params{'emulate'},
                service => 'amidxtaped',
+               auth_peer =>
+                   ($params{'emulate'} eq 'amandad' && !$params{'no_peer_name'})?
+                       "localhost" : undef,
                process_done => $steps->{'process_done'});
 
        $steps->{'start'}->();
@@ -275,8 +290,7 @@ sub run_amidxtaped {
                $service->send($cmd_stream, "DATESTAMP=^$timestamp\$\r\n");
            }
        }
-       $service->send($cmd_stream, "CONFIG=TESTCONF\r\n")
-           unless $params{'no_config'};
+       $service->send($cmd_stream, "CONFIG=TESTCONF\r\n");
        if ($params{'digit_end'}) {
            $service->send($cmd_stream, "999\r\n"); # dunno why this works..
        } else {
@@ -316,11 +330,12 @@ sub run_amidxtaped {
     };
 
     step expect_feedme => sub  {
+       Amanda::Debug::debug("HERE");
        if ($params{'feedme'}) {
            $service->expect($cmd_stream,
                [ re => qr/^FEEDME TESTCONF01\r\n/, $steps->{'got_feedme'} ],
                [ re => qr/^MESSAGE [^\r]*\r\n/, $steps->{'got_message'} ]);
-       } elsif ($params{'holding_err'}) {
+       } elsif ($params{'holding_err'} || $params{'recovery_limit'}) {
            $steps->{'expect_err_message'}->();
        } else {
            $steps->{'expect_header'}->();
@@ -435,6 +450,8 @@ sub run_amidxtaped {
            $event->("ERR-INVAL-CMD");
        } elsif ($line =~ /^MESSAGE could not open.*/) {
            $event->('GOT-HOLDING-ERR');
+       } elsif ($line =~ /^MESSAGE No matching dumps found.*/) {
+           $event->('GOT-NOMATCH');
        } else {
            $event->('UNKNOWN-MSG');
        }
@@ -453,6 +470,11 @@ sub run_amidxtaped {
        # reset the alarm - the risk of deadlock has passed
        alarm(0);
 
+       # reset the disklist, if necessary
+       if ($old_disklist) {
+           burp($disklist_file, $old_disklist);
+       }
+
        # do a little bit of gymnastics to only treat this as one test
 
        my $ok = 1;
@@ -532,6 +554,12 @@ sub run_amidxtaped {
                        ($inetd and $params{'splits'})? ('GOT-CONNECT', 'DATA-SECURITY') : (),
                        'GOT-HOLDING-ERR', 'EXIT-0' );
            }
+           if ($params{'recovery_limit'}) {
+               @exp_events = (
+                       @sec_evts,
+                       'SEND-FEAT', 'GOT-FEAT', 'SENT-CMD',
+                       'GOT-NOMATCH', 'EXIT-0' );
+           }
            $ok = is_deeply([@events], [@exp_events],
                $testmsg);
        }
@@ -569,7 +597,7 @@ sub make_holding_file {
     $hdr->{'name'} = 'localhost';
     $hdr->{'disk'} = "$diskname";
     $hdr->{'program'} = "INSTALLCHECK";
-    print $fh $hdr->to_string(32768,32768);
+    $fh->syswrite($hdr->to_string(32768,32768), 32768);
 
     my $bytes_to_write = 131072;
     my $bufbase = substr((('='x127)."\n".('-'x127)."\n") x 4, 8, -3) . "1K\n";
@@ -653,6 +681,12 @@ for $emulate ('inetd', 'amandad') {
         holding_no_colon_zero => 1);
 }
 
+# missing peer name is not normally a problem
+test(emulate => 'amandad', no_peer_name => 1);
+
+# if the recovery_limit is given and not matching, we get an error..
+test(emulate => 'amandad', recovery_limit => 1);
+
 # bad authentication triggers an error message
 test(emulate => 'amandad', bad_auth => 1);
 
index fd5be1dab48ee0bfa9d6223cbef85592e61b9085..92f45346672a19cbba4d103ecc1334615b08f4af 100644 (file)
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 19;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
@@ -58,7 +60,7 @@ $dev->finish()
     or BAIL_OUT("device error");
 
 my $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST));
-my $tl = Amanda::Tapelist::read_tapelist($tlf);
+my $tl = Amanda::Tapelist->new($tlf, 1);
 $tl->add_tapelabel("0", "TESTCONF13", "test tape");
 $tl->write($tlf);
 
@@ -74,8 +76,8 @@ like(run_get('amlabel', 'TESTCONF', 'TESTCONF92'),
     qr/Writing label 'TESTCONF92'/,
     "amlabel labels the current slot by default");
 
-$tl = Amanda::Tapelist::read_tapelist($tlf);
-is_deeply($tl->[0], {
+$tl->reload();
+is_deeply($tl->{'tles'}->[0], {
        'reuse' => 1,
        'comment' => undef,
        'position' => 1,
diff --git a/installcheck/amoverview.pl b/installcheck/amoverview.pl
new file mode 100644 (file)
index 0000000..60ef71c
--- /dev/null
@@ -0,0 +1,79 @@
+# Copyright (c) 2007, 2008, 2010 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use Test::More tests => 4;
+use strict;
+use warnings;
+
+use lib "@amperldir@";
+use Installcheck::Config;
+use Installcheck::Dumpcache;
+use Installcheck::Catalogs;
+use Installcheck::Run qw(run run_get run_err $diskname);
+use Amanda::Paths;
+use Amanda::Debug;
+
+Amanda::Debug::dbopen("installcheck");
+
+##
+# First, try amoverview without a config
+
+ok(!run('amoverview'),
+    "amoverview with no arguments returns an error exit status");
+like($Installcheck::Run::stderr, qr/\AUSAGE:/i,
+    ".. and gives usage message on stderr");
+
+##
+# Now try it against a cached dump
+
+Installcheck::Dumpcache::load("multi");
+
+like(run_get('amoverview', 'TESTCONF'),
+    # this pattern is pretty loose, but that's OK
+    qr{
+       \s+date\s+\d\d\s+
+       host\s+disk\s+\d\d\s+
+       localhos\s+/.*\s+00\s+
+       localhos\s+/.*\s+01
+    }mxs,
+    "amoverview of the 'multi' dump looks good");
+
+Installcheck::Run::cleanup();
+
+##
+# And some cached catalogs
+
+my $testconf = Installcheck::Run::setup();
+$testconf->write();
+
+my $cat = Installcheck::Catalogs::load("bigdb");
+$cat->install();
+
+like(run_get('amoverview', 'TESTCONF', '--skipmissed'),
+    qr{
+\s*              date      \s+ 01\s+02\s+03\s+03\s+04\s+05\s+05\s+06\s+07 \s+
+\s*  host \s+    disk      \s+ 11\s+22\s+11\s+13\s+14\s+11\s+15\s+16\s+22 \s+
+\s*
+\s*  lovelace\s+ /home/ada \s+  -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ 3 \s+
+\s*  otherbox\s+ /direct   \s+  -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ 0\s+ -\s+ - \s+
+\s*  otherbox\s+ /lib      \s+  -\s+ -\s+ -\s+ 0\s+1E\s+ 0\s+ -\s+ -\s+ - \s+
+\s*  otherbox\s+ /usr/bin  \s+  -\s+ -\s+00\s+ -\s+ -\s+ 0\s+ -\s+ -\s+ - \s+
+\s*  somebox \s+ /lib      \s+  0\s+ 0\s+ -\s+ 0\s+ -\s+ -\s+ 0\s+ E\s+ - \s+
+\s*  somebox \s+ /usr/bin  \s+  -\s+ -\s+ -\s+ 1\s+ -\s+ -\s+ 1\s+ 1\s+ -
+    }mxs,
+    "amoverview of the bigdb catalog looks right");
index fa1ffca45cbb4ff35b8bbe40e8603f3bb649ed4e..2362d9737460ecdb2be35ec2db75564e7be510b6 100644 (file)
@@ -79,8 +79,9 @@ sub run_amrecover {
     my @commands = @{$params{'commands'}};
 
     cleandir();
+    my @h_opt = ('-h', 'localhost') unless $set_host_succeed;
     $exp = Installcheck::Run::run_expect('amrecover', 'TESTCONF',
-       '-t', 'localhost', '-o', 'auth=local');
+       @h_opt, '-s', 'localhost', '-t', 'localhost', '-o', 'auth=local');
     $exp->log_stdout($debug);
 
     @results = ();
@@ -138,7 +139,7 @@ run_amrecover(
 
 is_deeply([ @results ], [
        'server-ready', 'config-set',
-       ($set_host_succeed) ? 'host-set' : 'use-sethost',
+       'host-set',
        '> sethost localhost',
        'host-set',
        "> setdisk $diskname",
@@ -171,7 +172,7 @@ run_amrecover(
 
 is_deeply([ @results ], [
        'server-ready', 'config-set',
-       ($set_host_succeed) ? 'host-set' : 'use-sethost',
+       'host-set',
        '> sethost localhost ',
        'host-set',
        '> sethost localhost',
index 763f71b37e4367c449ed114f77dbf4383068407c..345a024dfcd83703b53539da684ed5aacb1adbb3 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 156;
+use Test::More tests => 166;
 
 use strict;
 use warnings;
@@ -25,11 +25,12 @@ use lib "@amperldir@";
 
 use Installcheck;
 use Installcheck::Run qw( run run_get run_err );
+use Installcheck::Catalogs;
 use Amanda::Paths;
 use Amanda::Constants;
 use Amanda::Util qw( slurp burp );
 use Amanda::Debug;
-use Amanda::Config qw (:getconf);
+use Amanda::Config qw ( :init :getconf );
 
 # easy knob to twiddle to check amreport_new instead
 my $amreport = "amreport";
@@ -62,14 +63,17 @@ my $mail_output = "$Installcheck::TMP/mail-output";
 $ENV{'INSTALLCHECK_MOCK_MAIL_OUTPUT'} = $mail_output;
 my $mail_mock = abs_path("mock") . "/mail";
 
-my $old_log_filename="$Installcheck::TMP/installcheck-log.datastamp.0";
-my $current_log_filename="$Installcheck::TMP/log";
+my $cat;
+my $alternate_log_filename="$Installcheck::TMP/installcheck-log";
+my $current_log_filename="$Installcheck::CONFIG_DIR/TESTCONF/log/log";
 my $out_filename="$Installcheck::TMP/installcheck-amreport-output";
 
 sub setup_config {
     my %params = @_;
     my $testconf = Installcheck::Run::setup();
 
+    cleanup();
+
     my $mailer =
         $params{want_mailer}  ? "\"$mail_mock\""
       : $params{bogus_mailer} ? "\"$mail_mock.bogus\""
@@ -91,17 +95,29 @@ sub setup_config {
         exists $params{send_amreport} ? uc($params{send_amreport}) : "ALL"
     );
 
-    $testconf->remove_param('logdir');
-    $testconf->add_param('logdir', "\"$Installcheck::TMP\"");
+    if (defined $params{'runtapes'}) {
+       $testconf->remove_param('runtapes');
+       $testconf->add_param('runtapes', $params{'runtapes'});
+    }
+    if (defined $params{'tapecycle'}) {
+       $testconf->remove_param('tapecycle');
+       $testconf->add_param('tapecycle', $params{'tapecycle'});
+    }
+
     $testconf->write();
+
+    undef $cat;
+    if ($params{'catalog'}) {
+       $cat = Installcheck::Catalogs::load($params{'catalog'});
+       $cat->install();
+    }
 }
 
 sub cleanup {
-    unlink $old_log_filename;
-    unlink $current_log_filename;
     unlink $out_filename;
     unlink $mail_output;
     unlink $printer_output;
+    unlink $alternate_log_filename;
 }
 
 # compare two multiline strings, giving a diff if they do not match
@@ -178,39 +194,11 @@ sub make_mail {
 EOF
 }
 
-## read __DATA__ to a hash, keyed by the names following '%%%%'
-
-my %datas;
-my $key = undef;
-while (<DATA>) {
-    if (/^%%%% (.*)/) {
-       $key = $1;
-    } else {
-       $datas{$key} .= $_;
-    }
-}
-
-## and make a very long logfile
-{
-    my $trigger_line = "  . /bin/tar: ./var/run/acpid.socket: socket ignored\n";
-    my $replacement = "  | /bin/tar: something crazy!\n" x 1000;
-    $datas{'longstrange'} = $datas{'shortstrange'};
-    $datas{'longstrange'} =~
-       s{$trigger_line}{$replacement};
-
-    # this set of 1000 lines is shortened in the report..
-    $trigger_line = "--LINE-REPLACED-BY-91-LINES--\n";
-    $replacement = "  | /bin/tar: something crazy!\n" x 91;
-    $datas{'longstrange-rpt'} =~
-       s{$trigger_line}{$replacement};
-}
-
 ## try a few various options with a pretty normal logfile.  Note that
 ## these tests all use amreport's script mode
 
-setup_config(want_mailer => 1, want_mailto => 1, want_template => 1);
-cleanup();
-burp($current_log_filename, $datas{'normal'});
+setup_config(catalog => 'normal',
+    want_mailer => 1, want_mailto => 1, want_template => 1);
 
 like(run_err($amreport, 'TESTCONF-NOSUCH'),
     qr/could not open conf/,
@@ -229,12 +217,14 @@ like(run_get($amreport, 'TESTCONF-NOSUCH', '--version'),
 ok(run($amreport, 'TESTCONF', '--from-amdump'),
     "amreport, as run from amdump, with mailer, mailto, and a template")
     or diag($Installcheck::Run::stderr);
+
 is($Installcheck::Run::stdout, "", "..produces no output");
 results_match($mail_output,
-    make_mail($datas{'normal-rpt1'}, "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
+    make_mail($cat->get_text('rpt1'), "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
     "..mail matches");
+
 results_match($printer_output,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
 ok(run($amreport, 'TESTCONF', '--from-amdump', '/garbage/directory/'),
@@ -242,56 +232,54 @@ ok(run($amreport, 'TESTCONF', '--from-amdump', '/garbage/directory/'),
     or diag($Installcheck::Run::stderr);
 is($Installcheck::Run::stdout, "", "..produces no output");
 results_match($mail_output,
-    make_mail($datas{'normal-rpt1'}, "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
+    make_mail($cat->get_text('rpt1'), "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
     "..mail matches");
 results_match($printer_output,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
 ok(run($amreport, 'TESTCONF', '-M', 'somebody@localhost'),
     "amreport -M, with mailer, mailto, and a template")
     or diag($Installcheck::Run::stderr);
 is($Installcheck::Run::stdout, "", "..produces no output");
 results_match($mail_output,
-    make_mail($datas{'normal-rpt1'}, "DailySet1", 0, "February 25, 2009", "somebody\@localhost"),
+    make_mail($cat->get_text('rpt1'), "DailySet1", 0, "February 25, 2009", "somebody\@localhost"),
     "..mail matches");
 results_match($printer_output,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
-like(run_get($amreport, 'TESTCONF', '-i'),
-    qr/nothing to do/,
-    "amreport -i, with mailer, mailto, and a template, prints an error but exit==0");
+ok(run($amreport, 'TESTCONF', '-i'),
+    "amreport -i, with mailer, mailto, and a template => no error");
+ok(! -f $mail_output,
+    "..doesn't mail");
+ok(! -f $printer_output,
+    "..doesn't print");
 
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
 ok(run($amreport, 'TESTCONF', '-p', $out_filename),
     "amreport -p, with mailer, mailto, and a template")
     or diag($Installcheck::Run::stderr);
 is($Installcheck::Run::stdout, "", "..produces no output");
 results_match($mail_output,
-    make_mail($datas{'normal-rpt1'}, "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
+    make_mail($cat->get_text('rpt1'), "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
     "..mail matches");
 ok(! -f $printer_output,
     "..doesn't print");
-results_match($out_filename, $datas{'normal-postscript'}, "..postscript file matches");
+results_match($out_filename, $cat->get_text('postscript'), "..postscript file matches");
 
 # test a bare 'amreport', which should now output to stdout
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
 ok(run($amreport, 'TESTCONF'),
     "amreport with no other options outputs to stdout for user convenience")
   or diag($Installcheck::Run::stderr);
-results_match('stdout', $datas{'normal-rpt1'},
+results_match('stdout', $cat->get_text('rpt1'),
     "..output matches");
 ok(!-f $printer_output, "..no printer output")
   or diag("error: printer output!:\n" . burp($printer_output));
@@ -300,12 +288,11 @@ ok(!-f $mail_output, "..no mail output")
 
 # test long-form file option
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
 ok(run($amreport, 'TESTCONF', "--text=$out_filename"),
     "amreport --text=foo, no other options")
   or diag($Installcheck::Run::stderr);
-results_match($out_filename, $datas{'normal-rpt1'},
+results_match($out_filename, $cat->get_text('rpt1'),
     "..output matches");
 ok(!-f $printer_output, "..no printer output")
   or diag("error: printer output!:\n" . burp($printer_output));
@@ -314,27 +301,27 @@ ok(!-f $mail_output, "..no mail output")
 
 # test long form postscript option
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
 ok(
     run($amreport, 'TESTCONF', '--ps', $out_filename),
     "amreport --ps foo, no other options"
 );
-results_match($out_filename, $datas{"normal-postscript"}, '..results match');
+results_match($out_filename, $cat->get_text('postscript'), '..results match');
 ok(!-f $printer_output, "..no printer output");
 ok(!-f $mail_output, "..no mail output");
 
 cleanup();
 
 # test new mail option, using config mailto
-setup_config(want_mailer => 1, want_mailto => 1, want_template => 1);
-burp($current_log_filename, $datas{'normal'});
+setup_config(catalog => 'normal',
+            want_mailer => 1, want_mailto => 1, want_template => 1);
+
 ok(run($amreport, 'TESTCONF', '--mail-text'),
     "amreport --mail-text, no other options, built-in mailto");
 results_match(
     $mail_output,
     make_mail(
-        $datas{'normal-rpt1'}, "DailySet1", 0,
+        $cat->get_text('rpt1'), "DailySet1", 0,
         "February 25, 2009",   "nobody\@localhost"
     ),
     "..mail matches"
@@ -345,13 +332,12 @@ ok(!-f $out_filename,   "..no file output");
 cleanup();
 
 # test new mail option, using passed mailto
-burp($current_log_filename, $datas{'normal'});
 ok(run($amreport, 'TESTCONF', '--mail-text=somebody@localhost',),
     'amreport --mail-text=somebody\@localhost, no other options');
 results_match(
     $mail_output,
     make_mail(
-        $datas{'normal-rpt1'}, "DailySet1", 0,
+        $cat->get_text('rpt1'), "DailySet1", 0,
         "February 25, 2009",   "somebody\@localhost"
     ),
     "..mail matches"
@@ -361,13 +347,13 @@ ok(!-f $out_filename, "..no file output");
 
 cleanup();
 
-# test long-form old log option
-burp($old_log_filename, $datas{'normal'});
+# test long-form log option
+burp($alternate_log_filename, $cat->get_file('log/log'));
 ok(
-    run($amreport, 'TESTCONF', '--log', $old_log_filename),
+    run($amreport, 'TESTCONF', '--log', $alternate_log_filename),
     "amreport --log with old log, no other config options"
 );
-results_match('stdout', $datas{'normal-rpt1'},
+results_match('stdout', $cat->get_text('rpt1'),
     '..stdout output matches');
 ok(!-f $mail_output, "..no mail output");
 ok(!-f $out_filename, "..no file output");
@@ -376,22 +362,21 @@ ok(!-f $printer_output, "..no printer output");
 cleanup();
 
 # test long-form print option, without specified printer
-setup_config(want_template => 1);
-burp($current_log_filename, $datas{'normal'});
+setup_config(catalog => 'normal', want_template => 1);
 ok(run($amreport, 'TESTCONF', '--print'),
     'amreport --print, no other options');
 results_match(
     $printer_output,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches"
 );
 ok(!-f $mail_output,  "..no mail output");
 ok(!-f $out_filename, "..no file output");
 
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
-setup_config(want_mailer => 1, want_mailto => 1, want_template => 1);
+setup_config(catalog => 'normal',
+    want_mailer => 1, want_mailto => 1, want_template => 1);
 ok(run($amreport, 'TESTCONF', '-i', '-p', $out_filename),
     "amreport -i -p, with mailer, mailto, and a template")
     or diag($Installcheck::Run::stderr);
@@ -401,11 +386,10 @@ ok(! -f $mail_output,
 ok(! -f $printer_output,
     "..doesn't print");
 results_match($out_filename,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..postscript output in -p file matches");
 
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
 ok(run($amreport, 'TESTCONF', '-i', '-f', $out_filename),
     "amreport -i -f, with mailer, mailto, and a template")
@@ -414,110 +398,86 @@ is($Installcheck::Run::stdout, "", "..produces no output");
 ok(! -f $mail_output,
     "..produces no mail");
 results_match($printer_output,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 results_match($out_filename,
-    $datas{'normal-rpt1'},
+    $cat->get_text('rpt1'),
     "..report output in -f file matches");
 
 cleanup();
-burp($old_log_filename, $datas{'normal'});
 
-ok(run($amreport, 'TESTCONF', '-l', $old_log_filename),
+burp($alternate_log_filename, $cat->get_file('log/log'));
+ok(run($amreport, 'TESTCONF', '-l', $alternate_log_filename),
     "amreport -l, with mailer, mailto, and a template")
     or diag($Installcheck::Run::stderr);
 is($Installcheck::Run::stdout, "", "..produces no output");
 results_match($mail_output,
-    make_mail($datas{'normal-rpt1'}, "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
+    make_mail($cat->get_text('rpt1'), "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
     "..mail matches");
 results_match($printer_output,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-setup_config(want_mailer => 1);
-cleanup();
-burp($current_log_filename, $datas{'normal'});
+setup_config(catalog => 'normal',
+    want_mailer => 1);
 
-like(run_get($amreport, 'TESTCONF', '--from-amdump'),
-    qr/nothing to do/,
-    "amreport --from-amdump, with mailer but no mailto and no template, "
-    . "prints an error but exit==0");
+ok(run($amreport, 'TESTCONF', '--from-amdump'),
+    "amreport --from-amdump, with mailer but no mailto and no template => exit==0");
 ok(! -f $mail_output, "..doesn't mail");
 ok(! -f $printer_output, "..doesn't print");
 
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
 ok(run($amreport, 'TESTCONF', '--from-amdump', '-o', 'mailto=hello'),
     "amreport -o to set mailto, with mailer but no mailto and no template")
     or diag($Installcheck::Run::stderr);
 is($Installcheck::Run::stdout, "", "..produces no output");
 results_match($mail_output,
-    make_mail($datas{'normal-rpt1'}, "DailySet1", 0, "February 25, 2009", "hello"),
+    make_mail($cat->get_text('rpt1'), "DailySet1", 0, "February 25, 2009", "hello"),
     "..mail matches");
 ok(! -f $printer_output,
     "..doesn't print");
 
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
 like(run_err($amreport, 'TESTCONF', '--from-amdump', '-o', 'mailto=ill\egal'),
-    qr/mail address has invalid characters/,
+    qr/mail addresses have invalid characters/,
     "amreport with illegal email in -o, with mailer but no mailto and no template, errors out");
 
-setup_config(want_mailer => 1, want_template => 1);
-cleanup();
-burp($current_log_filename, $datas{'normal'});
+setup_config(catalog => 'normal',
+    want_mailer => 1, want_template => 1);
 
-like(run_get($amreport, 'TESTCONF', '--from-amdump'),
-    qr/nothing to do/, ## this is arguably a bug, but we'll keep it
+ok(run($amreport, 'TESTCONF', '--from-amdump'),
     "no-args amreport with mailer, no mailto, and a template does nothing even though it could "
-       . "print a label");
+       . "print a label"); # arguably a bug, but we'll keep it for now
 ok(! -f $mail_output, "..doesn't mail");
 ok(! -f $printer_output, "..doesn't print");
 
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
 ok(run($amreport, 'TESTCONF', '--from-amdump', '-o', 'mailto=dustin'),
     "amreport with mailer, no mailto, and a template, but mailto in config override works")
     or diag($Installcheck::Run::stderr);
 is($Installcheck::Run::stdout, "", "..produces no output");
 results_match($mail_output,
-    make_mail($datas{'normal-rpt1'}, "DailySet1", 0, "February 25, 2009", "dustin"),
+    make_mail($cat->get_text('rpt1'), "DailySet1", 0, "February 25, 2009", "dustin"),
     "..mail matches");
 results_match($printer_output,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-cleanup();
-burp($current_log_filename, $datas{'doublefailure'});
-
-ok(!run($amreport, 'TESTCONF', '-M', 'dustin'),
-    "amreport with log in error")
-    or diag($Installcheck::Run::stderr);
-is($Installcheck::Run::stdout, "", "..produces no output");
-results_match($mail_output,
-    make_mail($datas{'doublefailure-rpt'}, "DailySet1", 1, "March 26, 2009", "dustin"),
-    "..mail matches");
-
-cleanup();
-burp($current_log_filename, $datas{'normal'});
-
 ok(run($amreport, 'TESTCONF', '-M', 'pcmantz'),
     "amreport with mailer, no mailto, and a template, but mailto in -M works")
     or diag($Installcheck::Run::stderr);
 is($Installcheck::Run::stdout, "", "..produces no output");
 results_match($mail_output,
-    make_mail($datas{'normal-rpt1'}, "DailySet1", 0, "February 25, 2009", "pcmantz"),
+    make_mail($cat->get_text('rpt1'), "DailySet1", 0, "February 25, 2009", "pcmantz"),
     "..mail matches");
 results_match($printer_output,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-setup_config(want_template => 1);
-cleanup();
-burp($current_log_filename, $datas{'normal'});
+setup_config(catalog => 'normal', want_template => 1);
 
 like(run_get($amreport, 'TESTCONF', '-M', 'martineau'),
     qr/Warning: a mailer is not defined/,
@@ -526,22 +486,20 @@ like(run_get($amreport, 'TESTCONF', '-M', 'martineau'),
 ok(! -f $mail_output, "..doesn't mail");
 ok(! -f $printer_output, "..doesn't print");
 
-setup_config(want_mailer => 1, want_mailto => 1);
-cleanup();
-burp($current_log_filename, $datas{'normal'});
+setup_config(catalog => 'normal',
+       want_mailer => 1, want_mailto => 1);
 
 ok(run($amreport, 'TESTCONF', '-p', $out_filename), # XXX another probable bug
     "amreport with mailer, mailto, but no template, ignores -p option ")
     or diag($Installcheck::Run::stderr);
 is($Installcheck::Run::stdout, "", "..produces no output");
 results_match($mail_output,
-    make_mail($datas{'normal-rpt1'}, "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
+    make_mail($cat->get_text('rpt1'), "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
     "..mail matches");
 ok(! -f $printer_output,
     "..doesn't print");
 
 cleanup();
-burp($current_log_filename, $datas{'normal'});
 
 ok(run($amreport, 'TESTCONF', '-o', "tapetype:TEST-TAPE-TEMPLATE:lbl_templ=$ps_template",
                                            '-p', $out_filename),
@@ -549,15 +507,14 @@ ok(run($amreport, 'TESTCONF', '-o', "tapetype:TEST-TAPE-TEMPLATE:lbl_templ=$ps_t
     or diag($Installcheck::Run::stderr);
 is($Installcheck::Run::stdout, "", "..produces no output");
 results_match($mail_output,
-    make_mail($datas{'normal-rpt1'}, "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
+    make_mail($cat->get_text('rpt1'), "DailySet1", 0, "February 25, 2009", "nobody\@localhost"),
     "..mail matches");
 results_match($out_filename,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-cleanup();
-burp($current_log_filename, $datas{'normal'});
-setup_config(bogus_mailer => 1, want_mailto => 1, want_template => 1);
+setup_config(catalog => 'normal',
+       bogus_mailer => 1, want_mailto => 1, want_template => 1);
 
 ok(run($amreport, 'TESTCONF', '--from-amdump'),
     "amreport with bogus mailer; doesn't mail, still prints")
@@ -566,13 +523,12 @@ ok(!-f $mail_output, "..produces no mail output");
 is($Installcheck::Run::stdout, "", "..produces no stdout output");
 results_match(
     $printer_output,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches"
 );
 
-cleanup();
-burp($current_log_filename, $datas{'normal'});
 setup_config(
+    catalog => 'normal',
     want_mailer   => 1,
     want_mailto   => 1,
     want_template => 1,
@@ -588,1870 +544,235 @@ is($Installcheck::Run::stdout, "", "..produces no stdout output")
   or diag($Installcheck::Run::stdout);
 results_match(
     $printer_output,
-    $datas{'normal-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches"
 );
 
 ## test columnspec adjustments, etc.
 
-cleanup();
-setup_config();
-burp($current_log_filename, $datas{'normal'});
+setup_config(catalog => 'normal');
 
 ok(run($amreport, 'TESTCONF', '-f', $out_filename, '-o', 'columnspec=OrigKB=::2'),
     "amreport with OrigKB=::2");
-results_match($out_filename, $datas{'normal-rpt2'},
+results_match($out_filename, $cat->get_text('rpt2'),
     "..result matches");
 
 ok(run($amreport, 'TESTCONF', '-f', $out_filename, '-o', 'columnspec=OrigKB=:5'),
     "amreport with OrigKB=:5");
-results_match($out_filename, $datas{'normal-rpt3'},
+results_match($out_filename, $cat->get_text('rpt3'),
     "..result matches");
 
 ok(run($amreport, 'TESTCONF', '-f', $out_filename, '-o', 'columnspec=OrigKB=:5:6'),
     "amreport with OrigKB=:5:6");
-results_match($out_filename, $datas{'normal-rpt4'},
+results_match($out_filename, $cat->get_text('rpt4'),
     "..result matches");
-# TODO: do a lot more tests of the colspec stuff
 
 ok(run($amreport, 'TESTCONF', '-f', $out_filename, '-o', 'displayunit=m'),
     "amreport with displayunit=m");
-results_match($out_filename, $datas{'normal-rpt5'},
+results_match($out_filename, $cat->get_text('rpt5'),
     "..result matches");
 
+setup_config(catalog => 'doublefailure',
+    want_mailer => 1, want_template => 1);
+
+ok(!run($amreport, 'TESTCONF', '-M', 'dustin'),
+    "amreport with log in error")
+    or diag($Installcheck::Run::stderr);
+is($Installcheck::Run::stdout, "", "..produces no output");
+results_match($mail_output,
+    make_mail($cat->get_text('report'), "DailySet1", 1, "March 26, 2009", "dustin"),
+    "..mail matches");
+
 ## some (anonymized) real logfiles, for regression testing
 
-cleanup();
-setup_config(want_template => 1);
-burp($current_log_filename, $datas{'strontium'});
+setup_config(catalog => 'strontium', want_template => 1);
 
 ok(run($amreport, 'TESTCONF', '-f', $out_filename),
     "amreport with strontium logfile (simple example with multiple levels)");
-results_match($out_filename, $datas{'strontium-rpt'},
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 results_match($printer_output,
-    $datas{'strontium-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-cleanup();
-burp($current_log_filename, $datas{'amflush'});
+setup_config(catalog => 'amflush', want_template => 1);
 
 ok(run($amreport, 'TESTCONF', '-f', $out_filename),
     "amreport with amflush logfile (regression check for flush-related DUMP STATUS)");
-results_match($out_filename, $datas{'amflush-rpt'},
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 results_match($printer_output,
-    $datas{'amflush-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-cleanup();
-burp($current_log_filename, $datas{'resultsmissing'});
+setup_config(catalog => 'resultsmissing', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
-is($Installcheck::Run::exit_code, 8,
-    "amreport with resultsmissing logfile ('RESULTS MISSING') exit==8");
-results_match($out_filename, $datas{'resultsmissing-rpt'},
+is($Installcheck::Run::exit_code, 12,
+    "amreport with resultsmissing logfile ('RESULTS MISSING') exit==12");
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 results_match($printer_output,
-    $datas{'resultsmissing-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-cleanup();
-burp($current_log_filename, $datas{'shortstrange'});
+setup_config(catalog => 'shortstrange', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
 is($Installcheck::Run::exit_code, 2,
     "amreport with shortstrange logfile exit==2");
-results_match($out_filename, $datas{'shortstrange-rpt'},
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 results_match($printer_output,
-    $datas{'shortstrange-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-cleanup();
-burp($current_log_filename, $datas{'longstrange'});
+setup_config(catalog => 'longstrange', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
 is($Installcheck::Run::exit_code, 2,
     "amreport with longstrange logfile exit==2");
-results_match($out_filename, $datas{'longstrange-rpt'},
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 
-cleanup();
-burp($current_log_filename, $datas{'doublefailure'});
+setup_config(catalog => 'doublefailure', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
 is($Installcheck::Run::exit_code, 4,
     "amreport with doublefailure logfile exit==4");
-results_match($out_filename, $datas{'doublefailure-rpt'},
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 results_match($printer_output,
-    $datas{'doublefailure-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-cleanup();
-burp($current_log_filename, $datas{'bigestimate'});
+setup_config(catalog => 'bigestimate', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
 is($Installcheck::Run::exit_code, 0,
     "amreport with bigestimate logfile exit==0");
-results_match($out_filename, $datas{'bigestimate-rpt'},
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 results_match($printer_output,
-    $datas{'bigestimate-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-cleanup();
-burp($current_log_filename, $datas{'retried'});
+setup_config(catalog => 'retried', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
 is($Installcheck::Run::exit_code, 4,
     "amreport with retried logfile exit==4");
-results_match($out_filename, $datas{'retried-rpt'},
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 results_match($printer_output,
-    $datas{'retried-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-cleanup();
-# if the 'FINISH DRIVER' line is missing, then the dumps did not finish
-# properly, and the runtime is 0:00. We'll simulate that by "adjusting"
-# the retried logfile.  First, lose the final line
-$datas{'retried'} =~ s/^FINISH driver.*\n//m;
-# and correspondingly add "FAILED" message to report
-$datas{'retried-rpt'} = "*** THE DUMPS DID NOT FINISH PROPERLY!\n"
-                       . $datas{'retried-rpt'};
-# and adjust the runtime
-$datas{'retried-rpt'} =~ s{(Run Time .*)21:32}{$1 0:00};
-burp($current_log_filename, $datas{'retried'});
+setup_config(catalog => 'retried-strange');
+
+run($amreport, 'TESTCONF', '-f', $out_filename);
+is($Installcheck::Run::exit_code, 6,
+    "amreport with retried logfile, with strange exit==6");
+results_match($out_filename, $cat->get_text('report'),
+    "..result matches");
+
+setup_config(catalog => 'retried-nofinish', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
 is($Installcheck::Run::exit_code, 4,
     "amreport with retried logfile where driver did not finish exit==4");
-results_match($out_filename, $datas{'retried-rpt'},
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 
-cleanup();
-burp($current_log_filename, $datas{'taperr'});
+setup_config(catalog => 'taperr', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
 is($Installcheck::Run::exit_code, 16,
     "amreport with taperr logfile exit==16");
-results_match($out_filename, $datas{'taperr-rpt-holding'},
+results_match($out_filename, $cat->get_text('report-holding'),
     "..result matches");
 ok((-f $printer_output and -z $printer_output),
     "..printer output exists but is empty");
-cleanup();
-burp($old_log_filename, $datas{'taperr'});
+
+burp($alternate_log_filename, $cat->get_file('log/log'));
 
 # use an explicit -l here so amreport doesn't try to look at the holding disk
-run($amreport, 'TESTCONF', '-f', $out_filename, '-l', $old_log_filename);
+run($amreport, 'TESTCONF', '-f', $out_filename, '-l', $alternate_log_filename);
 is($Installcheck::Run::exit_code, 16,
     "amreport with taperr logfile specified explicitly exit==16");
-results_match($out_filename, $datas{'taperr-rpt-noholding'},
+results_match($out_filename, $cat->get_text('report-noholding'),
     "..result matches");
 
-cleanup();
-burp($current_log_filename, $datas{'spanned'});
+setup_config(catalog => 'spanned', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
 is($Installcheck::Run::exit_code, 0,
     "amreport with spanned logfile");
-results_match($out_filename, $datas{'spanned-rpt'},
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 results_match($printer_output,
-    $datas{'spanned-postscript'},
+    $cat->get_text('postscript'),
     "..printer output matches");
 
-cleanup();
-burp($current_log_filename, $datas{'fatal'});
+setup_config(catalog => 'fatal', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
-is($Installcheck::Run::exit_code, 13,
+is($Installcheck::Run::exit_code, 5,
     "amreport with fatal logfile");
-results_match($out_filename, $datas{'fatal-rpt'},
+results_match($out_filename, $cat->get_text('report'),
     "..result matches");
 ok(-f $printer_output && -z $printer_output,
     "..printer output is empty (no dumps, no tapes)");
 
-cleanup();
-burp($current_log_filename, $datas{'flush-origsize'});
+setup_config(catalog => 'flush-origsize', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
 is($Installcheck::Run::exit_code, 0,
-    "..exit status is correct");
-results_match($out_filename, $datas{'flush-origsize-rpt'},
-    "..result matches flush-origsize-rpt");
+    "amreport with flush-origsize");
+results_match($out_filename, $cat->get_text('report'),
+    "..result matches");
 
-cleanup();
-burp($current_log_filename, $datas{'flush-noorigsize'});
+setup_config(catalog => 'flush-noorigsize', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
 is($Installcheck::Run::exit_code, 0,
-    "..exit status is correct");
-results_match($out_filename, $datas{'flush-noorigsize-rpt'},
-    "..result matches flush-origsize-rpt");
+    "amreport with flush-noorigsize");
+results_match($out_filename, $cat->get_text('report'),
+    "..result matches");
 
-cleanup();
-burp($current_log_filename, $datas{'plannerfail'});
+setup_config(catalog => 'plannerfail', want_template => 1);
 
 run($amreport, 'TESTCONF', '-f', $out_filename);
-is($Installcheck::Run::exit_code, 12,
-    "..exit status is correct (failed|missing)");
-results_match($out_filename, $datas{'plannerfail-rpt'},
-    "..result matches plannerfail-rpt");
+is($Installcheck::Run::exit_code, 4,
+    "amreport with a planner failure (failed)");
+results_match($out_filename, $cat->get_text('report'),
+    "..result matches");
 
-cleanup();
+setup_config(catalog => 'skipped', want_template => 1);
 
-__DATA__
-%%%% normal
-INFO amdump amdump pid 23649
-INFO planner planner pid 23682
-DISK planner localhost.localdomain /boot1
-DISK planner localhost.localdomain /boot2
-DISK planner localhost.localdomain /boot3
-DISK planner localhost.localdomain /boot4
-DISK planner localhost.localdomain /boot5
-DISK planner localhost.localdomain /boot6
-DISK planner localhost.localdomain /boot7
-DISK planner localhost.localdomain /boot8
-DISK planner localhost.localdomain /boot9
-START planner date 20090225080737
-INFO driver driver pid 23684
-START driver date 20090225080737
-STATS driver hostname localhost.localdomain
-STATS driver startup time 0.004
-INFO dumper dumper pid 23686
-INFO taper taper pid 23685
-FINISH planner date 20090225080737 time 0.084
-INFO planner pid-done 23682
-INFO chunker chunker pid 23733
-INFO dumper gzip pid 23738
-SUCCESS dumper localhost.localdomain /boot1 20090225080737 0 [sec 1.585 kb 12 kps 24748.4 orig-kb 16]
-STATS driver estimate localhost.localdomain /boot1 20090225080737 0 [sec 1 nkb 12 ckb 12 kps 25715]
-SUCCESS chunker localhost.localdomain /boot1 20090225080737 0 [sec 1.607 kb 12 kps 24426.5]
-INFO chunker pid-done 23733
-INFO dumper pid-done 23738
-START taper datestamp 20090225080737 label DIRO-TEST-003 tape 1
-PART taper DIRO-TEST-003 1 localhost.localdomain /boot1 20090225080737 1/1 0 [sec 0.250557 kb 12 kps 156611.070535]
-DONE taper localhost.localdomain /boot1 20090225080737 1 0 [sec 0.250557 kb 12 kps 156611.070535]
-INFO chunker chunker pid 23733
-INFO dumper gzip pid 23738
-SUCCESS dumper localhost.localdomain /boot2 20090225080737 0 [sec 1.585 kb 123 kps 24748.4 orig-kb 167]
-STATS driver estimate localhost.localdomain /boot2 20090225080737 0 [sec 1 nkb 123 ckb 123 kps 25715]
-SUCCESS chunker localhost.localdomain /boot2 20090225080737 0 [sec 1.607 kb 123 kps 24426.5]
-INFO chunker pid-done 23733
-INFO dumper pid-done 23738
-PART taper DIRO-TEST-003 2 localhost.localdomain /boot2 20090225080737 1/1 0 [sec 0.250557 kb 123 kps 156611.070535]
-DONE taper localhost.localdomain /boot2 20090225080737 1 0 [sec 0.250557 kb 123 kps 156611.070535]
-INFO chunker chunker pid 23733
-INFO dumper gzip pid 23738
-SUCCESS dumper localhost.localdomain /boot3 20090225080737 0 [sec 1.585 kb 1234 kps 24748.4 orig-kb 1678]
-STATS driver estimate localhost.localdomain /boot3 20090225080737 0 [sec 1 nkb 1234 ckb 1234 kps 25715]
-SUCCESS chunker localhost.localdomain /boot3 20090225080737 0 [sec 1.607 kb 1234 kps 24426.5]
-INFO chunker pid-done 23733
-INFO dumper pid-done 23738
-PART taper DIRO-TEST-003 3 localhost.localdomain /boot3 20090225080737 1/1 0 [sec 0.250557 kb 1234 kps 156611.070535]
-DONE taper localhost.localdomain /boot3 20090225080737 1 0 [sec 0.250557 kb 1234 kps 156611.070535]
-INFO chunker chunker pid 23733
-INFO dumper gzip pid 23738
-SUCCESS dumper localhost.localdomain /boot4 20090225080737 0 [sec 1.585 kb 12345 kps 24748.4 orig-kb 16789]
-STATS driver estimate localhost.localdomain /boot4 20090225080737 0 [sec 1 nkb 12345 ckb 12345 kps 25715]
-SUCCESS chunker localhost.localdomain /boot4 20090225080737 0 [sec 1.607 kb 12345 kps 24426.5]
-INFO chunker pid-done 23733
-INFO dumper pid-done 23738
-PART taper DIRO-TEST-003 4 localhost.localdomain /boot4 20090225080737 1/1 0 [sec 0.250557 kb 12345 kps 156611.070535]
-DONE taper localhost.localdomain /boot4 20090225080737 1 0 [sec 0.250557 kb 12345 kps 156611.070535]
-INFO chunker chunker pid 23733
-INFO dumper gzip pid 23738
-SUCCESS dumper localhost.localdomain /boot5 20090225080737 0 [sec 1.585 kb 123456 kps 24748.4 orig-kb 167890]
-STATS driver estimate localhost.localdomain /boot5 20090225080737 0 [sec 1 nkb 123456 ckb 123456 kps 25715]
-SUCCESS chunker localhost.localdomain /boot5 20090225080737 0 [sec 1.607 kb 123456 kps 24426.5]
-INFO chunker pid-done 23733
-INFO dumper pid-done 23738
-PART taper DIRO-TEST-003 5 localhost.localdomain /boot5 20090225080737 1/1 0 [sec 0.250557 kb 123456 kps 156611.070535]
-DONE taper localhost.localdomain /boot5 20090225080737 1 0 [sec 0.250557 kb 123456 kps 156611.070535]
-INFO chunker chunker pid 23733
-INFO dumper gzip pid 23738
-SUCCESS dumper localhost.localdomain /boot6 20090225080737 0 [sec 1.585 kb 1234567 kps 24748.4 orig-kb 1678901]
-STATS driver estimate localhost.localdomain /boot6 20090225080737 0 [sec 1 nkb 1234567 ckb 1234567 kps 25715]
-SUCCESS chunker localhost.localdomain /boot6 20090225080737 0 [sec 1.607 kb 1234567 kps 24426.5]
-INFO chunker pid-done 23733
-INFO dumper pid-done 23738
-PART taper DIRO-TEST-003 6 localhost.localdomain /boot6 20090225080737 1/1 0 [sec 0.250557 kb 1234567 kps 156611.070535]
-DONE taper localhost.localdomain /boot6 20090225080737 1 0 [sec 0.250557 kb 1234567 kps 156611.070535]
-INFO chunker chunker pid 23733
-INFO dumper gzip pid 23738
-SUCCESS dumper localhost.localdomain /boot7 20090225080737 0 [sec 1.585 kb 12345678 kps 24748.4 orig-kb 16789012]
-STATS driver estimate localhost.localdomain /boot7 20090225080737 0 [sec 1 nkb 12345678 ckb 12345678 kps 25715]
-SUCCESS chunker localhost.localdomain /boot7 20090225080737 0 [sec 1.607 kb 12345678 kps 24426.5]
-INFO chunker pid-done 23733
-INFO dumper pid-done 23738
-PART taper DIRO-TEST-003 7 localhost.localdomain /boot7 20090225080737 1/1 0 [sec 0.250557 kb 12345678 kps 156611.070535]
-DONE taper localhost.localdomain /boot7 20090225080737 1 0 [sec 0.250557 kb 12345678 kps 156611.070535]
-INFO chunker chunker pid 23733
-INFO dumper gzip pid 23738
-SUCCESS dumper localhost.localdomain /boot8 20090225080737 0 [sec 1.585 kb 123456789 kps 24748.4 orig-kb 167890123]
-STATS driver estimate localhost.localdomain /boot8 20090225080737 0 [sec 1 nkb 123456789 ckb 123456789 kps 25715]
-SUCCESS chunker localhost.localdomain /boot8 20090225080737 0 [sec 1.607 kb 123456789 kps 24426.5]
-INFO chunker pid-done 23733
-INFO dumper pid-done 23738
-PART taper DIRO-TEST-003 8 localhost.localdomain /boot8 20090225080737 1/1 0 [sec 0.250557 kb 123456789 kps 156611.070535]
-DONE taper localhost.localdomain /boot8 20090225080737 1 0 [sec 0.250557 kb 123456789 kps 156611.070535]
-INFO chunker chunker pid 23733
-INFO dumper gzip pid 23738
-SUCCESS dumper localhost.localdomain /boot9 20090225080737 0 [sec 1.585 kb 1234567890 kps 24748.4 orig-kb 1678901234]
-STATS driver estimate localhost.localdomain /boot9 20090225080737 0 [sec 1 nkb 1234567890 ckb 1234567890 kps 25715]
-SUCCESS chunker localhost.localdomain /boot9 20090225080737 0 [sec 1.607 kb 1234567890 kps 24426.5]
-INFO chunker pid-done 23733
-INFO dumper pid-done 23738
-PART taper DIRO-TEST-003 9 localhost.localdomain /boot9 20090225080737 1/1 0 [sec 0.250557 kb 1234567890 kps 156611.070535]
-DONE taper localhost.localdomain /boot9 20090225080737 1 0 [sec 0.250557 kb 1234567890 kps 156611.070535]
-INFO dumper pid-done 23686
-INFO taper tape DIRO-TEST-003 kb 39240 fm 10 [OK]
-INFO taper pid-done 23685
-FINISH driver date 20090225080737 time 5.306
-INFO driver pid-done 23684
-%%%% normal-postscript
---PS-TEMPLATE--
-(February 25, 2009) DrawDate
-
-(Amanda Version x.y.z) DrawVers
-(DIRO-TEST-003) DrawTitle
-(Total Size:        1339591.9 MB) DrawStat
-(Tape Used (%)       ##### %) DrawStat
-(Number of files:      9) DrawStat
-(Filesystems Taped:    9) DrawStat
-(-) (DIRO-TEST-003) (-) (  0) (      32) (      32) DrawHost
-(localhost.localdomain) (/boot1) (0) (  1) (      16) (      12) DrawHost
-(localhost.localdomain) (/boot2) (0) (  2) (     167) (     123) DrawHost
-(localhost.localdomain) (/boot3) (0) (  3) (    1678) (    1234) DrawHost
-(localhost.localdomain) (/boot4) (0) (  4) (   16789) (   12345) DrawHost
-(localhost.localdomain) (/boot5) (0) (  5) (  167890) (  123456) DrawHost
-(localhost.localdomain) (/boot6) (0) (  6) ( 1678901) ( 1234567) DrawHost
-(localhost.localdomain) (/boot7) (0) (  7) (16789012) (12345678) DrawHost
-(localhost.localdomain) (/boot8) (0) (  8) (167890123) (123456789) DrawHost
-(localhost.localdomain) (/boot9) (0) (  9) (1678901234) (1234567890) DrawHost
-
-showpage
-%%%% normal-rpt1
-Hostname: localhost.localdomain
-Org     : DailySet1
-Config  : TESTCONF
-Date    : February 25, 2009
-
-These dumps were to tape DIRO-TEST-003.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:00
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)      1339591.9   1339591.9        0.0
-Original Size (meg)    1821724.4   1821724.4        0.0
-Avg Compressed Size (%)    73.5       73.5        --
-Filesystems Dumped            9          9          0
-Avg Dump Rate (k/s)     #######    #######        --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)        1339591.9   1339591.9        0.0
-Tape Used (%)             #####      #####        0.0
-Filesystems Taped             9          9          0
-
-Parts Taped                   9          9          0
-Avg Tp Write Rate (k/s) #######    #######        --
-
-USAGE BY TAPE:
-  Label               Time      Size      %    Nb    Nc
-  DIRO-TEST-003       0:00 1371742094k  #####     9     9
-
-\f
-NOTES:
-  taper: tape DIRO-TEST-003 kb 39240 fm 10 [OK]
-
-\f
-DUMP SUMMARY:
-                                          DUMPER STATS                    TAPER STATS
-HOSTNAME     DISK        L    ORIG-kB     OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
--------------------------- -------------------------------------------- ---------------
-localhost.lo /boot1      0         16         12   75.0    0:02 24748.4   0:00 156611.1
-localhost.lo /boot2      0        167        123   73.7    0:02 24748.4   0:00 156611.1
-localhost.lo /boot3      0       1678       1234   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot4      0      16789      12345   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot5      0     167890     123456   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot6      0    1678901    1234567   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot7      0   16789012   12345678   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot8      0  167890123  123456789   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot9      0 1678901234 1234567890   73.5    0:02 24748.4   0:00 156611.1
-
-(brought to you by Amanda version x.y.z)
-%%%% normal-rpt2
-Hostname: localhost.localdomain
-Org     : DailySet1
-Config  : TESTCONF
-Date    : February 25, 2009
-
-These dumps were to tape DIRO-TEST-003.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:00
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)      1339591.9   1339591.9        0.0
-Original Size (meg)    1821724.4   1821724.4        0.0
-Avg Compressed Size (%)    73.5       73.5        --
-Filesystems Dumped            9          9          0
-Avg Dump Rate (k/s)     #######    #######        --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)        1339591.9   1339591.9        0.0
-Tape Used (%)             #####      #####        0.0
-Filesystems Taped             9          9          0
-
-Parts Taped                   9          9          0
-Avg Tp Write Rate (k/s) #######    #######        --
-
-USAGE BY TAPE:
-  Label               Time      Size      %    Nb    Nc
-  DIRO-TEST-003       0:00 1371742094k  #####     9     9
-
-\f
-NOTES:
-  taper: tape DIRO-TEST-003 kb 39240 fm 10 [OK]
-
-\f
-DUMP SUMMARY:
-                                            DUMPER STATS                     TAPER STATS
-HOSTNAME     DISK        L       ORIG-kB     OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
--------------------------- ----------------------------------------------- ---------------
-localhost.lo /boot1      0         16.00         12   75.0    0:02 24748.4   0:00 156611.1
-localhost.lo /boot2      0        167.00        123   73.7    0:02 24748.4   0:00 156611.1
-localhost.lo /boot3      0       1678.00       1234   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot4      0      16789.00      12345   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot5      0     167890.00     123456   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot6      0    1678901.00    1234567   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot7      0   16789012.00   12345678   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot8      0  167890123.00  123456789   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot9      0 1678901234.00 1234567890   73.5    0:02 24748.4   0:00 156611.1
-
-(brought to you by Amanda version x.y.z)
-%%%% normal-rpt3
-Hostname: localhost.localdomain
-Org     : DailySet1
-Config  : TESTCONF
-Date    : February 25, 2009
-
-These dumps were to tape DIRO-TEST-003.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:00
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)      1339591.9   1339591.9        0.0
-Original Size (meg)    1821724.4   1821724.4        0.0
-Avg Compressed Size (%)    73.5       73.5        --
-Filesystems Dumped            9          9          0
-Avg Dump Rate (k/s)     #######    #######        --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)        1339591.9   1339591.9        0.0
-Tape Used (%)             #####      #####        0.0
-Filesystems Taped             9          9          0
-
-Parts Taped                   9          9          0
-Avg Tp Write Rate (k/s) #######    #######        --
-
-USAGE BY TAPE:
-  Label               Time      Size      %    Nb    Nc
-  DIRO-TEST-003       0:00 1371742094k  #####     9     9
-
-\f
-NOTES:
-  taper: tape DIRO-TEST-003 kb 39240 fm 10 [OK]
-
-\f
-DUMP SUMMARY:
-                                        DUMPER STATS                 TAPER STATS
-HOSTNAME     DISK        L ORIG-kB     OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
--------------------------- --------------------------------------- ---------------
-localhost.lo /boot1      0    16         12   75.0    0:02 24748.4   0:00 156611.1
-localhost.lo /boot2      0   167        123   73.7    0:02 24748.4   0:00 156611.1
-localhost.lo /boot3      0  1678       1234   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot4      0 16789      12345   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot5      0 167890     123456   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot6      0 1678901    1234567   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot7      0 16789012   12345678   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot8      0 167890123  123456789   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot9      0 1678901234 1234567890   73.5    0:02 24748.4   0:00 156611.1
-
-(brought to you by Amanda version x.y.z)
-%%%% normal-rpt4
-Hostname: localhost.localdomain
-Org     : DailySet1
-Config  : TESTCONF
-Date    : February 25, 2009
-
-These dumps were to tape DIRO-TEST-003.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:00
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)      1339591.9   1339591.9        0.0
-Original Size (meg)    1821724.4   1821724.4        0.0
-Avg Compressed Size (%)    73.5       73.5        --
-Filesystems Dumped            9          9          0
-Avg Dump Rate (k/s)     #######    #######        --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)        1339591.9   1339591.9        0.0
-Tape Used (%)             #####      #####        0.0
-Filesystems Taped             9          9          0
-
-Parts Taped                   9          9          0
-Avg Tp Write Rate (k/s) #######    #######        --
-
-USAGE BY TAPE:
-  Label               Time      Size      %    Nb    Nc
-  DIRO-TEST-003       0:00 1371742094k  #####     9     9
-
-\f
-NOTES:
-  taper: tape DIRO-TEST-003 kb 39240 fm 10 [OK]
-
-\f
-DUMP SUMMARY:
-                                        DUMPER STATS                 TAPER STATS
-HOSTNAME     DISK        L ORIG-kB     OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
--------------------------- --------------------------------------- ---------------
-localhost.lo /boot1 0 16.000000 12 75.0 0:02 24748.4 0:00 156611.1
-localhost.lo /boot2 0 167.000000 123 73.7 0:02 24748.4 0:00 156611.1
-localhost.lo /boot3 0 1678.000000 1234 73.5 0:02 24748.4 0:00 156611.1
-localhost.lo /boot4 0 16789.000000 12345 73.5 0:02 24748.4 0:00 156611.1
-localhost.lo /boot5 0 167890.000000 123456 73.5 0:02 24748.4 0:00 156611.1
-localhost.lo /boot6 0 1678901.000000 1234567 73.5 0:02 24748.4 0:00 156611.1
-localhost.lo /boot7 0 16789012.000000 12345678 73.5 0:02 24748.4 0:00 156611.1
-localhost.lo /boot8 0 167890123.000000 123456789 73.5 0:02 24748.4 0:00 156611.1
-localhost.lo /boot9 0 1678901234.000000 1234567890 73.5 0:02 24748.4 0:00 156611.1
-
-(brought to you by Amanda version x.y.z)
-%%%% normal-rpt5
-Hostname: localhost.localdomain
-Org     : DailySet1
-Config  : TESTCONF
-Date    : February 25, 2009
-
-These dumps were to tape DIRO-TEST-003.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:00
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)      1339591.9   1339591.9        0.0
-Original Size (meg)    1821724.4   1821724.4        0.0
-Avg Compressed Size (%)    73.5       73.5        --
-Filesystems Dumped            9          9          0
-Avg Dump Rate (k/s)     #######    #######        --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)        1339591.9   1339591.9        0.0
-Tape Used (%)             #####      #####        0.0
-Filesystems Taped             9          9          0
-
-Parts Taped                   9          9          0
-Avg Tp Write Rate (k/s) #######    #######        --
-
-USAGE BY TAPE:
-  Label               Time      Size      %    Nb    Nc
-  DIRO-TEST-003       0:00  1339592M  #####     9     9
-
-\f
-NOTES:
-  taper: tape DIRO-TEST-003 kb 39240 fm 10 [OK]
-
-\f
-DUMP SUMMARY:
-                                       DUMPER STATS                 TAPER STATS
-HOSTNAME     DISK        L ORIG-MB  OUT-MB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
--------------------------- -------------------------------------- ---------------
-localhost.lo /boot1      0       0       0   75.0    0:02 24748.4   0:00 156611.1
-localhost.lo /boot2      0       0       0   73.7    0:02 24748.4   0:00 156611.1
-localhost.lo /boot3      0       2       1   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot4      0      16      12   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot5      0     164     121   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot6      0    1640    1206   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot7      0   16396   12056   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot8      0  163955  120563   73.5    0:02 24748.4   0:00 156611.1
-localhost.lo /boot9      0 1639552 1205633   73.5    0:02 24748.4   0:00 156611.1
-
-(brought to you by Amanda version x.y.z)
-%%%% strontium
-INFO amdump amdump pid 12920
-INFO planner planner pid 12944
-START planner date 20100107111335
-DISK planner strontium /etc
-DISK planner strontium /local
-DISK planner strontium /home/elantra
-DISK planner strontium /zones/data/strontium.example.com/repositories/repository_13
-INFO driver driver pid 12945
-START driver date 20100107111335
-STATS driver hostname advantium
-STATS driver startup time 0.016
-INFO dumper dumper pid 12947
-INFO dumper dumper pid 12948
-INFO dumper dumper pid 12949
-INFO dumper dumper pid 12950
-INFO taper taper pid 12946
-FINISH planner date 20100107111335 time 2.344
-INFO planner pid-done 12944
-INFO chunker chunker pid 13015
-INFO dumper gzip pid 13016
-SUCCESS dumper strontium /home/elantra 20100107111335 1 [sec 0.152 kb 10 kps 65.6 orig-kb 10]
-SUCCESS chunker strontium /home/elantra 20100107111335 1 [sec 0.184 kb 10 kps 228.0]
-INFO chunker pid-done 13015
-INFO dumper pid-done 13016
-STATS driver estimate strontium /home/elantra 20100107111335 1 [sec 0 nkb 49 ckb 64 kps 1024]
-START taper datestamp 20100107111335 label metals-013 tape 1
-PART taper metals-013 1 strontium /home/elantra 20100107111335 1/1 1 [sec 0.001107 kb 10 kps 9033.423668]
-DONE taper strontium /home/elantra 20100107111335 1 1 [sec 0.001107 kb 10 kps 9033.423668]
-INFO chunker chunker pid 13017
-INFO dumper gzip pid 13018
-SUCCESS dumper strontium /local 20100107111335 0 [sec 0.149 kb 20 kps 133.9 orig-kb 20]
-SUCCESS chunker strontium /local 20100107111335 0 [sec 0.183 kb 20 kps 283.3]
-INFO chunker pid-done 13017
-INFO dumper pid-done 13018
-STATS driver estimate strontium /local 20100107111335 0 [sec 0 nkb 46 ckb 64 kps 1024]
-PART taper metals-013 2 strontium /local 20100107111335 1/1 0 [sec 0.000724 kb 20 kps 27624.309392]
-DONE taper strontium /local 20100107111335 1 0 [sec 0.000724 kb 20 kps 27624.309392]
-INFO chunker chunker pid 13026
-INFO dumper gzip pid 13027
-SUCCESS dumper strontium /etc 20100107111335 1 [sec 0.235 kb 270 kps 1146.3 orig-kb 270]
-SUCCESS chunker strontium /etc 20100107111335 1 [sec 0.271 kb 270 kps 1110.9]
-INFO chunker pid-done 13026
-INFO dumper pid-done 13027
-STATS driver estimate strontium /etc 20100107111335 1 [sec 0 nkb 516 ckb 544 kps 1024]
-PART taper metals-013 3 strontium /etc 20100107111335 1/1 1 [sec 0.001916 kb 270 kps 140918.580376]
-DONE taper strontium /etc 20100107111335 1 1 [sec 0.001916 kb 270 kps 140918.580376]
-INFO chunker chunker pid 13034
-INFO dumper gzip pid 13035
-SUCCESS dumper strontium /zones/data/strontium.example.com/repositories/repository_13 20100107111335 1 [sec 0.525 kb 1350 kps 2568.5 orig-kb 1350]
-SUCCESS chunker strontium /zones/data/strontium.example.com/repositories/repository_13 20100107111335 1 [sec 0.561 kb 1350 kps 2461.3]
-INFO chunker pid-done 13034
-INFO dumper pid-done 13035
-STATS driver estimate strontium /zones/data/strontium.example.com/repositories/repository_13 20100107111335 1 [sec 0 nkb 1344 ckb 1344 kps 1350]
-PART taper metals-013 4 strontium /zones/data/strontium.example.com/repositories/repository_13 20100107111335 1/1 1 [sec 0.007714 kb 1350 kps 175006.481722]
-DONE taper strontium /zones/data/strontium.example.com/repositories/repository_13 20100107111335 1 1 [sec 0.007714 kb 1350 kps 175006.481722]
-INFO dumper pid-done 12947
-INFO dumper pid-done 12948
-INFO dumper pid-done 12949
-INFO dumper pid-done 12950
-INFO taper tape metals-013 kb 1650 fm 4 [OK]
-INFO taper pid-done 12946
-FINISH driver date 20100107111335 time 49.037
-INFO driver pid-done 12945
-%%%% strontium-rpt
-Hostname: advantium
-Org     : DailySet1
-Config  : TESTCONF
-Date    : January 7, 2010
-
-These dumps were to tape metals-013.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:01
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)           1.6        0.0        1.6
-Original Size (meg)         1.6        0.0        1.6
-Avg Compressed Size (%)   100.0      100.0      100.0   (level:#disks ...)
-Filesystems Dumped            4          1          3   (1:3)
-Avg Dump Rate (k/s)      1555.1      134.2     1787.3
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)             1.6        0.0        1.6
-Tape Used (%)               5.5        0.1        5.4   (level:#disks ...)
-Filesystems Taped             4          1          3   (1:3)
-   (level:#parts ...)
-Parts Taped                   4          1          3   (1:3)
-Avg Tp Write Rate (k/s)  143966    27624.3     151811
-
-USAGE BY TAPE:
-  Label            Time      Size      %    Nb    Nc
-  metals-013       0:00     1650k    5.4     4     4
-
-
-NOTES:
-  taper: tape metals-013 kb 1650 fm 4 [OK]
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS                TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS     KB/s
--------------------------- ------------------------------------- ---------------
-strontium    /etc        1     270     270    --     0:00 1146.3   0:00 140918.6
-strontium    -me/elantra 1      10      10    --     0:00   65.6   0:00   9033.4
-strontium    /local      0      20      20    --     0:00  133.9   0:00  27624.3
-strontium    -ository_13 1    1350    1350    --     0:01 2568.5   0:00 175006.5
-
-(brought to you by Amanda version x.y.z)
-%%%% strontium-postscript
---PS-TEMPLATE--
-(January 7, 2010) DrawDate
-
-(Amanda Version x.y.z) DrawVers
-(metals-013) DrawTitle
-(Total Size:           1.6 MB) DrawStat
-(Tape Used (%)         5.4 %) DrawStat
-(Number of files:      4) DrawStat
-(Filesystems Taped:    4) DrawStat
-(-) (metals-013) (-) (  0) (      32) (      32) DrawHost
-(strontium) (/home/elantra) (1) (  1) (      10) (      10) DrawHost
-(strontium) (/local) (0) (  2) (      20) (      20) DrawHost
-(strontium) (/etc) (1) (  3) (     270) (     270) DrawHost
-(strontium) (/zones/data/strontium.example.com/repositories/repository_13) (1) (  4) (    1350) (    1350) DrawHost
-
-showpage
-%%%% amflush
-INFO amflush amflush pid 26036
-DISK amflush localhost /usr/local
-DISK amflush localhost /opt
-DISK amflush localhost /usr/lib
-DISK amflush localhost /var/mysql
-DISK amflush localhost /home
-START amflush date 20090622075550
-INFO driver driver pid 26076
-START driver date 20090622075550
-STATS driver hostname centralcity.zmanda.com
-STATS driver startup time 0.011
-INFO taper taper pid 26077
-START taper datestamp 20090622075550 label Flushy-017 tape 1
-PART taper Flushy-017 1 localhost /var/mysql 20090620020002 1/1 1 [sec 2.504314 kb 36980 kps 14766.518895]
-DONE taper localhost /var/mysql 20090620020002 1 1 [sec 2.504314 kb 36980 kps 14766.518895]
-PART taper Flushy-017 2 localhost /usr/lib 20090620020002 1/1 1 [sec 1.675693 kb 309 kps 184.632684]
-DONE taper localhost /usr/lib 20090620020002 1 1 [sec 1.675693 kb 309 kps 184.632684]
-INFO taper pid-done 26077
-FINISH driver date 20090622075550 time 177.708
-INFO driver pid-done 26076
-INFO amflush pid-done 26075
-%%%% amflush-rpt
-Hostname: centralcity.zmanda.com
-Org     : DailySet1
-Config  : TESTCONF
-Date    : June 22, 2009
-
-The dumps were flushed to tape Flushy-017.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:03
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)           0.0        0.0        0.0
-Original Size (meg)         0.0        0.0        0.0
-Avg Compressed Size (%)     --         --         --
-Filesystems Dumped            0          0          0
-Avg Dump Rate (k/s)         --         --         --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)            36.4        0.0       36.4
-Tape Used (%)             121.4        0.0      121.4   (level:#disks ...)
-Filesystems Taped             2          0          2   (1:2)
-   (level:#parts ...)
-Parts Taped                   2          0          2   (1:2)
-Avg Tp Write Rate (k/s)  8920.8        --      8920.8
-
-USAGE BY TAPE:
-  Label            Time      Size      %    Nb    Nc
-  Flushy-017       0:00    37289k  121.4     2     2
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS               TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
--------------------------- ------------------------------------- --------------
-localhost    /home         NO FILE TO FLUSH -----------------------------------
-localhost    /opt          NO FILE TO FLUSH -----------------------------------
-localhost    /usr/lib    1             309    --       FLUSH       0:02   184.6
-localhost    /usr/local    NO FILE TO FLUSH -----------------------------------
-localhost    /var/mysql  1           36980    --       FLUSH       0:03 14766.5
-
-(brought to you by Amanda version x.y.z)
-%%%% amflush-postscript
---PS-TEMPLATE--
-(June 22, 2009) DrawDate
-
-(Amanda Version x.y.z) DrawVers
-(Flushy-017) DrawTitle
-(Total Size:          36.4 MB) DrawStat
-(Tape Used (%)       121.4 %) DrawStat
-(Number of files:      2) DrawStat
-(Filesystems Taped:    2) DrawStat
-(-) (Flushy-017) (-) (  0) (      32) (      32) DrawHost
-(localhost) (/var/mysql) (1) (  1) (        ) (   36980) DrawHost
-(localhost) (/usr/lib) (1) (  2) (        ) (     309) DrawHost
-
-showpage
-%%%% resultsmissing
-START planner date 20090326001503
-START driver date 20090326001503
-INFO amdump amdump pid 22014
-INFO driver driver pid 22043
-INFO planner planner pid 22042
-DISK planner cnc.slikon.local /boot
-DISK planner cnc.slikon.local /
-INFO taper taper pid 22044
-DISK planner ns-new.slikon.local //usr/local
-DISK planner ns-new.slikon.local /home
-SUCCESS dumper ns-new.slikon.local //usr/local 20090326001503 0 [sec 0.040 kb 1 kps 24.6 orig-kb 30]
-START taper datestamp 20090326001503 label Daily-36 tape 1
-SUCCESS dumper cnc.slikon.local /boot 20090326001503 0 [sec 4.255 kb 17246 kps 4052.7 orig-kb 20670]
-INFO dumper pid-done 7337
-SUCCESS chunker ns-new.slikon.local //usr/local 20090326001503 0 [sec 1.109 kb 1 kps 29.8]
-SUCCESS chunker cnc.slikon.local /boot 20090326001503 0 [sec 10.093 kb 17246 kps 1711.9]
-STATS driver estimate ns-new.slikon.local //usr/local 20090326001503 0 [sec 1 nkb 62 ckb 64 kps 1]
-INFO chunker pid-done 7334
-STATS driver estimate cnc.slikon.local /boot 20090326001503 0 [sec 2 nkb 20702 ckb 17280 kps 5749]
-PART taper Daily-36 1 cnc.slikon.local /boot 20090326001503 1/1 0 [sec 0.742831 kb 17245 kps 23216.462699]
-DONE taper cnc.slikon.local /boot 20090326001503 1 0 [sec 0.742831 kb 17245 kps 23216.462699]
-PART taper Daily-36 2 ns-new.slikon.local //usr/local 20090326001503 1/1 0 [sec 0.004696 kb 1 kps 153.471705]
-DONE taper ns-new.slikon.local //usr/local 20090326001503 1 0 [sec 0.004696 kb 1 kps 153.471705]
-INFO taper pid-done 22044
-FINISH driver date 20090326001503 time 77506.015
-INFO driver pid-done 22043
-%%%% resultsmissing-rpt
-These dumps were to tape Daily-36.
-The next tape Amanda expects to use is: 1 new tape.
-
-FAILURE DUMP SUMMARY:
-   cnc.slikon.local    /      RESULTS MISSING
-   ns-new.slikon.local /home  RESULTS MISSING
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)        21:32
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)          16.8       16.8        0.0
-Original Size (meg)        20.2       20.2        0.0
-Avg Compressed Size (%)    83.3       83.3        --
-Filesystems Dumped            2          2          0
-Avg Dump Rate (k/s)      4015.6     4015.6        --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)            16.8       16.8        0.0
-Tape Used (%)              56.2       56.2        0.0
-Filesystems Taped             2          2          0
-
-Parts Taped                   2          2          0
-Avg Tp Write Rate (k/s) 23070.7    23070.7        --
-
-USAGE BY TAPE:
-  Label          Time      Size      %    Nb    Nc
-  Daily-36       0:00    17246k   56.2     2     2
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS               TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
--------------------------- ------------------------------------- --------------
-cnc.slikon.l /             MISSING --------------------------------------------
-cnc.slikon.l /boot       0   20670   17245   83.4    0:04 4052.7   0:01 23216.5
-ns-new.sliko //usr/local 0      30       1    3.3    0:00   24.6   0:00   153.5
-ns-new.sliko /home         MISSING --------------------------------------------
-
-(brought to you by Amanda version x.y.z)
-%%%% resultsmissing-postscript
---PS-TEMPLATE--
-(March 26, 2009) DrawDate
-
-(Amanda Version x.y.z) DrawVers
-(Daily-36) DrawTitle
-(Total Size:          16.8 MB) DrawStat
-(Tape Used (%)        56.2 %) DrawStat
-(Number of files:      2) DrawStat
-(Filesystems Taped:    2) DrawStat
-(-) (Daily-36) (-) (  0) (      32) (      32) DrawHost
-(cnc.slikon.local) (/boot) (0) (  1) (   20670) (   17245) DrawHost
-(ns-new.slikon.local) (//usr/local) (0) (  2) (      30) (       1) DrawHost
-
-showpage
-%%%% shortstrange
-START planner date 20090326001503
-START driver date 20090326001503
-INFO amdump amdump pid 22014
-INFO driver driver pid 22043
-INFO planner planner pid 22042
-DISK planner bsdfw.slikon.local /
-START taper datestamp 20090326001503 label Daily-36 tape 1
-STRANGE dumper bsdfw.slikon.local / 0 [sec 1775.514 kb 2317814 kps 1305.4 orig-kb 5401240]
-  sendbackup: info BACKUP=APPLICATION
-  sendbackup: info APPLICATION=amgtar
-  sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
-  sendbackup: info COMPRESS_SUFFIX=.gz
-  sendbackup: info end
-  | /bin/tar: ./tmp/.gdm_socket: socket ignored
-  | /bin/tar: ./tmp/.X11-unix/X0: socket ignored
-  | /bin/tar: ./tmp/.font-unix/fs7100: socket ignored
-  ? /bin/tar: ./var/log/messages: file changed as we read it
-  | /bin/tar: ./var/run/acpid.socket: socket ignored
-  | /bin/tar: ./var/run/dbus/system_bus_socket: socket ignored
-  | Total bytes written: 5530869760 (5.2GiB, 3.0MiB/s)
-  sendbackup: size 5401240
-  sendbackup: end
-SUCCESS chunker bsdfw.slikon.local / 20090326001503 0 [sec 1782.341 kb 2293471 kps 1286.8]
-STATS driver estimate bsdfw.slikon.local / 20090326001503 0 [sec 1715 nkb 5400282 ckb 2294272 kps 1337]
-PART taper Daily-36 1 bsdfw.slikon.local / 20090326001503 1/1 0 [sec 157.123731 kb 2293470 kps 14596.586283]
-DONE taper bsdfw.slikon.local / 20090326001503 1 0 [sec 157.123731 kb 2293470 kps 14596.586283]
-FINISH driver date 20090326001503 time 77506.015
-%%%% shortstrange-rpt
-These dumps were to tape Daily-36.
-The next tape Amanda expects to use is: 1 new tape.
-
-STRANGE DUMP SUMMARY:
-   bsdfw.slikon.local / lev 0  STRANGE (see below)
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)        21:32
-Dump Time (hrs:min)        0:30       0:30       0:00
-Output Size (meg)        2239.7     2239.7        0.0
-Original Size (meg)      5274.6     5274.6        0.0
-Avg Compressed Size (%)    42.5       42.5        --
-Filesystems Dumped            1          1          0
-Avg Dump Rate (k/s)      1291.7     1291.7        --
-
-Tape Time (hrs:min)        0:03       0:03       0:00
-Tape Size (meg)          2239.7     2239.7        0.0
-Tape Used (%)              7466       7466        0.0
-Filesystems Taped             1          1          0
-
-Parts Taped                   1          1          0
-Avg Tp Write Rate (k/s) 14596.6    14596.6        --
-
-USAGE BY TAPE:
-  Label          Time      Size      %    Nb    Nc
-  Daily-36       0:03  2293470k   7466     1     1
-
-
-STRANGE DUMP DETAILS:
-
-/--  bsdfw.slikon.local / lev 0 STRANGE
-sendbackup: info BACKUP=APPLICATION
-sendbackup: info APPLICATION=amgtar
-sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
-sendbackup: info COMPRESS_SUFFIX=.gz
-sendbackup: info end
-| /bin/tar: ./tmp/.gdm_socket: socket ignored
-| /bin/tar: ./tmp/.X11-unix/X0: socket ignored
-| /bin/tar: ./tmp/.font-unix/fs7100: socket ignored
-? /bin/tar: ./var/log/messages: file changed as we read it
-| /bin/tar: ./var/run/acpid.socket: socket ignored
-| /bin/tar: ./var/run/dbus/system_bus_socket: socket ignored
-| Total bytes written: 5530869760 (5.2GiB, 3.0MiB/s)
-sendbackup: size 5401240
-sendbackup: end
-\--------
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS               TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
--------------------------- ------------------------------------- --------------
-bsdfw.slikon /           0 5401240 2293470   42.5   29:36 1305.4   2:37 14596.6
-
-(brought to you by Amanda version x.y.z)
-%%%% shortstrange-postscript
---PS-TEMPLATE--
-(March 26, 2009) DrawDate
-
-(Amanda Version x.y.z) DrawVers
-(Daily-36) DrawTitle
-(Total Size:        2239.7 MB) DrawStat
-(Tape Used (%)        7466 %) DrawStat
-(Number of files:      1) DrawStat
-(Filesystems Taped:    1) DrawStat
-(-) (Daily-36) (-) (  0) (      32) (      32) DrawHost
-(bsdfw.slikon.local) (/) (0) (  1) ( 5401240) ( 2293470) DrawHost
-
-showpage
-%%%% longstrange-rpt
-These dumps were to tape Daily-36.
-The next tape Amanda expects to use is: 1 new tape.
-
-STRANGE DUMP SUMMARY:
-   bsdfw.slikon.local / lev 0  STRANGE (see below)
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)        21:32
-Dump Time (hrs:min)        0:30       0:30       0:00
-Output Size (meg)        2239.7     2239.7        0.0
-Original Size (meg)      5274.6     5274.6        0.0
-Avg Compressed Size (%)    42.5       42.5        --
-Filesystems Dumped            1          1          0
-Avg Dump Rate (k/s)      1291.7     1291.7        --
-
-Tape Time (hrs:min)        0:03       0:03       0:00
-Tape Size (meg)          2239.7     2239.7        0.0
-Tape Used (%)              7466       7466        0.0
-Filesystems Taped             1          1          0
-
-Parts Taped                   1          1          0
-Avg Tp Write Rate (k/s) 14596.6    14596.6        --
-
-USAGE BY TAPE:
-  Label          Time      Size      %    Nb    Nc
-  Daily-36       0:03  2293470k   7466     1     1
-
-
-STRANGE DUMP DETAILS:
-
-/--  bsdfw.slikon.local / lev 0 STRANGE
-sendbackup: info BACKUP=APPLICATION
-sendbackup: info APPLICATION=amgtar
-sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
-sendbackup: info COMPRESS_SUFFIX=.gz
-sendbackup: info end
-| /bin/tar: ./tmp/.gdm_socket: socket ignored
-| /bin/tar: ./tmp/.X11-unix/X0: socket ignored
-| /bin/tar: ./tmp/.font-unix/fs7100: socket ignored
-? /bin/tar: ./var/log/messages: file changed as we read it
---LINE-REPLACED-BY-91-LINES--
-\--------
-913 lines follow, see the corresponding log.* file for the complete list
-\--------
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS               TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
--------------------------- ------------------------------------- --------------
-bsdfw.slikon /           0 5401240 2293470   42.5   29:36 1305.4   2:37 14596.6
-
-(brought to you by Amanda version x.y.z)
-%%%% doublefailure
-START planner date 20090326001503
-START driver date 20090326001503
-INFO amdump amdump pid 22014
-INFO driver driver pid 22043
-INFO planner planner pid 22042
-START taper datestamp 20090326001503 label Daily-13 tape 1
-DISK planner ns-new.slikon.local /opt/var
-INFO planner Forcing full dump of ns-new.slikon.local:/opt/var as directed.
-FAIL dumper ns-new.slikon.local /opt/var 20090326001503 0 [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134405000.debug]
-  sendbackup: info BACKUP=APPLICATION
-  sendbackup: info APPLICATION=amgtar
-  sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
-  sendbackup: info COMPRESS_SUFFIX=.gz
-  sendbackup: info end
-  ? /bin/tar: ./gdm: Cannot savedir: Permission denied
-  | Total bytes written: 943831040 (901MiB, 4.9MiB/s)
-  | /bin/tar: Error exit delayed from previous errors
-  sendbackup: error [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134405000.debug]
-  sendbackup: size 921710
-  sendbackup: end
-PARTIAL chunker ns-new.slikon.local /opt/var 20090326001503 0 [sec 187.313 kb 54930 kps 293.4]
-FAIL dumper ns-new.slikon.local /opt/var 20090326001503 0 [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134714000.debug]
-  sendbackup: info BACKUP=APPLICATION
-  sendbackup: info APPLICATION=amgtar
-  sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
-  sendbackup: info COMPRESS_SUFFIX=.gz
-  sendbackup: info end
-  ? /bin/tar: ./gdm: Cannot savedir: Permission denied
-  | Total bytes written: 943851520 (901MiB, 7.4MiB/s)
-  | /bin/tar: Error exit delayed from previous errors
-  sendbackup: error [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134714000.debug]
-  sendbackup: size 921730
-  sendbackup: end
-PARTIAL chunker ns-new.slikon.local /opt/var 20090326001503 0 [sec 123.421 kb 54930 kps 445.3]
-PART taper Daily-13 1 ns-new.slikon.local /opt/var 20090326001503 1/1 0 [sec 3.555085 kb 54929 kps 15451.027696]
-PARTIAL taper ns-new.slikon.local /opt/var 20090326001503 1 0 [sec 3.555085 kb 54929 kps 15451.027696]
-FINISH driver date 20090326001503 time 77506.015
-%%%% doublefailure-rpt
-These dumps were to tape Daily-13.
-The next tape Amanda expects to use is: 1 new tape.
-
-FAILURE DUMP SUMMARY:
-   ns-new.slikon.local /opt/var lev 0  FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134405000.debug]
-   ns-new.slikon.local /opt/var lev 0  FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134714000.debug]
-   ns-new.slikon.local /opt/var lev 0  partial taper: successfully taped a partial dump
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)        21:32
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)         107.3      107.3        0.0
-Original Size (meg)         0.0        0.0        0.0
-Avg Compressed Size (%)     --         --         --
-Filesystems Dumped            0          0          0
-Avg Dump Rate (k/s)         --         --         --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)            53.6       53.6        0.0
-Tape Used (%)             178.8      178.8        0.0
-Filesystems Taped             1          1          0
-
-Parts Taped                   1          1          0
-Avg Tp Write Rate (k/s) 15450.8    15450.8        --
-
-USAGE BY TAPE:
-  Label          Time      Size      %    Nb    Nc
-  Daily-13       0:00    54929k  178.8     1     1
-
-FAILED DUMP DETAILS:
-
-/--  ns-new.slikon.local /opt/var lev 0 FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134405000.debug]
-sendbackup: info BACKUP=APPLICATION
-sendbackup: info APPLICATION=amgtar
-sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
-sendbackup: info COMPRESS_SUFFIX=.gz
-sendbackup: info end
-? /bin/tar: ./gdm: Cannot savedir: Permission denied
-| Total bytes written: 943831040 (901MiB, 4.9MiB/s)
-| /bin/tar: Error exit delayed from previous errors
-sendbackup: error [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134405000.debug]
-sendbackup: size 921710
-sendbackup: end
-\--------
-
-/--  ns-new.slikon.local /opt/var lev 0 FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134714000.debug]
-sendbackup: info BACKUP=APPLICATION
-sendbackup: info APPLICATION=amgtar
-sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
-sendbackup: info COMPRESS_SUFFIX=.gz
-sendbackup: info end
-? /bin/tar: ./gdm: Cannot savedir: Permission denied
-| Total bytes written: 943851520 (901MiB, 7.4MiB/s)
-| /bin/tar: Error exit delayed from previous errors
-sendbackup: error [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134714000.debug]
-sendbackup: size 921730
-sendbackup: end
-\--------
-
-
-NOTES:
-  planner: Forcing full dump of ns-new.slikon.local:/opt/var as directed.
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS               TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
--------------------------- ------------------------------------- --------------
-ns-new.sliko /opt/var    0           54929    --      PARTIAL      0:04 15451.0 PARTIAL
-
-(brought to you by Amanda version x.y.z)
-%%%% doublefailure-postscript
---PS-TEMPLATE--
-(March 26, 2009) DrawDate
-
-(Amanda Version x.y.z) DrawVers
-(Daily-13) DrawTitle
-(Total Size:          53.6 MB) DrawStat
-(Tape Used (%)       178.8 %) DrawStat
-(Number of files:      1) DrawStat
-(Filesystems Taped:    1) DrawStat
-(-) (Daily-13) (-) (  0) (      32) (      32) DrawHost
-(ns-new.slikon.local) (/opt/var) (0) (  1) (        ) (   54929) DrawHost
-
-showpage
-%%%% bigestimate
-START planner date 20090326001503
-START driver date 20090326001503
-INFO amdump amdump pid 22014
-INFO driver driver pid 22043
-INFO planner planner pid 22042
-DISK planner home.slikon.local /opt/public
-SUCCESS dumper home.slikon.local /opt/public 20090326001503 0 [sec 2816.520 kb 50917370 kps 18078.1 orig-kb 72987320]
-START taper datestamp 20090326001503 label Daily-36 tape 1
-SUCCESS chunker home.slikon.local /opt/public 20090326001503 0 [sec 2821.633 kb 50917370 kps 18045.9]
-STATS driver estimate home.slikon.local /opt/public 20090326001503 0 [sec 0 nkb 72987352 ckb 80286112 kps 4294967295]
-PART taper Daily-36 1 home.slikon.local /opt/public 20090326001503 1/3 0 [sec 813.482141 kb 22020096 kps 27068.935985]
-PART taper Daily-36 2 home.slikon.local /opt/public 20090326001503 2/3 0 [sec 800.783991 kb 22020096 kps 27498.172101]
-PART taper Daily-36 3 home.slikon.local /opt/public 20090326001503 3/3 0 [sec 251.674410 kb 6877177 kps 27325.692199]
-DONE taper home.slikon.local /opt/public 20090326001503 3 0 [sec 1865.940542 kb 50917369 kps 27287.777030]
-FINISH driver date 20090326001503 time 77506.015
-%%%% bigestimate-rpt
-These dumps were to tape Daily-36.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)        21:32
-Dump Time (hrs:min)        0:47       0:47       0:00
-Output Size (meg)       49724.0    49724.0        0.0
-Original Size (meg)     71276.7    71276.7        0.0
-Avg Compressed Size (%)    69.8       69.8        --
-Filesystems Dumped            1          1          0
-Avg Dump Rate (k/s)     18078.1    18078.1        --
-
-Tape Time (hrs:min)        0:31       0:31       0:00
-Tape Size (meg)         49724.0    49724.0        0.0
-Tape Used (%)             #####      #####        0.0
-Filesystems Taped             1          1          0
-
-Parts Taped                   3          3          0
-Avg Tp Write Rate (k/s) 27287.8    27287.8        --
-
-USAGE BY TAPE:
-  Label          Time      Size      %    Nb    Nc
-  Daily-36       0:31 50917369k  #####     1     3
-
-
-NOTES:
-  big estimate: home.slikon.local /opt/public 0
-                est: 80286112k    out 50917369k
-
-
-DUMP SUMMARY:
-                                        DUMPER STATS                 TAPER STATS
-HOSTNAME     DISK        L  ORIG-kB   OUT-kB  COMP%  MMM:SS    KB/s MMM:SS    KB/s
--------------------------- ---------------------------------------- --------------
-home.slikon. /opt/public 0 72987320 50917369   69.8   46:57 18078.1  31:06 27287.8
-
-(brought to you by Amanda version x.y.z)
-%%%% bigestimate-postscript
---PS-TEMPLATE--
-(March 26, 2009) DrawDate
-
-(Amanda Version x.y.z) DrawVers
-(Daily-36) DrawTitle
-(Total Size:        49724.0 MB) DrawStat
-(Tape Used (%)       ##### %) DrawStat
-(Number of files:      3) DrawStat
-(Filesystems Taped:    1) DrawStat
-(-) (Daily-36) (-) (  0) (      32) (      32) DrawHost
-(home.slikon.local) (/opt/public) (0) (  1) (72987320) (50917369) DrawHost
-
-showpage
-%%%% retried
-START planner date 20090326001503
-START driver date 20090326001503
-INFO amdump amdump pid 22014
-INFO driver driver pid 22043
-INFO planner planner pid 22042
-START taper datestamp 20090326001503 label Daily-36 tape 1
-DISK planner jamon.slikon.local /var
-WARNING planner disk jamon.slikon.local:/var, estimate of level 1 failed.
-FAIL dumper jamon.slikon.local /var 20090326001503 0 [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326133640000.debug]
-  blah blah blah
-PARTIAL chunker jamon.slikon.local /var 20090326001503 0 [sec 64.950 kb 268358 kps 4132.2]
-SUCCESS dumper jamon.slikon.local /var 20090326001503 0 [sec 53.356 kb 268357 kps 5029.5 orig-kb 2985670]
-SUCCESS chunker jamon.slikon.local /var 20090326001503 0 [sec 58.396 kb 268357 kps 4596.0]
-STATS driver estimate jamon.slikon.local /var 20090326001503 0 [sec 62 nkb 2950092 ckb 266528 kps 4294]
-PART taper Daily-36 1 jamon.slikon.local /var 20090326001503 1/1 0 [sec 15.589804 kb 268356 kps 17213.595632]
-DONE taper jamon.slikon.local /var 20090326001503 1 0 [sec 15.589804 kb 268356 kps 17213.595632]
-FINISH driver date 20090326001503 time 77506.015
-%%%% retried-rpt
-These dumps were to tape Daily-36.
-The next tape Amanda expects to use is: 1 new tape.
-
-FAILURE DUMP SUMMARY:
-   jamon.slikon.local /var lev 0  FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326133640000.debug]
-   jamon.slikon.local /var lev 0  was successfully retried
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)        21:32
-Dump Time (hrs:min)        0:01       0:01       0:00
-Output Size (meg)         524.1      524.1        0.0
-Original Size (meg)      2915.7     2915.7        0.0
-Avg Compressed Size (%)    18.0       18.0        --
-Filesystems Dumped            1          1          0
-Avg Dump Rate (k/s)     10059.1    10059.1        --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)           262.1      262.1        0.0
-Tape Used (%)             873.6      873.6        0.0
-Filesystems Taped             1          1          0
-
-Parts Taped                   1          1          0
-Avg Tp Write Rate (k/s) 17213.6    17213.6        --
-
-USAGE BY TAPE:
-  Label          Time      Size      %    Nb    Nc
-  Daily-36       0:00   268356k  873.6     1     1
-
-
-FAILED DUMP DETAILS:
-
-/--  jamon.slikon.local /var lev 0 FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326133640000.debug]
-blah blah blah
-\--------
-
-
-NOTES:
-  planner: disk jamon.slikon.local:/var, estimate of level 1 failed.
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS               TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
--------------------------- ------------------------------------- --------------
-jamon.slikon /var        0 2985670  268356    9.0    0:53 5029.5   0:16 17213.6
-
-(brought to you by Amanda version x.y.z)
-%%%% retried-postscript
---PS-TEMPLATE--
-(March 26, 2009) DrawDate
-
-(Amanda Version x.y.z) DrawVers
-(Daily-36) DrawTitle
-(Total Size:         262.1 MB) DrawStat
-(Tape Used (%)       873.6 %) DrawStat
-(Number of files:      1) DrawStat
-(Filesystems Taped:    1) DrawStat
-(-) (Daily-36) (-) (  0) (      32) (      32) DrawHost
-(jamon.slikon.local) (/var) (0) (  1) ( 2985670) (  268356) DrawHost
-
-showpage
-%%%% taperr
-INFO amdump amdump pid 32302
-INFO planner planner pid 32323
-START planner date 20100303133320
-DISK planner euclid /A/p/etc
-INFO driver driver pid 32324
-START driver date 20100303133320
-STATS driver hostname euclid
-INFO dumper dumper pid 32331
-INFO dumper dumper pid 32337
-STATS driver startup time 0.130
-INFO dumper dumper pid 32338
-INFO dumper dumper pid 32335
-INFO taper taper pid 32326
-ERROR taper no-tape [Virtual-tape directory /A/p/vtapes does not exist.]
-FINISH planner date 20100303133320 time 1.137
-INFO planner pid-done 32323
-INFO chunker chunker pid 32351
-INFO dumper gzip pid 32355
-SUCCESS dumper euclid /A/p/etc 20100303133320 0 [sec 0.040 kb 100 kps 2491.0 orig-kb 100]
-SUCCESS chunker euclid /A/p/etc 20100303133320 0 [sec 0.064 kb 100 kps 2044.3]
-INFO chunker pid-done 32351
-STATS driver estimate euclid /A/p/etc 20100303133320 0 [sec 0 nkb 132 ckb 160 kps 1024]
-INFO dumper pid-done 32337
-INFO dumper pid-done 32335
-INFO dumper pid-done 32338
-INFO dumper pid-done 32355
-INFO dumper pid-done 32331
-INFO taper pid-done 32326
-FINISH driver date 20100303133320 time 2.247
-INFO driver pid-done 32324
-%%%% taperr-rpt-holding
-Hostname: euclid
-Org     : DailySet1
-Config  : TESTCONF
-Date    : March 3, 2010
-
-*** A TAPE ERROR OCCURRED: [Virtual-tape directory /A/p/vtapes does not exist.].
-No dumps are left in the holding disk.
-
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:00
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)           0.1        0.1        0.0
-Original Size (meg)         0.1        0.1        0.0
-Avg Compressed Size (%)   100.0      100.0        --
-Filesystems Dumped            1          1          0
-Avg Dump Rate (k/s)      2500.0     2500.0        --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)             0.0        0.0        0.0
-Tape Used (%)               0.0        0.0        0.0
-Filesystems Taped             0          0          0
-
-Parts Taped                   0          0          0
-Avg Tp Write Rate (k/s)     --         --         --
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS               TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
--------------------------- ------------------------------------- -------------
-euclid       /A/p/etc    0     100     100    --     0:00 2491.0
-
-(brought to you by Amanda version x.y.z)
-%%%% taperr-rpt-noholding
-Hostname: euclid
-Org     : DailySet1
-Config  : TESTCONF
-Date    : March 3, 2010
-
-*** A TAPE ERROR OCCURRED: [Virtual-tape directory /A/p/vtapes does not exist.].
-Some dumps may have been left in the holding disk.
-
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:00
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)           0.1        0.1        0.0
-Original Size (meg)         0.1        0.1        0.0
-Avg Compressed Size (%)   100.0      100.0        --
-Filesystems Dumped            1          1          0
-Avg Dump Rate (k/s)      2500.0     2500.0        --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)             0.0        0.0        0.0
-Tape Used (%)               0.0        0.0        0.0
-Filesystems Taped             0          0          0
-
-Parts Taped                   0          0          0
-Avg Tp Write Rate (k/s)     --         --         --
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS               TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
--------------------------- ------------------------------------- -------------
-euclid       /A/p/etc    0     100     100    --     0:00 2491.0
-
-(brought to you by Amanda version x.y.z)
-%%%% spanned
-INFO amdump amdump pid 30070
-INFO planner planner pid 30091
-START planner date 20100303153307
-DISK planner euclid /A/b/server-src
-INFO driver driver pid 30092
-START driver date 20100303153307
-STATS driver hostname euclid
-INFO dumper dumper pid 30095
-STATS driver startup time 0.044
-INFO dumper dumper pid 30098
-INFO dumper dumper pid 30100
-INFO dumper dumper pid 30099
-INFO taper taper pid 30094
-FINISH planner date 20100303153307 time 5.128
-INFO planner pid-done 30091
-INFO chunker chunker pid 30160
-INFO dumper gzip pid 30164
-SUCCESS dumper euclid /A/b/server-src 20100303153307 0 [sec 0.264 kb 21830 kps 82641.8 orig-kb 21830]
-INFO dumper pid-done 30164
-SUCCESS chunker euclid /A/b/server-src 20100303153307 0 [sec 0.290 kb 21830 kps 75337.9]
-INFO chunker pid-done 30160
-STATS driver estimate euclid /A/b/server-src 20100303153307 0 [sec 21 nkb 21862 ckb 21888 kps 1024]
-START taper datestamp 20100303153307 label Conf-001 tape 1
-PART taper Conf-001 1 euclid /A/b/server-src 20100303153307 1/-1 0 [sec 0.020357 kb 5120 kps 251515.911452 orig-kb 21830]
-PART taper Conf-001 2 euclid /A/b/server-src 20100303153307 2/-1 0 [sec 0.022239 kb 5120 kps 230222.763006 orig-kb 21830]
-PART taper Conf-001 3 euclid /A/b/server-src 20100303153307 3/-1 0 [sec 0.019910 kb 5120 kps 257153.694334 orig-kb 21830]
-PARTPARTIAL taper Conf-001 4 euclid /A/b/server-src 20100303153307 4/-1 0 [sec 0.017390 kb 4960 kps 285216.405648 orig-kb 21830] "No space left on device"
-INFO taper Will request retry of failed split part.
-INFO taper tape Conf-001 kb 15360 fm 4 [OK]
-START taper datestamp 20100303153307 label Conf-002 tape 2
-PART taper Conf-002 1 euclid /A/b/server-src 20100303153307 4/-1 0 [sec 0.022851 kb 5120 kps 224055.372485 orig-kb 21830]
-PART taper Conf-002 2 euclid /A/b/server-src 20100303153307 5/-1 0 [sec 0.004047 kb 1350 kps 333557.846590 orig-kb 21830]
-DONE taper euclid /A/b/server-src 20100303153307 5 0 [sec 0.089405 kb 21830 kps 244169.966680 orig-kb 21830]
-INFO dumper pid-done 30095
-INFO dumper pid-done 30098
-INFO dumper pid-done 30099
-INFO dumper pid-done 30100
-INFO taper tape Conf-002 kb 6470 fm 2 [OK]
-INFO taper pid-done 30094
-FINISH driver date 20100303153307 time 7.391
-INFO driver pid-done 30092
-%%%% spanned-rpt
-Hostname: euclid
-Org     : DailySet1
-Config  : TESTCONF
-Date    : March 3, 2010
-
-These dumps were to tapes Conf-001, Conf-002.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:00
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)          21.3       21.3        0.0
-Original Size (meg)        21.3       21.3        0.0
-Avg Compressed Size (%)   100.0      100.0        --
-Filesystems Dumped            1          1          0
-Avg Dump Rate (k/s)     82689.4    82689.4        --
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)            21.3       21.3        0.0
-Tape Used (%)              71.2       71.2        0.0
-Filesystems Taped             1          1          0
-
-Parts Taped                   6          6          0
-Avg Tp Write Rate (k/s)  244170     244170        --
-
-USAGE BY TAPE:
-  Label          Time      Size      %    Nb    Nc
-  Conf-001       0:00    20320k   66.2     1     4
-  Conf-002       0:00     6470k   21.1     0     2
-
-
-NOTES:
-  taper: Will request retry of failed split part.
-  taper: tape Conf-001 kb 15360 fm 4 [OK]
-  taper: tape Conf-002 kb 6470 fm 2 [OK]
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS                 TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
--------------------------- -------------------------------------- ---------------
-euclid       -server-src 0   21830   21830    --     0:00 82641.8   0:00 244170.0
-
-(brought to you by Amanda version x.y.z)
-%%%% spanned-postscript
---PS-TEMPLATE--
-(March 3, 2010) DrawDate
-
-(Amanda Version x.y.z) DrawVers
-(Conf-001) DrawTitle
-(Total Size:          19.8 MB) DrawStat
-(Tape Used (%)        66.2 %) DrawStat
-(Number of files:      4) DrawStat
-(Filesystems Taped:    1) DrawStat
-(-) (Conf-001) (-) (  0) (      32) (      32) DrawHost
-(euclid) (/A/b/server-src) (0) (  1) (   21830) (   20320) DrawHost
-
-showpage
---PS-TEMPLATE--
-(March 3, 2010) DrawDate
-
-(Amanda Version x.y.z) DrawVers
-(Conf-002) DrawTitle
-(Total Size:           6.3 MB) DrawStat
-(Tape Used (%)        21.1 %) DrawStat
-(Number of files:      2) DrawStat
-(Filesystems Taped:    0) DrawStat
-(-) (Conf-002) (-) (  0) (      32) (      32) DrawHost
-
-showpage
-%%%% fatal
-INFO amdump amdump pid 14564
-INFO driver driver pid 14588
-INFO planner planner pid 14587
-START planner date 20100303144314
-START driver date 20100303144314
-STATS driver hostname localhost.localdomain
-DISK planner localhost /boot
-WARNING planner tapecycle (3) <= runspercycle (10)
-INFO planner Forcing full dump of localhost:/boot as directed.
-INFO dumper dumper pid 14595
-INFO dumper dumper pid 14596
-INFO dumper dumper pid 14597
-INFO dumper dumper pid 14600
-INFO dumper dumper pid 14599
-INFO dumper dumper pid 14598
-INFO dumper dumper pid 14601
-INFO dumper dumper pid 14602
-INFO dumper dumper pid 14603
-STATS driver startup time 0.214
-INFO dumper dumper pid 14604
-INFO taper taper pid 14590
-WARNING planner disk localhost:/boot, full dump (83480KB) will be larger than available tape space
-FAIL planner localhost /boot 20100303144314 0 "[dump larger than available tape space, 83480 KB, but cannot incremental dump new disk]"
-FATAL planner cannot fit anything on tape, bailing out
-WARNING driver WARNING: got empty schedule from planner
-INFO dumper pid-done 14595
-INFO dumper pid-done 14597
-INFO dumper pid-done 14596
-INFO dumper pid-done 14598
-INFO dumper pid-done 14600
-INFO dumper pid-done 14601
-INFO dumper pid-done 14604
-INFO dumper pid-done 14603
-INFO dumper pid-done 14602
-INFO dumper pid-done 14599
-INFO taper pid-done 14590
-FINISH driver date 20100303144314 time 8.150
-INFO driver pid-done 14588
-%%%% fatal-rpt
-Hostname: localhost.localdomain
-Org     : DailySet1
-Config  : TESTCONF
-Date    : March 3, 2010
-
-The next tape Amanda expects to use is: 1 new tape.
-
-FAILURE DUMP SUMMARY:
-  planner: FATAL cannot fit anything on tape, bailing out
-   localhost /boot lev 0  FAILED [dump larger than available tape space, 83480 KB, but cannot incremental dump new disk]
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)    0:00
-Run Time (hrs:min)         0:00
-Dump Time (hrs:min)        0:00       0:00       0:00
-Output Size (meg)           0.0        0.0        0.0
-Original Size (meg)         0.0        0.0        0.0
-Avg Compressed Size (%)     --         --         -- 
-Filesystems Dumped            0          0          0
-Avg Dump Rate (k/s)         --         --         -- 
-
-Tape Time (hrs:min)        0:00       0:00       0:00
-Tape Size (meg)             0.0        0.0        0.0
-Tape Used (%)               0.0        0.0        0.0
-Filesystems Taped             0          0          0
-
-Parts Taped                   0          0          0
-Avg Tp Write Rate (k/s)     --         --         -- 
-
-
-NOTES:
-  planner: tapecycle (3) <= runspercycle (10)
-  planner: Forcing full dump of localhost:/boot as directed.
-  planner: disk localhost:/boot, full dump (83480KB) will be larger than available tape space
-  driver: WARNING: got empty schedule from planner
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS               TAPER STATS 
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
--------------------------- ------------------------------------- -------------
-localhost    /boot         MISSING -------------------------------------------
-
-(brought to you by Amanda version x.y.z)
-%%%% flush-origsize
-INFO amflush amflush pid 11753
-DISK amflush localhost /boot
-START amflush date 20100303132501
-INFO driver driver pid 11755
-START driver date 20100303132501
-STATS driver hostname localhost.localdomain
-STATS driver startup time 0.020
-INFO taper taper pid 11756
-START taper datestamp 20100303132501 label TESTCONF02 tape 1
-PART taper TESTCONF02 1 localhost /boot 20100303132432 1/-1 0 [sec 0.493936 kb 83480 kps 169009.900121 orig-kb 148870]
-DONE taper localhost /boot 20100303132432 1 0 [sec 0.493936 kb 83480 kps 169009.900121 orig-kb 148870]
-INFO taper tape TESTCONF02 kb 83480 fm 9 [OK]
-INFO taper pid-done 11756
-FINISH driver date 20100303132501 time 1.966
-INFO driver pid-done 11755
-INFO amflush pid-done 11754
-%%%% flush-origsize-rpt
-Hostname: localhost.localdomain                   
-Org     : DailySet1                               
-Config  : TESTCONF                                
-Date    : March 3, 2010                           
-
-The dumps were flushed to tape TESTCONF02.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)     0:00
-Run Time (hrs:min)          0:00
-Dump Time (hrs:min)         0:00       0:00       0:00
-Output Size (meg)            0.0        0.0        0.0
-Original Size (meg)          0.0        0.0        0.0
-Avg Compressed Size (%)      --         --         --
-Filesystems Dumped             0          0          0
-Avg Dump Rate (k/s)          --         --         --
-
-Tape Time (hrs:min)         0:00       0:00       0:00
-Tape Size (meg)             81.5       81.5        0.0
-Tape Used (%)              271.8      271.8        0.0
-Filesystems Taped              1          1          0
-Parts Taped                    1          1          0
-Avg Tp Write Rate (k/s)   169010     169010        --
-
-USAGE BY TAPE:
-  Label               Time         Size      %    Nb    Nc
-  TESTCONF02          0:00       83480k  271.8     1     1
-
-NOTES:
-  taper: tape TESTCONF02 kb 83480 fm 9 [OK]
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS                TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS     KB/s
--------------------------- ------------------------------------- ---------------
-localhost    /boot       0  148870   83480   56.1     FLUSH        0:00 169009.9
-
-(brought to you by Amanda version x.y.z)
-%%%% flush-noorigsize
-INFO amflush amflush pid 11753
-DISK amflush localhost /boot
-START amflush date 20100303132501
-INFO driver driver pid 11755
-START driver date 20100303132501
-STATS driver hostname localhost.localdomain
-STATS driver startup time 0.020
-INFO taper taper pid 11756
-START taper datestamp 20100303132501 label TESTCONF02 tape 1
-PART taper TESTCONF02 1 localhost /boot 20100303132432 1/-1 0 [sec 0.493936 kb 83480 kps 169009.900121]
-DONE taper localhost /boot 20100303132432 1 0 [sec 0.493936 kb 83480 kps 169009.900121]
-INFO taper tape TESTCONF02 kb 83480 fm 9 [OK]
-INFO taper pid-done 11756
-FINISH driver date 20100303132501 time 1.966
-INFO driver pid-done 11755
-INFO amflush pid-done 11754
-%%%% flush-noorigsize-rpt
-Hostname: localhost.localdomain                   
-Org     : DailySet1                               
-Config  : TESTCONF                                
-Date    : March 3, 2010                           
-
-The dumps were flushed to tape TESTCONF02.
-The next tape Amanda expects to use is: 1 new tape.
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)     0:00
-Run Time (hrs:min)          0:00
-Dump Time (hrs:min)         0:00       0:00       0:00
-Output Size (meg)            0.0        0.0        0.0
-Original Size (meg)          0.0        0.0        0.0
-Avg Compressed Size (%)      --         --         --
-Filesystems Dumped             0          0          0
-Avg Dump Rate (k/s)          --         --         --
-
-Tape Time (hrs:min)         0:00       0:00       0:00
-Tape Size (meg)             81.5       81.5        0.0
-Tape Used (%)              271.8      271.8        0.0
-Filesystems Taped              1          1          0
-Parts Taped                    1          1          0
-Avg Tp Write Rate (k/s)   169010     169010        --
-
-USAGE BY TAPE:
-  Label               Time         Size      %    Nb    Nc
-  TESTCONF02          0:00       83480k  271.8     1     1
-
-NOTES:
-  taper: tape TESTCONF02 kb 83480 fm 9 [OK]
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS                TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS     KB/s
--------------------------- ------------------------------------- ---------------
-localhost    /boot       0           83480    --      FLUSH        0:00 169009.9
-
-(brought to you by Amanda version x.y.z)
-%%%% plannerfail
-START planner date 20100313212012
-START driver date 20100313212012
-DISK planner 1.2.3.4 SystemState
-STATS driver hostname advantium
-DISK planner 1.2.3.4 "C:/"
-DISK planner 1.2.3.4 "E:/Replication/Scripts"
-DISK planner 1.2.3.4 "G:/"
-STATS driver startup time 0.051
-INFO dumper dumper pid 11362
-INFO dumper dumper pid 11359
-INFO dumper dumper pid 11360
-INFO dumper dumper pid 11361
-INFO taper taper pid 11358
-INFO taper Will write new label `winsafe-002' to new tape
-FAIL planner 1.2.3.4 "G:/" 20100313212012 0 "[Request to 1.2.3.4 failed: recv error: Connection reset by peer]"
-FAIL planner 1.2.3.4 "E:/Replication/Scripts" 20100313212012 0 "[Request to 1.2.3.4 failed: recv error: Connection reset by peer]"
-FAIL planner 1.2.3.4 "C:/" 20100313212012 0 "[Request to 1.2.3.4 failed: recv error: Connection reset by peer]"
-FAIL planner 1.2.3.4 SystemState 20100313212012 0 "[Request to 1.2.3.4 failed: recv error: Connection reset by peer]"
-FINISH planner date 20100313212012 time 2113.308
-WARNING driver WARNING: got empty schedule from planner
-FINISH driver date 20100313212012 time 2114.332
-%%%% plannerfail-rpt
-Hostname: advantium
-Org     : DailySet1
-Config  : TESTCONF
-Date    : March 13, 2010
-
-The next tape Amanda expects to use is: 1 new tape.
-FAILURE DUMP SUMMARY:
-  1.2.3.4 SystemState lev 0  FAILED [Request to 1.2.3.4 failed: recv error: Connection reset by peer]
-  1.2.3.4 "C:/" lev 0  FAILED [Request to 1.2.3.4 failed: recv error: Connection reset by peer]
-  1.2.3.4 "E:/Replication/Scripts" lev 0  FAILED [Request to 1.2.3.4 failed: recv error: Connection reset by peer]
-  1.2.3.4 "G:/" lev 0  FAILED [Request to 1.2.3.4 failed: recv error: Connection reset by peer]
-
-
-
-STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
-Estimate Time (hrs:min)     0:35
-Run Time (hrs:min)          0:35
-Dump Time (hrs:min)         0:00       0:00       0:00
-Output Size (meg)            0.0        0.0        0.0
-Original Size (meg)          0.0        0.0        0.0
-Avg Compressed Size (%)      --         --         --
-Filesystems Dumped             0          0          0
-Avg Dump Rate (k/s)          --         --         --
-
-Tape Time (hrs:min)         0:00       0:00       0:00
-Tape Size (meg)              0.0        0.0        0.0
-Tape Used (%)                0.0        0.0        0.0
-Filesystems Taped              0          0          0
-Parts Taped                    0          0          0
-Avg Tp Write Rate (k/s)      --         --         --
-
-NOTES:
-  driver: WARNING: got empty schedule from planner
-  taper: Will write new label `winsafe-002' to new tape
-
-
-DUMP SUMMARY:
-                                       DUMPER STATS               TAPER STATS
-HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
--------------------------- ------------------------------------- -------------
-1.2.3.4      "C:/"         MISSING -------------------------------------------
-1.2.3.4      "-/Scripts"   MISSING -------------------------------------------
-1.2.3.4      "G:/"         MISSING -------------------------------------------
-1.2.3.4      SystemState   MISSING -------------------------------------------
-
-(brought to you by Amanda version x.y.z)
+run($amreport, 'TESTCONF', '-f', $out_filename);
+is($Installcheck::Run::exit_code, 0,
+    "amreport with a planner skipped dump (success)");
+results_match($out_filename, $cat->get_text('report'),
+    "..result matches");
+
+setup_config(catalog => 'filesystemstaped', want_template => 1, runtapes => 3, tapecycle => 5);
+
+run($amreport, 'TESTCONF', '-f', $out_filename);
+is($Installcheck::Run::exit_code, 0,
+    "amreport correctly report filesystem taped (success)");
+results_match($out_filename, $cat->get_text('report'),
+    "..result matches");
+
+setup_config(catalog => 'multi-taper', want_template => 0);
+
+config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+my $logdir = getconf($CNF_LOGDIR);
+my $logfile = $logdir . "/log.20100908110856.0";
+run($amreport, 'TESTCONF', '-l', $logfile, '-f', $out_filename, '-o', 'TAPETYPE:TEST-TAPE-TEMPLATE:length=41m');
+is($Installcheck::Run::exit_code, 0,
+    "amreport correctly report multi-taper (success)");
+results_match($out_filename, $cat->get_text('report'),
+    "..result matches");
+
+cleanup();
index 6dda145dbba3893ad7417034941472369ae6353e..68fa8811f9e2cf4518eb7c33433632e7727039b0 100644 (file)
@@ -271,7 +271,7 @@ SKIP: {
     {   # write to the file
        my $xfer = Amanda::Xfer->new([
                Amanda::Xfer::Source::Random->new(32768*40+280, 0xEEEEE),
-               Amanda::Xfer::Dest::Device->new($dev, 32768*5) ]);
+               Amanda::Xfer::Dest::Device->new($dev, 0) ]);
        $xfer->start(make_cb(xmsg_cb => sub {
            my ($src, $msg, $xfer) = @_;
            if ($msg->{'type'} == $XMSG_ERROR) {
index 01efe923ecb5f84615be8e7c8d558d3bd92cc26c..585a3539ea13c637166da4c95b46825f456aa050 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 41;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use File::Find;
@@ -66,13 +68,13 @@ Installcheck::Dumpcache::load("notimestamps");
 config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF');
 
 cmp_ok(
-    run(qw(amrmtape -o tapelist="/this/is/a/fake/tapelist" TESTCONF TESTCONF01)),
-    "==", 0, "config override run"
+    run(qw(amrmtape -o tapelist=/this/is/a/fake/tapelist TESTCONF TESTCONF01)),
+    "==", 1, "config override run"
 ) or proc_diag();
 
 cmp_ok(
-    $Installcheck::Run::stderr, "=~",
-    qr/amrmtape: Could not read the tapelist/,
+    $Installcheck::Run::stdout, "=~",
+    qr/label 'TESTCONF01' not found in \/this\/is\/a\/fake\/tapelist/,
     "config overrides handled correctly"
 ) or proc_diag();
 
@@ -81,7 +83,7 @@ cmp_ok(
 Installcheck::Dumpcache::load("notimestamps");
 
 config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF');
-my $tapelist = Amanda::Tapelist::read_tapelist(config_dir_relative("tapelist"));
+my $tapelist = Amanda::Tapelist->new(config_dir_relative("tapelist"));
 ok($tapelist->lookup_tapelabel('TESTCONF01'), "looked up tape after dump");
 
 $idx_count_pre = dir_file_count($CNF_INDEXDIR);
@@ -92,7 +94,7 @@ ok(run('amrmtape', 'TESTCONF', 'TESTCONF01'), "amrmtape runs successfully")
 $idx_count_post = dir_file_count($CNF_INDEXDIR);
 is($idx_count_post, $idx_count_pre, "number of index files before and after is the same");
 
-$tapelist = Amanda::Tapelist::read_tapelist(config_dir_relative("tapelist"));
+$tapelist->reload();
 ok(!$tapelist->lookup_tapelabel('TESTCONF01'),
      "should fail to look up tape that should has been removed");
 
@@ -119,7 +121,7 @@ ok(run('amrmtape', '--cleanup', 'TESTCONF', 'TESTCONF01'),
 $idx_count_post = dir_file_count($CNF_INDEXDIR);
 isnt($idx_count_post, $idx_count_pre, "number of index files before and after is different");
 
-$tapelist = Amanda::Tapelist::read_tapelist(config_dir_relative("tapelist"));
+$tapelist->reload();
 ok(!$tapelist->lookup_tapelabel('TESTCONF01'),
      "succesfully looked up tape that should have been removed after --cleanup");
 
@@ -146,7 +148,7 @@ ok(run('amrmtape', '--erase', 'TESTCONF', 'TESTCONF01'),
 $idx_count_post = dir_file_count($CNF_INDEXDIR);
 is($idx_count_post, $idx_count_pre, "number of index files before and after is the same");
 
-$tapelist = Amanda::Tapelist::read_tapelist(config_dir_relative("tapelist"));
+$tapelist->reload();
 ok(!$tapelist->lookup_tapelabel('TESTCONF01'),
      "succesfully looked up tape that should have been removed after --erase");
 
@@ -174,7 +176,7 @@ ok(run('amrmtape', '--keep-label', 'TESTCONF', 'TESTCONF01'),
 $idx_count_post = dir_file_count($CNF_INDEXDIR);
 is($idx_count_post, $idx_count_pre, "number of index files before and after is the same");
 
-$tapelist = Amanda::Tapelist::read_tapelist(config_dir_relative("tapelist"));
+$tapelist->reload();
 my $tape = $tapelist->lookup_tapelabel('TESTCONF01');
 ok($tape, "succesfully looked up tape that should still be there");
 is($tape->{'datestamp'}, "0", "datestamp was zeroed");
@@ -202,7 +204,7 @@ ok(run('amrmtape', '--keep-label', '--erase', 'TESTCONF', 'TESTCONF01'),
 $idx_count_post = dir_file_count($CNF_INDEXDIR);
 is($idx_count_post, $idx_count_pre, "number of index files before and after is the same");
 
-$tapelist = Amanda::Tapelist::read_tapelist(config_dir_relative("tapelist"));
+$tapelist->reload();
 $tape = $tapelist->lookup_tapelabel('TESTCONF01');
 ok($tape, "succesfully looked up tape that should still be there");
 is($tape->{'datestamp'}, "0", "datestamp was zeroed");
@@ -228,7 +230,7 @@ ok(run('amrmtape', '--keep-label', '--erase', 'TESTCONF', 'TESTCONF01'),
 $idx_count_post = dir_file_count($CNF_INDEXDIR);
 is($idx_count_post, $idx_count_pre, "number of index files before and after is the same");
 
-$tapelist = Amanda::Tapelist::read_tapelist(config_dir_relative("tapelist"));
+$tapelist->reload();
 $tape = $tapelist->lookup_tapelabel('TESTCONF01');
 ok($tape, "succesfully looked up tape that should still be there");
 is($tape->{'datestamp'}, "0", "datestamp was zeroed");
@@ -254,7 +256,7 @@ ok(run('amrmtape', '--dryrun', '--erase', '--cleanup', 'TESTCONF', 'TESTCONF01')
 $idx_count_post = dir_file_count($CNF_INDEXDIR);
 is($idx_count_post, $idx_count_pre, "number of index files before and after is the same");
 
-$tapelist = Amanda::Tapelist::read_tapelist(config_dir_relative("tapelist"));
+$tapelist->reload();
 ok($tapelist->lookup_tapelabel('TESTCONF01'),
      "succesfully looked up tape that should still be there");
 
diff --git a/installcheck/amserverconfig.pl b/installcheck/amserverconfig.pl
new file mode 100644 (file)
index 0000000..5b61ae3
--- /dev/null
@@ -0,0 +1,73 @@
+# Copyright (c) 2010 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use Test::More tests => 8;
+
+use lib "@amperldir@";
+use File::Path;
+use Installcheck;
+use Installcheck::Run qw(run run_err $diskname);
+use Amanda::Paths;
+use Amanda::Constants;
+use Amanda::Util qw( slurp burp );
+use Amanda::Config qw( :init );
+
+# this basically gets one run of amserverconfig in for each template, and then
+# checks that the config loads correctly
+
+sub config_ok {
+    my ($msg) = @_;
+
+    config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+
+    my ($cfgerr_level, @cfgerr_errors) = config_errors();
+    ok($cfgerr_level < $CFGERR_WARNINGS, $msg || "..config is OK") or
+       config_print_errors();
+
+    config_uninit();
+}
+
+Installcheck::Run::cleanup();
+ok(run("$sbindir/amserverconfig", 'TESTCONF', '--template', 'S3'),
+    "amserverconfig with S3 template")
+    or diag($Installcheck::Run::stderr);
+config_ok();
+
+Installcheck::Run::cleanup();
+ok(run("$sbindir/amserverconfig", 'TESTCONF', '--template', 'harddisk'),
+    "amserverconfig with harddisk template")
+    or diag($Installcheck::Run::stderr);
+config_ok();
+
+Installcheck::Run::cleanup();
+ok(run("$sbindir/amserverconfig", 'TESTCONF', '--template', 'single-tape'),
+    "amserverconfig with single-tape template")
+    or diag($Installcheck::Run::stderr);
+config_ok();
+
+SKIP: {
+    skip "tape-changer template requires mtx", 2
+       unless $Amanda::Constants::MTX && -x $Amanda::Constants::MTX;
+    Installcheck::Run::cleanup();
+    ok(run("$sbindir/amserverconfig", 'TESTCONF', '--template', 'tape-changer'),
+       "amserverconfig with tape-changer template")
+       or diag($Installcheck::Run::stderr);
+    config_ok();
+}
+
+Installcheck::Run::cleanup();
index 87e06eb504fa4e38bc5ed41961f56e422cc16ef2..560ca277e645d6b8cdd15c83c2aa102e10f60fe8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 3;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
index cf41b476acf8244b99027eda9ec3650c4f1a00b5..fd2a1c3f695bab101c0385859517c4df08a1e84e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 10;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
 use Installcheck::Run qw( run run_get );
+use Installcheck::Catalogs;
 use Amanda::Paths;
 use Amanda::Constants;
 
-my $filename="$Installcheck::TMP/installcheck-amdump.1";
+my $cat;
 my $testconf = Installcheck::Run::setup();
 $testconf->write();
 
-# read __DATA__ to a hash, keyed by the names following '%%%%'
-my %logfiles;
-my $key = undef;
-while (<DATA>) {
-    if (/^%%%% (.*)/) {
-       $key = $1;
-    } else {
-       $logfiles{$key} .= $_;
-    }
-}
-
-sub write_logfile {
-    my ($data) = @_;
-    open(my $fh, ">", $filename) or die("Could not open '$filename' for writing");
-    print $fh $data;
-    close($fh);
-};
-
 ## try a few various options with a pretty normal logfile
 
-write_logfile($logfiles{'normal'});
+$cat = Installcheck::Catalogs::load('normal');
+$cat->install();
 
-ok(run('amstatus', 'TESTCONF', '--file', $filename),
+ok(run('amstatus', 'TESTCONF'),
     "plain amstatus runs without error");
 like($Installcheck::Run::stdout,
     qr{clienthost:/some/dir\s*0\s*100k\s*finished\s*\(13:01:53\)},
     "output is reasonable");
 
-ok(run('amstatus', 'TESTCONF', '--file', $filename, '--summary'),
+ok(run('amstatus', 'TESTCONF', '--summary'),
     "amstatus --summary runs without error");
 unlike($Installcheck::Run::stdout,
     qr{clienthost:/some/dir\s*0\s*100k\s*finished\s*\(13:01:53\)},
@@ -67,9 +53,10 @@ like($Installcheck::Run::stdout,
 
 ## now test a file with spaces and other funny characters in filenames
 
-write_logfile($logfiles{'quoted'});
+$cat = Installcheck::Catalogs::load('quoted');
+$cat->install();
 
-ok(run('amstatus', 'TESTCONF', '--file', $filename),
+ok(run('amstatus', 'TESTCONF'),
     "amstatus runs without error with quoted disknames");
 like($Installcheck::Run::stdout,
     # note that amstatus' output is quoted, so backslashes are doubled
@@ -78,425 +65,13 @@ like($Installcheck::Run::stdout,
 
 ## now test a chunker partial result
 
-write_logfile($logfiles{'chunker_partial'});
+$cat = Installcheck::Catalogs::load('chunker-partial');
+$cat->install();
 
-ok(!run('amstatus', 'TESTCONF', '--file', $filename),
+ok(!run('amstatus', 'TESTCONF'),
     "amstatus return error with chunker partial");
-ok($Installcheck::Run::exit_code == 4,
+is($Installcheck::Run::exit_code, 4,
     "correct exit code for chunker partial");
 like($Installcheck::Run::stdout,
     qr{localhost:/etc 0 backup failed: dumper: \[/usr/sbin/tar returned error\] \(7:49:23\)},
     "output is correct");
-
-unlink($filename);
-
-__DATA__
-%%%% normal
-amdump: start at Wed Jun 18 13:01:47 EDT 2008
-amdump: datestamp 20080618
-amdump: starttime 20080618130147
-amdump: starttime-locale-independent 2008-06-18 13:01:47 EDT
-planner: pid 4079 executable /path/to/planner version 9.8.7
-READING CONF INFO...
-planner: timestamp 20080618130147
-planner: time 0.000: startup took 0.000 secs
-
-SENDING FLUSHES...
-ENDFLUSH
-
-SETTING UP FOR ESTIMATES...
-planner: time 0.000: setting up estimates for clienthost:/some/dir
-clienthost:/some/dir overdue 14049 days for level 0
-setup_estimate: clienthost:/some/dir: command 0, options: none    last_level -1 next_level0 -14049 level_days 0    getting estimates 0 (-2) -1 (-2) -1 (-2)
-planner: time 0.000: setting up estimates took 0.000 secs
-
-GETTING ESTIMATES...
-driver: pid 4080 executable /path/to/driver version 9.8.7
-driver: adding holding disk 0 dir /holding size 868352 chunksize 1048576
-reserving 0 out of 868352 for degraded-mode dumps
-driver: send-cmd time 0.015 to taper: START-TAPER 20080618130147
-taper: pid 4084 executable taper version 9.8.7
-driver: started dumper0 pid 4086
-driver: send-cmd time 0.031 to dumper0: START 20080618130147
-planner: time 0.050: got partial result for host clienthost disk /some/dir: 0 -> -2K, -1 -> -2K, -1 -> -2K
-dumper: pid 4090 executable dumper1 version 9.8.7
-driver: started dumper1 pid 4090
-driver: send-cmd time 0.046 to dumper1: START 20080618130147
-driver: started dumper2 pid 4094
-driver: send-cmd time 0.048 to dumper2: START 20080618130147
-driver: started dumper3 pid 4095
-driver: send-cmd time 0.059 to dumper3: START 20080618130147
-driver: start time 0.059 inparallel 4 bandwidth 600 diskspace 868352  dir OBSOLETE datestamp 20080618130147 driver: drain-ends tapeq FIRST big-dumpers sssS
-dumper: pid 4094 executable dumper2 version 9.8.7
-planner: time 0.088: got partial result for host clienthost disk /some/dir: 0 -> 100K, -1 -> -2K, -1 -> -2K
-planner: time 0.091: got result for host clienthost disk /some/dir: 0 -> 100K, -1 -> -2K, -1 -> -2K
-planner: time 0.091: getting estimates took 0.090 secs
-FAILED QUEUE: empty
-DONE QUEUE:
-  0: clienthost     /some/dir
-
-ANALYZING ESTIMATES...
-pondering clienthost:/some/dir... next_level0 -14049 last_level -1 (due for level 0) (new disk, can't switch to degraded mode)
-  curr level 0 nsize 100 csize 100 total size 208 total_lev0 100 balanced-lev0size 50
-INITIAL SCHEDULE (size 208):
-  clienthost /some/dir pri 14050 lev 0 nsize 100 csize 100
-
-DELAYING DUMPS IF NEEDED, total_size 208, tape length 102400 mark 4
-  delay: Total size now 208.
-
-PROMOTING DUMPS IF NEEDED, total_lev0 100, balanced_size 50...
-planner: time 0.091: analysis took 0.000 secs
-
-GENERATING SCHEDULE:
---------
-DUMP clienthost ffffffff9ffeffffffff1f /some/dir 20080618130147 14050 0 1970:1:1:0:0:0 100 100 0 1024
---------
-dumper: pid 4086 executable dumper0 version 9.8.7
-dumper: pid 4095 executable dumper3 version 9.8.7
-taper: using label `Conf-001' date `20080618130147'
-driver: result time 1.312 from taper: TAPER-OK
-driver: state time 1.312 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: not-idle
-driver: interface-state time 1.312 if default: free 600
-driver: hdisk-state time 1.312 hdisk 0: free 868352 dumpers 0
-driver: flush size 0
-driver: started chunker0 pid 4129
-driver: send-cmd time 1.314 to chunker0: START 20080618130147
-driver: send-cmd time 1.314 to chunker0: PORT-WRITE 00-00001 /holding/20080618130147/clienthost._some_dir.0 clienthost ffffffff9ffeffffffff1f /some/dir 0 1970:1:1:0:0:0 1048576 GNUTAR 192 |;auth=local;index;
-chunker: pid 4129 executable chunker0 version 9.8.7
-driver: result time 1.330 from chunker0: PORT 1487
-driver: send-cmd time 1.330 to dumper0: PORT-DUMP 00-00001 1487 clienthost ffffffff9ffeffffffff1f /some/dir NODEVICE 0 1970:1:1:0:0:0 GNUTAR X amanda X local |"  <auth>local</auth>\n  <record>YES</record>\n  <index>YES</index>\n"
-driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.408 if default: free 0
-driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1
-driver: result time 6.408 from dumper0: DONE 00-00001 100 100 0 "[sec 0.012 kb 100 kps 7915.1 orig-kb 100]"
-driver: finished-cmd time 6.408 dumper0 dumped clienthost:/some/dir
-driver: send-cmd time 6.408 to chunker0: DONE 00-00001
-driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.408 if default: free 0
-driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1
-driver: result time 6.408 from chunker0: DONE 00-00001 100 "[sec 5.075 kb 100 kps 26.0]"
-driver: finished-cmd time 6.408 chunker0 chunked clienthost:/some/dir
-driver: send-cmd time 6.410 to taper: FILE-WRITE 00-00002 /holding/20080618130147/clienthost._some_dir.0 clienthost /some/dir 0 20080618130147 0
-driver: startaflush: FIRST clienthost /some/dir 132 102400
-driver: state time 6.410 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.410 if default: free 600
-driver: hdisk-state time 6.410 hdisk 0: free 868220 dumpers 0
-driver: result time 6.411 from taper: REQUEST-NEW-TAPE 00-00002
-driver: send-cmd time 6.411 to taper: NEW-TAPE
-driver: state time 6.412 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.412 if default: free 600
-driver: hdisk-state time 6.412 hdisk 0: free 868220 dumpers 0
-driver: result time 6.412 from taper: NEW-TAPE 00-00002 Conf-001
-driver: state time 6.414 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.414 if default: free 600
-driver: hdisk-state time 6.414 hdisk 0: free 868220 dumpers 0
-driver: result time 6.415 from taper: PARTDONE 00-00002 Conf-001 1 100 "[sec 0.001177 kb 100 kps 84961.767205]"
-driver: state time 6.415 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.415 if default: free 600
-driver: hdisk-state time 6.415 hdisk 0: free 868220 dumpers 0
-driver: result time 6.415 from taper: DONE 00-00002 INPUT-GOOD TAPE-GOOD "[sec 0.001177 kb 100 kps 84961.767205]" "" ""
-driver: finished-cmd time 6.415 taper wrote clienthost:/some/dir
-driver: state time 6.415 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.415 if default: free 600
-driver: hdisk-state time 6.415 hdisk 0: free 868352 dumpers 0
-driver: QUITTING time 6.415 telling children to quit
-driver: send-cmd time 6.415 to dumper0: QUIT
-driver: send-cmd time 6.415 to dumper1: QUIT
-driver: send-cmd time 6.417 to dumper2: QUIT
-driver: send-cmd time 6.417 to dumper3: QUIT
-driver: send-cmd time 6.418 to taper: QUIT
-taper: DONE
-driver: FINISHED time 7.426
-amdump: end at Wed Jun 18 13:01:55 EDT 2008
-%%%% quoted
-amdump: start at Wed Jun 18 13:01:47 EDT 2008
-amdump: datestamp 20080618
-amdump: starttime 20080618130147
-amdump: starttime-locale-independent 2008-06-18 13:01:47 EDT
-planner: pid 4079 executable /path/to/planner version 9.8.7
-READING CONF INFO...
-planner: timestamp 20080618130147
-planner: time 0.000: startup took 0.000 secs
-
-SENDING FLUSHES...
-ENDFLUSH
-
-SETTING UP FOR ESTIMATES...
-planner: time 0.000: setting up estimates for clienthost:"C:\\Some Dir\\"
-clienthost:"C:\\Some Dir\\" overdue 14049 days for level 0
-setup_estimate: clienthost:"C:\\Some Dir\\": command 0, options: none    last_level -1 next_level0 -14049 level_days 0    getting estimates 0 (-2) -1 (-2) -1 (-2)
-planner: time 0.000: setting up estimates took 0.000 secs
-
-GETTING ESTIMATES...
-driver: pid 4080 executable /path/to/driver version 9.8.7
-driver: adding holding disk 0 dir /holding size 868352 chunksize 1048576
-reserving 0 out of 868352 for degraded-mode dumps
-driver: send-cmd time 0.015 to taper: START-TAPER 20080618130147
-taper: pid 4084 executable taper version 9.8.7
-driver: started dumper0 pid 4086
-driver: send-cmd time 0.031 to dumper0: START 20080618130147
-planner: time 0.050: got partial result for host clienthost disk "C:\\Some Dir\\": 0 -> -2K, -1 -> -2K, -1 -> -2K
-dumper: pid 4090 executable dumper1 version 9.8.7
-driver: started dumper1 pid 4090
-driver: send-cmd time 0.046 to dumper1: START 20080618130147
-driver: started dumper2 pid 4094
-driver: send-cmd time 0.048 to dumper2: START 20080618130147
-driver: started dumper3 pid 4095
-driver: send-cmd time 0.059 to dumper3: START 20080618130147
-driver: start time 0.059 inparallel 4 bandwidth 600 diskspace 868352  dir OBSOLETE datestamp 20080618130147 driver: drain-ends tapeq FIRST big-dumpers sssS
-dumper: pid 4094 executable dumper2 version 9.8.7
-planner: time 0.088: got partial result for host clienthost disk "C:\\Some Dir\\": 0 -> 100K, -1 -> -2K, -1 -> -2K
-planner: time 0.091: got result for host clienthost disk "C:\\Some Dir\\": 0 -> 100K, -1 -> -2K, -1 -> -2K
-planner: time 0.091: getting estimates took 0.090 secs
-FAILED QUEUE: empty
-DONE QUEUE:
-  0: clienthost     "C:\\Some Dir\\"
-
-ANALYZING ESTIMATES...
-pondering clienthost:"C:\\Some Dir\\"... next_level0 -14049 last_level -1 (due for level 0) (new disk, can't switch to degraded mode)
-  curr level 0 nsize 100 csize 100 total size 208 total_lev0 100 balanced-lev0size 50
-INITIAL SCHEDULE (size 208):
-  clienthost "C:\\Some Dir\\" pri 14050 lev 0 nsize 100 csize 100
-
-DELAYING DUMPS IF NEEDED, total_size 208, tape length 102400 mark 4
-  delay: Total size now 208.
-
-PROMOTING DUMPS IF NEEDED, total_lev0 100, balanced_size 50...
-planner: time 0.091: analysis took 0.000 secs
-
-GENERATING SCHEDULE:
---------
-DUMP clienthost ffffffff9ffeffffffff1f "C:\\Some Dir\\" 20080618130147 14050 0 1970:1:1:0:0:0 100 100 0 1024
---------
-dumper: pid 4086 executable dumper0 version 9.8.7
-dumper: pid 4095 executable dumper3 version 9.8.7
-taper: using label `Conf-001' date `20080618130147'
-driver: result time 1.312 from taper: TAPER-OK
-driver: state time 1.312 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: not-idle
-driver: interface-state time 1.312 if default: free 600
-driver: hdisk-state time 1.312 hdisk 0: free 868352 dumpers 0
-driver: flush size 0
-driver: started chunker0 pid 4129
-driver: send-cmd time 1.314 to chunker0: START 20080618130147
-driver: send-cmd time 1.314 to chunker0: PORT-WRITE 00-00001 /holding/20080618130147/clienthost._some_dir.0 clienthost ffffffff9ffeffffffff1f "C:\\Some Dir\\" 0 1970:1:1:0:0:0 1048576 GNUTAR 192 |;auth=local;index;
-chunker: pid 4129 executable chunker0 version 9.8.7
-driver: result time 1.330 from chunker0: PORT 1487
-driver: send-cmd time 1.330 to dumper0: PORT-DUMP 00-00001 1487 clienthost ffffffff9ffeffffffff1f "C:\\Some Dir\\" NODEVICE 0 1970:1:1:0:0:0 GNUTAR X amanda X local |"  <auth>local</auth>\n  <record>YES</record>\n  <index>YES</index>\n"
-driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.408 if default: free 0
-driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1
-driver: result time 6.408 from dumper0: DONE 00-00001 100 100 0 "[sec 0.012 kb 100 kps 7915.1 orig-kb 100]"
-driver: finished-cmd time 6.408 dumper0 dumped clienthost:"C:\\Some Dir\\"
-driver: send-cmd time 6.408 to chunker0: DONE 00-00001
-driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.408 if default: free 0
-driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1
-driver: result time 6.408 from chunker0: DONE 00-00001 100 "[sec 5.075 kb 100 kps 26.0]"
-driver: finished-cmd time 6.408 chunker0 chunked clienthost:"C:\\Some Dir\\"
-driver: send-cmd time 6.410 to taper: FILE-WRITE 00-00002 /holding/20080618130147/clienthost._some_dir.0 clienthost "C:\\Some Dir\\" 0 20080618130147 0
-driver: startaflush: FIRST clienthost "C:\\Some Dir\\" 132 102400
-driver: state time 6.410 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.410 if default: free 600
-driver: hdisk-state time 6.410 hdisk 0: free 868220 dumpers 0
-driver: result time 6.411 from taper: REQUEST-NEW-TAPE 00-00002
-driver: send-cmd time 6.411 to taper: NEW-TAPE
-driver: state time 6.412 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.412 if default: free 600
-driver: hdisk-state time 6.412 hdisk 0: free 868220 dumpers 0
-driver: result time 6.412 from taper: NEW-TAPE 00-00002 Conf-001
-driver: state time 6.414 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.414 if default: free 600
-driver: hdisk-state time 6.414 hdisk 0: free 868220 dumpers 0
-driver: result time 6.415 from taper: PARTDONE 00-00002 Conf-001 1 100 "[sec 0.001177 kb 100 kps 84961.767205]"
-driver: state time 6.415 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.415 if default: free 600
-driver: hdisk-state time 6.415 hdisk 0: free 868220 dumpers 0
-driver: result time 6.415 from taper: DONE 00-00002 INPUT-GOOD TAPE-GOOD "[sec 0.001177 kb 100 kps 84961.767205]" "" ""
-driver: finished-cmd time 6.415 taper wrote clienthost:"C:\\Some Dir\\"
-driver: state time 6.415 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 6.415 if default: free 600
-driver: hdisk-state time 6.415 hdisk 0: free 868352 dumpers 0
-driver: QUITTING time 6.415 telling children to quit
-driver: send-cmd time 6.415 to dumper0: QUIT
-driver: send-cmd time 6.415 to dumper1: QUIT
-driver: send-cmd time 6.417 to dumper2: QUIT
-driver: send-cmd time 6.417 to dumper3: QUIT
-driver: send-cmd time 6.418 to taper: QUIT
-taper: DONE
-driver: FINISHED time 7.426
-amdump: end at Wed Jun 18 13:01:55 EDT 2008
-%%%% chunker_partial
-amdump: start at Fri Apr 10 07:47:59 PDT 2009
-amdump: datestamp 20090410
-amdump: starttime 20090410074759
-amdump: starttime-locale-independent 2009-04-10 07:47:59 PDT
-planner: pid 4108 executable /usr/lib/amanda/planner version 3.0.0
-planner: build: VERSION="Amanda-3.0.0"
-planner:        BUILT_DATE="Wed Apr 8 17:49:57 PDT 2009"
-planner:        BUILT_MACH="i386-pc-solaris2.10" BUILT_REV="16514"
-planner:        BUILT_BRANCH="Amanda_Enterprise_3_0" CC="gcc"
-planner: paths: bindir="/usr/bin" sbindir="/usr/sbin"
-planner:        libexecdir="/usr/lib" amlibexecdir="/usr/lib/amanda"
-planner:        mandir="/usr/share/man" AMANDA_TMPDIR="/tmp/amanda"
-planner:        AMANDA_DBGDIR="/var/log/amanda" CONFIG_DIR="/etc/amanda"
-planner:        DEV_PREFIX="/dev/dsk/" RDEV_PREFIX="/dev/rdsk/"
-planner:        DUMP="/usr/sbin/ufsdump" RESTORE="/usr/sbin/ufsrestore"
-planner:        VDUMP=UNDEF VRESTORE=UNDEF XFSDUMP=UNDEF XFSRESTORE=UNDEF
-planner:        VXDUMP=UNDEF VXRESTORE=UNDEF
-planner:        SAMBA_CLIENT="/usr/sfw/bin/smbclient"
-planner:        STAR="/opt/csw/bin/star" GNUTAR="/opt/csw/bin/gtar"
-planner:        COMPRESS_PATH="/usr/bin/gzip"
-planner:        UNCOMPRESS_PATH="/usr/bin/gzip" LPRCMD="/usr/bin/lp"
-planner:         MAILER=UNDEF listed_incr_dir="/var/lib/amanda/gnutar-lists"
-planner: defs:  DEFAULT_SERVER="localhost" DEFAULT_CONFIG="DailySet1"
-planner:        DEFAULT_TAPE_SERVER="localhost" DEFAULT_TAPE_DEVICE=""
-planner:        HAVE_MMAP NEED_STRSTR HAVE_SYSVSHM AMFLOCK_POSIX AMFLOCK_LOCKF
-planner:        AMFLOCK_LNLOCK SETPGRP_VOID ASSERTIONS AMANDA_DEBUG_DAYS=4
-planner:        BSD_SECURITY RSH_SECURITY USE_AMANDAHOSTS
-planner:        CLIENT_LOGIN="amandabackup" CHECK_USERID HAVE_GZIP
-planner:        COMPRESS_SUFFIX=".gz" COMPRESS_FAST_OPT="--fast"
-planner:        COMPRESS_BEST_OPT="--best" UNCOMPRESS_OPT="-dc"
-READING CONF INFO...
-planner: timestamp 20090410074759
-planner: time 0.001: startup took 0.001 secs
-
-SENDING FLUSHES...
-ENDFLUSH
-
-SETTING UP FOR ESTIMATES...
-planner: time 0.001: setting up estimates for localhost:/etc
-localhost:/etc overdue 14338 days for level 0
-setup_estimate: localhost:/etc: command 0, options: none    last_level 0 next_level0 -14338 level_days 0    getting estimates 0 (-2) 1 (-2) -1 (-2)
-planner: time 0.002: setting up estimates took 0.000 secs
-
-GETTING ESTIMATES...
-planner time 0.113: got result for host localhost disk /etc: 0 -> 80822K, 1 -> 61440K, -1 -> -2K
-driver: pid 4109 executable /usr/lib/amanda/driver version 3.0.0
-driver: tape size 122880
-driver: adding holding disk 0 dir /var/lib/amanda/staging size 1215488 chunksize 1048576
-reserving 1215488 out of 1215488 for degraded-mode dumps
-driver: send-cmd time 0.010 to taper: START-TAPER 20090410074759
-driver: started dumper0 pid 4116
-driver: send-cmd time 0.012 to dumper0: START 20090410074759
-driver: started dumper1 pid 4117
-driver: send-cmd time 0.014 to dumper1: START 20090410074759
-driver: started dumper2 pid 4118
-driver: send-cmd time 0.016 to dumper2: START 20090410074759
-driver: started dumper3 pid 4119
-driver: send-cmd time 0.018 to dumper3: START 20090410074759
-driver: start time 0.018 inparallel 4 bandwidth 8000 diskspace 1215488  dir OBSOLETE datestamp 20090410074759 driver: drain-ends tapeq FIRST big-dumpers sssS
-taper: pid 4115 executable taper version 3.0.0
-dumper: pid 4116 executable dumper0 version 3.0.0
-planner: time 0.744: got partial result for host localhost disk /etc: 0 -> 80822K, 1 -> -1K, -1 -> -2K
-planner: time 0.744: got result for host localhost disk /etc: 0 -> 80822K, 1 -> -1K, -1 -> -2K
-planner: time 0.745: getting estimates took 0.742 secs
-FAILED QUEUE: empty
-DONE QUEUE:
-  0: localhost  /etc
-
-ANALYZING ESTIMATES...
-pondering localhost:/etc... next_level0 -14338 last_level 0 (due for level 0) (picking inclevel for degraded mode)   picklev: last night 0, so tonight level 1
-(no inc estimate)
-  curr level 0 nsize 80822 csize 80822 total size 80921 total_lev0 80822 balanced-lev0size 11546
-INITIAL SCHEDULE (size 80921):
-  localhost /etc pri 14339 lev 0 nsize 80822 csize 80822
-
-DELAYING DUMPS IF NEEDED, total_size 80921, tape length 122880 mark 1
-  delay: Total size now 80921.
-
-PROMOTING DUMPS IF NEEDED, total_lev0 80822, balanced_size 11546...
-planner: time 0.745: analysis took 0.000 secs
-
-GENERATING SCHEDULE:
---------
-DUMP localhost ffffffff9efeffffffffff01 /etc 20090410074759 14339 0 1970:1:1:0:0:0 80822 80822 86 929 "Can't switch to degraded mode because an incremental estimate could not be performed"
---------
-dumper: pid 4119 executable dumper3 version 3.0.0
-dumper: pid 4118 executable dumper2 version 3.0.0
-dumper: pid 4117 executable dumper1 version 3.0.0
-taper: using label `maitreyee-010' date `20090410074759'
-driver: result time 2.928 from taper: TAPER-OK 
-driver: state time 2.937 free kps: 8000 space: 1215488 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: not-idle
-driver: interface-state time 2.937 if default: free 8000
-driver: hdisk-state time 2.937 hdisk 0: free 1215488 dumpers 0
-driver: flush size 0
-driver: started chunker0 pid 4160
-driver: send-cmd time 2.954 to chunker0: START 20090410074759
-driver: send-cmd time 2.954 to chunker0: PORT-WRITE 00-00001 /var/lib/amanda/staging/20090410074759/localhost._etc.0 localhost ffffffff9efeffffffffff01 /etc 0 1970:1:1:0:0:0 1048576 APPLICATION 80896 |;auth=bsdtcp;index;
-chunker: pid 4160 executable chunker0 version 3.0.0
-driver: result time 3.000 from chunker0: PORT 11005
-driver: send-cmd time 3.001 to dumper0: PORT-DUMP 00-00001 11005 localhost ffffffff9efeffffffffff01 /etc /etc 0 1970:1:1:0:0:0 amsuntar X X X bsdtcp |"  <auth>bsdtcp</auth>\n  <record>YES</record>\n  <index>YES</index>\n  <backup-program>\n    <plugin>amsuntar</plugin>\n    <property>\n      <name>EXTENDED-HEADERS</name>\n      <value>NO</value>\n    </property>\n    <property>\n      <name>EXTENDED-ATTRIBUTES</name>\n      <value>NO</value>\n    </property>\n    <property>\n      <name>BLOCK-SIZE</name>\n      <value>64</value>\n    </property>\n  </backup-program>\n"
-driver: state time 3.034 free kps: 7071 space: 1134592 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 3.034 if default: free 7071
-driver: hdisk-state time 3.034 hdisk 0: free 1134592 dumpers 1
-driver: state time 49.732 free kps: 7071 space: 1134592 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 49.732 if default: free 7071
-driver: hdisk-state time 49.732 hdisk 0: free 1134592 dumpers 1
-driver: result time 49.732 from chunker0: RQ-MORE-DISK 00-00001
-driver: send-cmd time 49.733 to chunker0: CONTINUE 00-00001 /var/lib/amanda/staging/20090410074759/localhost._etc.0 1048576 4096
-dumper: kill index command
-driver: state time 49.901 free kps: 7071 space: 1130496 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 49.901 if default: free 7071
-driver: hdisk-state time 49.901 hdisk 0: free 1130496 dumpers 1
-driver: result time 49.901 from dumper0: FAILED 00-00001 "[/usr/sbin/tar returned error]"
-driver: send-cmd time 49.901 to chunker0: FAILED 00-00001
-driver: state time 49.906 free kps: 7071 space: 1130496 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 49.906 if default: free 7071
-driver: hdisk-state time 49.906 hdisk 0: free 1130496 dumpers 1
-driver: result time 49.906 from chunker0: PARTIAL 00-00001 80909 "[sec 46.789 kb 80909 kps 1729.9]"
-driver: finished-cmd time 49.907 chunker0 chunked localhost:/etc
-driver: started chunker0 pid 4184
-driver: send-cmd time 50.094 to chunker0: START 20090410074759
-driver: send-cmd time 50.094 to chunker0: PORT-WRITE 00-00002 /var/lib/amanda/staging/20090410074759/localhost._etc.0 localhost ffffffff9efeffffffffff01 /etc 0 1970:1:1:0:0:0 1048576 APPLICATION 84960 |;auth=bsdtcp;index;
-chunker: pid 4184 executable chunker0 version 3.0.0
-driver: result time 50.139 from chunker0: PORT 11035
-driver: send-cmd time 50.140 to dumper0: PORT-DUMP 00-00002 11035 localhost ffffffff9efeffffffffff01 /etc /etc 0 1970:1:1:0:0:0 amsuntar X X X bsdtcp |"  <auth>bsdtcp</auth>\n  <record>YES</record>\n  <index>YES</index>\n  <backup-program>\n    <plugin>amsuntar</plugin>\n    <property>\n      <name>EXTENDED-HEADERS</name>\n      <value>NO</value>\n    </property>\n    <property>\n      <name>EXTENDED-ATTRIBUTES</name>\n      <value>NO</value>\n    </property>\n    <property>\n      <name>BLOCK-SIZE</name>\n      <value>64</value>\n    </property>\n  </backup-program>\n"
-driver: state time 50.175 free kps: 7071 space: 1130528 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 50.175 if default: free 7071
-driver: hdisk-state time 50.175 hdisk 0: free 1130528 dumpers 1
-driver: state time 84.740 free kps: 7071 space: 1130528 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 84.740 if default: free 7071
-driver: hdisk-state time 84.740 hdisk 0: free 1130528 dumpers 1
-driver: result time 84.740 from dumper0: FAILED 00-00002 "[/usr/sbin/tar returned error]"
-driver: send-cmd time 84.740 to chunker0: FAILED 00-00002
-driver: state time 84.745 free kps: 7071 space: 1130528 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 84.745 if default: free 7071
-driver: hdisk-state time 84.745 hdisk 0: free 1130528 dumpers 1
-driver: result time 84.745 from chunker0: PARTIAL 00-00002 80917 "[sec 34.565 kb 80917 kps 2341.9]"
-driver: finished-cmd time 84.745 chunker0 chunked localhost:/etc
-dumper: kill index command
-driver: send-cmd time 84.890 to taper: FILE-WRITE 00-00003 /var/lib/amanda/staging/20090410074759/localhost._etc.0 localhost /etc 0 20090410074759 0
-driver: startaflush: FIRST localhost /etc 80949 122880
-driver: state time 84.890 free kps: 8000 space: 1134539 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 84.890 if default: free 8000
-driver: hdisk-state time 84.890 hdisk 0: free 1134539 dumpers 0
-driver: state time 84.891 free kps: 8000 space: 1134539 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 84.891 if default: free 8000
-driver: hdisk-state time 84.891 hdisk 0: free 1134539 dumpers 0
-driver: result time 84.891 from taper: REQUEST-NEW-TAPE 00-00003
-driver: send-cmd time 84.891 to taper: NEW-TAPE
-driver: state time 84.906 free kps: 8000 space: 1134539 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 84.906 if default: free 8000
-driver: hdisk-state time 84.906 hdisk 0: free 1134539 dumpers 0
-driver: result time 84.906 from taper: NEW-TAPE 00-00003 maitreyee-010
-driver: state time 114.910 free kps: 8000 space: 1134539 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 114.910 if default: free 8000
-driver: hdisk-state time 114.910 hdisk 0: free 1134539 dumpers 0
-driver: result time 114.911 from taper: PARTDONE 00-00003 maitreyee-010 1 80917 "[sec 30.003926 kb 80917 kps 2696.880402]"
-driver: state time 114.911 free kps: 8000 space: 1134539 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 114.911 if default: free 8000
-driver: hdisk-state time 114.911 hdisk 0: free 1134539 dumpers 0
-driver: result time 114.911 from taper: DONE 00-00003 INPUT-GOOD TAPE-GOOD "[sec 30.003926 kb 80917 kps 2696.880402]" "" ""
-driver: finished-cmd time 114.911 taper wrote localhost:/etc
-driver: state time 114.943 free kps: 8000 space: 1215488 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
-driver: interface-state time 114.943 if default: free 8000
-driver: hdisk-state time 114.943 hdisk 0: free 1215488 dumpers 0
-driver: QUITTING time 114.943 telling children to quit
-driver: send-cmd time 114.943 to dumper0: QUIT ""
-driver: send-cmd time 114.944 to dumper1: QUIT ""
-driver: send-cmd time 114.944 to dumper2: QUIT ""
-driver: send-cmd time 114.944 to dumper3: QUIT ""
-driver: send-cmd time 114.944 to taper: QUIT
-taper: DONE
-driver: FINISHED time 115.961
-amdump: end at Fri Apr 10 07:49:55 PDT 2009
index 3a2beadb5be8a804de72e40e26e8f468fc5244d6..51ea4842d3e50d4fb984281ee56d28cebe8f024b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 42;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
@@ -69,7 +71,7 @@ sub setup_vtapes {
         or BAIL_OUT("device error");
 
     my $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST));
-    my $tl = Amanda::Tapelist::read_tapelist($tlf);
+    my $tl = Amanda::Tapelist->new($tlf, 1);
     $tl->add_tapelabel("0", "TESTCONF13", "test tape");
     $tl->write($tlf);
 }
index c1b2040b703a11fe532fc72782c733f646d4e34a..c8cd108b7150b5c389fab4927cbf13cc938afdb7 100644 (file)
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 5;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Run qw(run run_get run_err vtape_dir);
@@ -48,5 +50,5 @@ ok(run_err('amtapetype', 'TESTCONF', 'smallvtape'),
     "a second run on the same device fails because -f isn't used") or die;
 
 like(run_get('amtapetype', 'TESTCONF', '-f', '-b', '33000', 'smallvtape'),
-    qr/add device_property/,
+    qr/add device-property/,
     "with a non-kilobyte block size, directs user to add a device_property");
index 89bacaa9ac49fee42839504e68c0f47d5e88e38d..370b23be10b615380ab44d860e76aff81964c760 100644 (file)
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 2;
+use Test::More tests => 11;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use File::Path;
+use Data::Dumper;
 use Installcheck;
 use Installcheck::Dumpcache;
 use Installcheck::Config;
-use Installcheck::Run qw(run run_err $diskname amdump_diag);
-use Amanda::Config qw( :init );
+use Installcheck::Mock;
+use Installcheck::Run qw(run run_err run_get $diskname);
+use Amanda::DB::Catalog;
 use Amanda::Paths;
+use Amanda::Config qw( :init );
+use Amanda::Changer;
+use Amanda::Debug;
+
+Amanda::Debug::dbopen("installcheck");
 
 my $vtape_root = "$Installcheck::TMP/tertiary";
 sub setup_chg_disk {
@@ -37,10 +46,54 @@ sub setup_chg_disk {
 # set up a basic dump
 Installcheck::Dumpcache::load("basic");
 
+config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+my ($cfgerr_level, @cfgerr_errors) = config_errors();
+if ($cfgerr_level >= $CFGERR_WARNINGS) {
+    config_print_errors();
+    die "config errors";
+}
+
 # and then set up a new vtape to vault onto
 my $tertiary_chg = setup_chg_disk();
 
-ok(run("$sbindir/amvault", 'TESTCONF', 'latest', $tertiary_chg, "TESTCONF%%"),
+# try a few failures first
+like(run_err("$sbindir/amvault",
+               '--autolabel=any',
+               '--label-template', "TESTCONF%%",
+               '--src-timestamp', 'latest',
+               '--dst-changer', $tertiary_chg,
+               'TESTCONF', 'someotherhost'),
+    qr/No dumps to vault/,
+    "amvault with a non-matching dumpspec dumps nothing")
+    or diag($Installcheck::Run::stderr);
+
+like(run_err("$sbindir/amvault",
+               '--autolabel=any',
+               '--label-template', "TESTCONF%%",
+               '--src-timestamp', 'latest',
+               '--fulls-only',
+               '--dst-changer', $tertiary_chg,
+               'TESTCONF', '*', '*', '*', '1-3'),
+    qr/No dumps to vault/,
+    "amvault with --fulls-only but specifying non-full dumpspecs dumps nothing")
+    or diag($Installcheck::Run::stderr);
+
+like(run_err("$sbindir/amvault",
+               '--autolabel=any',
+               '--label-template', "TESTCONF%%",
+               '--dst-changer', $tertiary_chg,
+               'TESTCONF'),
+    qr/specify something to select/,
+    "amvault without any limiting factors is an error"),
+    or diag($Installcheck::Run::stderr);
+
+# now a successful vaulting
+ok(run("$sbindir/amvault",
+               '--autolabel=any',
+               '--label-template', "TESTCONF%%",
+               '--src-timestamp', 'latest',
+               '--dst-changer', $tertiary_chg,
+               'TESTCONF'),
     "amvault runs!")
     or diag($Installcheck::Run::stderr);
 
@@ -48,5 +101,164 @@ my @tert_files = glob("$vtape_root/slot1/0*");
 ok(@tert_files > 0,
     "..and files appear on the tertiary volume!");
 
+my @dumps = Amanda::DB::Catalog::sort_dumps([ 'write_timestamp' ],
+       Amanda::DB::Catalog::get_dumps());
+
+is(scalar @dumps, 2,
+    "now there are two dumps in the catalog");
+
+sub summarize {
+    my ($dump) = @_;
+    return {
+       map { $_ => $dump->{$_} }
+           qw(diskname hostname level dump_timestamp kb orig_kb)
+    };
+}
+is_deeply(summarize($dumps[1]), summarize($dumps[0]),
+    "and they match in all the right ways")
+    or diag(Dumper(@dumps));
+
+# clean up the tertiary vtapes before moving on
 rmtree $vtape_root;
 Installcheck::Run::cleanup();
+
+# try the multi dump, to get a better idea of the filtering possibilities
+Installcheck::Dumpcache::load("multi");
+config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+($cfgerr_level, @cfgerr_errors) = config_errors();
+if ($cfgerr_level >= $CFGERR_WARNINGS) {
+    config_print_errors();
+    die "config errors";
+}
+
+sub get_dry_run {
+    my $stdout = run_get(@_);
+    if (!$stdout) {
+       diag($Installcheck::Run::stderr);
+       return 'run-failed';
+    }
+
+    my @rv;
+    for my $line (split /\n/, $stdout) {
+       next if ($line =~ /^Total Size:/);
+       my ($tape, $file, $host, $disk, $datestamp, $level) =
+           ($line =~ /^(\S+) (\d*) (\S+) (.+) (\d+) (\d+)$/);
+       $tape = 'holding' if $file eq '';
+       push @rv, [$tape, $file, $host, $disk,   $level]; # note: no datestamp
+    }
+    return @rv;
+}
+
+is_deeply([ get_dry_run("$sbindir/amvault",
+               '--dry-run',
+               '--autolabel=any',
+               '--label-template', "TESTCONF%%",
+               '--fulls-only',
+               '--dst-changer', $tertiary_chg,
+               'TESTCONF') ], [
+    [ "TESTCONF01", "1", "localhost", "$diskname/dir", "0" ],
+    [ "TESTCONF01", "2", "localhost", "$diskname",     "0" ],
+    [ "TESTCONF02", "2", "localhost", "$diskname",     "0" ]
+    ], "amvault with --fulls-only only dumps fulls");
+
+is_deeply([ get_dry_run("$sbindir/amvault",
+               '--dry-run',
+               '--autolabel=any',
+               '--label-template', "TESTCONF%%",
+               '--dst-changer', $tertiary_chg,
+               'TESTCONF', "localhost", "$diskname/dir") ], [
+    [ "holding", "",     "localhost", "$diskname/dir",     "1" ],
+    [ "TESTCONF01", "1", "localhost", "$diskname/dir",     "0" ],
+    [ "TESTCONF02", "1", "localhost", "$diskname/dir",     "1" ]
+    ], "amvault with a disk expression dumps only that disk");
+
+# Test NDMP-to-NDMP vaulting.  This will test all manner of goodness:
+#  - specifying a named changer on the amvault command line
+#  - exporting
+#  - directtcp vaulting (well, not really, since we don't support connecting yet)
+SKIP: {
+    skip "not built with ndmp and server", 2 unless
+       Amanda::Util::built_with_component("ndmp") and Amanda::Util::built_with_component("server");
+
+    Installcheck::Dumpcache::load("ndmp");
+
+    my $ndmp = Installcheck::Mock::NdmpServer->new(no_reset => 1);
+    $ndmp->edit_config();
+
+    # append a tertiary changer to the config file - it's just too hard to
+    # specify a full ndmp changer on the command line
+
+    my $ndmp_port = $ndmp->{'port'};
+    my $chg_dir = "$Installcheck::TMP/vtapes/ndmjob-tert";
+    my $chg_spec = "chg-ndmp:127.0.0.1:$ndmp_port\@$chg_dir";
+    my $drive_root = "ndmp:127.0.0.1:$ndmp_port\@$chg_dir";
+
+    -d $chg_dir && rmtree($chg_dir);
+    mkpath($chg_dir);
+
+    my $amanda_conf_filename = "$CONFIG_DIR/TESTCONF/amanda.conf";
+    open(my $fh, ">>", $amanda_conf_filename);
+    print $fh <<EOF;
+define changer "tertiary" {
+    tpchanger "$chg_spec"
+    property        "tape-device" "0=$drive_root/drive0"
+    property append "tape-device" "1=$drive_root/drive1"
+    changerfile "$chg_dir-changerfile"
+}
+EOF
+
+    $tertiary_chg = "tertiary";
+    ok(run("$sbindir/amvault",
+                   '--export',
+                   '--autolabel=any',
+                   '--label-template', "TESTCONF%%",
+                   '--src-timestamp', 'latest',
+                   '--dst-changer', $tertiary_chg,
+                   'TESTCONF'),
+       "amvault runs with an NDMP device as secondary and tertiary, with --export")
+       or diag($Installcheck::Run::stderr);
+
+    config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+    ($cfgerr_level, @cfgerr_errors) = config_errors();
+    if ($cfgerr_level >= $CFGERR_WARNINGS) {
+       config_print_errors();
+       die "config errors";
+    }
+
+    # query the tertiary changer to see where that dump ended up
+    my $chg = Amanda::Changer->new($tertiary_chg);
+    my $inventory;
+    my $inventory_cb = sub {
+       my ($err, $inv) = @_;
+       die "$err" if $err;
+
+       $inventory = $inv;
+       Amanda::MainLoop::quit();
+    };
+    Amanda::MainLoop::call_later(sub { $chg->inventory(inventory_cb => $inventory_cb); });
+    Amanda::MainLoop::run();
+
+    # find TESTCONF02 in the inventory, and check that it is in an i/e slot
+    my $notfound = "tertiary volume not found";
+    for my $i (@$inventory) {
+       if ($i->{'label'} && $i->{'label'} eq 'TESTCONF02') {
+           if ($i->{'import_export'}) {
+               $notfound = undef;
+           } else {
+               $notfound = "tertiary volume not properly exported";
+           }
+           #last;
+       }
+    }
+
+    ok(!$notfound, "tertiary volume exists and was properly exported");
+    if ($notfound) {
+       diag($notfound);
+       diag("amvault stderr:");
+       diag($Installcheck::Run::stderr);
+    }
+
+}
+
+# clean up
+Installcheck::Run::cleanup();
index 48099feb5fc7a069477d34f02928544a812755ea..6fa8a3561311fa6cf6e1da2e2a173f718b8582b3 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -17,6 +17,8 @@
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
 use Test::More tests => 74;
+use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Amanda::Tests;
@@ -25,39 +27,39 @@ use Amanda::BigIntCompat;
 
 # define some constants; Perl doesn't have native 64-bit numbers, so
 # none are tested 
-$G_MAXUINT64_bigint = Math::BigInt->new('18446744073709551615');
-$G_MAXINT64_bigint = Math::BigInt->new('9223372036854775807');
-$G_MININT64_bigint = Math::BigInt->new('-9223372036854775808');
-
-$G_MAXUINT32_native = 2 ** 32 - 1;
-$G_MAXUINT32_double = 2.0 ** 32 - 1;
-$G_MAXUINT32_bigint = Math::BigInt->new('4294967295');
-$G_MAXINT32_native = 2 ** 31 - 1;
-$G_MAXINT32_double = 2.0 ** 31 - 1;
-$G_MAXINT32_bigint = Math::BigInt->new('2147483647');
-$G_MININT32_native = - 2 ** 31;
-$G_MININT32_double = - 2.0 ** 31;
-$G_MININT32_bigint = Math::BigInt->new('-2147483648');
-
-$G_MAXUINT16_native = 2 ** 16 - 1;
-$G_MAXUINT16_double = 2.0 ** 16 - 1;
-$G_MAXUINT16_bigint = Math::BigInt->new('65535');
-$G_MAXINT16_native = 2 ** 15 - 1;
-$G_MAXINT16_double = 2.0 ** 15 - 1;
-$G_MAXINT16_bigint = Math::BigInt->new('32767');
-$G_MININT16_native = - 2 ** 15;
-$G_MININT16_double = - 2.0 ** 15;
-$G_MININT16_bigint = Math::BigInt->new('-32768');
-
-$G_MAXUINT8_native = 2 ** 8 - 1;
-$G_MAXUINT8_double = 2.0 ** 8 - 1;
-$G_MAXUINT8_bigint = Math::BigInt->new('255');
-$G_MAXINT8_native = 2 ** 7 - 1;
-$G_MAXINT8_double = 2.0 ** 7 - 1;
-$G_MAXINT8_bigint = Math::BigInt->new('127');
-$G_MININT8_native = - 2 ** 7;
-$G_MININT8_double = - 2.0 ** 7;
-$G_MININT8_bigint = Math::BigInt->new('-128');
+my $G_MAXUINT64_bigint = Math::BigInt->new('18446744073709551615');
+my $G_MAXINT64_bigint = Math::BigInt->new('9223372036854775807');
+my $G_MININT64_bigint = Math::BigInt->new('-9223372036854775808');
+
+my $G_MAXUINT32_native = 2 ** 32 - 1;
+my $G_MAXUINT32_double = 2.0 ** 32 - 1;
+my $G_MAXUINT32_bigint = Math::BigInt->new('4294967295');
+my $G_MAXINT32_native = 2 ** 31 - 1;
+my $G_MAXINT32_double = 2.0 ** 31 - 1;
+my $G_MAXINT32_bigint = Math::BigInt->new('2147483647');
+my $G_MININT32_native = - 2 ** 31;
+my $G_MININT32_double = - 2.0 ** 31;
+my $G_MININT32_bigint = Math::BigInt->new('-2147483648');
+
+my $G_MAXUINT16_native = 2 ** 16 - 1;
+my $G_MAXUINT16_double = 2.0 ** 16 - 1;
+my $G_MAXUINT16_bigint = Math::BigInt->new('65535');
+my $G_MAXINT16_native = 2 ** 15 - 1;
+my $G_MAXINT16_double = 2.0 ** 15 - 1;
+my $G_MAXINT16_bigint = Math::BigInt->new('32767');
+my $G_MININT16_native = - 2 ** 15;
+my $G_MININT16_double = - 2.0 ** 15;
+my $G_MININT16_bigint = Math::BigInt->new('-32768');
+
+my $G_MAXUINT8_native = 2 ** 8 - 1;
+my $G_MAXUINT8_double = 2.0 ** 8 - 1;
+my $G_MAXUINT8_bigint = Math::BigInt->new('255');
+my $G_MAXINT8_native = 2 ** 7 - 1;
+my $G_MAXINT8_double = 2.0 ** 7 - 1;
+my $G_MAXINT8_bigint = Math::BigInt->new('127');
+my $G_MININT8_native = - 2 ** 7;
+my $G_MININT8_double = - 2.0 ** 7;
+my $G_MININT8_bigint = Math::BigInt->new('-128');
 
 # first test "taking" integers -- Perl -> C
 
diff --git a/installcheck/catalogs/amflush.cat b/installcheck/catalogs/amflush.cat
new file mode 100644 (file)
index 0000000..783ff7f
--- /dev/null
@@ -0,0 +1,86 @@
+# A logfile from an amflush run
+
+%F log/log
+INFO amflush amflush pid 26036
+DISK amflush localhost /usr/local
+DISK amflush localhost /opt
+DISK amflush localhost /usr/lib
+DISK amflush localhost /var/mysql
+DISK amflush localhost /home
+START amflush date 20090622075550
+INFO driver driver pid 26076
+START driver date 20090622075550
+STATS driver hostname centralcity.zmanda.com
+STATS driver startup time 0.011
+INFO taper taper pid 26077
+START taper datestamp 20090622075550 label Flushy-017 tape 1
+PART taper Flushy-017 1 localhost /var/mysql 20090620020002 1/1 1 [sec 2.504314 kb 36980 kps 14766.518895]
+DONE taper localhost /var/mysql 20090620020002 1 1 [sec 2.504314 kb 36980 kps 14766.518895]
+PART taper Flushy-017 2 localhost /usr/lib 20090620020002 1/1 1 [sec 1.675693 kb 309 kps 184.632684]
+DONE taper localhost /usr/lib 20090620020002 1 1 [sec 1.675693 kb 309 kps 184.632684]
+INFO taper pid-done 26077
+FINISH driver date 20090622075550 time 177.708
+INFO driver pid-done 26076
+INFO amflush pid-done 26075
+
+%T report
+Hostname: centralcity.zmanda.com
+Org     : DailySet1
+Config  : TESTCONF
+Date    : June 22, 2009
+
+The dumps were flushed to tape Flushy-017.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:03
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)           0.0        0.0        0.0
+Original Size (meg)         0.0        0.0        0.0
+Avg Compressed Size (%)     --         --         --
+DLEs Dumped            0          0          0
+Avg Dump Rate (k/s)         --         --         --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)            36.4        0.0       36.4
+Tape Used (%)             121.4        0.0      121.4
+DLEs Taped             2          0          2   1:2
+Parts Taped                   2          0          2   1:2
+Avg Tp Write Rate (k/s)  8920.8        --      8920.8
+
+USAGE BY TAPE:
+  Label            Time      Size      %  DLEs Parts
+  Flushy-017       0:00    37289k  121.4     2     2
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
+-------------------------- ------------------------------------- --------------
+localhost    /home         NO FILE TO FLUSH -----------------------------------
+localhost    /opt          NO FILE TO FLUSH -----------------------------------
+localhost    /usr/lib    1             309    --       FLUSH       0:02   184.6
+localhost    /usr/local    NO FILE TO FLUSH -----------------------------------
+localhost    /var/mysql  1           36980    --       FLUSH       0:03 14766.5
+
+(brought to you by Amanda version x.y.z)
+
+%T postscript
+--PS-TEMPLATE--
+(June 22, 2009) DrawDate
+\
+(Amanda Version 2.6.2alpha) DrawVers
+(Flushy-017) DrawTitle
+(Total Size:          36.4 MB) DrawStat
+(Tape Used (%)       121.4 %) DrawStat
+(Number of files:      2) DrawStat
+(Filesystems Taped:    2) DrawStat
+(-) (Flushy-017) (-) (  0) (      32) (      32) DrawHost
+(localhost) (/var/mysql) (1) (  1) (        ) (   36980) DrawHost
+(localhost) (/usr/lib) (1) (  2) (        ) (     309) DrawHost
+\
+showpage
diff --git a/installcheck/catalogs/bigdb.cat b/installcheck/catalogs/bigdb.cat
new file mode 100644 (file)
index 0000000..37623f1
--- /dev/null
@@ -0,0 +1,297 @@
+# Copyright (c) 2008, 2010 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+#
+# This file contains a "full" catalog with some useful corner cases, and is
+# used by a number of tests of complex catalog-based functionality.  The
+# %-directives indicate what dumps are in the catalog, and are used by
+# the tests to construct the set of expected results.
+#
+
+# a short-datestamp logfile with only a single, single-part file in it, produced
+# by amflush
+%F log/log.20080111.0
+DISK planner somebox /lib
+START amflush date 20080111
+START planner date 20080111
+START driver date 20080111
+STATS driver hostname somebox
+STATS driver startup time 0.051
+FINISH planner date 20080111 time 82.721
+START taper datestamp 20080111 label Conf-001 tape 1
+SUCCESS dumper somebox /lib 20080111 0 [sec 0.209 kb 1970 kps 9382.2 orig-kb 1970]
+SUCCESS chunker somebox /lib 20080111 0 [sec 0.305 kb 420 kps 1478.7]
+STATS driver estimate somebox /lib 20080111 0 [sec 1 nkb 2002 ckb 480 kps 385]
+%D somebox_lib_20080111 20080111000000 20080111000000 somebox /lib 0 OK "" 1 4.813543 419 0
+%P somebox_lib_20080111 somebox_lib_20080111 Conf-001 1 1 OK 4.813543 419 0
+PART taper Conf-001 1 somebox /lib 20080111 1/1 0 [sec 4.813543 kb 419 kps 87.133307]
+DONE taper somebox /lib 20080111 1 0 [sec 4.813543 kb 419 kps 87.133307]
+FINISH driver date 20080111 time 2167.581
+
+# a long-datestamp logfile, also fairly simple; this one from amvault
+%F log/log.20080222222222.0
+DISK planner somebox /lib
+START amvault date 20080222222222
+START planner date 20080222222222
+START driver date 20080222222222
+STATS driver hostname somebox
+STATS driver startup time 0.051
+FINISH planner date 20080222222222 time 0.102
+SUCCESS dumper somebox /lib 20080222222222 0 [sec 0.012 kb 100 kps 8115.6 orig-kb 100]
+SUCCESS chunker somebox /lib 20080222222222 0 [sec 5.075 kb 100 kps 26.0]
+STATS driver estimate somebox /lib 20080222222222 0 [sec 0 nkb 132 ckb 160 kps 1024]
+START taper datestamp 20080222222222 label Conf-002 tape 1
+%D somebox_lib_20080222222222 20080222222222 20080222222222 somebox /lib 0 OK "" 2 0.001161 172 0
+%P somebox_lib_20080222222222_p1 somebox_lib_20080222222222 Conf-002 1 1 OK 0.000733 100 0
+PART taper Conf-002 1 somebox /lib 20080222222222 1/2 0 [sec 0.000733 kb 100 kps 136425.648022]
+%P somebox_lib_20080222222222_p2 somebox_lib_20080222222222 Conf-002 2 2 OK 0.000428 72 0
+PART taper Conf-002 2 somebox /lib 20080222222222 2/2 0 [sec 0.000428 kb 72 kps 136425.648022]
+DONE taper somebox /lib 20080222222222 2 0 [sec 0.001161 kb 172 kps 136425.648022]
+FINISH driver date 20080222222222 time 6.206
+
+# a logfile with several dumps in it, one of which comes in many parts, and one of which is
+# from a previous run
+%F log/log.20080313133333.0
+DISK planner somebox /usr/bin
+DISK planner somebox /lib
+DISK planner otherbox /lib
+DISK planner otherbox /usr/bin
+START planner date 20080313133333
+START driver date 20080313133333
+STATS driver hostname somebox
+STATS driver startup time 0.059
+INFO planner Full dump of somebox:/lib promoted from 2 days ahead.
+FINISH planner date 20080313133333 time 0.286
+SUCCESS dumper somebox /usr/bin 20080313133333 1 [sec 0.001 kb 20 kps 10352.0 orig-kb 20]
+SUCCESS chunker somebox /usr/bin 20080313133333 1 [sec 1.023 kb 20 kps 50.8]
+STATS driver estimate somebox /usr/bin 20080313133333 1 [sec 0 nkb 52 ckb 64 kps 1024]
+START taper datestamp 20080313133333 label Conf-003 tape 1
+%D somebox_usr_bin_20080313133333 20080313133333 20080313133333 somebox /usr/bin 1 OK "" 1 0.000370 20 0
+%P somebox_usr_bin_20080313133333 somebox_usr_bin_20080313133333 Conf-003 1 1 OK 0.000370 20 0
+PART taper Conf-003 1 somebox /usr/bin 20080313133333 1/1 1 [sec 0.000370 kb 20 kps 54054.054054]
+DONE taper somebox /usr/bin 20080313133333 1 1 [sec 0.000370 kb 20 kps 54054.054054]
+# a multi-part dump
+SUCCESS dumper somebox /lib 20080313133333 0 [sec 0.189 kb 3156 kps 50253.1 orig-kb 3156]
+SUCCESS chunker somebox /lib 20080313133333 0 [sec 5.250 kb 3156 kps 1815.5]
+STATS driver estimate somebox /lib 20080313133333 0 [sec 1 nkb 3156 ckb 3156 kps 9500]
+%D somebox_lib_20080313133333 20080313133333 20080313133333 somebox /lib 0 OK "" 10 0.051436 3156 0
+%P somebox_lib_20080313133333_p1 somebox_lib_20080313133333 Conf-003 2 1 OK 0.005621 1024 0
+PART taper Conf-003 2 somebox /lib 20080313133333 1/10 0 [sec 0.005621 kb 1024 kps 182173.990393]
+%P somebox_lib_20080313133333_p2 somebox_lib_20080313133333 Conf-003 3 2 OK 0.006527 1024 0
+PART taper Conf-003 3 somebox /lib 20080313133333 2/10 0 [sec 0.006527 kb 1024 kps 156886.777999]
+%P somebox_lib_20080313133333_p3 somebox_lib_20080313133333 Conf-003 4 3 OK 0.005854 1024 0
+PART taper Conf-003 4 somebox /lib 20080313133333 3/10 0 [sec 0.005854 kb 1024 kps 174923.129484]
+%P somebox_lib_20080313133333_p4 somebox_lib_20080313133333 Conf-003 5 4 OK 0.007344 1024 0
+PART taper Conf-003 5 somebox /lib 20080313133333 4/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
+%P somebox_lib_20080313133333_p5 somebox_lib_20080313133333 Conf-003 6 5 OK 0.007344 1024 0
+PART taper Conf-003 6 somebox /lib 20080313133333 5/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
+%P somebox_lib_20080313133333_p6 somebox_lib_20080313133333 Conf-003 7 6 OK 0.007344 1024 0
+PART taper Conf-003 7 somebox /lib 20080313133333 6/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
+%P somebox_lib_20080313133333_p7 somebox_lib_20080313133333 Conf-003 8 7 OK 0.007344 1024 0
+PART taper Conf-003 8 somebox /lib 20080313133333 7/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
+%P somebox_lib_20080313133333_p8 somebox_lib_20080313133333 Conf-003 9 8 OK 0.007344 1024 0
+PART taper Conf-003 9 somebox /lib 20080313133333 8/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
+%P somebox_lib_20080313133333_p9 somebox_lib_20080313133333 Conf-003 10 9 OK 0.007344 1024 0
+PART taper Conf-003 10 somebox /lib 20080313133333 9/10 0 [sec 0.007344 kb 1024 kps 147993.746743]
+%P somebox_lib_20080313133333_p10 somebox_lib_20080313133333 Conf-003 11 10 OK 0.001919 284 0
+PART taper Conf-003 11 somebox /lib 20080313133333 10/10 0 [sec 0.001919 kb 284 kps 147993.746743]
+DONE taper somebox /lib 20080313133333 10 0 [sec 0.051436 kb 3156 kps 184695.543977]
+SUCCESS dumper otherbox /lib 20080313133333 0 [sec 0.001 kb 190 kps 10352.0 orig-kb 20]
+SUCCESS chunker otherbox /lib 20080313133333 0 [sec 1.023 kb 190 kps 50.8]
+STATS driver estimate otherbox /lib 20080313133333 0 [sec 0 nkb 190 ckb 190 kps 1024]
+# this dump is from a previous run, with an older dump_timestamp
+%D otherbox_usr_bin_20080313133333_2 20080311132233 20080313133333 otherbox /usr/bin 0 OK "" 1 0.002733 240 0
+%P otherbox_usr_bin_20080313133333_2 otherbox_usr_bin_20080313133333_2 Conf-003 12 1 OK 0.002733 240 0
+PART taper Conf-003 12 otherbox /usr/bin 20080311132233 1/1 0 [sec 0.002733 kb 240 kps 136425.648022]
+DONE taper otherbox /usr/bin 20080311132233 1 0 [sec 0.002733 kb 240 kps 136425.648022]
+# and another dump of the same DLE from an even older dump_timestamp
+%D otherbox_usr_bin_20080313133333_1 20080311131133 20080313133333 otherbox /usr/bin 0 OK "" 1 0.002733 240 0
+%P otherbox_usr_bin_20080313133333_1 otherbox_usr_bin_20080313133333_1 Conf-003 13 1 OK 0.002733 240 0
+PART taper Conf-003 13 otherbox /usr/bin 20080311131133 1/1 0 [sec 0.002733 kb 240 kps 136425.648022]
+DONE taper otherbox /usr/bin 20080311131133 1 0 [sec 0.002733 kb 240 kps 136425.648022]
+%D otherbox_lib_20080313133333 20080313133333 20080313133333 otherbox /lib 0 OK "" 1 0.001733 190 0
+%P otherbox_lib_20080313133333 otherbox_lib_20080313133333 Conf-003 14 1 OK 0.001733 190 0
+PART taper Conf-003 14 otherbox /lib 20080313133333 1/1 0 [sec 0.001733 kb 190 kps 136425.648022]
+DONE taper otherbox /lib 20080313133333 1 0 [sec 0.001733 kb 190 kps 136425.648022]
+FINISH driver date 20080313133333 time 24.777
+
+# A logfile with some partial parts (PARTPARTIAL) in it
+%F log/log.20080414144444.0
+DISK planner otherbox /lib
+START planner date 20080414144444
+START driver date 20080414144444
+STATS driver hostname otherbox
+STATS driver startup time 0.075
+INFO taper Will write new label `Conf-004' to new (previously non-amanda) tape
+FINISH planner date 20080414144444 time 2.139
+SUCCESS dumper otherbox /lib 20080414144444 1 [sec 0.003 kb 60 kps 16304.3 orig-kb 60]
+SUCCESS chunker otherbox /lib 20080414144444 1 [sec 1.038 kb 60 kps 88.5]
+STATS driver estimate otherbox /lib 20080414144444 1 [sec 0 nkb 92 ckb 96 kps 1024]
+START taper datestamp 20080414144444 label Conf-004 tape 1
+%D otherbox_lib_20080414144444 20080414144444 20080414144444 otherbox /lib 1 PARTIAL full-up 0 0.000540 32 0
+%P otherbox_lib_20080414144444_try1 otherbox_lib_20080414144444 Conf-004 1 1 PARTIAL 0.000707 32 0
+PARTPARTIAL taper Conf-004 1 otherbox /lib 20080414144444 1/1 1 [sec 0.000707 kb 32 kps 45261.669024] ""
+INFO taper Will request retry of failed split part.
+INFO taper Will write new label `Conf-005' to new (previously non-amanda) tape
+START taper datestamp 20080414144444 label Conf-005 tape 2
+%P otherbox_lib_20080414144444_try2 otherbox_lib_20080414144444 Conf-005 1 1 PARTIAL 0.000540 32 0
+PARTPARTIAL taper Conf-005 1 otherbox /lib 20080414144444 1/1 1 [sec 0.000540 kb 32 kps 59259.259259] ""
+INFO taper Will request retry of failed split part.
+WARNING driver Out of tapes; going into degraded mode.
+PARTIAL taper otherbox /lib 20080414144444 1 1 [sec 0.000540 kb 32 kps 59259.259259] "full-up"
+# a completely failed dump
+%D otherbox_boot_20080414144444 20080414144444 20080414144444 otherbox /boot 0 FAIL no-space 0 0.0 0 0
+FAIL taper otherbox /boot 20080414144444 0 error "no-space"
+# add a partially chunked dump; this should not appear in the catalog, as the partial
+# holding-disk file is no longer in the holding disk
+FAIL dumper ns-new.slikon.local /opt/var 20090326001503 0 [blargh]
+  sendbackup: boooo
+PARTIAL chunker ns-new.slikon.local /opt/var 20090326001503 0 [sec 187.313 kb 54930 kps 293.4]
+FINISH driver date 20080414144444 time 6.959
+
+# A logfile with orig-kb in taper line
+%F log/log.20080515155555.0
+DISK planner somebox /usr/bin
+DISK planner somebox /lib
+DISK planner otherbox /lib
+DISK planner otherbox /usr/bin
+START planner date 20080515155555
+START driver date 20080515155555
+STATS driver hostname somebox
+STATS driver startup time 0.059
+INFO planner Full dump of somebox:/lib promoted from 2 days ahead.
+FINISH planner date 20080515155555 time 0.286
+SUCCESS dumper somebox /usr/bin 20080515155555 1 [sec 0.001 kb 20 kps 10352.0 orig-kb 20]
+SUCCESS chunker somebox /usr/bin 20080515155555 1 [sec 1.023 kb 20 kps 50.8]
+STATS driver estimate somebox /usr/bin 20080515155555 1 [sec 0 nkb 52 ckb 64 kps 1024]
+START taper datestamp 20080515155555 label Conf-006 tape 1
+%D somebox_usr_bin_20080515155555 20080515155555 20080515155555 somebox /usr/bin 1 OK "" 1 0.000370 20 20
+%P somebox_usr_bin_20080515155555 somebox_usr_bin_20080515155555 Conf-006 1 1 OK 0.000370 20 20
+PART taper Conf-006 1 somebox /usr/bin 20080515155555 1/1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
+DONE taper somebox /usr/bin 20080515155555 1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
+# a multi-part dump
+SUCCESS dumper somebox /lib 20080515155555 0 [sec 0.189 kb 3156 kps 50253.1 orig-kb 3156]
+SUCCESS chunker somebox /lib 20080515155555 0 [sec 5.250 kb 3156 kps 1815.5]
+STATS driver estimate somebox /lib 20080515155555 0 [sec 1 nkb 3156 ckb 3156 kps 9500]
+%D somebox_lib_20080515155555 20080515155555 20080515155555 somebox /lib 0 OK "" 10 0.051436 3156 3156
+%P somebox_lib_20080515155555_p1 somebox_lib_20080515155555 Conf-006 2 1 OK 0.005621 1024 3156
+PART taper Conf-006 2 somebox /lib 20080515155555 1/10 0 [sec 0.005621 kb 1024 kps 182173.990393 orig-kb 3156]
+%P somebox_lib_20080515155555_p2 somebox_lib_20080515155555 Conf-006 3 2 OK 0.006527 1024 3156
+PART taper Conf-006 3 somebox /lib 20080515155555 2/10 0 [sec 0.006527 kb 1024 kps 156886.777999 orig-kb 3156]
+%P somebox_lib_20080515155555_p3 somebox_lib_20080515155555 Conf-006 4 3 OK 0.005854 1024 3156
+PART taper Conf-006 4 somebox /lib 20080515155555 3/10 0 [sec 0.005854 kb 1024 kps 174923.129484 orig-kb 3156]
+%P somebox_lib_20080515155555_p4 somebox_lib_20080515155555 Conf-006 5 4 OK 0.007344 1024 3156
+PART taper Conf-006 5 somebox /lib 20080515155555 4/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
+%P somebox_lib_20080515155555_p5 somebox_lib_20080515155555 Conf-006 6 5 OK 0.007344 1024 3156
+PART taper Conf-006 6 somebox /lib 20080515155555 5/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
+%P somebox_lib_20080515155555_p6 somebox_lib_20080515155555 Conf-006 7 6 OK 0.007344 1024 3156
+PART taper Conf-006 7 somebox /lib 20080515155555 6/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
+%P somebox_lib_20080515155555_p7 somebox_lib_20080515155555 Conf-006 8 7 OK 0.007344 1024 3156
+PART taper Conf-006 8 somebox /lib 20080515155555 7/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
+%P somebox_lib_20080515155555_p8 somebox_lib_20080515155555 Conf-006 9 8 OK 0.007344 1024 3156
+PART taper Conf-006 9 somebox /lib 20080515155555 8/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
+%P somebox_lib_20080515155555_p9 somebox_lib_20080515155555 Conf-006 10 9 OK 0.007344 1024 3156
+PART taper Conf-006 10 somebox /lib 20080515155555 9/10 0 [sec 0.007344 kb 1024 kps 147993.746743 orig-kb 3156]
+%P somebox_lib_20080515155555_p10 somebox_lib_20080515155555 Conf-006 11 10 OK 0.001919 284 3156
+PART taper Conf-006 11 somebox /lib 20080515155555 10/10 0 [sec 0.001919 kb 284 kps 147993.746743 orig-kb 3156]
+DONE taper somebox /lib 20080515155555 10 0 [sec 0.051436 kb 3156 kps 184695.543977 orig-kb 3156]
+SUCCESS dumper otherbox /lib 20080515155555 0 [sec 0.001 kb 190 kps 10352.0 orig-kb 20]
+SUCCESS chunker otherbox /lib 20080515155555 0 [sec 1.023 kb 190 kps 50.8]
+STATS driver estimate otherbox /lib 20080515155555 0 [sec 0 nkb 190 ckb 190 kps 1024]
+# this dump is from a previous run, with an older dump_timestamp
+%D otherbox_usr_bin_20080515155555 20080511151155 20080515155555 otherbox /usr/bin 0 OK "" 1 0.002733 240 240
+%P otherbox_usr_bin_20080515155555 otherbox_usr_bin_20080515155555 Conf-006 12 1 OK 0.002733 240 240
+PART taper Conf-006 12 otherbox /usr/bin 20080511151155 1/1 0 [sec 0.002733 kb 240 kps 136425.648022 orig-kb 240]
+DONE taper otherbox /usr/bin 20080511151155 1 0 [sec 0.002733 kb 240 kps 136425.648022 orig-kb 240]
+%D otherbox_lib_20080515155555 20080511151555 20080515155555 otherbox /lib 0 OK "" 1 0.001733 190 190
+%P otherbox_lib_20080515155555 otherbox_lib_20080515155555 Conf-006 13 1 OK 0.001733 190 190
+PART taper Conf-006 13 otherbox /lib 20080511151555 1/1 0 [sec 0.001733 kb 190 kps 136425.648022 orig-kb 190]
+DONE taper otherbox /lib 20080511151555 1 0 [sec 0.001733 kb 190 kps 136425.648022 orig-kb 190]
+# this dump is a direct to tape
+%D otherbox_direct_20080515155555 20080515155555 20080515155555 otherbox /direct 0 OK "" 1 0.001 190 350
+%P otherbox_direct_20080515155555 otherbox_direct_20080515155555 Conf-006 14 1 OK 0.001 190 350
+SUCCESS dumper otherbox /direct 20080515155555 0 [sec 0.001 kb 190 kps 10352.0 orig-kb 350]
+PART taper Conf-006 14 otherbox /direct 20080515155555 1/1 0 [sec 0.001 kb 190 kps 10352.0]
+DONE taper otherbox /direct 20080515155555 1 0 [sec 0.001 kb 190 kps 10352.0 orig-kb 350]
+FINISH driver date 20080515155555 time 24.777
+
+# A logfile with removed tape-kb in taper line
+%F log/log.20080616166666.0
+DISK planner somebox /usr/bin
+DISK planner somebox /lib
+DISK planner otherbox /lib
+START planner date 20080616166666
+START driver date 20080616166666
+STATS driver hostname somebox
+STATS driver startup time 0.059
+FINISH planner date 20080616166666 time 0.286
+SUCCESS dumper somebox /usr/bin 20080616166666 1 [sec 0.001 kb 20 kps 10352.0 orig-kb 20]
+SUCCESS chunker somebox /usr/bin 20080616166666 1 [sec 1.023 kb 20 kps 50.8]
+STATS driver estimate somebox /usr/bin 20080616166666 1 [sec 0 nkb 52 ckb 64 kps 1024]
+START taper datestamp 20080616166666 label Conf-007 tape 1
+%D somebox_usr_bin_20080616166666 20080616166666 20080616166666 somebox /usr/bin 1 OK "" 1 0.000370 20 20
+%P somebox_usr_bin_20080616166666 somebox_usr_bin_20080616166666 Conf-007 1 1 OK 0.000370 20 20
+PART taper Conf-007 1 somebox /usr/bin 20080616166666 1/1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
+DONE taper somebox /usr/bin 20080616166666 1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
+SUCCESS dumper somebox /lib 20080616166666 1 [sec 0.001 kb 20 kps 10352.0 orig-kb 20]
+SUCCESS chunker somebox /lib 20080616166666 1 [sec 1.023 kb 20 kps 50.8]
+%D somebox_lib_20080616166666 20080616166666 20080616166666 somebox /lib 1 FAIL "" 1 0.000370 20 20
+%P somebox_lib_20080616166666 somebox_lib_20080616166666 Conf-007 2 1 OK 0.000370 20 20
+PART taper Conf-007 2 somebox /lib 20080616166666 1/2 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
+STATS driver estimate somebox /lib 20080616166666 1 [sec 0 nkb 52 ckb 64 kps 1024]
+START taper datestamp 20080616166666 label Conf-008 tape 1
+# this tape has been removed from the tapelist
+#%P somebox_lib_20080616166666 somebox_lib_20080616166666 Conf-008 1 1 OK 0.000370 20 20
+PART taper Conf-008 1 somebox /lib 20080616166666 2/2 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
+DONE taper somebox /lib 20080616166666 1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
+
+# an old-school logfile
+%F log/log.20100722.0
+:timestamp 20100722000000
+START planner date 20100722000000
+DISK planner lovelace /home/ada
+START taper datestamp 20100722 label Conf-009 tape 0
+SUCCESS dumper lovelace /home/ada 20100722 3 [sec 19.271 kb 166951 kps 8663.1 orig-kb 208420]
+SUCCESS chunker lovelace /home/ada 20100722 3 [sec 19.298 kb 166951 kps 8652.7]
+STATS driver estimate lovelace /home/ada 20100722 3 [sec 30 nkb 208422 ckb 32640 kps 1081]
+%D lovelace_home_ada_20100722 20100722000000 20100722000000 lovelace /home/ada 3 OK "" 1 0.883 166976 0
+%P lovelace_home_ada_20100722 lovelace_home_ada_20100722 Conf-009 1 1 OK 0.883 166976 0
+SUCCESS taper lovelace /home/ada 20100722 3 [sec 0.883 kb 166976 kps 188922.8 {wr: writers 5219 rdwait 0.001 wrwait 0.710 filemark 0.000}]
+INFO taper tape Conf-009 kb 166976 fm 1 [OK]
+
+# holding-disk
+%H otherbox_lib_20080414144444_holding 20080414144444 otherbox /lib 1 OK 256
+%H oldbox_opt_20080414144444_holding 20080414144444 oldbox /opt 0 OK 1298
+
+%F disklist
+somebox /lib installcheck-test
+somebox /usr/bin installcheck-test
+otherbox /lib installcheck-test
+otherbox /usr/bin installcheck-test
+otherbox /direct installcheck-test
+lovelace /home/ada installcheck-test
+
+%F tapelist
+20080111 Conf-001
+20080222222222 Conf-002
+20080313133333 Conf-003
+20080414144444 Conf-004
+20080414144444 Conf-005
+20080515155555 Conf-006
+20080616166666 Conf-007
+20100722 Conf-009
diff --git a/installcheck/catalogs/bigestimate.cat b/installcheck/catalogs/bigestimate.cat
new file mode 100644 (file)
index 0000000..a913ecb
--- /dev/null
@@ -0,0 +1,76 @@
+# a logfile with a large estimate
+
+%F log/log
+START planner date 20090326001503
+START driver date 20090326001503
+INFO amdump amdump pid 22014
+INFO driver driver pid 22043
+INFO planner planner pid 22042
+DISK planner home.slikon.local /opt/public
+SUCCESS dumper home.slikon.local /opt/public 20090326001503 0 [sec 2816.520 kb 50917370 kps 18078.1 orig-kb 72987320]
+START taper datestamp 20090326001503 label Daily-36 tape 1
+SUCCESS chunker home.slikon.local /opt/public 20090326001503 0 [sec 2821.633 kb 50917370 kps 18045.9]
+STATS driver estimate home.slikon.local /opt/public 20090326001503 0 [sec 0 nkb 72987352 ckb 80286112 kps 4294967295]
+PART taper Daily-36 1 home.slikon.local /opt/public 20090326001503 1/3 0 [sec 813.482141 kb 22020096 kps 27068.935985]
+PART taper Daily-36 2 home.slikon.local /opt/public 20090326001503 2/3 0 [sec 800.783991 kb 22020096 kps 27498.172101]
+PART taper Daily-36 3 home.slikon.local /opt/public 20090326001503 3/3 0 [sec 251.674410 kb 6877177 kps 27325.692199]
+DONE taper home.slikon.local /opt/public 20090326001503 3 0 [sec 1865.940542 kb 50917369 kps 27287.777030]
+FINISH driver date 20090326001503 time 77506.015
+
+%T report
+These dumps were to tape Daily-36.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)        21:32
+Dump Time (hrs:min)        0:47       0:47       0:00
+Output Size (meg)       49724.0    49724.0        0.0
+Original Size (meg)     71276.7    71276.7        0.0
+Avg Compressed Size (%)    69.8       69.8        --
+DLEs Dumped            1          1          0
+Avg Dump Rate (k/s)     18078.1    18078.1        --
+
+Tape Time (hrs:min)        0:31       0:31       0:00
+Tape Size (meg)         49724.0    49724.0        0.0
+Tape Used (%)             #####      #####        0.0
+DLEs Taped             1          1          0
+
+Parts Taped                   3          3          0
+Avg Tp Write Rate (k/s) 27287.8    27287.8        --
+
+USAGE BY TAPE:
+  Label          Time      Size      %  DLEs Parts
+  Daily-36       0:31 50917369k  #####     1     3
+
+
+NOTES:
+  big estimate: home.slikon.local /opt/public 0
+                est: 80286112k    out 50917369k
+
+
+DUMP SUMMARY:
+                                        DUMPER STATS                 TAPER STATS
+HOSTNAME     DISK        L  ORIG-kB   OUT-kB  COMP%  MMM:SS    KB/s MMM:SS    KB/s
+-------------------------- ---------------------------------------- --------------
+home.slikon. /opt/public 0 72987320 50917369   69.8   46:57 18078.1  31:06 27287.8
+
+(brought to you by Amanda version x.y.z)
+
+%T postscript
+--PS-TEMPLATE--
+(March 26, 2009) DrawDate
+\
+(Amanda Version 2.6.2alpha) DrawVers
+(Daily-36) DrawTitle
+(Total Size:        49724.0 MB) DrawStat
+(Tape Used (%)       ##### %) DrawStat
+(Number of files:      3) DrawStat
+(Filesystems Taped:    1) DrawStat
+(-) (Daily-36) (-) (  0) (      32) (      32) DrawHost
+(home.slikon.local) (/opt/public) (0) (  1) (72987320) (50917369) DrawHost
+\
+showpage
diff --git a/installcheck/catalogs/chunker-partial.cat b/installcheck/catalogs/chunker-partial.cat
new file mode 100644 (file)
index 0000000..621b73f
--- /dev/null
@@ -0,0 +1,177 @@
+# an amdump logfile to check amstatus's display of related errors
+
+%F log/amdump
+amdump: start at Fri Apr 10 07:47:59 PDT 2009
+amdump: datestamp 20090410
+amdump: starttime 20090410074759
+amdump: starttime-locale-independent 2009-04-10 07:47:59 PDT
+planner: pid 4108 executable /usr/lib/amanda/planner version 3.0.0
+planner: build: VERSION="Amanda-3.0.0"
+planner:        BUILT_DATE="Wed Apr 8 17:49:57 PDT 2009"
+planner:        BUILT_MACH="i386-pc-solaris2.10" BUILT_REV="16514"
+planner:        BUILT_BRANCH="Amanda_Enterprise_3_0" CC="gcc"
+planner: paths: bindir="/usr/bin" sbindir="/usr/sbin"
+planner:        libexecdir="/usr/lib" amlibexecdir="/usr/lib/amanda"
+planner:        mandir="/usr/share/man" AMANDA_TMPDIR="/tmp/amanda"
+planner:        AMANDA_DBGDIR="/var/log/amanda" CONFIG_DIR="/etc/amanda"
+planner:        DEV_PREFIX="/dev/dsk/" RDEV_PREFIX="/dev/rdsk/"
+planner:        DUMP="/usr/sbin/ufsdump" RESTORE="/usr/sbin/ufsrestore"
+planner:        VDUMP=UNDEF VRESTORE=UNDEF XFSDUMP=UNDEF XFSRESTORE=UNDEF
+planner:        VXDUMP=UNDEF VXRESTORE=UNDEF
+planner:        SAMBA_CLIENT="/usr/sfw/bin/smbclient"
+planner:        STAR="/opt/csw/bin/star" GNUTAR="/opt/csw/bin/gtar"
+planner:        COMPRESS_PATH="/usr/bin/gzip"
+planner:        UNCOMPRESS_PATH="/usr/bin/gzip" LPRCMD="/usr/bin/lp"
+planner:         MAILER=UNDEF listed_incr_dir="/var/lib/amanda/gnutar-lists"
+planner: defs:  DEFAULT_SERVER="localhost" DEFAULT_CONFIG="DailySet1"
+planner:        DEFAULT_TAPE_SERVER="localhost" DEFAULT_TAPE_DEVICE=""
+planner:        HAVE_MMAP NEED_STRSTR HAVE_SYSVSHM AMFLOCK_POSIX AMFLOCK_LOCKF
+planner:        AMFLOCK_LNLOCK SETPGRP_VOID ASSERTIONS AMANDA_DEBUG_DAYS=4
+planner:        BSD_SECURITY RSH_SECURITY USE_AMANDAHOSTS
+planner:        CLIENT_LOGIN="amandabackup" CHECK_USERID HAVE_GZIP
+planner:        COMPRESS_SUFFIX=".gz" COMPRESS_FAST_OPT="--fast"
+planner:        COMPRESS_BEST_OPT="--best" UNCOMPRESS_OPT="-dc"
+READING CONF INFO...
+planner: timestamp 20090410074759
+planner: time 0.001: startup took 0.001 secs
+
+SENDING FLUSHES...
+ENDFLUSH
+
+SETTING UP FOR ESTIMATES...
+planner: time 0.001: setting up estimates for localhost:/etc
+localhost:/etc overdue 14338 days for level 0
+setup_estimate: localhost:/etc: command 0, options: none    last_level 0 next_level0 -14338 level_days 0    getting estimates 0 (-2) 1 (-2) -1 (-2)
+planner: time 0.002: setting up estimates took 0.000 secs
+
+GETTING ESTIMATES...
+planner time 0.113: got result for host localhost disk /etc: 0 -> 80822K, 1 -> 61440K, -1 -> -2K
+driver: pid 4109 executable /usr/lib/amanda/driver version 3.0.0
+driver: tape size 122880
+driver: adding holding disk 0 dir /var/lib/amanda/staging size 1215488 chunksize 1048576
+reserving 1215488 out of 1215488 for degraded-mode dumps
+driver: send-cmd time 0.010 to taper: START-TAPER worker0 20090410074759
+driver: started dumper0 pid 4116
+driver: send-cmd time 0.012 to dumper0: START 20090410074759
+driver: started dumper1 pid 4117
+driver: send-cmd time 0.014 to dumper1: START 20090410074759
+driver: started dumper2 pid 4118
+driver: send-cmd time 0.016 to dumper2: START 20090410074759
+driver: started dumper3 pid 4119
+driver: send-cmd time 0.018 to dumper3: START 20090410074759
+driver: start time 0.018 inparallel 4 bandwidth 8000 diskspace 1215488  dir OBSOLETE datestamp 20090410074759 driver: drain-ends tapeq FIRST big-dumpers sssS
+taper: pid 4115 executable taper version 3.0.0
+dumper: pid 4116 executable dumper0 version 3.0.0
+planner: time 0.744: got partial result for host localhost disk /etc: 0 -> 80822K, 1 -> -1K, -1 -> -2K
+planner: time 0.744: got result for host localhost disk /etc: 0 -> 80822K, 1 -> -1K, -1 -> -2K
+planner: time 0.745: getting estimates took 0.742 secs
+FAILED QUEUE: empty
+DONE QUEUE:
+  0: localhost  /etc
+
+ANALYZING ESTIMATES...
+pondering localhost:/etc... next_level0 -14338 last_level 0 (due for level 0) (picking inclevel for degraded mode)   picklev: last night 0, so tonight level 1
+(no inc estimate)
+  curr level 0 nsize 80822 csize 80822 total size 80921 total_lev0 80822 balanced-lev0size 11546
+INITIAL SCHEDULE (size 80921):
+  localhost /etc pri 14339 lev 0 nsize 80822 csize 80822
+
+DELAYING DUMPS IF NEEDED, total_size 80921, tape length 122880 mark 1
+  delay: Total size now 80921.
+
+PROMOTING DUMPS IF NEEDED, total_lev0 80822, balanced_size 11546...
+planner: time 0.745: analysis took 0.000 secs
+
+GENERATING SCHEDULE:
+--------
+DUMP localhost ffffffff9efeffffffffff01 /etc 20090410074759 14339 0 1970:1:1:0:0:0 80822 80822 86 929 "Can't switch to degraded mode because an incremental estimate could not be performed"
+--------
+dumper: pid 4119 executable dumper3 version 3.0.0
+dumper: pid 4118 executable dumper2 version 3.0.0
+dumper: pid 4117 executable dumper1 version 3.0.0
+taper: wrote label 'maitreyee-010'
+driver: result time 2.928 from taper: TAPER-OK worker0
+driver: state time 2.937 free kps: 8000 space: 1215488 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: not-idle
+driver: interface-state time 2.937 if default: free 8000
+driver: hdisk-state time 2.937 hdisk 0: free 1215488 dumpers 0
+driver: flush size 0
+driver: started chunker0 pid 4160
+driver: send-cmd time 2.954 to chunker0: START 20090410074759
+driver: send-cmd time 2.954 to chunker0: PORT-WRITE 00-00001 /var/lib/amanda/staging/20090410074759/localhost._etc.0 localhost ffffffff9efeffffffffff01 /etc 0 1970:1:1:0:0:0 1048576 APPLICATION 80896 |;auth=bsdtcp;index;
+chunker: pid 4160 executable chunker0 version 3.0.0
+driver: result time 3.000 from chunker0: PORT 11005
+driver: send-cmd time 3.001 to dumper0: PORT-DUMP 00-00001 11005 localhost ffffffff9efeffffffffff01 /etc /etc 0 1970:1:1:0:0:0 amsuntar X X X bsdtcp |"  <auth>bsdtcp</auth>\n  <record>YES</record>\n  <index>YES</index>\n  <backup-program>\n    <plugin>amsuntar</plugin>\n    <property>\n      <name>EXTENDED-HEADERS</name>\n      <value>NO</value>\n    </property>\n    <property>\n      <name>EXTENDED-ATTRIBUTES</name>\n      <value>NO</value>\n    </property>\n    <property>\n      <name>BLOCK-SIZE</name>\n      <value>64</value>\n    </property>\n  </backup-program>\n"
+driver: state time 3.034 free kps: 7071 space: 1134592 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 3.034 if default: free 7071
+driver: hdisk-state time 3.034 hdisk 0: free 1134592 dumpers 1
+driver: state time 49.732 free kps: 7071 space: 1134592 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 49.732 if default: free 7071
+driver: hdisk-state time 49.732 hdisk 0: free 1134592 dumpers 1
+driver: result time 49.732 from chunker0: RQ-MORE-DISK 00-00001
+driver: send-cmd time 49.733 to chunker0: CONTINUE 00-00001 /var/lib/amanda/staging/20090410074759/localhost._etc.0 1048576 4096
+dumper: kill index command
+driver: state time 49.901 free kps: 7071 space: 1130496 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 49.901 if default: free 7071
+driver: hdisk-state time 49.901 hdisk 0: free 1130496 dumpers 1
+driver: result time 49.901 from dumper0: FAILED 00-00001 "[/usr/sbin/tar returned error]"
+driver: send-cmd time 49.901 to chunker0: FAILED 00-00001
+driver: state time 49.906 free kps: 7071 space: 1130496 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 49.906 if default: free 7071
+driver: hdisk-state time 49.906 hdisk 0: free 1130496 dumpers 1
+driver: result time 49.906 from chunker0: PARTIAL 00-00001 80909 "[sec 46.789 kb 80909 kps 1729.9]"
+driver: finished-cmd time 49.907 chunker0 chunked localhost:/etc
+driver: started chunker0 pid 4184
+driver: send-cmd time 50.094 to chunker0: START 20090410074759
+driver: send-cmd time 50.094 to chunker0: PORT-WRITE 00-00002 /var/lib/amanda/staging/20090410074759/localhost._etc.0 localhost ffffffff9efeffffffffff01 /etc 0 1970:1:1:0:0:0 1048576 APPLICATION 84960 |;auth=bsdtcp;index;
+chunker: pid 4184 executable chunker0 version 3.0.0
+driver: result time 50.139 from chunker0: PORT 11035
+driver: send-cmd time 50.140 to dumper0: PORT-DUMP 00-00002 11035 localhost ffffffff9efeffffffffff01 /etc /etc 0 1970:1:1:0:0:0 amsuntar X X X bsdtcp |"  <auth>bsdtcp</auth>\n  <record>YES</record>\n  <index>YES</index>\n  <backup-program>\n    <plugin>amsuntar</plugin>\n    <property>\n      <name>EXTENDED-HEADERS</name>\n      <value>NO</value>\n    </property>\n    <property>\n      <name>EXTENDED-ATTRIBUTES</name>\n      <value>NO</value>\n    </property>\n    <property>\n      <name>BLOCK-SIZE</name>\n      <value>64</value>\n    </property>\n  </backup-program>\n"
+driver: state time 50.175 free kps: 7071 space: 1130528 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 50.175 if default: free 7071
+driver: hdisk-state time 50.175 hdisk 0: free 1130528 dumpers 1
+driver: state time 84.740 free kps: 7071 space: 1130528 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 84.740 if default: free 7071
+driver: hdisk-state time 84.740 hdisk 0: free 1130528 dumpers 1
+driver: result time 84.740 from dumper0: FAILED 00-00002 "[/usr/sbin/tar returned error]"
+driver: send-cmd time 84.740 to chunker0: FAILED 00-00002
+driver: state time 84.745 free kps: 7071 space: 1130528 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 84.745 if default: free 7071
+driver: hdisk-state time 84.745 hdisk 0: free 1130528 dumpers 1
+driver: result time 84.745 from chunker0: PARTIAL 00-00002 80917 "[sec 34.565 kb 80917 kps 2341.9]"
+driver: finished-cmd time 84.745 chunker0 chunked localhost:/etc
+dumper: kill index command
+driver: send-cmd time 84.890 to taper: FILE-WRITE worker0 00-00003 /var/lib/amanda/staging/20090410074759/localhost._etc.0 localhost /etc 0 20090410074759 0
+driver: startaflush: FIRST localhost /etc 80949 122880
+driver: state time 84.890 free kps: 8000 space: 1134539 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 84.890 if default: free 8000
+driver: hdisk-state time 84.890 hdisk 0: free 1134539 dumpers 0
+driver: state time 84.891 free kps: 8000 space: 1134539 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 84.891 if default: free 8000
+driver: hdisk-state time 84.891 hdisk 0: free 1134539 dumpers 0
+driver: result time 84.891 from taper: REQUEST-NEW-TAPE 00-00003
+driver: send-cmd time 84.891 to taper: NEW-TAPE worker0 00-00003
+driver: state time 84.906 free kps: 8000 space: 1134539 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 84.906 if default: free 8000
+driver: hdisk-state time 84.906 hdisk 0: free 1134539 dumpers 0
+driver: result time 84.906 from taper: NEW-TAPE 00-00003 maitreyee-010
+driver: state time 114.910 free kps: 8000 space: 1134539 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 114.910 if default: free 8000
+driver: hdisk-state time 114.910 hdisk 0: free 1134539 dumpers 0
+driver: result time 114.911 from taper: PARTDONE 00-00003 maitreyee-010 1 80917 "[sec 30.003926 kb 80917 kps 2696.880402]"
+driver: state time 114.911 free kps: 8000 space: 1134539 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 114.911 if default: free 8000
+driver: hdisk-state time 114.911 hdisk 0: free 1134539 dumpers 0
+driver: result time 114.911 from taper: DONE 00-00003 INPUT-GOOD TAPE-GOOD "[sec 30.003926 kb 80917 kps 2696.880402]" "" ""
+driver: finished-cmd time 114.911 taper wrote localhost:/etc
+driver: state time 114.943 free kps: 8000 space: 1215488 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 114.943 if default: free 8000
+driver: hdisk-state time 114.943 hdisk 0: free 1215488 dumpers 0
+driver: QUITTING time 114.943 telling children to quit
+driver: send-cmd time 114.943 to dumper0: QUIT ""
+driver: send-cmd time 114.944 to dumper1: QUIT ""
+driver: send-cmd time 114.944 to dumper2: QUIT ""
+driver: send-cmd time 114.944 to dumper3: QUIT ""
+driver: send-cmd time 114.944 to taper: QUIT
+taper: DONE
+driver: FINISHED time 115.961
+amdump: end at Fri Apr 10 07:49:55 PDT 2009
diff --git a/installcheck/catalogs/doublefailure.cat b/installcheck/catalogs/doublefailure.cat
new file mode 100644 (file)
index 0000000..9023244
--- /dev/null
@@ -0,0 +1,130 @@
+%F log/log
+START planner date 20090326001503
+START driver date 20090326001503
+INFO amdump amdump pid 22014
+INFO driver driver pid 22043
+INFO planner planner pid 22042
+START taper datestamp 20090326001503 label Daily-13 tape 1
+DISK planner ns-new.slikon.local /opt/var
+INFO planner Forcing full dump of ns-new.slikon.local:/opt/var as directed.
+FAIL dumper ns-new.slikon.local /opt/var 20090326001503 0 [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134405000.debug]
+  sendbackup: info BACKUP=APPLICATION
+  sendbackup: info APPLICATION=amgtar
+  sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
+  sendbackup: info COMPRESS_SUFFIX=.gz
+  sendbackup: info end
+  ? /bin/tar: ./gdm: Cannot savedir: Permission denied
+  | Total bytes written: 943831040 (901MiB, 4.9MiB/s)
+  | /bin/tar: Error exit delayed from previous errors
+  sendbackup: error [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134405000.debug]
+  sendbackup: size 921710
+  sendbackup: end
+PARTIAL chunker ns-new.slikon.local /opt/var 20090326001503 0 [sec 187.313 kb 54930 kps 293.4]
+FAIL dumper ns-new.slikon.local /opt/var 20090326001503 0 [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134714000.debug]
+  sendbackup: info BACKUP=APPLICATION
+  sendbackup: info APPLICATION=amgtar
+  sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
+  sendbackup: info COMPRESS_SUFFIX=.gz
+  sendbackup: info end
+  ? /bin/tar: ./gdm: Cannot savedir: Permission denied
+  | Total bytes written: 943851520 (901MiB, 7.4MiB/s)
+  | /bin/tar: Error exit delayed from previous errors
+  sendbackup: error [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134714000.debug]
+  sendbackup: size 921730
+  sendbackup: end
+PARTIAL chunker ns-new.slikon.local /opt/var 20090326001503 0 [sec 123.421 kb 54930 kps 445.3]
+PART taper Daily-13 1 ns-new.slikon.local /opt/var 20090326001503 1/1 0 [sec 3.555085 kb 54929 kps 15451.027696]
+PARTIAL taper ns-new.slikon.local /opt/var 20090326001503 1 0 [sec 3.555085 kb 54929 kps 15451.027696]
+FINISH driver date 20090326001503 time 77506.015
+
+%T report
+These dumps were to tape Daily-13.
+The next tape Amanda expects to use is: 1 new tape.
+
+FAILURE DUMP SUMMARY:
+   ns-new.slikon.local /opt/var lev 0  FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134405000.debug]
+   ns-new.slikon.local /opt/var lev 0  FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134714000.debug]
+   ns-new.slikon.local /opt/var lev 0  partial taper: successfully taped a partial dump
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)        21:32
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)         107.3      107.3        0.0
+Original Size (meg)         0.0        0.0        0.0
+Avg Compressed Size (%)     --         --         --
+DLEs Dumped            0          0          0
+Avg Dump Rate (k/s)         --         --         --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)            53.6       53.6        0.0
+Tape Used (%)             178.8      178.8        0.0
+DLEs Taped             1          1          0
+
+Parts Taped                   1          1          0
+Avg Tp Write Rate (k/s) 15450.8    15450.8        --
+
+USAGE BY TAPE:
+  Label          Time      Size      %  DLEs Parts
+  Daily-13       0:00    54929k  178.8     1     1
+
+FAILED DUMP DETAILS:
+
+/--  ns-new.slikon.local /opt/var lev 0 FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134405000.debug]
+sendbackup: info BACKUP=APPLICATION
+sendbackup: info APPLICATION=amgtar
+sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
+sendbackup: info COMPRESS_SUFFIX=.gz
+sendbackup: info end
+? /bin/tar: ./gdm: Cannot savedir: Permission denied
+| Total bytes written: 943831040 (901MiB, 4.9MiB/s)
+| /bin/tar: Error exit delayed from previous errors
+sendbackup: error [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134405000.debug]
+sendbackup: size 921710
+sendbackup: end
+\\--------
+
+/--  ns-new.slikon.local /opt/var lev 0 FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134714000.debug]
+sendbackup: info BACKUP=APPLICATION
+sendbackup: info APPLICATION=amgtar
+sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
+sendbackup: info COMPRESS_SUFFIX=.gz
+sendbackup: info end
+? /bin/tar: ./gdm: Cannot savedir: Permission denied
+| Total bytes written: 943851520 (901MiB, 7.4MiB/s)
+| /bin/tar: Error exit delayed from previous errors
+sendbackup: error [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326134714000.debug]
+sendbackup: size 921730
+sendbackup: end
+\\--------
+
+
+NOTES:
+  planner: Forcing full dump of ns-new.slikon.local:/opt/var as directed.
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
+-------------------------- ------------------------------------- --------------
+ns-new.sliko /opt/var    0           54929    --      PARTIAL      0:04 15451.0 PARTIAL
+
+(brought to you by Amanda version x.y.z)
+
+%T postscript
+--PS-TEMPLATE--
+(March 26, 2009) DrawDate
+\
+(Amanda Version 2.6.2alpha) DrawVers
+(Daily-13) DrawTitle
+(Total Size:          53.6 MB) DrawStat
+(Tape Used (%)       178.8 %) DrawStat
+(Number of files:      1) DrawStat
+(Filesystems Taped:    1) DrawStat
+(-) (Daily-13) (-) (  0) (      32) (      32) DrawHost
+(ns-new.slikon.local) (/opt/var) (0) (  1) (        ) (   54929) DrawHost
+\
+showpage
diff --git a/installcheck/catalogs/fatal.cat b/installcheck/catalogs/fatal.cat
new file mode 100644 (file)
index 0000000..9c8f69c
--- /dev/null
@@ -0,0 +1,90 @@
+# a planner failure
+
+%F log/log
+INFO amdump amdump pid 14564
+INFO driver driver pid 14588
+INFO planner planner pid 14587
+START planner date 20100303144314
+START driver date 20100303144314
+STATS driver hostname localhost.localdomain
+DISK planner localhost /boot
+WARNING planner tapecycle (3) <= runspercycle (10)
+INFO planner Forcing full dump of localhost:/boot as directed.
+INFO dumper dumper pid 14595
+INFO dumper dumper pid 14596
+INFO dumper dumper pid 14597
+INFO dumper dumper pid 14600
+INFO dumper dumper pid 14599
+INFO dumper dumper pid 14598
+INFO dumper dumper pid 14601
+INFO dumper dumper pid 14602
+INFO dumper dumper pid 14603
+STATS driver startup time 0.214
+INFO dumper dumper pid 14604
+INFO taper taper pid 14590
+WARNING planner disk localhost:/boot, full dump (83480KB) will be larger than available tape space
+FAIL planner localhost /boot 20100303144314 0 "[dump larger than available tape space, 83480 KB, but cannot incremental dump new disk]"
+FATAL planner cannot fit anything on tape, bailing out
+WARNING driver WARNING: got empty schedule from planner
+INFO dumper pid-done 14595
+INFO dumper pid-done 14597
+INFO dumper pid-done 14596
+INFO dumper pid-done 14598
+INFO dumper pid-done 14600
+INFO dumper pid-done 14601
+INFO dumper pid-done 14604
+INFO dumper pid-done 14603
+INFO dumper pid-done 14602
+INFO dumper pid-done 14599
+INFO taper pid-done 14590
+FINISH driver date 20100303144314 time 8.150
+INFO driver pid-done 14588
+
+%T report
+Hostname: localhost.localdomain
+Org     : DailySet1
+Config  : TESTCONF
+Date    : March 3, 2010
+
+The next tape Amanda expects to use is: 1 new tape.
+
+FAILURE DUMP SUMMARY:
+  planner: FATAL cannot fit anything on tape, bailing out
+   localhost /boot lev 0  FAILED [dump larger than available tape space, 83480 KB, but cannot incremental dump new disk]
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:00
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)           0.0        0.0        0.0
+Original Size (meg)         0.0        0.0        0.0
+Avg Compressed Size (%)     --         --         --
+DLEs Dumped            0          0          0
+Avg Dump Rate (k/s)         --         --         --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)             0.0        0.0        0.0
+Tape Used (%)               0.0        0.0        0.0
+DLEs Taped             0          0          0
+
+Parts Taped                   0          0          0
+Avg Tp Write Rate (k/s)     --         --         --
+
+
+NOTES:
+  planner: tapecycle (3) <= runspercycle (10)
+  planner: Forcing full dump of localhost:/boot as directed.
+  planner: disk localhost:/boot, full dump (83480KB) will be larger than available tape space
+  driver: WARNING: got empty schedule from planner
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
+-------------------------- ------------------------------------- -------------
+localhost    /boot         FAILED
+
+(brought to you by Amanda version 2.6.2alpha)
diff --git a/installcheck/catalogs/filesystemstaped.cat b/installcheck/catalogs/filesystemstaped.cat
new file mode 100644 (file)
index 0000000..e5a4af3
--- /dev/null
@@ -0,0 +1,74 @@
+# A collection of dumps to check that the "Filesystems Taped" are correctly
+# displayed
+
+%F log/log
+INFO amflush amflush pid 1239
+DISK amflush localhost.localdomain /boot
+START amflush date 20100713120014
+INFO driver driver pid 1240
+START driver date 20100713120014
+STATS driver hostname localhost.localdomain
+STATS driver startup time 0.015
+INFO taper taper pid 1241
+START taper datestamp 20100713120014 label DAILY-37 tape 1
+PART taper DAILY-37 1 localhost.localdomain /boot 20100713111516 1/-1 1 [sec 0.096877 kb 10240 kps 105701.444021 orig-kb 20480]
+PART taper DAILY-37 2 localhost.localdomain /boot 20100713111516 2/-1 1 [sec 0.079061 kb 10240 kps 129519.788435 orig-kb 20480]
+DONE taper localhost.localdomain /boot 20100713111516 2 1 [sec 0.100000 kb 20480 kps 446100.000000 orig-kb 20480]
+PART taper DAILY-37 3 localhost.localdomain /boot 20100713111517 1/-1 2 [sec 0.096877 kb 10240 kps 105701.444021 orig-kb 10240]
+DONE taper localhost.localdomain /boot 20100713111517 1 2 [sec 0.100000 kb 10240 kps 446100.000000 orig-kb 10240]
+INFO taper tape DAILY-37 kb 30720 fm 3 [OK]
+INFO taper pid-done 1241
+FINISH driver date 20100713120014 time 2.534
+INFO driver pid-done 1240
+INFO amflush pid-done 1239
+
+%F tapelist
+20100923000000 TESTCONF41 reuse
+20100922000000 TESTCONF40 reuse
+20100921000000 TESTCONF39 reuse
+20100920000000 TESTCONF38 reuse
+20100910000000 TESTCONF37 no-reuse
+%T report
+Hostname: localhost.localdomain
+Org     : DailySet1
+Config  : TESTCONF
+Date    : July 13, 2010
+
+The dumps were flushed to tape DAILY-37.
+The next 3 tapes Amanda expects to use are: 1 new tape, TESTCONF38, TESTCONF39.
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)     0:00
+Run Time (hrs:min)          0:00
+Dump Time (hrs:min)         0:00       0:00       0:00
+Output Size (meg)            0.0        0.0        0.0
+Original Size (meg)          0.0        0.0        0.0
+Avg Compressed Size (%)      --         --         --
+DLEs Dumped             0          0          0
+Avg Dump Rate (k/s)          --         --         --
+
+Tape Time (hrs:min)         0:00       0:00       0:00
+Tape Size (meg)             30.0        0.0       30.0
+Tape Used (%)              100.1        0.0      100.1
+DLEs Taped              2          0          2  1:1 2:1
+Parts Taped                    3          0          3  1:2 2:1
+Avg Tp Write Rate (k/s)   153600        --      153600
+
+USAGE BY TAPE:
+  Label               Time         Size      %  DLEs Parts
+  DAILY-37            0:00       30720k  100.1     2     3
+
+NOTES:
+  taper: tape DAILY-37 kb 30720 fm 3 [OK]
+
+
+DUMP SUMMARY:
+                                      DUMPER STATS                TAPER STATS
+ HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS     KB/s
+ -------------------------- ------------------------------------- ---------------
+ localhost.lo /boot       2   10240   10240    --      FLUSH        0:00 446100.0
+ localhost.lo /boot       1   20480   20480    --      FLUSH        0:00 446100.0
+
+(brought to you by Amanda version x.y.z)
diff --git a/installcheck/catalogs/flush-noorigsize.cat b/installcheck/catalogs/flush-noorigsize.cat
new file mode 100644 (file)
index 0000000..f9d6cdc
--- /dev/null
@@ -0,0 +1,64 @@
+# Like flush-origsize, but without the orig-kb segments
+
+%F log/log
+INFO amflush amflush pid 11753
+DISK amflush localhost /boot
+START amflush date 20100303132501
+INFO driver driver pid 11755
+START driver date 20100303132501
+STATS driver hostname localhost.localdomain
+STATS driver startup time 0.020
+INFO taper taper pid 11756
+START taper datestamp 20100303132501 label TESTCONF02 tape 1
+PART taper TESTCONF02 1 localhost /boot 20100303132432 1/-1 0 [sec 0.493936 kb 83480 kps 169009.900121]
+DONE taper localhost /boot 20100303132432 1 0 [sec 0.493936 kb 83480 kps 169009.900121]
+INFO taper tape TESTCONF02 kb 83480 fm 9 [OK]
+INFO taper pid-done 11756
+FINISH driver date 20100303132501 time 1.966
+INFO driver pid-done 11755
+INFO amflush pid-done 11754
+
+%T report
+Hostname: localhost.localdomain
+Org     : DailySet1
+Config  : TESTCONF
+Date    : March 3, 2010
+
+The dumps were flushed to tape TESTCONF02.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)     0:00
+Run Time (hrs:min)          0:00
+Dump Time (hrs:min)         0:00       0:00       0:00
+Output Size (meg)            0.0        0.0        0.0
+Original Size (meg)          0.0        0.0        0.0
+Avg Compressed Size (%)      --         --         --
+DLEs Dumped             0          0          0
+Avg Dump Rate (k/s)          --         --         --
+
+Tape Time (hrs:min)         0:00       0:00       0:00
+Tape Size (meg)             81.5       81.5        0.0
+Tape Used (%)              271.8      271.8        0.0
+DLEs Taped              1          1          0
+Parts Taped                    1          1          0
+Avg Tp Write Rate (k/s)   169010     169010        --
+
+USAGE BY TAPE:
+  Label               Time         Size      %  DLEs Parts
+  TESTCONF02          0:00       83480k  271.8     1     1
+
+NOTES:
+  taper: tape TESTCONF02 kb 83480 fm 9 [OK]
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS                TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS     KB/s
+-------------------------- ------------------------------------- ---------------
+localhost    /boot       0           83480    --      FLUSH        0:00 169009.9
+
+(brought to you by Amanda version x.y.z)
diff --git a/installcheck/catalogs/flush-origsize.cat b/installcheck/catalogs/flush-origsize.cat
new file mode 100644 (file)
index 0000000..2719971
--- /dev/null
@@ -0,0 +1,64 @@
+# A flush with orig-kb fields
+
+%F log/log
+INFO amflush amflush pid 11753
+DISK amflush localhost /boot
+START amflush date 20100303132501
+INFO driver driver pid 11755
+START driver date 20100303132501
+STATS driver hostname localhost.localdomain
+STATS driver startup time 0.020
+INFO taper taper pid 11756
+START taper datestamp 20100303132501 label TESTCONF02 tape 1
+PART taper TESTCONF02 1 localhost /boot 20100303132432 1/-1 0 [sec 0.493936 kb 83480 kps 169009.900121 orig-kb 148870]
+DONE taper localhost /boot 20100303132432 1 0 [sec 0.493936 kb 83480 kps 169009.900121 orig-kb 148870]
+INFO taper tape TESTCONF02 kb 83480 fm 9 [OK]
+INFO taper pid-done 11756
+FINISH driver date 20100303132501 time 1.966
+INFO driver pid-done 11755
+INFO amflush pid-done 11754
+
+%T report
+Hostname: localhost.localdomain
+Org     : DailySet1
+Config  : TESTCONF
+Date    : March 3, 2010
+
+The dumps were flushed to tape TESTCONF02.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)     0:00
+Run Time (hrs:min)          0:00
+Dump Time (hrs:min)         0:00       0:00       0:00
+Output Size (meg)            0.0        0.0        0.0
+Original Size (meg)          0.0        0.0        0.0
+Avg Compressed Size (%)      --         --         --
+DLEs Dumped             0          0          0
+Avg Dump Rate (k/s)          --         --         --
+
+Tape Time (hrs:min)         0:00       0:00       0:00
+Tape Size (meg)             81.5       81.5        0.0
+Tape Used (%)              271.8      271.8        0.0
+DLEs Taped              1          1          0
+Parts Taped                    1          1          0
+Avg Tp Write Rate (k/s)   169010     169010        --
+
+USAGE BY TAPE:
+  Label               Time         Size      %  DLEs Parts
+  TESTCONF02          0:00       83480k  271.8     1     1
+
+NOTES:
+  taper: tape TESTCONF02 kb 83480 fm 9 [OK]
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS                TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS     KB/s
+-------------------------- ------------------------------------- ---------------
+localhost    /boot       0  148870   83480   56.1     FLUSH        0:00 169009.9
+
+(brought to you by Amanda version 2.6.2alpha)
diff --git a/installcheck/catalogs/longstrange.cat b/installcheck/catalogs/longstrange.cat
new file mode 100644 (file)
index 0000000..73e5ca3
--- /dev/null
@@ -0,0 +1,1179 @@
+# What a long, strange journey it's been -- a logfile with some STRANGE output
+# .. a lot of it!
+
+%F log/log
+START planner date 20090326001503
+START driver date 20090326001503
+INFO amdump amdump pid 22014
+INFO driver driver pid 22043
+INFO planner planner pid 22042
+DISK planner bsdfw.slikon.local /
+START taper datestamp 20090326001503 label Daily-36 tape 1
+STRANGE dumper bsdfw.slikon.local / 0 [sec 1775.514 kb 2317814 kps 1305.4 orig-kb 5401240]
+  sendbackup: info BACKUP=APPLICATION
+  sendbackup: info APPLICATION=amgtar
+  sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
+  sendbackup: info COMPRESS_SUFFIX=.gz
+  sendbackup: info end
+  | /bin/tar: ./tmp/.gdm_socket: socket ignored
+  | /bin/tar: ./tmp/.X11-unix/X0: socket ignored
+  | /bin/tar: ./tmp/.font-unix/fs7100: socket ignored
+  ? /bin/tar: ./var/log/messages: file changed as we read it
+  | /bin/tar: ./var/run/acpid.socket: socket ignored
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | x
+  | Total bytes written: 5530869760 (5.2GiB, 3.0MiB/s)
+  sendbackup: size 5401240
+  sendbackup: end
+SUCCESS chunker bsdfw.slikon.local / 20090326001503 0 [sec 1782.341 kb 2293471 kps 1286.8]
+STATS driver estimate bsdfw.slikon.local / 20090326001503 0 [sec 1715 nkb 5400282 ckb 2294272 kps 1337]
+PART taper Daily-36 1 bsdfw.slikon.local / 20090326001503 1/1 0 [sec 157.123731 kb 2293470 kps 14596.586283]
+DONE taper bsdfw.slikon.local / 20090326001503 1 0 [sec 157.123731 kb 2293470 kps 14596.586283]
+FINISH driver date 20090326001503 time 77506.015
+
+%T report
+These dumps were to tape Daily-36.
+The next tape Amanda expects to use is: 1 new tape.
+
+STRANGE DUMP SUMMARY:
+   bsdfw.slikon.local / lev 0  STRANGE (see below)
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)        21:32
+Dump Time (hrs:min)        0:30       0:30       0:00
+Output Size (meg)        2239.7     2239.7        0.0
+Original Size (meg)      5274.6     5274.6        0.0
+Avg Compressed Size (%)    42.5       42.5        --
+DLEs Dumped            1          1          0
+Avg Dump Rate (k/s)      1291.7     1291.7        --
+
+Tape Time (hrs:min)        0:03       0:03       0:00
+Tape Size (meg)          2239.7     2239.7        0.0
+Tape Used (%)              7466       7466        0.0
+DLEs Taped             1          1          0
+
+Parts Taped                   1          1          0
+Avg Tp Write Rate (k/s) 14596.6    14596.6        --
+
+USAGE BY TAPE:
+  Label          Time      Size      %  DLEs Parts
+  Daily-36       0:03  2293470k   7466     1     1
+
+
+STRANGE DUMP DETAILS:
+
+/--  bsdfw.slikon.local / lev 0 STRANGE
+sendbackup: info BACKUP=APPLICATION
+sendbackup: info APPLICATION=amgtar
+sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
+sendbackup: info COMPRESS_SUFFIX=.gz
+sendbackup: info end
+| /bin/tar: ./tmp/.gdm_socket: socket ignored
+| /bin/tar: ./tmp/.X11-unix/X0: socket ignored
+| /bin/tar: ./tmp/.font-unix/fs7100: socket ignored
+? /bin/tar: ./var/log/messages: file changed as we read it
+| /bin/tar: ./var/run/acpid.socket: socket ignored
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+| x
+\\--------
+913 lines follow, see the corresponding log.* file for the complete list
+\\--------
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
+-------------------------- ------------------------------------- --------------
+bsdfw.slikon /           0 5401240 2293470   42.5   29:36 1305.4   2:37 14596.6
+
+(brought to you by Amanda version x.y.z)
diff --git a/installcheck/catalogs/multi-taper.cat b/installcheck/catalogs/multi-taper.cat
new file mode 100644 (file)
index 0000000..cfff2bc
--- /dev/null
@@ -0,0 +1,159 @@
+# A collection of dumps to check that multi-taper works.
+
+%F log/log.20100908110856.0
+INFO amflush amflush pid 20079
+DISK amflush localhost.localdomain /bootAMGTAR
+START amflush date 20100908110856
+INFO driver driver pid 20080
+START driver date 20100908110856
+STATS driver hostname localhost.localdomain
+STATS driver startup time 0.019
+INFO taper taper pid 20081
+START taper datestamp 20100908110856 label DIRO-TEST-002 tape 1
+START taper datestamp 20100908110856 label DIRO-TEST-003 tape 1
+%D localhost.localdomain_bootAMGTAR_20100720114523 20100720114523 20100908110856 localhost.localdomain /bootAMGTAR 1 OK "" 6 1.000000 44610 44610
+%P localhost.localdomain_bootAMGTAR_20100720114523_1 localhost.localdomain_bootAMGTAR_20100720114523 DIRO-TEST-002 1 1 OK 0.054244 10240 44610
+PART taper DIRO-TEST-002 1 localhost.localdomain /bootAMGTAR 20100720114523 1/-1 1 [sec 0.054244 kb 10240 kps 188775.695778 orig-kb 44610]
+%D localhost.localdomain_bootAMGTAR_20100720114534 20100720114534 20100908110856 localhost.localdomain /bootAMGTAR 1 OK "" 6 1.000000 44610 44610
+%P localhost.localdomain_bootAMGTAR_20100720114534_1 localhost.localdomain_bootAMGTAR_20100720114534 DIRO-TEST-003 1 1 OK 0.065777 10240 44610
+PART taper DIRO-TEST-003 1 localhost.localdomain /bootAMGTAR 20100720114534 1/-1 1 [sec 0.065777 kb 10240 kps 155678.153115 orig-kb 44610]
+START taper datestamp 20100908110856 label DIRO-TEST-004 tape 1
+%P localhost.localdomain_bootAMGTAR_20100720114523_2 localhost.localdomain_bootAMGTAR_20100720114523 DIRO-TEST-002 2 2 OK 0.112201 10240 44610
+PART taper DIRO-TEST-002 2 localhost.localdomain /bootAMGTAR 20100720114523 2/-1 1 [sec 0.112201 kb 10240 kps 91264.766655 orig-kb 44610]
+%D localhost.localdomain_bootAMGTAR_20100720114543 20100720114543 20100908110856 localhost.localdomain /bootAMGTAR 1 OK "" 6 1.000000 44610 44610
+%P localhost.localdomain_bootAMGTAR_20100720114543_1 localhost.localdomain_bootAMGTAR_20100720114543 DIRO-TEST-004 1 1 OK 0.065334 10240 44610
+PART taper DIRO-TEST-004 1 localhost.localdomain /bootAMGTAR 20100720114543 1/-1 1 [sec 0.065334 kb 10240 kps 156731.904689 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114534_2 localhost.localdomain_bootAMGTAR_20100720114534 DIRO-TEST-003 2 2 OK 0.116547 10240 44610
+PART taper DIRO-TEST-003 2 localhost.localdomain /bootAMGTAR 20100720114534 2/-1 1 [sec 0.116547 kb 10240 kps 87861.895447 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114543_2 localhost.localdomain_bootAMGTAR_20100720114543 DIRO-TEST-004 2 2 OK 0.070451 10240 44610
+PART taper DIRO-TEST-004 2 localhost.localdomain /bootAMGTAR 20100720114543 2/-1 1 [sec 0.070451 kb 10240 kps 145349.695470 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114523_3 localhost.localdomain_bootAMGTAR_20100720114523 DIRO-TEST-002 3 3 OK 0.120603 10240 44610
+PART taper DIRO-TEST-002 3 localhost.localdomain /bootAMGTAR 20100720114523 3/-1 1 [sec 0.120603 kb 10240 kps 84906.537181 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114534_3 localhost.localdomain_bootAMGTAR_20100720114534 DIRO-TEST-003 3 3 OK 0.122529 10240 44610
+PART taper DIRO-TEST-003 3 localhost.localdomain /bootAMGTAR 20100720114534 3/-1 1 [sec 0.122529 kb 10240 kps 83571.766549 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114543_3 localhost.localdomain_bootAMGTAR_20100720114543 DIRO-TEST-004 3 3 OK 0.101365 10240 44610
+PART taper DIRO-TEST-004 3 localhost.localdomain /bootAMGTAR 20100720114543 3/-1 1 [sec 0.101365 kb 10240 kps 101020.766506 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114534_4 localhost.localdomain_bootAMGTAR_20100720114534 DIRO-TEST-003 4 4 OK 0.072379 10240 44610
+PART taper DIRO-TEST-003 4 localhost.localdomain /bootAMGTAR 20100720114534 4/-1 1 [sec 0.072379 kb 10240 kps 141477.033214 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114534_5 localhost.localdomain_bootAMGTAR_20100720114534 DIRO-TEST-003 5 5 OK 0.005367 736 44610
+PART taper DIRO-TEST-003 5 localhost.localdomain /bootAMGTAR 20100720114534 5/-1 1 [sec 0.005367 kb 736 kps 137137.456823 orig-kb 44610]
+INFO taper tape DIRO-TEST-003 kb 41696 fm 5 [OK]
+START taper datestamp 20100908110856 label DIRO-TEST-005 tape 2
+%P localhost.localdomain_bootAMGTAR_20100720114523_4 localhost.localdomain_bootAMGTAR_20100720114523 DIRO-TEST-002 4 4 OK 0.156138 10240 44610
+PART taper DIRO-TEST-002 4 localhost.localdomain /bootAMGTAR 20100720114523 4/-1 1 [sec 0.156138 kb 10240 kps 65583.074167 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114543_4 localhost.localdomain_bootAMGTAR_20100720114543 DIRO-TEST-004 4 4 OK 0.125116 10240 44610
+PART taper DIRO-TEST-004 4 localhost.localdomain /bootAMGTAR 20100720114543 4/-1 1 [sec 0.125116 kb 10240 kps 81844.010782 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114523_5 localhost.localdomain_bootAMGTAR_20100720114523 DIRO-TEST-002 5 5 OK 0.011990 736 44610
+PART taper DIRO-TEST-002 5 localhost.localdomain /bootAMGTAR 20100720114523 5/-1 1 [sec 0.011990 kb 736 kps 61384.185015 orig-kb 44610]
+INFO taper tape DIRO-TEST-002 kb 41696 fm 5 [OK]
+START taper datestamp 20100908110856 label DIRO-TEST-006 tape 2
+%P localhost.localdomain_bootAMGTAR_20100720114523_6 localhost.localdomain_bootAMGTAR_20100720114523 DIRO-TEST-006 1 6 OK 0.016100 2914 44610
+PART taper DIRO-TEST-006 1 localhost.localdomain /bootAMGTAR 20100720114523 6/-1 1 [sec 0.016100 kb 2914 kps 180992.945685 orig-kb 44610]
+DONE taper localhost.localdomain /bootAMGTAR 20100720114523 6 1 [sec 1.000000 kb 44610 kps 44610.000000 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114534_6 localhost.localdomain_bootAMGTAR_20100720114534 DIRO-TEST-005 1 6 OK 0.027878 2914 44610
+PART taper DIRO-TEST-005 1 localhost.localdomain /bootAMGTAR 20100720114534 6/-1 1 [sec 0.027878 kb 2914 kps 104525.457293 orig-kb 44610]
+DONE taper localhost.localdomain /bootAMGTAR 20100720114534 6 1 [sec 1.000000 kb 44610 kps 44610.000000 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114543_5 localhost.localdomain_bootAMGTAR_20100720114543 DIRO-TEST-004 5 5 OK 0.032260 736 44610
+PART taper DIRO-TEST-004 5 localhost.localdomain /bootAMGTAR 20100720114543 5/-1 1 [sec 0.032260 kb 736 kps 22814.479780 orig-kb 44610]
+INFO taper tape DIRO-TEST-004 kb 41696 fm 5 [OK]
+START taper datestamp 20100908110856 label DIRO-TEST-001 tape 2
+%P localhost.localdomain_bootAMGTAR_20100720114543_6 localhost.localdomain_bootAMGTAR_20100720114543 DIRO-TEST-001 1 6 OK 0.016867 2914 44610
+PART taper DIRO-TEST-001 1 localhost.localdomain /bootAMGTAR 20100720114543 6/-1 1 [sec 0.016867 kb 2914 kps 172764.090871 orig-kb 44610]
+DONE taper localhost.localdomain /bootAMGTAR 20100720114543 6 1 [sec 1.000000 kb 44610 kps 44610.000000 orig-kb 44610]
+%D localhost.localdomain_bootAMGTAR_20100720114551 20100720114551 20100908110856 localhost.localdomain /bootAMGTAR 1 OK "" 5 1.000000 44610 44610
+%P localhost.localdomain_bootAMGTAR_20100720114551_1 localhost.localdomain_bootAMGTAR_20100720114551 DIRO-TEST-006 2 1 OK 0.099352 10240 44610
+PART taper DIRO-TEST-006 2 localhost.localdomain /bootAMGTAR 20100720114551 1/-1 1 [sec 0.099352 kb 10240 kps 103067.679643 orig-kb 44610]
+%D localhost.localdomain_bootAMGTAR_20100720114601 20100720114601 20100908110856 localhost.localdomain /bootAMGTAR 1 OK "" 5 1.000000 44610 44610
+%P localhost.localdomain_bootAMGTAR_20100720114601_1 localhost.localdomain_bootAMGTAR_20100720114601 DIRO-TEST-005 2 1 OK 0.088941 10240 44610
+PART taper DIRO-TEST-005 2 localhost.localdomain /bootAMGTAR 20100720114601 1/-1 1 [sec 0.088941 kb 10240 kps 115133.092562 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114601_2 localhost.localdomain_bootAMGTAR_20100720114601 DIRO-TEST-005 3 2 OK 0.064858 10240 44610
+PART taper DIRO-TEST-005 3 localhost.localdomain /bootAMGTAR 20100720114601 2/-1 1 [sec 0.064858 kb 10240 kps 157882.258658 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114551_2 localhost.localdomain_bootAMGTAR_20100720114551 DIRO-TEST-006 3 2 OK 0.091257 10240 44610
+PART taper DIRO-TEST-006 3 localhost.localdomain /bootAMGTAR 20100720114551 2/-1 1 [sec 0.091257 kb 10240 kps 112210.179133 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114601_3 localhost.localdomain_bootAMGTAR_20100720114601 DIRO-TEST-005 4 3 OK 0.071162 10240 44610
+PART taper DIRO-TEST-005 4 localhost.localdomain /bootAMGTAR 20100720114601 3/-1 1 [sec 0.071162 kb 10240 kps 143897.492822 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114551_3 localhost.localdomain_bootAMGTAR_20100720114551 DIRO-TEST-006 4 3 OK 0.064180 10240 44610
+PART taper DIRO-TEST-006 4 localhost.localdomain /bootAMGTAR 20100720114551 3/-1 1 [sec 0.064180 kb 10240 kps 159550.861831 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114601_4 localhost.localdomain_bootAMGTAR_20100720114601 DIRO-TEST-005 5 4 OK 0.055595 8032 44610
+PART taper DIRO-TEST-005 5 localhost.localdomain /bootAMGTAR 20100720114601 4/-1 1 [sec 0.055595 kb 8032 kps 144473.423869 orig-kb 44610]
+INFO taper tape DIRO-TEST-005 kb 41666 fm 5 [OK]
+%P localhost.localdomain_bootAMGTAR_20100720114551_4 localhost.localdomain_bootAMGTAR_20100720114551 DIRO-TEST-006 5 4 OK 0.053089 8032 44610
+PART taper DIRO-TEST-006 5 localhost.localdomain /bootAMGTAR 20100720114551 4/-1 1 [sec 0.053089 kb 8032 kps 151294.428187 orig-kb 44610]
+INFO taper tape DIRO-TEST-006 kb 41666 fm 5 [OK]
+%P localhost.localdomain_bootAMGTAR_20100720114601_5 localhost.localdomain_bootAMGTAR_20100720114601 DIRO-TEST-001 2 5 OK 0.036792 5858 44610
+PART taper DIRO-TEST-001 2 localhost.localdomain /bootAMGTAR 20100720114601 5/-1 1 [sec 0.036792 kb 5858 kps 159221.511723 orig-kb 44610]
+DONE taper localhost.localdomain /bootAMGTAR 20100720114601 5 1 [sec 1.000000 kb 44610 kps 44610.000000 orig-kb 44610]
+%P localhost.localdomain_bootAMGTAR_20100720114551_5 localhost.localdomain_bootAMGTAR_20100720114551 DIRO-TEST-001 3 5 OK 0.031049 5858 44610
+PART taper DIRO-TEST-001 3 localhost.localdomain /bootAMGTAR 20100720114551 5/-1 1 [sec 0.031049 kb 5858 kps 188670.209016 orig-kb 44610]
+DONE taper localhost.localdomain /bootAMGTAR 20100720114551 5 1 [sec 1.000000 kb 44610 kps 44610.000000 orig-kb 44610]
+INFO taper tape DIRO-TEST-001 kb 14630 fm 3 [OK]
+INFO taper pid-done 20081
+FINISH driver date 20100908110856 time 3.390
+INFO driver pid-done 20080
+INFO amflush pid-done 20079
+%T report
+Hostname: localhost.localdomain
+Org     : DailySet1
+Config  : TESTCONF
+Date    : September 8, 2010
+
+The dumps were flushed to tapes DIRO-TEST-002, DIRO-TEST-003, DIRO-TEST-004, DIRO-TEST-005, DIRO-TEST-006, DIRO-TEST-001.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)     0:00
+Run Time (hrs:min)          0:00
+Dump Time (hrs:min)         0:00       0:00       0:00
+Output Size (meg)            0.0        0.0        0.0
+Original Size (meg)          0.0        0.0        0.0
+Avg Compressed Size (%)      --         --         --
+DLEs Dumped             0          0          0
+Avg Dump Rate (k/s)          --         --         --
+
+Tape Time (hrs:min)         0:00       0:00       0:00
+Tape Size (meg)            217.8        0.0      217.8
+Tape Used (%)              531.6        0.0      531.6
+DLEs Taped              5          0          5  1:5
+Parts Taped                   28          0         28  1:28
+Avg Tp Write Rate (k/s)  44610.0        --     44610.0
+
+USAGE BY TAPE:
+  Label               Time         Size      %  DLEs Parts
+  DIRO-TEST-002       0:00       41696k   99.4     1     5
+  DIRO-TEST-003       0:00       41696k   99.4     1     5
+  DIRO-TEST-004       0:00       41696k   99.4     1     5
+  DIRO-TEST-005       0:00       41666k   99.3     1     5
+  DIRO-TEST-006       0:00       41666k   99.3     1     5
+  DIRO-TEST-001       0:00       14630k   34.9     0     3
+
+NOTES:
+  taper: tape DIRO-TEST-003 kb 41696 fm 5 [OK]
+  taper: tape DIRO-TEST-002 kb 41696 fm 5 [OK]
+  taper: tape DIRO-TEST-004 kb 41696 fm 5 [OK]
+  taper: tape DIRO-TEST-005 kb 41666 fm 5 [OK]
+  taper: tape DIRO-TEST-006 kb 41666 fm 5 [OK]
+  taper: tape DIRO-TEST-001 kb 14630 fm 3 [OK]
+
+
+DUMP SUMMARY:
+                                      DUMPER STATS               TAPER STATS
+ HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
+ -------------------------- ------------------------------------- --------------
+ localhost.lo /bootAMGTAR 1   44610   44610     --     FLUSH        0:01 44610.0
+ localhost.lo /bootAMGTAR 1   44610   44610     --     FLUSH        0:01 44610.0
+ localhost.lo /bootAMGTAR 1   44610   44610     --     FLUSH        0:01 44610.0
+ localhost.lo /bootAMGTAR 1   44610   44610     --     FLUSH        0:01 44610.0
+ localhost.lo /bootAMGTAR 1   44610   44610     --     FLUSH        0:01 44610.0
+
+(brought to you by Amanda version 3.2.0alpha.git.8dca8d1f)
+
+%F tapelist
+20100908110856 DIRO-TEST-001 reuse
+20100908110856 DIRO-TEST-006 reuse
+20100908110856 DIRO-TEST-005 reuse
+20100908110856 DIRO-TEST-004 reuse
+20100908110856 DIRO-TEST-003 reuse
+20100908110856 DIRO-TEST-002 reuse
diff --git a/installcheck/catalogs/normal.cat b/installcheck/catalogs/normal.cat
new file mode 100644 (file)
index 0000000..1e73d43
--- /dev/null
@@ -0,0 +1,524 @@
+%F log/log
+INFO amdump amdump pid 23649
+INFO planner planner pid 23682
+DISK planner localhost.localdomain /boot1
+DISK planner localhost.localdomain /boot2
+DISK planner localhost.localdomain /boot3
+DISK planner localhost.localdomain /boot4
+DISK planner localhost.localdomain /boot5
+DISK planner localhost.localdomain /boot6
+DISK planner localhost.localdomain /boot7
+DISK planner localhost.localdomain /boot8
+DISK planner localhost.localdomain /boot9
+START planner date 20090225080737
+INFO driver driver pid 23684
+START driver date 20090225080737
+STATS driver hostname localhost.localdomain
+STATS driver startup time 0.004
+INFO dumper dumper pid 23686
+INFO taper taper pid 23685
+FINISH planner date 20090225080737 time 0.084
+INFO planner pid-done 23682
+INFO chunker chunker pid 23733
+INFO dumper gzip pid 23738
+SUCCESS dumper localhost.localdomain /boot1 20090225080737 0 [sec 1.585 kb 12 kps 24748.4 orig-kb 16]
+STATS driver estimate localhost.localdomain /boot1 20090225080737 0 [sec 1 nkb 12 ckb 12 kps 25715]
+SUCCESS chunker localhost.localdomain /boot1 20090225080737 0 [sec 1.607 kb 12 kps 24426.5]
+INFO chunker pid-done 23733
+INFO dumper pid-done 23738
+START taper datestamp 20090225080737 label DIRO-TEST-003 tape 1
+PART taper DIRO-TEST-003 1 localhost.localdomain /boot1 20090225080737 1/1 0 [sec 0.250557 kb 12 kps 156611.070535]
+DONE taper localhost.localdomain /boot1 20090225080737 1 0 [sec 0.250557 kb 12 kps 156611.070535]
+INFO chunker chunker pid 23733
+INFO dumper gzip pid 23738
+SUCCESS dumper localhost.localdomain /boot2 20090225080737 0 [sec 1.585 kb 123 kps 24748.4 orig-kb 167]
+STATS driver estimate localhost.localdomain /boot2 20090225080737 0 [sec 1 nkb 123 ckb 123 kps 25715]
+SUCCESS chunker localhost.localdomain /boot2 20090225080737 0 [sec 1.607 kb 123 kps 24426.5]
+INFO chunker pid-done 23733
+INFO dumper pid-done 23738
+PART taper DIRO-TEST-003 2 localhost.localdomain /boot2 20090225080737 1/1 0 [sec 0.250557 kb 123 kps 156611.070535]
+DONE taper localhost.localdomain /boot2 20090225080737 1 0 [sec 0.250557 kb 123 kps 156611.070535]
+INFO chunker chunker pid 23733
+INFO dumper gzip pid 23738
+SUCCESS dumper localhost.localdomain /boot3 20090225080737 0 [sec 1.585 kb 1234 kps 24748.4 orig-kb 1678]
+STATS driver estimate localhost.localdomain /boot3 20090225080737 0 [sec 1 nkb 1234 ckb 1234 kps 25715]
+SUCCESS chunker localhost.localdomain /boot3 20090225080737 0 [sec 1.607 kb 1234 kps 24426.5]
+INFO chunker pid-done 23733
+INFO dumper pid-done 23738
+PART taper DIRO-TEST-003 3 localhost.localdomain /boot3 20090225080737 1/1 0 [sec 0.250557 kb 1234 kps 156611.070535]
+DONE taper localhost.localdomain /boot3 20090225080737 1 0 [sec 0.250557 kb 1234 kps 156611.070535]
+INFO chunker chunker pid 23733
+INFO dumper gzip pid 23738
+SUCCESS dumper localhost.localdomain /boot4 20090225080737 0 [sec 1.585 kb 12345 kps 24748.4 orig-kb 16789]
+STATS driver estimate localhost.localdomain /boot4 20090225080737 0 [sec 1 nkb 12345 ckb 12345 kps 25715]
+SUCCESS chunker localhost.localdomain /boot4 20090225080737 0 [sec 1.607 kb 12345 kps 24426.5]
+INFO chunker pid-done 23733
+INFO dumper pid-done 23738
+PART taper DIRO-TEST-003 4 localhost.localdomain /boot4 20090225080737 1/1 0 [sec 0.250557 kb 12345 kps 156611.070535]
+DONE taper localhost.localdomain /boot4 20090225080737 1 0 [sec 0.250557 kb 12345 kps 156611.070535]
+INFO chunker chunker pid 23733
+INFO dumper gzip pid 23738
+SUCCESS dumper localhost.localdomain /boot5 20090225080737 0 [sec 1.585 kb 123456 kps 24748.4 orig-kb 167890]
+STATS driver estimate localhost.localdomain /boot5 20090225080737 0 [sec 1 nkb 123456 ckb 123456 kps 25715]
+SUCCESS chunker localhost.localdomain /boot5 20090225080737 0 [sec 1.607 kb 123456 kps 24426.5]
+INFO chunker pid-done 23733
+INFO dumper pid-done 23738
+PART taper DIRO-TEST-003 5 localhost.localdomain /boot5 20090225080737 1/1 0 [sec 0.250557 kb 123456 kps 156611.070535]
+DONE taper localhost.localdomain /boot5 20090225080737 1 0 [sec 0.250557 kb 123456 kps 156611.070535]
+INFO chunker chunker pid 23733
+INFO dumper gzip pid 23738
+SUCCESS dumper localhost.localdomain /boot6 20090225080737 0 [sec 1.585 kb 1234567 kps 24748.4 orig-kb 1678901]
+STATS driver estimate localhost.localdomain /boot6 20090225080737 0 [sec 1 nkb 1234567 ckb 1234567 kps 25715]
+SUCCESS chunker localhost.localdomain /boot6 20090225080737 0 [sec 1.607 kb 1234567 kps 24426.5]
+INFO chunker pid-done 23733
+INFO dumper pid-done 23738
+PART taper DIRO-TEST-003 6 localhost.localdomain /boot6 20090225080737 1/1 0 [sec 0.250557 kb 1234567 kps 156611.070535]
+DONE taper localhost.localdomain /boot6 20090225080737 1 0 [sec 0.250557 kb 1234567 kps 156611.070535]
+INFO chunker chunker pid 23733
+INFO dumper gzip pid 23738
+SUCCESS dumper localhost.localdomain /boot7 20090225080737 0 [sec 1.585 kb 12345678 kps 24748.4 orig-kb 16789012]
+STATS driver estimate localhost.localdomain /boot7 20090225080737 0 [sec 1 nkb 12345678 ckb 12345678 kps 25715]
+SUCCESS chunker localhost.localdomain /boot7 20090225080737 0 [sec 1.607 kb 12345678 kps 24426.5]
+INFO chunker pid-done 23733
+INFO dumper pid-done 23738
+PART taper DIRO-TEST-003 7 localhost.localdomain /boot7 20090225080737 1/1 0 [sec 0.250557 kb 12345678 kps 156611.070535]
+DONE taper localhost.localdomain /boot7 20090225080737 1 0 [sec 0.250557 kb 12345678 kps 156611.070535]
+INFO chunker chunker pid 23733
+INFO dumper gzip pid 23738
+SUCCESS dumper localhost.localdomain /boot8 20090225080737 0 [sec 1.585 kb 123456789 kps 24748.4 orig-kb 167890123]
+STATS driver estimate localhost.localdomain /boot8 20090225080737 0 [sec 1 nkb 123456789 ckb 123456789 kps 25715]
+SUCCESS chunker localhost.localdomain /boot8 20090225080737 0 [sec 1.607 kb 123456789 kps 24426.5]
+INFO chunker pid-done 23733
+INFO dumper pid-done 23738
+PART taper DIRO-TEST-003 8 localhost.localdomain /boot8 20090225080737 1/1 0 [sec 0.250557 kb 123456789 kps 156611.070535]
+DONE taper localhost.localdomain /boot8 20090225080737 1 0 [sec 0.250557 kb 123456789 kps 156611.070535]
+INFO chunker chunker pid 23733
+INFO dumper gzip pid 23738
+# add an 'orig-kb 0' which should be equivalent to a missing field
+SUCCESS dumper localhost.localdomain /boot9 20090225080737 0 [sec 1.585 kb 1234567890 kps 24748.4 orig-kb 1678901234 orig-kb 0]
+STATS driver estimate localhost.localdomain /boot9 20090225080737 0 [sec 1 nkb 1234567890 ckb 1234567890 kps 25715 orig-kb 0]
+SUCCESS chunker localhost.localdomain /boot9 20090225080737 0 [sec 1.607 kb 1234567890 kps 24426.5]
+INFO chunker pid-done 23733
+INFO dumper pid-done 23738
+# add an 'orig-kb -1', which the driver has been known to produce, and which should be treated as missing
+PART taper DIRO-TEST-003 9 localhost.localdomain /boot9 20090225080737 1/1 0 [sec 0.250557 kb 1234567890 kps 156611.070535 orig-kb -1]
+DONE taper localhost.localdomain /boot9 20090225080737 1 0 [sec 0.250557 kb 1234567890 kps 156611.070535 orig-kb -1]
+INFO dumper pid-done 23686
+INFO taper tape DIRO-TEST-003 kb 39240 fm 10 [OK]
+INFO taper pid-done 23685
+FINISH driver date 20090225080737 time 5.306
+INFO driver pid-done 23684
+
+%F log/amdump
+amdump: start at Wed Jun 18 13:01:47 EDT 2008
+amdump: datestamp 20080618
+amdump: starttime 20080618130147
+amdump: starttime-locale-independent 2008-06-18 13:01:47 EDT
+planner: pid 4079 executable /path/to/planner version 9.8.7
+READING CONF INFO...
+planner: timestamp 20080618130147
+planner: time 0.000: startup took 0.000 secs
+
+SENDING FLUSHES...
+ENDFLUSH
+
+SETTING UP FOR ESTIMATES...
+planner: time 0.000: setting up estimates for clienthost:/some/dir
+clienthost:/some/dir overdue 14049 days for level 0
+setup_estimate: clienthost:/some/dir: command 0, options: none    last_level -1 next_level0 -14049 level_days 0    getting estimates 0 (-2) -1 (-2) -1 (-2)
+planner: time 0.000: setting up estimates took 0.000 secs
+
+GETTING ESTIMATES...
+driver: pid 4080 executable /path/to/driver version 9.8.7
+driver: adding holding disk 0 dir /holding size 868352 chunksize 1048576
+reserving 0 out of 868352 for degraded-mode dumps
+driver: send-cmd time 0.015 to taper: START-TAPER worker0 20080618130147
+taper: pid 4084 executable taper version 9.8.7
+driver: started dumper0 pid 4086
+driver: send-cmd time 0.031 to dumper0: START 20080618130147
+planner: time 0.050: got partial result for host clienthost disk /some/dir: 0 -> -2K, -1 -> -2K, -1 -> -2K
+dumper: pid 4090 executable dumper1 version 9.8.7
+driver: started dumper1 pid 4090
+driver: send-cmd time 0.046 to dumper1: START 20080618130147
+driver: started dumper2 pid 4094
+driver: send-cmd time 0.048 to dumper2: START 20080618130147
+driver: started dumper3 pid 4095
+driver: send-cmd time 0.059 to dumper3: START 20080618130147
+driver: start time 0.059 inparallel 4 bandwidth 600 diskspace 868352  dir OBSOLETE datestamp 20080618130147 driver: drain-ends tapeq FIRST big-dumpers sssS
+dumper: pid 4094 executable dumper2 version 9.8.7
+planner: time 0.088: got partial result for host clienthost disk /some/dir: 0 -> 100K, -1 -> -2K, -1 -> -2K
+planner: time 0.091: got result for host clienthost disk /some/dir: 0 -> 100K, -1 -> -2K, -1 -> -2K
+planner: time 0.091: getting estimates took 0.090 secs
+FAILED QUEUE: empty
+DONE QUEUE:
+  0: clienthost     /some/dir
+
+ANALYZING ESTIMATES...
+pondering clienthost:/some/dir... next_level0 -14049 last_level -1 (due for level 0) (new disk, can't switch to degraded mode)
+  curr level 0 nsize 100 csize 100 total size 208 total_lev0 100 balanced-lev0size 50
+INITIAL SCHEDULE (size 208):
+  clienthost /some/dir pri 14050 lev 0 nsize 100 csize 100
+
+DELAYING DUMPS IF NEEDED, total_size 208, tape length 102400 mark 4
+  delay: Total size now 208.
+
+PROMOTING DUMPS IF NEEDED, total_lev0 100, balanced_size 50...
+planner: time 0.091: analysis took 0.000 secs
+
+GENERATING SCHEDULE:
+--------
+DUMP clienthost ffffffff9ffeffffffff1f /some/dir 20080618130147 14050 0 1970:1:1:0:0:0 100 100 0 1024
+--------
+dumper: pid 4086 executable dumper0 version 9.8.7
+dumper: pid 4095 executable dumper3 version 9.8.7
+taper: wrote label 'Conf-001'
+driver: result time 1.312 from taper: TAPER-OK worker0
+driver: state time 1.312 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: not-idle
+driver: interface-state time 1.312 if default: free 600
+driver: hdisk-state time 1.312 hdisk 0: free 868352 dumpers 0
+driver: flush size 0
+driver: started chunker0 pid 4129
+driver: send-cmd time 1.314 to chunker0: START 20080618130147
+driver: send-cmd time 1.314 to chunker0: PORT-WRITE 00-00001 /holding/20080618130147/clienthost._some_dir.0 clienthost ffffffff9ffeffffffff1f /some/dir 0 1970:1:1:0:0:0 1048576 GNUTAR 192 |;auth=local;index;
+chunker: pid 4129 executable chunker0 version 9.8.7
+driver: result time 1.330 from chunker0: PORT 1487
+driver: send-cmd time 1.330 to dumper0: PORT-DUMP 00-00001 1487 clienthost ffffffff9ffeffffffff1f /some/dir NODEVICE 0 1970:1:1:0:0:0 GNUTAR X amanda X local |"  <auth>local</auth>\n  <record>YES</record>\n  <index>YES</index>\n"
+driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.408 if default: free 0
+driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1
+driver: result time 6.408 from dumper0: DONE 00-00001 100 100 0 "[sec 0.012 kb 100 kps 7915.1 orig-kb 100]"
+driver: finished-cmd time 6.408 dumper0 dumped clienthost:/some/dir
+driver: send-cmd time 6.408 to chunker0: DONE 00-00001
+driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.408 if default: free 0
+driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1
+driver: result time 6.408 from chunker0: DONE 00-00001 100 "[sec 5.075 kb 100 kps 26.0]"
+driver: finished-cmd time 6.408 chunker0 chunked clienthost:/some/dir
+driver: send-cmd time 6.410 to taper: FILE-WRITE worker0 00-00002 /holding/20080618130147/clienthost._some_dir.0 clienthost /some/dir 0 20080618130147 0
+driver: startaflush: FIRST clienthost /some/dir 132 102400
+driver: state time 6.410 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.410 if default: free 600
+driver: hdisk-state time 6.410 hdisk 0: free 868220 dumpers 0
+driver: result time 6.411 from taper: REQUEST-NEW-TAPE 00-00002
+driver: send-cmd time 6.411 to taper: NEW-TAPE worker0 00-00002
+driver: state time 6.412 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.412 if default: free 600
+driver: hdisk-state time 6.412 hdisk 0: free 868220 dumpers 0
+driver: result time 6.412 from taper: NEW-TAPE 00-00002 Conf-001
+driver: state time 6.414 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.414 if default: free 600
+driver: hdisk-state time 6.414 hdisk 0: free 868220 dumpers 0
+driver: result time 6.415 from taper: PARTDONE 00-00002 Conf-001 1 100 "[sec 0.001177 kb 100 kps 84961.767205]"
+driver: state time 6.415 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.415 if default: free 600
+driver: hdisk-state time 6.415 hdisk 0: free 868220 dumpers 0
+driver: result time 6.415 from taper: DONE 00-00002 INPUT-GOOD TAPE-GOOD "[sec 0.001177 kb 100 kps 84961.767205]" "" ""
+driver: finished-cmd time 6.415 taper wrote clienthost:/some/dir
+driver: state time 6.415 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.415 if default: free 600
+driver: hdisk-state time 6.415 hdisk 0: free 868352 dumpers 0
+driver: QUITTING time 6.415 telling children to quit
+driver: send-cmd time 6.415 to dumper0: QUIT
+driver: send-cmd time 6.415 to dumper1: QUIT
+driver: send-cmd time 6.417 to dumper2: QUIT
+driver: send-cmd time 6.417 to dumper3: QUIT
+driver: send-cmd time 6.418 to taper: QUIT
+taper: DONE
+driver: FINISHED time 7.426
+amdump: end at Wed Jun 18 13:01:55 EDT 2008
+
+%T postscript
+--PS-TEMPLATE--
+(February 25, 2009) DrawDate
+\
+(Amanda Version x.y.z) DrawVers
+(DIRO-TEST-003) DrawTitle
+(Total Size:        1339591.9 MB) DrawStat
+(Tape Used (%)       ##### %) DrawStat
+(Number of files:      9) DrawStat
+(Filesystems Taped:    9) DrawStat
+(-) (DIRO-TEST-003) (-) (  0) (      32) (      32) DrawHost
+(localhost.localdomain) (/boot1) (0) (  1) (      16) (      12) DrawHost
+(localhost.localdomain) (/boot2) (0) (  2) (     167) (     123) DrawHost
+(localhost.localdomain) (/boot3) (0) (  3) (    1678) (    1234) DrawHost
+(localhost.localdomain) (/boot4) (0) (  4) (   16789) (   12345) DrawHost
+(localhost.localdomain) (/boot5) (0) (  5) (  167890) (  123456) DrawHost
+(localhost.localdomain) (/boot6) (0) (  6) ( 1678901) ( 1234567) DrawHost
+(localhost.localdomain) (/boot7) (0) (  7) (16789012) (12345678) DrawHost
+(localhost.localdomain) (/boot8) (0) (  8) (167890123) (123456789) DrawHost
+(localhost.localdomain) (/boot9) (0) (  9) (1678901234) (1234567890) DrawHost
+\
+showpage
+
+# several versions of the report, with different colspec options
+
+%T rpt1
+Hostname: localhost.localdomain
+Org     : DailySet1
+Config  : TESTCONF
+Date    : February 25, 2009
+
+These dumps were to tape DIRO-TEST-003.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:00
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)      1339591.9   1339591.9        0.0
+Original Size (meg)    1821724.4   1821724.4        0.0
+Avg Compressed Size (%)    73.5       73.5        --
+DLEs Dumped            9          9          0
+Avg Dump Rate (k/s)     #######    #######        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)        1339591.9   1339591.9        0.0
+Tape Used (%)             #####      #####        0.0
+DLEs Taped             9          9          0
+
+Parts Taped                   9          9          0
+Avg Tp Write Rate (k/s) #######    #######        --
+
+USAGE BY TAPE:
+  Label               Time        Size      %  DLEs Parts
+  DIRO-TEST-003       0:00 1371742094k  #####     9     9
+
+\f
+NOTES:
+  taper: tape DIRO-TEST-003 kb 39240 fm 10 [OK]
+
+\f
+DUMP SUMMARY:
+                                          DUMPER STATS                    TAPER STATS
+HOSTNAME     DISK        L    ORIG-kB     OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
+-------------------------- -------------------------------------------- ---------------
+localhost.lo /boot1      0         16         12   75.0    0:02 24748.4   0:00 156611.1
+localhost.lo /boot2      0        167        123   73.7    0:02 24748.4   0:00 156611.1
+localhost.lo /boot3      0       1678       1234   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot4      0      16789      12345   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot5      0     167890     123456   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot6      0    1678901    1234567   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot7      0   16789012   12345678   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot8      0  167890123  123456789   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot9      0 1678901234 1234567890   73.5    0:02 24748.4   0:00 156611.1
+
+(brought to you by Amanda version x.y.z)
+%T rpt2
+Hostname: localhost.localdomain
+Org     : DailySet1
+Config  : TESTCONF
+Date    : February 25, 2009
+
+These dumps were to tape DIRO-TEST-003.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:00
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)      1339591.9   1339591.9        0.0
+Original Size (meg)    1821724.4   1821724.4        0.0
+Avg Compressed Size (%)    73.5       73.5        --
+DLEs Dumped            9          9          0
+Avg Dump Rate (k/s)     #######    #######        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)        1339591.9   1339591.9        0.0
+Tape Used (%)             #####      #####        0.0
+DLEs Taped             9          9          0
+
+Parts Taped                   9          9          0
+Avg Tp Write Rate (k/s) #######    #######        --
+
+USAGE BY TAPE:
+  Label               Time        Size      %  DLEs Parts
+  DIRO-TEST-003       0:00 1371742094k  #####     9     9
+
+\f
+NOTES:
+  taper: tape DIRO-TEST-003 kb 39240 fm 10 [OK]
+
+\f
+DUMP SUMMARY:
+                                            DUMPER STATS                     TAPER STATS
+HOSTNAME     DISK        L       ORIG-kB     OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
+-------------------------- ----------------------------------------------- ---------------
+localhost.lo /boot1      0         16.00         12   75.0    0:02 24748.4   0:00 156611.1
+localhost.lo /boot2      0        167.00        123   73.7    0:02 24748.4   0:00 156611.1
+localhost.lo /boot3      0       1678.00       1234   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot4      0      16789.00      12345   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot5      0     167890.00     123456   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot6      0    1678901.00    1234567   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot7      0   16789012.00   12345678   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot8      0  167890123.00  123456789   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot9      0 1678901234.00 1234567890   73.5    0:02 24748.4   0:00 156611.1
+
+(brought to you by Amanda version x.y.z)
+%T rpt3
+Hostname: localhost.localdomain
+Org     : DailySet1
+Config  : TESTCONF
+Date    : February 25, 2009
+
+These dumps were to tape DIRO-TEST-003.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:00
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)      1339591.9   1339591.9        0.0
+Original Size (meg)    1821724.4   1821724.4        0.0
+Avg Compressed Size (%)    73.5       73.5        --
+DLEs Dumped            9          9          0
+Avg Dump Rate (k/s)     #######    #######        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)        1339591.9   1339591.9        0.0
+Tape Used (%)             #####      #####        0.0
+DLEs Taped             9          9          0
+
+Parts Taped                   9          9          0
+Avg Tp Write Rate (k/s) #######    #######        --
+
+USAGE BY TAPE:
+  Label               Time        Size      %  DLEs Parts
+  DIRO-TEST-003       0:00 1371742094k  #####     9     9
+
+\f
+NOTES:
+  taper: tape DIRO-TEST-003 kb 39240 fm 10 [OK]
+
+\f
+DUMP SUMMARY:
+                                        DUMPER STATS                 TAPER STATS
+HOSTNAME     DISK        L ORIG-kB     OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
+-------------------------- --------------------------------------- ---------------
+localhost.lo /boot1      0    16         12   75.0    0:02 24748.4   0:00 156611.1
+localhost.lo /boot2      0   167        123   73.7    0:02 24748.4   0:00 156611.1
+localhost.lo /boot3      0  1678       1234   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot4      0 16789      12345   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot5      0 167890     123456   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot6      0 1678901    1234567   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot7      0 16789012   12345678   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot8      0 167890123  123456789   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot9      0 1678901234 1234567890   73.5    0:02 24748.4   0:00 156611.1
+
+(brought to you by Amanda version x.y.z)
+%T rpt4
+Hostname: localhost.localdomain
+Org     : DailySet1
+Config  : TESTCONF
+Date    : February 25, 2009
+
+These dumps were to tape DIRO-TEST-003.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:00
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)      1339591.9   1339591.9        0.0
+Original Size (meg)    1821724.4   1821724.4        0.0
+Avg Compressed Size (%)    73.5       73.5        --
+DLEs Dumped            9          9          0
+Avg Dump Rate (k/s)     #######    #######        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)        1339591.9   1339591.9        0.0
+Tape Used (%)             #####      #####        0.0
+DLEs Taped             9          9          0
+
+Parts Taped                   9          9          0
+Avg Tp Write Rate (k/s) #######    #######        --
+
+USAGE BY TAPE:
+  Label               Time        Size      %  DLEs Parts
+  DIRO-TEST-003       0:00 1371742094k  #####     9     9
+
+\f
+NOTES:
+  taper: tape DIRO-TEST-003 kb 39240 fm 10 [OK]
+
+\f
+DUMP SUMMARY:
+                                        DUMPER STATS                 TAPER STATS
+HOSTNAME     DISK        L ORIG-kB     OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
+-------------------------- --------------------------------------- ---------------
+localhost.lo /boot1 0 16.000000 12 75.0 0:02 24748.4 0:00 156611.1
+localhost.lo /boot2 0 167.000000 123 73.7 0:02 24748.4 0:00 156611.1
+localhost.lo /boot3 0 1678.000000 1234 73.5 0:02 24748.4 0:00 156611.1
+localhost.lo /boot4 0 16789.000000 12345 73.5 0:02 24748.4 0:00 156611.1
+localhost.lo /boot5 0 167890.000000 123456 73.5 0:02 24748.4 0:00 156611.1
+localhost.lo /boot6 0 1678901.000000 1234567 73.5 0:02 24748.4 0:00 156611.1
+localhost.lo /boot7 0 16789012.000000 12345678 73.5 0:02 24748.4 0:00 156611.1
+localhost.lo /boot8 0 167890123.000000 123456789 73.5 0:02 24748.4 0:00 156611.1
+localhost.lo /boot9 0 1678901234.000000 1234567890 73.5 0:02 24748.4 0:00 156611.1
+
+(brought to you by Amanda version x.y.z)
+%T rpt5
+Hostname: localhost.localdomain
+Org     : DailySet1
+Config  : TESTCONF
+Date    : February 25, 2009
+
+These dumps were to tape DIRO-TEST-003.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:00
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)      1339591.9   1339591.9        0.0
+Original Size (meg)    1821724.4   1821724.4        0.0
+Avg Compressed Size (%)    73.5       73.5        --
+DLEs Dumped            9          9          0
+Avg Dump Rate (k/s)     #######    #######        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)        1339591.9   1339591.9        0.0
+Tape Used (%)             #####      #####        0.0
+DLEs Taped             9          9          0
+
+Parts Taped                   9          9          0
+Avg Tp Write Rate (k/s) #######    #######        --
+
+USAGE BY TAPE:
+  Label               Time      Size      %  DLEs Parts
+  DIRO-TEST-003       0:00  1339592M  #####     9     9
+
+\f
+NOTES:
+  taper: tape DIRO-TEST-003 kb 39240 fm 10 [OK]
+
+\f
+DUMP SUMMARY:
+                                       DUMPER STATS                 TAPER STATS
+HOSTNAME     DISK        L ORIG-MB  OUT-MB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
+-------------------------- -------------------------------------- ---------------
+localhost.lo /boot1      0       0       0   75.0    0:02 24748.4   0:00 156611.1
+localhost.lo /boot2      0       0       0   73.7    0:02 24748.4   0:00 156611.1
+localhost.lo /boot3      0       2       1   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot4      0      16      12   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot5      0     164     121   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot6      0    1640    1206   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot7      0   16396   12056   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot8      0  163955  120563   73.5    0:02 24748.4   0:00 156611.1
+localhost.lo /boot9      0 1639552 1205633   73.5    0:02 24748.4   0:00 156611.1
+
+(brought to you by Amanda version x.y.z)
diff --git a/installcheck/catalogs/plannerfail.cat b/installcheck/catalogs/plannerfail.cat
new file mode 100644 (file)
index 0000000..dee6e55
--- /dev/null
@@ -0,0 +1,74 @@
+# A complete planner failure
+
+%F log/log
+START planner date 20100313212012
+START driver date 20100313212012
+DISK planner 1.2.3.4 SystemState
+STATS driver hostname advantium
+DISK planner 1.2.3.4 "C:/"
+DISK planner 1.2.3.4 "E:/Replication/Scripts"
+DISK planner 1.2.3.4 "G:/"
+STATS driver startup time 0.051
+INFO dumper dumper pid 11362
+INFO dumper dumper pid 11359
+INFO dumper dumper pid 11360
+INFO dumper dumper pid 11361
+INFO taper taper pid 11358
+INFO taper Will write new label `winsafe-002' to new tape
+FAIL planner 1.2.3.4 "G:/" 20100313212012 0 "[Request to 1.2.3.4 failed: recv error: Connection reset by peer]"
+FAIL planner 1.2.3.4 "E:/Replication/Scripts" 20100313212012 0 "[Request to 1.2.3.4 failed: recv error: Connection reset by peer]"
+FAIL planner 1.2.3.4 "C:/" 20100313212012 0 "[Request to 1.2.3.4 failed: recv error: Connection reset by peer]"
+FAIL planner 1.2.3.4 SystemState 20100313212012 0 "[Request to 1.2.3.4 failed: recv error: Connection reset by peer]"
+FINISH planner date 20100313212012 time 2113.308
+WARNING driver WARNING: got empty schedule from planner
+FINISH driver date 20100313212012 time 2114.332
+
+%T report
+Hostname: advantium
+Org     : DailySet1
+Config  : TESTCONF
+Date    : March 13, 2010
+
+The next tape Amanda expects to use is: 1 new tape.
+FAILURE DUMP SUMMARY:
+  1.2.3.4 SystemState lev 0  FAILED [Request to 1.2.3.4 failed: recv error: Connection reset by peer]
+  1.2.3.4 "C:/" lev 0  FAILED [Request to 1.2.3.4 failed: recv error: Connection reset by peer]
+  1.2.3.4 "E:/Replication/Scripts" lev 0  FAILED [Request to 1.2.3.4 failed: recv error: Connection reset by peer]
+  1.2.3.4 "G:/" lev 0  FAILED [Request to 1.2.3.4 failed: recv error: Connection reset by peer]
+
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)     0:35
+Run Time (hrs:min)          0:35
+Dump Time (hrs:min)         0:00       0:00       0:00
+Output Size (meg)            0.0        0.0        0.0
+Original Size (meg)          0.0        0.0        0.0
+Avg Compressed Size (%)      --         --         --
+DLEs Dumped             0          0          0
+Avg Dump Rate (k/s)          --         --         --
+
+Tape Time (hrs:min)         0:00       0:00       0:00
+Tape Size (meg)              0.0        0.0        0.0
+Tape Used (%)                0.0        0.0        0.0
+DLEs Taped              0          0          0
+Parts Taped                    0          0          0
+Avg Tp Write Rate (k/s)      --         --         --
+
+NOTES:
+  driver: WARNING: got empty schedule from planner
+  taper: Will write new label `winsafe-002' to new tape
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
+-------------------------- ------------------------------------- -------------
+1.2.3.4      "C:/"         FAILED
+1.2.3.4      "-/Scripts"   FAILED
+1.2.3.4      "G:/"         FAILED
+1.2.3.4      SystemState   FAILED
+
+(brought to you by Amanda version x.y.z)
diff --git a/installcheck/catalogs/quoted.cat b/installcheck/catalogs/quoted.cat
new file mode 100644 (file)
index 0000000..7b1f86c
--- /dev/null
@@ -0,0 +1,119 @@
+# an amdump logfile containing lots of quoted strings
+
+%F log/amdump
+amdump: start at Wed Jun 18 13:01:47 EDT 2008
+amdump: datestamp 20080618
+amdump: starttime 20080618130147
+amdump: starttime-locale-independent 2008-06-18 13:01:47 EDT
+planner: pid 4079 executable /path/to/planner version 9.8.7
+READING CONF INFO...
+planner: timestamp 20080618130147
+planner: time 0.000: startup took 0.000 secs
+
+SENDING FLUSHES...
+ENDFLUSH
+
+SETTING UP FOR ESTIMATES...
+planner: time 0.000: setting up estimates for clienthost:"C:\\Some Dir\\"
+clienthost:"C:\\Some Dir\\" overdue 14049 days for level 0
+setup_estimate: clienthost:"C:\\Some Dir\\": command 0, options: none    last_level -1 next_level0 -14049 level_days 0    getting estimates 0 (-2) -1 (-2) -1 (-2)
+planner: time 0.000: setting up estimates took 0.000 secs
+
+GETTING ESTIMATES...
+driver: pid 4080 executable /path/to/driver version 9.8.7
+driver: adding holding disk 0 dir /holding size 868352 chunksize 1048576
+reserving 0 out of 868352 for degraded-mode dumps
+driver: send-cmd time 0.015 to taper: START-TAPER worker0 20080618130147
+taper: pid 4084 executable taper version 9.8.7
+driver: started dumper0 pid 4086
+driver: send-cmd time 0.031 to dumper0: START 20080618130147
+planner: time 0.050: got partial result for host clienthost disk "C:\\Some Dir\\": 0 -> -2K, -1 -> -2K, -1 -> -2K
+dumper: pid 4090 executable dumper1 version 9.8.7
+driver: started dumper1 pid 4090
+driver: send-cmd time 0.046 to dumper1: START 20080618130147
+driver: started dumper2 pid 4094
+driver: send-cmd time 0.048 to dumper2: START 20080618130147
+driver: started dumper3 pid 4095
+driver: send-cmd time 0.059 to dumper3: START 20080618130147
+driver: start time 0.059 inparallel 4 bandwidth 600 diskspace 868352  dir OBSOLETE datestamp 20080618130147 driver: drain-ends tapeq FIRST big-dumpers sssS
+dumper: pid 4094 executable dumper2 version 9.8.7
+planner: time 0.088: got partial result for host clienthost disk "C:\\Some Dir\\": 0 -> 100K, -1 -> -2K, -1 -> -2K
+planner: time 0.091: got result for host clienthost disk "C:\\Some Dir\\": 0 -> 100K, -1 -> -2K, -1 -> -2K
+planner: time 0.091: getting estimates took 0.090 secs
+FAILED QUEUE: empty
+DONE QUEUE:
+  0: clienthost     "C:\\Some Dir\\"
+
+ANALYZING ESTIMATES...
+pondering clienthost:"C:\\Some Dir\\"... next_level0 -14049 last_level -1 (due for level 0) (new disk, can't switch to degraded mode)
+  curr level 0 nsize 100 csize 100 total size 208 total_lev0 100 balanced-lev0size 50
+INITIAL SCHEDULE (size 208):
+  clienthost "C:\\Some Dir\\" pri 14050 lev 0 nsize 100 csize 100
+
+DELAYING DUMPS IF NEEDED, total_size 208, tape length 102400 mark 4
+  delay: Total size now 208.
+
+PROMOTING DUMPS IF NEEDED, total_lev0 100, balanced_size 50...
+planner: time 0.091: analysis took 0.000 secs
+
+GENERATING SCHEDULE:
+--------
+DUMP clienthost ffffffff9ffeffffffff1f "C:\\Some Dir\\" 20080618130147 14050 0 1970:1:1:0:0:0 100 100 0 1024
+--------
+dumper: pid 4086 executable dumper0 version 9.8.7
+dumper: pid 4095 executable dumper3 version 9.8.7
+taper: wrote label 'Conf-001'
+driver: result time 1.312 from taper: TAPER-OK worker0
+driver: state time 1.312 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: not-idle
+driver: interface-state time 1.312 if default: free 600
+driver: hdisk-state time 1.312 hdisk 0: free 868352 dumpers 0
+driver: flush size 0
+driver: started chunker0 pid 4129
+driver: send-cmd time 1.314 to chunker0: START 20080618130147
+driver: send-cmd time 1.314 to chunker0: PORT-WRITE 00-00001 /holding/20080618130147/clienthost._some_dir.0 clienthost ffffffff9ffeffffffff1f "C:\\Some Dir\\" 0 1970:1:1:0:0:0 1048576 GNUTAR 192 |;auth=local;index;
+chunker: pid 4129 executable chunker0 version 9.8.7
+driver: result time 1.330 from chunker0: PORT 1487
+driver: send-cmd time 1.330 to dumper0: PORT-DUMP 00-00001 1487 clienthost ffffffff9ffeffffffff1f "C:\\Some Dir\\" NODEVICE 0 1970:1:1:0:0:0 GNUTAR X amanda X local |"  <auth>local</auth>\n  <record>YES</record>\n  <index>YES</index>\n"
+driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.408 if default: free 0
+driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1
+driver: result time 6.408 from dumper0: DONE 00-00001 100 100 0 "[sec 0.012 kb 100 kps 7915.1 orig-kb 100]"
+driver: finished-cmd time 6.408 dumper0 dumped clienthost:"C:\\Some Dir\\"
+driver: send-cmd time 6.408 to chunker0: DONE 00-00001
+driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.408 if default: free 0
+driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1
+driver: result time 6.408 from chunker0: DONE 00-00001 100 "[sec 5.075 kb 100 kps 26.0]"
+driver: finished-cmd time 6.408 chunker0 chunked clienthost:"C:\\Some Dir\\"
+driver: send-cmd time 6.410 to taper: FILE-WRITE worker0 00-00002 /holding/20080618130147/clienthost._some_dir.0 clienthost "C:\\Some Dir\\" 0 20080618130147 0
+driver: startaflush: FIRST clienthost "C:\\Some Dir\\" 132 102400
+driver: state time 6.410 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.410 if default: free 600
+driver: hdisk-state time 6.410 hdisk 0: free 868220 dumpers 0
+driver: result time 6.411 from taper: REQUEST-NEW-TAPE 00-00002
+driver: send-cmd time 6.411 to taper: NEW-TAPE worker0 00-00002
+driver: state time 6.412 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.412 if default: free 600
+driver: hdisk-state time 6.412 hdisk 0: free 868220 dumpers 0
+driver: result time 6.412 from taper: NEW-TAPE 00-00002 Conf-001
+driver: state time 6.414 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.414 if default: free 600
+driver: hdisk-state time 6.414 hdisk 0: free 868220 dumpers 0
+driver: result time 6.415 from taper: PARTDONE 00-00002 Conf-001 1 100 "[sec 0.001177 kb 100 kps 84961.767205]"
+driver: state time 6.415 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.415 if default: free 600
+driver: hdisk-state time 6.415 hdisk 0: free 868220 dumpers 0
+driver: result time 6.415 from taper: DONE 00-00002 INPUT-GOOD TAPE-GOOD "[sec 0.001177 kb 100 kps 84961.767205]" "" ""
+driver: finished-cmd time 6.415 taper wrote clienthost:"C:\\Some Dir\\"
+driver: state time 6.415 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers
+driver: interface-state time 6.415 if default: free 600
+driver: hdisk-state time 6.415 hdisk 0: free 868352 dumpers 0
+driver: QUITTING time 6.415 telling children to quit
+driver: send-cmd time 6.415 to dumper0: QUIT
+driver: send-cmd time 6.415 to dumper1: QUIT
+driver: send-cmd time 6.417 to dumper2: QUIT
+driver: send-cmd time 6.417 to dumper3: QUIT
+driver: send-cmd time 6.418 to taper: QUIT
+taper: DONE
+driver: FINISHED time 7.426
+amdump: end at Wed Jun 18 13:01:55 EDT 2008
diff --git a/installcheck/catalogs/resultsmissing.cat b/installcheck/catalogs/resultsmissing.cat
new file mode 100644 (file)
index 0000000..a57d482
--- /dev/null
@@ -0,0 +1,94 @@
+# A logfile without dump information for some disks that were planned
+
+%F log/log
+START planner date 20090326001503
+START driver date 20090326001503
+INFO amdump amdump pid 22014
+INFO driver driver pid 22043
+INFO planner planner pid 22042
+DISK planner cnc.slikon.local /boot
+DISK planner cnc.slikon.local /
+INFO taper taper pid 22044
+DISK planner ns-new.slikon.local //usr/local
+DISK planner ns-new.slikon.local /home
+DISK planner ns-new.slikon.local /boot
+FAIL planner ns-new.slikon.local /boot 20090326001503 0 "[planner failed]"
+SUCCESS dumper ns-new.slikon.local //usr/local 20090326001503 0 [sec 0.040 kb 1 kps 24.6 orig-kb 30]
+START taper datestamp 20090326001503 label Daily-36 tape 1
+SUCCESS dumper cnc.slikon.local /boot 20090326001503 0 [sec 4.255 kb 17246 kps 4052.7 orig-kb 20670]
+INFO dumper pid-done 7337
+SUCCESS chunker ns-new.slikon.local //usr/local 20090326001503 0 [sec 1.109 kb 1 kps 29.8]
+SUCCESS chunker cnc.slikon.local /boot 20090326001503 0 [sec 10.093 kb 17246 kps 1711.9]
+STATS driver estimate ns-new.slikon.local //usr/local 20090326001503 0 [sec 1 nkb 62 ckb 64 kps 1]
+INFO chunker pid-done 7334
+STATS driver estimate cnc.slikon.local /boot 20090326001503 0 [sec 2 nkb 20702 ckb 17280 kps 5749]
+PART taper Daily-36 1 cnc.slikon.local /boot 20090326001503 1/1 0 [sec 0.742831 kb 17245 kps 23216.462699]
+DONE taper cnc.slikon.local /boot 20090326001503 1 0 [sec 0.742831 kb 17245 kps 23216.462699]
+PART taper Daily-36 2 ns-new.slikon.local //usr/local 20090326001503 1/1 0 [sec 0.004696 kb 1 kps 153.471705]
+DONE taper ns-new.slikon.local //usr/local 20090326001503 1 0 [sec 0.004696 kb 1 kps 153.471705]
+INFO taper pid-done 22044
+FINISH driver date 20090326001503 time 77506.015
+INFO driver pid-done 22043
+
+%T report
+These dumps were to tape Daily-36.
+The next tape Amanda expects to use is: 1 new tape.
+
+FAILURE DUMP SUMMARY:
+   cnc.slikon.local    /      RESULTS MISSING
+   ns-new.slikon.local /home  RESULTS MISSING
+   ns-new.slikon.local /boot  lev 0 FAILED [planner failed]
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)        21:32
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)          16.8       16.8        0.0
+Original Size (meg)        20.2       20.2        0.0
+Avg Compressed Size (%)    83.3       83.3        --
+DLEs Dumped            2          2          0
+Avg Dump Rate (k/s)      4015.6     4015.6        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)            16.8       16.8        0.0
+Tape Used (%)              56.2       56.2        0.0
+DLEs Taped             2          2          0
+
+Parts Taped                   2          2          0
+Avg Tp Write Rate (k/s) 23070.7    23070.7        --
+
+USAGE BY TAPE:
+  Label          Time      Size      %  DLEs Parts
+  Daily-36       0:00    17246k   56.2     2     2
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
+-------------------------- ------------------------------------- --------------
+cnc.slikon.l /             MISSING --------------------------------------------
+cnc.slikon.l /boot       0   20670   17245   83.4    0:04 4052.7   0:01 23216.5
+ns-new.sliko //usr/local 0      30       1    3.3    0:00   24.6   0:00   153.5
+ns-new.sliko /boot         FAILED
+ns-new.sliko /home         MISSING --------------------------------------------
+
+(brought to you by Amanda version x.y.z)
+
+%T postscript
+--PS-TEMPLATE--
+(March 26, 2009) DrawDate
+\
+(Amanda Version 2.6.2alpha) DrawVers
+(Daily-36) DrawTitle
+(Total Size:          16.8 MB) DrawStat
+(Tape Used (%)        56.2 %) DrawStat
+(Number of files:      2) DrawStat
+(Filesystems Taped:    2) DrawStat
+(-) (Daily-36) (-) (  0) (      32) (      32) DrawHost
+(cnc.slikon.local) (/boot) (0) (  1) (   20670) (   17245) DrawHost
+(ns-new.slikon.local) (//usr/local) (0) (  2) (      30) (       1) DrawHost
+\
+showpage
diff --git a/installcheck/catalogs/retried-nofinish.cat b/installcheck/catalogs/retried-nofinish.cat
new file mode 100644 (file)
index 0000000..0e477e0
--- /dev/null
@@ -0,0 +1,73 @@
+# like retried, but without the FINISH driver line
+
+%F log/log
+START planner date 20090326001503
+START driver date 20090326001503
+INFO amdump amdump pid 22014
+INFO driver driver pid 22043
+INFO planner planner pid 22042
+START taper datestamp 20090326001503 label Daily-36 tape 1
+DISK planner jamon.slikon.local /var
+WARNING planner disk jamon.slikon.local:/var, estimate of level 1 failed.
+FAIL dumper jamon.slikon.local /var 20090326001503 0 [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326133640000.debug]
+  blah blah blah
+PARTIAL chunker jamon.slikon.local /var 20090326001503 0 [sec 64.950 kb 268358 kps 4132.2]
+SUCCESS dumper jamon.slikon.local /var 20090326001503 0 [sec 53.356 kb 268357 kps 5029.5 orig-kb 2985670]
+SUCCESS chunker jamon.slikon.local /var 20090326001503 0 [sec 58.396 kb 268357 kps 4596.0]
+STATS driver estimate jamon.slikon.local /var 20090326001503 0 [sec 62 nkb 2950092 ckb 266528 kps 4294]
+PART taper Daily-36 1 jamon.slikon.local /var 20090326001503 1/1 0 [sec 15.589804 kb 268356 kps 17213.595632]
+DONE taper jamon.slikon.local /var 20090326001503 1 0 [sec 15.589804 kb 268356 kps 17213.595632]
+
+%T report
+*** THE DUMPS DID NOT FINISH PROPERLY!
+These dumps were to tape Daily-36.
+The next tape Amanda expects to use is: 1 new tape.
+
+FAILURE DUMP SUMMARY:
+   jamon.slikon.local /var lev 0  FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326133640000.debug]
+   jamon.slikon.local /var lev 0  was successfully retried
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:00
+Dump Time (hrs:min)        0:01       0:01       0:00
+Output Size (meg)         524.1      524.1        0.0
+Original Size (meg)      2915.7     2915.7        0.0
+Avg Compressed Size (%)    18.0       18.0        --
+DLEs Dumped            1          1          0
+Avg Dump Rate (k/s)     10059.1    10059.1        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)           262.1      262.1        0.0
+Tape Used (%)             873.6      873.6        0.0
+DLEs Taped             1          1          0
+
+Parts Taped                   1          1          0
+Avg Tp Write Rate (k/s) 17213.6    17213.6        --
+
+USAGE BY TAPE:
+  Label           Time     Size      %  DLEs Parts
+  Daily-36       0:00   268356k  873.6     1     1
+
+
+FAILED DUMP DETAILS:
+
+/--  jamon.slikon.local /var lev 0 FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326133640000.debug]
+blah blah blah
+\\--------
+
+
+NOTES:
+  planner: disk jamon.slikon.local:/var, estimate of level 1 failed.
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
+-------------------------- ------------------------------------- --------------
+jamon.slikon /var        0 2985670  268356    9.0    0:53 5029.5   0:16 17213.6
+
+(brought to you by Amanda version x.y.z)
diff --git a/installcheck/catalogs/retried-strange.cat b/installcheck/catalogs/retried-strange.cat
new file mode 100644 (file)
index 0000000..6286eb8
--- /dev/null
@@ -0,0 +1,141 @@
+# a dump was retreid in this logfile
+
+%F log/log
+START planner date 20100824181503
+START driver date 20100824181503
+STATS driver hostname molybdenum.zmanda.com
+DISK planner lead.zmanda.com /tensile-measurements
+INFO dumper dumper pid 4942
+INFO dumper dumper pid 4945
+INFO dumper dumper pid 4943
+INFO dumper dumper pid 4944
+STATS driver startup time 1.328
+INFO taper taper pid 4941
+FINISH planner date 20100824181503 time 1053.509
+INFO planner pid-done 4939
+INFO chunker chunker pid 20113
+INFO dumper gzip pid 20114
+INFO dumper gzip pid 20115
+INFO dumper pid-done 20115
+PARTIAL chunker lead.zmanda.com /tensile-measurements 20100824181503 0 [sec 43165.756 kb 207921840 kps 4817.0]
+INFO chunker pid-done 20113
+INFO dumper pid-done 20114
+FAIL dumper lead.zmanda.com /tensile-measurements 20100824181503 0 [data read: recv error: Connection timed out]
+  sendbackup: info BACKUP=APPLICATION
+  sendbackup: info APPLICATION=amgtar
+  sendbackup: info RECOVER_CMD=/usr/lib64/amanda/application/amgtar restore [./file-to-restore]+
+  sendbackup: info COMPRESS_SUFFIX=.gz
+  sendbackup: info end
+INFO chunker chunker pid 15112
+INFO dumper gzip pid 15113
+INFO dumper gzip pid 15114
+STRANGE dumper lead.zmanda.com /tensile-measurements 0 [sec 49067.760 kb 539140000 kps 10987.7 orig-kb 539140000]
+  sendbackup: info BACKUP=APPLICATION
+  sendbackup: info APPLICATION=amgtar
+  sendbackup: info RECOVER_CMD=/usr/lib64/amanda/application/amgtar restore [./file-to-restore]+
+  sendbackup: info COMPRESS_SUFFIX=.gz
+  sendbackup: info end
+  ? /bin/tar: ./foundry.mpg: file changed as we read it
+SUCCESS chunker lead.zmanda.com /tensile-measurements 20100824181503 0 [sec 49068.101 kb 258237054 kps 5263.0]
+INFO chunker pid-done 15112
+INFO dumper pid-done 15113
+INFO dumper pid-done 15114
+STATS driver estimate lead.zmanda.com /tensile-measurements 20100824181503 0 [sec 51455 nkb 537755342 ckb 262506912 kps 5102]
+START taper datestamp 20100824181503 label metals-003-000105 tape 1
+PART taper metals-003-000105 1 lead.zmanda.com /tensile-measurements 20100824181503 1/-1 0 [sec 272.900788 kb 20971520 kps 76846.681733 orig-kb 539140000]
+PART taper metals-003-000105 2 lead.zmanda.com /tensile-measurements 20100824181503 2/-1 0 [sec 277.041222 kb 20971520 kps 75698.193390 orig-kb 539140000]
+PART taper metals-003-000105 3 lead.zmanda.com /tensile-measurements 20100824181503 3/-1 0 [sec 273.880014 kb 20971520 kps 76571.925398 orig-kb 539140000]
+PART taper metals-003-000105 4 lead.zmanda.com /tensile-measurements 20100824181503 4/-1 0 [sec 276.668545 kb 20971520 kps 75800.160080 orig-kb 539140000]
+PART taper metals-003-000105 5 lead.zmanda.com /tensile-measurements 20100824181503 5/-1 0 [sec 275.720200 kb 20971520 kps 76060.876207 orig-kb 539140000]
+PART taper metals-003-000105 6 lead.zmanda.com /tensile-measurements 20100824181503 6/-1 0 [sec 295.455832 kb 20971520 kps 70980.220150 orig-kb 539140000]
+PART taper metals-003-000105 7 lead.zmanda.com /tensile-measurements 20100824181503 7/-1 0 [sec 274.582232 kb 20971520 kps 76376.099966 orig-kb 539140000]
+PART taper metals-003-000105 8 lead.zmanda.com /tensile-measurements 20100824181503 8/-1 0 [sec 271.353809 kb 20971520 kps 77284.782098 orig-kb 539140000]
+PART taper metals-003-000105 9 lead.zmanda.com /tensile-measurements 20100824181503 9/-1 0 [sec 271.368039 kb 20971520 kps 77280.729438 orig-kb 539140000]
+PART taper metals-003-000105 10 lead.zmanda.com /tensile-measurements 20100824181503 10/-1 0 [sec 281.441637 kb 20971520 kps 74514.631963 orig-kb 539140000]
+PART taper metals-003-000105 11 lead.zmanda.com /tensile-measurements 20100824181503 11/-1 0 [sec 271.238315 kb 20971520 kps 77317.690165 orig-kb 539140000]
+PART taper metals-003-000105 12 lead.zmanda.com /tensile-measurements 20100824181503 12/-1 0 [sec 271.243204 kb 20971520 kps 77316.296559 orig-kb 539140000]
+PART taper metals-003-000105 13 lead.zmanda.com /tensile-measurements 20100824181503 13/-1 0 [sec 88.135554 kb 6578813 kps 74644.257640 orig-kb 539140000]
+DONE taper lead.zmanda.com /tensile-measurements 20100824181503 13 0 [sec 3436.000000 kb 258237053 kps 75156.301804 orig-kb 539140000]
+INFO taper tape metals-003-000105 kb 258237053 fm 13 [OK]
+INFO dumper pid-done 4943
+INFO dumper pid-done 4945
+INFO dumper pid-done 4944
+INFO dumper pid-done 4942
+INFO taper pid-done 4941
+FINISH driver date 20100824181503 time 97784.977
+INFO driver pid-done 4940
+
+%T report
+Hostname: molybdenum.zmanda.com
+Org     : DailySet1
+Config  : TESTCONF
+Date    : August 24, 2010
+
+These dumps were to tape metals-003-000105.
+The next tape Amanda expects to use is: 1 new tape.
+
+FAILURE DUMP SUMMARY:
+   lead.zmanda.com /tensile-measurements lev 0  FAILED [data read: recv error: Connection timed out]
+   lead.zmanda.com /tensile-measurements lev 0  was successfully retried
+
+STRANGE DUMP SUMMARY:
+   lead.zmanda.com /tensile-measurements lev 0  STRANGE (see below)
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:18
+Run Time (hrs:min)        27:10
+Dump Time (hrs:min)       13:38      13:38       0:00
+Output Size (meg)      455233.3   455233.3        0.0
+Original Size (meg)    526503.9   526503.9        0.0
+Avg Compressed Size (%)    86.5       86.5        --
+DLEs Dumped            1          1          0
+Avg Dump Rate (k/s)      9500.3     9500.3        --
+
+Tape Time (hrs:min)        0:57       0:57       0:00
+Tape Size (meg)        252184.6   252184.6        0.0
+Tape Used (%)             #####      #####        0.0
+DLEs Taped             1          1          0
+
+Parts Taped                  13         13          0
+Avg Tp Write Rate (k/s) 75156.3    75156.3        --
+
+USAGE BY TAPE:
+  Label                      Time      Size      %    DLEs    Parts
+  metals-003-000105       0:57      258237053k  #####     1    13
+
+\f
+FAILED DUMP DETAILS:
+
+/--  lead.zmanda.com /tensile-measurements lev 0 FAILED [data read: recv error: Connection timed out]
+sendbackup: info BACKUP=APPLICATION
+sendbackup: info APPLICATION=amgtar
+sendbackup: info RECOVER_CMD=/usr/lib64/amanda/application/amgtar restore [./file-to-restore]+
+sendbackup: info COMPRESS_SUFFIX=.gz
+sendbackup: info end
+\\--------
+
+\f
+STRANGE DUMP DETAILS:
+
+/--  lead.zmanda.com /tensile-measurements lev 0 STRANGE
+sendbackup: info BACKUP=APPLICATION
+sendbackup: info APPLICATION=amgtar
+sendbackup: info RECOVER_CMD=/usr/lib64/amanda/application/amgtar restore [./file-to-restore]+
+sendbackup: info COMPRESS_SUFFIX=.gz
+sendbackup: info end
+? /bin/tar: ./foundry.mpg: file changed as we read it
+\\--------
+
+NOTES:
+  taper: tape metals-003-000105 kb 258237053 fm 13 [OK]
+
+DUMP SUMMARY:
+                                       DUMPER STATS                TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS    KB/s MMM:SS    KB/s
+-------------------------- ------------------------------------------ --------------
+lead.zmanda. -asurements 0 539140000 258237053 47.9 817:48 10987.7 57:16 75156.3
+
+(brought to you by Amanda version x.y.z)
diff --git a/installcheck/catalogs/retried.cat b/installcheck/catalogs/retried.cat
new file mode 100644 (file)
index 0000000..cf5ad06
--- /dev/null
@@ -0,0 +1,88 @@
+# a dump was retreid in this logfile
+
+%F log/log
+START planner date 20090326001503
+START driver date 20090326001503
+INFO amdump amdump pid 22014
+INFO driver driver pid 22043
+INFO planner planner pid 22042
+START taper datestamp 20090326001503 label Daily-36 tape 1
+DISK planner jamon.slikon.local /var
+WARNING planner disk jamon.slikon.local:/var, estimate of level 1 failed.
+FAIL dumper jamon.slikon.local /var 20090326001503 0 [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326133640000.debug]
+  blah blah blah
+PARTIAL chunker jamon.slikon.local /var 20090326001503 0 [sec 64.950 kb 268358 kps 4132.2]
+SUCCESS dumper jamon.slikon.local /var 20090326001503 0 [sec 53.356 kb 268357 kps 5029.5 orig-kb 2985670]
+SUCCESS chunker jamon.slikon.local /var 20090326001503 0 [sec 58.396 kb 268357 kps 4596.0]
+STATS driver estimate jamon.slikon.local /var 20090326001503 0 [sec 62 nkb 2950092 ckb 266528 kps 4294]
+PART taper Daily-36 1 jamon.slikon.local /var 20090326001503 1/1 0 [sec 15.589804 kb 268356 kps 17213.595632]
+DONE taper jamon.slikon.local /var 20090326001503 1 0 [sec 15.589804 kb 268356 kps 17213.595632]
+FINISH driver date 20090326001503 time 77506.015
+
+%T report
+These dumps were to tape Daily-36.
+The next tape Amanda expects to use is: 1 new tape.
+
+FAILURE DUMP SUMMARY:
+   jamon.slikon.local /var lev 0  FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326133640000.debug]
+   jamon.slikon.local /var lev 0  was successfully retried
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)        21:32
+Dump Time (hrs:min)        0:01       0:01       0:00
+Output Size (meg)         524.1      524.1        0.0
+Original Size (meg)      2915.7     2915.7        0.0
+Avg Compressed Size (%)    18.0       18.0        --
+DLEs Dumped            1          1          0
+Avg Dump Rate (k/s)     10059.1    10059.1        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)           262.1      262.1        0.0
+Tape Used (%)             873.6      873.6        0.0
+DLEs Taped             1          1          0
+
+Parts Taped                   1          1          0
+Avg Tp Write Rate (k/s) 17213.6    17213.6        --
+
+USAGE BY TAPE:
+  Label           Time     Size      %  DLEs Parts
+  Daily-36       0:00   268356k  873.6     1     1
+
+
+FAILED DUMP DETAILS:
+
+/--  jamon.slikon.local /var lev 0 FAILED [/bin/tar exited with status 2: see /var/log/amanda/client/Daily/amgtar.20090326133640000.debug]
+blah blah blah
+\\--------
+
+
+NOTES:
+  planner: disk jamon.slikon.local:/var, estimate of level 1 failed.
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
+-------------------------- ------------------------------------- --------------
+jamon.slikon /var        0 2985670  268356    9.0    0:53 5029.5   0:16 17213.6
+
+(brought to you by Amanda version x.y.z)
+
+%T postscript
+--PS-TEMPLATE--
+(March 26, 2009) DrawDate
+\
+(Amanda Version 2.6.2alpha) DrawVers
+(Daily-36) DrawTitle
+(Total Size:         262.1 MB) DrawStat
+(Tape Used (%)       873.6 %) DrawStat
+(Number of files:      1) DrawStat
+(Filesystems Taped:    1) DrawStat
+(-) (Daily-36) (-) (  0) (      32) (      32) DrawHost
+(jamon.slikon.local) (/var) (0) (  1) ( 2985670) (  268356) DrawHost
+\
+showpage
diff --git a/installcheck/catalogs/shortstrange.cat b/installcheck/catalogs/shortstrange.cat
new file mode 100644 (file)
index 0000000..5c529c4
--- /dev/null
@@ -0,0 +1,106 @@
+# a logfile with some STRANGE output .. but not too much of it
+
+%F log/log
+START planner date 20090326001503
+START driver date 20090326001503
+INFO amdump amdump pid 22014
+INFO driver driver pid 22043
+INFO planner planner pid 22042
+DISK planner bsdfw.slikon.local /
+START taper datestamp 20090326001503 label Daily-36 tape 1
+STRANGE dumper bsdfw.slikon.local / 0 [sec 1775.514 kb 2317814 kps 1305.4 orig-kb 5401240]
+  sendbackup: info BACKUP=APPLICATION
+  sendbackup: info APPLICATION=amgtar
+  sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
+  sendbackup: info COMPRESS_SUFFIX=.gz
+  sendbackup: info end
+  | /bin/tar: ./tmp/.gdm_socket: socket ignored
+  | /bin/tar: ./tmp/.X11-unix/X0: socket ignored
+  | /bin/tar: ./tmp/.font-unix/fs7100: socket ignored
+  ? /bin/tar: ./var/log/messages: file changed as we read it
+  | /bin/tar: ./var/run/acpid.socket: socket ignored
+  | /bin/tar: ./var/run/dbus/system_bus_socket: socket ignored
+  | Total bytes written: 5530869760 (5.2GiB, 3.0MiB/s)
+  sendbackup: size 5401240
+  sendbackup: end
+SUCCESS chunker bsdfw.slikon.local / 20090326001503 0 [sec 1782.341 kb 2293471 kps 1286.8]
+STATS driver estimate bsdfw.slikon.local / 20090326001503 0 [sec 1715 nkb 5400282 ckb 2294272 kps 1337]
+PART taper Daily-36 1 bsdfw.slikon.local / 20090326001503 1/1 0 [sec 157.123731 kb 2293470 kps 14596.586283]
+DONE taper bsdfw.slikon.local / 20090326001503 1 0 [sec 157.123731 kb 2293470 kps 14596.586283]
+FINISH driver date 20090326001503 time 77506.015
+
+%T report
+These dumps were to tape Daily-36.
+The next tape Amanda expects to use is: 1 new tape.
+
+STRANGE DUMP SUMMARY:
+   bsdfw.slikon.local / lev 0  STRANGE (see below)
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)        21:32
+Dump Time (hrs:min)        0:30       0:30       0:00
+Output Size (meg)        2239.7     2239.7        0.0
+Original Size (meg)      5274.6     5274.6        0.0
+Avg Compressed Size (%)    42.5       42.5        --
+DLEs Dumped            1          1          0
+Avg Dump Rate (k/s)      1291.7     1291.7        --
+
+Tape Time (hrs:min)        0:03       0:03       0:00
+Tape Size (meg)          2239.7     2239.7        0.0
+Tape Used (%)              7466       7466        0.0
+DLEs Taped             1          1          0
+
+Parts Taped                   1          1          0
+Avg Tp Write Rate (k/s) 14596.6    14596.6        --
+
+USAGE BY TAPE:
+  Label          Time      Size      %  DLEs Parts
+  Daily-36       0:03  2293470k   7466     1     1
+
+
+STRANGE DUMP DETAILS:
+
+/--  bsdfw.slikon.local / lev 0 STRANGE
+sendbackup: info BACKUP=APPLICATION
+sendbackup: info APPLICATION=amgtar
+sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
+sendbackup: info COMPRESS_SUFFIX=.gz
+sendbackup: info end
+| /bin/tar: ./tmp/.gdm_socket: socket ignored
+| /bin/tar: ./tmp/.X11-unix/X0: socket ignored
+| /bin/tar: ./tmp/.font-unix/fs7100: socket ignored
+? /bin/tar: ./var/log/messages: file changed as we read it
+| /bin/tar: ./var/run/acpid.socket: socket ignored
+| /bin/tar: ./var/run/dbus/system_bus_socket: socket ignored
+| Total bytes written: 5530869760 (5.2GiB, 3.0MiB/s)
+sendbackup: size 5401240
+sendbackup: end
+\\--------
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
+-------------------------- ------------------------------------- --------------
+bsdfw.slikon /           0 5401240 2293470   42.5   29:36 1305.4   2:37 14596.6
+
+(brought to you by Amanda version x.y.z)
+
+%T postscript
+--PS-TEMPLATE--
+(March 26, 2009) DrawDate
+\
+(Amanda Version 2.6.2alpha) DrawVers
+(Daily-36) DrawTitle
+(Total Size:        2239.7 MB) DrawStat
+(Tape Used (%)        7466 %) DrawStat
+(Number of files:      1) DrawStat
+(Filesystems Taped:    1) DrawStat
+(-) (Daily-36) (-) (  0) (      32) (      32) DrawHost
+(bsdfw.slikon.local) (/) (0) (  1) ( 5401240) ( 2293470) DrawHost
+\
+showpage
diff --git a/installcheck/catalogs/skipped.cat b/installcheck/catalogs/skipped.cat
new file mode 100644 (file)
index 0000000..314b068
--- /dev/null
@@ -0,0 +1,52 @@
+# planner skips a dump
+
+%F log/log
+START planner date 20090326001503
+START driver date 20090326001503
+INFO amdump amdump pid 22014
+INFO driver driver pid 22043
+INFO planner planner pid 22042
+INFO taper taper pid 22044
+DISK planner ns-new.slikon.local /boot
+SUCCESS planner ns-new.slikon.local /boot 20090326001503 1 "[skipped: skip-incr]"
+START taper datestamp 20090326001503 label Daily-36 tape 1
+INFO dumper pid-done 7337
+FINISH driver date 20090326001503 time 77506.015
+INFO driver pid-done 22043
+
+%T report
+These dumps were to tape Daily-36.
+The next tape Amanda expects to use is: 1 new tape.
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)        21:32
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)           0.0        0.0        0.0
+Original Size (meg)         0.0        0.0        0.0
+Avg Compressed Size (%)     --         --         --
+DLEs Dumped            0          0          0
+Avg Dump Rate (k/s)         --         --         --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)             0.0        0.0        0.0
+Tape Used (%)               0.0        0.0        0.0
+DLEs Taped             0          0          0
+
+Parts Taped                   0          0          0
+Avg Tp Write Rate (k/s)     --         --         --
+
+USAGE BY TAPE:
+  Label          Time      Size      %    DLEs Parts
+  Daily-36       0:00        0k    0.0     0     0
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
+-------------------------- ------------------------------------- -------------
+ns-new.sliko /boot         SKIPPED -------------------------------------------
+
+(brought to you by Amanda version x.y.z)
diff --git a/installcheck/catalogs/spanned.cat b/installcheck/catalogs/spanned.cat
new file mode 100644 (file)
index 0000000..9328d6a
--- /dev/null
@@ -0,0 +1,123 @@
+# a dump spanned over two volumes
+
+%F log/log
+INFO amdump amdump pid 30070
+INFO planner planner pid 30091
+START planner date 20100303153307
+DISK planner euclid /A/b/server-src
+INFO driver driver pid 30092
+START driver date 20100303153307
+STATS driver hostname euclid
+INFO dumper dumper pid 30095
+STATS driver startup time 0.044
+INFO dumper dumper pid 30098
+INFO dumper dumper pid 30100
+INFO dumper dumper pid 30099
+INFO taper taper pid 30094
+FINISH planner date 20100303153307 time 5.128
+INFO planner pid-done 30091
+INFO chunker chunker pid 30160
+INFO dumper gzip pid 30164
+SUCCESS dumper euclid /A/b/server-src 20100303153307 0 [sec 0.264 kb 21830 kps 82641.8 orig-kb 21830]
+INFO dumper pid-done 30164
+SUCCESS chunker euclid /A/b/server-src 20100303153307 0 [sec 0.290 kb 21830 kps 75337.9]
+INFO chunker pid-done 30160
+STATS driver estimate euclid /A/b/server-src 20100303153307 0 [sec 21 nkb 21862 ckb 21888 kps 1024]
+START taper datestamp 20100303153307 label Conf-001 tape 1
+PART taper Conf-001 1 euclid /A/b/server-src 20100303153307 1/-1 0 [sec 0.020357 kb 5120 kps 251515.911452 orig-kb 21830]
+PART taper Conf-001 2 euclid /A/b/server-src 20100303153307 2/-1 0 [sec 0.022239 kb 5120 kps 230222.763006 orig-kb 21830]
+PART taper Conf-001 3 euclid /A/b/server-src 20100303153307 3/-1 0 [sec 0.019910 kb 5120 kps 257153.694334 orig-kb 21830]
+PARTPARTIAL taper Conf-001 4 euclid /A/b/server-src 20100303153307 4/-1 0 [sec 0.017390 kb 4960 kps 285216.405648 orig-kb 21830] "No space left on device"
+INFO taper Will request retry of failed split part.
+INFO taper tape Conf-001 kb 15360 fm 4 [OK]
+START taper datestamp 20100303153307 label Conf-002 tape 2
+PART taper Conf-002 1 euclid /A/b/server-src 20100303153307 4/-1 0 [sec 0.022851 kb 5120 kps 224055.372485 orig-kb 21830]
+PART taper Conf-002 2 euclid /A/b/server-src 20100303153307 5/-1 0 [sec 0.004047 kb 1350 kps 333557.846590 orig-kb 21830]
+DONE taper euclid /A/b/server-src 20100303153307 5 0 [sec 0.089405 kb 21830 kps 244169.966680 orig-kb 21830]
+INFO dumper pid-done 30095
+INFO dumper pid-done 30098
+INFO dumper pid-done 30099
+INFO dumper pid-done 30100
+INFO taper tape Conf-002 kb 6470 fm 2 [OK]
+INFO taper pid-done 30094
+FINISH driver date 20100303153307 time 7.391
+INFO driver pid-done 30092
+
+%T report
+Hostname: euclid
+Org     : DailySet1
+Config  : TESTCONF
+Date    : March 3, 2010
+
+These dumps were to tapes Conf-001, Conf-002.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:00
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)          21.3       21.3        0.0
+Original Size (meg)        21.3       21.3        0.0
+Avg Compressed Size (%)   100.0      100.0        --
+DLEs Dumped            1          1          0
+Avg Dump Rate (k/s)     82689.4    82689.4        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)            21.3       21.3        0.0
+Tape Used (%)              71.2       71.2        0.0
+DLEs Taped             1          1          0
+
+Parts Taped                   6          6          0
+Avg Tp Write Rate (k/s)  244170     244170        --
+
+USAGE BY TAPE:
+  Label          Time      Size      %  DLEs Parts
+  Conf-001       0:00    20320k   66.2     1     4
+  Conf-002       0:00     6470k   21.1     0     2
+
+
+NOTES:
+  taper: Will request retry of failed split part.
+  taper: tape Conf-001 kb 15360 fm 4 [OK]
+  taper: tape Conf-002 kb 6470 fm 2 [OK]
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS                 TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
+-------------------------- -------------------------------------- ---------------
+euclid       -server-src 0   21830   21830    --     0:00 82641.8   0:00 244170.0
+
+(brought to you by Amanda version x.y.z)
+
+%T postscript
+--PS-TEMPLATE--
+(March 3, 2010) DrawDate
+\
+(Amanda Version 2.6.2alpha) DrawVers
+(Conf-001) DrawTitle
+(Total Size:          19.8 MB) DrawStat
+(Tape Used (%)        66.2 %) DrawStat
+(Number of files:      4) DrawStat
+(Filesystems Taped:    1) DrawStat
+(-) (Conf-001) (-) (  0) (      32) (      32) DrawHost
+(euclid) (/A/b/server-src) (0) (  1) (   21830) (   20320) DrawHost
+\
+showpage
+--PS-TEMPLATE--
+(March 3, 2010) DrawDate
+\
+(Amanda Version 2.6.2alpha) DrawVers
+(Conf-002) DrawTitle
+(Total Size:           6.3 MB) DrawStat
+(Tape Used (%)        21.1 %) DrawStat
+(Number of files:      2) DrawStat
+(Filesystems Taped:    0) DrawStat
+(-) (Conf-002) (-) (  0) (      32) (      32) DrawHost
+(euclid) (- /A/b/server-src) (0) (  1) (   21830) (    6470) DrawHost
+
+\
+showpage
diff --git a/installcheck/catalogs/strontium.cat b/installcheck/catalogs/strontium.cat
new file mode 100644 (file)
index 0000000..9503a71
--- /dev/null
@@ -0,0 +1,134 @@
+# a "real", but anonymized, logfile without much excitement.  It does have
+# multiple levels, so it checks the summarizing of stats by level
+
+%F log/log
+INFO amdump amdump pid 12920
+INFO planner planner pid 12944
+START planner date 20100107111335
+DISK planner strontium /etc
+DISK planner strontium /local
+DISK planner strontium /home/elantra
+DISK planner strontium /zones/data/strontium.example.com/repositories/repository_13
+INFO driver driver pid 12945
+START driver date 20100107111335
+STATS driver hostname advantium
+STATS driver startup time 0.016
+INFO dumper dumper pid 12947
+INFO dumper dumper pid 12948
+INFO dumper dumper pid 12949
+INFO dumper dumper pid 12950
+INFO taper taper pid 12946
+FINISH planner date 20100107111335 time 2.344
+INFO planner pid-done 12944
+INFO chunker chunker pid 13015
+INFO dumper gzip pid 13016
+SUCCESS dumper strontium /home/elantra 20100107111335 1 [sec 0.152 kb 10 kps 65.6 orig-kb 10]
+SUCCESS chunker strontium /home/elantra 20100107111335 1 [sec 0.184 kb 10 kps 228.0]
+INFO chunker pid-done 13015
+INFO dumper pid-done 13016
+STATS driver estimate strontium /home/elantra 20100107111335 1 [sec 0 nkb 49 ckb 64 kps 1024]
+START taper datestamp 20100107111335 label metals-013 tape 1
+PART taper metals-013 1 strontium /home/elantra 20100107111335 1/1 1 [sec 0.001107 kb 10 kps 9033.423668]
+DONE taper strontium /home/elantra 20100107111335 1 1 [sec 0.001107 kb 10 kps 9033.423668]
+INFO chunker chunker pid 13017
+INFO dumper gzip pid 13018
+SUCCESS dumper strontium /local 20100107111335 0 [sec 0.149 kb 20 kps 133.9 orig-kb 20]
+SUCCESS chunker strontium /local 20100107111335 0 [sec 0.183 kb 20 kps 283.3]
+INFO chunker pid-done 13017
+INFO dumper pid-done 13018
+STATS driver estimate strontium /local 20100107111335 0 [sec 0 nkb 46 ckb 64 kps 1024]
+PART taper metals-013 2 strontium /local 20100107111335 1/1 0 [sec 0.000724 kb 20 kps 27624.309392]
+DONE taper strontium /local 20100107111335 1 0 [sec 0.000724 kb 20 kps 27624.309392]
+INFO chunker chunker pid 13026
+INFO dumper gzip pid 13027
+SUCCESS dumper strontium /etc 20100107111335 1 [sec 0.235 kb 270 kps 1146.3 orig-kb 270]
+SUCCESS chunker strontium /etc 20100107111335 1 [sec 0.271 kb 270 kps 1110.9]
+INFO chunker pid-done 13026
+INFO dumper pid-done 13027
+STATS driver estimate strontium /etc 20100107111335 1 [sec 0 nkb 516 ckb 544 kps 1024]
+PART taper metals-013 3 strontium /etc 20100107111335 1/1 1 [sec 0.001916 kb 270 kps 140918.580376]
+DONE taper strontium /etc 20100107111335 1 1 [sec 0.001916 kb 270 kps 140918.580376]
+INFO chunker chunker pid 13034
+INFO dumper gzip pid 13035
+SUCCESS dumper strontium /zones/data/strontium.example.com/repositories/repository_13 20100107111335 1 [sec 0.525 kb 1350 kps 2568.5 orig-kb 1350]
+SUCCESS chunker strontium /zones/data/strontium.example.com/repositories/repository_13 20100107111335 1 [sec 0.561 kb 1350 kps 2461.3]
+INFO chunker pid-done 13034
+INFO dumper pid-done 13035
+STATS driver estimate strontium /zones/data/strontium.example.com/repositories/repository_13 20100107111335 1 [sec 0 nkb 1344 ckb 1344 kps 1350]
+PART taper metals-013 4 strontium /zones/data/strontium.example.com/repositories/repository_13 20100107111335 1/1 1 [sec 0.007714 kb 1350 kps 175006.481722]
+DONE taper strontium /zones/data/strontium.example.com/repositories/repository_13 20100107111335 1 1 [sec 0.007714 kb 1350 kps 175006.481722]
+INFO dumper pid-done 12947
+INFO dumper pid-done 12948
+INFO dumper pid-done 12949
+INFO dumper pid-done 12950
+INFO taper tape metals-013 kb 1650 fm 4 [OK]
+INFO taper pid-done 12946
+FINISH driver date 20100107111335 time 49.037
+INFO driver pid-done 12945
+
+%T report
+Hostname: advantium
+Org     : DailySet1
+Config  : TESTCONF
+Date    : January 7, 2010
+
+These dumps were to tape metals-013.
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:01
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)           1.6        0.0        1.6
+Original Size (meg)         1.6        0.0        1.6
+Avg Compressed Size (%)   100.0      100.0      100.0
+DLEs Dumped            4          1          3   1:3
+Avg Dump Rate (k/s)      1555.1      134.2     1787.3
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)             1.6        0.0        1.6
+Tape Used (%)              5.5        0.1        5.4
+DLEs Taped             4          1          3   1:3
+Parts Taped                   4          1          3   1:3
+Avg Tp Write Rate (k/s)  143966    27624.3     151811
+
+USAGE BY TAPE:
+  Label            Time      Size      %  DLEs Parts
+  metals-013       0:00     1650k    5.4     4     4
+
+
+NOTES:
+  taper: tape metals-013 kb 1650 fm 4 [OK]
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS                TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS     KB/s
+-------------------------- ------------------------------------- ---------------
+strontium    /etc        1     270     270    --     0:00 1146.3   0:00 140918.6
+strontium    -me/elantra 1      10      10    --     0:00   65.6   0:00   9033.4
+strontium    /local      0      20      20    --     0:00  133.9   0:00  27624.3
+strontium    -ository_13 1    1350    1350    --     0:01 2568.5   0:00 175006.5
+
+(brought to you by Amanda version x.y.z)
+
+%T postscript
+--PS-TEMPLATE--
+(January 7, 2010) DrawDate
+\
+(Amanda Version x.y.z) DrawVers
+(metals-013) DrawTitle
+(Total Size:           1.6 MB) DrawStat
+(Tape Used (%)         5.4 %) DrawStat
+(Number of files:      4) DrawStat
+(Filesystems Taped:    4) DrawStat
+(-) (metals-013) (-) (  0) (      32) (      32) DrawHost
+(strontium) (/home/elantra) (1) (  1) (      10) (      10) DrawHost
+(strontium) (/local) (0) (  2) (      20) (      20) DrawHost
+(strontium) (/etc) (1) (  3) (     270) (     270) DrawHost
+(strontium) (/zones/data/strontium.example.com/repositories/repository_13) (1) (  4) (    1350) (    1350) DrawHost
+\
+showpage
diff --git a/installcheck/catalogs/taperr.cat b/installcheck/catalogs/taperr.cat
new file mode 100644 (file)
index 0000000..28a9110
--- /dev/null
@@ -0,0 +1,118 @@
+# a log with a atpe error in it
+
+# this has two reports - one when this is the "current" logfile, and one when it
+# is a historical logfile
+
+%F log/log
+INFO amdump amdump pid 32302
+INFO planner planner pid 32323
+START planner date 20100303133320
+DISK planner euclid /A/p/etc
+INFO driver driver pid 32324
+START driver date 20100303133320
+STATS driver hostname euclid
+INFO dumper dumper pid 32331
+INFO dumper dumper pid 32337
+STATS driver startup time 0.130
+INFO dumper dumper pid 32338
+INFO dumper dumper pid 32335
+INFO taper taper pid 32326
+ERROR taper no-tape error [Virtual-tape directory /A/p/vtapes does not exist.]
+FINISH planner date 20100303133320 time 1.137
+INFO planner pid-done 32323
+INFO chunker chunker pid 32351
+INFO dumper gzip pid 32355
+SUCCESS dumper euclid /A/p/etc 20100303133320 0 [sec 0.040 kb 100 kps 2491.0 orig-kb 100]
+SUCCESS chunker euclid /A/p/etc 20100303133320 0 [sec 0.064 kb 100 kps 2044.3]
+INFO chunker pid-done 32351
+STATS driver estimate euclid /A/p/etc 20100303133320 0 [sec 0 nkb 132 ckb 160 kps 1024]
+INFO dumper pid-done 32337
+INFO dumper pid-done 32335
+INFO dumper pid-done 32338
+INFO dumper pid-done 32355
+INFO dumper pid-done 32331
+INFO taper pid-done 32326
+FINISH driver date 20100303133320 time 2.247
+INFO driver pid-done 32324
+
+%T report-holding
+Hostname: euclid
+Org     : DailySet1
+Config  : TESTCONF
+Date    : March 3, 2010
+
+*** A TAPE ERROR OCCURRED: [Virtual-tape directory /A/p/vtapes does not exist.].
+No dumps are left in the holding disk.
+
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:00
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)           0.1        0.1        0.0
+Original Size (meg)         0.1        0.1        0.0
+Avg Compressed Size (%)   100.0      100.0        --
+DLEs Dumped            1          1          0
+Avg Dump Rate (k/s)      2500.0     2500.0        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)             0.0        0.0        0.0
+Tape Used (%)               0.0        0.0        0.0
+DLEs Taped             0          0          0
+
+Parts Taped                   0          0          0
+Avg Tp Write Rate (k/s)     --         --         --
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
+-------------------------- ------------------------------------- -------------
+euclid       /A/p/etc    0     100     100    --     0:00 2491.0
+
+(brought to you by Amanda version x.y.z)
+
+%T report-noholding
+Hostname: euclid
+Org     : DailySet1
+Config  : TESTCONF
+Date    : March 3, 2010
+
+*** A TAPE ERROR OCCURRED: [Virtual-tape directory /A/p/vtapes does not exist.].
+Some dumps may have been left in the holding disk.
+
+The next tape Amanda expects to use is: 1 new tape.
+
+
+STATISTICS:
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:00
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)           0.1        0.1        0.0
+Original Size (meg)         0.1        0.1        0.0
+Avg Compressed Size (%)   100.0      100.0        --
+DLEs Dumped            1          1          0
+Avg Dump Rate (k/s)      2500.0     2500.0        --
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)             0.0        0.0        0.0
+Tape Used (%)               0.0        0.0        0.0
+DLEs Taped             0          0          0
+
+Parts Taped                   0          0          0
+Avg Tp Write Rate (k/s)     --         --         --
+
+
+DUMP SUMMARY:
+                                       DUMPER STATS               TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
+-------------------------- ------------------------------------- -------------
+euclid       /A/p/etc    0     100     100    --     0:00 2491.0
+
+(brought to you by Amanda version x.y.z)
diff --git a/installcheck/chunker.pl b/installcheck/chunker.pl
new file mode 100644 (file)
index 0000000..ccafbd7
--- /dev/null
@@ -0,0 +1,600 @@
+# Copyright (c) 2010 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use Test::More tests => 60;
+
+use warnings;
+use strict;
+
+use lib '@amperldir@';
+use Installcheck::Run;
+use Installcheck::Mock;
+use IO::Handle;
+use IPC::Open3;
+use Data::Dumper;
+use IO::Socket::INET;
+use POSIX ":sys_wait_h";
+use Cwd qw(abs_path);
+use File::Path;
+
+use Amanda::Paths;
+use Amanda::Header qw( :constants );
+use Amanda::Debug;
+use Amanda::Holding;
+use Amanda::Util;
+
+# put the debug messages somewhere
+Amanda::Debug::dbopen("installcheck");
+Installcheck::log_test_output();
+
+my $test_hdir = "$Installcheck::TMP/chunker-holding";
+my $test_hfile = "$test_hdir/holder";
+my $chunker_stderr_file = "$Installcheck::TMP/chunker-stderr";
+my $debug = !exists $ENV{'HARNESS_ACTIVE'};
+
+# information on the current run
+my ($datestamp, $handle);
+my ($chunker_pid, $chunker_in, $chunker_out, $last_chunker_reply, $chunker_reply_timeout);
+my $writer_pid;
+
+sub run_chunker {
+    my ($description, %params) = @_;
+
+    cleanup_chunker();
+
+    diag("******** $description") if $debug;
+
+    my $testconf = Installcheck::Run::setup();
+    $testconf->add_param('debug_chunker', 9);
+    $testconf->write();
+
+    if (exists $params{'ENOSPC_at'}) {
+       diag("setting CHUNKER_FAKE_ENOSPC_AT=$params{ENOSPC_at}") if $debug;
+       $ENV{'CHUNKER_FAKE_ENOSPC_AT'} = $params{'ENOSPC_at'};
+    } else {
+       delete $ENV{'CHUNKER_FAKE_ENOSPC'};
+    }
+
+    open(CHUNKER_ERR, ">", $chunker_stderr_file);
+    $chunker_in = $chunker_out = '';
+    $chunker_pid = open3($chunker_in, $chunker_out, ">&CHUNKER_ERR",
+       "$amlibexecdir/chunker", "TESTCONF");
+    close CHUNKER_ERR;
+    $chunker_in->blocking(1);
+    $chunker_out->autoflush();
+
+    pass("spawned new chunker for 'test $description'");
+
+    # define this to get the installcheck to wait and allow you to attach
+    # a gdb instance to the chunker
+    if ($params{'use_gdb'}) {
+       $chunker_reply_timeout = 0; # no timeouts while debugging
+       diag("attach debugger to pid $chunker_pid and press ENTER");
+       <>;
+    } else {
+       $chunker_reply_timeout = 120;
+    }
+
+    chunker_cmd("START $datestamp");
+}
+
+sub wait_for_exit {
+    if ($chunker_pid) {
+       waitpid($chunker_pid, 0);
+       $chunker_pid = undef;
+    }
+}
+
+sub cleanup_chunker {
+    -d $test_hdir and rmtree($test_hdir);
+    mkpath($test_hdir);
+
+    # make a small effort to collect zombies
+    if ($chunker_pid) {
+       if (waitpid($chunker_pid, WNOHANG) == $chunker_pid) {
+           $chunker_pid = undef;
+       }
+    }
+    if ($writer_pid) {
+       if (waitpid($writer_pid, WNOHANG) == $writer_pid) {
+           $writer_pid = undef;
+       }
+    }
+}
+
+sub wait_for_writer {
+    if ($writer_pid) {
+       if (waitpid($writer_pid, 0) == $writer_pid) {
+           $writer_pid = undef;
+       }
+    }
+}
+
+sub chunker_cmd {
+    my ($cmd) = @_;
+
+    diag(">>> $cmd") if $debug;
+    print $chunker_in "$cmd\n";
+}
+
+sub chunker_reply {
+    local $SIG{ALRM} = sub { die "Timeout while waiting for reply\n" };
+    alarm($chunker_reply_timeout);
+    $last_chunker_reply = $chunker_out->getline();
+    alarm(0);
+
+    if (!$last_chunker_reply) {
+       die("wrong pid") unless ($chunker_pid == waitpid($chunker_pid, 0));
+       my $exit_status = $?;
+
+       open(my $fh, "<", $chunker_stderr_file) or die("open $chunker_stderr_file: $!");
+       my $stderr = do { local $/; <$fh> };
+       close($fh);
+
+       diag("chunker stderr:\n$stderr") if $stderr;
+       die("chunker (pid $chunker_pid) died unexpectedly with status $exit_status");
+    }
+
+    # trim trailing whitespace -- C chunker outputs an extra ' ' after
+    # single-word replies
+    $last_chunker_reply =~ s/\s*$//;
+    diag("<<< $last_chunker_reply") if $debug;
+
+    return $last_chunker_reply;
+}
+
+sub check_logs {
+    my ($expected, $msg) = @_;
+    my $re;
+    my $line;
+
+    # must contain a pid line at the beginning and end
+    unshift @$expected, qr/^INFO chunker chunker pid \d+$/;
+    push @$expected, qr/^INFO chunker pid-done \d+$/;
+
+    open(my $logfile, "<", "$CONFIG_DIR/TESTCONF/log/log")
+       or die("opening log: $!");
+    my @logfile = grep(/^\S+ chunker /, <$logfile>);
+    close($logfile);
+
+    while (@logfile and @$expected) {
+       my $logline = shift @logfile;
+       my $expline = shift @$expected;
+       chomp $logline;
+       if ($logline !~ $expline) {
+           like($logline, $expline, $msg);
+           return;
+       }
+    }
+    if (@logfile) {
+       fail("$msg (extra trailing log lines)");
+       return;
+    }
+    if (@$expected) {
+       fail("$msg (logfile ends early)");
+       diag("first missing line should match ");
+       diag("".$expected->[0]);
+       return;
+    }
+
+    pass($msg);
+}
+
+sub check_holding_chunks {
+    my ($filename, $chunks, $host, $disk, $datestamp, $level) = @_;
+
+    my $msg = ".tmp holding chunk files";
+    my $exp_nchunks = @$chunks;
+    my $nchunks = 0;
+    while ($filename) {
+       $nchunks++;
+
+       my $filename_tmp = "$filename.tmp";
+       if (!-f $filename_tmp) {
+           fail($msg);
+           diag("file $filename_tmp doesn't exist");
+           diag(`ls -1l $test_hdir`);
+           return 0;
+       }
+
+       my $fh;
+       open($fh, "<", $filename_tmp) or die("opening $filename_tmp: $!");
+       my $hdr_str = Amanda::Util::full_read(fileno($fh), Amanda::Holding::DISK_BLOCK_BYTES);
+       close($fh);
+
+       my $hdr = Amanda::Header->from_string($hdr_str);
+       my $exp_type = ($nchunks == 1)? $F_DUMPFILE : $F_CONT_DUMPFILE;
+       if ($hdr->{'type'} != $exp_type) {
+           my ($exp, $got) = (Amanda::Header::filetype_t_to_string($exp_type),
+                              Amanda::Header::filetype_t_to_string($hdr->{'type'}));
+           fail($msg);
+           diag("file $filename_tmp has header type $got; expected $exp");
+           return 0;
+       }
+
+       my $ok = 1;
+       $ok &&= $hdr->{'name'} eq $host;
+       $ok &&= $hdr->{'disk'} eq $disk;
+       $ok &&= $hdr->{'datestamp'} eq $datestamp;
+       $ok &&= $hdr->{'dumplevel'} eq $level;
+       if (!$ok) {
+           fail($msg);
+           diag("file $filename_tmp header has unexpected values:\n" . $hdr->summary());
+           return 0;
+       }
+
+       my $data_size = (stat($filename_tmp))[7] - Amanda::Holding::DISK_BLOCK_BYTES;
+       my $exp_size = (shift @$chunks) * 1024;
+       if (defined $exp_size and $exp_size != $data_size) {
+           fail($msg);
+           diag("file $filename_tmp: expected $exp_size bytes, got $data_size");
+           return 0;
+       } # note: if @$exp_chunks is empty, the final is() will catch it
+
+       my $last_filename = $filename;
+       $filename = $hdr->{'cont_filename'};
+       die("header loop!") if $last_filename eq $filename;
+    }
+
+    return is($nchunks, $exp_nchunks, $msg);
+}
+
+sub cleanup_log {
+    my $logfile = "$CONFIG_DIR/TESTCONF/log/log";
+    -f $logfile and unlink($logfile);
+}
+
+# functions to create dumpfiles
+
+sub write_dumpfile_header_to {
+    my ($fh, $size, $hostname, $disk, $expect_failure) = @_;
+
+    my $hdr = Amanda::Header->new();
+    $hdr->{'type'} = $Amanda::Header::F_DUMPFILE;
+    $hdr->{'datestamp'} = $datestamp;
+    $hdr->{'dumplevel'} = 0;
+    $hdr->{'compressed'} = 0;
+    $hdr->{'comp_suffix'} = ".foo";
+    $hdr->{'name'} = $hostname;
+    $hdr->{'disk'} = $disk;
+    $hdr->{'program'} = "INSTALLCHECK";
+    $hdr = $hdr->to_string(Amanda::Holding::DISK_BLOCK_BYTES,
+                          Amanda::Holding::DISK_BLOCK_BYTES);
+
+    $fh->write($hdr);
+}
+
+sub write_dumpfile_data_to {
+    my ($fh, $size, $hostname, $disk, $expect_failure) = @_;
+
+    my $bytes_to_write = $size;
+    my $bufbase = substr((('='x127)."\n".('-'x127)."\n") x 4, 8, -3) . "1K\n";
+    die length($bufbase) unless length($bufbase) == 1024-8;
+    my $k = 0;
+    while ($bytes_to_write > 0) {
+       my $buf = sprintf("%08x", $k++).$bufbase;
+       my $written = $fh->syswrite($buf, $bytes_to_write);
+       if (!defined($written)) {
+           die "writing: $!" unless $expect_failure;
+           exit;
+       }
+       $bytes_to_write -= $written;
+    }
+}
+
+# connect to the given port and write a dumpfile; this *will* create
+# zombies, but it's OK -- installchecks aren't daemons.
+sub write_to_port {
+    my ($port_cmd, $size, $hostname, $disk, $expect_error) = @_;
+
+    my ($header_port, $data_addr) =
+       ($last_chunker_reply =~ /^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+)/);
+
+    # just run this in the child
+    $writer_pid = fork();
+    return unless $writer_pid == 0;
+
+    my $sock = IO::Socket::INET->new(
+       PeerAddr => "127.0.0.1:$header_port",
+       Proto => "tcp",
+       ReuseAddr => 1,
+    );
+
+    write_dumpfile_header_to($sock, $size, $hostname, $disk, $expect_error);
+    close $sock;
+
+    $sock = IO::Socket::INET->new(
+       PeerAddr => $data_addr,
+       Proto => "tcp",
+       ReuseAddr => 1,
+    );
+
+    write_dumpfile_data_to($sock, $size, $hostname, $disk, $expect_error);
+    exit;
+}
+
+########
+
+##
+# A simple, two-chunk PORT-WRITE
+
+$handle = "11-11111";
+$datestamp = "20070102030405";
+run_chunker("simple");
+# note that features (ffff here) and options (ops) are ignored by the chunker
+chunker_cmd("PORT-WRITE $handle \"$test_hfile\" ghost ffff /boot 0 $datestamp 512 INSTALLCHECK 10240 ops");
+like(chunker_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+       "got PORT with data address");
+write_to_port($last_chunker_reply, 700*1024, "ghost", "/boot", 0);
+wait_for_writer();
+chunker_cmd("DONE $handle");
+like(chunker_reply, qr/^DONE $handle 700 "\[sec [\d.]+ kb 700 kps [\d.]+\]"$/,
+       "got DONE") or die;
+wait_for_exit();
+
+check_logs([
+    qr(^SUCCESS chunker ghost /boot $datestamp 0 \[sec [\d.]+ kb 700 kps [\d.]+\]$),
+], "logs correct");
+
+check_holding_chunks($test_hfile, [ 480, 220 ], "ghost", "/boot", $datestamp, 0);
+
+##
+# A two-chunk PORT-WRITE that the dumper flags as a failure, but chunker as PARTIAL
+
+$handle = "22-11111";
+$datestamp = "20080808080808";
+run_chunker("partial");
+chunker_cmd("PORT-WRITE $handle \"$test_hfile\" ghost ffff /root 0 $datestamp 512 INSTALLCHECK 10240 ops");
+like(chunker_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+       "got PORT with data address");
+write_to_port($last_chunker_reply, 768*1024, "ghost", "/root", 0);
+wait_for_writer();
+chunker_cmd("FAILED $handle");
+like(chunker_reply, qr/^PARTIAL $handle 768 "\[sec [\d.]+ kb 768 kps [\d.]+\]"$/,
+       "got PARTIAL") or die;
+wait_for_exit();
+
+check_logs([
+    qr(^PARTIAL chunker ghost /root $datestamp 0 \[sec [\d.]+ kb 768 kps [\d.]+\]$),
+], "logs correct");
+
+check_holding_chunks($test_hfile, [ 480, 288 ], "ghost", "/root", $datestamp, 0);
+
+##
+# A two-chunk PORT-WRITE that the dumper flags as a failure and chunker
+# does too, since no appreciatble bytes were transferred
+
+$handle = "33-11111";
+$datestamp = "20070202020202";
+run_chunker("failed");
+chunker_cmd("PORT-WRITE $handle \"$test_hfile\" ghost ffff /usr 0 $datestamp 512 INSTALLCHECK 10240 ops");
+like(chunker_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+       "got PORT with data address");
+write_to_port($last_chunker_reply, 0, "ghost", "/usr", 0);
+wait_for_writer();
+chunker_cmd("FAILED $handle");
+like(chunker_reply, qr/^FAILED $handle "\[dumper returned FAILED\]"$/,
+       "got FAILED") or die;
+wait_for_exit();
+
+check_logs([
+    qr(^FAIL chunker ghost /usr $datestamp 0 \[dumper returned FAILED\]$),
+], "logs correct");
+
+check_holding_chunks($test_hfile, [ 0 ], "ghost", "/usr", $datestamp, 0);
+
+cleanup_chunker();
+
+##
+# A PORT-WRITE with a USE value smaller than the dump size, but an overly large
+# chunksize
+
+$handle = "44-11111";
+$datestamp = "20040404040404";
+run_chunker("more-than-use");
+chunker_cmd("PORT-WRITE $handle \"$test_hfile\" ghost ffff /var 0 $datestamp 10240 INSTALLCHECK 512 ops");
+like(chunker_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+       "got PORT with data address");
+write_to_port($last_chunker_reply, 700*1024, "ghost", "/var", 1);
+like(chunker_reply, qr/^RQ-MORE-DISK $handle$/,
+       "got RQ-MORE-DISK") or die;
+chunker_cmd("CONTINUE $handle $test_hfile-u2 10240 512");
+wait_for_writer();
+chunker_cmd("DONE $handle");
+like(chunker_reply, qr/^DONE $handle 700 "\[sec [\d.]+ kb 700 kps [\d.]+\]"$/,
+       "got DONE") or die;
+wait_for_exit();
+
+check_logs([
+    qr(^SUCCESS chunker ghost /var $datestamp 0 \[sec [\d.]+ kb 700 kps [\d.]+\]$),
+], "logs correct");
+
+check_holding_chunks($test_hfile, [ 480, 220 ], "ghost", "/var", $datestamp, 0);
+
+##
+# A PORT-WRITE with a USE value smaller than the dump size, and an even smaller
+# chunksize, with a different chunksize on the second holding disk
+
+$handle = "55-11111";
+$datestamp = "20050505050505";
+run_chunker("more-than-use-and-chunks");
+chunker_cmd("PORT-WRITE $handle \"$test_hfile\" ghost ffff /var 0 $datestamp 96 INSTALLCHECK 160 ops");
+like(chunker_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+       "got PORT with data address");
+write_to_port($last_chunker_reply, 400*1024, "ghost", "/var", 1);
+like(chunker_reply, qr/^RQ-MORE-DISK $handle$/,
+       "got RQ-MORE-DISK") or die;
+chunker_cmd("CONTINUE $handle $test_hfile-u2 128 10240");
+wait_for_writer();
+chunker_cmd("DONE $handle");
+like(chunker_reply, qr/^DONE $handle 400 "\[sec [\d.]+ kb 400 kps [\d.]+\]"$/,
+       "got DONE") or die;
+wait_for_exit();
+
+check_logs([
+    qr(^SUCCESS chunker ghost /var $datestamp 0 \[sec [\d.]+ kb 400 kps [\d.]+\]$),
+], "logs correct");
+
+check_holding_chunks($test_hfile, [ 64, 32, 96, 96, 96, 16 ],
+    "ghost", "/var", $datestamp, 0);
+
+cleanup_chunker();
+
+##
+# A PORT-WRITE with a USE value smaller than the dump size, but with the CONTINUE
+# giving the same filename, so that the dump continues in the same file
+
+$handle = "55-22222";
+$datestamp = "20050505050505";
+run_chunker("use, continue on same file");
+chunker_cmd("PORT-WRITE $handle \"$test_hfile\" ghost ffff /var/lib 0 $datestamp 10240 INSTALLCHECK 64 ops");
+like(chunker_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+       "got PORT with data address");
+write_to_port($last_chunker_reply, 70*1024, "ghost", "/var/lib", 1);
+like(chunker_reply, qr/^RQ-MORE-DISK $handle$/,
+       "got RQ-MORE-DISK") or die;
+chunker_cmd("CONTINUE $handle $test_hfile 10240 10240");
+wait_for_writer();
+chunker_cmd("DONE $handle");
+like(chunker_reply, qr/^DONE $handle 70 "\[sec [\d.]+ kb 70 kps [\d.]+\]"$/,
+       "got DONE") or die;
+wait_for_exit();
+
+check_logs([
+    qr(^SUCCESS chunker ghost /var/lib $datestamp 0 \[sec [\d.]+ kb 70 kps [\d.]+\]$),
+], "logs correct");
+
+check_holding_chunks($test_hfile, [ 70 ],
+    "ghost", "/var/lib", $datestamp, 0);
+
+cleanup_chunker();
+
+##
+# A PORT-WRITE with a USE value that will trigger in the midst of a header
+# on the second chunk
+
+$handle = "66-11111";
+$datestamp = "20060606060606";
+run_chunker("out-of-use-during-header");
+chunker_cmd("PORT-WRITE $handle \"$test_hfile\" ghost ffff /u01 0 $datestamp 96 INSTALLCHECK 120 ops");
+like(chunker_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+       "got PORT with data address");
+write_to_port($last_chunker_reply, 400*1024, "ghost", "/u01", 1);
+like(chunker_reply, qr/^RQ-MORE-DISK $handle$/,
+       "got RQ-MORE-DISK") or die;
+chunker_cmd("CONTINUE $handle $test_hfile-u2 128 10240");
+wait_for_writer();
+chunker_cmd("DONE $handle");
+like(chunker_reply, qr/^DONE $handle 400 "\[sec [\d.]+ kb 400 kps [\d.]+\]"$/,
+       "got DONE") or die;
+wait_for_exit();
+
+check_logs([
+    qr(^SUCCESS chunker ghost /u01 $datestamp 0 \[sec [\d.]+ kb 400 kps [\d.]+\]$),
+], "logs for more-than-use-and-chunks PORT-WRITE");
+
+check_holding_chunks($test_hfile, [ 64, 96, 96, 96, 48 ],
+    "ghost", "/u01", $datestamp, 0);
+
+##
+# A two-disk PORT-WRITE, but with the DONE sent before the first byte of data
+# arrives, to test the ability of the chunker to defer the DONE until it gets
+# an EOF
+
+$handle = "77-11111";
+$datestamp = "20070707070707";
+run_chunker("early-DONE");
+chunker_cmd("PORT-WRITE $handle \"$test_hfile\" roast ffff /boot 0 $datestamp 10240 INSTALLCHECK 128 ops");
+like(chunker_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+       "got PORT with data address");
+chunker_cmd("DONE $handle");
+write_to_port($last_chunker_reply, 180*1024, "roast", "/boot", 0);
+like(chunker_reply, qr/^RQ-MORE-DISK $handle$/,
+       "got RQ-MORE-DISK") or die;
+chunker_cmd("CONTINUE $handle $test_hfile-u2 10240 10240");
+wait_for_writer();
+like(chunker_reply, qr/^DONE $handle 180 "\[sec [\d.]+ kb 180 kps [\d.]+\]"$/,
+       "got DONE") or die;
+wait_for_exit();
+
+check_logs([
+    qr(^SUCCESS chunker roast /boot $datestamp 0 \[sec [\d.]+ kb 180 kps [\d.]+\]$),
+], "logs for simple PORT-WRITE");
+
+check_holding_chunks($test_hfile, [ 96, 84 ], "roast", "/boot", $datestamp, 0);
+
+##
+# A two-disk PORT-WRITE, where the first disk runs out of space before it hits
+# the USE limit.
+
+$handle = "88-11111";
+$datestamp = "20080808080808";
+run_chunker("ENOSPC-1", ENOSPC_at => 90*1024);
+chunker_cmd("PORT-WRITE $handle \"$test_hfile\" roast ffff /boot 0 $datestamp 10240 INSTALLCHECK 10240 ops");
+like(chunker_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+       "got PORT with data address");
+write_to_port($last_chunker_reply, 100*1024, "roast", "/boot", 0);
+like(chunker_reply, qr/^NO-ROOM $handle 10150$/, # == 10240-90
+       "got NO-ROOM") or die;
+like(chunker_reply, qr/^RQ-MORE-DISK $handle$/,
+       "got RQ-MORE-DISK") or die;
+chunker_cmd("CONTINUE $handle $test_hfile-u2 10240 10240");
+wait_for_writer();
+chunker_cmd("DONE $handle");
+like(chunker_reply, qr/^DONE $handle 100 "\[sec [\d.]+ kb 100 kps [\d.]+\]"$/,
+       "got DONE") or die;
+wait_for_exit();
+
+check_logs([
+    qr(^SUCCESS chunker roast /boot $datestamp 0 \[sec [\d.]+ kb 100 kps [\d.]+\]$),
+], "logs for simple PORT-WRITE");
+
+check_holding_chunks($test_hfile, [ 58, 42 ], "roast", "/boot", $datestamp, 0);
+
+##
+# A two-chunk PORT-WRITE, where the second chunk gets ENOSPC in the header.  This
+# also checks the behavior of rounding down the use value to the nearest multiple
+# of 32k (with am_floor)
+
+$handle = "88-22222";
+$datestamp = "20080808080808";
+run_chunker("ENOSPC-2", ENOSPC_at => 130*1024);
+chunker_cmd("PORT-WRITE $handle \"$test_hfile\" roast ffff /boot 0 $datestamp 128 INSTALLCHECK 1000 ops");
+like(chunker_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+       "got PORT with data address");
+write_to_port($last_chunker_reply, 128*1024, "roast", "/boot", 0);
+like(chunker_reply, qr/^NO-ROOM $handle 864$/, # == am_floor(1000)-128
+       "got NO-ROOM") or die;
+like(chunker_reply, qr/^RQ-MORE-DISK $handle$/,
+       "got RQ-MORE-DISK") or die;
+chunker_cmd("CONTINUE $handle $test_hfile-u2 300 128");
+wait_for_writer();
+chunker_cmd("DONE $handle");
+like(chunker_reply, qr/^DONE $handle 128 "\[sec [\d.]+ kb 128 kps [\d.]+\]"$/,
+       "got DONE") or die;
+wait_for_exit();
+
+check_logs([
+    qr(^SUCCESS chunker roast /boot $datestamp 0 \[sec [\d.]+ kb 128 kps [\d.]+\]$),
+], "logs for simple PORT-WRITE");
+
+check_holding_chunks($test_hfile, [ 96, 32 ], "roast", "/boot", $datestamp, 0);
+ok(!-f "$test_hfile.1.tmp",
+    "half-written header is deleted");
+
+cleanup_chunker();
diff --git a/installcheck/example.pl b/installcheck/example.pl
new file mode 100644 (file)
index 0000000..7d90484
--- /dev/null
@@ -0,0 +1,51 @@
+# Copyright (c) 2010 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use Test::More tests => 2;
+
+use lib "@amperldir@";
+use File::Path;
+use Installcheck;
+use Installcheck::Config;
+use Installcheck::Run;
+use Amanda::Paths;
+use Amanda::Util qw( slurp burp );
+use Amanda::Config qw( :init );
+
+# set up a basic TESTCONF, and then burp the example configs over amanda.conf
+my $testconf = Installcheck::Config->new();
+$testconf->write();
+my $example_dir = "$amdatadir/example";
+my $testconf_dir = "$CONFIG_DIR/TESTCONF";
+my ($cfgerr_level, @cfgerr_errors);
+
+burp("$testconf_dir/amanda.conf", slurp("$example_dir/amanda.conf"));
+config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+($cfgerr_level, @cfgerr_errors) = config_errors();
+ok($cfgerr_level < $CFGERR_WARNINGS, "example/amanda.conf parses without warnings or errors") or
+    config_print_errors();
+config_uninit();
+
+burp("$testconf_dir/amanda-client.conf", slurp("$example_dir/amanda-client.conf"));
+config_init($CONFIG_INIT_EXPLICIT_NAME|$CONFIG_INIT_CLIENT, "TESTCONF");
+($cfgerr_level, @cfgerr_errors) = config_errors();
+ok($cfgerr_level < $CFGERR_WARNINGS, "example/amanda-client.conf parses without warnings or errors") or
+    config_print_errors();
+config_uninit();
+
+Installcheck::Run::cleanup();
diff --git a/installcheck/gnutar.pl b/installcheck/gnutar.pl
new file mode 100644 (file)
index 0000000..a7eaecd
--- /dev/null
@@ -0,0 +1,553 @@
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use Test::More tests => 201;
+use File::Path;
+use Data::Dumper;
+use POSIX qw( WIFEXITED );
+use warnings;
+use strict;
+
+use lib "@amperldir@";
+use Installcheck;
+use IPC::Open3;
+use Amanda::Constants;
+use Amanda::Util qw( slurp );
+
+## this is an unusual installcheck, because it does not test anything about
+## Amanda itself.  However, it validates the accuracy of our understanding of
+## GNU Tar's behavior, as recorded at
+##  http://wiki.zmanda.com/index.php/GNU_Tar_Include_and_Exclude_Behavior
+
+my $gnutar = $Amanda::Constants::GNUTAR;
+$gnutar = $ENV{'GNUTAR'} if exists $ENV{'GNUTAR'};
+
+## get set up
+
+my @filenames = (qw{A*A AxA B?B BxB C[C CC D]D E\E F'F G"G}, 'H H');
+
+my $tarfile = "$Installcheck::TMP/gnutar-tests.tar";
+my $datadir = "$Installcheck::TMP/gnutar-tests";
+
+sub make_tarfile
+{
+    my @extra_args = @_;
+
+    rmtree($datadir) if -e $datadir;
+    mkpath($datadir);
+
+    for my $fn (@filenames) {
+       open(my $fh, ">", "$datadir/$fn");
+       print $fh "data";
+       close($fh);
+    }
+
+    system($gnutar, "-C", $datadir, "-cf", $tarfile, @extra_args, '.');
+    die "could not run gnutar" unless $? == 0;
+
+    rmtree($datadir) if -e $datadir;
+}
+
+## gnutar version
+
+my ($v, $numeric_version);
+{
+    my $verstring = `$gnutar --version`;
+    die "could not run gnutar" unless $? == 0;
+    ($v) = ($verstring =~ /tar \(GNU tar\) *([0-9.]+)/);
+    my ($maj, $min, $mic) = ($v =~ /([0-9]+)\.([0-9]+)(?:\.([0-9]+))?/);
+
+    $numeric_version = 0;
+    $numeric_version += $maj * 10000 if $maj;
+    $numeric_version += $min * 100 if $min;
+    $numeric_version += $mic if $mic;
+}
+
+# see if the default for --wildcards during inclusion has been changed
+my $wc_default_changed = 0;
+{
+    my $help_output = `$gnutar --help`;
+    # redhatty patches helpfully change the help message
+    if ($help_output =~ /--wildcards\s*use wildcards \(default\)$/m) {
+       $wc_default_changed = 1;
+    }
+}
+
+my %version_classes = (
+    '<1.16' => $numeric_version < 11591,
+    '>=1.16' => $numeric_version >= 11591,
+    '>=1.16-no-wc' => $numeric_version >= 11591 && !$wc_default_changed, # normal
+    '>=1.16-wc' => $numeric_version >= 11591 && $wc_default_changed, # stupid distros screw things up!
+
+    '<1.23' => $numeric_version < 12300,
+    '>=1.23' => $numeric_version >= 12300,
+    '*' => 1,
+    '1.23' => ($numeric_version >= 12290 and $numeric_version <= 12300),
+    '!1.23' => ($numeric_version < 12290 || $numeric_version > 12300),
+);
+
+# include and exclude all use the same set of patterns and filenames
+my $patterns = [
+       './A*A' =>      'A*A',
+       './A*A' =>      'AxA',
+       './B?B' =>      'B?B',
+       './B?B' =>      'BxB',
+       './C[C' =>      'C[C',
+       './D]D' =>      'D]D',
+       './E\\E' =>     'E\\E',
+       './F\'F' =>     'F\'F',
+       './G"G' =>      'G"G',
+       './H H' =>      'H H',
+       './A\\*A' =>    'A*A',
+       './A\\*A' =>    'AxA',
+       './B\\?B' =>    'B?B',
+       './B\\?B' =>    'BxB',
+       './C\\[C' =>    'C[C',
+       './D\\]D' =>    'D]D',
+       './E\\\\E' =>   'E\\E',
+       './F\\\'F' =>   'F\'F',
+       './G\\"G' =>    'G"G',
+       './H\\ H' =>    'H H',
+];
+
+my $named_expectations = [
+    [ 'alpha',
+         'beta',
+           'gamma',
+              'delta',
+                 'epsilon',
+                    'empty', ],
+    #  al be ga de ep empty
+    [  1, 1, 1, 1, 1, 1,     ], # './A*A' =>   'A*A',
+    [  1, 1, 1, 1, 0, 0,     ], # './A*A' =>   'AxA',
+    [  1, 1, 1, 1, 1, 1,     ], # './B?B' =>   'B?B',
+    [  1, 1, 1, 1, 0, 0,     ], # './B?B' =>   'BxB',
+    [  0, 0, 0, 0, 1, 1,     ], # './C[C' =>   'C[C',
+    [  1, 1, 1, 1, 1, 1,     ], # './D]D' =>   'D]D',
+    [  1, 0, 0, 1, 1, 1,     ], # './E\\E' =>  'E\\E',
+    [  1, 1, 1, 1, 1, 1,     ], # './F\'F' =>  'F\'F',
+    [  1, 1, 1, 1, 1, 1,     ], # './G"G' =>   'G"G',
+    [  1, 1, 1, 1, 1, 1,     ], # './H H' =>   'H H',
+    [  1, 1, 1, 0, 0, 0,     ], # './A\\*A' => 'A*A',
+    [  0, 0, 0, 0, 0, 0,     ], # './A\\*A' => 'AxA',
+    [  0, 0, 1, 0, 0, 0,     ], # './B\\?B' => 'B?B',
+    [  0, 0, 0, 0, 0, 0,     ], # './B\\?B' => 'BxB',
+    [  1, 1, 1, 0, 0, 0,     ], # './C\\[C' => 'C[C',
+    [  0, 1, 1, 0, 0, 0,     ], # './D\\]D' => 'D]D',
+    [  1, 0, 1, 0, 1, 0,     ], # './E\\\\E' =>        'E\\E',
+    [  0, 1, 1, 0, 0, 0,     ], # './F\\\'F' =>        'F\'F',
+    [  0, 1, 1, 0, 0, 0,     ], # './G\\"G' => 'G"G',
+    [  0, 1, 1, 0, 0, 0,     ], # './H\\ H' => 'H H',
+];
+
+sub get_expectation {
+    my ($name) = @_;
+    my @names = @{$named_expectations->[0]};
+
+    # get the index for that greek letter
+    my $i;
+    for (0 .. $#names) {
+       if ($names[$_] eq $name) {
+           $i = $_;
+           last;
+       }
+    }
+
+    # then assemble the result
+    my @rv;
+    my @exps = @$named_expectations;
+    shift @exps;
+    for (@exps) {
+       push @rv, $_->[$i];
+    }
+
+    return @rv;
+}
+
+sub get_matching_type {
+    my ($expectations) = @_;
+
+    # find the type for the first matching version
+    for (keys %$expectations) {
+       if ($version_classes{$_}) {
+           return $expectations->{$_};
+       }
+    }
+    return undef;
+}
+
+sub get_version_index {
+    my @versions = @{$_[0]};
+
+    my $vi;
+    for (0 .. $#versions) {
+       if ($version_classes{$versions[$_]}) {
+           return $_;
+       }
+    }
+    return undef;
+}
+
+## utils
+
+my ($stderr, $stdout, $exit_code);
+sub run_gnutar {
+    my %params = @_;
+    my @args = @{ $params{'args'} };
+
+    my $errtempfile = "$Installcheck::TMP/stderr$$.out";
+
+    # use a temporary file for error output -- this eliminates synchronization
+    # problems between reading stderr and stdout
+    local (*INFH, *OUTFH, *ERRFH);
+    open(ERRFH, ">", $errtempfile);
+
+    local %ENV;
+    if ($params{'env'}) {
+       my %env = %{$params{'env'}};
+       for (keys %env) {
+           $ENV{$_} = $env{$_};
+       }
+    }
+
+    my $pid = IPC::Open3::open3("INFH", "OUTFH", ">&ERRFH", $gnutar, @args);
+    my $cmdline = "$gnutar " . join(' ', @args);
+
+    # immediately close the child's stdin
+    close(INFH);
+
+    # read from stdout until it's closed
+    $stdout = do { local $/; <OUTFH> };
+    close(OUTFH);
+
+    # and wait for the kid to die
+    waitpid $pid, 0 or croak("Error waiting for gnutar die: $@");
+    my $status = $?;
+    close(ERRFH);
+
+    # fetch stderr from the temporary file
+    $stderr = slurp($errtempfile);
+    unlink($errtempfile);
+
+    # get the exit status
+    $exit_code = WIFEXITED($status)? ($status >> 8) : 0xffff;
+
+    if ($exit_code != 0) {
+       return 0;
+    } else {
+       return 1;
+    }
+}
+
+## inclusion tests (using -x and filenames on the command line)
+
+sub test_gnutar_inclusion {
+    my %params = @_;
+
+    my $matching_type = get_matching_type($params{'expectations'});
+
+    # skip these tests if there's no matching version
+    if (!defined $matching_type) {
+       SKIP: {
+           my $msg = (join " ", @{$params{'extra_args'}}) .
+                       " not supported in version $v";
+           my $count = @$patterns / 2;
+           skip $msg, $count;
+       }
+       return;
+    }
+
+    make_tarfile();
+    my @patterns = @$patterns;
+    my @expectations = get_expectation($matching_type);
+    while (@patterns) {
+       my $pat = shift @patterns;
+       my $file = shift @patterns;
+       my $exp = shift @expectations;
+
+       my $eargs = '';
+       $eargs = ', ' . join(' ', @{$params{'extra_args'}}) if @{$params{'extra_args'}};
+       my $match = $exp? "matches" : "does not match";
+       my $msg = "inclusion$eargs, pattern $pat $match file $file";
+
+       rmtree($datadir) if -e $datadir;
+       mkpath($datadir);
+
+       my $ok = run_gnutar(args => [ '-C', $datadir, '-x', '-f', $tarfile, @{$params{'extra_args'}}, $pat ]);
+       $ok = 0 unless -f "$datadir/$file";
+       if ($ok and !$exp) {
+           fail($msg);
+           diag("  unexpected success with version $v");
+       } elsif (!$ok and $exp) {
+           fail($msg);
+           diag("  unexpected failure with version $v:\n$stderr");
+       } else {
+           pass($msg);
+       }
+    }
+    rmtree($datadir) if -e $datadir;
+}
+
+# We'll trust that the following logic is implemented correctly in GNU Tar
+# --no-wildcards is the default (same as no args) (but not everywhere!!)
+# --unquote is the default (same as no args) (this seems true universally)
+
+test_gnutar_inclusion(
+    extra_args => [],
+    expectations => {
+       '<1.16' => 'alpha',
+       '>=1.16-no-wc' => 'epsilon',
+       '>=1.16-wc' => 'beta', # acts like --wildcards
+    },
+);
+
+test_gnutar_inclusion(
+    extra_args => [ '--no-wildcards' ],
+    expectations => {
+       '<1.16' => 'alpha',
+       '>=1.16' => 'epsilon',
+    },
+);
+
+test_gnutar_inclusion(
+    extra_args => [ '--no-unquote' ],
+    expectations => {
+       '<1.16' => undef,
+       '>=1.16-no-wc' => 'empty',
+       '>=1.16-wc' => 'gamma', # acts like --wildcards --no-unquote
+    },
+);
+
+test_gnutar_inclusion(
+    extra_args => [ '--no-wildcards', '--no-unquote' ],
+    expectations => {
+       '<1.16' => undef,
+       '>=1.16' => 'empty',
+    },
+);
+
+test_gnutar_inclusion(
+    extra_args => [ '--wildcards' ],
+    expectations => {
+       '<1.16' => 'alpha',
+       '>=1.16' => 'beta',
+    },
+);
+
+test_gnutar_inclusion(
+    extra_args => [ '--wildcards', '--no-unquote' ],
+    expectations => {
+       '<1.16' => undef,
+       '>=1.16' => 'gamma',
+    },
+);
+
+## exclusion tests (using -t and filenames on the command line)
+
+sub test_gnutar_exclusion {
+    my %params = @_;
+
+    my $matching_type = get_matching_type($params{'expectations'});
+
+    # skip these tests if there's no matching version
+    if (!defined $matching_type) {
+       SKIP: {
+           my $msg = (join " ", @{$params{'extra_args'}}) .
+                       " not supported in version $v";
+           my $count = @$patterns; # two elements per test, but we run each one twice
+           skip $msg, $count;
+       }
+       return;
+    }
+
+    make_tarfile();
+    my @patterns = @$patterns;
+    my @expectations = get_expectation($matching_type);
+    while (@patterns) {
+       my $pat = shift @patterns;
+       my $file = shift @patterns;
+       my $exp = shift @expectations;
+
+       my $eargs = '';
+       $eargs = ', ' . join(' ', @{$params{'extra_args'}}) if @{$params{'extra_args'}};
+       my $match = $exp? "matches" : "does not match";
+       my $msg = "exclusion$eargs, extract, pattern $pat $match $file";
+
+       rmtree($datadir) if -e $datadir;
+       mkpath($datadir);
+
+       my $ok = run_gnutar(args => [ '-C', $datadir, '-x', '-f', $tarfile, @{$params{'extra_args'}}, "--exclude=$pat" ]);
+
+       # fail if the excluded file was extracted anyway..
+       if ($ok) {
+           my $excluded_ok = ! -f "$datadir/$file";
+           if ($excluded_ok and !$exp) {
+               fail($msg);
+               diag("  exclusion unexpectedly worked with version $v");
+           } elsif (!$excluded_ok and $exp) {
+               fail($msg);
+               diag("  exclusion unexpectedly failed with version $v");
+           } else {
+               pass($msg);
+           }
+       } else {
+           fail($msg);
+           diag("  unexpected error exit with version $v:\n$stderr");
+       }
+    }
+
+    # test again, but this time during a 'c'reate operation
+    @patterns = @$patterns;
+    @expectations = get_expectation($matching_type);
+    while (@patterns) {
+       my $pat = shift @patterns;
+       my $file = shift @patterns;
+       my $exp = shift @expectations;
+
+       my $eargs = '';
+       $eargs = ', ' . join(' ', @{$params{'extra_args'}}) if @{$params{'extra_args'}};
+       my $match = $exp? "matches" : "does not match";
+       my $msg = "exclusion$eargs, create, pattern $pat $match $file";
+
+       # this time around, we create the tarball with the exclude, then extract the whole
+       # thing.  We extract rather than using 't' because 't' has a funny habit of backslashing
+       # its output that we don't want to deal with here.
+       make_tarfile(@{$params{'extra_args'}}, "--exclude=$pat");
+
+       rmtree($datadir) if -e $datadir;
+       mkpath($datadir);
+       my $ok = run_gnutar(args => [ '-C', $datadir, '-x', '-f', $tarfile]);
+
+       # fail if the excluded file was extracted anyway..
+       if ($ok) {
+           my $excluded_ok = ! -f "$datadir/$file";
+           if ($excluded_ok and !$exp) {
+               fail($msg);
+               diag("  exclusion unexpectedly worked with version $v");
+           } elsif (!$excluded_ok and $exp) {
+               fail($msg);
+               diag("  exclusion unexpectedly failed with version $v");
+           } else {
+               pass($msg);
+           }
+       } else {
+           fail($msg);
+           diag("  unexpected error exit with version $v:\n$stderr");
+       }
+    }
+
+    rmtree($datadir) if -e $datadir;
+}
+
+# We'll trust that the following logic is implemented correctly in GNU Tar
+# --wildcards is the default (same as no args)
+# --no-unquote / --unquote has no effect
+
+# --wildcards
+test_gnutar_exclusion(
+    extra_args => [],
+    expectations => {
+       '!1.23' => 'gamma',
+       '1.23' => 'delta',
+    },
+);
+
+# --no-wildcards
+test_gnutar_exclusion(
+    extra_args => [ '--no-wildcards' ],
+    expectations => {
+       '*' => 'empty',
+    },
+);
+
+## list (-t)
+
+sub test_gnutar_toc {
+    my %params = @_;
+
+    my $vi = get_version_index($params{'versions'});
+
+    my @patterns = @{ $params{'patterns'} };
+    my @filenames;
+    my @expectations;
+    while (@patterns) {
+       my $file = shift @patterns;
+       my $exp = shift @patterns;
+       $exp = $exp->[$vi];
+
+       push @filenames, $file;
+       push @expectations, $exp;
+    }
+
+    my $eargs = '';
+    $eargs = ', ' . join(' ', @{$params{'extra_args'}}) if @{$params{'extra_args'}};
+    my $msg = "list$eargs, with lots of funny characters";
+
+    # make a tarfile containing the filenames, then run -t over it
+    rmtree($datadir) if -e $datadir;
+    mkpath($datadir);
+
+    for my $fn (@filenames) {
+       open(my $fh, ">", "$datadir/$fn")
+           or die("opening $datadir/$fn: $!");
+       print $fh "data";
+       close($fh);
+    }
+
+    system($gnutar, "-C", $datadir, "-cf", $tarfile, '.');
+    die "could not run gnutar" unless $? == 0;
+
+    rmtree($datadir) if -e $datadir;
+    my %env;
+    if ($params{'env'}) {
+       %env = %{$params{'env'}};
+    }
+    my $ok = run_gnutar(args => [ '-t', '-f', $tarfile, @{$params{'extra_args'}}],
+                       env => \%env);
+    if (!$ok) {
+       fail($msg);
+       diag("gnutar exited with nonzero status for version $v");
+    }
+
+    my @toc_members = sort split(/\n/, $stdout);
+    shift @toc_members; # strip off './'
+    is_deeply([ @toc_members ], [ @expectations ], $msg);
+}
+
+# there are no extra_args that seem to affect this behavior
+test_gnutar_toc(
+    extra_args => [],
+    env => { LC_CTYPE => 'C' }, # avoid any funniness with ctypes
+    versions =>  [ '*' ],
+    patterns => [
+       "A\007", [ './A\a' ],
+       "B\010", [ './B\b' ],
+       "C\011", [ './C\t' ],
+       "D\012", [ './D\n' ],
+       "E\013", [ './E\v' ],
+       "F\014", [ './F\f' ],
+       "G\015", [ './G\r' ],
+       "H\\",   [ './H\\\\' ], # H\ -> H\\
+       "I\177", [ './I\\177' ],
+       "J\317\264", [ './J\\317\\264' ], # use legitimate utf-8, for mac os fs
+       "K\\x",  [ './K\\\\x' ],
+       "L\\\\", [ './L\\\\\\\\' ],
+    ],
+);
+
+unlink($tarfile);
index 2213bd93ae33c621f5a35023f1d0506d97826a13..84a4970a8fa19d9c15e520dd7a2228a0b8fbdf60 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -19,6 +19,7 @@
 use Test::More tests => 31;
 use File::Path;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck;
index 707d1e16cbe043f1376c54de5a798b7dead65ffc..3cb4b2a73e7de3a21a1b389aab9dea68d4672f83 100644 (file)
@@ -16,7 +16,9 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 172;
+use Test::More tests => 201;
+use strict;
+use warnings;
 
 use lib '@amperldir@';
 use Installcheck::Run;
@@ -63,7 +65,12 @@ sub run_taper {
     cleanup_taper();
 
     unless ($params{'keep_config'}) {
-       my $testconf = Installcheck::Run::setup();
+       my $testconf;
+       if ($params{'new_vtapes'}) {
+           $testconf = Installcheck::Run::setup(1);
+       } else {
+           $testconf = Installcheck::Run::setup();
+       }
        $testconf->add_param('autolabel', '"TESTCONF%%" empty volume_error');
        if ($params{'notapedev'}) {
            $testconf->remove_param('tapedev');
@@ -73,6 +80,10 @@ sub run_taper {
            $ndmp->reset();
            $ndmp->config($testconf);
        }
+       unless ($params{'leom'} or $params{'ndmp_server'}) {
+           $testconf->add_param('device_property', '"LEOM" "OFF"');
+       }
+       $testconf->add_param('debug_taper', '9'); ## TEMPORARY
        $testconf->add_tapetype('TEST-TAPE', [
            'length' =>  "$length",
            ]);
@@ -103,7 +114,7 @@ sub run_taper {
        $taper_reply_timeout = 120;
     }
 
-    taper_cmd("START-TAPER $datestamp");
+    taper_cmd("START-TAPER worker0 $datestamp");
 }
 
 sub wait_for_exit {
@@ -173,8 +184,8 @@ sub check_logs {
     close($logfile);
 
     while (@logfile and @$expected) {
-       $logline = shift @logfile;
-       $expline = shift @$expected;
+       my $logline = shift @logfile;
+       my $expline = shift @$expected;
        chomp $logline;
        if ($logline !~ $expline) {
            like($logline, $expline, $msg);
@@ -216,7 +227,7 @@ sub write_dumpfile_header_to {
     $hdr->{'program'} = "INSTALLCHECK";
     $hdr = $hdr->to_string(32768,32768);
 
-    $fh->write($hdr);
+    $fh->syswrite($hdr, 32768);
 }
 
 sub write_dumpfile_data_to {
@@ -251,7 +262,7 @@ sub write_to_port {
     my ($port_cmd, $size, $hostname, $disk, $expect_error) = @_;
 
     my ($header_port, $data_addr) =
-       ($last_taper_reply =~ /^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+)/);
+       ($last_taper_reply =~ /^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+)/);
 
     # just run this in the child
     return unless fork() == 0;
@@ -282,15 +293,16 @@ sub write_to_port {
 $handle = "11-11111";
 $datestamp = "20070102030405";
 run_taper(4096, "single-part and multipart FILE-WRITE");
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
 make_holding_file(1024*1024, "localhost", "/home");
-taper_cmd("FILE-WRITE $handle \"$test_filename\" localhost /home 0 $datestamp 0 12");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /home 0 $datestamp \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" 12");
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 1024 "\[sec [\d.]+ kb 1024 kps [\d.]+ orig-kb 12\]"$/,
        "got PARTDONE") or die;
 like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1024 kps [\d.]+ orig-kb 12\]" "" ""$/,
@@ -302,7 +314,7 @@ like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1024 kp
 
 $handle = '11-22222';
 make_holding_file(1024*1024, "localhost", "/usr");
-taper_cmd("FILE-WRITE $handle \"$test_filename\" localhost /usr 0 $datestamp 524288 512");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /usr 0 $datestamp 524288 \"\" \"\" 1 \"\" \"\" \"\" \"\" 512");
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 512 "\[sec [\d.]+ kb 512 kps [\d.]+ orig-kb 512\]"$/,
        "got PARTDONE for filenum 2") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 512 "\[sec [\d.]+ kb 512 kps [\d.]+ orig-kb 512\]"$/,
@@ -313,7 +325,6 @@ taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
     qr(^PART taper TESTCONF01 1 localhost /home $datestamp 1/-1 0 \[sec [\d.]+ kb 1024 kps [\d.]+ orig-kb 12\]$),
     qr(^DONE taper localhost /home $datestamp 1 0 \[sec [\d.]+ kb 1024 kps [\d.]+ orig-kb 12\]$),
@@ -381,17 +392,18 @@ check_logs([
 $handle = "11-33333";
 $datestamp = "19780615010203";
 run_taper(4096, "multipart PORT-WRITE");
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
-taper_cmd("PORT-WRITE $handle localhost /var 0 $datestamp 524288 NULL 393216");
-like(taper_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+taper_cmd("PORT-WRITE worker0 $handle localhost /var 0 $datestamp 524288 \"\" 393216 1 0 \"\" \"\" 0 AMANDA");
+like(taper_reply, qr/^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
        "got PORT with data address");
 write_to_port($last_taper_reply, 63*32768, "localhost", "/var", 0);
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
@@ -406,14 +418,13 @@ like(taper_reply, qr/^PARTDONE $handle TESTCONF01 6 96 "\[sec [\d.]+ kb 96 kps [
        "got PARTDONE for filenum 6") or die;
 like(taper_reply, qr/^DUMPER-STATUS $handle$/,
        "got DUMPER-STATUS request") or die;
-taper_cmd("DONE $handle 712");
+taper_cmd("DONE worker0 $handle 712");
 like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 2016 kps [\d.]+ orig-kb 712\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
     qr(^PART taper TESTCONF01 1 localhost /var $datestamp 1/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
     qr(^PART taper TESTCONF01 2 localhost /var $datestamp 2/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
@@ -431,22 +442,21 @@ check_logs([
 $handle = "11-44444";
 $datestamp = "19411207000000";
 run_taper(4096, "testing NO-NEW-TAPE from the driver on 1st request");
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
 make_holding_file(1024*1024, "localhost", "/home");
-taper_cmd("FILE-WRITE $handle \"$test_filename\" localhost /home 0 $datestamp 0 912");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /home 0 $datestamp 0 \"\" 0 1 0 \"\" \"\" 0 912");
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NO-NEW-TAPE sorry");
-like(taper_reply, qr/^FAILED $handle INPUT-GOOD TAPE-ERROR "" "CONFIG:sorry"?.*$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("NO-NEW-TAPE worker0 $handle sorry");
+like(taper_reply, qr/^FAILED $handle INPUT-GOOD TAPE-ERROR "" "?sorry"?.*$/,
        "got FAILED") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
-    qr(^ERROR taper no-tape \[CONFIG:sorry\]$),
-    qr(^FAIL taper localhost /home $datestamp 0 "CONFIG:sorry"$),
+    qr(^ERROR taper no-tape config \[sorry\]$),
+    qr(^FAIL taper localhost /home $datestamp 0 config sorry$),
 ], "NO-NEW-TAPE logged correctly");
 
 ##
@@ -455,44 +465,44 @@ check_logs([
 $handle = "11-55555";
 $datestamp = "19750711095836";
 run_taper(1024, "PORT-WRITE retry on EOT (mem cache)");
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
-taper_cmd("PORT-WRITE $handle localhost /usr/local 0 $datestamp 786432 NULL 786432");
-like(taper_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+taper_cmd("PORT-WRITE worker0 $handle localhost /usr/local 0 $datestamp 786432 \"\" 786432 1 0 \"\" \"\" 0 AMANDA");
+like(taper_reply, qr/^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
        "got PORT with data address");
 write_to_port($last_taper_reply, 1575936, "localhost", "/usr/local", 0);
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 3 "\[sec [\d.]+ kb 3 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 2 on second tape") or die;
 like(taper_reply, qr/^DUMPER-STATUS $handle$/,
        "got DUMPER-STATUS request") or die;
-taper_cmd("DONE $handle 1012");
+taper_cmd("DONE worker0 $handle 1012");
 like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1539 kps [\d.]+ orig-kb 1012\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
     qr(^PART taper TESTCONF01 1 localhost /usr/local $datestamp 1/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+\]$),
     qr(^PARTPARTIAL taper TESTCONF01 2 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ kb 160 kps [\d.]+\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF01 kb 768 fm 2 \[OK\]$),
-    qr(^INFO taper Will write new label `TESTCONF02' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
     qr(^PART taper TESTCONF02 1 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+\]$),
     qr(^PART taper TESTCONF02 2 localhost /usr/local $datestamp 3/-1 0 \[sec [\d.]+ kb 3 kps [\d.]+\]$),
@@ -506,22 +516,24 @@ check_logs([
 $handle = "11-66666";
 $datestamp = "19470815000000";
 run_taper(1024, "FILE-WRITE retry on EOT");
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
 make_holding_file(1575936, "localhost", "/usr");
-taper_cmd("FILE-WRITE $handle \"$test_filename\" localhost /usr 0 $datestamp 786432 1112");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /usr 0 $datestamp \"\" \"\" \"\" 1 786432 \"\" \"\" \"\" 1112");
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+ orig-kb 1112\]"$/,
        "got PARTDONE for filenum 1") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+ orig-kb 1112\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 3 "\[sec [\d.]+ kb 3 kps [\d.]+ orig-kb 1112\]"$/,
@@ -532,13 +544,11 @@ taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
     qr(^PART taper TESTCONF01 1 localhost /usr $datestamp 1/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+ orig-kb 1112\]$),
     qr(^PARTPARTIAL taper TESTCONF01 2 localhost /usr $datestamp 2/-1 0 \[sec [\d.]+ kb 160 kps [\d.]+ orig-kb 1112\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF01 kb 768 fm 2 \[OK\]$),
-    qr(^INFO taper Will write new label `TESTCONF02' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
     qr(^PART taper TESTCONF02 1 localhost /usr $datestamp 2/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+ orig-kb 1112\]$),
     qr(^PART taper TESTCONF02 2 localhost /usr $datestamp 3/-1 0 \[sec [\d.]+ kb 3 kps [\d.]+ orig-kb 1112\]$),
@@ -552,44 +562,44 @@ check_logs([
 $handle = "11-77777";
 $datestamp = "20090427212500";
 run_taper(1024, "PORT-WRITE retry on EOT (disk cache)");
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
-taper_cmd("PORT-WRITE $handle localhost /usr/local 0 $datestamp 786432 \"$Installcheck::TMP\" 786432");
-like(taper_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+taper_cmd("PORT-WRITE worker0 $handle localhost /usr/local 0 $datestamp 786432 \"$Installcheck::TMP\" 786432 1 0 \"\" \"\" 0 AMANDA");
+like(taper_reply, qr/^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
        "got PORT with data address");
 write_to_port($last_taper_reply, 1575936, "localhost", "/usr/local", 0);
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 3 "\[sec [\d.]+ kb 3 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 2 on second tape") or die;
 like(taper_reply, qr/^DUMPER-STATUS $handle$/,
        "got DUMPER-STATUS request") or die;
-taper_cmd("DONE $handle 1212");
+taper_cmd("DONE worker0 $handle 1212");
 like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1539 kps [\d.]+ orig-kb 1212\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
     qr(^PART taper TESTCONF01 1 localhost /usr/local $datestamp 1/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+\]$),
     qr(^PARTPARTIAL taper TESTCONF01 2 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ kb 160 kps [\d.]+\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF01 kb 768 fm 2 \[OK\]$),
-    qr(^INFO taper Will write new label `TESTCONF02' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
     qr(^PART taper TESTCONF02 1 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+\]$),
     qr(^PART taper TESTCONF02 2 localhost /usr/local $datestamp 3/-1 0 \[sec [\d.]+ kb 3 kps [\d.]+\]$),
@@ -604,47 +614,47 @@ check_logs([
 $handle = "11-88888";
 $datestamp = "20090424173000";
 run_taper(1024, "PORT-WRITE failure on EOT (no cache)");
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
-taper_cmd("PORT-WRITE $handle localhost /var/log 0 $datestamp 0 NULL 0");
-like(taper_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+taper_cmd("PORT-WRITE worker0 $handle localhost /var/log 0 $datestamp 0 \"\" 0 0 0 \"\" \"\" 0 AMANDA");
+like(taper_reply, qr/^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
        "got PORT with data address");
 write_to_port($last_taper_reply, 1575936, "localhost", "/var/log", 1);
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTIAL $handle INPUT-GOOD TAPE-ERROR "\[sec [\d.]+ kb 0 kps [\d.]+\]" "" "No space left on device"$/,
        "got PARTIAL") or die;
 # retry on the next tape
 $handle = "11-88899";
-taper_cmd("PORT-WRITE $handle localhost /boot 0 $datestamp 0 NULL 0");
-like(taper_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+taper_cmd("PORT-WRITE worker0 $handle localhost /boot 0 $datestamp 0 \"\" 0 0 0 \"\" \"\" 0 AMANDA");
+like(taper_reply, qr/^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
        "got PORT with data address");
 write_to_port($last_taper_reply, 65536, "localhost", "/boot", 0);
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 64 "\[sec [\d.]+ kb 64 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
 like(taper_reply, qr/^DUMPER-STATUS $handle$/,
        "got DUMPER-STATUS request") or die;
-taper_cmd("DONE $handle 64");
+taper_cmd("DONE worker0 $handle 64");
 like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 64 kps [\d.]+ orig-kb 64\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
     qr(^PARTPARTIAL taper TESTCONF01 1 localhost /var/log $datestamp 1/-1 0 \[sec [\d.]+ kb 960 kps [\d.]+\] "No space left on device"$),
     qr(^PARTIAL taper localhost /var/log $datestamp 1 0 \[sec [\d.]+ kb 0 kps [\d.]+\] "No space left on device"$),
     qr(^INFO taper tape TESTCONF01 kb 0 fm 1 \[OK\]$),
-    qr(^INFO taper Will write new label `TESTCONF02' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
     qr(^PART taper TESTCONF02 1 localhost /boot $datestamp 1/-1 0 \[sec [\d.]+ kb 64 kps [\d.]+\]$),
     qr(^DONE taper localhost /boot $datestamp 1 0 \[sec [\d.]+ kb 64 kps [\d.]+ orig-kb 64\]$),
@@ -657,35 +667,34 @@ check_logs([
 $handle = "11-99999";
 $datestamp = "20100101000000";
 run_taper(512, "FILE-WRITE runs out of tapes");
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
 make_holding_file(512*1024, "localhost", "/music");
-taper_cmd("FILE-WRITE $handle \"$test_filename\" localhost /music 0 $datestamp 262144 1312");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /music 0 $datestamp \"\" \"\" \"\" 1 262144 \"none\" \"\" 10240 1312");
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1312\]"$/,
        "got PARTDONE for filenum 1 on first tape") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NO-NEW-TAPE \"that's enough\"");
-like(taper_reply, qr/^PARTIAL $handle INPUT-GOOD TAPE-ERROR "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1312\]" "" "CONFIG:that's enough"$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("NO-NEW-TAPE worker0 $handle \"that's enough\"");
+like(taper_reply, qr/^PARTIAL $handle INPUT-GOOD TAPE-ERROR "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1312\]" "" "that's enough"$/,
        "got PARTIAL") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
     qr(^PART taper TESTCONF01 1 localhost /music $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1312\]$),
     qr(^PARTPARTIAL taper TESTCONF01 2 localhost /music $datestamp 2/-1 0 \[sec [\d.]+ kb 160 kps [\d.]+ orig-kb 1312\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF01 kb 256 fm 2 \[OK\]$),
-    qr(^ERROR taper no-tape \[CONFIG:that's enough\]$),
-    qr(^INFO taper Will write new label `TESTCONF02' to new tape$),
-    qr(^PARTIAL taper localhost /music $datestamp 2 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1312\] "CONFIG:that's enough"$),
+    qr(^ERROR taper no-tape config \[that's enough\]$),
+    qr(^PARTIAL taper localhost /music $datestamp 2 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1312\] "that's enough"$),
 ], "running out of tapes (simulating runtapes=1) logged correctly");
 
 ##
@@ -694,17 +703,18 @@ check_logs([
 $handle = "22-00000";
 $datestamp = "20200202222222";
 run_taper(4096, "multipart PORT-WRITE");
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
-taper_cmd("PORT-WRITE $handle localhost /sbin 0 $datestamp 10 NULL 655360");
-like(taper_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+taper_cmd("PORT-WRITE worker0 $handle localhost /sbin 0 $datestamp 999999 \"\" 655360 1 \"\" \"\" \"\" \"\" AMANDA");
+like(taper_reply, qr/^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
        "got PORT with data address");
 write_to_port($last_taper_reply, 63*32768, "localhost", "/sbin", 0);
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 640 "\[sec [\d.]+ kb 640 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 640 "\[sec [\d.]+ kb 640 kps [\d.]+\]"$/,
@@ -715,14 +725,13 @@ like(taper_reply, qr/^PARTDONE $handle TESTCONF01 4 96 "\[sec [\d.]+ kb 96 kps [
        "got PARTDONE for filenum 4") or die;
 like(taper_reply, qr/^DUMPER-STATUS $handle$/,
        "got DUMPER-STATUS request") or die;
-taper_cmd("FAILED $handle");
+taper_cmd("FAILED worker0 $handle");
 like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 2016 kps [\d.]+\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
     qr(^PART taper TESTCONF01 1 localhost /sbin $datestamp 1/-1 0 \[sec [\d.]+ kb 640 kps [\d.]+\]$),
     qr(^PART taper TESTCONF01 2 localhost /sbin $datestamp 2/-1 0 \[sec [\d.]+ kb 640 kps [\d.]+\]$),
@@ -738,15 +747,16 @@ check_logs([
 $handle = "33-11111";
 $datestamp = "20090101010000";
 run_taper(1024, "first in a sequence");
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
 make_holding_file(500000, "localhost", "/u01");
-taper_cmd("FILE-WRITE $handle \"$test_filename\" localhost /u01 0 $datestamp 262144 1412");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u01 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1412");
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1412\]"$/,
        "got PARTDONE for filenum 1") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 232 "\[sec [\d.]+ kb 232 kps [\d.]+ orig-kb 1412\]"$/,
@@ -755,14 +765,15 @@ like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 488 kps
        "got DONE") or die;
 $handle = "33-22222";
 make_holding_file(614400, "localhost", "/u02");
-taper_cmd("FILE-WRITE $handle \"$test_filename\" localhost /u02 0 $datestamp 262144 1512");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u02 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1512");
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1512\]"$/,
        "got PARTDONE for filenum 3") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1512\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 88 "\[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1512\]"$/,
@@ -773,7 +784,6 @@ taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
     qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1412\]$),
     qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ kb 232 kps [\d.]+ orig-kb 1412\]$),
@@ -782,7 +792,6 @@ check_logs([
     qr(^PARTPARTIAL taper TESTCONF01 4 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ kb 96 kps [\d.]+ orig-kb 1512\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF01 kb 744 fm 4 \[OK\]$),
-    qr(^INFO taper Will write new label `TESTCONF02' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
     qr(^PART taper TESTCONF02 1 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1512\]$),
     qr(^PART taper TESTCONF02 2 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1512\]$),
@@ -794,15 +803,16 @@ cleanup_log();
 $handle = "33-33333";
 $datestamp = "20090202020000";
 run_taper(1024, "second in a sequence", keep_config => 1);
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
 make_holding_file(300000, "localhost", "/u01");
-taper_cmd("FILE-WRITE $handle \"$test_filename\" localhost /u01 0 $datestamp 262144 1612");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u01 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1612");
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF03$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF03 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]"$/,
        "got PARTDONE for filenum 1") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF03 2 36 "\[sec [\d.]+ kb 36 kps [\d.]+ orig-kb 1612\]"$/,
@@ -811,16 +821,17 @@ like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 292 kps
        "got DONE") or die;
 $handle = "33-44444";
 make_holding_file(614400, "localhost", "/u02");
-taper_cmd("FILE-WRITE $handle \"$test_filename\" localhost /u02 0 $datestamp 262144 1712");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u02 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1712");
 like(taper_reply, qr/^PARTDONE $handle TESTCONF03 3 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]"$/,
        "got PARTDONE for filenum 3") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF03 4 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]"$/,
        "got PARTDONE for filenum 4") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NEW-TAPE");
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-       "got proper NEW-TAPE") or die;
+       "got proper NEW-TAPE worker0 $handle") or die;
 like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 88 "\[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1712\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
 like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 600 kps [\d.]+ orig-kb 1712\]" "" ""$/,
@@ -829,7 +840,6 @@ taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
-    qr(^INFO taper Will write new label `TESTCONF03' to new tape$),
     qr(^START taper datestamp $datestamp label TESTCONF03 tape 1$),
     qr(^PART taper TESTCONF03 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]$),
     qr(^PART taper TESTCONF03 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ kb 36 kps [\d.]+ orig-kb 1612\]$),
@@ -839,7 +849,6 @@ check_logs([
     qr(^PARTPARTIAL taper TESTCONF03 5 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ kb 0 kps [\d.]+ orig-kb 1712\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF03 kb 804 fm 5 \[OK\]$),
-    # note no "Will write new label.."
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 2$),
     qr(^PART taper TESTCONF01 1 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1712\]$),
     qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ kb 600 kps [\d.]+ orig-kb 1712\]$),
@@ -853,31 +862,32 @@ cleanup_log();
 $handle = "33-55555";
 $datestamp = "20090303030000";
 run_taper(1024, "failure to overwrite a volume", keep_config => 1);
-like(taper_reply, qr/^TAPER-OK$/,
+like(taper_reply, qr/^TAPER-OK worker0$/,
        "got TAPER-OK") or die;
 make_holding_file(32768, "localhost", "/u03");
-taper_cmd("FILE-WRITE $handle \"$test_filename\" localhost /u03 0 $datestamp 262144 1812");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u03 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1812");
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
 # we've secretly replaced the tape in slot 1 with a read-only tape.. let's see
 # if anyone can tell the difference!
 chmod(0555, Installcheck::Run::vtape_dir(2));
-taper_cmd("NEW-TAPE");
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
 # NO-NEW-TAPE indicates it did *not* overwrite the tape
 like(taper_reply, qr/^NO-NEW-TAPE $handle$/,
-       "got proper NO-NEW-TAPE"); # no "die" here, so we can restore perms
+       "got proper NO-NEW-TAPE worker0 $handle"); # no "die" here, so we can restore perms
 chmod(0755, Installcheck::Run::vtape_dir(2));
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-       "got REQUEST-NEW-TAPE") or die;
-taper_cmd("NO-NEW-TAPE \"sorry\"");
-like(taper_reply, qr/^FAILED $handle INPUT-GOOD TAPE-ERROR "" "CONFIG:sorry"?.*$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("NO-NEW-TAPE worker0 $handle \"sorry\"");
+like(taper_reply, qr/^FAILED $handle INPUT-GOOD TAPE-ERROR "" "?sorry"?.*$/,
        "got FAILED") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 # (logs aren't that interesting here - filled with VFS-specific error messages)
 
-# TODO: simulate an "erased" tape, to which taper should reply with "NEW-TAPE" and
+# TODO: simulate an "erased" tape, to which taper should reply with "NEW-TAPE worker0 $handle" and
 # immediately REQUEST-NEW-TAPE.  I can't see a way to make the VFS device erase a
 # volume without start_device succeeding.
 
@@ -886,10 +896,124 @@ wait_for_exit();
 $handle = "44-11111";
 $datestamp = "20070102030405";
 run_taper(4096, "no tapedev", notapedev => 1);
-like(taper_reply, qr/^TAPE-ERROR 99-9999 "You must specify one of 'tapedev' or 'tpchanger'"$/,
+like(taper_reply, qr/^TAPE-ERROR SETUP "You must specify one of 'tapedev' or 'tpchanger'"$/,
        "got TAPE-ERROR") or die;
 wait_for_exit();
 
+##
+# A run with 2 workers
+my $handle0 = "66-00000";
+my $handle1 = "66-11111";
+$datestamp = "20090202020000";
+run_taper(1024, "with 2 workers", new_vtapes => 1);
+like(taper_reply, qr/^TAPER-OK worker0$/,
+       "got TAPER-OK") or die;
+taper_cmd("START-TAPER worker1 $datestamp");
+like(taper_reply, qr/^TAPER-OK worker1$/,
+       "got TAPER-OK") or die;
+make_holding_file(300000, "localhost", "/u01");
+taper_cmd("FILE-WRITE worker0 $handle0 \"$test_filename\" localhost /u01 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1612");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle0$/,
+       "got REQUEST-NEW-TAPE worker0 $handle0") or die;
+taper_cmd("START-SCAN worker0 $handle0");
+taper_cmd("NEW-TAPE worker0 $handle0");
+like(taper_reply, qr/^NEW-TAPE $handle0 TESTCONF01$/,
+       "got proper NEW-TAPE worker0 $handle0") or die;
+like(taper_reply, qr/^PARTDONE $handle0 TESTCONF01 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 1") or die;
+like(taper_reply, qr/^PARTDONE $handle0 TESTCONF01 2 36 "\[sec [\d.]+ kb 36 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 2") or die;
+like(taper_reply, qr/^DONE $handle0 INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 292 kps [\d.]+ orig-kb 1612\]" "" ""$/,
+       "got DONE") or die;
+make_holding_file(614400, "localhost", "/u02");
+taper_cmd("FILE-WRITE worker1 $handle1 \"$test_filename\" localhost /u02 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1712");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle1$/,
+       "got REQUEST-NEW-TAPE worker1 $handle1") or die;
+taper_cmd("START-SCAN worker1 $handle1");
+taper_cmd("NEW-TAPE worker1 $handle1");
+like(taper_reply, qr/^NEW-TAPE $handle1 TESTCONF02$/,
+       "got proper NEW-TAPE worker1 $handle1") or die;
+like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]"$/,
+       "got PARTDONE for filenum 1 on second tape") or die;
+like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 2 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]"$/,
+       "got PARTDONE for filenum 2 on second tape") or die;
+like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 3 88 "\[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1712\]"$/,
+       "got PARTDONE for filenum 3 on second tape") or die;
+like(taper_reply, qr/^DONE $handle1 INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 600 kps [\d.]+ orig-kb 1712\]" "" ""$/,
+       "got DONE") or die;
+taper_cmd("QUIT");
+wait_for_exit();
+
+check_logs([
+    qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
+    qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ kb 36 kps [\d.]+ orig-kb 1612\]$),
+    qr(^DONE taper localhost /u01 $datestamp 2 0 \[sec [\d.]+ kb 292 kps [\d.]+ orig-kb 1612\]$),
+    qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
+    qr(^PART taper TESTCONF02 1 localhost /u02 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PART taper TESTCONF02 2 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PART taper TESTCONF02 3 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1712\]$),
+    qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ kb 600 kps [\d.]+ orig-kb 1712\]$),
+    qr(^INFO taper tape TESTCONF01 kb 292 fm 2 \[OK\]$),
+    qr(^INFO taper tape TESTCONF02 kb 600 fm 3 \[OK\]$),
+], "two workers logged correctly");
+cleanup_log();
+
+##
+# A run with 2 workers and a take_scribe
+$handle = "66-22222";
+$datestamp = "20090202020000";
+run_taper(1024, "with 2 workers and a take_scribe", new_vtapes => 1);
+like(taper_reply, qr/^TAPER-OK worker0$/,
+       "got TAPER-OK") or die;
+taper_cmd("START-TAPER worker1 $datestamp");
+like(taper_reply, qr/^TAPER-OK worker1$/,
+       "got TAPER-OK") or die;
+make_holding_file(1000000, "localhost", "/u01");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u01 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1612");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
+like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
+       "got proper NEW-TAPE worker0 $handle") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 1") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 2") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 3") or die;
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("TAKE-SCRIBE-FROM worker0 $handle worker1");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
+like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
+       "got proper NEW-TAPE worker0 $handle") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 208 "\[sec [\d.]+ kb 208 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 4") or die;
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 976 kps [\d.]+ orig-kb 1612\]" "" ""$/,
+       "got DONE") or die;
+taper_cmd("QUIT");
+wait_for_exit();
+
+check_logs([
+    qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
+    qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF01 3 localhost /u01 $datestamp 3/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PARTPARTIAL taper TESTCONF01 4 localhost /u01 $datestamp 4/-1 0 \[sec [\d.]+ kb 96 kps [\d.]+ orig-kb 1612\] \"No space left on device\"$),
+    qr(^INFO taper Will request retry of failed split part.$),
+    qr(^INFO taper tape TESTCONF01 kb 768 fm 4 \[OK\]$),
+    qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
+    qr(^PART taper TESTCONF02 1 localhost /u01 $datestamp 4/-1 0 \[sec [\d.]+ kb 208 kps [\d.]+ orig-kb 1612\]$),
+    qr(^DONE taper localhost /u01 $datestamp 4 0 \[sec [\d.]+ kb 976 kps [\d.]+ orig-kb 1612\]$),
+    qr(^INFO taper tape TESTCONF02 kb 208 fm 1 \[OK\]$),
+], "TAKE-SCRIBE logged correctly");
+cleanup_log();
+
 ##
 # Test with NDMP device (DirectTCP)
 
@@ -904,19 +1028,21 @@ SKIP : {
     $datestamp = "19780615010305";
     run_taper(4096, "multipart directtcp PORT-WRITE",
        ndmp_server => $ndmp);
-    like(taper_reply, qr/^TAPER-OK$/,
+    like(taper_reply, qr/^TAPER-OK worker0$/,
            "got TAPER-OK") or die;
-    # note that Amanda uses the fallback splitsize here, even though it doesn't
-    # need a disk_splitbuffer
-    taper_cmd("PORT-WRITE $handle localhost /var 0 $datestamp 524288 NULL 393216");
-    like(taper_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+    # note that, with the addition of the new splitting params, this does the "sensible"
+    # thing and uses the tape_splitsize, not the fallback_splitsize (this is a change from
+    # Amanda-3.1)
+    taper_cmd("PORT-WRITE worker0 $handle localhost /var 0 $datestamp 393216 \"\" 327680 \"\" \"\" \"\" \"\" \"\" DIRECTTCP");
+    like(taper_reply, qr/^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
            "got PORT with data address");
     write_to_port($last_taper_reply, 1230*1024, "localhost", "/var", 0);
     like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-           "got REQUEST-NEW-TAPE") or die;
-    taper_cmd("NEW-TAPE");
+           "got REQUEST-NEW-TAPE worker0 $handle") or die;
+    taper_cmd("START-SCAN worker0 $handle");
+    taper_cmd("NEW-TAPE worker0 $handle");
     like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-           "got proper NEW-TAPE") or die;
+           "got proper NEW-TAPE worker0 $handle") or die;
     like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
            "got PARTDONE for part 1") or die;
     like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
@@ -924,43 +1050,42 @@ SKIP : {
     like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 64 "\[sec [\d.]+ kb 64 kps [\d.]+\]"$/,
            "got PARTDONE for part 3 (short part)") or die;
     like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-           "got REQUEST-NEW-TAPE") or die;
-    taper_cmd("NEW-TAPE");
+           "got REQUEST-NEW-TAPE worker0 $handle") or die;
+    taper_cmd("START-SCAN worker0 $handle");
+    taper_cmd("NEW-TAPE worker0 $handle");
     like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
-           "got proper NEW-TAPE") or die;
+           "got proper NEW-TAPE worker0 $handle") or die;
     like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
            "got PARTDONE for part 4") or die;
     like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 32 "\[sec [\d.]+ kb 32 kps [\d.]+\]"$/,
            "got PARTDONE for part 5") or die;
     like(taper_reply, qr/^DUMPER-STATUS $handle$/,
            "got DUMPER-STATUS request") or die;
-    taper_cmd("DONE $handle 1912");
+    taper_cmd("DONE worker0 $handle 1912");
     like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1248 kps [\d.]+ orig-kb 1912\]" "" ""$/,
            "got DONE") or die;
     $handle = "55-22222";
-    taper_cmd("PORT-WRITE $handle localhost /etc 0 $datestamp 524288 NULL 393216");
-    like(taper_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+    taper_cmd("PORT-WRITE worker0 $handle localhost /etc 0 $datestamp 524288 \"\" 393216 \"\" \"\" \"\" \"\" \"\" DIRECTTCP");
+    like(taper_reply, qr/^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
            "got PORT with data address");
     write_to_port($last_taper_reply, 300*1024, "localhost", "/etc", 0);
     like(taper_reply, qr/^PARTDONE $handle TESTCONF02 3 320 "\[sec [\d.]+ kb 320 kps [\d.]+\]"$/,
            "got PARTDONE for part 1") or die;
     like(taper_reply, qr/^DUMPER-STATUS $handle$/,
            "got DUMPER-STATUS request") or die;
-    taper_cmd("DONE $handle 2012");
+    taper_cmd("DONE worker0 $handle 2012");
     like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 320 kps [\d.]+ orig-kb 2012\]" "" ""$/,
            "got DONE") or die;
     taper_cmd("QUIT");
     wait_for_exit();
 
     check_logs([
-       qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
        qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
        qr(^PART taper TESTCONF01 1 localhost /var $datestamp 1/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
        qr(^PART taper TESTCONF01 2 localhost /var $datestamp 2/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
        qr(^PART taper TESTCONF01 3 localhost /var $datestamp 3/-1 0 \[sec [\d.]+ kb 64 kps [\d.]+\]$),
        # note no "Will retry.."
        qr(^INFO taper tape TESTCONF01 kb 832 fm 3 \[OK\]$),
-       qr(^INFO taper Will write new label `TESTCONF02' to new tape$),
        qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
        qr(^PART taper TESTCONF02 1 localhost /var $datestamp 4/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
        qr(^PART taper TESTCONF02 2 localhost /var $datestamp 5/-1 0 \[sec [\d.]+ kb 32 kps [\d.]+\]$),
@@ -974,54 +1099,55 @@ SKIP : {
     $datestamp = "19780615010305";
     run_taper(4096, "multipart directtcp PORT-WRITE, with a zero-byte part",
        ndmp_server => $ndmp);
-    like(taper_reply, qr/^TAPER-OK$/,
+    like(taper_reply, qr/^TAPER-OK worker0$/,
            "got TAPER-OK") or die;
     # use a different part size this time, to hit EOM "on the head"
-    taper_cmd("PORT-WRITE $handle localhost /var 0 $datestamp 524288 NULL 425984");
-    like(taper_reply, qr/^PORT (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
+    taper_cmd("PORT-WRITE worker0 $handle localhost /var 0 $datestamp 425984 \"\" 327680 \"\" \"\" \"\" \"\" \"\" DIRECTTCP");
+    like(taper_reply, qr/^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
            "got PORT with data address");
     write_to_port($last_taper_reply, 1632*1024, "localhost", "/var", 0);
     like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-           "got REQUEST-NEW-TAPE") or die;
-    taper_cmd("NEW-TAPE");
+           "got REQUEST-NEW-TAPE worker0 $handle") or die;
+    taper_cmd("START-SCAN worker0 $handle");
+    taper_cmd("NEW-TAPE worker0 $handle");
     like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
-           "got proper NEW-TAPE") or die;
+           "got proper NEW-TAPE worker0 $handle") or die;
     like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 416 "\[sec [\d.]+ kb 416 kps [\d.]+\]"$/,
            "got PARTDONE for part 1") or die;
     like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 416 "\[sec [\d.]+ kb 416 kps [\d.]+\]"$/,
            "got PARTDONE for part 2") or die;
     # note: zero-byte part is not reported as PARTDONE
     like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
-           "got REQUEST-NEW-TAPE") or die;
-    taper_cmd("NEW-TAPE");
+           "got REQUEST-NEW-TAPE worker0 $handle") or die;
+    taper_cmd("START-SCAN worker0 $handle");
+    taper_cmd("NEW-TAPE worker0 $handle");
     like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
-           "got proper NEW-TAPE") or die;
+           "got proper NEW-TAPE worker0 $handle") or die;
     like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 416 "\[sec [\d.]+ kb 416 kps [\d.]+\]"$/,
            "got PARTDONE for part 3") or die;
     like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
            "got PARTDONE for part 4") or die;
     like(taper_reply, qr/^DUMPER-STATUS $handle$/,
            "got DUMPER-STATUS request") or die;
-    taper_cmd("DONE $handle 2112");
+    taper_cmd("DONE worker0 $handle 2112");
     like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1632 kps [\d.]+ orig-kb 2112\]" "" ""$/,
            "got DONE") or die;
     taper_cmd("QUIT");
     wait_for_exit();
 
     check_logs([
-       qr(^INFO taper Will write new label `TESTCONF01' to new tape$),
        qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
        qr(^PART taper TESTCONF01 1 localhost /var $datestamp 1/-1 0 \[sec [\d.]+ kb 416 kps [\d.]+\]$),
        qr(^PART taper TESTCONF01 2 localhost /var $datestamp 2/-1 0 \[sec [\d.]+ kb 416 kps [\d.]+\]$),
        # Note: zero-byte part is not logged, but is counted in this INFO line's 'fm' field
        qr(^INFO taper tape TESTCONF01 kb 832 fm 3 \[OK\]$),
-       qr(^INFO taper Will write new label `TESTCONF02' to new tape$),
        qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
        qr(^PART taper TESTCONF02 1 localhost /var $datestamp 3/-1 0 \[sec [\d.]+ kb 416 kps [\d.]+\]$),
        qr(^PART taper TESTCONF02 2 localhost /var $datestamp 4/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
        qr(^DONE taper localhost /var $datestamp 4 0 \[sec [\d.]+ kb 1632 kps [\d.]+ orig-kb 2112\]$),
        qr(^INFO taper tape TESTCONF02 kb 800 fm 2 \[OK\]$),
     ], "multipart directtcp PORT-WRITE with a zero-byte part logged correctly");
+    cleanup_log();
 
     $ndmp->cleanup();
 } # end of ndmp SKIP
index b1dd55efde0cb28997beaa5170c9c3faa7fcbf0d..f43fcdcecd24696a430fd72594217fa27b63cd5d 100644 (file)
@@ -12,6 +12,7 @@ COMMON_MAN_PAGES =  amanda.8 \
                    amanda-scripts.7 \
                    amanda-archive-format.5 \
                    amanda-auth.7 \
+                   amanda-match.7 \
                    amarchiver.8 \
                    script-email.8
 
index 64dc37fdb9f06b9bba80fad9d92193686d7f909f..84f72d617cca49c67027d3cf63a5113ac717a4dd 100644 (file)
@@ -56,7 +56,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -84,7 +83,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -97,10 +95,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -114,7 +116,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -127,10 +131,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -142,21 +149,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -238,7 +249,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -258,10 +269,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -317,78 +325,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -399,12 +462,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -419,17 +511,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -438,60 +534,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -499,13 +654,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -514,9 +675,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -552,7 +716,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -561,7 +724,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -569,19 +731,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -607,47 +792,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -655,6 +896,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -677,19 +919,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -699,13 +943,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -749,6 +990,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -785,6 +1027,7 @@ COMMON_MAN_PAGES = amanda.8 \
                    amanda-scripts.7 \
                    amanda-archive-format.5 \
                    amanda-auth.7 \
+                   amanda-match.7 \
                    amarchiver.8 \
                    script-email.8
 
index 53875794aa4c9def3a8b9447c4215358222c7703..3fa88b07e946fab2276aa12314fa651ef09aee9b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amaddclient
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMADDCLIENT" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMADDCLIENT" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index d3012e03aae8306a8c468389f741d26d3cc3902d..b08d1da170135c52dcd35a45600dabecc373d0b3 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amadmin
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMADMIN" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMADMIN" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amadmin \- administrative interface to control Amanda backups
 .SH "SYNOPSIS"
 .HP \w'\fBamadmin\fR\ 'u
-\fBamadmin\fR \fIconfig\fR \fIcommand\fR [\fIcommand_options\fR...] [{\fB\-o\fR\ \fIconfigoption\fR}...]
+\fBamadmin\fR \fIconfig\fR \fIcommand\fR [\fIcommand_options\fR...] [\fB\-o\fR\ \fIconfigoption\fR...]
 .SH "DESCRIPTION"
 .PP
 \fBAmadmin\fR
@@ -46,18 +46,13 @@ for that
 if no disks are specified\&. Where
 \fIhostname\fR
 is also marked as being optional, the command operates on all hosts and disks in the
-\fBdisklist\fR(5)\&. Both
+\fBdisklist\fR(5)
+when no hostname is given\&. Both
 \fIhostname\fR
 and
 \fIdisks\fR
-are special expressions; see the "HOST & DISK EXPRESSION" section of
-\fBamanda\fR(8)
-for a description\&.
-.PP
-Commands that take one or more
-\fIdumpspec\fR
-parameters operate on the set of dumps specified by all of the expressions\&. See the "DUMP SPECIFICATIONS" section of
-\fBamanda\fR(8)
+are match expressions; see
+\fBamanda-match\fR(7)
 for a description\&.
 .PP
 \fBversion\fR
@@ -192,7 +187,9 @@ Delete holding files matching the given specification\&. At least a hostname mus
 .PP
 \fBholding list\fR [\-l] [\-d] [ \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ \&.\&. ] ] ] ]
 .RS 4
-List holding files matching the given specification, or all holding files if no specification is provided\&. With \'\-l\', additional information (size, level, and whether the dump is outdated) is provided\&. With \'\-d\', only outdated dumps are shown\&.
+List holding files matching the given dump specification, or all holding files if no specification is provided\&. See
+\fBamanda-match\fR(7)
+for more information on dump specifications\&. With \'\-l\', additional information (size, level, and whether the dump is outdated) is provided\&. With \'\-d\', only outdated dumps are shown\&.
 .sp
 An outdated holding file is one which is not required for a restore of the
 \fImost recent\fR
@@ -264,6 +261,18 @@ on
 (or all hosts)\&. Mostly used for debugging\&.
 .RE
 .PP
+\fBhosts\fR
+.RS 4
+Output a list of distinct hosts in the
+\fBdisklist\fR(5), one per line, for easy use in shell scripts\&.
+.RE
+.PP
+\fBdles\fR
+.RS 4
+Output a list of distinct DLEs in the
+\fBdisklist\fR(5), one per line with host and diskname separated by a space, for easy use in shell scripts\&.
+.RE
+.PP
 \fBinfo\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]*
 .RS 4
 Display the database record for each of the
@@ -388,9 +397,6 @@ $ amadmin daily balance
 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
 TOTAL      241  12412187   7316312   731631  (estimated 8 runs per dumpcycle)
 .fi
-.SH "FILES"
-.PP
-/usr/local/etc/amanda/\fIconfig\fR/amanda\&.conf
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
@@ -398,7 +404,8 @@ TOTAL      241  12412187   7316312   731631  (estimated 8 runs per dumpcycle)
 \fBamcheck\fR(8),
 \fBamdump\fR(8),
 \fBamrestore\fR(8),
-\fBamfetchdump\fR(8)
+\fBamfetchdump\fR(8),
+\fBamanda-match\fR(7)
 .PP
 The Amanda Wiki:
 : http://wiki.zmanda.com/
index 89eb82d34452fc13b42eb7867540d6f4711d68f3..a201c420573087a6f35e06b1cec45cfa2cd9b36b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amaespipe
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMAESPIPE" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMAESPIPE" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index c27a279bac07fc37430c5611b985b5651e51e2ba..63f47e9cbec3c3aad92470119d4e577020c71cf3 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-applications
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-APPLICATIONS" "7" "06/01/2010" "Amanda 3\&.1\&.0" "Miscellanea"
+.TH "AMANDA\-APPLICATIONS" "7" "10/18/2010" "Amanda 3\&.2\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index c258c7514fc41605441764621b2f71a160e2a026..ae2efdcb0ea4c2ef63cee412d3766bc1bcf80741 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-archive-format
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: File formats and conventions
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-ARCHIVE\-FOR" "5" "06/01/2010" "Amanda 3\&.1\&.0" "File formats and conventions"
+.TH "AMANDA\-ARCHIVE\-FOR" "5" "10/18/2010" "Amanda 3\&.2\&.0" "File formats and conventions"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index cc4bdf386e9df4ec3948e5c097a4ac46a43993e6..84e2fef22191cee0495688e74f8a11173cd7eb5c 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-auth
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-AUTH" "7" "06/01/2010" "Amanda 3\&.1\&.0" "Miscellanea"
+.TH "AMANDA\-AUTH" "7" "10/18/2010" "Amanda 3\&.2\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -30,13 +30,10 @@ parameter are
 \fBbsd\fR,
 \fBbsdudp\fR,
 \fBbsdtcp\fR,
-\fBkrb4\fR,
 \fBkrb5\fR,
 \fBlocal\fR,
 \fBrsh\fR, and
-\fBssh\fR\&. Please note that
-\fBkrb4\fR
-will be removed in the next release\&. The authentication and communication method is used during the backup process
+\fBssh\fR\&. The authentication and communication method is used during the backup process
 \fBamdump\fR
 (amdump(8)) as well as the recovery process
 \fBamrecover\fR
@@ -106,15 +103,22 @@ There are additional configure options for Kerberos if you so desire\&. All but
    \-\-with\-client\-instance=ARG     client host instance   [HOSTNAME_INSTANCE]
    \-\-with\-client\-keyfile=ARG      client host key file   [KEYFILE]
    \-\-with\-ticket\-lifetime=ARG     ticket lifetime        [128]
-   \-\-with\-krb4\-security=DIR       where libkrb\&.a lives   [see below]
    \-\-with\-krb5\-security=DIR       where libkrb\&.a lives   [see below]
 .fi
 .PP
-If configuring with \-\-with\-krb4\-security and/or \-\-with\-krb5\-security, the configure script will search under /usr/kerberos/lib, /usr/cygnus/lib, /usr/lib, and /opt/kerberos/lib for the kerberos bits, libkrb\&.a, in this order\&. Kerberos support will not be added if it does not find them\&. If the kerberos bits are found under some other hierarchy, you can specify this via \-\-with\-krb5\-security=DIR and/or \-\-with\-krb4\-security=DIR, where DIR is where the kerberos bits live\&. The configure script will then look in the \'lib\' directory under this hierarchy for libkrb\&.a\&.
+If configuring with \-\-with\-krb5\-security, the configure script will search under /usr/kerberos/lib, /usr/cygnus/lib, /usr/lib, and /opt/kerberos/lib for the kerberos bits, libkrb\&.a, in this order\&. Kerberos support will not be added if it does not find them\&. If the kerberos bits are found under some other hierarchy, you can specify this via \-\-with\-krb5\-security=DIR where DIR is where the kerberos bits live\&. The configure script will then look in the \'lib\' directory under this hierarchy for libkrb\&.a\&.
 .PP
 The
 \fBauth\fR
 parameter selects a communication/authentication method to use between the client and the backup server\&. These methods are described each in their own section below\&.
+.SS "Usernames"
+.PP
+When Amanda is built, a username is specified with the
+\fB\-\-with\-user\fR
+option\&. Most Amanda processes run under this user\'s identity, to minimize security risks\&. In binary distributions, this username is usually one of \'amanda\', \'amandabackup\', or \'backup\'\&. The examples below use \'amandabackup\' since it is unambiguous\&. You may need to adjust accordingly for your system\&.
+.SS "Authenticated Peer Hostnames"
+.PP
+Amanda\'s authentication mechanisms provide an authenticated hostname of the system on the other end of the connection, which is used to restrict access to only particular hosts\&. The degree of "authentication" performed on this hostname varies with the authentication mechanism, and is discussed below\&.
 .SH "BSD, BSDUDP, AND BSDTCP COMMUNICATION AND AUTHENTICATION"
 .PP
 For additional information including example configurations, see http://wiki\&.zmanda\&.com/index\&.php/Configuring_bsd/bsdudp/bsdtcp_authentication\&.
@@ -125,6 +129,8 @@ The
 \fBbsdtcp\fR
 communication methods use either UDP, TCP, or both protocols operating as a network service to authenticate and exchange data between server and clients\&.
 .PP
+The authentication proceeds as follows: for a new, incoming connection, Amanda verifies that the source port is in the reserved range (less than 1024), which for UNIX hosts suggests that the remote user has root privileges\&. Amanda then verifies that the reverse DNS for the remote address matches the forward DNS; that is, that the address maps to a hostname which maps back to the same address\&. Finally, the remote system must provide a username that matches the username in \&.amandahosts\&.
+.PP
 In addition to compilation and general configuration (see
 \fBCOMPILATION AND GENERAL INFORMATION\fR
 above), the authentication method that the client is configured to receive is specified by the
@@ -134,7 +140,7 @@ parameter in the network service configuration for Amanda\&. The authentication
 parameter in the client\'s Amanda network service configuration or in its amanda\-client\&.conf file (see amanda\-client\&.conf(5))\&.
 .PP
 By default, Amanda use the "amanda" service name and associated port set in /etc/services\&. It can be changed by setting the dumptype
-\fIclient_port\fR
+\fIclient\-port\fR
 option to a different port number or a different service name\&. All examples are for the service name "amanda" that uses the default port 10080\&.
 .SS "\&.amandahosts file"
 .PP
@@ -177,7 +183,7 @@ If service is omitted, it defaults to
 (which is equivalent to
 \fBamdump\fR)\&.
 .PP
-Example of the \&.amandahosts file on an Amanda client
+Example of the \&.amandahosts file on an Amanda client, where \'amandabackup\' is the Amanda dumpuser\&.
 .sp
 .nf
     \fBamandaserver\&.example\&.com   amandabackup   amdump\fR
@@ -222,7 +228,7 @@ Client example of using
 authorization for inetd server given Amanda user is "amandabackup":
 .sp
 .nf
-\fB   amanda stream tcp nowait amanda /path/to/amandad amandad \-auth=bsdtcp amdump\fR
+\fB   amanda stream tcp nowait amandabackup /path/to/amandad amandad \-auth=bsdtcp amdump\fR
 .fi
 .PP
 \fBamindexd\fR
@@ -237,7 +243,7 @@ Server example of using
 authorization for inetd server given Amanda user is "amandabackup":
 .sp
 .nf
-\fB   amanda stream tcp nowait amanda /path/to/amandad amandad \-auth=bsdtcp amdump amindexd amidxtaped\fR
+\fB   amanda stream tcp nowait amandabackup /path/to/amandad amandad \-auth=bsdtcp amdump amindexd amidxtaped\fR
 .fi
 .PP
 For Amanda version 2\&.5\&.0 and earlier, remember that neither
@@ -271,8 +277,8 @@ instead and, again, the server must be running the amandaidx and amidxtape netwo
 Example of amindexd and amidxtaped Amanda daemon services configured as their own network services for a 2\&.5\&.0 or earlier server or a newer server having 2\&.5\&.0 or earlier clients
 .sp
 .nf
-\fB   amandaidx stream tcp nowait amanda /usr/local/libexec/amanda/current/amindexd   amindexd\fR
-\fB   amidxtape stream tcp nowait amanda /usr/local/libexec/amanda/current/amidxtaped amidxtaped\fR
+\fB   amandaidx stream tcp nowait amandabackup /usr/local/libexec/amanda/current/amindexd   amindexd\fR
+\fB   amidxtape stream tcp nowait amandabackup /usr/local/libexec/amanda/current/amidxtaped amidxtaped\fR
 .fi
 .SS "USING XINETD SERVER"
 .PP
@@ -432,52 +438,24 @@ parameters in amanda\&.conf and amanda\-client\&.conf configuration files (see
 \fBamanda.conf\fR(5)
 and
 \fBamanda-client.conf\fR(5))\&.
+.SS "Authenticated Peer Hostnames with BSD Authentications"
+.PP
+The BSD authentication mechanisms only verify that the remote host\'s DNS is configured correctly and that the remote user has access to reserved ports\&. As such, the peer hostname should only be trusted to the extent that the local DNS service is trusted\&.
 .SH "KERBEROS COMMUNICATION AND AUTHENTICATION"
 
 For more detail, see http://wiki\&.zmanda\&.com/index\&.php/Kerberos_authentication\&.
 .PP
-Amanda supports Kerberos 4 and 5 communication methods between Amanda server and client\&. Please note, however, that support for Kerberos 4 will be removed in the next release\&.
+Amanda supports Kerberos 5 communication methods between Amanda server and client\&.
 .PP
 General information including compilation are given above (see
 \fBCOMPILATION AND GENERAL INFORMATION\fR
-above)\&. Below sections give specific Kerberos 4 and 5 information\&.
-.SS "KERBEROS v4"
-
-Please note that support for Kerberos 4 will be removed in the next release\&.
-
-Kerberos 4 uses UDP protocol and the number of DLEs is limited by UDP packet size\&.
-
-The kerberized AMANDA service uses a different port on the client hosts\&. The /etc/services line is:
-
-    kamanda      10081/udp
-.PP
-And the /etc/inetd\&.conf line is:
-.sp
-.nf
-    kamanda dgram udp wait root /usr/local/libexec/amanda/amandad amandad \-auth=krb4
-.fi
-.PP
-Note that you\'re running this as root, rather than as your dump user\&. AMANDA will set its uid down to the dump user at times it doesn\'t need to read the srvtab file, and give up root permissions entirely before it goes off and runs dump\&. Alternately you can change your srvtab files to be readable by user amanda\&.
-.PP
-The following dumptype options apply to krb4:
-.sp
-.nf
-auth "krb4"    # use krb4 auth for this host
-               # (you can mingle krb hosts and bsd \&.rhosts in one conf)
-kencrypt       # encrypt this filesystem over the net using the krb4
-               # session key\&.  About 2x slower\&.  Good for those root
-               # partitions containing your keyfiles\&.  Don\'t want to
-               # give away the keys to an ethernet sniffer!
-               # This is currently always enabled\&.  There is no
-               # way to disable it\&.  This is a bug\&.
-.fi
-.SS "KERBEROS v5"
+above)\&.
 .PP
 Kerberos 5 uses TCP and the server uses only one TCP port and data streams are multiplexed to this port\&.
 
 
 The \fBkrb5\fR driver script defaults to:
-
+.nf
 /*
  * The lifetime of our tickets in minutes\&.
  */
@@ -487,12 +465,15 @@ The \fBkrb5\fR driver script defaults to:
  * The name of the service in /etc/services\&.
  */
 #define AMANDA_KRB5_SERVICE_NAME        "k5amanda"
+.fi
+
 
 You can currently only override these by editing the source code\&.
 
 The kerberized AMANDA service uses a different port on the client hosts\&. The /etc/services line is:
-
+.nf
    k5amanda      10082/tcp
+.fi
 .PP
 And the /etc/inetd\&.conf line is:
 .sp
@@ -557,11 +538,16 @@ Here are examples of valid entries in the \&.k5amandahosts:
 Rather than using a \&.k5amandahosts or \&.k5login file, the easiest way is to use a principal named after the destination user, (such as amanda@TEST\&.COM in our example) and not have either a \&.k5amandahosts or \&.k5login file in the destination user\'s home directory\&.
 .PP
 There is no attempt to verify the realm in this case (only a concern if you have cross\-realm authentication setup)\&.
+.SS "Authenticated Peer Hostnames with Kerberos Authentication"
+.PP
+When accepting a new incoming connection, the Kerberos authentication mechanism performs a similar check to that done by the BSD authentications: the forward and reverse DNS entries for the remote host must match\&. As such, while Kerberos authentication can cryptographically ensure that the remote system is recognized (since it has a ticket), its assurances about the remote host\'s identity are weaker and depend on the integrity of the DNS\&.
 .SH "LOCAL COMMUNICATION"
 .PP
 The Amanda server communicates with the client internally versus over the network, ie\&. the client is also the server\&.
 .PP
 This is the only method that requires no authentication as it is clearly not needed\&.
+.PP
+The authenticated peer hostname for this authentication is always "localhost"\&.
 .SH "RSH COMMUNICATION AND AUTHENTICATION"
 
 For more detail, see http://wiki\&.zmanda\&.com/index\&.php/Configuring_rsh_authentication\&.
@@ -579,14 +565,14 @@ above)\&.
 In addition to specifying the
 \fIauth\fR
 field in dumptype definition, it might be required to specify
-\fIclient_username\fR
+\fIclient\-username\fR
 and
 \fBamandad\fR
 fields\&. If the backup user name is different on the Amanda client, the user name is specified as
-\fBclient_username\fR\&. If the location of the Amanda daemon
+\fBclient\-username\fR\&. If the location of the Amanda daemon
 \fBamandad\fR
 is different on the Amanda client, the location is specified as
-\fIamandad_path\fR
+\fIamandad\-path\fR
 field value\&.
 .sp
 .nf
@@ -594,11 +580,14 @@ For example:
 define dumptype rsh_example {
          \&.\&.\&.
          auth "rsh"
-         client_username "amandabackup"
-         amandad_path "/usr/lib/exec/amandad"
+         client\-username "amandabackup"
+         amandad\-path "/usr/lib/exec/amandad"
          \&.\&.\&.
 }
 .fi
+.SS "Authenticated Peer Hostnames with RSH Authentication"
+.PP
+The RSH authentication mechanism does not provide an authenticated peer hostname\&.
 .SH "SSH COMMUNICATION AND AUTHENTICATION"
 
 For more detail, see http://wiki\&.zmanda\&.com/index\&.php/How_To:Set_up_transport_encryption_with_SSH\&.
@@ -615,18 +604,18 @@ To use SSH, you need to set up SSH keys either by storing the passphrase in clea
 
 When you use a public key on the client to do data encryption (see http://wiki\&.zmanda\&.com/index\&.php/How_To:Set_up_data_encryption), you can lock away the private key in a secure place\&. Both, transport and storage will be encrypted with such a setup\&. See http://wiki\&.zmanda\&.com/index\&.php/Encryption for an overview of encryption options\&.
 
-Enable SSH authentication and set the ssh_keys option in all DLEs for that host by adding the following to the DLE itself or to the corresponding dumptype in amanda\&.conf:
+Enable SSH authentication and set the \fBssh\-keys\fR option in all DLEs for that host by adding the following to the DLE itself or to the corresponding dumptype in amanda\&.conf:
 
   auth "ssh"
-  ssh_keys "/home/amandabackup/\&.ssh/id_rsa_amdump"
+  ssh\-keys "/home/amandabackup/\&.ssh/id_rsa_amdump"
 
-\fIssh_keys\fR is the path to the private key on the client\&. If the username to which Amanda should connect is different from the default, then you should also add
+\fBssh\-keys\fR is the path to the private key on the client\&. If the username to which Amanda should connect is different from the default, then you should also add
 
-  client_username "otherusername"
+  client\-username "otherusername"
 
 If your server  \fBamandad\fR path and client  \fBamandad\fR path are different, you should also add
 
-  amandad_path "/client/amandad/path"
+  amandad\-path "/client/amandad/path"
 .PP
 For a marginal increase in security, prepend the keys used for AMANDA in the clients\' authorized_keys file with the following:
 .sp
@@ -645,13 +634,15 @@ In the same way, prepend the key used for AMANDA in the server\'s authorized_key
 .PP
 You can omit the from=\&.\&. option if you have too many clients to list, although this has obvious security implications\&.
 .PP
-Set ssh_keys and any other necessary options in /etc/amanda/amanda_client\&.conf:
+Set
+\fBssh\-keys\fR
+and any other necessary options in /etc/amanda/amanda_client\&.conf:
 .sp
 .nf
   auth "ssh"
-  ssh_keys "/root/\&.ssh/id_rsa_amrecover"
-  client_username "amanda"
-  amandad_path "/server/amandad/path"
+  ssh\-keys "/root/\&.ssh/id_rsa_amrecover"
+  client\-username "amanda"
+  amandad\-path "/server/amandad/path"
 .fi
 .PP
 Besides user keys, SSH uses host keys to uniquely identify each host, to prevent one host from impersonating another\&. Unfortunately, the only easy way to set up these host keys is to make a connection and tell SSH that you trust the identity:
@@ -664,6 +655,9 @@ Besides user keys, SSH uses host keys to uniquely identify each host, to prevent
 .fi
 .PP
 As Amanda will not answer this question itself, you must manually make every connection (server to client and client to server) that you expect Amanda to make\&. Note that you must use the same username that Amanda will use (that is, ssh client and ssh client\&.domain\&.com are distinct)\&.
+.SS "Authenticated Peer Hostnames with SSH Authentication"
+.PP
+When accepting an incoming conneciton, the SSH daemon gives Amanda information about the remote system in the $SSH_CONNECTION environment variable\&. Amanda parses this information to determine the remote address, and then performs a similar check to that done by the BSD authentications: the forward and reverse DNS entries for the remote host must match\&. As such, while SSH authentication can cryptographically ensure that the remote system is recognized (since it had a recognized secret key), its assurances about the remote host\'s identity are weaker and depend on the integrity of the DNS\&.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
index 503089e049808cc5d9d6df295ad8a5e9dd238e35..dd7df7fdbf502d8f09066741152413268772815d 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-changers
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-CHANGERS" "7" "06/01/2010" "Amanda 3\&.1\&.0" "Miscellanea"
+.TH "AMANDA\-CHANGERS" "7" "10/18/2010" "Amanda 3\&.2\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -68,7 +68,7 @@ define changer hp\-robot {
     tapedev "chg\-robot:/dev/sg1"
     property "tape\-device" "0=tape:/dev/nst0"
     property append "tape\-device" "1=tape:/dev/nst1"
-    device_property "BLOCK_SIZE" "512k"
+    device\-property "BLOCK_SIZE" "512k"
 }
 # \&.\&.\&.
 tapedev "hp\-robot"
@@ -82,7 +82,7 @@ example, above\&.
 .PP
 Devices, too, can take properties to control their behavior (see
 \fBamanda-devices\fR(7))\&. Device properties can come from four places: implicit device properties (from tapetype parameters), global device properties (from global
-\fIdevice_property\fR
+\fIdevice\-property\fR
 parameters), properties in device definitions, and properties in changer definitions\&. Properties are applied in this order, with later properties taking priority\&.
 .PP
 There are only three implicit properties:
@@ -148,6 +148,13 @@ setting\&. It is useful when all volumes for a configuration have different devi
 \fIchangerfile\fR
 must exist; it is used to save the state file\&.
 .PP
+The child devices are specified using the same syntax as for the RAIT device (see
+\fBamanda-changers\fR(7))\&. The range specification can be especially useful here:
+.sp
+.nf
+tpchanger "chg\-multi:s3:mycompany\-backups/tape\-{001\&.\&.100}"
+.fi
+.PP
 This changer is not fast\-search capable\&.
 .SS "Properties"
 .PP
@@ -619,6 +626,12 @@ NDMP\-USERNAME
 
 The username for the NDMP server\&.
 .RE
+.PP
+VERBOSE
+.RS 4
+
+If true, enables the NDMJOB library\'s verbose (packet\-level) debugging\&.
+.RE
 .SS "Unmaintained Changers"
 .PP
 Amanda has many other changer scripts and programs beyond those described here (see the
index 692ccc359f41c931e9b8ab607f0e4dfb2075c1f7..b7342aaf5e04e639890a78585f13fbb04159f561 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-client.conf
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: File formats and conventions
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-CLIENT\&.CON" "5" "06/01/2010" "Amanda 3\&.1\&.0" "File formats and conventions"
+.TH "AMANDA\-CLIENT\&.CON" "5" "10/18/2010" "Amanda 3\&.2\&.0" "File formats and conventions"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -43,7 +43,7 @@ Default:
 \fISet by configure\fR\&. The conf use by amrecover\&.
 .RE
 .PP
-\fBclient_username\fR \fIstring\fR
+\fBclient\-username\fR \fIstring\fR
 .RS 4
 Default:
 \fICLIENT_LOGIN\fR\&. Similar to the parameter of the same name in
@@ -54,20 +54,20 @@ should send when connecting to the server\&. It should match the username specif
 on the server\&.
 .RE
 .PP
-\fBclient_port\fR [ \fIint\fR | \fIstring\fR ]
+\fBclient\-port\fR [ \fIint\fR | \fIstring\fR ]
 .RS 4
 Default:
 \fI"amanda"\fR\&. Similar to the parameter of the same name in
 \fBamanda.conf\fR(5), this specifies the port to connect on the server\&. It can be a service name or a numeric port number\&.
 .RE
 .PP
-\fBindex_server\fR \fIstring\fR
+\fBindex\-server\fR \fIstring\fR
 .RS 4
 Default:
 \fISet by configure\fR\&. The amindexd server amrecover will connect to\&.
 .RE
 .PP
-\fBtape_server\fR \fIstring\fR
+\fBtape\-server\fR \fIstring\fR
 .RS 4
 Default:
 \fISet by configure\fR\&. The amidxtaped server amrecover will connect to\&.
@@ -102,13 +102,13 @@ to use rsh authorization\&.
 to use OpenSSH authorization\&.
 .RE
 .PP
-\fBssh_keys\fR \fIstring\fR
+\fBssh\-keys\fR \fIstring\fR
 .RS 4
 Default:
 \fINo default\fR\&. The key file the ssh auth will use, it must be the private key\&. If this parameter is not specified, then the default ssh key will be used\&.
 .RE
 .PP
-\fBgnutar_list_dir\fR \fIstring\fR
+\fBgnutar\-list\-dir\fR \fIstring\fR
 .RS 4
 Default from configure
 \fI\-\-with\-gnutar\-listdir=DIR\fR\&. The directory where gnutar keep its state file\&.
@@ -125,85 +125,85 @@ Default:
 \fI/etc/amandates\fR\&. The file where amanda keep the last date of each dumplevel\&.
 .RE
 .PP
-\fBconnect_tries\fR \fIint\fR
+\fBconnect\-tries\fR \fIint\fR
 .RS 4
 Default:
 \fI3\fR\&. How many times the server will try a connection\&.
 .RE
 .PP
-\fBrep_tries\fR \fIint\fR
+\fBrep\-tries\fR \fIint\fR
 .RS 4
 Default:
 \fI5\fR\&. How many times amandad will resend a REP packet if it doesn\'t get the ACK packet\&.
 .RE
 .PP
-\fBdebug_days\fR \fIint\fR
+\fBdebug\-days\fR \fIint\fR
 .RS 4
 Default:
 \fI3\fR\&. The number of days the debug files are kept\&.
 .RE
 .PP
-\fBdebug_amandad\fR \fIint\fR
+\fBdebug\-amandad\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the amandad process
 .RE
 .PP
-\fBdebug_amidxtaped\fR \fIint\fR
+\fBdebug\-amidxtaped\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the amidxtaped process
 .RE
 .PP
-\fBdebug_amindexd\fR \fIint\fR
+\fBdebug\-amindexd\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the amindexd process
 .RE
 .PP
-\fBdebug_amrecover\fR \fIint\fR
+\fBdebug\-amrecover\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the amrecover process
 .RE
 .PP
-\fBdebug_auth\fR \fIint\fR
+\fBdebug\-auth\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the auth module
 .RE
 .PP
-\fBdebug_event\fR \fIint\fR
+\fBdebug\-event\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the event module
 .RE
 .PP
-\fBdebug_holding\fR \fIint\fR
+\fBdebug\-holding\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the holdingdisk module
 .RE
 .PP
-\fBdebug_protocol\fR \fIint\fR
+\fBdebug\-protocol\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the protocol module
 .RE
 .PP
-\fBdebug_selfcheck\fR \fIint\fR
+\fBdebug\-selfcheck\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the selfcheck process
 .RE
 .PP
-\fBdebug_sendsize\fR \fIint\fR
+\fBdebug\-sendsize\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the sendsize process
 .RE
 .PP
-\fBdebug_sendbackup\fR \fIint\fR
+\fBdebug\-sendbackup\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the sendbackup process
@@ -305,7 +305,7 @@ No default\&. Must be set to the name of the program\&. This program must be in
 directory on the client and/or server\&.
 .RE
 .PP
-\fBexecute_where\fR [ \fBclient\fR | \fBserver\fR ]
+\fBexecute\-where\fR [ \fBclient\fR | \fBserver\fR ]
 .RS 4
 Default:
 \fBclient\fR\&. Where the script must be executed, on the client or server\&. Only
@@ -313,7 +313,7 @@ Default:
 is valid\&.
 .RE
 .PP
-\fBexecute_on\fR \fIexecute_on\fR[,\fIexecute_on\fR]*
+\fBexecute\-on\fR \fIexecute_on\fR[,\fIexecute_on\fR]*
 .RS 4
 No default\&. When the script must be executed, you can specify many of them:
 .PP
index cc9f4085eca5ff7d0e36181002a55d46e176db33..648e71957f967e9e9cfb555d8108c267bdba1ffb 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-compatibility
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-COMPATIBILIT" "7" "06/01/2010" "Amanda 3\&.1\&.0" "Miscellanea"
+.TH "AMANDA\-COMPATIBILIT" "7" "10/18/2010" "Amanda 3\&.2\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -40,6 +40,76 @@ To restore a dump created with the tapesplit_size option using amrecover, you ne
 .SH "UPGRADES"
 .PP
 The recommended course for Amanda upgrades is to upgrade the server first, and test backups and restores before upgrading clients\&. Consult the changes described below for the relevant span of versions to determine what adjustments, if any, are required\&. Also see the NEWS file shipped with each Amanda release for more detailed information\&.
+.SS "Amanda 3\&.2"
+.PP
+The following configuration configration keywords are deprecated\&. This is currently a warning, but will become an error soon\&.
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fBamrecover\-do\-fsf\fR
+\- amrecover always seeks to files when recovering
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fBamrecover\-check\-label\fR
+\- amrecover always checks the volume label when recovering
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Dumptype parameters
+\fBtape\-splitsize\fR,
+\fBsplit\-diskbuffer\fR, and
+\fBfallback\-splitsize\fR
+\- see
+\fBallow\-split\fR
+and tapetype parameters
+\fBpart\-size\fR,
+\fBpart\-cache\-type\fR,
+\fBpart\-cache\-dir\fR, and
+\fBpart\-cache\-max\-size\fR\&. See
+\fBamanda.conf\fR(5)
+for more information on these new parameters, noting particularly that all but the first are tapetype parameters, not dumptype parameters\&.
+.sp
+To convert most cases to the new parameters, set
+\fBpart\-size\fR
+to the old value of
+\fBtape\-splitsize\fR
+and
+\fBpart\-cache\-dir\fR
+to the old value of
+\fBsplit\-diskbuffer\fR, if present\&. If
+\fBsplit\-diskbuffer\fR
+was set, then set
+\fBpart\-cache\-type\fR
+to
+\fBdisk\fR, otherwise
+\fBmemory\fR\&. Finally, if using memory caching, set
+\fBpart\-cache\-max\-size\fR
+to the previous value of
+\fBfallback\-splitsize\fR\&. Be sure to remove all of the old keywords from your configuration\&.
+.RE
+.sp
+.RE
 .SS "Amanda 3\&.1"
 .PP
 Although it is a significant rewrite, there are no incompatible changes in this release\&.
@@ -51,7 +121,7 @@ are particularly encouraged to consider the much more intelligent
 \fBamanda-changers\fR(7)
 for more information\&.
 .PP
-The following configuration configration keywords are deprecated\&. This is currently a warning, but will become an error soon\&.
+The following configuration configration keywords are deprecated\&. This is currently a warning, but will become an error in a future version\&.
 .sp
 .RS 4
 .ie n \{\
index 72f587878ba0d9581ead89f70b9bfede79462a10..9899670b2fd8b2e4b9d81191669eb3459c4138f5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-devices
 .\"    Author: Ian Turner <ian@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-DEVICES" "7" "06/01/2010" "Amanda 3\&.1\&.0" "Miscellanea"
+.TH "AMANDA\-DEVICES" "7" "10/18/2010" "Amanda 3\&.2\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -45,7 +45,7 @@ with "device" sections, e\&.g\&.,
 .nf
 define device top_drive {
     tapedev "tape:/dev/nst0"
-    device_property "BLOCK_SIZE" "131072"
+    device\-property "BLOCK_SIZE" "131072"
 }
 .fi
 Such a device defininition creates a device "alias", in this case named
@@ -116,9 +116,9 @@ with the
 parameter\&. The syntax looks like this:
 .sp
 .nf
-device_property "FROBNICATOR_PATH" "/var/frobd/state"
-device_property "BYTES_PER_FORTNIGHT" "128k"
-device_property "USE_QUBITS" "no"
+device\-property "FROBNICATOR_PATH" "/var/frobd/state"
+device\-property "BYTES_PER_FORTNIGHT" "128k"
+device\-property "USE_QUBITS" "no"
 .fi
 .PP
 Both the property name and the property value are always quoted\&. Property names, like Amanda configuration parameters, are not case\-sensitive, and
@@ -152,7 +152,7 @@ Tapetype parameters (including length, blocksize, and readblocksize) are transla
 .sp -1
 .IP "  2." 4.2
 .\}
-Device properties from any device_property configuration parameters are set, in the order they appear in the configuration file\&.
+Device properties from any device\-property configuration parameters are set, in the order they appear in the configuration file\&.
 .RE
 .PP
 Properties described as read\-only are not accessible to users\&. They are listed here for completeness\&.
@@ -202,16 +202,16 @@ CONCURRENCY
  (read\-only) This property indicates the level of concurrent access that this device supports\&.
 .RE
 .PP
-FREE_SPACE
+FULL_DELETION
 .RS 4
 
- (read\-only) This property gives the amount of free space available on the current volume, if known\&.  This is often an estimate; for example, tape devices can only estimate the amount of tape left on a spool\&.
+ (read\-only) This property indicates whether the device supports erasing the entire volume\&.  Aside from S3 and VFS, most devices cannot support this feature\&.
 .RE
 .PP
-FULL_DELETION
+LEOM
 .RS 4
 
- (read\-only) This property indicates whether the device supports erasing the entire volume\&.  Aside from S3 and VFS, most devices cannot support this feature\&.
+(read\-write) If this property is true, then the device can detect an EOM condition before actually running out of space, allowing Amanda to forgo caching parts while writing\&.  For some devices, it is necessary to override the conservative default value of this property\&.
 .RE
 .PP
 MAX_BLOCK_SIZE
@@ -247,7 +247,14 @@ PARTIAL_DELETION
 STREAMING
 .RS 4
 
- (read\-only) This property gives the streaming requirement for this device\&.  For example, tape drives often require a steady supply of data to avoid shoe\-shining, while disk devices have no such requirement\&.
+(read\-only) This property gives the streaming requirement for this device\&.  For
+example, tape drives often require a steady supply of data to avoid
+shoe\-shining, while disk devices have no such requirement\&.  Streaming is
+accomplished by buffering \fBdevice\-output\-buffer\-size\fR bytes of
+data\&.  The allowed values are "none" (no streaming buffer necessary),
+"required" (fill the buffer before starting to write), or "desired" (fill the
+buffer before starting to write, and if the buffer becomes empty, stop writing
+until it is completely full again)\&.
 .RE
 .PP
 VERBOSE
@@ -278,6 +285,11 @@ Most devices are flexible enough to read a volume using a different block size t
 The RAIT device does not support flexible block sizes, as its parity algorithm requires that all child devices have the same, fixed block size\&.
 .sp .5v
 .RE
+.SS "LEOM DETECTION"
+.PP
+Some Amanda devices can detect end\-of\-medium (running out of space on the device) before it occurs\&. This early warning is referred to as logical EOM, and where it is supported Amanda can operate more efficiently, since the possibility for data loss is reduced\&.
+.PP
+The boolean LEOM property indicates whether or not a particular device supports LEOM detection\&. The sections below also describe the degree of support\&.
 .SH "DEVICES"
 .PP
 This section lists the device drivers included with Amanda, and basic instructions for using them\&. For complete How\-To information, consult the Amanda wiki at http://wiki\&.zmanda\&.com\&.
@@ -295,7 +307,13 @@ tapedev "rait:tape:/dev/rmt/tps0d{4,5,6}n"
 The RAIT device driver mirrors or stripes data over multiple "child" devices\&. The child devices are specified using a shell\-like syntax, where alternatives are enclosed in braces and separated by commas\&. Braces and commas can be escaped with a backslash\&. Note that the backslash itself must be escaped in most contexts\&. For example:
 .sp
 .nf
-tapedev "rait:{commandev:foo\e\e,bar,bracedev:foo\e\e}bar}"
+tapedev "rait:{file:/var/amanda/vtapes,tape:/dev/nst0}"
+tapedev "rait:{comma\-dev:foo\e\e,bar,brace\-dev:foo\e\e}bar}" # quoting
+.fi
+If the braces contain a numeric range separated with two dots, that range will be filled in sequentially\&. If the first number has a leading zero, then the results will be zero\-padded to the maximum length\&. For example:
+.sp
+.nf
+tapedev "rait:file:/var/amanda/vtapes/drive{01\&.\&.04}"
 .fi
 .PP
 With two child devices, the RAIT device driver mirrors data such that the two devices contain identical data and can be used singly for recovery\&. With more than two devices, the RAIT device "stripes" data across all but one device and writes a parity block to the final device, usable for data recovery in the event of a device or volume failure\&. The RAIT device scales its blocksize as necessary to match the number of children that will be used to store data\&.
@@ -308,6 +326,8 @@ tapedev "rait:{tape:/dev/st0,ERROR,tape:/dev/st2}"
 This will cause the RAIT device to start up in degraded mode, reconstructing the data from the missing device\&.
 .PP
 Like ordinary RAID drivers, the RAIT device driver can automatically enter degraded mode when one of its child devices fails\&. However, the RAIT device cannot automatically recover from any write error nor write any data in degraded mode\&. When reading, certain errors may be fatal (rather than causing degraded mode)\&. And in any case, labels on all volumes must initially match (labeled or otherwise)\&. If you have lost one volume from a set, explicitly start the device in degraded mode as described above\&.
+.PP
+This device can detect LEOM if and only if all of the child devices can detect LEOM\&.
 .SS "Child Device Block Sizes"
 .PP
 The RAIT device driver requires that all of its child devices use the same block size\&. If no block sizes are specified, the driver selects the block size closest to 32k that is within the MIN_BLOCK_SIZE \- MAX_BLOCK_SIZE range of all child devices, and calculates its own blocksize according to the formula
@@ -316,8 +336,8 @@ The RAIT device driver requires that all of its child devices use the same block
 .SS "S3 Device"
 .nf
 tapedev "s3:foocorp\-backups/DailySet1\-"
-device_property "S3_ACCESS_KEY" "MYACCESSKEY"
-device_property "S3_SECRET_KEY" "MYSECRETKEY"
+device\-property "S3_ACCESS_KEY" "MYACCESSKEY"
+device\-property "S3_SECRET_KEY" "MYSECRETKEY"
 .fi
 .PP
 The S3 device driver uploads data to the Amazon S3 "storage cloud"\&. Its device name is a slash\-sparated combination of bucket name and prefix: "s3:BUCKET/PREFIX"\&. Since buckets must be unique across all Amazon S3 users, and since the number of buckets allowed to each user is limited, the driver can store multiple Amanda volumes in a single S3 bucket, distinguished by prefix\&. The prefix and slash can be omitted if they are not needed: "s3:BUCKET"\&.
@@ -326,7 +346,7 @@ The access and secret keys used to authenticate to Amazon S3 are provided as pro
 .PP
 The S3 device driver stores each block in a distinct S3 object\&. Due to high HTTP overhead for each request, use of larger than normal block sizes (> 1 megabyte) is reccomended with the S3 device\&.
 .PP
-Amanda automatically creates a bucket when writing, if the bucket doesn\'t already exist\&. At that time, it specifies where Amazon should store the data based on the S3_BUCKET_LOCATION property\&. Currently, there are two valid settings: "*" (any location, probably US) and "EU" (Europe)\&. If this property is not set, Amazon\'s default value of "*" is used\&. The bucket location has both billing and legal concerns, so you are encouraged to consult Amazon\'s documentation for details\&.
+Amanda automatically creates a bucket when writing, if the bucket doesn\'t already exist\&. At that time, it specifies where Amazon should store the data based on the S3_BUCKET_LOCATION property\&. If this property is not set, Amazon\'s default value (equivalent to "*") is used\&. The bucket location has both billing and legal concerns, so you are encouraged to consult Amazon\'s documentation for details\&.
 .PP
 Amazon does not permit changes to bucket locations, so this is a permanent specification\&. If the bucket already exists and the property is set, then Amanda checks the property against the location of the bucket, and produces an error if they do not match\&.
 .if n \{\
@@ -347,6 +367,8 @@ If a location constraint is set, the bucket name must consist only of lower\-cas
 .RE
 .PP
 This driver supports the VERBOSE property, but use it carefully \-\- it produces a great deal of output, and may cause spurious failures by filling your debug log partition\&. Its logging is generally only useful for developers chasing down a problem in communications with Amazon\'s servers\&.
+.PP
+Since Amazon storage is unlimited, the device never encounteres EOM, so LEOM detection is trivially enabled for this device\&.
 .SS "Device-Specific Properties"
 .PP
 In addition to the common properties, the S3 device supports the properties listed in this section\&.
@@ -354,8 +376,8 @@ In addition to the common properties, the S3 device supports the properties list
 Most Amanda devices work just fine without any properties, but not the S3 device\&. A typical S3 configuration will have an access key and secret key specified:
 .sp
 .nf
-device_property "S3_ACCESS_KEY" "27D3B8C6C4E7AA423C2B37C72A0D22C8"
-device_property "S3_SECRET_KEY" "agphc2Q7Zmxragphc2RmO2xragpzZGY7a2xqCgr"
+device\-property "S3_ACCESS_KEY" "27D3B8C6C4E7AA423C2B37C72A0D22C8"
+device\-property "S3_SECRET_KEY" "agphc2Q7Zmxragphc2RmO2xragpzZGY7a2xqCgr"
 .fi
 .PP
 MAX_RECV_SPEED
@@ -384,9 +406,9 @@ S3_BUCKET_LOCATION
 .RS 4
 
  (read\-write) Location constraint for buckets on Amazon S3\&.
-Currently, it can be set to "", for no constraint (i\&.e\&. store data in the US),
-or "EU" (i\&.e\&. store data in the EU)\&.
-See Amazon\'s documentation for details and latest information
+As of this writing, it can be set to "*" (US Standard, i\&.e\&. lowest\-latency
+choice of US East or West), "us\-west\-1" (US West, Northern California), "EU"
+(European Union), or "ap\-southeast\-1" (Asia Pacific)\&.  See : http://docs.amazonwebservices.com/AmazonS3/latest/index.html?LocationSelection.html for the most up\-to\-date list\&.
 .RE
 .PP
 SSL_CA_INFO
@@ -406,6 +428,15 @@ S3_SECRET_KEY
  (read\-write) This property gives the Amazon S3 secret key used to access the service\&.
 .RE
 .PP
+S3_STORAGE_CLASS
+.RS 4
+
+(read\-write) Storage class for new objects, currently one of "STANDARD" (the default)
+or "REDUCED_REDUNDANCY" (cheaper, but less redundant)\&.  See
+: http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?DataDurability.html
+for the most up\-to\-date list\&.
+.RE
+.PP
 S3_SSL
 .RS 4
 
@@ -431,6 +462,8 @@ tapedev "tape:/dev/nst0"
 The tape device driver interacts with a tape drive\&. The device uses the operating system\'s built\-in tape support, which is generally similar to that available via the command\-line utilities dd(1) and mt(1)\&.
 .PP
 The tape device name should specify a path to the operating system\'s device file\&.
+.PP
+There is no simple way to determine whether a particular system (operating system and tape hardware) supports LEOM, so as a safe default the tape device has LEOM detection disabled\&. However, on modern hardware and common operating systems (Linux, *BSD, and Solaris, at least), LEOM support is functional\&. On these systems, enable LEOM by setting the LEOM property to "true" at the appropriate place in the Amanda configuration\&.
 .SS "Device-Specific Properties"
 .PP
 Most of these properties are automatically detected, but can be overridden in the configuration file if the autodetection fails\&. Note that tape drives are required to at least support the MTREW (rewind) operation; all other operations can be emulated with the MTREW and read data operations\&.
@@ -509,12 +542,14 @@ READ_BLOCK_SIZE
 .SS "NDMP Device"
 .nf
 tapedev "ndmp:my\&.filer\&.com:10000@st1"
-device_property "NDMP_USERNAME" "jimmy"
-device_property "NDMP_PASSWORD" "thelock"
+device\-property "NDMP_USERNAME" "jimmy"
+device\-property "NDMP_PASSWORD" "thelock"
 .fi
 .PP
 This device enables Amanda to communicate with a tape service on an NDMP server\&. The device name specifies the hostname and optionally the TCP port of the NDMP server, followed by the name of the tape device on the server (\fBst1\fR
 in the example above)\&.
+.PP
+This device supports LEOM detection\&.
 .SS "Device-Specific Properties"
 .PP
 The properties
@@ -542,6 +577,12 @@ NDMP_USERNAME
 
 (read\-write) Username for md5 or text authentications\&.
 .RE
+.PP
+READ_BLOCK_SIZE
+.RS 4
+
+(read\-write) This property specifies the block size that will be used for reads; this should be large enough to contain any block that may be read from the device and must be larger than BLOCK_SIZE\&. See BLOCK_SIZES, above\&.
+.RE
 .SS "VFS Device"
 .nf
 tapedev "file:/path/to/vtape"
@@ -550,12 +591,25 @@ tapedev "file:/path/to/vtape"
 The VFS device driver stores data on a UNIX filesystem\&. Note that although one typically uses the VFS device driver to store data on hard disks, the driver does not interface with any hardware on a block level\&.
 .PP
 The device name specifies a path to a directory which must exist and contain a "data/" subdirectory\&. Each tape file is stored as a distinct file in this directory, the name of which reflects the Amanda header in the tape file\&. Block boundaries are not maintained: the driver supports reads of arbitrary size, regardless of the blocksize used to write the data\&.
+.PP
+This device supports LEOM detection\&. LEOM will be indicated when the MAX_VOLUME_USAGE is nearly met, or when the filesystem is nearly out of space\&. The latter circumstance is detected by monitoring the available space on the filesystem, and this monitoring can be disabled with the MONITOR_FREE_SPACE property\&. Note that the device cannot detect other circumstances that may cause a write to fail, such as a filesystem quota\&. LEOM detection can be disabled by setting the LEOM property to false\&.
+.SS "Device-Specific Properties"
+.PP
+MONITOR_FREE_SPACE
+.RS 4
+
+        (read\-write) This property controls whether the device will monitor
+        the filesystem\'s free space to detect a full filesystem before an
+        error occurs, and defaults to true\&.  The monitoring operation works on
+        most filesystems, but if it causes problems, use this property to
+        disable it\&.
+.RE
 .SS "DVD\-RW Device"
 .nf
 tapedev "dvdrw:/var/cache/amanda/dvd\-cache:/dev/scd0"
-device_property "DVDRW_MOUNT_POINT" "/media/dvd"
-device_property "DVDRW_KEEP_CACHE" "false"
-device_property "DVDRW_UNLABELLED_WHEN_UNMOUNTABLE" "true"
+device\-property "DVDRW_MOUNT_POINT" "/media/dvd"
+device\-property "DVDRW_KEEP_CACHE" "false"
+device\-property "DVDRW_UNLABELLED_WHEN_UNMOUNTABLE" "true"
 .fi
 .PP
 The DVD\-RW device driver reads and writes optical media such as DVDs and CDs\&. The device name must specify a cache directory for data to be temporarily stored, followed by the operating system name for the optical drive\&. The cache directory must contain a "data/" subdirectory\&.
@@ -570,11 +624,13 @@ Note the "user" option\&.
 When writing data, the device acts as a VFS device using the given cache directory\&. On completion of writing the tape, the cache directory is written to optical media\&. The DVDRW_KEEP_CACHE property controls whether the cache contents are immediately deleted\&. When reading, the optical media is first mounted and read as a VFS device\&.
 .PP
 Attempting to mount unformatted media or media that is formatted but contains no filesystem will usually result in an error\&. The boolean DVDRW_UNLABELLED_WHEN_UNMOUNTABLE property specifies whether media that cannot be mounted should be treated as an empty, unlabelled volume when attempting to read the volume label\&. It is necessary to set this property to "true" when labelling such media\&.
+.PP
+This device does not support LEOM detection\&.
 .SS "Device-Specific Properties"
 .PP
 The properties DVDRW_GROWISOFS_COMMAND, DVDRW_MOUNT_COMMAND and DVDRW_UMOUNT_COMMAND specify alternative commands for writing, mounting and unmounting optical media\&. The default is to find the programs using the PATH environment variable\&.
 .PP
-The DVDRW_MOUNT_POINT property is required\&. Other properties are optional\&.
+The CDRW device supports all of the properties of the VFS device, as well as the properties given below\&. The DVDRW_MOUNT_POINT property is required\&. Other properties are optional\&.
 .PP
 DVDRW_KEEP_CACHE
 .RS 4
diff --git a/man/amanda-match.7 b/man/amanda-match.7
new file mode 100644 (file)
index 0000000..34cf1ce
--- /dev/null
@@ -0,0 +1,316 @@
+'\" t
+.\"     Title: amanda-match
+.\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
+.\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
+.\"      Date: 10/18/2010
+.\"    Manual: Miscellanea
+.\"    Source: Amanda 3.2.0
+.\"  Language: English
+.\"
+.TH "AMANDA\-MATCH" "7" "10/18/2010" "Amanda 3\&.2\&.0" "Miscellanea"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+amanda-match \- Common Amanda Match Expression
+.SH "DESCRIPTION"
+.PP
+Several Amanda commands allow the user to specify dumps using "match expressions"\&. This manual page describes the syntax of these expressions\&.
+.PP
+In some places, only certain match expressions are allowed\&. However, several commands take a dump specification ("dumpspec") consisting of a sequence of several expressions intended to match particular dumps in the catalog\&. Other applications take a DLE specification which indicates a set of DLEs to be operated on\&. These formats are described below\&.
+.SH "HOST & DISK EXPRESSIONS"
+.PP
+The hosts and disks match by word\&. Each word is a glob expression, and words are separated by the character \'\&.\' for host expressions and \'/\' for disk expressions\&. You can anchor the expression on the left with a \'^\' or on the right with a \'$\'\&. The matcher is case insensitive for hosts but case sensitive for disks\&. A match succeeds if all words in the expression match contiguous words in the host or disk\&.
+.PP
+If the disk is a UNC ("\e\ewindows\eshare") then all \'\e\' are converted to \'/\' before the match\&. Using \'\e\' is complicated because of the extra quoting required by the shell and amanda\&. It\'s easier to use \'/\' because it requires less quoting ("//windows/share")
+.PP
+The special characters follow\&. Note that the shell interprets some of these characters, so when used on the command line, they must be escaped appropriately for the shell\&.
+.PP
+dot (\&.)
+.RS 4
+word separator for a host
+.RE
+.PP
+/
+.RS 4
+word separator for a disk
+.RE
+.PP
+\e
+.RS 4
+word separator for a UNC disk
+.RE
+.PP
+^
+.RS 4
+anchor at left of word
+.RE
+.PP
+$
+.RS 4
+anchor at right of word
+.RE
+.PP
+?
+.RS 4
+match exactly one character except the separator
+.RE
+.PP
+*
+.RS 4
+match zero or more characters except the separator
+.RE
+.PP
+**
+.RS 4
+match zero or more characters including the separator
+.RE
+.PP
+[\&.\&.\&.]
+.RS 4
+match exactly one of the characters enclosed by the brackets\&.
+.RE
+.PP
+[!\&.\&.\&.]
+.RS 4
+match exactly one character that is not enclosed by the brackets\&.
+.RE
+.SS "Examples"
+.PP
+hosta
+.RS 4
+Will match
+hosta,
+foo\&.hosta\&.org, and
+hoSTA\&.dOMAIna\&.ORG
+but not
+hostb\&.
+.RE
+.PP
+host
+.RS 4
+Will match
+host
+but not
+hosta\&.
+.RE
+.PP
+host?
+.RS 4
+Will match
+hosta
+and
+hostb, but not
+host
+or
+hostabc\&.
+.RE
+.PP
+ho*na
+.RS 4
+Will match
+hoina
+but not
+ho\&.aina\&.org\&.
+.RE
+.PP
+ho**na
+.RS 4
+Will match
+hoina
+and
+ho\&.aina\&.org\&.
+.RE
+.PP
+^hosta
+.RS 4
+Will match
+hosta
+but not
+foo\&.hosta\&.org\&.
+.RE
+.PP
+sda*
+.RS 4
+Will match
+/dev/sda1
+and
+/dev/sda12\&.
+.RE
+.PP
+/opt
+.RS 4
+Will match the disk
+opt
+but not the host
+opt\&.
+.RE
+.PP
+(note dots:) \&.opt\&.
+.RS 4
+Will match the host
+opt
+but not the disk
+opt\&.
+.RE
+.PP
+/
+.RS 4
+Will match the disk
+/
+but no other disk\&.
+.RE
+.PP
+/usr
+.RS 4
+Will match the disks
+/usr
+and
+/usr/local\&.
+.RE
+.PP
+/usr$
+.RS 4
+Will match the disks
+/usr
+but not
+/usr/local\&.
+.RE
+.PP
+share
+.RS 4
+Will match the disks
+\e\ewindows1\eshare
+and
+\e\ewindows2\eshare\&.
+.RE
+.PP
+share*
+.RS 4
+Will match the disks
+\e\ewindows\eshare1
+and
+\e\ewindows\eshare2\&.
+.RE
+.PP
+//windows/share
+.RS 4
+Will match the disk
+\e\ewindows\eshare\&.
+.RE
+.SH "DATESTAMP EXPRESSIONS"
+.PP
+A datestamp expression is either a prefix of the datestamp, or a range expression (separated by \'\-\') matching several prefixes\&. A leading ^ is removed, while arailing $ will force an exact match\&.
+.SS "Examples"
+.PP
+20001212\-14
+.RS 4
+match all dates beginning with 20001212, 20001213 or 20001214
+.RE
+.PP
+20001212\-4
+.RS 4
+same as previous
+.RE
+.PP
+20001212\-24
+.RS 4
+match all dates between 20001212 and 20001224
+.RE
+.PP
+2000121
+.RS 4
+match all dates that start with 2000121 (20001210\-20001219)
+.RE
+.PP
+2
+.RS 4
+match all dates that start with 2 (20000101\-29991231)
+.RE
+.PP
+2000\-10
+.RS 4
+match all dates between 20000101\-20101231
+.RE
+.PP
+200010$
+.RS 4
+match only 200010
+.RE
+.SH "LEVEL EXPRESSIONS"
+.PP
+Level expressions are either prefix matches e\&.g\&., "1", which matches "1", "10", and "123", absolute matches e\&.g\&., "3$" which only matches "3", or a range e\&.g\&., "3\-5" which only matches levels 3, 4, and 5\&.
+.SH "DUMP SPECIFICATIONS"
+.PP
+A dump specification is used to select one or more dumps from the catalog\&. It consists of a sequence of match expressions in the order host, disk, datestamp, and level\&. Note that some commands do not take a level argument, out of historical accident\&. Note, too, that the datestamp expression matches the time that the dump was made on the Amanda client, rather than the date it was moved to tape\&.
+.SS "Examples"
+.PP
+amtool MyConfig ^vpdesktop$
+.RS 4
+all dumps of host "vpdesktop"
+.RE
+.PP
+amtool MyConfig \'*\' /var/stage
+.RS 4
+All dumps of
+/var/stage
+on any host
+.RE
+.PP
+amtool MyConfig www1 /var/www \'*\' www2 /var/www \'*\'
+.RS 4
+All dumps of /var/www on www1 and www2 (assuming amtool does not require a level argument)
+.RE
+.SH "DLE SPECIFICATIONS"
+.PP
+A DLE specification is used to select one or more DLEs\&. It consists of a sequence of match expressions\&. The first must be a host, and subsequent expressions will be experimentally matched against both hosts and disks in the
+\fBdisklist\fR(5), preferring hosts\&. This dynamic matching process can lead to odd behavior in extreme cases (e\&.g\&., where a disk and a host have the same name), but for most uses does exactly what is expected\&.
+.SS "Examples"
+.PP
+amtool MyConfig vpdesktop /home/anderson
+.RS 4
+/home/anderson
+on host vpdesktop
+.RE
+.PP
+amtool MyConfig \'*\' ^/etc \'*\' ^/var
+.RS 4
+All DLEs matching
+^/var
+or
+^/etc
+on any host
+.RE
+.PP
+amtool MyConfig web1 www web2 www
+.RS 4
+If no host matches "www", all DLEs matching
+www
+on hosts web1 and web2\&. If a host matches "www", then all DLEs on hosts www, web1, and web2\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fBamanda\fR(8),
+\fBamanda\fR(8),
+\fBamfetchdump\fR(8),
+\fBamrestore\fR(8),
+\fBamadmin\fR(8),
+\fBamvault\fR(8),
+\fBamflush\fR(8),
+\fBamdump\fR(8)
+.PP
+The Amanda Wiki:
+: http://wiki.zmanda.com/
+.SH "AUTHOR"
+.PP
+\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&>
+.RS 4
+Zmanda, Inc\&. (http://www\&.zmanda\&.com)
+.RE
index 35cd7db79ac7d7261f94a29e5389182a42f5c019..2e827d658870b95edfd8a29a19486e7f5ec71935 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-scripts
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-SCRIPTS" "7" "06/01/2010" "Amanda 3\&.1\&.0" "Miscellanea"
+.TH "AMANDA\-SCRIPTS" "7" "10/18/2010" "Amanda 3\&.2\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 290d25f380a65024ad38680c3df15bc96c404342..a1a0bad12200419108d7abc1ba59523e27a71a53 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-taperscan
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-TAPERSCAN" "7" "06/01/2010" "Amanda 3\&.1\&.0" "Miscellanea"
+.TH "AMANDA\-TAPERSCAN" "7" "10/18/2010" "Amanda 3\&.2\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -57,8 +57,9 @@ This algorithm duplicates Amanda\'s historical behavior, and it operates in two
 First, if there is an oldest reusable volume and if the changer supports "fast" searches, then the algorithm uses the changer to search for that volume\&. Newly labeled volumes are not considered when calculating the oldest reusable volume\&. Consequently, this taperscan algorithm prefers volumes which have been used before to newly\-labeled volumes when a fast\-searchable changer is in use\&.
 .PP
 Second, if there is no oldest reusable volume, or if that volume is not available in the changer, then the algorithm begins a sequential scan of the changer, starting at the current slot\&. It selects the first suitable volume it finds: a reusable volume (perhaps newly\-labeled) or, if
-\fIlabel_new_tapes\fR
-is true, a blank volume\&. Even across multiple invocations (when
+\fBautolabel\fR
+includes
+\fBempty\fR, a blank volume\&. Even across multiple invocations (when
 \fIruntapes > 1\fR), it will not return the same slot twice\&.
 .if n \{\
 .sp
index b83fb7a0b9258f4907a3cfe00fdcf6e930a4c1fa..7841959363c8083a2cbe41ac4b4bcd36f19d1220 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMANDA" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -599,6 +599,17 @@ Here are all the Amanda commands\&. Each one has its own manual page\&. See them
 .sp -1
 .IP \(bu 2.3
 .\}
+\fBamanda-match\fR(7),
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fBamanda-scripts\fR(7),
 .RE
 .sp
@@ -612,7 +623,7 @@ Here are all the Amanda commands\&. Each one has its own manual page\&. See them
 .\}
 \fBamanda-taperscan\fR(7),
 .RE
-.SH "CONFIGURATION"
+.SH "CONFIGURATION FILES"
 .PP
 There are four user\-editable files that control the behavior of Amanda\&.
 .PP
@@ -643,315 +654,7 @@ Most Amanda applications take a "config" parameter; this is generally the (unqua
 normal\&. If the parameter is
 \&.
 (dot), the current directory is used\&. This feature is present for backward compatibility, but is not commonly used\&.
-.SH "LOG FILES"
-.PP
-All log and database files generated by Amanda go in corresponding directories somewhere\&. The exact location is controlled by entries in
-\fBamanda.conf\fR(5)\&. A typical location would be under
-/var/adm/amanda\&. For the above example, the files might go in
-/var/adm/amanda/normal/
-and
-/var/adm/amanda/archive/\&.
-.PP
-As log files are no longer needed (no longer contain relevant information), Amanda cycles them out in various ways, depending on the type of file\&.
-.PP
-Detailed information about
-\fBamdump\fR
-runs are stored in dump logs \-\- files named
-\fBamdump\&.\fR\fINN\fR
-where
-\fINN\fR
-is a sequence number, with 1 being the most recent file\&.
-\fBAmdump\fR
-rotates these files each run, keeping roughly the last
-\fBtapecycle\fR
-(see below) worth of them\&.
-.PP
-The file used by
-\fBamreport\fR
-to generate the mail summary is the trace log\&. This file constitutes the "catalog" describing the data on the tapes written in a run\&. It is named
-\fBlog\&.\fR\fIYYYYMMDDHHMMSS\&.NN\fR
-where
-\fIYYYYMMDDHHMMSS\fR
-is the datestamp of the start of the
-\fBamdump\fR
-or
-\fBamflush\fR
-run and
-\fINN\fR
-is a sequence number started at 0\&. At the end of each
-\fBamdump\fR
-run, log files for runs whose tapes have been reused are renamed into a subdirectory of the main log directory (see the
-\fBlogdir\fR
-parameter below) named
-\fBoldlog\fR\&. It is up to the Amanda administrator to remove them from this directory when desired\&.
-.PP
-Index (backup image catalogue) files older than the full dump matching the oldest backup image for a given client and disk are removed by
-\fBamdump\fR
-at the end of each run\&.
-.SH "USING SAMBA"
-.PP
-For Samba access, Amanda needs a file on the Samba server (which may or may not also be the tape server) named
-/etc/amandapass
-with share names, (clear text) passwords and (optional) domain names, in that order, one per line, whitespace separated\&. By default, the user used to connect to the PC is the same for all PC\'s and is compiled into Amanda\&. It may be changed on a host by host basis by listing it first in the password field followed by a percent sign and then the password\&. For instance:
-.nf
-  //some\-pc/home normalpw
-  //another\-pc/disk otheruser%otherpw
-.fi
-.PP
-With clear text passwords, this file should obviously be tightly protected\&. It only needs to be readable by the Amanda\-user on the Samba server\&.
-.SH "HOST & DISK EXPRESSION"
-.PP
-All host and disk arguments to programs are special expressions\&. The command applies to all DLEs that match the arguments\&. This section describes the matcher\&.
-.PP
-The matcher matches by word, each word is a glob expression, words are separated by the separator \'\&.\' for host and \'/\' for disk\&. You can anchor the expression at left with a \'^\'\&. You can anchor the expression at right with a \'$\'\&. The matcher is case insensitive for host but is case sensitive for disk\&. A match succeeds if all words in your expression match contiguous words in the host or disk\&.
-.PP
-If the disk is a UNC ("\e\ewindows\eshare") then all \'\e\' are converted to \'/\' before the match\&. Using \'\e\' is complicated because of the extra quoting required by the shell and amanda\&. It\'s easier to use \'/\' because it require less quoting ("//windows/share")
-.PP
-dot (\&.)
-.RS 4
-word separator for a host
-.RE
-.PP
-/
-.RS 4
-word separator for a disk
-.RE
-.PP
-\e
-.RS 4
-word separator for a UNC disk
-.RE
-.PP
-^
-.RS 4
-anchor at left
-.RE
-.PP
-$
-.RS 4
-anchor at right
-.RE
-.PP
-?
-.RS 4
-match exactly one character except the separator
-.RE
-.PP
-*
-.RS 4
-match zero or more characters except the separator
-.RE
-.PP
-**
-.RS 4
-match zero or more characters including the separator
-.RE
-.PP
-[\&.\&.\&.]
-.RS 4
-match a single character, namely any of the characters enclosed by the brackets\&.
-.RE
-.PP
-[!\&.\&.\&.]
-.RS 4
-match a single character, namely any characters that is not enclosed by the brackets\&.
-.RE
-.PP
-The shell interpret some of these characters, they must be escaped by a backslash \'\e\' and/or the expression must be enclosed in simple or double quote\&.
-.PP
-Some examples:
-.PP
-hosta
-.RS 4
-Will match
-hosta,
-foo\&.hosta\&.org, and
-hoSTA\&.dOMAIna\&.ORG
-but not
-hostb\&.
-.RE
-.PP
-host
-.RS 4
-Will match
-host
-but not
-hosta\&.
-.RE
-.PP
-host?
-.RS 4
-Will match
-hosta
-and
-hostb, but not
-host\&.
-.RE
-.PP
-ho*na
-.RS 4
-Will match
-hoina
-but not
-ho\&.aina\&.org\&.
-.RE
-.PP
-ho**na
-.RS 4
-Will match
-hoina
-and
-ho\&.aina\&.org\&.
-.RE
-.PP
-^hosta
-.RS 4
-Will match
-hosta
-but not
-foo\&.hosta\&.org\&.
-.RE
-.PP
-sda*
-.RS 4
-Will match
-/dev/sda1
-and
-/dev/sda12\&.
-.RE
-.PP
-/opt
-.RS 4
-Will match the disk
-opt
-but not the host
-opt\&.
-.RE
-.PP
-(note dots:) \&.opt\&.
-.RS 4
-Will match the host
-opt
-but not the disk
-opt\&.
-.RE
-.PP
-/
-.RS 4
-Will match the disk
-/
-but no other disk\&.
-.RE
-.PP
-/usr
-.RS 4
-Will match the disks
-/usr
-and
-/usr/local\&.
-.RE
-.PP
-/usr$
-.RS 4
-Will match the disks
-/usr
-but not
-/usr/local\&.
-.RE
-.PP
-share
-.RS 4
-Will match the disks
-\e\ewindows1\eshare
-and
-\e\ewindows2\eshare\&.
-.RE
-.PP
-share*
-.RS 4
-Will match the disks
-\e\ewindows\eshare1
-and
-\e\ewindows\eshare2\&.
-.RE
-.PP
-//windows/share
-.RS 4
-Will match the disk
-\e\ewindows\eshare\&.
-.RE
-.SH "DATESTAMP EXPRESSION"
-.PP
-A
-\fIdatestamp\fR
-expression is a range expression where we only match the prefix\&. Leading ^ is removed\&. Trailing $ forces an exact match\&.
-.PP
-20001212\-14
-.RS 4
-match all dates beginning with 20001212, 20001213 or 20001214
-.RE
-.PP
-20001212\-4
-.RS 4
-same as previous
-.RE
-.PP
-20001212\-24
-.RS 4
-match all dates between 20001212 and 20001224
-.RE
-.PP
-2000121
-.RS 4
-match all dates that start with 2000121 (20001210\-20001219)
-.RE
-.PP
-2
-.RS 4
-match all dates that start with 2 (20000101\-29991231)
-.RE
-.PP
-2000\-10
-.RS 4
-match all dates between 20000101\-20101231
-.RE
-.PP
-200010$
-.RS 4
-match only 200010
-.RE
-.SH "DUMP SPECIFICATIONS"
-.PP
-A dump specification selects one or more dumps\&. It has the form
-\fI[host][:disk][@datestamp]\fR, where each component is a pattern as described above\&. If a component is missing, it is treated as a wildcard\&. The characters \':\', \'@\', and \'\e\' may be escaped within any component by preceding them with a \'\e\'\&.
-.PP
-Some examples:
-.PP
-client17
-.RS 4
-all dumps of client17
-.RE
-.PP
-@20080615
-.RS 4
-All dumps on with datestamps matching 20080615
-.RE
-.PP
-webserver:/var/www
-.RS 4
-All dumps of /var/www on host webserver
-.RE
-.PP
-webserver:/var/www@200806150317
-.RS 4
-The dump of webserver with datestamp 200806150317
-.RE
-.PP
-:/var/www
-.RS 4
-All dumps of /var/www on any host
-.RE
-.SH "CONFIGURATION OVERRIDE"
+.SS "Configuration Override"
 .PP
 Most commands allow the override of specific configuration options on the command line, using the
 \-o
index 595ed21073c7ae12aa2c494c08b6852c245223ed..b8b452ec8bb7e5c2a61d070de593fd5478b655d3 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda.conf
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: File formats and conventions
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMANDA\&.CONF" "5" "06/01/2010" "Amanda 3\&.1\&.0" "File formats and conventions"
+.TH "AMANDA\&.CONF" "5" "10/18/2010" "Amanda 3\&.2\&.0" "File formats and conventions"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -46,7 +46,7 @@ are treated the same\&. Also, the characters \'\fB\-\fR\' and \'\fB_\fR\' are in
 \fBdevice_property\fR
 and
 \fBdevice\-property\fR
-have the same meaning\&.
+have the same meaning\&. This manpage uses the dashed versions, but the underscored versions will be accepted for backward compatibility
 .PP
 Identifiers are names which are defined in the configuration itself, such as dumptypes or interfaces\&. Identifiers are are case\-insensitive, but sensitive to \'\fB\-\fR\' vs\&. \'\fB_\fR\'\&. Identifiers should be quoted in the configuration file, although For historical reasons, the quotes are optional\&.
 .PP
@@ -67,7 +67,7 @@ tapetype "EXABYTE"        # optional      insensitive     sensitive
 
 define dumptype "dt" {    # optional      insensitive     sensitive
   "dumptype\-common"       # optional      insensitive     sensitive
-  strategy noincr         # prohibited    insensitive     insensitive
+  strategy noinc          # prohibited    insensitive     insensitive
 }
 .fi
 .SS "VALUE SUFFIXES"
@@ -322,9 +322,19 @@ days /
 \fBtapecycle\fR \fIint\fR
 .RS 4
 Default:
-\fI15 tapes\fR\&. Typically tapes are used by Amanda in an ordered rotation\&. The
+\fI15 tapes\fR\&. Specifies the number of "active" volumes \- volumes that Amanda will not overwrite\&. While Amanda is always willing to write to a new volume, it refuses to overwrite a volume unless at least \'\fBtapecycle\fR
+\-1\' volumes have been written since\&.
+.sp
+It is considered good administrative practice to set the
+\fBtapecycle\fR
+parameter slightly lower than the actual number of tapes in use\&. This allows the administrator to more easily cope with damaged or misplaced tapes or schedule adjustments that call for slight adjustments in the rotation order\&.
+.sp
+Note: Amanda is commonly misconfigured with
+\fBtapecycle\fR
+equal to the number of tapes per
+\fBdumpcycle\fR\&. In this misconfiguration, amanda may erase a full dump before a new one is completed\&. Recovery is then impossible\&. The
 \fBtapecycle\fR
-parameter defines the size of that rotation\&. This parameter must be be larger than the number of tapes used in a dumpcycle\&.
+must be at least one tape larger than the number of tapes per dumpcycle\&.
 .sp
 The number of tapes per dumpcycle is calculated by multiplying the number of
 \fBamdump\fR
@@ -337,31 +347,6 @@ runs per dump cycle) and
 (the number of tapes used per run)\&. Typically
 \fBtapecycle\fR
 is set to two or four times the tapes per dumpcycle\&.
-.if n \{\
-.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBNote\fR
-.ps -1
-.br
-Amanda is commonly misconfigured with \fBtapecycle\fR
-equal to the number of tapes per \fBdumpcycle\fR\&.  In this
-misconfiguration, amanda may erase a full dump before a new one is completed,
-the recovery is then impossible\&. tapecycle must be at least one tape larger
-than the number of tapes per dumpcycle\&.
-.sp .5v
-.RE
-While Amanda is always willing to use a new tape in its rotation, it refuses to reuse a tape until at least \'\fBtapecycle\fR
-\-1\' number of other tapes have been used\&.
-.sp
-It is considered good administrative practice to set the
-\fBtapecycle\fR
-parameter slightly lower than the actual number of tapes in rotation\&. This allows the administrator to more easily cope with damaged or misplaced tapes or schedule adjustments that call for slight adjustments in the rotation order\&.
 .RE
 .PP
 \fBusetimestamps\fR \fIbool\fR
@@ -370,45 +355,48 @@ Default:
 \fBYes\fR\&. This option allows Amanda to track multiple runs per calendar day\&. The only reason one might disable it is that Amanda versions before 2\&.5\&.1 can\'t read logfiles written when this option was enabled\&.
 .RE
 .PP
-\fBlabel_new_tapes\fR \fIstring\fR
+\fBlabel\-new\-tapes\fR \fIstring\fR
 .RS 4
 Deprecated, use
 \fBautolabel\fR
-option\&.
+option with options
+\fBvolume\-error empty\fR
+to get equivalent behavior\&.
 .sp
-Default: not set\&. When set, this directive will cause Amanda to automatically write an Amanda tape label to any blank tape she encounters\&. This option is DANGEROUS because when set, Amanda will ERASE any non\-Amanda tapes you may have, and may also ERASE any near\-failing tapes\&. Use with caution\&.
-.sp
-When using this directive, specify the template for new tape labels\&. The template should contain some number of contiguous \'%\' characters, which will be replaced with a generated number\&. Be sure to specify enough \'%\' characters that you do not run out of tape labels\&. Example:
-\fBlabel_new_tapes "DailySet1\-%%%"\fR
+Default: not set\&. When set, this directive will cause Amanda to automatically write an Amanda tape label to any blank tape she encounters\&.
 .RE
 .PP
-\fBautolabel\fR \fIstring\fR [\fBany\fR] [\fBother_config\fR] [\fBnon_amanda\fR] [\fBvolume_error\fR] [\fBempty\fR]
+\fBautolabel\fR \fIstring\fR [\fBany\fR] [\fBother\-config\fR] [\fBnon\-amanda\fR] [\fBvolume\-error\fR] [\fBempty\fR]
 .RS 4
 Default: not set\&. When set, this directive will cause Amanda to automatically write an Amanda tape label to most volume she encounters\&. This option is DANGEROUS because when set, Amanda may erase near\-failing tapes or tapes accidentally loaded in the wrong slot\&.
 .sp
 When using this directive, specify the template for new tape labels\&. The template should contain some number of contiguous \'%\' characters, which will be replaced with a generated number\&. Be sure to specify enough \'%\' characters that you do not run out of tape labels\&. Example:
 \fBautolabel "DailySet1\-%%%" empty\fR
+.sp
+Note that many devices cannot distinguish an empty tape from an error condition, so it may is often necessary to include
+\fBvolume\-error\fR
+as an autolabel condition\&.
 .PP
 \fBany\fR
 .RS 4
-equivalent to \'\fBother_config non_amanda volume_error empty\fR\'
+equivalent to \'\fBother\-config non\-amanda volume\-error empty\fR\'
 .RE
 .PP
-\fBother_config\fR
+\fBother\-config\fR
 .RS 4
 Label volumes with a valid Amanda label that do not match our
 \fBlabelstr\fR\&. Danger: this may erase volumes
 from other Amanda configurations without warning!
 .RE
 .PP
-\fBnon_amanda\fR
+\fBnon\-amanda\fR
 .RS 4
 Label volumes which do not start with data that resembles an
 Amanda header\&. Danger: this may erase volumes from other backup applications
 without warning!
 .RE
 .PP
-\fBvolume_error\fR
+\fBvolume\-error\fR
 .RS 4
 Label volumes where an error occurs while trying to read the label\&.
 Danger: this may erase arbitrary volumes due to transient errors\&.
@@ -440,32 +428,18 @@ option\&.
 \fBtapedev\fR \fIstring\fR
 .RS 4
 Default:
-\fI"null:"\fR\&. The device name, referencing the name of a "device" section in the configuration file\&. See
-\fBamanda-devices\fR(7)
-for more information on device names\&.
-.sp
-If a tape changer is configured (see the
-\fBtpchanger\fR
-option), this option might not be used\&.
-.sp
-If
-\fBtapedev\fR
-is
-\fBnull:\fR, programs such as
-\fBamdump\fR
-will run normally but all images will be thrown away\&. This should only be used for debugging and testing, and probably only with the
-\fBrecord\fR
-option set to
-\fIno\fR\&.
+\fI"null:"\fR\&. This parameter can either specify a device (explicitly or by referencing a device definition \- see
+\fBamanda-devices\fR(7)) or a tape changer (explicitly or by referencing a device definition \- see
+\fBamanda-changers\fR(7))\&.
 .RE
 .PP
-\fBdevice_property\fR \fIstring\fR \fIstring\fR
+\fBdevice\-property\fR \fIstring\fR \fIstring\fR
 .RS 4
 These options can set various device properties\&. See
 \fBamanda-devices\fR(7)
 for more information on device properties and their syntax\&. Both strings are always quoted; the first string contains the name of the property to set, and the second contains its value\&. For example, to set a fixed block size of 128k, write:
 .nf
-device_property "BLOCK_SIZE" "128k"
+device\-property "BLOCK_SIZE" "128k"
 .fi
 .RE
 .PP
@@ -478,10 +452,15 @@ keyword append the values to the list of values for that property\&.
 .PP
 \fBtpchanger\fR \fIstring\fR
 .RS 4
-Default: not set\&. The name of the tape changer\&. If a tape changer is not configured, this option is not used and should be commented out of the configuration file\&.
-.sp
-If a tape changer is configured, choose one of the changer scripts (e\&.g\&.
-\fBchg\-scsi\fR) and enter that here\&.
+Default: not set\&. The tape changer to use\&. In most cases, only one of
+\fBtpchanger\fR
+or
+\fBtapedev\fR
+is specified, although for backward compatibility both may be specified if
+\fBtpchanger\fR
+gives the name of an old changer script\&. See
+\fBamanda-changers\fR(7)
+for more information on configuring changers\&.
 .RE
 .PP
 \fBchangerdev\fR \fIstring\fR
@@ -495,7 +474,7 @@ option\&.
 \fBchangerfile\fR \fIstring\fR
 .RS 4
 Default:
-\fI"usr/adm/amanda/log/changer\-status"\fR\&. A tape changer configuration parameter\&. Usage depends on the particular changer defined with the
+\fI"/usr/adm/amanda/log/changer\-status"\fR\&. A tape changer configuration parameter\&. Usage depends on the particular changer defined with the
 \fBtpchanger\fR
 option\&.
 .RE
@@ -508,14 +487,12 @@ Default:
 If a tape changer is configured, this may be set larger than one to let Amanda write to more than one tape\&.
 .sp
 Note that this is an upper bound on the number of tapes, and Amanda may use less\&.
-.sp
-Also note that as of this release, Amanda does not support true tape overflow\&. When it reaches the end of one tape, the backup image Amanda was processing starts over again on the next tape\&.
 .RE
 .PP
 \fBmaxdumpsize\fR \fIint\fR
 .RS 4
 Default:
-\fI\fBruntapes\fR\fR\fI*\fR\fI\fBtape_length\fR\fR\&. Maximum number of bytes the planner will schedule for a run\&.
+\fI\fBruntapes\fR\fR\fI*\fR\fI\fBtape\-length\fR\fR\&. Maximum number of bytes the planner will schedule for a run\&.
 .sp
 The default unit is Kbytes if it is not specified\&.
 .RE
@@ -556,6 +533,13 @@ Last in, first out\&.
 .RE
 .RE
 .PP
+\fBtaper\-parallel\-write\fR \fIint\fR
+.RS 4
+.PP
+Default:
+\fI1\fR\&. Amanda can write simultaneously up to that number of volume at any given time\&. The changer must have as many drives\&.
+.RE
+.PP
 \fBlabelstr\fR \fIstring\fR
 .RS 4
 Default:
@@ -608,13 +592,13 @@ will wait to get the dump size estimates (note: Amanda runs up to 3 estimates fo
 will wait up to 40 minutes for that machine\&. A negative value will be interpreted as a total amount of time to wait per client instead of per disk\&.
 .RE
 .PP
-\fBconnect_tries\fR \fIint\fR
+\fBconnect\-tries\fR \fIint\fR
 .RS 4
 Default:
 \fI3\fR\&. How many times the server will try a connection\&.
 .RE
 .PP
-\fBreq_tries\fR \fIint\fR
+\fBreq\-tries\fR \fIint\fR
 .RS 4
 Default:
 \fI3\fR\&. How many times the server will resend a REQ packet if it doesn\'t get the ACK packet\&.
@@ -772,7 +756,7 @@ Default:
 \fBtapelist\fR(5)\&. Amanda maintains this file with information about the active set of tapes\&.
 .RE
 .PP
-\fBdevice_output_buffer_size\fR \fIint\fR
+\fBdevice\-output\-buffer\-size\fR \fIint\fR
 .RS 4
 Default:
 \fI1280k\fR\&. Controls the amount of memory used by Amanda to hold data as it is read from the network or disk before it is written to the output device\&. Higher values may be useful on fast tape drives and optical media\&.
@@ -784,7 +768,7 @@ The default unit is bytes if it is not specified\&.
 .RS 4
 Default:
 \fI20\fR\&. This option is deprecated; use the
-\fBdevice_output_buffer_size\fR
+\fBdevice\-output\-buffer\-size\fR
 directive instead\&.
 \fBtapebufs\fR
 works the same way, but the number specified is multiplied by the device blocksize prior to use\&.
@@ -802,21 +786,27 @@ Default:
 \fBoff\fR\&. Whether an amdump run will flush the dumps from holding disk to tape\&.
 .RE
 .PP
-\fBamrecover_do_fsf\fR \fIbool\fR
+\fBamrecover\-do\-fsf\fR \fIbool\fR
 .RS 4
+Deprecated; amrecover always uses fsf, and does not invoke amrestore\&.
+.sp
 Default:
 \fBon\fR\&. Amrecover will call amrestore with the \-f flag for faster positioning of the tape\&.
 .RE
 .PP
-\fBamrecover_check_label\fR \fIbool\fR
+\fBamrecover\-check\-label\fR \fIbool\fR
 .RS 4
+Deprecated; amrecover always checks the label, and does not invoke amrestore\&.
+.sp
 Default:
 \fBon\fR\&. Amrecover will call amrestore with the \-l flag to check the label\&.
 .RE
 .PP
-\fBamrecover_changer\fR \fIstring\fR
+\fBamrecover\-changer\fR \fIstring\fR
 .RS 4
-Default: not set\&. Amrecover will use the changer if you use \'settape <string>\' and that string is the same as the amrecover_changer setting\&.
+Default: not set\&. Amrecover will use the changer if you use \'settape <string>\' and that string is the same as the
+\fBamrecover\-changer\fR
+setting\&.
 .RE
 .PP
 \fBcolumnspec\fR \fIstring\fR
@@ -901,61 +891,61 @@ Default:
 \fIno default\fR\&. The name of an Amanda configuration file to include within the current file\&. Useful for sharing dumptypes, tapetypes and interface definitions among several configurations\&. Relative pathnames are relative to the configuration directory\&.
 .RE
 .PP
-\fBdebug_days\fR \fIint\fR
+\fBdebug\-days\fR \fIint\fR
 .RS 4
 Default:
 \fI3\fR\&. The number of days the debug files are kept\&.
 .RE
 .PP
-\fBdebug_auth\fR \fIint\fR
+\fBdebug\-auth\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the auth module
 .RE
 .PP
-\fBdebug_event\fR \fIint\fR
+\fBdebug\-event\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the event module
 .RE
 .PP
-\fBdebug_holding\fR \fIint\fR
+\fBdebug\-holding\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the holdingdisk module
 .RE
 .PP
-\fBdebug_protocol\fR \fIint\fR
+\fBdebug\-protocol\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the protocol module
 .RE
 .PP
-\fBdebug_planner\fR \fIint\fR
+\fBdebug\-planner\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the planner process
 .RE
 .PP
-\fBdebug_driver\fR \fIint\fR
+\fBdebug\-driver\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the driver process
 .RE
 .PP
-\fBdebug_dumper\fR \fIint\fR
+\fBdebug\-dumper\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the dumper process
 .RE
 .PP
-\fBdebug_chunker\fR \fIint\fR
+\fBdebug\-chunker\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the chunker process
 .RE
 .PP
-\fBdebug_taper\fR \fIint\fR
+\fBdebug\-taper\fR \fIint\fR
 .RS 4
 Default:
 \fI0\fR\&. Debug level of the taper process
@@ -1036,6 +1026,21 @@ Default: \-\-with\-low\-tcpportrange or
 Default: \-\-with\-tcpportrange or
 \fI1024,65535\fR\&. Unreserved tcp port that will be used (bsd, bsdudp)\&. Range is inclusive\&.
 .RE
+.PP
+\fBrecovery\-limit\fR [ \fIstring\fR | \fBsame\-host\fR ]
+.RS 4
+Default: none (no limitations)\&. This parameter limits the hosts that may do remote recoveries\&. Hosts are identified by their authenticated peer name, as described in
+\fBamanda-auth\fR(7); if this is not available and the recovery\-limit parameter is present, recovery will be denied\&. The arguments to the parameter are strings giving host match expressions (see
+\fBamanda-match\fR(7)) or the special keyword same\-host, which requires an exact match to the hostname of the DLE being recovered\&. Specifying no arguments at all will disable all recoveries from any host\&.
+.sp
+Note that match expressions can be constructed to be forgiving of e\&.g\&., fully\-qualified vs\&. unqualified hostnames, but
+\fBsame\-host\fR
+requires an exact match\&.
+.sp
+The error messages that appear in amrecover are intentionally vague to avoid information leakage\&. Consult the amindexd debug log for more details on the reasons a recovery was rejected\&.
+.sp
+Recovery limits can be refined on a per\-DLE basis using the dumptype parameter of the same name\&. Note that the default value will apply to any dumpfiles for disks which no longer appear in the disklist; thus leaving the global parameter at its default value but setting it for all DLEs is not sufficient to maintain secure backups\&.
+.RE
 .SH "HOLDINGDISK SECTION"
 .PP
 The
@@ -1132,19 +1137,19 @@ Default:
 for more detail\&.
 .RE
 .PP
-\fBamandad_path\fR \fIstring\fR
+\fBamandad\-path\fR \fIstring\fR
 .RS 4
 Default:
 \fI"$libexec/amandad"\fR\&. Specify the amandad path of the client, only use with rsh/ssh authentification\&.
 .RE
 .PP
-\fBclient_username\fR \fIstring\fR
+\fBclient\-username\fR \fIstring\fR
 .RS 4
 Default:
 \fICLIENT_LOGIN\fR\&. Specify the username to connect on the client, only use with rsh/ssh authentification\&.
 .RE
 .PP
-\fBclient_port\fR [ \fIint\fR | \fIstring\fR ]
+\fBclient\-port\fR [ \fIint\fR | \fIstring\fR ]
 .RS 4
 Default:
 \fI"amanda"\fR\&. Specifies the port to connect to on the client\&. It can be a service name or a numeric port number\&.
@@ -1246,7 +1251,7 @@ compress client best
 compress client custom
 .RS 4
 Specify
-\fIclient_custom_compress\fR
+\fBclient\-custom\-compress\fR
 "PROG"
 .sp
 PROG must not contain white space and it must accept \-d for uncompress\&.
@@ -1263,7 +1268,7 @@ compress server best
 compress server custom
 .RS 4
 Specify
-\fBserver_custom_compress\fR
+\fBserver\-custom\-compress\fR
 "PROG"
 .sp
 PROG must not contain white space and it must accept \-d for uncompress\&.
@@ -1274,12 +1279,12 @@ Note that some tape devices do compression and this option has nothing to do wit
 option), Amanda (software) compression should be disabled\&.
 .RE
 .PP
-\fBclient_custom_compress\fR \fIstring\fR
+\fBclient\-custom\-compress\fR \fIstring\fR
 .RS 4
 Default: none\&. The program to use to perform compression/decompression on the client; used with "compress client custom"\&. Must not contain whitespace\&. Must accept \-d to uncompress\&.
 .RE
 .PP
-\fBserver_custom_compress\fR \fIstring\fR
+\fBserver\-custom\-compress\fR \fIstring\fR
 .RS 4
 Default: none\&. The program to use to perform compression/decompression on the server; used with "compress server custom"\&. Must not contain whitespace\&. Must accept \-d to uncompress\&.
 .RE
@@ -1304,11 +1309,11 @@ encrypt none
 .PP
 encrypt client
 .RS 4
-Specify client_encrypt "PROG"
+Specify client\-encrypt "PROG"
 .sp
 PROG must not contain white space\&.
 .sp
-Specify client_decrypt_option "decryption\-parameter" Default: "\-d"
+Specify client\-decrypt\-option "decryption\-parameter" Default: "\-d"
 .sp
 decryption\-parameter must not contain white space\&.
 .sp
@@ -1317,11 +1322,11 @@ decryption\-parameter must not contain white space\&.
 .PP
 encrypt server
 .RS 4
-Specify server_encrypt "PROG"
+Specify server\-encrypt "PROG"
 .sp
 PROG must not contain white space\&.
 .sp
-Specify server_decrypt_option "decryption\-parameter" Default: "\-d"
+Specify server\-decrypt\-option "decryption\-parameter" Default: "\-d"
 .sp
 decryption\-parameter must not contain white space\&.
 .sp
@@ -1335,24 +1340,24 @@ which is a wrapper of
 is provided as a reference symmetric encryption program\&.
 .RE
 .PP
-\fBclient_encrypt\fR \fIstring\fR
+\fBclient\-encrypt\fR \fIstring\fR
 .RS 4
 Default: none\&. The program to use to perform encryption/decryption on the client; used with "encrypt client"\&. Must not contain whitespace\&.
 .RE
 .PP
-\fBclient_decrypt_option\fR \fIstring\fR
+\fBclient\-decrypt\-option\fR \fIstring\fR
 .RS 4
-Default: \-d\&. The option that can be passed to client_encrypt to make it decrypt instead\&. Must not contain whitespace\&.
+Default: \-d\&. The option that can be passed to client\-encrypt to make it decrypt instead\&. Must not contain whitespace\&.
 .RE
 .PP
-\fBserver_encrypt\fR \fIstring\fR
+\fBserver\-encrypt\fR \fIstring\fR
 .RS 4
 Default: none\&. The program to use to perform encryption/decryption on the server; used with "encrypt server"\&. Must not contain whitespace\&.
 .RE
 .PP
-\fBserver_decrypt_option\fR \fIstring\fR
+\fBserver\-decrypt\-option\fR \fIstring\fR
 .RS 4
-Default: \-d\&. The option that can be passed to server_encrypt to make it decrypt instead\&. Must not contain whitespace\&.
+Default: \-d\&. The option that can be passed to server\-encrypt to make it decrypt instead\&. Must not contain whitespace\&.
 .RE
 .PP
 \fBestimate\fR [ \fBclient\fR | \fBcalcsize\fR | \fBserver\fR ]+
@@ -1635,7 +1640,7 @@ and
 has scheduled an incremental backup, these disks will be skipped\&.
 .RE
 .PP
-\fBssh_keys\fR \fIstring\fR
+\fBssh\-keys\fR \fIstring\fR
 .RS 4
 Default: not set\&. The key file the ssh auth will use, it must be the private key\&. If this parameter is not specified, then the default ssh key will be used\&.
 .RE
@@ -1681,24 +1686,40 @@ should be used to tell Amanda that a full dump has been performed off\-line, so
 .RE
 .RE
 .PP
-\fBtape_splitsize\fR \fIint\fR
+\fBallow\-split\fR \fIbool\fR
 .RS 4
-Default: not set\&. Split dump file on tape into pieces of a specified size\&. This allows dumps to be spread across multiple tapes, and can potentially make more efficient use of tape space\&. Note that if this value is too large (more than half the size of the average dump being split), substantial tape space can be wasted\&. If too small, large dumps will be split into innumerable tiny dumpfiles, adding to restoration complexity\&. A good rule of thumb, usually, is 1/10 of the size of your tape\&.
+Default: true\&. If true, then dumps with this dumptype can be split on the storage media\&. If false, then the dump will be written in a single file on the media\&. See "Dump Splitting Configuration" below\&.
+.RE
+.PP
+\fBtape\-splitsize\fR \fIint\fR
+.RS 4
+Deprecated\&. See "Dump Splitting Configuration" below\&.
 .sp
-The default unit is Kbytes if it is not specified\&.
+Default: not set\&. Split dump file on tape into pieces of a specified size\&. The default unit is Kbytes if it is not specified\&.
 .RE
 .PP
-\fBsplit_diskbuffer\fR \fIstring\fR
+\fBsplit\-diskbuffer\fR \fIstring\fR
 .RS 4
+.PP
+Deprecated\&. See "Dump Splitting Configuration" below\&.
 Default: not set\&. When dumping a split dump in PORT\-WRITE mode (usually meaning "no holding disk"), buffer the split chunks to a file in the directory specified by this option\&.
 .RE
 .PP
-\fBfallback_splitsize\fR \fIint\fR
+\fBfallback\-splitsize\fR \fIint\fR
 .RS 4
-Default:
-\fI10M\fR\&. When dumping a split dump in PORT\-WRITE mode, if no split_diskbuffer is specified (or if we somehow fail to use our split_diskbuffer), we must buffer split chunks in memory\&. This specifies the maximum size split chunks can be in this scenario, and thus the maximum amount of memory consumed for in\-memory splitting\&. The size of this buffer can be changed from its (very conservative) default to a value reflecting the amount of memory that each taper process on the dump server may reasonably consume\&.
+Deprecated\&. See "Dump Splitting Configuration" below\&.
 .sp
-The default unit is Kbytes if it is not specified\&.
+Default:
+\fI10M\fR\&. This specifies the part size used when no
+\fBsplit\-diskbuffer\fR
+is specified, or when it is too small or does not exist, and thus the maximum amount of memory consumed for in\-memory splitting\&. The default unit is Kbytes if it is not specified\&.
+.RE
+.PP
+\fBrecovery\-limit\fR [ \fBsame\-host\fR | \fIstring\fR ]*
+.RS 4
+Default: global value\&. This parameter overrides the global
+\fBrecovery\-limit\fR
+parameter for DLEs of this dumptype\&.
 .RE
 .PP
 The following
@@ -1829,6 +1850,30 @@ How much data will be read in each tape record\&. This can be used to override a
 The default unit is Kbytes if it is not specified\&.
 .RE
 .PP
+\fBpart\-size\fR \fIint\fR
+.RS 4
+Default: none\&. This is the size (in KB if no units are specified) of each split part written to the volume\&. It is reduced to
+\fBpart\-cache\-max\-size\fR
+when part caching is required\&. If this is set to zero, then no splitting will take place; in this case, some devices can span dumps from volume to volume, while others will cause the entire dump to fail if they encounter end\-of\-medium before the dump is complete\&. See "Dump Splitting Configuration" below\&.
+.RE
+.PP
+\fBpart\-cache\-type\fR [ \fBnone\fR | \fBdisk\fR | \fBmemory\fR ]
+.RS 4
+Default: none\&. When part caching is required, this parameter specifies the type of caching that will be used\&. The options include no caching (\fBnone\fR), in which case a failed part will cause the entire dump to fail; on\-disk caching (\fBdisk\fR), for which
+\fBpart\-cache\-dir\fR
+must be set properly; and in\-memory caching (\fBmemory\fR), which on most systems severely restrains the size of the part that can be written\&. See "Dump Splitting Configuration" below\&.
+.RE
+.PP
+\fBpart\-cache\-dir\fR \fIstring\fR
+.RS 4
+Default: none\&. The directory in which part\-cache files can be written when caching on disk\&. See "Dump Splitting Configuration" below\&.
+.RE
+.PP
+\fBpart\-cache\-max\-size\fR \fIint\fR
+.RS 4
+Default: none\&. The maximum part size to use when caching is in effect\&. This is used to limit the part size when disk or memory space for caching is constrained\&. This value must be greater than zero\&.
+.RE
+.PP
 \fBspeed\fR \fIint\fR
 .RS 4
 Default:
@@ -1848,7 +1893,7 @@ man page for more information\&.
 .PP
 In addition to options, another
 \fBtapetype\fR
-name may be supplie as an identifier, which makes this
+name may be supplied as an identifier, which makes this
 \fBtapetype\fR
 inherit options from another
 \fBtapetype\fR\&. For instance, the only difference between a DLT4000 tape drive using Compact\-III tapes and one using Compact\-IV tapes is the length of the tape\&. So they could be entered as:
@@ -1989,13 +2034,13 @@ Default:
 \fI5000\fR\&. Scripts are executed in that order, it is useful if you have many scripts and they must be executed in a spefific order\&.
 .RE
 .PP
-\fBexecute_where\fR [ \fBclient\fR | \fBserver\fR ]
+\fBexecute\-where\fR [ \fBclient\fR | \fBserver\fR ]
 .RS 4
 Default:
 \fBclient\fR\&. Where the script must be executed, on the client or server\&.
 .RE
 .PP
-\fB>execute_on\fR \fIexecute_on\fR [,\fIexecute_on\fR]*
+\fBexecute\-on\fR \fIexecute_on\fR [,\fIexecute_on\fR]*
 .RS 4
 No default\&. When the script must be executed, you can specify many of them:
 .PP
@@ -2098,7 +2143,7 @@ script \-\-post\-recover
 .fi
 .RE
 .PP
-\fBproperty\fR> [\fBappend\fR] [\fBpriority\fR] \fIstring\fR \fIstring\fR+
+\fBproperty\fR [\fBappend\fR] [\fBpriority\fR] \fIstring\fR \fIstring\fR+
 .RS 4
 No default\&. You can set property for the script, each script have a different set of property\&. Both strings are quoted; the first string contains the name of the property to set, and the others contains its values\&.
 \fBappend\fR
@@ -2115,7 +2160,7 @@ in the form of "device" sections, which look like this:
 define device \fIname\fR {
     commend "\fIcomment (optional)\fR"
     tapedev "\fIdevice\-specifier\fR"
-    device_property "\fIprop\-name\fR" "\fIprop\-value\fR"
+    device\-property "\fIprop\-name\fR" "\fIprop\-value\fR"
     \&.\&.\&.
 }
 .fi
@@ -2133,7 +2178,7 @@ specifies the device name to use; see
 parmeter is optional and only for the user\'s convenience\&.
 .PP
 An arbitrary number of
-\fIdevice_property\fR
+\fIdevice\-property\fR
 parameters can be specified\&. Again, see
 \fBamanda-devices\fR(7)
 for information on device properties\&.
@@ -2160,6 +2205,34 @@ is the user\-specified name of this device\&. The remaining parameters are speci
 See
 \fBamanda-changers\fR(7)
 for more information on configuring changers\&.
+.SH "DUMP SPLITTING CONFIGURATION"
+.PP
+Amanda can "split" dumps into parts while writing them to storage media\&. This allows Amanda to recover gracefully from a failure while writing a part to a volume, by simply selecting a new volume and re\-writing the dump from the beginning of the failed part\&. Parts also allow Amanda to seek directly to the required data, although this functionality is not yet used\&.
+.PP
+In order to support re\-writing from the beginning of a failed part, Amanda must have access to the contents of the part after it has been partially written\&. If the dump is being read from holding disk, then the part contents are availble there\&. Otherwise, the part must be cached, and this can be done memory or on disk\&. In either of the latter cases, the cache must have enough space to hold an entire part\&.
+.PP
+Because it is common for a single Amanda configuration to use both holding\-disk (FILE\-WRITE) and direct (known as PORT\-WRITE) dumps, Amanda allows the configuration of different split sizes for the two cases\&. This allows, for example, for a part size appropriate to large tapes when performing FILE\-WRITE dumps, with a part size limited by available disk or memory when performing PORT\-WRITE dumps\&.
+.PP
+Selecting a proper split size is a delicate matter\&. If the parts are too large, substantial storage space may be wasted in failed parts\&. If too small, large dumps will be split into innumerable tiny dumpfiles, adding to restoration complexity; furthermore, an excess of filemarks will cause slower tape drive operation and reduce the usable space on tape\&. A good rule of thumb is 1/10 of the size of a volume of storage media\&.
+.PP
+In versions of Amanda through 3\&.1\&.*, splitting was controlled by the dumptype parameters
+\fBtape\-splitsize\fR,
+\fBsplit\-diskbuffer\fR, and
+\fBfallback\-splitsize\fR\&. These keywords had confusing and non\-intuitive interactions, and have since been deprecated\&.
+.PP
+If the deprecated keywords are not present, subsequent versions of Amanda use the dumptype parameter
+\fBallow\-split\fR
+to control whether a DLE can be split, and the
+\fItapetype\fR
+parameters
+\fBpart\-size\fR,
+\fBpart\-cache\-type\fR,
+\fBpart\-cache\-dir\fR, and
+\fBpart\-cache\-max\-size\fR\&. The
+\fBpart\-size\fR
+specifies the "normal" part size, while the
+\fBpart\-cache\-*\fR
+parameters describe how to behave when caching is required (on PORT\-WRITE)\&. Full details on these parameters are given above\&.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
index 1d8d79aaae36ec64d8c52889f188cb457289e1c1..8bf0d1f31f9acf85406ad6864080912e2b8effdb 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amarchiver
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMARCHIVER" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMARCHIVER" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 36f04be5e123190915dc1e6208634bc15d746d93..d0286b246937fb29979230c7232523b76c3c222c 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcheck
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMCHECK" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMCHECK" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amcheck \- run Amanda self\-checks
 .SH "SYNOPSIS"
 .HP \w'\fBamcheck\fR\ 'u
-\fBamcheck\fR [\-am] [\-w] [\-sclt] [\-M\ \fIaddress\fR] \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [{\fB\-o\fR\ \fIconfigoption\fR}...]
+\fBamcheck\fR [\-am] [\-w] [\-sclt] [\-M\ \fIaddress\fR] \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [\fB\-o\fR\ \fIconfigoption\fR...]
 .SH "DESCRIPTION"
 .PP
 \fBAmcheck\fR
@@ -69,7 +69,9 @@ Run the tape tests on the server host\&.
 .RS 4
 Enables a DESTRUCTIVE check for write\-protection on the tape (which would otherwise cause the subsequent
 \fBamdump\fR
-to fail)\&. If the tape is writable, this check causes all data after the tape label to be erased\&. If the label_new_tapes option is enabled, this check may ERASE any non\-Amanda tape in the drive or changer\&. The check enable the tape tests on the server host and is only made if the tape is otherwise correct\&.
+to fail)\&. If the tape is writable, this check causes all data after the tape label to be erased\&. If the
+\fBautolabel\fR
+option is enabled, this check may ERASE any non\-Amanda tape in the drive or changer\&. The check enable the tape tests on the server host and is only made if the tape is otherwise correct\&.
 .RE
 .PP
 \fB\-m\fR
index 0277d4ce20cc445b6e7c3e9abe3a46f072305081..654916c72db7c159ff593dd27cd4a5eda4f41ec0 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcheckdb
 .\"    Author: Adrian T. Filipi-Martin <atf3r@cs.virginia.edu>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMCHECKDB" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMCHECKDB" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 78f7c57e18d7cc6cc1a1d0dbe8f1fa78312771f0..01161513f3b2d3d67811e4e6aef4e12c98a19b16 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcheckdump
 .\"    Author: Ian Turner <ian@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMCHECKDUMP" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMCHECKDUMP" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amcheckdump \- check the results of an Amanda dump
 .SH "SYNOPSIS"
 .HP \w'\fBamcheckdump\fR\ 'u
-\fBamcheckdump\fR \fIconfig\fR [\-\-timestamp|\-t\ \fItimestamp\fR] [\-\-verbose] [{\fB\-o\fR\ \fIconfigoption\fR}...]
+\fBamcheckdump\fR \fIconfig\fR [\-\-timestamp|\-t\ \fItimestamp\fR] [\-\-verbose] [\fB\-o\fR\ \fIconfigoption\fR...]
 .SH "DESCRIPTION"
 .PP
 \fBAmcheckdump\fR
@@ -51,10 +51,6 @@ amcheckdump MYCONFIG \-\-timestamp 19780615
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-: http://wiki.zmanda.com
-.SH "SEE ALSO"
-.PP
-\fBamanda\fR(8),
 \fBamcheck\fR(8)
 .PP
 The Amanda Wiki:
index 671fdb6b86e57bc8ba1b33128569acb9a42fe33c..0d1372c86f351eb10e0265ed52f17adb15da4aef 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcleanup
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMCLEANUP" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMCLEANUP" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 4b1c43ec8d1859f92c44ca6750b68d41dffdda28..2e0b3c4acfa5f15292e298a25bb6e0cbbaca059f 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcrypt-ossl-asym
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMCRYPT\-OSSL\-ASYM" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMCRYPT\-OSSL\-ASYM" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 0b8f7409114e5308496353f273b15aedaaa9a9d8..7db4f3d5b4e07e57a87313d4b785360484cadd91 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcrypt-ossl
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMCRYPT\-OSSL" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMCRYPT\-OSSL" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 718c70e5052a795158096e2352a661cb43967edb..170dbf61db276d638f2efab77f066fbd85243026 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcrypt
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMCRYPT" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMCRYPT" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 5a07dd7195930d4def6d7d2d8ad75ed92492dc4e..708f64f9d122e0c2764d3151555a6bc19af6d206 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcryptsimple
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMCRYPTSIMPLE" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMCRYPTSIMPLE" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 95d6c14c0515c6278e85e35876881af48889bcc4..089e48a2a7b8a763859e8a53480923ce17056f29 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amdevcheck
 .\"    Author: Ian Turner <ian@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMDEVCHECK" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMDEVCHECK" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amdevcheck \- Validate an Amanda device and volume\&.
 .SH "SYNOPSIS"
 .HP \w'\fBamdevcheck\fR\ 'u
-\fBamdevcheck\fR \fIconfig\fR [\fIdevice\-name\fR] [\-\-label] [\-properties\ \fIlist\fR] [{\fB\-o\fR\ \fIconfigoption\fR}...]
+\fBamdevcheck\fR \fIconfig\fR [\fIdevice\-name\fR] [\-\-label] [\-properties\ \fIlist\fR] [\fB\-o\fR\ \fIconfigoption\fR...]
 .SH "DESCRIPTION"
 .PP
 
index 0e297320cac61155a454c5c0f7f05aedf13459b3..bd2fcd1c785e36ce4c008a39dbfa4b52dc25288b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amdump
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMDUMP" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMDUMP" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
 amdump \- back up all disks in an Amanda configuration
 .SH "SYNOPSIS"
 .HP \w'\fBamdump\fR\ 'u
-\fBamdump\fR \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [{\fB\-o\fR\ \fIconfigoption\fR}...]
+\fBamdump\fR \fIconfig\fR [\fB\-\-no\-taper\fR] [\fIhost\fR\ [\fIdisk\fR...]...] [\fB\-o\fR\ \fIconfigoption\fR...]
 .SH "DESCRIPTION"
 .PP
 \fBAmdump\fR
-switches to the appropriate Amanda configuration directory, e\&.g\&. /usr/local/etc/amanda/\fIconfig\fR, then attempts to back up every disk specified by the
-\fIamanda\&.conf\fR
-file\&.
+is the main interface to the Amanda backup process\&. It loads the specified configuration and attempts to back up every disk specified by the
+\fBdisklist\fR(5)\&.
 \fBAmdump\fR
 is normally run by
 \fBcron\fR\&.
 .PP
-You can specify many host/disk expressions, only disks that match an expression will be dumped\&. All disks are dumped if no expressions are given\&.
+The command optionally takes a set of DLE specifications (see
+\fBamanda-match\fR(7)) to narrow the DLEs that will be dumped\&. All disks are dumped if no expressions are given\&.
 .PP
-If the file /usr/local/etc/amanda/\fIconfig\fR/hold exists,
+If a file named
+hold
+exists in the configuration directory,
 \fBamdump\fR
 will wait until it is removed before starting the backups\&. This allows scheduled backups to be delayed when circumstances warrant, for example, if the tape device is being used for some other purpose\&. While waiting,
 \fBamdump\fR
 checks for the hold file every minute\&.
 .PP
+In some cases it is desirable to dump all Amanda clients to holding disk without writing anything to storage media\&. The
+\fB\-\-no\-taper\fR
+option instructs Amanda to not start the taper, and thus enter degraded mode immediately\&.
+.PP
 See the
 \fBamanda\fR(8)
 man page for more details about Amanda\&.
@@ -48,7 +54,8 @@ man page for more details about Amanda\&.
 .PP
 \fIhost\fR [\fIdisk\fR]*
 .RS 4
-Specify the host and disk on which the command will work\&.
+Specify the host and disk on which the command will work \-\- see the description of DLE specifications in
+\fBamanda-match\fR(7)\&.
 .RE
 .PP
 \fB\-o \fR\fB\fIconfigoption\fR\fR
@@ -113,7 +120,8 @@ The exit code of \fBamdump\fR is the ORed value of:
 \fBamcleanup\fR(8),
 \fBamrestore\fR(8),
 \fBamflush\fR(8),
-\fBcron\fR(8)
+\fBcron\fR(8),
+\fBamanda-match\fR(7)
 .PP
 The Amanda Wiki:
 : http://wiki.zmanda.com/
index 2ae33aab42ca632f8f146f39a14e558149266b07..7f7d91a88fd9c5831ba9e0b1df451c3c452b91ee 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amfetchdump
 .\"    Author: John Stange <building@nap.edu>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMFETCHDUMP" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMFETCHDUMP" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -28,23 +28,21 @@ amfetchdump \- extract backup images from multiple Amanda tapes\&.
 \fBAmfetchdump\fR
 pulls one or more matching dumps from tape or from the holding disk, handling the reassembly of multi\-tape split dump files as well as any tape autochanger operations\&.
 .PP
-It will automatically use the logs created by
-\fBamdump\fR(8)
-to locate available dumps on tape, in the same way that the
+It will automatically use the Amanda catalog to locate available dumps on tape, in the same way that the
 \fBfind\fR
 feature of
 \fBamadmin\fR(8)
-lists available dumps\&. If these logs are unavailable, it can search tape\-by\-tape to find what it needs, and can generate new logs to serve as an emergency tape inventory\&.
+lists available dumps\&.
 .PP
 The
 \fIhostname\fR,
 \fIdiskname\fR,
 \fIdatestamp\fR, and
 \fIlevel\fR
-dump pattern\-matching works as in
-\fBamrestore\fR(8), with the added requirement that at minimum a
+dump specifications are further described in
+\fBamanda-match\fR(7)\&. Note that at minimum a
 \fIhostname\fR
-must be specified when not in inventory mode\&.
+must be specified\&.
 .PP
 Unless
 \fB\-p\fR
@@ -147,10 +145,9 @@ instead\&.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
+\fBamanda-match\fR(7),
 \fBamadmin\fR(8),
-\fBamrestore\fR(8),
-\fBtar\fR(1),
-\fBrestore\fR(8)
+\fBamrestore\fR(8)
 .PP
 The Amanda Wiki:
 : http://wiki.zmanda.com/
index 7a7c73c929b4622ed840f082a7494cf5ed597bf7..2cec85aff1ed7c8510022b67ef210eabe91c4e35 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amflush
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMFLUSH" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMFLUSH" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
 amflush \- flush Amanda backup files from holding disk to tape
 .SH "SYNOPSIS"
 .HP \w'\fBamflush\fR\ 'u
-\fBamflush\fR [\-b] [\-f] [\-s] [\-D\ \fIdatestamp\fR] \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [{\fB\-o\fR\ \fIconfigoption\fR}...]
+\fBamflush\fR [\-b] [\-f] [\-s] [\-D\ \fIdatestamp\fR] \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [\fB\-o\fR\ \fIconfigoption\fR...]
 .SH "DESCRIPTION"
 .PP
 \fBAmflush\fR
 writes Amanda backups from the holding disks to tape, and updates the Amanda info database and
 \fBtapelist\fR(5)
-accordingly\&. Backups may stay in a holding disk when something is wrong with the tape at the time
+accordingly\&. It is similar to amdump, but does not perform any backup operations on Amanda clients\&. Backups may stay in a holding disk when something is wrong with the tape at the time
 \fBamdump\fR
 is run\&. When this happens, the problem must be corrected and
 \fBamflush\fR
 run by hand\&.
+.PP
+The command optionally takes a set of DLE specifications (see
+\fBamanda-match\fR(7)) to narrow the DLEs for which dumps will be flushed\&. All dumps in holding are flushed if no expressions are given\&.
 .SH "OPTIONS"
 .PP
 \fB\-b\fR
@@ -66,16 +69,17 @@ option\&.
 .PP
 \fB\-D datestamp\fR
 .RS 4
-specify a datestamp expression you want to flush, see the "DATESTAMP EXPRESSION" section of
-\fBamanda\fR(8)
-for a description\&.
+specify a datestamp expression you want to flush; see
+\fBamanda-match\fR(7)
+for details on the format of this expression\&.
 \fB\-D 20001225\-7\fR
 will flush all dumps from 25 december 2000 to 27 december 2000\&.
 .RE
 .PP
 \fIhost\fR [\fIdisk\fR]*
 .RS 4
-Specify the host and disk on which the command will work\&.
+Specify the host and disk on which the command will work \-\- see the description of DLE specifications in
+\fBamanda-match\fR(7)\&.
 .RE
 .PP
 \fB\-o \fR\fB\fIconfigoption\fR\fR
@@ -146,7 +150,8 @@ The exit code of \fBamflush\fR is the ORed value of:
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fBamdump\fR(8)
+\fBamdump\fR(8),
+\fBamanda-match\fR(7)
 .PP
 The Amanda Wiki:
 : http://wiki.zmanda.com/
index d5055b5ba737a2edde7f155e81748a1e08ad6b0d..a1085d06361fcfdf3e6c2dc8a89462bc7d0c3722 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amgetconf
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMGETCONF" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMGETCONF" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amgetconf \- look up configuration parameters and manipulate debug logs
 .SH "SYNOPSIS"
 .HP \w'\fBamgetconf\fR\ 'u
-\fBamgetconf\fR [\fI\-l|\-\-list\fR] [\fI\-\-client\fR] [\fI\-\-execute\-where\ client|server\fR] [\fIconfig\fR] \fIparameter\fR [{\fB\-o\fR\ \fIconfigoption\fR}...]
+\fBamgetconf\fR [\fI\-l|\-\-list\fR] [\fI\-\-client\fR] [\fI\-\-execute\-where\ client|server\fR] [\fIconfig\fR] \fIparameter\fR [\fB\-o\fR\ \fIconfigoption\fR...]
 .SH "DESCRIPTION"
 .PP
 \fBAmgetconf\fR
index b135bb6a9f1b4f52b08802c2b8e912be9966eddb..3d2fdaca0e6b7469a59d4a1e0810837626ebdf69 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amgpgcrypt
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMGPGCRYPT" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMGPGCRYPT" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index fd51c99b735d068f200fc0d81515b3fac3098212..0b2e856643bb5241a0a27560e3b3575296dc20f4 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amgtar
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMGTAR" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMGTAR" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -166,6 +166,12 @@ STRANGE
 
 List all regex (POSIX Extended Regular Expression syntax) that are strange output from gtar\&. All gtar output that doesn\'t match a normal or ignore regex are strange by default\&. The result of the dump is STRANGE if gtar produce a strange output\&. These output are in the "FAILED DUMP DETAILS" section of the email report\&.
 .RE
+.PP
+VERBOSE
+.RS 4
+
+Default: "NO"\&. If "YES", amgtar print more verbose debugging message and can leave temporary files in AMANDA_TMPDIR\&.
+.RE
 .SH "INCLUDE AND EXCLUDE LISTS"
 .PP
 This application supplies exclude lists via the
index 2907a4ef1a2d192db9b79b4487926cccd101f89e..c954d08789e52b921ce5b1b4956c7d719370ea2e 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amlabel
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMLABEL" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMLABEL" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amlabel \- label an Amanda tape
 .SH "SYNOPSIS"
 .HP \w'\fBamlabel\fR\ 'u
-\fBamlabel\fR \fIconfig\fR \fIlabel\fR [slot\ \fIslot\fR] [\fB\-f\fR] [\fB\-\-version\fR] [{\fB\-o\fR\ \fIconfigoption\fR}...]
+\fBamlabel\fR \fIconfig\fR \fIlabel\fR [slot\ \fIslot\fR] [\fB\-f\fR] [\fB\-\-version\fR] [\fB\-o\fR\ \fIconfigoption\fR...]
 .SH "DESCRIPTION"
 .PP
 This command applies a label to an Amanda volume, erasing the volume in the process\&.
index c3131c8302d79a4c982ed8e7e482c8853be05ec9..c3207cd143444e3d9198eb3e6170d0a5b395ed49 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amoverview
 .\"    Author: Stefan G. Weichinger <sgw@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMOVERVIEW" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMOVERVIEW" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amoverview \- display file systems processed by Amanda over time
 .SH "SYNOPSIS"
 .HP \w'\fBamoverview\fR\ 'u
-\fBamoverview\fR [[\-config\ ]\ \fIconfig\fR] [\-hostwidth\ \fIwidth\fR] [\-diskwidth\ \fIwidth\fR] [\-skipmissed] [\-last] [\-num0] [\-togo0] [\-verbose]
+\fBamoverview\fR [[\-\-config\ ]\ \fIconfig\fR] [\-\-hostwidth\ \fIwidth\fR] [\-\-diskwidth\ \fIwidth\fR] [\-\-skipmissed] [\-\-last] [\-\-num0] [\-\-togo0] [\-\-verbose]
 .SH "DESCRIPTION"
 .PP
 \fBAmoverview\fR
@@ -33,14 +33,14 @@ See the
 man page for more details about Amanda\&.
 .SH "OPTIONS"
 .PP
-\fB\-config\fR \fIconfig\fR
+\fB\-\-config\fR \fIconfig\fR
 .RS 4
 Use configuration
 \fIconfig\fR
 instead of configuration daily\&.
 .RE
 .PP
-\fB\-hostwidth\fR \fIwidth\fR
+\fB\-\-hostwidth\fR \fIwidth\fR
 .RS 4
 Set
 \fBhost\fR
@@ -49,7 +49,7 @@ field column width to
 characters instead of 8\&.
 .RE
 .PP
-\fB\-diskwidth\fR \fIwidth\fR
+\fB\-\-diskwidth\fR \fIwidth\fR
 .RS 4
 Set
 \fBdisk\fR
@@ -58,27 +58,27 @@ field column width to
 characters instead of 20\&.
 .RE
 .PP
-\fB\-skipmissed\fR
+\fB\-\-skipmissed\fR
 .RS 4
 Compacts the output by only printing stats for the days Amanda actually ran\&.
 .RE
 .PP
-\fB\-last\fR
+\fB\-\-last\fR
 .RS 4
 Outputs the last status of each disk at the start\&. Useful for long tapecycles and/or sparse reports\&.
 .RE
 .PP
-\fB\-num0\fR
+\fB\-\-num0\fR
 .RS 4
 Outputs the number of level 0 dumps for each disk\&.
 .RE
 .PP
-\fB\-togo0\fR
+\fB\-\-togo0\fR
 .RS 4
 Outputs the number of runs until the last level 0 dump is overwritten\&.
 .RE
 .PP
-\fB\-verbose\fR
+\fB\-\-verbose\fR
 .RS 4
 \fBAmoverview\fR
 can take a long while on large systems\&. This option reports intermediate steps while it is working\&.
index 64ea29035f6521b2accfdd975aad31d7e69088b1..3490b5d682f99bf584c873ea84bb02eeccdec63f 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: ampgsql
 .\"    Author: Nikolas Coukouma <atrus@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMPGSQL" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMPGSQL" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -251,6 +251,24 @@ PSQL\-PATH
 Path to the psql binary\&. If not specified, the PATH environment variable
 will be searched\&.
 .RE
+.SH "RECOVERY"
+.PP
+Read the postgres documentation carefully before attempting a recovery\&. This section is only a rough guide to the process\&.
+.PP
+The data recovered from a postgres backup consists of a data tarball and one or more archive tarballs\&. The data contains the state of the database at the time the full backup was performed, and the archive tarballs contain postgres WAL files that must be re\-run to generate a consistent state\&.
+.PP
+Ensure that the database server is shut down, and move the existing data directory aside\&. Untar the data tarball over this directory, and verify that ownership and permissions are correct\&. Untar all of the archive tarballs into a single directory \- the archive directory\&. Create a
+recovery\&.conf
+in the data directory, owned by the proper user and with proper permissions\&. Add a
+\fBrestore_command\fR
+to it, e\&.g\&.,
+.nf
+restore_command = \'cp /path/to/archive_dir/%f "%p"\'
+.fi
+.PP
+Start the database server, and examine the logs to track the process of the recovery\&. When the recovery is complete, the server will transition into a running state, and will move the
+recovery\&.conf
+file aside so that it will not attempt a recovery on the next invocation\&.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
index b702150e8ab6a950dd0563136632d602f103c81f..f94fbf587fe7745ca5c5649036dc95efe715d2bd 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amplot
 .\"    Author: Olafur Gudmundsson <ogud@tis.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMPLOT" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMPLOT" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index e611fd7221e499b8cbdb9dd6adbe4fe1c9c1a8b1..ebb243eefbd2d67d73f3f712e2fe6d4b927a75ca 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amraw
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMRAW" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMRAW" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 6ac9e2b1c31a34f4dd2c13274c9da3d548718471..90bb0b01f368ff1a6f3bec681ee4ed34764a0424 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amrecover
 .\"    Author: Alan M. McIvor <alan@kauri.auck.irl.cri.nz>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMRECOVER" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMRECOVER" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amrecover \- Amanda index database browser
 .SH "SYNOPSIS"
 .HP \w'\fBamrecover\fR\ 'u
-\fBamrecover\fR [\-C\ \fIconfig\fR] [\-s\ \fIindex\-server\fR] [\-t\ \fItape\-server\fR] [\-d\ \fItape\-device\fR] [\-o\ \fIconfigoption\fR]...
+\fBamrecover\fR [\-C\ \fIconfig\fR] [\-s\ \fIindex\-server\fR] [\-t\ \fItape\-server\fR] [\-d\ \fItape\-device\fR] [\-h\ \fIhostname\fR] [\-o\ \fIconfigoption\fR]...
 .SH "DESCRIPTION"
 .PP
 \fBAmrecover\fR
@@ -84,6 +84,11 @@ Host that runs the tape server daemon\&.
 Tape device to use on the tape server host\&.
 .RE
 .PP
+\fB\-h hostname\fR
+.RS 4
+Hostname to begin restoring; defaults to the system\'s hostname\&.
+.RE
+.PP
 \fB\-o\fR \fIclientconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
@@ -207,7 +212,9 @@ Specifies the host to use as the tape server, and which of its tape devices to u
 .sp
 If you want amrecover to use your changer, the
 \fItapedev\fR
-must be equal to the amrecover_changer setting on the server\&.
+must be equal to the
+\fBamrecover\-changer\fR
+setting on the server\&.
 .sp
 Since device names contain colons, you must always specify the hostname\&.
 .nf
index 7a2aca1fa14c333123379b4747f20673a5ad8fa3..a0d47901bf4c013db9b3473f20cd462a00de6071 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amreport
 .\"    Author: Stefan G. Weichinger <sgw@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMREPORT" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMREPORT" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amreport \- generate a formatted output of statistics for an Amanda run
 .SH "SYNOPSIS"
 .HP \w'\fBamreport\fR\ 'u
-\fBamreport\fR [\fIconfig\fR] [{\fB\-o\fR\ \fIconfigoption\fR}...] [(1)\ \fIcommand\-line options\fR | (2)\ \fIscript options\fR]
+\fBamreport\fR [\fIconfig\fR] [\fB\-o\fR\ \fIconfigoption\fR...] [(1)\ \fIcommand\-line options\fR | (2)\ \fIscript options\fR]
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
@@ -149,6 +149,197 @@ directive is specified in amanda\&.conf\&.
 .RS 4
 Force script mode\&. Has no other effect\&.
 .RE
+.SH "TEXT REPORT FORMAT"
+.PP
+Amanda\'s text report format is divided into several sections\&. Some of these sections only appear if they are not empty\&.
+.PP
+Although newer versions of Amanda try to use the term "volume" to refer to a unit of storage, amreport still uses the term "tape", even if backups are done to non\-tape devices, to allow scripts which parse amreport\'s output to continue to function\&.
+.SS "Summary"
+.nf
+Hostname: bkserver
+Org     : DailySet1
+Config  : Daily
+Date    : February 25, 2009
+
+These dumps were to tape Daily\-103\&.
+The next tape Amanda expects to use is: Daily\-142
+
+FAILURE DUMP SUMMARY:
+   jamon\&.slikon\&.local /var lev 0  FAILED [/bin/tar exited with status 2]
+.fi
+.PP
+The summary section describes the run in broad terms, giving the server hostname, organization (from the
+\fBorg\fR
+configuration parameter), configuration name, and dump date\&. This is followed by a description of the volumes and holding disk used, and an rough estimate of the volume(s) Amanda will use on the next run\&.
+.PP
+Brief notices of any unusual circumstances will also be included here\&.
+.SS "Statistics"
+.nf
+STATISTICS:
+                          Total       Full      Incr\&.
+                        \-\-\-\-\-\-\-\-   \-\-\-\-\-\-\-\-   \-\-\-\-\-\-\-\-
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:01
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)           1\&.6        0\&.0        1\&.6
+Original Size (meg)         1\&.6        0\&.0        1\&.6
+Avg Compressed Size (%)   100\&.0      100\&.0      100\&.0   (level:#disks \&.\&.\&.)
+Filesystems Dumped            4          1          3   (1:3)
+Avg Dump Rate (k/s)      1555\&.1      134\&.2     1787\&.3
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)             1\&.6        0\&.0        1\&.6
+Tape Used (%)               5\&.5        0\&.1        5\&.4   (level:#disks \&.\&.\&.)
+Filesystems Taped             4          1          3   (1:3)
+                                                        (level:#parts \&.\&.\&.)
+Parts Taped                   4          1          3   (1:3)
+Avg Tp Write Rate (k/s)  143966    27624\&.3     151811
+
+USAGE BY TAPE:
+  Label            Time      Size      %  DLEs Parts
+  metals\-013       0:00     1650k    5\&.4     4     4
+.fi
+.PP
+This section contains aggregate statistics for the entire run\&. The three columns break down the results into a total for all data handled, only full dumps, and only incremental dumps\&. In the right margin, amreport indicates the breakdown of dump levels at the dumper and the taper\&.
+.PP
+The rows have the following meanings:
+.PP
+Estimate Time
+.RS 4
+The time used by the planner to estimate dump sizes\&.
+.RE
+.PP
+Run Time
+.RS 4
+Total runtime, from the invocation of amdump to its completion\&.
+.RE
+.PP
+Dump Time
+.RS 4
+Total time spent dumping clients\&.
+.RE
+.PP
+Output Size
+.RS 4
+Total quantity of data dumped, after compression\&.
+.RE
+.PP
+Original Size
+.RS 4
+Total quantity of data dumped, before compression\&.
+.RE
+.PP
+Avg Compressed Size
+.RS 4
+Compression ratio, calculated from the previous two rows\&.
+.RE
+.PP
+Filesystems Dumped
+.RS 4
+Number of DLEs dumped\&.
+.RE
+.PP
+Avg Dump Rate
+.RS 4
+Average speed at which clients produced data\&. Note that, for dumps done directly to a slow device, rather than to holding disk, this rate may reflect a write speed constrained by the device speed\&.
+.RE
+.PP
+Tape Time
+.RS 4
+Total time spent writing to storage volumes\&. This includes time spent changing tapes, including time spent waiting for flush thresholds to be met\&.
+.RE
+.PP
+Tape Size
+.RS 4
+Total quantity of data written to storage volumes\&.
+.RE
+.PP
+Tape Used
+.RS 4
+Fraction of the total allocated storage (tapetype length times runtapes) actually used\&.
+.RE
+.PP
+Filesystems Taped
+.RS 4
+Number of filesystems written to storage\&. This may be larger or smaller than the number of filesystems dumped, due to flushes or dumps left on holding disk\&.
+.RE
+.PP
+Parts Taped
+.RS 4
+Number of split parts writtten to storage\&. If this number is very large, then the split size may be too small\&.
+.RE
+.PP
+Avg Tp Write Rate
+.RS 4
+Taper speed, based on the tape time and tape size, above\&. Note that, because the tape time includes time spent on tasks other than writing to tape, this does not necessary reflect the device\'s real write speed\&. However, the value is useful for capacity planning, as it reflects a realistic estimate of how quickly Amanda can write data to storage\&.
+.RE
+.SS "Usage by Tape"
+.nf
+USAGE BY TAPE:
+  Label          Time      Size      %  DLEs Parts
+  Conf\-001       0:00    20320k   66\&.2     1     4
+  Conf\-002       0:00     6470k   21\&.1     0     2
+.fi
+.PP
+This short section gives per\-volume statistics: time spent writing to the volume; bytes written to the volume; portion of the expected tape length used; number of DLEs started, and total number of split parts written\&.
+.SS "Notes"
+.nf
+NOTES:
+  taper: tape DAILY\-37 kb 30720 fm 3 [OK]
+.fi
+.PP
+This section contains any informational log messages from the run\&. Most messages are self\-explanatory\&. The taper message shown in the example is always present, and is redundant to the previous section\&. It indicates that 30720 kb were written to "DAILY\-37" in 3 files\&.
+.SS "Failure and Strange Details"
+.nf
+FAILED DUMP DETAILS:
+
+/\-\-  jamon\&.slikon\&.local /var lev 0 FAILED [/bin/tar exited with status 2]
+sendbackup: info BACKUP=APPLICATION
+sendbackup: info APPLICATION=amgtar
+sendbackup: info RECOVER_CMD=/usr/bin/gzip \-dc |amgtar \-f\&.\&.\&. \-
+sendbackup: info COMPRESS_SUFFIX=\&.gz
+sendbackup: info end
+? /bin/tar: \&./gdm: Cannot savedir: Permission denied
+| Total bytes written: 943831040 (901MiB, 4\&.9MiB/s)
+| /bin/tar: Error exit delayed from previous errors
+sendbackup: error [/bin/tar exited with status 2]
+sendbackup: size 921710
+sendbackup: end
+\e\e\-\-\-\-\-\-\-\-
+
+STRANGE DUMP DETAILS:
+
+/\-\-  bsdfw\&.slikon\&.local / lev 0 STRANGE
+sendbackup: info BACKUP=APPLICATION
+sendbackup: info APPLICATION=amgtar
+sendbackup: info RECOVER_CMD=/usr/bin/gzip \-dc |amgtar \-f\&.\&.\&. \-
+sendbackup: info COMPRESS_SUFFIX=\&.gz
+sendbackup: info end
+| /bin/tar: \&./tmp/\&.X11\-unix/X0: socket ignored
+| Total bytes written: 5530869760 (5\&.2GiB, 3\&.0MiB/s)
+sendbackup: size 5401240
+sendbackup: end
+\e\e\-\-\-\-\-\-\-\-
+.fi
+.PP
+This section expands on failures and strange results indicated in earlier sections\&. In both cases, the details contain a messages produced by the underlying backup tool \- GNU tar, in this example\&. Failed dumps have actually failed, and the reasons are usually clear\&. Strange dumps, however, are regarded as successful by Amanda, but contain messages that Amanda did not recognize and which may be of interest to the operator\&.
+.SS "Dump Summary"
+.nf
+DUMP SUMMARY:
+                                       DUMPER STATS                TAPER STATS
+HOSTNAME     DISK        L ORIG\-kB  OUT\-kB  COMP%  MMM:SS   KB/s MMM:SS     KB/s
+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+strontium    /etc        1     270     270    \-\-     0:00 1146\&.3   0:00 140918\&.6
+strontium    \-me/elantra 1      10      10    \-\-     0:00   65\&.6   0:00   9033\&.4
+strontium    /local      0      20      20    \-\-     0:00  133\&.9   0:00  27624\&.3
+strontium    \-ository_13 1    1350    1350    \-\-     0:01 2568\&.5   0:00 175006\&.5
+.fi
+.PP
+The dump summary table has one row for each DLE processed during the run\&. The "L" column gives the level of the dump\&. The remaining colums are divided into dumper stats and taper stats\&.
+.PP
+The dumper stats give the original (before compression) and output (after compression) size of each dump, as well as a compression ratio, if applicable\&. The column labeled "MMM:SS" gives the time spent on that dump, and the next column is the calculated dump rate\&.
+.PP
+The taper stats give the time and speed with which the dump was written to storage\&. This value is the sum of the times for each part, and as such does not include time spent switching volumes\&.
 .SH "LABEL PRINTING"
 .PP
 Amanda can print postscript labels describing the contents of tape(s) written in a run\&. The labels are designed to be folded and inserted into the tape case along with the tape or hole punched and put in a 3\-ring binder\&. Various label templates are provided to format data for different tape sizes\&.
index 42dc9f13b39cccd74b9d46434befd1f4773d3303..3c7c540d1e6b3541abb070d5b4d0128b6210ab87 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amrestore
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMRESTORE" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMRESTORE" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amrestore \- low\-level data\-extraction from Amanda volumes
 .SH "SYNOPSIS"
 .HP \w'\fBamrestore\fR\ 'u
-\fBamrestore\fR [\-\-config\ \fIconfig\fR] [\-r | \-c | \-C] [\-b\ \fIblocksize\fR] [\-f\ \fIfilenum\fR] [\-l\ \fIlabel\fR] [\-p] [\-h] [{\fB\-o\fR\ \fIconfigoption\fR}...] [{\fIchangerspec\fR} | {[\-\-holding]\ \fIholdingfile\fR}] [\fIhostname\fR\ [\ \fIdiskname\fR\ [\ \fIdatestamp\fR\ [\ \fIhostname\fR\ [\ \fIdiskname\fR\ [\ \fIdatestamp\fR\ \&.\&.\&.\ ]\ ]\ ]\ ]\ ]]
+\fBamrestore\fR [\-\-config\ \fIconfig\fR] [\-r | \-c | \-C] [\-b\ \fIblocksize\fR] [\-f\ \fIfilenum\fR] [\-l\ \fIlabel\fR] [\-p] [\-h] [\fB\-o\fR\ \fIconfigoption\fR...] [{\fIchangerspec\fR} | {[\-\-holding]\ \fIholdingfile\fR}] [\fIhostname\fR\ [\ \fIdiskname\fR\ [\ \fIdatestamp\fR\ [\ \fIhostname\fR\ [\ \fIdiskname\fR\ [\ \fIdatestamp\fR\ \&.\&.\&.\ ]\ ]\ ]\ ]\ ]]
 .PP
 Note that this is the only Amanda command which does not take a configuration name as its first argument\&.
 .SH "DESCRIPTION"
@@ -49,15 +49,9 @@ s3:mybucket/tape\-1\&.
 .PP
 Only dumps matching the dump specification beginning with
 \fIhostname\fR
-are extracted\&. If no specification is given, every file on the volume (or the entire holdingfile) is restored\&. See the "HOST & DISK EXPRESSIONS" section of
-\fBamanda\fR(8)
-for the format of the
-\fIhostname\fR
-and
-\fIdiskname\fR
-parameters, and the "DATESTAMP EXPRESSIONS" section for the format of the
-\fIdatestamp\fR
-parameters\&.
+are extracted\&. If no specification is given, every file on the volume (or the entire holdingfile) is restored\&. See the "DUMP SPECIFICATIONS" section of
+\fBamanda-match\fR(7)
+for more information\&.
 .PP
 Unless
 \fB\-p\fR
@@ -164,6 +158,7 @@ must be used to restore files from backup images created with the GNUTAR dumptyp
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
+\fBamanda-match\fR(7),
 \fBamfetchdump\fR(8),
 \fBamrecover\fR(8)
 .PP
index d96c97fdcc30e568a1d5d8ce94fdbb63b8198954..1f34c1836d63b55d4b7a9bc97896a5d14040515f 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amrmtape
 .\"    Author: Adrian T. Filipi-Martin <atf3r@cs.virginia.edu>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMRMTAPE" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMRMTAPE" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index f797eae7349823bd8d3cd93feaa3d4c448db1280..875c2887e4b079185f17a44bdb2c4afa077ed931 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amsamba
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMSAMBA" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMSAMBA" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 3e7cbf4939c10ebbfcfc6df78b7f203fc3f9316f..06d65e065f357231e0975ce570357bb091fb0bf7 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amserverconfig
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMSERVERCONFIG" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMSERVERCONFIG" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 0276a8f09900e76fa041f4a0d49558ae6116f035..2ea8396d9d249651f24e39779a41870b68330fa3 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amservice
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMSERVICE" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMSERVICE" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amservice \- run an amanda service on a client
 .SH "SYNOPSIS"
 .HP \w'\fBamservice\fR\ 'u
-\fBamservice\fR \fIhostname\fR \fIauth\fR \fIservice\fR [\-f\ \fIinput_file\fR] [{\fB\-o\fR\ \fIconfigoption\fR}...]
+\fBamservice\fR \fIhostname\fR \fIauth\fR \fIservice\fR [\-f\ \fIinput_file\fR] [\fB\-o\fR\ \fIconfigoption\fR...]
 .SH "DESCRIPTION"
 .PP
 \fBAmservice\fR
index 7d01e6f7fecd795a3595d7ef690dab036c5f4090..067e9dd4477e712c9f5309a8de1d65ad7181ae01 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amstar
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMSTAR" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMSTAR" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 48aade71d4a102c0cb611eff6a6b438f940a8937..1d37ed2da8f4ba2b000263fb118cca7ff7288e18 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amstatus
 .\"    Author: Stefan G. Weichinger <sgw@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMSTATUS" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMSTATUS" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 858c04f5428a51eb0c128ee31fe647d82258d804..a4392599f90156b899b785f75aab01bd41fc87bc 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amsuntar
 .\"    Author: Satya Ganga <gast@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMSUNTAR" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMSUNTAR" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index e11d8c9b82acf228c697c7c4b453ea682c5edfba..85e2326d3bce8f25e4e5f134da7ef1828592b19c 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amtape
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMTAPE" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMTAPE" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amtape \- Control Amanda changers
 .SH "SYNOPSIS"
 .HP \w'\fBamtape\fR\ 'u
-\fBamtape\fR \fIconfig\fR \fIsubcommand\fR [\fIsubcommand_options\fR...] [{\fB\-o\fR\ \fIconfigoption\fR}...]
+\fBamtape\fR \fIconfig\fR \fIsubcommand\fR [\fIsubcommand_options\fR...] [\fB\-o\fR\ \fIconfigoption\fR...]
 .SH "DESCRIPTION"
 .PP
 \fBAmtape\fR
index daf775303fc3879ed112dfced86c08d53338cb68..b014129289bacbe8d54a904d7ce91422b78e3a19 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amtapetype
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMTAPETYPE" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMTAPETYPE" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amtapetype \- generate a tapetype definition by testing the device directly
 .SH "SYNOPSIS"
 .HP \w'\fBamtapetype\fR\ 'u
-\fBamtapetype\fR [\-h] [\-c] [\-f] [\-p] [\-b\ \fIblocksize\fR] [\-t\ \fItypename\fR] [\-l\ \fIlabel\fR] [{\fB\-o\fR\ \fIconfigoption\fR}...] [\fIconfig\fR] [\fIdevice\fR]
+\fBamtapetype\fR [\-h] [\-c] [\-f] [\-p] [\-b\ \fIblocksize\fR] [\-t\ \fItypename\fR] [\-l\ \fIlabel\fR] [\fB\-o\fR\ \fIconfigoption\fR...] [\fIconfig\fR] [\fIdevice\fR]
 .SH "DESCRIPTION"
 .PP
 \fBamtapetype\fR
index 3a0cb629ac3e71f5586209710715d872d78ba983..712455b5e71c41d2a65e3919b6578f6a0e600ee7 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amtoc
 .\"    Author: Nicolas Mayencourt <Nicolas.Mayencourt@cui.unige.ch>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMTOC" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMTOC" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index c87c24d8b121f3168a304a318408be9f8908b550..fe6e7c9d64f88ee262d44ebe4f3094acad33b4fb 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amvault
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMVAULT" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMVAULT" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
 amvault \- Copy Amanda dumps from one volume to another
 .SH "SYNOPSIS"
 .HP \w'\fBamvault\fR\ 'u
-\fBamvault\fR [{\fB\-o\fR\ \fIconfigoption\fR}...] [\-q|\-\-quiet] \fIconfig\fR \fIsrc\-run\-timestamp\fR \fIdst\-changer\fR \fIlabel\-template\fR
+\fBamvault\fR [\fB\-o\fR\ \fIconfigoption\fR...] [\-q] [\-\-quiet] [\-n] [\-\-dry\-run] [\-\-fulls\-only] [\-\-export] [\fB\-\-src\-timestamp\fR\ \fIsrc\-timestamp\fR]
+.br
+\fB\-\-label\-template\fR\ \fIlabel\-template\fR \fB\-\-dst\-changer\fR\ \fIdst\-changer\fR [\fB\-\-autolabel\fR\ \fIautolabel\-arg\fR...]
+.br
+\fIconfig\fR [\fIhostname\fR\ [\ \fIdisk\fR\ [\ \fIdate\fR\ [\ \fIlevel\fR\ [\ \fIhostname\fR\ [\&.\&.\&.]\ ]\ ]\ ]\ ]]
 .SH "WARNING"
 .PP
 This application is not yet in its final form, and is subject to major revision in subsequent versions of Amanda\&. Backward compatibility is not guaranteed\&.
 .PP
-The significant limitations of this version of amvault are: tapetypes for secondary and tertiary volumes much match (including length and device_properties); tertiary volumes must be blank (manual erasure is required to re\-use tertiary media; restore/recover operations will request tertiary media by label when dumpfiles are not found on secondary media, but there is no provision to automatically fetch such media from a different changer; and all dumpfiles on a secondary volume are moved to tertiary media \- there is no provision to filter dumps\&.
+Note that Amanda restore/recover operations will request tertiary media by label when dumpfiles are not found on secondary media, but there is no provision to automatically fetch such media from a different changer
 .PP
 Feedback on and patches to this application are invited and encouraged!
 .SH "DESCRIPTION"
 .PP
+Amvault is conceptually equivalent to "amfetchdump | taper"\&. That is, it reads specified dumps from secondary media and re\-writes them on tertiary media\&.
+.PP
 \fBAmvault\fR
 Copies data from the run with timestamp
-\fIsrc\-run\-timestamp\fR
+\fBsrc\-timestamp\fR
 onto volumes using the changer
-\fIdst\-changer\fR, labeling new volumes with
-\fIlabel\-template\fR\&. If
-\fIsrc\-run\-timestamp\fR
-is "latest", then the most recent amdump or amflush run will be used\&.
+\fBdst\-changer\fR, and labeling new volumes with
+\fBlabel\-template\fR\&. If
+\fBsrc\-timestamp\fR
+is "latest", then the most recent amdump or amflush run will be used\&. If
+\fB\-\-fulls\-only\fR
+is given, then only full (level\-0) dumps are copied\&.
+.PP
+The
+\fB\-\-quiet\fR
+(\fB\-q\fR) option will eliminate non\-error messages, and is useful when running amvault from cron\&. The
+\fB\-\-dry\-run\fR
+(\fB\-n\fR) option will cause amvault to print the dumps it would vault, but not actually perform any vaulting operations\&.
+.SS "Secondary Media"
 .PP
-In a vaulting operation, the source media is referred to as "secondary media", while the destination is referred to as "tertiary media"\&.
+The dumps to be read from secondary media can be specified by any combination of dump specifications,
+\fB\-\-fulls\-only\fR, and
+\fB\-\-src\-timestamp\fR\&. At least one must be specified, lest amvault attempt to vault all dumps in the catalog\&. See
+\fBamanda-match\fR(7)
+for more information on dump specifications\&.
 .PP
-Each source volume will be copied to a new destination volume; no re\-assembly or splitting will be performed\&. Destination volumes must be at least as large as the source volumes\&.
+Note that the datestamp given in the dumpspec is the
+\fIdump\fR
+datestamp \- the run in which the backup was taken on the Amanda client\&. The
+\fB\-\-src\-timestamp\fR, on the other hand, is the
+\fIwrite\fR
+timestamp \- the run in which the dump was written to secondary media\&. The latter option facilitates duplicating the results of an entire backup run, including any dumps that might have been flushed from holding disk\&.
+.SS "Tertiary Media"
+.PP
+The
+\fB\-\-dst\-changer\fR
+must be specified, and names the changer in which tertiary media are stored\&. In general, this should be different from the secondary changer, to eliminate the possibility of overwriting secondary media with tertiary data\&.
 .PP
 The changer parameter should specify the name of a changer defined in
 \fBamanda.conf\fR(5)\&. For example:
@@ -58,19 +87,37 @@ define changer vaulting_tape {
 .fi
 .PP
 The
-\fI\-\-quiet\fR
-option reduces the verbosity of the utility; this can be useful for volumes containing many split parts\&. The
-\fI\-\-autolabel\fR
-option defines which tertiary volumes amlabel will overwrite\&. It can have any of the values defined for
-\fBautolabel\fR
-in
-\fBamanda.conf\fR(5), with the addition of "this_config", meaning volumes matching the labelstr for this configuration\&. The option defaults to "empty"\&. Multiple values can be separated with commas\&. The label template functions identically to the template for teh
+\fB\-\-label\-template\fR
+option is required, and specifies a label template which is used to generate new labels for tertiary volumes\&. The
+\fB\-\-autolabel\fR
+option works just like the
 \fBautolabel\fR
-parameter\&.
+parameter in
+\fBamanda.conf\fR(5), and can be specified multiple times if necessary\&. The default is \'empty\'\&.
+.PP
+If
+\fBamanda.conf\fR(5)
+contains the new
+\fBpart\-size\fR
+splitting parameters, then amvault will use them without any additional configuration\&. However, if the configuration still uses the old splitting parameters (\fBtape_splitsize\fR,
+\fBsplit_diskbuffer\fR, and
+\fBfallback_splitsize\fR), then amvault will need some additional configuration in order to properly split dumps to tertiary media\&. To do so, specify a new tapetype in
+\fBamanda.conf\fR(5), say "TERTIARY", and set the
+\fBpart\-size\fR
+and other appropriate parameters there\&. Then reference that tapetype in the amvault invocation:
+.sp
+.nf
+    amvault \-otapetype=TERTIARY \&.\&.\&.
+.fi
+.PP
+The
+\fB\-\-export\fR
+option will cause amvault to attempt to move completed tertiary volumes to import/export slots, where they can be more easily removed by an operator\&.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fBamanda-changers\fR(7)
+\fBamanda-changers\fR(7),
+\fBamfetchdump\fR(8)
 .PP
 The Amanda Wiki:
 : http://wiki.zmanda.com/
index e6e124c11e3ea453aa75fc5ae4abbee1f0e49e35..8d17da791ab27c9b2ec2dc062666f1a21f3de2b1 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amzfs-sendrecv
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMZFS\-SENDRECV" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMZFS\-SENDRECV" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index ed0bdbc10fb0dbc9cb6996524337348fbac35326..458b491696dabfdf90618e64fa3f06085157c91c 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amzfs-snapshot
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "AMZFS\-SNAPSHOT" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "AMZFS\-SNAPSHOT" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 138ef89c2fca149b17f8a1927e17a9e924a567b5..349d7daac3b4a19221b2531118d341bfd282bba8 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: disklist
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: File formats and conventions
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "DISKLIST" "5" "06/01/2010" "Amanda 3\&.1\&.0" "File formats and conventions"
+.TH "DISKLIST" "5" "10/18/2010" "Amanda 3\&.2\&.0" "File formats and conventions"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 126e96b6891e51a107e0363adddf2d0022086425..d55b6e815feef24161fba26a8c2cc160b4a94291 100644 (file)
@@ -78,7 +78,7 @@
   </varlistentry>'>
 
 <!ENTITY configoverride.synopsis
-    '<group rep="repeat" choice="opt"><arg choice="req"><option>-o</option> <replaceable>configoption</replaceable></arg></group>'>
+    '<arg rep="repeat" choice="opt"><option>-o</option> <replaceable>configoption</replaceable></arg>'>
 
 <!ENTITY configoverride.varlistentry
   '<varlistentry>
index f6d7db847f0e24829ec65ba52b39980229129f34..e1e275a5dda0c865b3c5e61e0c3fbbb83f45cb71 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: script-email
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "SCRIPT\-EMAIL" "8" "06/01/2010" "Amanda 3\&.1\&.0" "System Administration Commands"
+.TH "SCRIPT\-EMAIL" "8" "10/18/2010" "Amanda 3\&.2\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 20e452557d39a3accd92768edd2979958c33aa3b..ffd848c70ef22bf056e2730f6659a04d4706089b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: tapelist
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 06/01/2010
+.\"      Date: 10/18/2010
 .\"    Manual: File formats and conventions
-.\"    Source: Amanda 3.1.0
+.\"    Source: Amanda 3.2.0
 .\"  Language: English
 .\"
-.TH "TAPELIST" "5" "06/01/2010" "Amanda 3\&.1\&.0" "File formats and conventions"
+.TH "TAPELIST" "5" "10/18/2010" "Amanda 3\&.2\&.0" "File formats and conventions"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 9f70828bf2bf0d7d104b5f2b25d5b6633c66e290..7bc1f2f641b48a48d6d6770aab8027cf60fb111a 100644 (file)
@@ -54,17 +54,9 @@ man page for more details about Amanda.</para>
 parameter pair operate on all disks in the &disklist; for that
 <emphasis remap='I'>hostname</emphasis> if no disks are specified.  Where
 <emphasis remap='I'>hostname</emphasis> is also marked as being optional,
-the command operates on all hosts and disks in the &disklist;.
+the command operates on all hosts and disks in the &disklist; when no hostname is given.
 Both <emphasis remap='I'>hostname</emphasis> and <emphasis remap='I'>disks</emphasis>
-are special expressions; see the &quot;HOST &amp; DISK EXPRESSION&quot; section
-of <manref name="amanda" vol="8"/>
-for a description.</para>
-
-<para>Commands that take one or more <emphasis remap='I'>dumpspec</emphasis> parameters operate
-on the set of dumps specified by all of the expressions.  See the &quot;DUMP SPECIFICATIONS&quot;
-section of
-<manref name="amanda" vol="8"/>
-for a description.</para>
+are match expressions; see <manref name="amanda-match" vol="7"/> for a description.</para>
 
 <variablelist remap='TP'>
   <varlistentry>
@@ -220,10 +212,12 @@ The default sort order is <emphasis remap='B'>hkdlpbfw</emphasis>.</para>
   <term><emphasis remap='B'>holding list</emphasis> [-l] [-d] [ <emphasis remap="I">hostname</emphasis> [ <emphasis remap="I">disk</emphasis> [ <emphasis remap="I">datestamp</emphasis> [ .. ] ] ] ]</term>
   <listitem>
 
-    <para>List holding files matching the given specification, or all holding
-    files if no specification is provided.  With '-l', additional information
-    (size, level, and whether the dump is outdated) is provided.  With '-d', only
-    outdated dumps are shown.</para>
+    <para>List holding files matching the given dump specification, or all
+       holding files if no specification is provided.  See <manref
+           name="amanda-match" vol="7"/> for more information on dump
+       specifications.  With '-l', additional information (size, level, and
+       whether the dump is outdated) is provided.  With '-d', only outdated
+       dumps are shown.</para>
 
     <para>An outdated holding file is one which is not required for a
     restore of the <emphasis>most recent</emphasis> dump.  Note that
@@ -299,6 +293,18 @@ on
 <emphasis remap='I'>hostname</emphasis>
 (or all hosts).
 Mostly used for debugging.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'>hosts</emphasis></term>
+  <listitem>
+<para>Output a list of distinct hosts in the &disklist;, one per line, for easy use in shell scripts.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'>dles</emphasis></term>
+  <listitem>
+<para>Output a list of distinct DLEs in the &disklist;, one per line with host and diskname separated by a space, for easy use in shell scripts.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
@@ -457,16 +463,13 @@ TOTAL      241  12412187   7316312   731631  (estimated 8 runs per dumpcycle)
 </programlisting>
 </refsect1>
 
-<refsect1><title>FILES</title>
-<para>/usr/local/etc/amanda/<emphasis remap='I'>config</emphasis>/amanda.conf</para>
-</refsect1>
-
 <seealso>
 <manref name="amanda" vol="8"/>,
 <manref name="amcheck" vol="8"/>,
 <manref name="amdump" vol="8"/>,
 <manref name="amrestore" vol="8"/>,
 <manref name="amfetchdump" vol="8"/>
+<manref name="amanda-match" vol="7"/>,
 </seealso>
 
 </refentry>
index 1a97ad2b13ee13d62b56f8d3eb16ef99509e0266..44b8730d37301efdfc7ff0ed0737c539f20a7b89 100644 (file)
@@ -29,7 +29,7 @@
 <!-- body begins here -->
 
 <refsect1><title>DESCRIPTION</title>
-<para>Amanda offers 7 methods of communication between Amanda server (sometimes also called the tape server) and clients, each with its own authentication method.  The desired communication method is specified by the <emphasis remap='I'>auth</emphasis> parameter in the amanda.conf file (&amconf;) commonly as a dumptype.  Valid values to the <emphasis remap='I'>auth</emphasis> parameter are <emphasis remap='B'>bsd</emphasis>, <emphasis remap='B'>bsdudp</emphasis>, <emphasis remap='B'>bsdtcp</emphasis>, <emphasis remap='B'>krb4</emphasis>, <emphasis remap='B'>krb5</emphasis>, <emphasis remap='B'>local</emphasis>, <emphasis remap='B'>rsh</emphasis>, and <emphasis remap='B'>ssh</emphasis>. Please note that <emphasis remap='B'>krb4</emphasis> will be removed in the next release.  The authentication and communication method is used during the backup process &amdump; (amdump(8)) as well as the recovery process &amrecover; (amrecover(8)).</para>
+<para>Amanda offers 7 methods of communication between Amanda server (sometimes also called the tape server) and clients, each with its own authentication method.  The desired communication method is specified by the <emphasis remap='I'>auth</emphasis> parameter in the amanda.conf file (&amconf;) commonly as a dumptype.  Valid values to the <emphasis remap='I'>auth</emphasis> parameter are <emphasis remap='B'>bsd</emphasis>, <emphasis remap='B'>bsdudp</emphasis>, <emphasis remap='B'>bsdtcp</emphasis>, <emphasis remap='B'>krb5</emphasis>, <emphasis remap='B'>local</emphasis>, <emphasis remap='B'>rsh</emphasis>, and <emphasis remap='B'>ssh</emphasis>. The authentication and communication method is used during the backup process &amdump; (amdump(8)) as well as the recovery process &amrecover; (amrecover(8)).</para>
 </refsect1>
 
 <refsect1><title>COMPILATION AND GENERAL INFORMATION</title>
@@ -71,14 +71,36 @@ Authentication        Configure option(s)
    --with-client-instance=ARG     client host instance   [HOSTNAME_INSTANCE]
    --with-client-keyfile=ARG      client host key file   [KEYFILE]
    --with-ticket-lifetime=ARG     ticket lifetime        [128]
-   --with-krb4-security=DIR       where libkrb.a lives   [see below]
    --with-krb5-security=DIR       where libkrb.a lives   [see below]
 </programlisting>
 </para>
 
-<para>If configuring with --with-krb4-security and/or --with-krb5-security, the configure script will search under /usr/kerberos/lib, /usr/cygnus/lib, /usr/lib, and /opt/kerberos/lib for the kerberos bits, libkrb.a, in this order.  Kerberos support will not be added if it does not find them.  If the kerberos bits are found under some other hierarchy, you can specify this via --with-krb5-security=DIR and/or --with-krb4-security=DIR, where DIR is where the kerberos bits live.  The configure script will then look in the 'lib' directory under this hierarchy for libkrb.a.</para>
+<para>If configuring with --with-krb5-security, the configure script will search under /usr/kerberos/lib, /usr/cygnus/lib, /usr/lib, and /opt/kerberos/lib for the kerberos bits, libkrb.a, in this order.  Kerberos support will not be added if it does not find them.  If the kerberos bits are found under some other hierarchy, you can specify this via --with-krb5-security=DIR where DIR is where the kerberos bits live.  The configure script will then look in the 'lib' directory under this hierarchy for libkrb.a.</para>
 
 <para>The <emphasis remap='B'>auth</emphasis> parameter selects a communication/authentication method to use between the client and the backup server. These methods are described each in their own section below.</para>
+
+<refsect2><title>Usernames</title>
+
+<para>When Amanda is built, a username is specified with the
+<option>--with-user</option> option.  Most Amanda processes run under
+this user's identity, to minimize security risks.  In binary
+distributions, this username is usually one of 'amanda',
+'amandabackup', or 'backup'.  The examples below use 'amandabackup'
+since it is unambiguous. You may need to adjust accordingly for your
+system.</para>
+
+</refsect2>
+
+<refsect2><title>Authenticated Peer Hostnames</title>
+
+<para>Amanda's authentication mechanisms provide an authenticated hostname of
+the system on the other end of the connection, which is used to restrict
+access to only particular hosts.  The degree of "authentication" performed
+on this hostname varies with the authentication mechanism, and is discussed
+below.</para>
+
+</refsect2>
+
 </refsect1>
 
 <refsect1><title>BSD, BSDUDP, AND BSDTCP COMMUNICATION AND AUTHENTICATION</title>
@@ -86,9 +108,17 @@ Authentication        Configure option(s)
 
   <para>The <emphasis remap='B'>bsd</emphasis>, <emphasis remap='B'>bsdudp</emphasis>, and <emphasis remap='B'>bsdtcp</emphasis> communication methods use either UDP, TCP, or both protocols operating as a network service to authenticate and exchange data between server and clients.</para>
 
+  <para>The authentication proceeds as follows: for a new, incoming connection,
+  Amanda verifies that the source port is in the reserved range (less than
+  1024), which for UNIX hosts suggests that the remote user has root
+  privileges.  Amanda then verifies that the reverse DNS for the remote
+  address matches the forward DNS; that is, that the address maps to a
+  hostname which maps back to the same address.  Finally, the remote system
+  must provide a username that matches the username in .amandahosts.</para>
+
   <para>In addition to compilation and general configuration (see <emphasis remap='B'>COMPILATION AND GENERAL INFORMATION</emphasis> above), the authentication method that the client is configured to receive is specified by the <emphasis remap='B'>auth</emphasis> parameter in the network service configuration for Amanda. The authentication method used by an Amanda client to reach the server during recovery is the authentication method specified by the <emphasis remap='I'>auth</emphasis> parameter in the client's Amanda network service configuration or in its amanda-client.conf file (see amanda-client.conf(5)).</para>
 
-  <para>By default, Amanda use the "amanda" service name and associated port set in /etc/services. It can be changed by setting the dumptype <emphasis remap='I'>client_port</emphasis> option to a different port number or a different service name.
+  <para>By default, Amanda use the "amanda" service name and associated port set in /etc/services. It can be changed by setting the dumptype <emphasis remap='I'>client-port</emphasis> option to a different port number or a different service name.
   All examples are for the service name "amanda" that uses the default port 10080.</para>
 
 
@@ -117,7 +147,7 @@ configuration file.</para>
 
 <para>If service is omitted, it defaults to <emphasis remap='B'>noop selfcheck sendsize sendbackup</emphasis> (which is equivalent to <emphasis remap='B'>amdump</emphasis>).</para>
 
-    <para>Example of the .amandahosts file on an Amanda client
+    <para>Example of the .amandahosts file on an Amanda client, where 'amandabackup' is the Amanda dumpuser.
 
 <programlisting>
     <emphasis remap='B'>amandaserver.example.com   amandabackup   amdump</emphasis>
@@ -161,14 +191,14 @@ configuration file.</para>
     <para>Client example of using <emphasis remap='B'>bsdtcp</emphasis> authorization for inetd server given Amanda user is "amandabackup":
 
 <programlisting>
-<emphasis remap='B'>   amanda stream tcp nowait amanda /path/to/amandad amandad -auth=bsdtcp amdump</emphasis>
+<emphasis remap='B'>   amanda stream tcp nowait amandabackup /path/to/amandad amandad -auth=bsdtcp amdump</emphasis>
 </programlisting>
     </para>
     <para><emphasis remap='B'>amindexd</emphasis> and <emphasis remap='B'>amidxtaped</emphasis> would typically be added at the end of the line as &amandad; server arguments for an Amanda server.</para>
     <para>Server example of using <emphasis remap='B'>bsdtcp</emphasis> authorization for inetd server given Amanda user is "amandabackup":
 
 <programlisting>
-<emphasis remap='B'>   amanda stream tcp nowait amanda /path/to/amandad amandad -auth=bsdtcp amdump amindexd amidxtaped</emphasis>
+<emphasis remap='B'>   amanda stream tcp nowait amandabackup /path/to/amandad amandad -auth=bsdtcp amdump amindexd amidxtaped</emphasis>
 </programlisting>
     </para>
     <para>For Amanda version 2.5.0 and earlier, remember that neither <emphasis remap='B'>bsdudp</emphasis> nor <emphasis remap='B'>bsdtcp</emphasis> are supported and the Amanda daemon &amandad; accepts no arguments.  Because of the latter, &amrecover; as of Amanda version 2.5.1  is not compatible with 2.5.0 and earlier servers.  Thus, servers that are 2.5.0 or earlier must, in addition to the <emphasis remap='I'>amanda</emphasis> service, run <emphasis remap='I'>amindexd</emphasis> and <emphasis remap='I'>amidxtaped</emphasis> Amanda services as their own network services, amandaidx and amidxtape, respectively (see below).</para>
@@ -178,8 +208,8 @@ configuration file.</para>
 <para>Example of amindexd and amidxtaped Amanda daemon services configured as their own network services for a 2.5.0 or earlier server or a newer server having 2.5.0 or earlier clients
 
 <programlisting>
-<emphasis remap='B'>   amandaidx stream tcp nowait amanda /usr/local/libexec/amanda/current/amindexd   amindexd</emphasis>
-<emphasis remap='B'>   amidxtape stream tcp nowait amanda /usr/local/libexec/amanda/current/amidxtaped amidxtaped</emphasis>
+<emphasis remap='B'>   amandaidx stream tcp nowait amandabackup /usr/local/libexec/amanda/current/amindexd   amindexd</emphasis>
+<emphasis remap='B'>   amidxtape stream tcp nowait amandabackup /usr/local/libexec/amanda/current/amidxtaped amidxtaped</emphasis>
 </programlisting>
 </para>
   </refsect2>
@@ -295,53 +325,30 @@ bsdtcp            tcp             1 RPpAP [--with-low-tcpportrange]       10080
     <para>Amanda server also uses two ports (dumper process) to communicate with the chunker/taper processes. These ports are in the range set by --with-tcpportrange.</para>
 <para>You can override the default port ranges that Amanda was compiled with in each configuration using the <emphasis remap='I'>reserved-udp-port</emphasis>, <emphasis remap='I'>reserved-tcp-port</emphasis>, and <emphasis remap='I'>unreserved-tcp-port</emphasis> parameters in amanda.conf and amanda-client.conf configuration files (see &amconf; and &amclientconf;).</para>
   </refsect2>
-</refsect1>
 
-<refsect1><title>KERBEROS COMMUNICATION AND AUTHENTICATION</title>
-For more detail, see http://wiki.zmanda.com/index.php/Kerberos_authentication.
+<refsect2><title>Authenticated Peer Hostnames with BSD Authentications</title>
 
-<para>Amanda supports Kerberos 4 and 5 communication methods between Amanda server and client. Please note, however, that support for Kerberos 4 will be removed in the next release.</para>
+<para>The BSD authentication mechanisms only verify that the remote
+host's DNS is configured correctly and that the remote user has access to
+reserved ports.  As such, the peer hostname should only be trusted to the
+extent that the local DNS service is trusted.</para>
 
-<para>General information including compilation are given above (see <emphasis remap='B'>COMPILATION AND GENERAL INFORMATION</emphasis> above).  Below sections give specific Kerberos 4 and 5 information.</para>
-
-<refsect2><title>KERBEROS v4</title>
-Please note that support for Kerberos 4 will be removed in the next release.
-
-Kerberos 4 uses UDP protocol and the number of DLEs is limited by UDP packet size.
-
-The kerberized AMANDA service uses a different port on the client hosts. The /etc/services line is:
-
-    kamanda      10081/udp
-
-<para>And the /etc/inetd.conf line is:
+</refsect2>
 
-<programlisting>
-    kamanda dgram udp wait root /usr/local/libexec/amanda/amandad amandad -auth=krb4
-</programlisting>
-</para>
+</refsect1>
 
-<para>Note that you're running this as root, rather than as your dump user. AMANDA will set its uid down to the dump user at times it doesn't need to read the srvtab file, and give up root permissions entirely before it goes off and runs dump. Alternately you can change your srvtab files to be readable by user amanda.</para>
+<refsect1><title>KERBEROS COMMUNICATION AND AUTHENTICATION</title>
+For more detail, see http://wiki.zmanda.com/index.php/Kerberos_authentication.
 
-<para>The following dumptype options apply to krb4:
+<para>Amanda supports Kerberos 5 communication methods between Amanda server and client.</para>
 
-<programlisting>
-auth "krb4"    # use krb4 auth for this host
-               # (you can mingle krb hosts and bsd .rhosts in one conf)
-kencrypt       # encrypt this filesystem over the net using the krb4
-               # session key.  About 2x slower.  Good for those root
-               # partitions containing your keyfiles.  Don't want to
-               # give away the keys to an ethernet sniffer!
-               # This is currently always enabled.  There is no
-               # way to disable it.  This is a bug.
-</programlisting>
-</para>
-</refsect2>
+<para>General information including compilation are given above (see <emphasis remap='B'>COMPILATION AND GENERAL INFORMATION</emphasis> above).</para>
 
-<refsect2><title>KERBEROS v5</title>
 <para>Kerberos 5 uses TCP and the server uses only one TCP port and data streams are multiplexed to this port.</para>
 
 The <emphasis remap='B'>krb5</emphasis> driver script defaults to:
 
+<programlisting>
 /*
  * The lifetime of our tickets in minutes.
  */
@@ -351,12 +358,15 @@ The <emphasis remap='B'>krb5</emphasis> driver script defaults to:
  * The name of the service in /etc/services.
  */
 #define AMANDA_KRB5_SERVICE_NAME        "k5amanda"
+</programlisting>
 
 You can currently only override these by editing the source code.
 
 The kerberized AMANDA service uses a different port on the client hosts. The /etc/services line is:
 
+<programlisting>
    k5amanda      10082/tcp
+</programlisting>
 
 <para>And the /etc/inetd.conf line is:
 
@@ -424,12 +434,25 @@ The kerberized AMANDA service uses a different port on the client hosts. The /et
 <para>Rather than using a .k5amandahosts or .k5login file, the easiest way is to use a principal named after the destination user, (such as amanda@TEST.COM in our example) and not have either a .k5amandahosts or .k5login file in the destination user's home directory.</para>
 
 <para>There is no attempt to verify the realm in this case (only a concern if you have cross-realm authentication setup).</para>
+
+<refsect2><title>Authenticated Peer Hostnames with Kerberos Authentication</title>
+
+<para>When accepting a new incoming connection, the Kerberos authentication
+mechanism performs a similar check to that done by the BSD authentications:
+the forward and reverse DNS entries for the remote host must match.  As
+such, while Kerberos authentication can cryptographically ensure that the
+remote system is recognized (since it has a ticket), its assurances about
+the remote host's identity are weaker and depend on the integrity of the
+DNS.</para>
+
 </refsect2>
+
 </refsect1>
 
 <refsect1><title>LOCAL COMMUNICATION</title>
 <para>The Amanda server communicates with the client internally versus over the network, ie. the client is also the server.</para>
 <para>This is the only method that requires no authentication as it is clearly not needed.</para>
+<para>The authenticated peer hostname for this authentication is always "localhost".</para>
 </refsect1>
 
 <refsect1><title>RSH COMMUNICATION AND AUTHENTICATION</title>
@@ -443,19 +466,26 @@ For more detail, see http://wiki.zmanda.com/index.php/Configuring_rsh_authentica
 
 <para>General information including compilation is given above (see <emphasis remap='B'>COMPILATION AND GENERAL INFORMATION</emphasis> above).</para>
 
-<para>In addition to specifying the <emphasis remap='I'>auth</emphasis> field in dumptype definition, it might be required to specify <emphasis remap='I'>client_username</emphasis> and &amandad; fields. If the backup user name is different on the Amanda client, the user name is specified as <emphasis remap='B'>client_username</emphasis>. If the location of the Amanda daemon &amandad; is different on the Amanda client, the location is specified as <emphasis remap='I'>amandad_path</emphasis> field value.
+<para>In addition to specifying the <emphasis remap='I'>auth</emphasis> field in dumptype definition, it might be required to specify <emphasis remap='I'>client-username</emphasis> and &amandad; fields. If the backup user name is different on the Amanda client, the user name is specified as <emphasis remap='B'>client-username</emphasis>. If the location of the Amanda daemon &amandad; is different on the Amanda client, the location is specified as <emphasis remap='I'>amandad-path</emphasis> field value.
 
 <programlisting>
 For example:
 define dumptype rsh_example {
          ...
          auth "rsh"
-         client_username "amandabackup"
-         amandad_path "/usr/lib/exec/amandad"
+         client-username "amandabackup"
+         amandad-path "/usr/lib/exec/amandad"
          ...
 }
 </programlisting>
 </para>
+
+<refsect2><title>Authenticated Peer Hostnames with RSH Authentication</title>
+
+<para>The RSH authentication mechanism does not provide an authenticated peer hostname.</para>
+
+</refsect2>
+
 </refsect1>
 
 <refsect1><title>SSH COMMUNICATION AND AUTHENTICATION</title>
@@ -473,18 +503,18 @@ To use SSH, you need to set up SSH keys either by storing the passphrase in clea
 
 When you use a public key on the client to do data encryption (see http://wiki.zmanda.com/index.php/How_To:Set_up_data_encryption), you can lock away the private key in a secure place. Both, transport and storage will be encrypted with such a setup. See http://wiki.zmanda.com/index.php/Encryption for an overview of encryption options.
 
-Enable SSH authentication and set the ssh_keys option in all DLEs for that host by adding the following to the DLE itself or to the corresponding dumptype in amanda.conf:
+Enable SSH authentication and set the <amkeyword>ssh-keys</amkeyword> option in all DLEs for that host by adding the following to the DLE itself or to the corresponding dumptype in amanda.conf:
 
   auth "ssh"
-  ssh_keys "/home/amandabackup/.ssh/id_rsa_amdump"
+  ssh-keys "/home/amandabackup/.ssh/id_rsa_amdump"
 
-<emphasis remap='I'>ssh_keys</emphasis> is the path to the private key on the client. If the username to which Amanda should connect is different from the default, then you should also add
+<amkeyword>ssh-keys</amkeyword> is the path to the private key on the client. If the username to which Amanda should connect is different from the default, then you should also add
 
-  client_username "otherusername"
+  client-username "otherusername"
 
 If your server &amandad; path and client &amandad; path are different, you should also add
 
-  amandad_path "/client/amandad/path"
+  amandad-path "/client/amandad/path"
 
 <para>For a marginal increase in security, prepend the keys used for AMANDA in the clients' authorized_keys file with the following:
 
@@ -504,13 +534,13 @@ If your server &amandad; path and client &amandad; path are different, you shoul
 
 <para>You can omit the from=.. option if you have too many clients to list, although this has obvious security implications.</para>
 
-<para>Set ssh_keys and any other necessary options in /etc/amanda/amanda_client.conf:
+<para>Set <amkeyword>ssh-keys</amkeyword> and any other necessary options in /etc/amanda/amanda_client.conf:
 
 <programlisting>
   auth "ssh"
-  ssh_keys "/root/.ssh/id_rsa_amrecover"
-  client_username "amanda"
-  amandad_path "/server/amandad/path"
+  ssh-keys "/root/.ssh/id_rsa_amrecover"
+  client-username "amanda"
+  amandad-path "/server/amandad/path"
 </programlisting>
 </para>
 
@@ -525,6 +555,21 @@ If your server &amandad; path and client &amandad; path are different, you shoul
 </para>
 
 <para>As Amanda will not answer this question itself, you must manually make every connection (server to client and client to server) that you expect Amanda to make. Note that you must use the same username that Amanda will use (that is, ssh client and ssh client.domain.com are distinct).</para>
+
+<refsect2><title>Authenticated Peer Hostnames with SSH Authentication</title>
+
+<para>When accepting an incoming conneciton, the SSH daemon gives Amanda
+information about the remote system in the $SSH_CONNECTION environment
+variable.  Amanda parses this information to determine the remote
+address, and then performs a similar check to that done by the BSD
+authentications: the forward and reverse DNS entries for the remote
+host must match.  As such, while SSH authentication can
+cryptographically ensure that the remote system is recognized (since it
+had a recognized secret key), its assurances about the remote host's
+identity are weaker and depend on the integrity of the DNS.</para>
+
+</refsect2>
+
 </refsect1>
 
 <seealso>
index 9846a12066e2e942acc5ae0fcfbb6523f3202b37..4827e08113970ff7f3070e5834087867744135f7 100644 (file)
@@ -97,7 +97,7 @@ define changer hp-robot {
     tapedev "chg-robot:/dev/sg1"
     property "tape-device" "0=tape:/dev/nst0"
     property append "tape-device" "1=tape:/dev/nst1"
-    device_property "BLOCK_SIZE" "512k"
+    device-property "BLOCK_SIZE" "512k"
 }
 # ...
 tapedev "hp-robot"
@@ -111,7 +111,7 @@ changer definition, as in the <emphasis>hp-robot</emphasis> example, above.</par
 <para>Devices, too, can take properties to control their behavior (see <manref
 name="amanda-devices" vol="7" />).  Device properties can come from four
 places: implicit device properties (from tapetype parameters), global device
-properties (from global <emphasis>device_property</emphasis> parameters),
+properties (from global <emphasis>device-property</emphasis> parameters),
 properties in device definitions, and properties in changer definitions.
 Properties are applied in this order, with later properties taking
 priority.</para>
@@ -183,6 +183,14 @@ all volumes for a configuration have different device names -- for example,
 if you have many standalone drive.  The <emphasis>changerfile</emphasis> must exist; it is used to save the state file.
 </para>
 
+<para>The child devices are specified using the same syntax as for the RAIT
+device (see <manref name="amanda-changers" vol="7"/>).  The range
+specification can be especially useful here:
+<programlisting>
+tpchanger "chg-multi:s3:mycompany-backups/tape-{001..100}"
+</programlisting>
+</para>
+
 <para>This changer is not fast-search capable.</para>
 
 <refsect3><title>Properties</title>
@@ -359,8 +367,10 @@ define changer robot {
 tpchanger "chg-rait:{vtape,robot}"
 </programlisting>
 
-<para>This changer script constructs RAIT devices out of the devices provided by several "sub-changers".  The sub-changers are specified using the same shell-like syntax as the RAIT device (see
-<manref name="amanda-devices" vol="7"/>).</para>
+<para>This changer script constructs RAIT devices out of the devices provided
+by several "sub-changers".  The sub-changers are specified using the same
+shell-like syntax as the RAIT device (see <manref name="amanda-devices"
+    vol="7"/>).</para>
 
 <para>Chg-rait does not require that all of the child changers have the same slot names: compound slot names are created by combining the slot names supplied by the child changers using the same shell-like syntax.  For example, if the child changers return slots "<computeroutput>top</computeroutput>", "<computeroutput>strange</computeroutput>", and "<computeroutput>3</computeroutput>", then the RAIT changer will return "<computeroutput>{top,strange,3}</computeroutput>".  This makes it possible to, for example, mirror data on tapes in slots 1-10 to tapes in slots 11-20 of the same robot, using two <command>chg-zd-mtx</command> child changers (and, naturally, two tape drives).  In this arrangement, the first slot would be named <computeroutput>{1,11}</computeroutput>.</para>
 
@@ -667,6 +677,10 @@ The password for the NDMP server.
 The username for the NDMP server.
 </listitem></varlistentry>
 <!-- ==== -->
+<varlistentry><term>VERBOSE</term><listitem>
+If true, enables the NDMJOB library's verbose (packet-level) debugging.
+</listitem></varlistentry>
+<!-- ==== -->
 </variablelist>
 
 </refsect3>
index 7942d70acdddcdd90343eadb475b37293e588244..40e53cb8b697e08f540809909d163b02c762fcce 100644 (file)
@@ -53,7 +53,7 @@ The conf use by amrecover.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>client_username</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>client-username</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>CLIENT_LOGIN</amdefault>.
@@ -64,7 +64,7 @@ specified in &amandahosts; on the server.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>client_port</amkeyword> [ <amtype>int</amtype> | <amtype>string</amtype> ]</term>
+  <term><amkeyword>client-port</amkeyword> [ <amtype>int</amtype> | <amtype>string</amtype> ]</term>
   <listitem>
 <para>Default:
 <amdefault>"amanda"</amdefault>.
@@ -73,7 +73,7 @@ Similar to the parameter of the same name in &amconf;, this specifies the port t
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>index_server</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>index-server</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>Set by configure</amdefault>.
@@ -82,7 +82,7 @@ The amindexd server amrecover will connect to.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>tape_server</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>tape-server</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>Set by configure</amdefault>.
@@ -124,7 +124,7 @@ authorization.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>ssh_keys</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>ssh-keys</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>No default</amdefault>.
@@ -133,7 +133,7 @@ The key file the ssh auth will use, it must be the private key. If this paramete
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>gnutar_list_dir</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>gnutar-list-dir</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default from configure 
 <amdefault>--with-gnutar-listdir=DIR</amdefault>.
@@ -158,7 +158,7 @@ The file where amanda keep the last date of each dumplevel.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>connect_tries</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>connect-tries</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>3</amdefault>.
@@ -167,7 +167,7 @@ How many times the server will try a connection.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>rep_tries</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>rep-tries</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>5</amdefault>.
@@ -176,7 +176,7 @@ How many times amandad will resend a REP packet if it doesn't get the ACK packet
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_days</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-days</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>3</amdefault>.
@@ -185,7 +185,7 @@ The number of days the debug files are kept.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_amandad</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-amandad</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <emphasis remap='I'>0</emphasis>.
@@ -194,7 +194,7 @@ Debug level of the amandad process</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_amidxtaped</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-amidxtaped</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -203,7 +203,7 @@ Debug level of the amidxtaped process</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_amindexd</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-amindexd</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -212,7 +212,7 @@ Debug level of the amindexd process</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_amrecover</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-amrecover</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -221,7 +221,7 @@ Debug level of the amrecover process</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_auth</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-auth</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -230,7 +230,7 @@ Debug level of the auth module</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_event</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-event</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -239,7 +239,7 @@ Debug level of the event module</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_holding</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-holding</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -248,7 +248,7 @@ Debug level of the holdingdisk module</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_protocol</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-protocol</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -257,7 +257,7 @@ Debug level of the protocol module</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_selfcheck</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-selfcheck</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -266,7 +266,7 @@ Debug level of the selfcheck process</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_sendsize</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-sendsize</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -275,7 +275,7 @@ Debug level of the sendsize process</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_sendbackup</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-sendbackup</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -404,13 +404,13 @@ A comment string describing this script.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>execute_where</amkeyword> [ <amkeyword>client</amkeyword> | <amkeyword>server</amkeyword> ]</term>
+  <term><amkeyword>execute-where</amkeyword> [ <amkeyword>client</amkeyword> | <amkeyword>server</amkeyword> ]</term>
   <listitem>
 <para>Default: <amkeyword>client</amkeyword>. Where the script must be executed, on the client or server. Only <amkeyword>client</amkeyword> is valid.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>execute_on</amkeyword> <amtype>execute_on</amtype>[,<amtype>execute_on</amtype>]*</term>
+  <term><amkeyword>execute-on</amkeyword> <amtype>execute_on</amtype>[,<amtype>execute_on</amtype>]*</term>
   <listitem>
 <para>No default. When the script must be executed, you can specify many of them:</para>
     <!-- .RS -->
index 27c40b8b1f8395d65310caebc96b500644c74bd5..482efc90d910251d9c5551e62169b9b98441070b 100644 (file)
@@ -64,6 +64,45 @@ changes described below for the relevant span of versions to determine what
 adjustments, if any, are required.  Also see the NEWS file shipped with
 each Amanda release for more detailed information.</para>
 
+<refsect2><title>Amanda 3.2</title>
+
+<para>The following configuration configration keywords are deprecated.  This is
+currently a warning, but will become an error soon.
+<itemizedlist>
+<listitem><para><amkeyword>amrecover-do-fsf</amkeyword> - amrecover always seeks to files when recovering</para></listitem>
+<listitem><para><amkeyword>amrecover-check-label</amkeyword> - amrecover always checks the volume label when recovering</para></listitem>
+<listitem>
+
+    <para>Dumptype parameters <amkeyword>tape-splitsize</amkeyword>,
+       <amkeyword>split-diskbuffer</amkeyword>, and
+       <amkeyword>fallback-splitsize</amkeyword> - see
+       <amkeyword>allow-split</amkeyword> and tapetype parameters
+       <amkeyword>part-size</amkeyword>,
+       <amkeyword>part-cache-type</amkeyword>,
+       <amkeyword>part-cache-dir</amkeyword>, and
+       <amkeyword>part-cache-max-size</amkeyword>.  See <manref
+           name="amanda.conf" vol="5" /> for more information on these new
+       parameters, noting particularly that all but the first are tapetype
+       parameters, not dumptype parameters.</para>
+
+    <para>To convert most cases to the new parameters, set
+       <amkeyword>part-size</amkeyword> to the old value of
+       <amkeyword>tape-splitsize</amkeyword> and
+       <amkeyword>part-cache-dir</amkeyword> to the old value of
+       <amkeyword>split-diskbuffer</amkeyword>, if present.  If
+       <amkeyword>split-diskbuffer</amkeyword> was set, then set
+       <amkeyword>part-cache-type</amkeyword> to <amkeyword>disk</amkeyword>,
+       otherwise <amkeyword>memory</amkeyword>.  Finally, if using memory
+       caching, set <amkeyword>part-cache-max-size</amkeyword> to the previous
+       value of <amkeyword>fallback-splitsize</amkeyword>.  Be sure to remove
+       all of the old keywords from your configuration.</para>
+
+</listitem>
+</itemizedlist>
+</para>
+
+</refsect2>
+
 <refsect2><title>Amanda 3.1</title>
 
 <para>Although it is a significant rewrite, there are no incompatible changes
@@ -77,7 +116,7 @@ much more intelligent <emphasis>chg-robot</emphasis>.  See <manref
 name="amanda-changers" vol="7" /> for more information.</para>
 
 <para>The following configuration configration keywords are deprecated.  This is
-currently a warning, but will become an error soon.
+currently a warning, but will become an error in a future version.
 <itemizedlist>
 <listitem><para><computeroutput>label_new_tapes</computeroutput> - use <computeroutput>autolabel</computeroutput></para></listitem>
 </itemizedlist>
index a333440cde2673a9e87604b57d6447503f5cc1f0..f1792bdc6922edc849a664066412c15c91d722b9 100644 (file)
@@ -57,7 +57,7 @@ below.</para>
 <programlisting>
 define device top_drive {
     tapedev "tape:/dev/nst0"
-    device_property "BLOCK_SIZE" "131072"
+    device-property "BLOCK_SIZE" "131072"
 }
 </programlisting>
 Such a device defininition creates a device "alias", in this case named
@@ -112,9 +112,9 @@ tape devices, they will not share property values.</para>
 <para>Properties are specified in <emphasis>amanda.conf</emphasis> with the
 <emphasis>device-property</emphasis> parameter.  The syntax looks like this:
 <programlisting>
-device_property "FROBNICATOR_PATH" "/var/frobd/state"
-device_property "BYTES_PER_FORTNIGHT" "128k"
-device_property "USE_QUBITS" "no"
+device-property "FROBNICATOR_PATH" "/var/frobd/state"
+device-property "BYTES_PER_FORTNIGHT" "128k"
+device-property "USE_QUBITS" "no"
 </programlisting></para>
 
 <para>Both the property name and the property value are always quoted.
@@ -134,7 +134,7 @@ property, below.</para>
 <para>The order in which device properties are set is as follows:
 <orderedlist>
 <listitem><para>Tapetype parameters (including length, blocksize, and readblocksize) are translated into device properties and set accordingly.</para></listitem>
-<listitem><para>Device properties from any device_property
+<listitem><para>Device properties from any device-property
     configuration parameters are set, in the order they appear in the
     configuration file.</para>
 </listitem>
@@ -178,14 +178,14 @@ for future expansion.  Not all devices implement all of these properties.</para>
  <!-- ==== -->
  <varlistentry><term>CONCURRENCY</term><listitem>
  (read-only) This property indicates the level of concurrent access that this device supports.
-</listitem></varlistentry>
- <!-- ==== -->
- <varlistentry><term>FREE_SPACE</term><listitem>
- (read-only) This property gives the amount of free space available on the current volume, if known.  This is often an estimate; for example, tape devices can only estimate the amount of tape left on a spool.
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>FULL_DELETION</term><listitem>
  (read-only) This property indicates whether the device supports erasing the entire volume.  Aside from S3 and VFS, most devices cannot support this feature.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>LEOM</term><listitem>
+(read-write) If this property is true, then the device can detect an EOM condition before actually running out of space, allowing Amanda to forgo caching parts while writing.  For some devices, it is necessary to override the conservative default value of this property.
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>MAX_BLOCK_SIZE</term><listitem>
@@ -209,7 +209,14 @@ for future expansion.  Not all devices implement all of these properties.</para>
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>STREAMING</term><listitem>
- (read-only) This property gives the streaming requirement for this device.  For example, tape drives often require a steady supply of data to avoid shoe-shining, while disk devices have no such requirement.
+(read-only) This property gives the streaming requirement for this device.  For
+example, tape drives often require a steady supply of data to avoid
+shoe-shining, while disk devices have no such requirement.  Streaming is
+accomplished by buffering <amkeyword>device-output-buffer-size</amkeyword> bytes of
+data.  The allowed values are "none" (no streaming buffer necessary),
+"required" (fill the buffer before starting to write), or "desired" (fill the
+buffer before starting to write, and if the buffer becomes empty, stop writing
+until it is completely full again).
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>VERBOSE</term><listitem>
@@ -251,6 +258,19 @@ size.</para></note>
 
 </refsect3>
 
+<refsect3><title>LEOM DETECTION</title>
+
+<para>Some Amanda devices can detect end-of-medium (running out of space on the
+device) before it occurs.  This early warning is referred to as logical EOM,
+and where it is supported Amanda can operate more efficiently, since the
+possibility for data loss is reduced.</para>
+
+<para>The boolean LEOM property indicates whether or not a particular device
+supports LEOM detection.  The sections below also describe the degree of
+support.</para>
+
+</refsect3>
+
 </refsect2>
 
 </refsect1>
@@ -280,7 +300,14 @@ alternatives are enclosed in braces and separated by commas.  Braces and commas
 can be escaped with a backslash.  Note that the backslash itself must be
 escaped in most contexts.  For example:
 <programlisting>
-tapedev "rait:{commandev:foo\\,bar,bracedev:foo\\}bar}"
+tapedev "rait:{file:/var/amanda/vtapes,tape:/dev/nst0}"
+tapedev "rait:{comma-dev:foo\\,bar,brace-dev:foo\\}bar}" # quoting
+</programlisting>
+If the braces contain a numeric range separated with two dots, that range will
+be filled in sequentially.  If the first number has a leading zero, then the results
+will be zero-padded to the maximum length.  For example:
+<programlisting>
+tapedev "rait:file:/var/amanda/vtapes/drive{01..04}"
 </programlisting>
 </para>
 
@@ -307,6 +334,8 @@ degraded mode).  And in any case, labels on all volumes must initially match
 (labeled or otherwise).  If you have lost one volume from a set, explicitly
 start the device in degraded mode as described above.</para>
 
+<para>This device can detect LEOM if and only if all of the child devices can detect LEOM.</para>
+
 <refsect3><title>Child Device Block Sizes</title>
 
 <para>The RAIT device driver requires that all of its child devices use the
@@ -326,8 +355,8 @@ of each child device accordingly.</para>
 <refsect2><title>S3 Device</title>
 <programlisting>
 tapedev "s3:foocorp-backups/DailySet1-"
-device_property "S3_ACCESS_KEY" "MYACCESSKEY"
-device_property "S3_SECRET_KEY" "MYSECRETKEY"
+device-property "S3_ACCESS_KEY" "MYACCESSKEY"
+device-property "S3_SECRET_KEY" "MYSECRETKEY"
 </programlisting>
 
 <para>The S3 device driver uploads data to the Amazon S3 "storage cloud".  Its
@@ -347,9 +376,8 @@ high HTTP overhead for each request, use of larger than normal block
 <para>
 Amanda automatically creates a bucket when writing, if the bucket doesn't
 already exist. At that time, it specifies where Amazon should store the data
-based on the S3_BUCKET_LOCATION property. Currently, there are two valid settings:
-"*" (any location, probably US) and "EU" (Europe). If this property is not set,
-Amazon's default value of "*" is used. The bucket location has both billing and
+based on the S3_BUCKET_LOCATION property. If this property is not set,
+Amazon's default value (equivalent to "*") is used. The bucket location has both billing and
 legal concerns, so you are encouraged to consult Amazon's documentation for details.
 </para>
 
@@ -370,6 +398,9 @@ produces a great deal of output, and may cause spurious failures by filling
 your debug log partition.  Its logging is generally only useful for developers
 chasing down a problem in communications with Amazon's servers.</para>
 
+<para>Since Amazon storage is unlimited, the device never encounteres EOM, so
+LEOM detection is trivially enabled for this device.</para>
+
 <refsect3><title>Device-Specific Properties</title>
 
 <para>In addition to the common properties, the S3 device supports the
@@ -380,8 +411,8 @@ device.  A typical S3 configuration will have an access key and secret key
 specified:
 
 <programlisting>
-device_property "S3_ACCESS_KEY" "27D3B8C6C4E7AA423C2B37C72A0D22C8"
-device_property "S3_SECRET_KEY" "agphc2Q7Zmxragphc2RmO2xragpzZGY7a2xqCgr"
+device-property "S3_ACCESS_KEY" "27D3B8C6C4E7AA423C2B37C72A0D22C8"
+device-property "S3_SECRET_KEY" "agphc2Q7Zmxragphc2RmO2xragpzZGY7a2xqCgr"
 </programlisting></para>
 
 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
@@ -405,9 +436,11 @@ writing long enough to bring the average below this value.
  <!-- ==== -->
  <varlistentry><term>S3_BUCKET_LOCATION</term><listitem>
  (read-write) Location constraint for buckets on Amazon S3.
-Currently, it can be set to "", for no constraint (i.e. store data in the US),
-or "EU" (i.e. store data in the EU).
-See Amazon's documentation for details and latest information
+As of this writing, it can be set to "*" (US Standard, i.e. lowest-latency
+choice of US East or West), "us-west-1" (US West, Northern California), "EU"
+(European Union), or "ap-southeast-1" (Asia Pacific).  See <ulink
+url="http://docs.amazonwebservices.com/AmazonS3/latest/index.html?LocationSelection.html"
+/> for the most up-to-date list.
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>SSL_CA_INFO</term><listitem>
@@ -421,6 +454,13 @@ The value is passed to curl_easy_setopt(3) as CURLOPT_CAINFO.
  <!-- ==== -->
  <varlistentry><term>S3_SECRET_KEY</term><listitem>
  (read-write) This property gives the Amazon S3 secret key used to access the service.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>S3_STORAGE_CLASS</term><listitem>
+(read-write) Storage class for new objects, currently one of "STANDARD" (the default)
+or "REDUCED_REDUNDANCY" (cheaper, but less redundant).  See
+<ulink url="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?DataDurability.html" />
+for the most up-to-date list.
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>S3_SSL</term><listitem>
@@ -453,6 +493,14 @@ available via the command-line utilities dd(1) and mt(1).</para>
 <para>The tape device name should specify a path to the operating system's
 device file.</para>
 
+<para>There is no simple way to determine whether a particular system
+(operating system and tape hardware) supports LEOM, so as a safe default
+the tape device has LEOM detection disabled.  However, on modern hardware
+and common operating systems (Linux, *BSD, and Solaris, at least), LEOM
+support is functional.  On these systems, enable LEOM by setting the LEOM
+property to "true" at the appropriate place in the Amanda
+configuration.</para>
+
 <refsect3><title>Device-Specific Properties</title>
 
 <para>Most of these properties are automatically detected, but can be
@@ -522,8 +570,8 @@ operations can be emulated with the MTREW and read data operations.</para>
 <refsect2><title>NDMP Device</title>
 <programlisting>
 tapedev "ndmp:my.filer.com:10000@st1"
-device_property "NDMP_USERNAME" "jimmy"
-device_property "NDMP_PASSWORD" "thelock"
+device-property "NDMP_USERNAME" "jimmy"
+device-property "NDMP_PASSWORD" "thelock"
 </programlisting>
 
 <para>This device enables Amanda to communicate with a tape service on an NDMP
@@ -531,6 +579,8 @@ server.  The device name specifies the hostname and optionally the TCP port of
 the NDMP server, followed by the name of the tape device on the server
 (<command>st1</command> in the example above).</para>
 
+<para>This device supports LEOM detection.</para>
+
 <refsect3><title>Device-Specific Properties</title>
 
 <para>The properties <command>NDMP_USERNAME</command> and
@@ -554,6 +604,10 @@ no authentication attempt at all).
 (read-write) Username for md5 or text authentications.
 </listitem></varlistentry>
  <!-- ==== -->
+<varlistentry><term>READ_BLOCK_SIZE</term><listitem>
+(read-write) This property specifies the block size that will be used for reads; this should be large enough to contain any block that may be read from the device and must be larger than BLOCK_SIZE. See BLOCK_SIZES, above.
+</listitem></varlistentry>
+ <!-- === -->
 </variablelist>
 
 </refsect3>
@@ -576,14 +630,37 @@ this directory, the name of which reflects the Amanda header in the tape file.
 Block boundaries are not maintained: the driver supports reads of arbitrary
 size, regardless of the blocksize used to write the data.</para>
 
+<para>This device supports LEOM detection.  LEOM will be indicated when the
+    MAX_VOLUME_USAGE is nearly met, or when the filesystem is nearly out of
+    space.  The latter circumstance is detected by monitoring the available
+    space on the filesystem, and this monitoring can be disabled with the
+    MONITOR_FREE_SPACE property.  Note that the device cannot detect other
+    circumstances that may cause a write to fail, such as a filesystem quota.
+    LEOM detection can be disabled by setting the LEOM property to
+    false.</para>
+
+<refsect3><title>Device-Specific Properties</title>
+
+<variablelist>
+ <varlistentry><term>MONITOR_FREE_SPACE</term><listitem>
+        (read-write) This property controls whether the device will monitor
+        the filesystem's free space to detect a full filesystem before an
+        error occurs, and defaults to true.  The monitoring operation works on
+        most filesystems, but if it causes problems, use this property to
+        disable it.
+</listitem></varlistentry>
+</variablelist>
+
+</refsect3>
+
 </refsect2>
 
 <refsect2><title>DVD-RW Device</title>
 <programlisting>
 tapedev "dvdrw:/var/cache/amanda/dvd-cache:/dev/scd0"
-device_property "DVDRW_MOUNT_POINT" "/media/dvd"
-device_property "DVDRW_KEEP_CACHE" "false"
-device_property "DVDRW_UNLABELLED_WHEN_UNMOUNTABLE" "true"
+device-property "DVDRW_MOUNT_POINT" "/media/dvd"
+device-property "DVDRW_KEEP_CACHE" "false"
+device-property "DVDRW_UNLABELLED_WHEN_UNMOUNTABLE" "true"
 </programlisting>
 
 <para>The DVD-RW device driver reads and writes optical media such as DVDs and
@@ -614,6 +691,8 @@ be mounted should be treated as an empty, unlabelled volume when attempting to
 read the volume label. It is necessary to set this property to "true" when
 labelling such media.</para>
 
+<para>This device does not support LEOM detection.</para>
+
 <refsect3><title>Device-Specific Properties</title>
 
 <para>The properties DVDRW_GROWISOFS_COMMAND, DVDRW_MOUNT_COMMAND and
@@ -621,7 +700,9 @@ DVDRW_UMOUNT_COMMAND specify alternative commands for writing, mounting and
 unmounting optical media. The default is to find the programs using the PATH
 environment variable.</para>
 
-<para>The DVDRW_MOUNT_POINT property is required. Other properties are optional.</para>
+<para>The CDRW device supports all of the properties of the VFS device, as well
+    as the properties given below.  The DVDRW_MOUNT_POINT property is required.
+    Other properties are optional.</para>
 
 <variablelist>
  <varlistentry><term>DVDRW_KEEP_CACHE</term><listitem>
diff --git a/man/xml-source/amanda-match.7.xml b/man/xml-source/amanda-match.7.xml
new file mode 100644 (file)
index 0000000..fe6ecce
--- /dev/null
@@ -0,0 +1,377 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+[
+  <!-- entities files to use -->
+  <!ENTITY % global_entities SYSTEM 'global.entities'>
+  %global_entities;
+]>
+
+<refentry id='amanda-match.7'>
+
+<refmeta>
+<refentrytitle>amanda-match</refentrytitle>
+<manvolnum>7</manvolnum>
+&rmi.source;
+&rmi.version;
+&rmi.manual.7;
+</refmeta>
+<refnamediv>
+<refname>amanda-match</refname>
+<refpurpose>Common Amanda Match Expression</refpurpose>
+</refnamediv>
+<refentryinfo>
+&author.dustin;
+</refentryinfo>
+<!-- body begins here -->
+
+<refsect1><title>DESCRIPTION</title>
+
+<para>Several Amanda commands allow the user to specify dumps using "match
+expressions".  This manual page describes the syntax of these
+expressions.</para>
+
+<para>In some places, only certain match expressions are allowed.  However,
+several commands take a dump specification ("dumpspec") consisting of a
+sequence of several expressions intended to match particular dumps in the
+catalog.  Other applications take a DLE specification which indicates a set
+of DLEs to be operated on.  These formats are described below.</para>
+
+</refsect1>
+
+<refsect1><title>HOST &amp; DISK EXPRESSIONS</title>
+
+<para>The hosts and disks match by word. Each word is a glob expression, and words
+are separated by the character '.' for host expressions and '/' for disk expressions. You
+can anchor the expression on the left with a '^' or on the right with a '$'. The matcher
+is case insensitive for hosts but case sensitive for disks. A match
+succeeds if all words in the expression match contiguous words in
+the host or disk.</para>
+
+<para>If the disk is a UNC ("\\windows\share") then all '\' are converted to
+'/' before the match.  Using '\' is complicated because of the extra
+quoting required by the shell and amanda. It's easier to use '/' because it
+requires less quoting ("//windows/share")</para>
+
+<para>The special characters follow.  Note that the shell interprets some of
+these characters, so when used on the command line, they must be escaped
+appropriately for the shell.</para>
+
+<variablelist remap='TP'>
+
+    <varlistentry>
+    <term>dot (.)</term> <!-- troff gets confused by a plain dot -->
+    <listitem><para>word separator for a host</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>/</term>
+    <listitem><para>word separator for a disk</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>\</term>
+    <listitem><para>word separator for a UNC disk</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>^</term>
+    <listitem><para>anchor at left of word</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>$</term>
+    <listitem><para>anchor at right of word</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>?</term>
+    <listitem><para>match exactly one character except the separator</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>*</term>
+    <listitem><para>match zero or more characters except the separator</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>**</term>
+    <listitem><para>match zero or more characters including the separator</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>[...]</term>
+    <listitem><para>match exactly one of the characters enclosed by the brackets.</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>[!...]</term>
+    <listitem><para>match exactly one character that is not enclosed by the brackets.</para></listitem>
+    </varlistentry>
+
+</variablelist>
+
+<refsect2><title>Examples</title>
+
+<variablelist remap='TP'>
+    <varlistentry>
+    <term>hosta</term>
+    <listitem><para>
+    Will match <filename>hosta</filename>, <filename>foo.hosta.org</filename>, and
+    <filename>hoSTA.dOMAIna.ORG</filename> but not <filename>hostb</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>host</term>
+    <listitem><para>
+    Will match <filename>host</filename> but not <filename>hosta</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>host?</term>
+    <listitem><para>
+    Will match <filename>hosta</filename> and <filename>hostb</filename>, but
+    not <filename>host</filename> or <filename>hostabc</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>ho*na</term>
+    <listitem><para>
+    Will match <filename>hoina</filename>
+    but not <filename>ho.aina.org</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>ho**na</term>
+    <listitem><para>
+    Will match <filename>hoina</filename>
+    and <filename>ho.aina.org</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>^hosta</term>
+    <listitem><para>
+    Will match <filename>hosta</filename>
+    but not <filename>foo.hosta.org</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>sda*</term>
+    <listitem><para>
+    Will match <filename>/dev/sda1</filename>
+    and <filename>/dev/sda12</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>/opt</term>
+    <listitem><para>
+    Will match the disk <filename>opt</filename>
+    but not the host <filename>opt</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>(note dots:) .opt.</term> <!-- nroff gets confused by dots -->
+    <listitem><para>
+    Will match the host <filename>opt</filename>
+    but not the disk <filename>opt</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>/</term>
+    <listitem><para>
+    Will match the disk <filename>/</filename>
+    but no other disk.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>/usr</term>
+    <listitem><para>
+    Will match the disks <filename>/usr</filename>
+    and <filename>/usr/local</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>/usr$</term>
+    <listitem><para>
+    Will match the disks <filename>/usr</filename>
+    but not <filename>/usr/local</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>share</term>
+    <listitem><para>
+    Will match the disks <filename>\\windows1\share</filename> and <filename>\\windows2\share</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>share*</term>
+    <listitem><para>
+    Will match the disks <filename>\\windows\share1</filename> and <filename>\\windows\share2</filename>.
+    </para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>//windows/share</term>
+    <listitem><para>
+    Will match the disk <filename>\\windows\share</filename>.
+    </para></listitem>
+    </varlistentry>
+
+</variablelist>
+
+</refsect2>
+
+</refsect1>
+
+<refsect1><title>DATESTAMP EXPRESSIONS</title>
+
+<para>A datestamp expression is either a prefix of the datestamp, or a range
+expression (separated by '-') matching several prefixes.  A leading ^ is
+removed, while arailing $ will force an exact match.</para>
+
+<refsect2><title>Examples</title>
+
+<variablelist remap="TP">
+
+    <varlistentry>
+    <term>20001212-14</term>
+    <listitem><para>match all dates beginning with 20001212, 20001213 or 20001214</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>20001212-4</term>
+    <listitem><para>same as previous</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>20001212-24</term>
+    <listitem><para>match all dates between 20001212 and 20001224</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>2000121</term>
+    <listitem><para>match all dates that start with 2000121 (20001210-20001219)</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>2</term>
+    <listitem><para>match all dates that start with 2 (20000101-29991231)</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>2000-10</term>
+    <listitem><para>match all dates between 20000101-20101231</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>200010$</term>
+    <listitem><para>match only 200010</para></listitem>
+    </varlistentry>
+
+</variablelist>
+
+</refsect2>
+
+</refsect1>
+
+<refsect1><title>LEVEL EXPRESSIONS</title>
+
+<para>Level expressions are either prefix matches e.g., "1", which matches "1",
+"10", and "123", absolute matches e.g., "3$" which only matches "3", or a
+range e.g., "3-5" which only matches levels 3, 4, and 5.</para>
+
+</refsect1>
+
+<refsect1><title>DUMP SPECIFICATIONS</title>
+
+<para>A dump specification is used to select one or more dumps from the
+catalog.  It consists of a sequence of match expressions in the order host,
+disk, datestamp, and level.  Note that some commands do not take a level
+argument, out of historical accident.  Note, too, that the datestamp
+expression matches the time that the dump was made on the Amanda client,
+rather than the date it was moved to tape.</para>
+
+<refsect2><title>Examples</title>
+
+<variablelist remap='TP'>
+    <varlistentry>
+    <term>amtool MyConfig ^vpdesktop$</term>
+    <listitem><para>all dumps of host "vpdesktop"</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>amtool MyConfig '*' /var/stage</term>
+    <listitem><para>All dumps of <filename>/var/stage</filename> on any host</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+    <term>amtool MyConfig www1 /var/www '*' www2 /var/www '*'</term>
+    <listitem><para>All dumps of /var/www on www1 and www2 (assuming amtool does not
+           require a level argument)</para></listitem>
+    </varlistentry>
+</variablelist>
+
+</refsect2>
+
+</refsect1>
+
+<refsect1><title>DLE SPECIFICATIONS</title>
+
+<para>A DLE specification is used to select one or more DLEs.  It consists of a
+    sequence of match expressions.  The first must be a host, and subsequent
+    expressions will be experimentally matched against both hosts and disks in
+    the &disklist;, preferring hosts.  This dynamic matching process can lead
+    to odd behavior in extreme cases (e.g., where a disk and a host have the
+    same name), but for most uses does exactly what is expected.</para>
+
+<refsect2><title>Examples</title>
+
+<variablelist remap='TP'>
+    <varlistentry>
+    <term>amtool MyConfig vpdesktop /home/anderson</term>
+    <listitem><para><filename>/home/anderson</filename> on host vpdesktop</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+       <term>amtool MyConfig '*' ^/etc '*' ^/var</term>
+       <listitem><para>All DLEs matching <filename>^/var</filename> or
+               <filename>^/etc</filename> on any host</para></listitem>
+    </varlistentry>
+
+    <varlistentry>
+       <term>amtool MyConfig web1 www web2 www</term>
+       <listitem><para>If no host matches "www", all DLEs matching
+       <filename>www</filename> on hosts web1 and web2.  If a host
+       matches "www", then all DLEs on hosts www, web1, and web2.
+       </para></listitem>
+    </varlistentry>
+</variablelist>
+
+</refsect2>
+
+</refsect1>
+
+<seealso>
+<manref name="amanda" vol="8"/>,
+<manref name="amfetchdump" vol="8"/>,
+<manref name="amrestore" vol="8"/>,
+<manref name="amadmin" vol="8"/>,
+<manref name="amvault" vol="8"/>
+<manref name="amflush" vol="8"/>
+<manref name="amdump" vol="8"/>
+</seealso>
+
+</refentry>
index 59745ef6c00148f1348644babef410b15a7e2c68..6e206971d7897f026f754bab8143671b42d7aead 100644 (file)
@@ -76,7 +76,7 @@ use.</para>
 available in the changer, then the algorithm begins a sequential scan of the
 changer, starting at the current slot.  It selects the first suitable volume it
 finds: a reusable volume (perhaps newly-labeled) or, if
-<emphasis>label_new_tapes</emphasis> is true, a blank volume.  Even across
+<amkeyword>autolabel</amkeyword> includes <amkeyword>empty</amkeyword>, a blank volume.  Even across
 multiple invocations (when <emphasis>runtapes &gt; 1</emphasis>), it will not
 return the same slot twice.</para>
 
index 1337822e33273c5e35134ff90afe509d530e046e..7162c175c1f38bc9a7df8235a772421e87e9695b 100644 (file)
@@ -205,6 +205,9 @@ configuration files for quick reference.</para>
 <manref name="amanda-devices" vol="7"/>,
 </listitem>
 <listitem>
+<manref name="amanda-match" vol="7"/>,
+</listitem>
+<listitem>
 <manref name="amanda-scripts" vol="7"/>,
 </listitem>
 <listitem>
@@ -214,7 +217,7 @@ configuration files for quick reference.</para>
 </refsect2>
 </refsect1>
 
-<refsect1><title>CONFIGURATION</title>
+<refsect1><title>CONFIGURATION FILES</title>
 <para>There are four user-editable files that control the behavior of Amanda.
 </para>
 <para>
@@ -251,371 +254,7 @@ populate and maintain these directories.</para>
 the current directory is used.  This feature is present for backward
 compatibility, but is not commonly used.</para>
 
-</refsect1>
-
-<refsect1><title>LOG FILES</title>
-<para>All log and database files generated by Amanda go in corresponding
-directories somewhere.
-The exact location is controlled by entries in
-<manref name="amanda.conf" vol="5"/>.
-A typical location would be under <filename>/var/adm/amanda</filename>.
-For the above example, the files might go in
-<filename>/var/adm/amanda/normal/</filename> and
-<filename>/var/adm/amanda/archive/</filename>.
-</para>
-
-<para>As log files are no longer needed (no longer contain relevant information),
-Amanda cycles them out in various ways, depending on the type of file.</para>
-
-<para>Detailed information about
-<command>amdump</command>
-runs are stored in dump logs -- files named
-<emphasis remap='B'>amdump.</emphasis><emphasis remap='I'>NN</emphasis>
-where
-<emphasis remap='I'>NN</emphasis>
-is a sequence number, with 1 being the most recent file.
-<emphasis remap='B'>Amdump</emphasis>
-rotates these files each run, keeping roughly the last
-<emphasis remap='B'>tapecycle</emphasis>
-(see below)
-worth of them.</para>
-
-<para>The file used by
-<emphasis remap='B'>amreport</emphasis>
-to generate the mail summary is the trace log.  This file constitutes the "catalog"
-describing the data on the tapes written in a run.  It is named
-<emphasis remap='B'>log.</emphasis><emphasis remap='I'>YYYYMMDDHHMMSS.NN</emphasis>
-where
-<emphasis remap='I'>YYYYMMDDHHMMSS</emphasis>
-is the datestamp of the start of the
-<command>amdump</command> or <command>amflush</command>
-run and
-<emphasis remap='I'>NN</emphasis>
-is a sequence number started at 0.
-At the end of each
-<command>amdump</command>
-run,
-log files for runs whose tapes have been reused are renamed
-into a subdirectory of the main log directory (see the
-<emphasis remap='B'>logdir</emphasis>
-parameter below)
-named
-<emphasis remap='B'>oldlog</emphasis>.
-It is up to the Amanda administrator to remove them from this
-directory when desired.</para>
-
-<para>Index (backup image catalogue) files older than the full dump
-matching the oldest backup image for a given client and disk
-are removed by
-<command>amdump</command>
-at the end of each run.</para>
-</refsect1>
-
-
-<refsect1><title>Using Samba</title>
-<para>For Samba access, Amanda needs a file on the Samba server (which may
-or may not also be the tape server) named
-<filename>/etc/amandapass</filename>
-with share names, (clear text) passwords and (optional) domain names,
-in that order, one per line, whitespace separated.
-By default, the user used to connect to the PC is the same for all
-PC's and is compiled into Amanda.
-It may be changed on a host by host basis
-by listing it first in the password field followed
-by a percent sign and then the password.
-For instance:</para>
-<programlisting>
-  //some-pc/home normalpw
-  //another-pc/disk otheruser%otherpw
-</programlisting>
-<para>With clear text passwords, this file should obviously be tightly protected.
-It only needs to be readable by the Amanda-user on the Samba server.  </para>
-</refsect1>
-
-<refsect1><title>HOST &amp; DISK EXPRESSION</title>
-<para>All host and disk arguments to programs are special expressions.
-The command applies to all DLEs that match the arguments.
-This section describes the matcher.</para>
-
-<para>The matcher matches by word, each word is a glob expression, words
-are separated by the separator '.' for host and '/' for disk. You
-can anchor the expression at left with a '^'. You can
-anchor the expression at right with a '$'. The matcher
-is case insensitive for host but is case sensitive for disk. A match
-succeeds if all words in your expression match contiguous words in 
-the host or disk.</para>
-
-<para>If the disk is a UNC ("\\windows\share") then all '\' are converted to '/' before the match.  Using '\' is complicated because of the extra quoting required by the shell and amanda. It's easier to use '/' because it require less quoting ("//windows/share")</para>
-
-<variablelist remap='TP'>
-
-    <varlistentry>
-    <term>dot (.)</term> <!-- troff gets confused by a plain dot -->
-    <listitem><para>word separator for a host</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>/</term>
-    <listitem><para>word separator for a disk</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>\</term>
-    <listitem><para>word separator for a UNC disk</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>^</term>
-    <listitem><para>anchor at left</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>$</term>
-    <listitem><para>anchor at right</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>?</term>
-    <listitem><para>match exactly one character except the separator</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>*</term>
-    <listitem><para>match zero or more characters except the separator</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>**</term>
-    <listitem><para>match zero or more characters including the separator</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>[...]</term>
-    <listitem><para>match a single character, namely any of the characters
-        enclosed  by the brackets.</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>[!...]</term>
-    <listitem><para>match a single character, namely any characters that is not
-         enclosed by the brackets.</para></listitem>
-    </varlistentry>
-
-</variablelist>
-
-<para>The shell interpret some of these characters, they must be escaped by a backslash '\' and/or the expression must be enclosed in simple or double quote.</para>
-
-<para>Some examples:</para>
-
-<variablelist remap='TP'>
-    <varlistentry>
-    <term>hosta</term>
-    <listitem><para>
-    Will match <filename>hosta</filename>, <filename>foo.hosta.org</filename>, and
-    <filename>hoSTA.dOMAIna.ORG</filename> but not <filename>hostb</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>host</term>
-    <listitem><para>
-    Will match <filename>host</filename> but not <filename>hosta</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>host?</term>
-    <listitem><para>
-    Will match <filename>hosta</filename> and <filename>hostb</filename>, but
-    not <filename>host</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>ho*na</term>
-    <listitem><para>
-    Will match <filename>hoina</filename>
-    but not <filename>ho.aina.org</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>ho**na</term>
-    <listitem><para>
-    Will match <filename>hoina</filename>
-    and <filename>ho.aina.org</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>^hosta</term>
-    <listitem><para>
-    Will match <filename>hosta</filename>
-    but not <filename>foo.hosta.org</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>sda*</term>
-    <listitem><para>
-    Will match <filename>/dev/sda1</filename>
-    and <filename>/dev/sda12</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>/opt</term>
-    <listitem><para>
-    Will match the disk <filename>opt</filename>
-    but not the host <filename>opt</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>(note dots:) .opt.</term> <!-- nroff gets confused by dots -->
-    <listitem><para>
-    Will match the host <filename>opt</filename>
-    but not the disk <filename>opt</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>/</term>
-    <listitem><para>
-    Will match the disk <filename>/</filename>
-    but no other disk.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>/usr</term>
-    <listitem><para>
-    Will match the disks <filename>/usr</filename>
-    and <filename>/usr/local</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>/usr$</term>
-    <listitem><para>
-    Will match the disks <filename>/usr</filename>
-    but not <filename>/usr/local</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>share</term>
-    <listitem><para>
-    Will match the disks <filename>\\windows1\share</filename> and <filename>\\windows2\share</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>share*</term>
-    <listitem><para>
-    Will match the disks <filename>\\windows\share1</filename> and <filename>\\windows\share2</filename>.
-    </para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>//windows/share</term>
-    <listitem><para>
-    Will match the disk <filename>\\windows\share</filename>.
-    </para></listitem>
-    </varlistentry>
-
-</variablelist>
-
-
-</refsect1>
-
-<refsect1><title>DATESTAMP EXPRESSION</title>
-<para>A
-<emphasis remap='I'>datestamp</emphasis>
-expression is a range expression where we only match the prefix.
-Leading ^ is removed. Trailing $ forces an exact match.</para>
-
-<variablelist remap="TP">
-
-    <varlistentry>
-    <term>20001212-14</term>
-    <listitem><para>match all dates beginning with 20001212, 20001213 or 20001214</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>20001212-4</term>
-    <listitem><para>same as previous</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>20001212-24</term>
-    <listitem><para>match all dates between 20001212 and 20001224</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>2000121</term>
-    <listitem><para>match all dates that start with 2000121 (20001210-20001219)</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>2</term>
-    <listitem><para>match all dates that start with 2 (20000101-29991231)</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>2000-10</term>
-    <listitem><para>match all dates between 20000101-20101231</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>200010$</term>
-    <listitem><para>match only 200010</para></listitem>
-    </varlistentry>
-
-</variablelist>
-
-</refsect1>
-
-<refsect1><title>DUMP SPECIFICATIONS</title> <para>A dump
-specification selects one or more dumps.  It has the form <emphasis
-remap="I">[host][:disk][@datestamp]</emphasis>, where each component
-is a pattern as described above.  If a component is missing, it
-is treated as a wildcard.  The characters ':', '@', and '\' may be
-escaped within any component by preceding them with a '\'.</para>
-
-<para>Some examples:</para>
-
-<variablelist remap='TP'>
-    <varlistentry>
-    <term>client17</term>
-    <listitem><para>all dumps of client17</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>@20080615</term>
-    <listitem><para>All dumps on with datestamps matching 20080615</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>webserver:/var/www</term>
-    <listitem><para>All dumps of /var/www on host webserver</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>webserver:/var/www@200806150317</term>
-    <listitem><para>The dump of webserver with datestamp 200806150317</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term>:/var/www</term>
-    <listitem><para>All dumps of /var/www on any host</para></listitem>
-    </varlistentry>
-</variablelist>
-
-
-</refsect1>
-
-<refsect1><title>CONFIGURATION OVERRIDE</title>
+<refsect2><title>Configuration Override</title>
 <para>Most commands allow the override of specific
 configuration options on the command line, using the <arg
 choice="plain">-o</arg> option.  This option has the form <arg
@@ -656,6 +295,8 @@ amdump -otapedev=/dev/nst1 -otpchanger=''
 </programlisting>
 </para>
 
+</refsect2>
+
 </refsect1>
 
 </refentry>
index fe19c50def205d4a77771bd1247661f4c72ce18e..179722e1c6c33fb7ba25695cc21ff92c0e3fdca2 100644 (file)
@@ -56,21 +56,18 @@ The remainder of the line is ignored.</para>
 and
 <amkeyword>MailTo</amkeyword>
 are treated the same.  Also, the characters
-'<amkeyword>-</amkeyword>'
-and
-'<amkeyword>_</amkeyword>'
+'<amkeyword>-</amkeyword>' and '<amkeyword>_</amkeyword>'
 are interchangeable in all predefined Amanda keywords:
 <amkeyword>device_property</amkeyword>
 and
 <amkeyword>device-property</amkeyword>
-have the same meaning.</para>
+have the same meaning.  This manpage uses the dashed versions, but the
+underscored versions will be accepted for backward compatibility</para>
 
 <para>Identifiers are names which are defined in the configuration itself, such
 as dumptypes or interfaces.  Identifiers are are case-insensitive, but
 sensitive to
-'<amkeyword>-</amkeyword>'
-vs.
-'<amkeyword>_</amkeyword>'.
+'<amkeyword>-</amkeyword>' vs.  '<amkeyword>_</amkeyword>'.
 Identifiers should be quoted in the configuration file, although For historical
 reasons, the quotes are optional.</para>
 
@@ -91,7 +88,7 @@ tapetype "EXABYTE"        # optional      insensitive     sensitive
 
 define dumptype "dt" {    # optional      insensitive     sensitive
   "dumptype-common"       # optional      insensitive     sensitive
-  strategy noincr         # prohibited    insensitive     insensitive
+  strategy noinc          # prohibited    insensitive     insensitive
 }
 </programlisting>
 </para>
@@ -395,9 +392,25 @@ days /
   <listitem>
 <para>Default:
 <amdefault>15 tapes</amdefault>.
-Typically tapes are used by Amanda in an ordered rotation. The <amkeyword>tapecycle</amkeyword> parameter 
-defines the size of that rotation. This parameter must be be larger than the number of tapes
-used in a dumpcycle.</para>
+
+Specifies the number of "active" volumes - volumes that Amanda will not
+overwrite.  While Amanda is always willing to write to a new volume, it refuses
+to overwrite a volume unless at least '<amkeyword>tapecycle</amkeyword> -1'
+volumes have been written since.</para>
+
+<para> It is considered good administrative practice to set the
+<amkeyword>tapecycle</amkeyword> parameter slightly lower than the actual
+number of tapes in use. This allows the administrator to more easily cope
+with damaged or misplaced tapes or schedule adjustments that call for
+slight adjustments in the rotation order.</para>
+
+<para>Note: Amanda is commonly misconfigured with <amkeyword>tapecycle</amkeyword>
+equal to the number of tapes per <amkeyword>dumpcycle</amkeyword>.  In this
+misconfiguration, amanda may erase a full dump before a new one is
+completed.  Recovery is then impossible. The
+<amkeyword>tapecycle</amkeyword> must be at least one tape larger than the
+number of tapes per dumpcycle.</para>
+
 <para>
 The number of tapes per dumpcycle is calculated by multiplying the number of
 &amdump; runs per dump cycle <amkeyword>runspercycle</amkeyword> (the
@@ -406,21 +419,6 @@ remap='B'>runtapes</emphasis> (the number of tapes used per run). Typically
 <amkeyword>tapecycle</amkeyword> is set to two or four times the tapes
 per dumpcycle.</para>
 
-<note>Amanda is commonly misconfigured with <amkeyword>tapecycle</amkeyword>
-equal to the number of tapes per <amkeyword>dumpcycle</amkeyword>.  In this
-misconfiguration, amanda may erase a full dump before a new one is completed,
-the recovery is then impossible. tapecycle must be at least one tape larger
-than the number of tapes per dumpcycle.
-</note>
-
-<para>While Amanda is always willing to use a new tape in its rotation, it refuses to reuse a tape until at
-least '<amkeyword>tapecycle</amkeyword> -1' number of other tapes have been used. 
-</para>
-<para>
-It is considered good administrative practice to set the <amkeyword>tapecycle</amkeyword> parameter 
-slightly lower than the actual number of tapes in rotation. This allows the administrator to more easily cope 
-with damaged or misplaced tapes or schedule adjustments that call for slight adjustments in the rotation order.
-</para>
   </listitem>
   </varlistentry>
 
@@ -437,22 +435,13 @@ can't read logfiles written when this option was enabled.
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>label_new_tapes</amkeyword>
+  <term><amkeyword>label-new-tapes</amkeyword>
         <amtype>string</amtype></term>
 <listitem>
-    <para>Deprecated, use <amkeyword>autolabel</amkeyword> option.</para>
+    <para>Deprecated, use <amkeyword>autolabel</amkeyword> option with options <amkeyword>volume-error empty</amkeyword> to get equivalent behavior.</para>
     <para>Default: not set.
 When set, this directive will cause Amanda to automatically write an Amanda
-tape label to any blank tape she encounters. This option is DANGEROUS 
-because when set, Amanda will ERASE any non-Amanda tapes you may have, and may 
-also ERASE any near-failing tapes. Use with caution.</para>
-<para>When using this directive, specify the template for new tape 
-labels. The template should contain some number of contiguous '%' 
-characters, which will be replaced with a generated number. Be sure to 
-specify enough '%' characters that you do not run out of tape labels. 
-Example: 
-<markup>label_new_tapes "DailySet1-%%%"</markup>
-</para>
+tape label to any blank tape she encounters.</para>
 </listitem>
 </varlistentry>
 
@@ -460,9 +449,9 @@ Example:
   <term><amkeyword>autolabel</amkeyword>
         <amtype>string</amtype>
         [<amkeyword>any</amkeyword>]
-        [<amkeyword>other_config</amkeyword>]
-        [<amkeyword>non_amanda</amkeyword>]
-        [<amkeyword>volume_error</amkeyword>]
+        [<amkeyword>other-config</amkeyword>]
+        [<amkeyword>non-amanda</amkeyword>]
+        [<amkeyword>volume-error</amkeyword>]
         [<amkeyword>empty</amkeyword>]</term>
 <listitem>
     <para>Default: not set.
@@ -477,28 +466,31 @@ specify enough '%' characters that you do not run out of tape labels.
 Example:
 <markup>autolabel &quot;DailySet1-%%%&quot; empty</markup>
 </para>
+<para>Note that many devices cannot distinguish an empty tape from an error
+condition, so it may is often necessary to include
+<amkeyword>volume-error</amkeyword> as an autolabel condition.</para>
 <variablelist remap='TP'>
 <varlistentry>
 <term><amkeyword>any</amkeyword></term>
-<listitem>equivalent to '<amkeyword>other_config non_amanda volume_error empty</amkeyword>'
+<listitem>equivalent to '<amkeyword>other-config non-amanda volume-error empty</amkeyword>'
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><amkeyword>other_config</amkeyword></term>
+<term><amkeyword>other-config</amkeyword></term>
 <listitem>Label volumes with a valid Amanda label that do not match our
 <amkeyword>labelstr</amkeyword>. Danger: this may erase volumes
 from other Amanda configurations without warning!
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><amkeyword>non_amanda</amkeyword></term>
+<term><amkeyword>non-amanda</amkeyword></term>
 <listitem>Label volumes which do not start with data that resembles an
 Amanda header. Danger: this may erase volumes from other backup applications
 without warning!
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><amkeyword>volume_error</amkeyword></term>
+<term><amkeyword>volume-error</amkeyword></term>
 <listitem>Label volumes where an error occurs while trying to read the label.
 Danger: this may erase arbitrary volumes due to transient errors.
 </listitem>
@@ -542,30 +534,14 @@ option.</para>
   <listitem>
 <para>Default:
 <amdefault>&quot;null:&quot;</amdefault>.
-The device name, referencing the name of a &quot;device&quot; section in the configuration file.  See
-<manref name="amanda-devices" vol="7"/>
-for more information on device names.</para>
+This parameter can either specify a device (explicitly or by referencing a device definition - see <manref name="amanda-devices" vol="7" />)
+or a tape changer (explicitly or by referencing a device definition - see <manref name="amanda-changers" vol="7" />).</para>
 
-<para>If a tape changer is configured
-(see the
-<amkeyword>tpchanger</amkeyword>
-option), this option might not be used.</para>
-
-<para>If <amkeyword>tapedev</amkeyword> is
-<emphasis remap='B'>null:</emphasis>,
-programs such as
-&amdump;
-will run normally but all images will be thrown away.
-This should only be used for debugging and testing,
-and probably only with the
-<amkeyword>record</amkeyword>
-option set to
-<amdefault>no</amdefault>.</para>
   </listitem>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>device_property</amkeyword> <amtype>string</amtype> <amtype>string</amtype></term>
+  <term><amkeyword>device-property</amkeyword> <amtype>string</amtype> <amtype>string</amtype></term>
   <listitem>
 <para>These options can set various device properties.  See
 <manref name="amanda-devices" vol="7"/>
@@ -574,7 +550,7 @@ Both strings are always quoted; the first string contains the name of
 the property to set, and the second contains its value. For example, to set
 a fixed block size of 128k, write:</para>
 <programlisting>
-device_property "BLOCK_SIZE" "128k"
+device-property "BLOCK_SIZE" "128k"
 </programlisting>
 
   </listitem>
@@ -595,13 +571,12 @@ the property to set, and the others contains its values.
   <varlistentry>
   <term><amkeyword>tpchanger</amkeyword> <amtype>string</amtype></term>
   <listitem>
-<para>Default: not set.
-The name of the tape changer.
-If a tape changer is not configured, this option is not used
-and should be commented out of the configuration file.</para>
-<para>If a tape changer is configured, choose one of the changer scripts
-(e.g.  <emphasis remap='B'>chg-scsi</emphasis>)
-and enter that here.</para>
+<para>Default: not set.  The tape changer to use.  In most cases, only one of
+<amkeyword>tpchanger</amkeyword> or <amkeyword>tapedev</amkeyword> is
+specified, although for backward compatibility both may be specified if
+<amkeyword>tpchanger</amkeyword> gives the name of an old changer script.
+See <manref name="amanda-changers" vol="7" /> for more information on
+configuring changers.</para>
   </listitem>
   </varlistentry>
 
@@ -620,7 +595,7 @@ option.</para>
   <term><amkeyword>changerfile</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default:
-<amdefault>&quot;usr/adm/amanda/log/changer-status&quot;</amdefault>.
+<amdefault>&quot;/usr/adm/amanda/log/changer-status&quot;</amdefault>.
 A tape changer configuration parameter.
 Usage depends on the particular changer defined with the
 <amkeyword>tpchanger</amkeyword>
@@ -639,9 +614,6 @@ and should be commented out of the configuration file.</para>
 let Amanda write to more than one tape.</para>
 <para>Note that this is an upper bound on the number of tapes,
 and Amanda may use less.</para>
-<para>Also note that as of this release, Amanda does not support true tape overflow.
-When it reaches the end of one tape,
-the backup image Amanda was processing starts over again on the next tape.</para>
   </listitem>
   </varlistentry>
 
@@ -649,7 +621,7 @@ the backup image Amanda was processing starts over again on the next tape.</para
   <term><amkeyword>maxdumpsize</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
-<amdefault><amkeyword>runtapes</amkeyword>*<amkeyword>tape_length</amkeyword></amdefault>.
+<amdefault><amkeyword>runtapes</amkeyword>*<amkeyword>tape-length</amkeyword></amdefault>.
 Maximum number of bytes the planner will schedule for a run.</para>
 <para>The default unit is Kbytes if it is not specified.</para>
   </listitem>
@@ -703,6 +675,14 @@ The algorithm used to choose which dump image to send to the taper.</para>
   </listitem>
   </varlistentry>
 <varlistentry>
+<term><amkeyword>taper-parallel-write</amkeyword> <amtype>int</amtype></term>
+<listitem>
+  </listitem>
+<para>Default: <amdefault>1</amdefault>.
+Amanda can write simultaneously up to that number of volume at any given
+time. The changer must have as many drives.</para>
+  </varlistentry>
+<varlistentry>
 <term><amkeyword>labelstr</amkeyword> <amtype>string</amtype></term>
 <listitem>
 <para>Default:
@@ -778,7 +758,7 @@ per client instead of per disk.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>connect_tries</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>connect-tries</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>3</amdefault>.
@@ -787,7 +767,7 @@ How many times the server will try a connection.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>req_tries</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>req-tries</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>3</amdefault>.
@@ -1023,7 +1003,7 @@ Amanda maintains this file with information about the active set of tapes.</para
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>device_output_buffer_size</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>device-output-buffer-size</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>1280k</amdefault>.
@@ -1040,7 +1020,7 @@ useful on fast tape drives and optical media.</para>
 <para>Default:
 <amdefault>20</amdefault>.
 This option is deprecated; use
-the <amkeyword>device_output_buffer_size</amkeyword> directive
+the <amkeyword>device-output-buffer-size</amkeyword> directive
 instead. <amkeyword>tapebufs</amkeyword> works the same way,
 but the number specified is multiplied by the device blocksize prior
 to use.</para>
@@ -1068,27 +1048,29 @@ Whether an amdump run will flush the dumps from holding disk to tape.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>amrecover_do_fsf</amkeyword> <amtype>bool</amtype></term>
+  <term><amkeyword>amrecover-do-fsf</amkeyword> <amtype>bool</amtype></term>
   <listitem>
+<para>Deprecated; amrecover always uses fsf, and does not invoke amrestore.</para>
 <para>Default:
 <amkeyword>on</amkeyword>.
 Amrecover will call amrestore with the -f flag for faster positioning of the tape.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>amrecover_check_label</amkeyword> <amtype>bool</amtype></term>
+  <term><amkeyword>amrecover-check-label</amkeyword> <amtype>bool</amtype></term>
   <listitem>
+<para>Deprecated; amrecover always checks the label, and does not invoke amrestore.</para>
 <para>Default:
 <amkeyword>on</amkeyword>.
 Amrecover will call amrestore with the -l flag to check the label.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>amrecover_changer</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>amrecover-changer</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default: not set.
 Amrecover will use the changer if you use 'settape &lt;string&gt;' and that string
-is the same as the amrecover_changer setting.</para>
+is the same as the <amkeyword>amrecover-changer</amkeyword> setting.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
@@ -1159,7 +1141,7 @@ Relative pathnames are relative to the configuration directory.
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_days</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-days</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>3</amdefault>.
@@ -1168,7 +1150,7 @@ The number of days the debug files are kept.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_auth</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-auth</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -1177,7 +1159,7 @@ Debug level of the auth module</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_event</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-event</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -1186,7 +1168,7 @@ Debug level of the event module</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_holding</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-holding</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -1195,7 +1177,7 @@ Debug level of the holdingdisk module</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_protocol</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-protocol</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -1204,7 +1186,7 @@ Debug level of the protocol module</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_planner</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-planner</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -1213,7 +1195,7 @@ Debug level of the planner process</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_driver</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-driver</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -1222,7 +1204,7 @@ Debug level of the driver process</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_dumper</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-dumper</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -1231,7 +1213,7 @@ Debug level of the dumper process</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_chunker</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-chunker</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -1240,7 +1222,7 @@ Debug level of the chunker process</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>debug_taper</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>debug-taper</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>0</amdefault>.
@@ -1357,6 +1339,36 @@ Range is inclusive.</para>
   </listitem>
   </varlistentry>
 
+  <varlistentry>
+  <term><amkeyword>recovery-limit</amkeyword> [ <amtype>string</amtype> | <amkeyword>same-host</amkeyword> ]</term>
+  <listitem>
+<para>Default: none (no limitations).  This parameter limits the hosts
+    that may do remote recoveries.  Hosts are identified by their authenticated
+    peer name, as described in <manref name="amanda-auth" vol="7"/>; if this is
+    not available and the recovery-limit parameter is present, recovery will be
+    denied.  The arguments to the parameter are strings giving host match
+    expressions (see <manref name="amanda-match" vol="7"/>) or the special
+    keyword same-host, which requires an exact match to the hostname of the
+    DLE being recovered.  Specifying no arguments at all will disable all
+    recoveries from any host.</para>
+
+<para>Note that match expressions can be constructed to be
+    forgiving of e.g., fully-qualified vs. unqualified hostnames, but
+    <amkeyword>same-host</amkeyword> requires an exact match.</para>
+
+<para>The error messages that appear in amrecover are intentionally vague to
+    avoid information leakage.  Consult the amindexd debug log for more details
+    on the reasons a recovery was rejected.</para>
+
+<para>Recovery limits can be refined on a per-DLE basis using the dumptype
+    parameter of the same name.  Note that the default value will apply to any
+    dumpfiles for disks which no longer appear in the disklist; thus leaving the
+    global parameter at its default value but setting it for all DLEs is not
+    sufficient to maintain secure backups.</para>
+
+  </listitem>
+  </varlistentry>
+
 </variablelist>
 </refsect1>
 
@@ -1490,7 +1502,7 @@ Type of authorization to perform between tape server and backup client hosts.  S
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>amandad_path</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>amandad-path</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>&quot;$libexec/amandad&quot;</amdefault>.
@@ -1500,7 +1512,7 @@ Specify the amandad path of the client, only use with rsh/ssh authentification.
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>client_username</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>client-username</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default:
 <amdefault>CLIENT_LOGIN</amdefault>.
@@ -1510,7 +1522,7 @@ Specify the username to connect on the client, only use with rsh/ssh authentific
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>client_port</amkeyword> [ <amtype>int</amtype> | <amtype>string</amtype> ]</term>
+  <term><amkeyword>client-port</amkeyword> [ <amtype>int</amtype> | <amtype>string</amtype> ]</term>
   <listitem>
 <para>Default:
 <amdefault>&quot;amanda&quot;</amdefault>.
@@ -1653,7 +1665,7 @@ to use your own compression method. (See dumptype custom-compress in example/ama
   <varlistentry>
     <term>compress client custom</term>
     <listitem>
-      <para>Specify <emphasis>client_custom_compress</emphasis> &quot;PROG&quot;</para>
+      <para>Specify <amkeyword>client-custom-compress</amkeyword> &quot;PROG&quot;</para>
       <para>PROG must not contain white space and it must accept -d for uncompress.</para>
     </listitem>
   </varlistentry>
@@ -1666,7 +1678,7 @@ to use your own compression method. (See dumptype custom-compress in example/ama
   <varlistentry>
     <term>compress server custom</term>
     <listitem>
-      <para>Specify <amkeyword>server_custom_compress</amkeyword> &quot;PROG&quot;</para>
+      <para>Specify <amkeyword>server-custom-compress</amkeyword> &quot;PROG&quot;</para>
       <para>PROG must not contain white space and it must accept -d for uncompress.</para>
     </listitem>
   </varlistentry>
@@ -1678,7 +1690,7 @@ or <emphasis remap='B'>mt</emphasis> option), Amanda (software) compression shou
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>client_custom_compress</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>client-custom-compress</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default: none.
     The program to use to perform compression/decompression on the client; used with
@@ -1687,7 +1699,7 @@ or <emphasis remap='B'>mt</emphasis> option), Amanda (software) compression shou
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>server_custom_compress</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>server-custom-compress</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default: none.
     The program to use to perform compression/decompression on the server; used with
@@ -1722,9 +1734,9 @@ server host as it goes from the network into the holding disk or to tape.</para>
   <varlistentry>
     <term>encrypt client</term>
     <listitem>
-      <para>Specify client_encrypt &quot;PROG&quot;</para>
+      <para>Specify client-encrypt &quot;PROG&quot;</para>
       <para>PROG must not contain white space.</para>
-      <para>Specify client_decrypt_option &quot;decryption-parameter&quot; Default: &quot;-d&quot;</para>
+      <para>Specify client-decrypt-option &quot;decryption-parameter&quot; Default: &quot;-d&quot;</para>
       <para>decryption-parameter must not contain white space.</para>
       <para>(See dumptype client-encrypt-nocomp in example/amanda.conf for reference)</para>
     </listitem>
@@ -1732,9 +1744,9 @@ server host as it goes from the network into the holding disk or to tape.</para>
   <varlistentry>
     <term>encrypt server</term>
     <listitem>
-      <para>Specify server_encrypt &quot;PROG&quot;</para>
+      <para>Specify server-encrypt &quot;PROG&quot;</para>
       <para>PROG must not contain white space.</para>
-      <para>Specify server_decrypt_option &quot;decryption-parameter&quot; Default: &quot;-d&quot;</para>
+      <para>Specify server-decrypt-option &quot;decryption-parameter&quot; Default: &quot;-d&quot;</para>
       <para>decryption-parameter must not contain white space.</para>
       <para>(See dumptype server-encrypt-fast in example/amanda.conf for reference)</para>
     </listitem>
@@ -1750,7 +1762,7 @@ client-encryption AND server-compression is not supported.
 </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>client_encrypt</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>client-encrypt</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default: none.
 The program to use to perform encryption/decryption on the client; used with
@@ -1759,16 +1771,16 @@ The program to use to perform encryption/decryption on the client; used with
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>client_decrypt_option</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>client-decrypt-option</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default: -d.
-The option that can be passed to client_encrypt to make it decrypt instead.
+The option that can be passed to client-encrypt to make it decrypt instead.
 Must not contain whitespace.</para>
   </listitem>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>server_encrypt</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>server-encrypt</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default: none.
 The program to use to perform encryption/decryption on the server; used with
@@ -1777,10 +1789,10 @@ The program to use to perform encryption/decryption on the server; used with
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>server_decrypt_option</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>server-decrypt-option</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default: -d.
-The option that can be passed to server_encrypt to make it decrypt instead.
+The option that can be passed to server-encrypt to make it decrypt instead.
 Must not contain whitespace.</para>
   </listitem>
   </varlistentry>
@@ -2098,7 +2110,7 @@ level 1 incrementals in this configuration; this is probably a bug.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>ssh_keys</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>ssh-keys</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default: not set.
 The key file the ssh auth will use, it must be the private key. If this parameter is not specified, then the default ssh key will be used.</para>
@@ -2159,23 +2171,28 @@ The value should be hh*100+mm, e.g. 6:30PM (18:30) would be entered as
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>tape_splitsize</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>allow-split</amkeyword> <amtype>bool</amtype></term>
+  <listitem>
+<para>Default: true.
+If true, then dumps with this dumptype can be split on the storage media.  If false, then
+the dump will be written in a single file on the media.  See "Dump Splitting Configuration"
+below.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><amkeyword>tape-splitsize</amkeyword> <amtype>int</amtype></term>
   <listitem>
+      <para>Deprecated.  See "Dump Splitting Configuration" below.</para>
 <para>Default: not set.
 Split dump file on tape into pieces of a specified size.
-This allows dumps to be spread across multiple tapes, and can potentially
-make more efficient use of tape space.
-Note that if this value is too large (more than half the size of the
-average dump being split), substantial tape space can be wasted.
-If too small, large dumps will be split into innumerable tiny dumpfiles,
-adding to restoration complexity.
-A good rule of thumb, usually, is 1/10 of the size of your tape.</para>
-<para>The default unit is Kbytes if it is not specified.</para>
+The default unit is Kbytes if it is not specified.</para>
   </listitem>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>split_diskbuffer</amkeyword> <amtype>string</amtype></term>
+  <term><amkeyword>split-diskbuffer</amkeyword> <amtype>string</amtype></term>
+      <para>Deprecated.  See "Dump Splitting Configuration" below.</para>
   <listitem>
 <para>Default: not set.
 When dumping a split dump in PORT-WRITE mode (usually meaning "no holding disk"), buffer the split chunks to a file in the directory specified by this option.
@@ -2184,20 +2201,26 @@ When dumping a split dump in PORT-WRITE mode (usually meaning "no holding disk")
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>fallback_splitsize</amkeyword> <amtype>int</amtype></term>
+  <term><amkeyword>fallback-splitsize</amkeyword> <amtype>int</amtype></term>
   <listitem>
+      <para>Deprecated.  See "Dump Splitting Configuration" below.</para>
 <para>Default:
 <amdefault>10M</amdefault>.
-When dumping a split dump in PORT-WRITE mode, if no split_diskbuffer is
-specified (or if we somehow fail to use our split_diskbuffer), we must
-buffer split chunks in memory.
-This specifies the maximum size split chunks can be in this scenario,
+This specifies the part size used when no <amkeyword>split-diskbuffer</amkeyword> is specified, or when it is too small or does not exist,
 and thus the maximum amount of memory consumed for in-memory splitting.
-The size of this buffer can be changed from its (very conservative) default
-to a value reflecting the amount of memory that each taper process on
-the dump server may reasonably consume.
-</para>
-<para>The default unit is Kbytes if it is not specified.</para>
+The default unit is Kbytes if it is not specified.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+      <term><amkeyword>recovery-limit</amkeyword>
+           [ <amkeyword>same-host</amkeyword> | <amtype>string</amtype> ]*</term>
+  <listitem>
+
+<para>Default: global value.  This parameter overrides the global
+    <amkeyword>recovery-limit</amkeyword> parameter for DLEs of this
+    dumptype.</para>
+
   </listitem>
   </varlistentry>
 </variablelist>
@@ -2348,6 +2371,52 @@ tape devices.
   </listitem>
   </varlistentry>
   
+  <varlistentry>
+  <term><amkeyword>part-size</amkeyword> <amtype>int</amtype></term>
+  <listitem>
+<para>Default: none.  This is the size (in KB if no units are specified) of
+each split part written to the volume.  It is reduced to
+<amkeyword>part-cache-max-size</amkeyword> when part caching is required.
+If this is set to zero, then no splitting will take place; in this case,
+some devices can span dumps from volume to volume, while others will cause
+the entire dump to fail if they encounter end-of-medium before the dump is
+complete.  See "Dump Splitting Configuration" below.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><amkeyword>part-cache-type</amkeyword> [ <amkeyword>none</amkeyword> | <amkeyword>disk</amkeyword> | <amkeyword>memory</amkeyword> ] </term>
+  <listitem>
+<para>Default: none.  When part caching is required, this parameter specifies
+the type of caching that will be used.  The options include no caching
+(<amkeyword>none</amkeyword>), in which case a failed part will cause the
+entire dump to fail; on-disk caching (<amkeyword>disk</amkeyword>), for
+which <amkeyword>part-cache-dir</amkeyword> must be set properly; and
+in-memory caching (<amkeyword>memory</amkeyword>), which on most systems
+severely restrains the size of the part that can be written.  See "Dump
+Splitting Configuration" below.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><amkeyword>part-cache-dir</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>Default: none.
+The directory in which part-cache files can be written when caching on disk.
+See "Dump Splitting Configuration" below.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><amkeyword>part-cache-max-size</amkeyword> <amtype>int</amtype></term>
+  <listitem>
+<para>Default: none.
+The maximum part size to use when caching is in effect.  This is used to limit
+the part size when disk or memory space for caching is constrained.  This value
+must be greater than zero.</para>
+  </listitem>
+  </varlistentry>
+
   <varlistentry>
   <term><amkeyword>speed</amkeyword> <amtype>int</amtype></term>
   <listitem>
@@ -2374,7 +2443,7 @@ man page for more information.</para>
 
 <para>In addition to options, another
 <amkeyword>tapetype</amkeyword>
-name may be supplie as an identifier, which makes this
+name may be supplied as an identifier, which makes this
 <amkeyword>tapetype</amkeyword>
 inherit options from another
 <amkeyword>tapetype</amkeyword>.
@@ -2547,13 +2616,13 @@ A comment string describing this script.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>execute_where</amkeyword> [ <amkeyword>client</amkeyword> | <amkeyword>server</amkeyword> ]</term>
+  <term><amkeyword>execute-where</amkeyword> [ <amkeyword>client</amkeyword> | <amkeyword>server</amkeyword> ]</term>
   <listitem>
 <para>Default: <amkeyword>client</amkeyword>. Where the script must be executed, on the client or server.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>>execute_on</amkeyword> <amtype>execute_on</amtype> [,<amtype>execute_on</amtype>]*</term>
+  <term><amkeyword>execute-on</amkeyword> <amtype>execute_on</amtype> [,<amtype>execute_on</amtype>]*</term>
   <listitem>
 <para>No default. When the script must be executed, you can specify many of them:</para>
     <!-- .RS -->
@@ -2676,7 +2745,7 @@ script --post-recover
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>property</amkeyword>> [<amkeyword>append</amkeyword>] [<amkeyword>priority</amkeyword>] <amtype>string</amtype> <amtype>string</amtype>+</term>
+  <term><amkeyword>property</amkeyword> [<amkeyword>append</amkeyword>] [<amkeyword>priority</amkeyword>] <amtype>string</amtype> <amtype>string</amtype>+</term>
   <listitem>
 <para>No default. You can set property for the script, each script have a different set of property. Both strings are quoted; the first string contains the name of
 the property to set, and the others contains its values.
@@ -2697,7 +2766,7 @@ in the form of "device" sections, which look like this:</para>
 define device <emphasis remap='I'>name</emphasis> {
     commend "<emphasis remap='I'>comment (optional)</emphasis>"
     tapedev "<emphasis remap='I'>device-specifier</emphasis>"
-    device_property "<emphasis remap='I'>prop-name</emphasis>" "<emphasis remap='I'>prop-value</emphasis>"
+    device-property "<emphasis remap='I'>prop-name</emphasis>" "<emphasis remap='I'>prop-value</emphasis>"
     <literal>...</literal>
 }
 </programlisting>
@@ -2712,7 +2781,7 @@ As with most sections, the <emphasis remap='I'>comment</emphasis>
 parmeter is optional and only for the user's convenience.</para>
 
 <para>An arbitrary number of <emphasis
-remap='I'>device_property</emphasis> parameters can be specified.
+remap='I'>device-property</emphasis> parameters can be specified.
 Again, see
 <manref name="amanda-devices" vol="7"/>
 for information on device properties.</para>
@@ -2743,6 +2812,60 @@ device. The remaining parameters are specific to the changer type selected.
 
 </refsect1>
 
+<refsect1><title>Dump Splitting Configuration</title>
+
+    <para>Amanda can "split" dumps into parts while writing them to storage
+       media.  This allows Amanda to recover gracefully from a failure while
+       writing a part to a volume, by simply selecting a new volume and
+       re-writing the dump from the beginning of the failed part.  Parts also
+       allow Amanda to seek directly to the required data, although this
+       functionality is not yet used.</para>
+
+    <para>In order to support re-writing from the beginning of a failed part,
+       Amanda must have access to the contents of the part after it has been
+       partially written.  If the dump is being read from holding disk, then
+       the part contents are availble there.  Otherwise, the part must be
+       cached, and this can be done memory or on disk.  In either of the
+       latter cases, the cache must have enough space to hold an entire
+       part.</para>
+
+    <para>Because it is common for a single Amanda configuration to use both
+       holding-disk (FILE-WRITE) and direct (known as PORT-WRITE) dumps, Amanda
+       allows the configuration of different split sizes for the two cases.  This
+       allows, for example, for a part size appropriate to large tapes when
+       performing FILE-WRITE dumps, with a part size limited by available disk
+       or memory when performing PORT-WRITE dumps.</para>
+
+    <para>Selecting a proper split size is a delicate matter.  If the parts are
+       too large, substantial storage space may be wasted in failed parts.  If
+       too small, large dumps will be split into innumerable tiny dumpfiles,
+       adding to restoration complexity; furthermore, an excess of filemarks
+       will cause slower tape drive operation and reduce the usable space on
+       tape.  A good rule of thumb is 1/10 of the size of a volume of storage
+       media.</para>
+
+    <para>In versions of Amanda through 3.1.*, splitting was controlled by the
+       dumptype parameters <amkeyword>tape-splitsize</amkeyword>,
+       <amkeyword>split-diskbuffer</amkeyword>, and
+       <amkeyword>fallback-splitsize</amkeyword>.  These keywords had
+       confusing and non-intuitive interactions, and have since been
+       deprecated.</para>
+
+    <para>If the deprecated keywords are not present, subsequent versions
+       of Amanda use the dumptype parameter
+       <amkeyword>allow-split</amkeyword> to control whether a DLE can be
+       split, and the <emphasis>tapetype</emphasis> parameters
+       <amkeyword>part-size</amkeyword>,
+       <amkeyword>part-cache-type</amkeyword>,
+       <amkeyword>part-cache-dir</amkeyword>, and
+       <amkeyword>part-cache-max-size</amkeyword>.  The
+       <amkeyword>part-size</amkeyword> specifies the "normal" part size,
+       while the <amkeyword>part-cache-*</amkeyword> parameters describe
+       how to behave when caching is required (on PORT-WRITE).  Full
+       details on these parameters are given above.</para>
+
+</refsect1>
+
 <seealso>
 <manref name="amanda-client.conf" vol="5"/>,
 <manref name="amanda-applications" vol="7"/>,
index d224f933a9ac9df1732107d166b1d5feda37f594..9b641352d3c726be81acaa652c0cf8d2e1bbc9e1 100644 (file)
@@ -105,7 +105,7 @@ tape (which would otherwise cause the subsequent
 to fail).
 If the tape
 is writable, this check causes all data after the tape label to be
-erased. If the label_new_tapes option is enabled, this check may ERASE
+erased. If the <amkeyword>autolabel</amkeyword> option is enabled, this check may ERASE
 any non-Amanda tape in the drive or changer.
 The check enable the tape tests on the server host
 and is only made if the tape is otherwise correct.</para>
index 441def658e7f0c86867d797d67fb602a628c857f..9cbe5dc701b105fb64a3b5b8d49a3ff7d68ac7f8 100644 (file)
@@ -65,11 +65,6 @@ amcheckdump MYCONFIG
 amcheckdump MYCONFIG --timestamp 19780615
 </programlisting></para>
 </refsect1>
- <refsect1><title>SEE ALSO</title>
- <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <ulink url="http://wiki.zmanda.com"/>
- </para>
- </refsect1> 
 
 <seealso>
 <manref name="amcheck" vol="8" />
index dd8a8f503add4a6e4c8928ca9f39f3a0dc949755..166ec71925b662e529d826140e3a43b091158a56 100644 (file)
@@ -30,6 +30,7 @@
 <cmdsynopsis>
   <command>amdump</command>    
     <arg choice='plain'><replaceable>config</replaceable></arg>
+    <arg choice='opt'><option>--no-taper</option></arg>
     <arg choice='opt' rep='repeat'>
        <arg choice='plain'><replaceable>host</replaceable></arg>
        <arg choice='opt' rep='repeat'><replaceable>disk</replaceable></arg>
 
 <refsect1><title>DESCRIPTION</title>
 <para><emphasis remap='B'>Amdump</emphasis>
-switches to the appropriate Amanda configuration directory,
-e.g. /usr/local/etc/amanda/<emphasis remap='I'>config</emphasis>,
-then attempts to back up every disk specified by the
-<emphasis remap='I'>amanda.conf</emphasis>
-file.
+is the main interface to the Amanda backup process.  It loads the specified configuration
+and attempts to back up every disk specified by the
+&disklist;.
 <emphasis remap='B'>Amdump</emphasis>
 is normally run by
 <emphasis remap='B'>cron</emphasis>.</para>
 
-<para>You can specify many host/disk expressions, only disks that
-match an expression will be dumped. All disks are dumped if no
-expressions are given.</para>
+<para>The command optionally takes a set of DLE specifications
+    (see <manref
+    name="amanda-match" vol="7"/>) to narrow the DLEs that will be dumped.
+All disks are dumped if no expressions are given.</para>
 
-<para>If the file /usr/local/etc/amanda/<emphasis remap='I'>config</emphasis>/hold exists,
+<para>If a file named <filename>hold</filename> exists in the configuration directory,
 <command>amdump</command>
 will wait until it is removed before starting the backups.
 This allows scheduled backups to be delayed when circumstances warrant, for example, 
@@ -63,6 +63,11 @@ While waiting,
 <command>amdump</command>
 checks for the hold file every minute.</para>
 
+<para>In some cases it is desirable to dump all Amanda clients to holding disk
+without writing anything to storage media.  The <option>--no-taper</option>
+option instructs Amanda to not start the taper, and thus enter degraded mode
+immediately.</para>
+
 <para>See the
 <manref name="amanda" vol="8"/>
 man page for more details about Amanda.</para>
@@ -74,7 +79,8 @@ man page for more details about Amanda.</para>
   <varlistentry>
   <term><replaceable>host</replaceable> [<replaceable>disk</replaceable>]*</term>
   <listitem>
-<para>Specify the host and disk on which the command will work.</para>
+<para>Specify the host and disk on which the command will work -- see
+    the description of DLE specifications in <manref name="amanda-match" vol="7"/>. </para>
   </listitem>
   </varlistentry>
 
@@ -143,6 +149,7 @@ The exit code of <command>amdump</command> is the ORed value of:
 <manref name="amrestore" vol="8"/>,
 <manref name="amflush" vol="8"/>,
 <manref name="cron" vol="8"/>
+<manref name="amanda-match" vol="7"/>
 </seealso>
 
 </refentry>
index f9d20007e113c29bcd67e9065f8e0a9d75ace31e..f81d191167d6fb6409de4cd9b6655a76dc42adea 100644 (file)
@@ -60,27 +60,22 @@ pulls one or more matching dumps from tape or from the holding disk,
 handling the reassembly of multi-tape split dump files as well as any
 tape autochanger operations.</para>
 
-<para>It will automatically use the logs created by
-<manref name="amdump" vol="8"/>
+<para>It will automatically use the Amanda catalog
 to locate available dumps on tape, in the same way that the <emphasis
 remap='B'>find</emphasis> feature of
 <manref name="amadmin" vol="8"/>
-lists available dumps. If these logs are unavailable, it can search
-tape-by-tape to find what it needs, and can generate new logs to serve
-as an emergency tape inventory.</para>
+lists available dumps.</para>
 
 <para>The 
 <emphasis remap='I'>hostname</emphasis>,
 <emphasis remap='I'>diskname</emphasis>,
 <emphasis remap='I'>datestamp</emphasis>,
 and
-<emphasis remap='I'>level</emphasis> dump pattern-matching works as in
-<manref name="amrestore" vol="8"/>,
-with the added requirement that at minimum a <emphasis
-remap='I'>hostname</emphasis> must be specified when not in inventory mode.</para>
+<emphasis remap='I'>level</emphasis> dump specifications are further described in
+<manref name="amanda-match" vol="7"/>.
+Note that at minimum a <emphasis remap='I'>hostname</emphasis> must be specified.</para>
 
-<para>Unless
-<option>-p</option>
+<para>Unless <option>-p</option>
 is used, backup images are extracted to files in the current directory named:</para>
 
 <para>If a changer error occurs, or the <option>-d</option> option is given,
@@ -199,10 +194,9 @@ instead.</para>
 </refsect1>
 
 <seealso>
+<manref name="amanda-match" vol="7"/>,
 <manref name="amadmin" vol="8"/>,
 <manref name="amrestore" vol="8"/>,
-<manref name="tar" vol="1"/>
-<manref name="restore" vol="8"/>
 </seealso>
 
 </refentry>
index f78879ed531a5dc5092d20b016b81e4294b3445c..c27261bc0751d1be06b5bad32e4c909d67ed103c 100644 (file)
 <para><emphasis remap='B'>Amflush</emphasis>
 writes Amanda backups from the holding disks to tape,
 and updates the Amanda info database and &tapelist; accordingly.
+It is similar to amdump, but does not perform any backup operations on
+Amanda clients.
 Backups may stay in a holding disk when something is wrong with the tape
-at the time
-<emphasis remap='B'>amdump</emphasis>
-is run.
+at the time <command>amdump</command> is run.
 When this happens, the problem must be corrected and
-<command>amflush</command>
-run by hand.</para>
+<command>amflush</command> run by hand.</para>
+
+<para>The command optionally takes a set of DLE specifications
+    (see <manref
+    name="amanda-match" vol="7"/>) to narrow the DLEs for which dumps will be flushed.
+All dumps in holding are flushed if no expressions are given.</para>
+
 </refsect1>
 
 <refsect1><title>OPTIONS</title>
@@ -97,23 +102,23 @@ option.</para>
   <varlistentry>
   <term><option>-D datestamp</option></term>
   <listitem>
-<para>specify a  datestamp expression you want to flush, see the 
-&quot;DATESTAMP EXPRESSION&quot; section of
-<manref name="amanda" vol="8"/>
-for a description.
+<para>specify a datestamp expression you want to flush; see
+<manref name="amanda-match" vol="7"/>
+for details on the format of this expression.
 <option>-D 20001225-7</option>
-will flush all
-dumps from 25 december 2000 to 27 december 2000.</para>
+will flush all dumps from 25 december 2000 to 27 december 2000.</para>
   </listitem>
   </varlistentry>
 
   <varlistentry>
   <term><replaceable>host</replaceable> [<replaceable>disk</replaceable>]*</term>
   <listitem>
-<para>Specify the host and disk on which the command will work.</para>
+<para>Specify the host and disk on which the command will work -- see
+    the description of DLE specifications in <manref name="amanda-match" vol="7"/>. </para>
   </listitem>
   </varlistentry>
 
+
   &configoverride.varlistentry;
 
 </variablelist>
@@ -193,6 +198,7 @@ The exit code of <command>amflush</command> is the ORed value of:
 
 <seealso>
 <manref name="amdump" vol="8"/>
+<manref name="amanda-match" vol="7"/>
 </seealso>
 
 </refentry>
index 32ee09434892717a034a87f3a87b86296a366e75..ed546cd02b4cfa02a06d62543a203d54d64505ce 100644 (file)
@@ -139,6 +139,10 @@ List all regex (POSIX Extended Regular Expression syntax) that amanda ignore. Th
  <!-- ==== -->
  <varlistentry><term>STRANGE</term><listitem>
 List all regex (POSIX Extended Regular Expression syntax) that are strange output from gtar. All gtar output that doesn't match a normal or ignore regex are strange by default. The result of the dump is STRANGE if gtar produce a strange output. These output are in the "FAILED DUMP DETAILS" section of the email report.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>VERBOSE</term><listitem>
+Default: "NO". If "YES", amgtar print more verbose debugging message and can leave temporary files in AMANDA_TMPDIR.
 </listitem></varlistentry>
 </variablelist>
 
index a819454700a147ad194249f3b566c37bb805791e..acd3704a2e68ff68254bc2fc456009267e77c383 100644 (file)
 <refsynopsisdiv>
 <cmdsynopsis>
   <command>amoverview</command>    
-    <arg choice='opt'><arg choice='opt'>-config </arg><arg choice='plain'><replaceable>config</replaceable></arg></arg>
-    <arg choice='opt'>-hostwidth <replaceable>width</replaceable></arg>
-    <arg choice='opt'>-diskwidth <replaceable>width</replaceable></arg>
-    <arg choice='opt'>-skipmissed</arg>
-    <arg choice='opt'>-last</arg>
-    <arg choice='opt'>-num0</arg>
-    <arg choice='opt'>-togo0</arg>
-    <arg choice='opt'>-verbose</arg>
+    <arg choice='opt'><arg choice='opt'>--config </arg><arg choice='plain'><replaceable>config</replaceable></arg></arg>
+    <arg choice='opt'>--hostwidth <replaceable>width</replaceable></arg>
+    <arg choice='opt'>--diskwidth <replaceable>width</replaceable></arg>
+    <arg choice='opt'>--skipmissed</arg>
+    <arg choice='opt'>--last</arg>
+    <arg choice='opt'>--num0</arg>
+    <arg choice='opt'>--togo0</arg>
+    <arg choice='opt'>--verbose</arg>
 </cmdsynopsis>
 </refsynopsisdiv>
 
@@ -53,7 +53,7 @@ man page for more details about Amanda.</para>
 <refsect1><title>OPTIONS</title>
 <variablelist remap='TP'>
   <varlistentry>
-  <term><option>-config</option> <replaceable>config</replaceable></term>
+  <term><option>--config</option> <replaceable>config</replaceable></term>
   <listitem>
 <para>Use configuration
 <emphasis remap='I'>config</emphasis>
@@ -61,7 +61,7 @@ instead of configuration daily.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><option>-hostwidth</option> <replaceable>width</replaceable></term>
+  <term><option>--hostwidth</option> <replaceable>width</replaceable></term>
   <listitem>
 <para>Set
 <emphasis remap='B'>host</emphasis>
@@ -71,7 +71,7 @@ characters instead of 8.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><option>-diskwidth</option> <replaceable>width</replaceable></term>
+  <term><option>--diskwidth</option> <replaceable>width</replaceable></term>
   <listitem>
 <para>Set
 <emphasis remap='B'>disk</emphasis>
@@ -81,7 +81,7 @@ characters instead of 20.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><option>-skipmissed</option></term>
+  <term><option>--skipmissed</option></term>
   <listitem>
 <para>Compacts the output by only printing stats 
 for the days Amanda actually ran.
@@ -90,7 +90,7 @@ for the days Amanda actually ran.
   </varlistentry>
 
   <varlistentry>
-  <term><option>-last</option></term>
+  <term><option>--last</option></term>
   <listitem>
   <para>
   Outputs the last status of each disk at the start. 
@@ -100,7 +100,7 @@ for the days Amanda actually ran.
   </varlistentry>
 
   <varlistentry>
-  <term><option>-num0</option></term>
+  <term><option>--num0</option></term>
   <listitem>
   <para>
   Outputs the number of level 0 dumps for each disk.
@@ -109,7 +109,7 @@ for the days Amanda actually ran.
   </varlistentry>
   
   <varlistentry>
-  <term><option>-togo0</option></term>
+  <term><option>--togo0</option></term>
   <listitem>
   <para>
   Outputs the number of runs until the last level 0 dump is overwritten.
@@ -118,7 +118,7 @@ for the days Amanda actually ran.
   </varlistentry>
 
   <varlistentry>
-  <term><option>-verbose</option></term>
+  <term><option>--verbose</option></term>
   <listitem>
 <para><emphasis remap='B'>Amoverview</emphasis>
 can take a long while on large systems.
index cea1fc5643aee4ea091988ba4cdb1329472dfff9..21fc0b79b7186319960e489c921fa834ef283bc8 100644 (file)
@@ -174,6 +174,37 @@ will be searched.
 
 </refsect1>
 
+<refsect1><title>RECOVERY</title>
+
+<para>Read the postgres documentation carefully before attempting a recovery.
+This section is only a rough guide to the process.</para>
+
+<para>The data recovered from a postgres backup consists of a data tarball and
+one or more archive tarballs.  The data contains the state of the database
+at the time the full backup was performed, and the archive tarballs contain
+postgres WAL files that must be re-run to generate a consistent
+state.</para>
+
+<para>Ensure that the database server is shut down, and move the existing data
+directory aside.  Untar the data tarball over this directory, and verify
+that ownership and permissions are correct.  Untar all of the archive
+tarballs into a single directory - the archive directory.  Create a
+<filename>recovery.conf</filename> in the data directory, owned by the
+proper user and with proper permissions.  Add a
+<command>restore_command</command> to it, e.g.,</para>
+
+<programlisting>
+restore_command = 'cp /path/to/archive_dir/%f "%p"'
+</programlisting>
+
+<para>Start the database server, and examine the logs to track the process of
+the recovery.  When the recovery is complete, the server will transition
+into a running state, and will move the <filename>recovery.conf</filename>
+file aside so that it will not attempt a recovery on the next
+invocation.</para>
+
+</refsect1>
+
 <seealso>
 <manref name="amanda.conf" vol="5"/>,
 <manref name="amanda-client.conf" vol="5"/>,
index 2e3f26b980df586cd8310c8f8cbf4728ba2597f5..aaef74e48985d1282e931b3a011178626c23f7df 100644 (file)
@@ -34,6 +34,7 @@
     <arg choice='opt'>-s <replaceable>index-server</replaceable></arg>
     <arg choice='opt'>-t <replaceable>tape-server</replaceable></arg>
     <arg choice='opt'>-d <replaceable>tape-device</replaceable></arg>
+    <arg choice='opt'>-h <replaceable>hostname</replaceable></arg>
     <arg choice='plain' rep='repeat'><group><arg choice='plain'>-o </arg><replaceable>configoption</replaceable></group></arg>
 </cmdsynopsis>
 </refsynopsisdiv>
@@ -89,6 +90,12 @@ client-custom-compressed tapes.</para>
 <para>Tape device to use on the tape server host.</para>
   </listitem>
   </varlistentry>
+  <varlistentry>
+  <term><option>-h hostname</option></term>
+  <listitem>
+<para>Hostname to begin restoring; defaults to the system's hostname.</para>
+  </listitem>
+  </varlistentry>
 
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>clientconfigoption</replaceable></term>
@@ -232,7 +239,7 @@ If the tape device is omitted, the default is used.</para>
 
 <para>If you want amrecover to use your changer, the 
 <emphasis remap='I'>tapedev</emphasis>
-must be equal to the amrecover_changer setting on the server.</para>
+must be equal to the <amkeyword>amrecover-changer</amkeyword> setting on the server.</para>
 
 <para>Since device names contain colons, you must always specify the hostname.</para>
 
index f56d6337e4b34fbad26b7832a8f6b6ac7c3407ed..27defce6a3120a1d6cbe66877d8bc314e5322e8f 100644 (file)
@@ -193,6 +193,254 @@ report is put in <emphasis remap='I'>outputfile</emphasis>.</para>
 </refsect2>
 </refsect1>
 
+<refsect1><title>TEXT REPORT FORMAT</title>
+
+<para>Amanda's text report format is divided into several sections.  Some of these
+sections only appear if they are not empty.</para>
+
+<para>Although newer versions of Amanda try to use the term "volume" to refer
+to a unit of storage, amreport still uses the term "tape", even if backups
+are done to non-tape devices, to allow scripts which parse amreport's
+output to continue to function.</para>
+
+<refsect2><title>Summary</title>
+<programlisting>
+Hostname: bkserver
+Org     : DailySet1
+Config  : Daily
+Date    : February 25, 2009
+
+These dumps were to tape Daily-103.
+The next tape Amanda expects to use is: Daily-142
+
+FAILURE DUMP SUMMARY:
+   jamon.slikon.local /var lev 0  FAILED [/bin/tar exited with status 2]
+</programlisting>
+
+<para>The summary section describes the run in broad terms, giving the server
+hostname, organization (from the <amkeyword>org</amkeyword> configuration
+parameter), configuration name, and dump date.  This is followed by a
+description of the volumes and holding disk used, and an rough estimate of the
+volume(s) Amanda will use on the next run.</para>
+
+<para>Brief notices of any unusual circumstances will also be included
+here.</para>
+
+</refsect2>
+
+<refsect2><title>Statistics</title>
+<programlisting>
+STATISTICS:
+                          Total       Full      Incr.
+                        --------   --------   --------
+Estimate Time (hrs:min)    0:00
+Run Time (hrs:min)         0:01
+Dump Time (hrs:min)        0:00       0:00       0:00
+Output Size (meg)           1.6        0.0        1.6
+Original Size (meg)         1.6        0.0        1.6
+Avg Compressed Size (%)   100.0      100.0      100.0   (level:#disks ...)
+Filesystems Dumped            4          1          3   (1:3)
+Avg Dump Rate (k/s)      1555.1      134.2     1787.3
+
+Tape Time (hrs:min)        0:00       0:00       0:00
+Tape Size (meg)             1.6        0.0        1.6
+Tape Used (%)               5.5        0.1        5.4   (level:#disks ...)
+Filesystems Taped             4          1          3   (1:3)
+                                                        (level:#parts ...)
+Parts Taped                   4          1          3   (1:3)
+Avg Tp Write Rate (k/s)  143966    27624.3     151811
+
+USAGE BY TAPE:
+  Label            Time      Size      %  DLEs Parts
+  metals-013       0:00     1650k    5.4     4     4
+</programlisting>
+
+<para>This section contains aggregate statistics for the entire run.  The three
+columns break down the results into a total for all data handled, only full
+dumps, and only incremental dumps.  In the right margin, amreport indicates
+the breakdown of dump levels at the dumper and the taper.</para>
+
+<para>The rows have the following meanings:</para>
+<variablelist>
+<!-- ============= -->
+<varlistentry><term>Estimate Time</term><listitem>
+<para>
+The time used by the planner to estimate dump sizes.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Run Time</term><listitem>
+<para>
+Total runtime, from the invocation of amdump to its completion.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Dump Time</term><listitem>
+<para>
+Total time spent dumping clients.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Output Size</term><listitem>
+<para>
+Total quantity of data dumped, after compression.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Original Size</term><listitem>
+<para>
+Total quantity of data dumped, before compression.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Avg Compressed Size</term><listitem>
+<para>
+Compression ratio, calculated from the previous two rows.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Filesystems Dumped</term><listitem>
+<para>
+Number of DLEs dumped.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Avg Dump Rate</term><listitem>
+<para>
+Average speed at which clients produced data.  Note that, for dumps done
+directly to a slow device, rather than to holding disk, this rate may
+reflect a write speed constrained by the device speed.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Tape Time</term><listitem>
+<para>
+Total time spent writing to storage volumes.  This includes time spent changing
+tapes, including time spent waiting for flush thresholds to be met.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Tape Size</term><listitem>
+<para>
+Total quantity of data written to storage volumes.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Tape Used</term><listitem>
+<para>
+Fraction of the total allocated storage (tapetype length times runtapes) actually used.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Filesystems Taped</term><listitem>
+<para>
+Number of filesystems written to storage.  This may be larger or smaller than the
+number of filesystems dumped, due to flushes or dumps left on holding disk.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Parts Taped</term><listitem>
+<para>
+Number of split parts writtten to storage.  If this number is very large, then the split
+size may be too small.
+</para></listitem></varlistentry>
+<!-- ============= -->
+<varlistentry><term>Avg Tp Write Rate</term><listitem>
+<para>
+Taper speed, based on the tape time and tape size, above.  Note that, because the tape time
+includes time spent on tasks other than writing to tape, this does not necessary reflect the
+device's real write speed.  However, the value is useful for capacity planning, as it reflects
+a realistic estimate of how quickly Amanda can write data to storage.
+</para></listitem></varlistentry>
+</variablelist>
+
+</refsect2>
+
+<refsect2><title>Usage by Tape</title>
+<programlisting>
+USAGE BY TAPE:
+  Label          Time      Size      %  DLEs Parts
+  Conf-001       0:00    20320k   66.2     1     4
+  Conf-002       0:00     6470k   21.1     0     2
+</programlisting>
+
+<para>This short section gives per-volume statistics: time spent writing to the
+volume; bytes written to the volume; portion of the expected tape length
+used; number of DLEs started, and total number of split parts
+written.</para>
+
+</refsect2>
+
+<refsect2><title>Notes</title>
+<programlisting>
+NOTES:
+  taper: tape DAILY-37 kb 30720 fm 3 [OK]
+</programlisting>
+
+<para>This section contains any informational log messages from the run.  Most
+messages are self-explanatory. The taper message shown in the example is
+always present, and is redundant to the previous section. It indicates that
+30720 kb were written to "DAILY-37" in 3 files.  </para>
+</refsect2>
+
+<refsect2><title>Failure and Strange Details</title>
+<programlisting>
+FAILED DUMP DETAILS:
+
+/--  jamon.slikon.local /var lev 0 FAILED [/bin/tar exited with status 2]
+sendbackup: info BACKUP=APPLICATION
+sendbackup: info APPLICATION=amgtar
+sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
+sendbackup: info COMPRESS_SUFFIX=.gz
+sendbackup: info end
+? /bin/tar: ./gdm: Cannot savedir: Permission denied
+| Total bytes written: 943831040 (901MiB, 4.9MiB/s)
+| /bin/tar: Error exit delayed from previous errors
+sendbackup: error [/bin/tar exited with status 2]
+sendbackup: size 921710
+sendbackup: end
+\\--------
+
+STRANGE DUMP DETAILS:
+
+/--  bsdfw.slikon.local / lev 0 STRANGE
+sendbackup: info BACKUP=APPLICATION
+sendbackup: info APPLICATION=amgtar
+sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... -
+sendbackup: info COMPRESS_SUFFIX=.gz
+sendbackup: info end
+| /bin/tar: ./tmp/.X11-unix/X0: socket ignored
+| Total bytes written: 5530869760 (5.2GiB, 3.0MiB/s)
+sendbackup: size 5401240
+sendbackup: end
+\\--------
+</programlisting>
+
+<para>This section expands on failures and strange results indicated in earlier
+sections.  In both cases, the details contain a messages produced by the
+underlying backup tool - GNU tar, in this example.  Failed dumps have
+actually failed, and the reasons are usually clear.  Strange dumps,
+however, are regarded as successful by Amanda, but contain messages that
+Amanda did not recognize and which may be of interest to the
+operator.</para>
+</refsect2>
+
+<refsect2><title>Dump Summary</title>
+<programlisting>
+DUMP SUMMARY:
+                                       DUMPER STATS                TAPER STATS
+HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS     KB/s
+-------------------------- ------------------------------------- ---------------
+strontium    /etc        1     270     270    --     0:00 1146.3   0:00 140918.6
+strontium    -me/elantra 1      10      10    --     0:00   65.6   0:00   9033.4
+strontium    /local      0      20      20    --     0:00  133.9   0:00  27624.3
+strontium    -ository_13 1    1350    1350    --     0:01 2568.5   0:00 175006.5
+</programlisting>
+
+<para>The dump summary table has one row for each DLE processed during the run.
+The "L" column gives the level of the dump.  The remaining colums are
+divided into dumper stats and taper stats.  </para>
+
+<para>The dumper stats give the original (before compression) and output (after
+compression) size of each dump, as well as a compression ratio, if
+applicable.  The column labeled "MMM:SS" gives the time spent on that dump,
+and the next column is the calculated dump rate.</para>
+
+<para>The taper stats give the time and speed with which the dump was written
+to storage.  This value is the sum of the times for each part, and as such
+does not include time spent switching volumes.</para>
+</refsect2>
+
+</refsect1>
+
 <refsect1><title>LABEL PRINTING</title>
 <para>Amanda can print postscript labels describing the contents
 of tape(s) written in a run.
index 64ed37018dc136acd122ee44179b35d0dfbd5f6f..73a266af1b0ca11ef1d8262d8ecbb62dfef78451 100644 (file)
@@ -94,11 +94,8 @@ decompress the result.</para>
 <para>Only dumps matching the dump specification beginning with
 <replaceable>hostname</replaceable> are extracted.  If no specification is
 given, every file on the volume (or the entire holdingfile) is restored.  See
-the "HOST &amp; DISK EXPRESSIONS" section of <manref name="amanda" vol="8"/>
-for the format of the <replaceable>hostname</replaceable> and
-<replaceable>diskname</replaceable> parameters, and the "DATESTAMP EXPRESSIONS"
-section for the format of the <replaceable>datestamp</replaceable>
-parameters.</para>
+the "DUMP SPECIFICATIONS" section of <manref name="amanda-match" vol="7"/>
+for more information.</para>
 
 <para>Unless <option>-p</option> is used, candidate backup images are extracted
 to files in the current directory named:
@@ -227,6 +224,7 @@ images.</para>
 </refsect1>
 
 <seealso>
+<manref name="amanda-match" vol="7"/>,
 <manref name="amfetchdump" vol="8"/>,
 <manref name="amrecover" vol="8"/>,
 </seealso>
index 3f83662d8f7ba80882fd72a610e6aa776a0258a6..eed3375a334dcf923cb45e078700f3ea50775c8c 100644 (file)
 <cmdsynopsis>
   <command>amvault</command>
     &configoverride.synopsis;
-    <arg choice='opt'>-q|--quiet</arg>
+    <arg choice='opt'>-q</arg> <arg choice='opt'>--quiet</arg>
+    <arg choice='opt'>-n</arg> <arg choice='opt'>--dry-run</arg>
+    <arg choice='opt'>--fulls-only </arg>
+    <arg choice='opt'>--export </arg>
+    <arg choice='opt'><option>--src-timestamp</option>
+       <replaceable>src-timestamp</replaceable></arg>
+    <sbr/>
+    <arg choice='plain'><option>--label-template</option>
+           <replaceable>label-template</replaceable></arg>
+    <arg choice='plain'><option>--dst-changer</option>
+           <replaceable>dst-changer</replaceable></arg>
+    <arg choice='opt' rep='repeat'><option>--autolabel</option>
+           <replaceable>autolabel-arg</replaceable></arg>
+    <sbr/>
     <arg choice='plain'><replaceable>config</replaceable></arg>
-    <arg choice='plain'><replaceable>src-run-timestamp</replaceable></arg>
-    <arg choice='plain'><replaceable>dst-changer</replaceable></arg>
-    <arg choice='plain'><replaceable>label-template</replaceable></arg>
+    <arg choice='opt'>
+      <arg choice='plain'><replaceable>hostname</replaceable></arg>
+      <arg choice='opt'>
+        <arg choice='plain'><replaceable>disk</replaceable></arg>
+        <arg choice='opt'>
+          <arg choice='plain'><replaceable>date</replaceable></arg>
+          <arg choice='opt'>
+            <arg choice='plain'><replaceable>level</replaceable></arg>
+            <arg choice='opt'>
+              <arg choice='plain'><replaceable>hostname</replaceable></arg>
+              <arg choice='opt'>...</arg>
+            </arg>
+          </arg>
+        </arg>
+      </arg>
+    </arg>
 </cmdsynopsis>
 </refsynopsisdiv>
 
 <refsect1><title>WARNING</title>
+
 <para>This application is not yet in its final form, and is subject to major revision
 in subsequent versions of Amanda.  Backward compatibility is not guaranteed.</para>
 
-<para>The significant limitations of this version of amvault are: tapetypes for
-secondary and tertiary volumes much match (including length and
-device_properties); tertiary volumes must be blank (manual erasure is required
-to re-use tertiary media; restore/recover operations will request tertiary
-media by label when dumpfiles are not found on secondary media, but there is no
-provision to automatically fetch such media from a different changer; and all
-dumpfiles on a secondary volume are moved to tertiary media - there is no
-provision to filter dumps.</para>
+<para>Note that Amanda restore/recover operations will request tertiary media
+by label when dumpfiles are not found on secondary media, but there is no
+provision to automatically fetch such media from a different changer</para>
 
 <para>Feedback on and patches to this application are invited and
 encouraged!</para>
@@ -55,19 +77,48 @@ encouraged!</para>
 
 <refsect1><title>DESCRIPTION</title>
 
+<para>Amvault is conceptually equivalent to "amfetchdump | taper".  That is, it reads
+specified dumps from secondary media and re-writes them on tertiary media.</para>
+
 <para><emphasis remap='B'>Amvault</emphasis> Copies data from the run with
-timestamp <emphasis remap='I'>src-run-timestamp</emphasis> onto volumes using
-the changer <emphasis remap='I'>dst-changer</emphasis>, labeling new volumes
-with <emphasis remap='I'>label-template</emphasis>.  If <emphasis
-remap='I'>src-run-timestamp</emphasis> is "latest", then the most recent amdump
-or amflush run will be used.</para>
+timestamp <option>src-timestamp</option> onto volumes using the changer
+<option>dst-changer</option>, and labeling new volumes with
+<option>label-template</option>.  If <option>src-timestamp</option> is
+"latest", then the most recent amdump or amflush run will be used.  If
+<option>--fulls-only</option> is given, then only full (level-0) dumps are
+copied.</para>
+
+<para>The <option>--quiet</option> (<option>-q</option>) option will
+eliminate non-error messages, and is useful when running amvault from
+cron.  The <option>--dry-run</option> (<option>-n</option>) option will
+cause amvault to print the dumps it would vault, but not actually perform
+any vaulting operations.</para>
+
+<refsect2><title>Secondary Media</title>
+
+<para>The dumps to be read from secondary media can be specified by any
+combination of dump specifications, <option>--fulls-only</option>, and
+<option>--src-timestamp</option>.  At least one must be specified, lest
+amvault attempt to vault all dumps in the catalog.  See <manref
+    name="amanda-match" vol="7"/> for more information on dump
+specifications.</para>
+
+<para>Note that the datestamp given in the dumpspec is the
+<emphasis>dump</emphasis> datestamp - the run in which the backup was taken
+on the Amanda client.  The <option>--src-timestamp</option>, on the other
+hand, is the <emphasis>write</emphasis> timestamp - the run in which the
+dump was written to secondary media.  The latter option facilitates
+duplicating the results of an entire backup run, including any dumps that
+might have been flushed from holding disk.</para>
 
-<para>In a vaulting operation, the source media is referred to as "secondary
-media", while the destination is referred to as "tertiary media".</para>
+</refsect2>
 
-<para>Each source volume will be copied to a new destination volume; no
-re-assembly or splitting will be performed.  Destination volumes must be at
-least as large as the source volumes.</para>
+<refsect2><title>Tertiary Media</title>
+
+<para>The <option>--dst-changer</option> must be specified, and names the changer
+in which tertiary media are stored.  In general, this should be different
+from the secondary changer, to eliminate the possibility of overwriting
+secondary media with tertiary data.</para>
 
 <para>The changer parameter should specify the name of a changer defined in
 &amconf;.  For example:
@@ -80,21 +131,37 @@ define changer vaulting_tape {
 }
 </programlisting></para>
 
-<para>The <emphasis>--quiet</emphasis> option reduces the verbosity of the
-utility; this can be useful for volumes containing many split parts.  The
-<emphasis>--autolabel</emphasis> option defines which tertiary volumes
-amlabel will overwrite.  It can have any of the values defined for
-<amkeyword>autolabel</amkeyword> in <manref name="amanda.conf" vol="5" />,
-with the addition of "this_config", meaning volumes matching the labelstr
-for this configuration.  The option defaults to "empty".  Multiple
-values can be separated with commas.  The label template functions
-identically to the template for teh <amkeyword>autolabel</amkeyword>
-parameter.</para>
+<para>The <option>--label-template</option> option is required, and specifies a
+label template which is used to generate new labels for tertiary volumes.
+The <option>--autolabel</option> option works just like the
+<amkeyword>autolabel</amkeyword> parameter in &amconf;, and can be
+specified multiple times if necessary.  The default is 'empty'.</para>
+
+<para>If &amconf; contains the new <amkeyword>part-size</amkeyword>
+splitting parameters, then amvault will use them without any additional configuration.
+However, if the configuration still uses the old splitting parameters
+(<amkeyword>tape_splitsize</amkeyword>,
+<amkeyword>split_diskbuffer</amkeyword>, and
+<amkeyword>fallback_splitsize</amkeyword>), then amvault will need some
+additional configuration in order to properly split dumps to tertiary
+media.  To do so, specify a new tapetype in &amconf;, say "TERTIARY",
+and set the <amkeyword>part-size</amkeyword> and other appropriate
+parameters there.  Then reference that tapetype in the amvault invocation:
+<programlisting>
+    amvault -otapetype=TERTIARY ...
+</programlisting></para>
+
+<para>The <option>--export</option> option will cause amvault to attempt to move
+completed tertiary volumes to import/export slots, where they can be
+more easily removed by an operator.</para>
+
+</refsect2>
 
 </refsect1>
 
 <seealso>
 <manref name="amanda-changers" vol="7"/>
+<manref name="amfetchdump" vol="8"/>
 </seealso>
 
 </refentry>
index f74b94bc0599c782cc4037c7493ebc3a3238cfee..8eeb15dcf6d98b1ff64378384c64a4fc825643f6 100644 (file)
   </span>
 </xsl:template>
 
+<xsl:template name="user.footer.content">
+  <hr />
+  <center>Amanda-@VERSION@</center>
+</xsl:template>
+
 </xsl:stylesheet>
index 46534a9d042b6c903335ab917eef89ab7462844e..343e7d3f57d01432fc7a7686ed068c2c853e60cb 100644 (file)
@@ -209,25 +209,33 @@ ndmjob_LDADD = libndmjob.la \
 amndmjob_LDADD = libndmjob.la \
                   ../common-src/libamanda.la
 
-# for systems without rpcgen, don't even include rules that *might*
-# regenerate things from the .x files.  These would rarely change
-# upstream, and *definitely* shouldn't change in Amanda.
-if HAVE_RPCGEN
 ndmp0.h ndmp0_xdr.c : ndmp0.x
-       rpcgen ndmp0.x
+       $(RPCGEN) ndmp0.x
 
 ndmp2.h ndmp2_xdr.c : ndmp2.x
-       rpcgen ndmp2.x
+       $(RPCGEN) ndmp2.x
 
 ndmp3.h ndmp3_xdr.c : ndmp3.x
-       rpcgen ndmp3.x
+       $(RPCGEN) ndmp3.x
 
 ndmp4.h ndmp4_xdr.c : ndmp4.x
-       rpcgen ndmp4.x
+       $(RPCGEN) ndmp4.x
 
 ndmp9.h ndmp9_xdr.c : ndmp9.x
-       rpcgen ndmp9.x
-endif
+       $(RPCGEN) ndmp9.x
+
+# cause these files to be built before those that might depend on them
+BUILT_SOURCES += \
+       ndmp0.h \
+       ndmp0_xdr.c \
+       ndmp2.h \
+       ndmp2_xdr.c \
+       ndmp3.h \
+       ndmp3_xdr.c \
+       ndmp4.h \
+       ndmp4_xdr.c \
+       ndmp9.h \
+       ndmp9_xdr.c
 
 noinst_HEADERS = \
        md5.h            ndmp0_enum_strs.h  ndmp3.x            ndmprotocol.h \
index a2c7dfffa1d667d3ce7752cf2fa2ef7d42564e66..9ce11b08e315c6b4002468e0d430df3ddb7b9566 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -196,7 +198,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -224,7 +225,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -237,10 +237,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -254,7 +258,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -267,10 +273,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -282,21 +291,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -439,7 +452,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -459,10 +472,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -518,78 +528,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -600,12 +665,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -620,17 +714,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -639,60 +737,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -700,13 +857,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -715,9 +878,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -753,7 +919,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -762,7 +927,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -770,19 +934,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -808,47 +995,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -856,6 +1099,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -878,19 +1122,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -900,13 +1146,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -950,6 +1193,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -982,7 +1226,10 @@ top_srcdir = @top_srcdir@
 SUFFIXES = 
 EXTRA_DIST = ndmos_glib.c ndmos_common.c README ShakeOut.sh \
        ThingsToTry idx_dump.pl
-BUILT_SOURCES = 
+
+# cause these files to be built before those that might depend on them
+BUILT_SOURCES = ndmp0.h ndmp0_xdr.c ndmp2.h ndmp2_xdr.c ndmp3.h \
+       ndmp3_xdr.c ndmp4.h ndmp4_xdr.c ndmp9.h ndmp9_xdr.c
 MOSTLYCLEANFILES = 
 CLEANFILES = 
 DISTCLEANFILES = $(am__append_1)
@@ -1010,6 +1257,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/gnulib
@@ -1605,29 +1865,12 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
@@ -1647,23 +1890,20 @@ install-data-hook: installperms-data
 %.i : %.c
        $(COMPILE) -E -o $@ $<
 
-# for systems without rpcgen, don't even include rules that *might*
-# regenerate things from the .x files.  These would rarely change
-# upstream, and *definitely* shouldn't change in Amanda.
-@HAVE_RPCGEN_TRUE@ndmp0.h ndmp0_xdr.c : ndmp0.x
-@HAVE_RPCGEN_TRUE@     rpcgen ndmp0.x
+ndmp0.h ndmp0_xdr.c : ndmp0.x
+       $(RPCGEN) ndmp0.x
 
-@HAVE_RPCGEN_TRUE@ndmp2.h ndmp2_xdr.c : ndmp2.x
-@HAVE_RPCGEN_TRUE@     rpcgen ndmp2.x
+ndmp2.h ndmp2_xdr.c : ndmp2.x
+       $(RPCGEN) ndmp2.x
 
-@HAVE_RPCGEN_TRUE@ndmp3.h ndmp3_xdr.c : ndmp3.x
-@HAVE_RPCGEN_TRUE@     rpcgen ndmp3.x
+ndmp3.h ndmp3_xdr.c : ndmp3.x
+       $(RPCGEN) ndmp3.x
 
-@HAVE_RPCGEN_TRUE@ndmp4.h ndmp4_xdr.c : ndmp4.x
-@HAVE_RPCGEN_TRUE@     rpcgen ndmp4.x
+ndmp4.h ndmp4_xdr.c : ndmp4.x
+       $(RPCGEN) ndmp4.x
 
-@HAVE_RPCGEN_TRUE@ndmp9.h ndmp9_xdr.c : ndmp9.x
-@HAVE_RPCGEN_TRUE@     rpcgen ndmp9.x
+ndmp9.h ndmp9_xdr.c : ndmp9.x
+       $(RPCGEN) ndmp9.x
 
 # 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.
index 2ea784fda6d3a578837db82334130952780c4d00..d68025abfcf18f2de46e22f828d71f275fa3b35f 100644 (file)
@@ -88,10 +88,6 @@ main (int ac, char *av[])
                return 0;
        }
 
-       /* exit when our stdin goes away */
-       g_thread_init(NULL);
-       g_thread_create(exit_on_stdin_eof_thread, NULL, FALSE, NULL);
-
 #ifndef NDMOS_OPTION_NO_CONTROL_AGENT
        the_session.control_acb.swap_connect = (o_swap_connect != 0);
 
index bdede992e8128682fc376795a64077c2b36dc7a6..3bd0a19eae0fd551f211bfc611de7dccebae7cee 100644 (file)
@@ -1241,7 +1241,7 @@ ndmp_sxa_tape_mtio (struct ndm_session *sess,
        default:
                NDMADR_RAISE_ILLEGAL_ARGS("tape_op");
 
-       case NDMP2_MTIO_EOF:
+       case NDMP9_MTIO_EOF:
                will_write = 1;
                tape_op = NDMP9_MTIO_EOF;
                break;
@@ -1702,7 +1702,7 @@ ndmp_sxa_data_stop (struct ndm_session *sess,
 {
        struct ndm_data_agent * da = &sess->data_acb;
 
-      NDMS_WITH_VOID_REQUEST(ndmp2_data_stop)
+      NDMS_WITH_VOID_REQUEST(ndmp9_data_stop)
        if (da->data_state.state != NDMP9_DATA_STATE_HALTED) {
                NDMADR_RAISE_ILLEGAL_STATE("data_state !HALTED");
        }
@@ -2562,9 +2562,6 @@ ndmp_sxa_mover_set_record_size (struct ndm_session *sess,
 
 
 
-#ifdef notyet
-
-
 #ifndef NDMOS_EFFECT_NO_NDMP3_NOR_NDMP4        /* Surrounds NDMPv[34] MOVER intfs */
 
 static int             mover_connect_common34 (struct ndm_session *sess,
@@ -2577,46 +2574,8 @@ static int               mover_connect_common34 (struct ndm_session *sess,
  * NDMP[34]_MOVER_CONNECT
  */
 int
-ndmadr_mover_connect (struct ndm_session *sess,
+ndmp_sxa_mover_connect (struct ndm_session *sess,
   struct ndmp_xa_buf *xa, struct ndmconn *ref_conn)
-{
-    switch (xa->request.protocol_version) {
-    default: return NDMADR_UNIMPLEMENTED_VERSION; /* should never happen */
-
-#ifndef NDMOS_OPTION_NO_NDMP2
-    case NDMP2VER:
-       /* not part of NDMPv2 */
-       return NDMADR_UNSPECIFIED_MESSAGE;
-#endif /* !NDMOS_OPTION_NO_NDMP2 */
-
-#ifndef NDMOS_OPTION_NO_NDMP3
-    case NDMP3VER:
-      NDMS_WITH(ndmp3_mover_connect)
-       ndmp9_mover_mode        mover_mode;
-       ndmp9_addr              data_addr;
-
-       switch (request->mode) {
-       default:                mover_mode = -1; break;
-       case NDMP3_MOVER_MODE_READ: mover_mode = NDMP9_MOVER_MODE_READ; break;
-       case NDMP3_MOVER_MODE_WRITE:mover_mode = NDMP9_MOVER_MODE_WRITE;break;
-       }
-
-       ndmp_3to9_addr (&request->addr, &data_addr);
-
-       return mover_connect_common34 (sess, xa, ref_conn,
-                               &data_addr, mover_mode);
-      NDMS_ENDWITH
-      break;
-#endif /* !NDMOS_OPTION_NO_NDMP3 */
-    }
-    return 0;
-}
-
-/* this same intf is expected in v4, so _common() now */
-static int
-mover_connect_common34 (struct ndm_session *sess,
-  struct ndmp_xa_buf *xa, struct ndmconn *ref_conn,
-  ndmp9_addr *data_addr, ndmp9_mover_mode mover_mode)
 {
 #ifndef NDMOS_OPTION_NO_DATA_AGENT
        struct ndm_data_agent * da = &sess->data_acb;
@@ -2626,8 +2585,10 @@ mover_connect_common34 (struct ndm_session *sess,
        int                     will_write;
        char                    reason[100];
 
+      NDMS_WITH(ndmp9_mover_connect)
+
        /* Check args */
-       switch (mover_mode) {
+       switch (request->mode) {
        default:                NDMADR_RAISE_ILLEGAL_ARGS("mover_mode");
        case NDMP9_MOVER_MODE_READ:
                will_write = 1;
@@ -2638,7 +2599,7 @@ mover_connect_common34 (struct ndm_session *sess,
                break;
        }
 
-       switch (data_addr->addr_type) {
+       switch (request->addr.addr_type) {
        default:                NDMADR_RAISE_ILLEGAL_ARGS("mover_addr_type");
        case NDMP9_ADDR_LOCAL:
 #ifdef NDMOS_OPTION_NO_DATA_AGENT
@@ -2654,7 +2615,7 @@ mover_connect_common34 (struct ndm_session *sess,
        if (ta->mover_state.state != NDMP9_MOVER_STATE_IDLE)
                NDMADR_RAISE_ILLEGAL_STATE("mover_state !IDLE");
 #ifndef NDMOS_OPTION_NO_DATA_AGENT
-       if (data_addr->addr_type == NDMP9_ADDR_LOCAL) {
+       if (request->addr.addr_type == NDMP9_ADDR_LOCAL) {
                ndmp9_data_get_state_reply *ds = &da->data_state;
 
                if (ds->state != NDMP9_DATA_STATE_LISTEN)
@@ -2678,27 +2639,26 @@ mover_connect_common34 (struct ndm_session *sess,
         * us an extra measure of robustness and sanity
         * check on the implementation.
         */
-       error = ndmis_audit_tape_connect (sess, data_addr->addr_type, reason);
+       error = ndmis_audit_tape_connect (sess, request->addr.addr_type, reason);
        if (error != NDMP9_NO_ERR) NDMADR_RAISE(error, reason);
 
-       error = ndmis_tape_connect (sess, data_addr, reason);
+       error = ndmis_tape_connect (sess, &request->addr, reason);
        if (error != NDMP9_NO_ERR) NDMADR_RAISE(error, reason);
 
-       ta->mover_state.data_connection_addr = *data_addr;
+       ta->mover_state.data_connection_addr = request->addr;
        /* alt: ta->....data_connection_addr = sess->...peer_addr */
 
-       error = ndmta_mover_connect (sess, mover_mode);
+       error = ndmta_mover_connect (sess, request->mode);
        if (error != NDMP9_NO_ERR) {
                /* TODO: belay ndmis_tape_connect() */
                NDMADR_RAISE(error, "!mover_connect");
        }
 
        return 0;
+      NDMS_ENDWITH
 }
 #endif /* !NDMOS_EFFECT_NO_NDMP3_NOR_NDMP4  Surrounds NDMPv[34] MOVER intfs */
 
-#endif /* notyet */
-
 
 
 /*
@@ -2767,7 +2727,7 @@ int
 ndmp_sxa_notify_connected (struct ndm_session *sess,
   struct ndmp_xa_buf *xa, struct ndmconn *ref_conn)
 {
-      NDMS_WITH_NO_REPLY(ndmp2_notify_connected)
+      NDMS_WITH_NO_REPLY(ndmp9_notify_connected)
        xa->reply.flags |= NDMNMB_FLAG_NO_SEND;
        /* Just ignore? */
        return 0;
@@ -2786,7 +2746,7 @@ ndmp_sxa_notify_mover_halted (struct ndm_session *sess,
 {
        struct ndm_control_agent *      ca = &sess->control_acb;
 
-      NDMS_WITH_NO_REPLY(ndmp2_notify_mover_halted)
+      NDMS_WITH_NO_REPLY(ndmp9_notify_mover_halted)
        xa->reply.flags |= NDMNMB_FLAG_NO_SEND;
 
        ca->pending_notify_mover_halted++;
@@ -3423,9 +3383,7 @@ struct ndm_dispatch_request_table ndma_dispatch_request_table_v9[] = {
    { NDMP9_MOVER_READ,                 0, ndmp_sxa_mover_read },
    { NDMP9_MOVER_CLOSE,                        0, ndmp_sxa_mover_close },
    { NDMP9_MOVER_SET_RECORD_SIZE,      0, ndmp_sxa_mover_set_record_size },
-#ifdef notyet
    { NDMP9_MOVER_CONNECT,              0, ndmp_sxa_mover_connect },
-#endif /* notyet */
 #endif /* !NDMOS_OPTION_NO_TAPE_AGENT */       /* Surrounds MOVER intfs */
    {0}
 };
index 8ccf943342b37c4c86fbaef29c1a73563c2ffa71..6067d1da1ea0c123b490fbb157eeffe7e4600d63 100644 (file)
@@ -189,6 +189,7 @@ ndma_daemon_session (struct ndm_session *sess, int port, int is_test_daemon)
            fflush(stdout);
 
            /* and exit when our stdin goes away */
+           g_debug("will exit on EOF from stdin");
            g_thread_init(NULL);
            g_thread_create(exit_on_stdin_eof_thread, NULL, FALSE, NULL);
        }
index 927829eb9440dc2edebcf37ca28ce554e2fb1a77..098216ef6fb3151ff4f1fbd720f1947887aa1b19 100644 (file)
@@ -720,6 +720,7 @@ ndmca_opq_show_device_info (struct ndm_session *sess,
 
                        ndmalogqr (sess, "    device     %s", dc->device);
                        if (!strcmp(what, "tape")) {
+#ifndef NDMOS_OPTION_NO_NDMP3
                            if (sess->plumb.tape->protocol_version == 3) {
                                attr = dc->v3attr.value;
                                ndmalogqr (sess, "      attr       0x%lx",
@@ -729,6 +730,18 @@ ndmca_opq_show_device_info (struct ndm_session *sess,
                                if (attr & NDMP3_TAPE_ATTR_UNLOAD)
                                    ndmalogqr (sess, "        UNLOAD");
                            }
+#endif /* !NDMOS_OPTION_NO_NDMP3 */
+#ifndef NDMOS_OPTION_NO_NDMP4
+                           if (sess->plumb.tape->protocol_version == 4) {
+                               attr = dc->v4attr.value;
+                               ndmalogqr (sess, "      attr       0x%lx",
+                                          attr);
+                               if (attr & NDMP4_TAPE_ATTR_REWIND)
+                                   ndmalogqr (sess, "        REWIND");
+                               if (attr & NDMP4_TAPE_ATTR_UNLOAD)
+                                   ndmalogqr (sess, "        UNLOAD");
+                           }
+#endif /* !NDMOS_OPTION_NO_NDMP4 */
                        }
                        for (k = 0; k < dc->capability.capability_len; k++) {
                                ndmalogqr (sess, "      set        %s=%s",
index ca16c0aa5197276dfd717c7d1362c928fcc4031a..c4995a9ff93572811176a90fe47f8235d6c748df 100644 (file)
@@ -84,6 +84,7 @@ main (int ac, char *av[])
                        dump_settings();
                        return 0;
                }
+
                ndma_daemon_session (&the_session, p_ndmp_port, the_mode == NDM_JOB_OP_TEST_DAEMON);
                return 0;
        }
index 278f087d61cedd6a59e7ffff4e804729b3749aa7..34998f361f3d421bea351406e5e078ccd7f199da 100644 (file)
 
 #include "ndmlib.h"
 
+/* On some solaris distributions INADDR_NONE is not defined,
+ * so define it here..
+ */
+
+#ifndef INADDR_NONE
+#define INADDR_NONE     ((in_addr_t)-1)
+#endif
 
 int
 ndmagent_from_str (struct ndmagent *agent, char *str)
index e26ee1c89fdd83fc22fa50309939837f91bf904a..b8e5cd0952d605cda901ea51dafc2d05031f3cec 100644 (file)
 #endif
 
 
-/* On Solaris platforms create platform specific environment for NDMP  
-   if not we might see issues with rpc code, specifically with 64 bit 
-   mode. 
-*/
-
-#ifdef __sun__
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/fcntl.h>
-#include <signal.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <assert.h>
-#include <errno.h>
-#include <strings.h>
-#include <netdb.h>
-#include <ctype.h>
-
-/* On some solaris distributions INADDR_NONE is not defined 
-   hence define here.. "in_addr_t" is defined in netinet/in.h  
-*/  
-
-#ifndef INADDR_NONE 
-#define INADDR_NONE     ((in_addr_t)-1)
-#endif
-
-#endif 
-
-
 /* this may need to be autodetected, or NDMOS_MACRO_SET_SOCKADDR may need to be
  * rewritten in terms of Amanda's sockaddr-util.h.  According to ndmpjoblib,
  * only FreeBDS has sin_len. */
index 1157b263f0ad434a6fc66964ee186fdf40896c7e..5c40c994befbda84fa7db035d67374059207d043 100644 (file)
@@ -8,77 +8,93 @@
 bool_t
 xdr_ndmp0_error (XDR *xdrs, ndmp0_error *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp0_header_message_type (XDR *xdrs, ndmp0_header_message_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp0_message (XDR *xdrs, ndmp0_message *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp0_header (XDR *xdrs, ndmp0_header *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->sequence))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->time_stamp))
-               return FALSE;
-       if (!xdr_ndmp0_header_message_type (xdrs, &objp->message_type))
-               return FALSE;
-       if (!xdr_ndmp0_message (xdrs, &objp->message))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->reply_sequence))
-               return FALSE;
-       if (!xdr_ndmp0_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->sequence))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->time_stamp))
+                return FALSE;
+        if (!xdr_ndmp0_header_message_type (xdrs, &objp->message_type))
+                return FALSE;
+        if (!xdr_ndmp0_message (xdrs, &objp->message))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->reply_sequence))
+                return FALSE;
+        if (!xdr_ndmp0_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp0_connect_open_request (XDR *xdrs, ndmp0_connect_open_request *objp)
 {
-       if (!xdr_u_short (xdrs, &objp->protocol_version))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_short (xdrs, &objp->protocol_version))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp0_connect_open_reply (XDR *xdrs, ndmp0_connect_open_reply *objp)
 {
-       if (!xdr_ndmp0_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp0_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp0_connect_reason (XDR *xdrs, ndmp0_connect_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp0_notify_connected_request (XDR *xdrs, ndmp0_notify_connected_request *objp)
 {
-       if (!xdr_ndmp0_connect_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->protocol_version))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->text_reason, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp0_connect_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->protocol_version))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->text_reason, ~0))
+                return FALSE;
        return TRUE;
 }
index 3fa31daa71bbd449134c33a5e2cdb979867a9525..84a60e883379b14b4932dddde76c974efa21160d 100644 (file)
@@ -11,140 +11,169 @@ extern bool_t xdr_ndmp2_u_quad();
 bool_t
 xdr__ndmp2_u_quad (XDR *xdrs, _ndmp2_u_quad *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->high))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->low))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->high))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->low))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_pval (XDR *xdrs, ndmp2_pval *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->value, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->value, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_device (XDR *xdrs, ndmp2_scsi_device *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_device (XDR *xdrs, ndmp2_tape_device *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_error (XDR *xdrs, ndmp2_error *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_header_message_type (XDR *xdrs, ndmp2_header_message_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_message (XDR *xdrs, ndmp2_message *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_header (XDR *xdrs, ndmp2_header *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->sequence))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->time_stamp))
-               return FALSE;
-       if (!xdr_ndmp2_header_message_type (xdrs, &objp->message_type))
-               return FALSE;
-       if (!xdr_ndmp2_message (xdrs, &objp->message))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->reply_sequence))
-               return FALSE;
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->sequence))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->time_stamp))
+                return FALSE;
+        if (!xdr_ndmp2_header_message_type (xdrs, &objp->message_type))
+                return FALSE;
+        if (!xdr_ndmp2_message (xdrs, &objp->message))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->reply_sequence))
+                return FALSE;
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_connect_open_request (XDR *xdrs, ndmp2_connect_open_request *objp)
 {
-       if (!xdr_u_short (xdrs, &objp->protocol_version))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_short (xdrs, &objp->protocol_version))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_connect_open_reply (XDR *xdrs, ndmp2_connect_open_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_auth_type (XDR *xdrs, ndmp2_auth_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_auth_text (XDR *xdrs, ndmp2_auth_text *objp)
 {
-       if (!xdr_string (xdrs, &objp->auth_id, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->auth_password, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->auth_id, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->auth_password, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_auth_md5 (XDR *xdrs, ndmp2_auth_md5 *objp)
 {
-       if (!xdr_string (xdrs, &objp->auth_id, ~0))
-               return FALSE;
-       if (!xdr_opaque (xdrs, objp->auth_digest, 16))
-               return FALSE;
+       register int32_t *buf;
+
+       int i;
+        if (!xdr_string (xdrs, &objp->auth_id, ~0))
+                return FALSE;
+        if (!xdr_opaque (xdrs, objp->auth_digest, 16))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_auth_data (XDR *xdrs, ndmp2_auth_data *objp)
 {
-       if (!xdr_ndmp2_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        switch (objp->auth_type) {
        case NDMP2_AUTH_NONE:
                break;
        case NDMP2_AUTH_TEXT:
-               if (!xdr_ndmp2_auth_text (xdrs, &objp->ndmp2_auth_data_u.auth_text))
-                       return FALSE;
+                if (!xdr_ndmp2_auth_text (xdrs, &objp->ndmp2_auth_data_u.auth_text))
+                        return FALSE;
                break;
        case NDMP2_AUTH_MD5:
-               if (!xdr_ndmp2_auth_md5 (xdrs, &objp->ndmp2_auth_data_u.auth_md5))
-                       return FALSE;
+                if (!xdr_ndmp2_auth_md5 (xdrs, &objp->ndmp2_auth_data_u.auth_md5))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -155,32 +184,38 @@ xdr_ndmp2_auth_data (XDR *xdrs, ndmp2_auth_data *objp)
 bool_t
 xdr_ndmp2_connect_client_auth_request (XDR *xdrs, ndmp2_connect_client_auth_request *objp)
 {
-       if (!xdr_ndmp2_auth_data (xdrs, &objp->auth_data))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_auth_data (xdrs, &objp->auth_data))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_connect_client_auth_reply (XDR *xdrs, ndmp2_connect_client_auth_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_auth_attr (XDR *xdrs, ndmp2_auth_attr *objp)
 {
-       if (!xdr_ndmp2_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        switch (objp->auth_type) {
        case NDMP2_AUTH_NONE:
                break;
        case NDMP2_AUTH_TEXT:
                break;
        case NDMP2_AUTH_MD5:
-               if (!xdr_opaque (xdrs, objp->ndmp2_auth_attr_u.challenge, 64))
-                       return FALSE;
+                if (!xdr_opaque (xdrs, objp->ndmp2_auth_attr_u.challenge, 64))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -191,168 +226,202 @@ xdr_ndmp2_auth_attr (XDR *xdrs, ndmp2_auth_attr *objp)
 bool_t
 xdr_ndmp2_connect_server_auth_request (XDR *xdrs, ndmp2_connect_server_auth_request *objp)
 {
-       if (!xdr_ndmp2_auth_attr (xdrs, &objp->client_attr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_auth_attr (xdrs, &objp->client_attr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_connect_server_auth_reply (XDR *xdrs, ndmp2_connect_server_auth_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp2_auth_data (xdrs, &objp->auth_result))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp2_auth_data (xdrs, &objp->auth_result))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_config_get_host_info_reply (XDR *xdrs, ndmp2_config_get_host_info_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->hostname, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->os_type, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->os_vers, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->hostid, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->auth_type.auth_type_val, (u_int *) &objp->auth_type.auth_type_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->hostname, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->os_type, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->os_vers, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->hostid, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->auth_type.auth_type_val, (u_int *) &objp->auth_type.auth_type_len, ~0,
                sizeof (ndmp2_auth_type), (xdrproc_t) xdr_ndmp2_auth_type))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_config_get_butype_attr_request (XDR *xdrs, ndmp2_config_get_butype_attr_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_config_get_butype_attr_reply (XDR *xdrs, ndmp2_config_get_butype_attr_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->attrs))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->attrs))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_addr_type (XDR *xdrs, ndmp2_mover_addr_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_config_get_mover_type_reply (XDR *xdrs, ndmp2_config_get_mover_type_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->methods.methods_val, (u_int *) &objp->methods.methods_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->methods.methods_val, (u_int *) &objp->methods.methods_len, ~0,
                sizeof (ndmp2_mover_addr_type), (xdrproc_t) xdr_ndmp2_mover_addr_type))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_config_get_auth_attr_request (XDR *xdrs, ndmp2_config_get_auth_attr_request *objp)
 {
-       if (!xdr_ndmp2_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_config_get_auth_attr_reply (XDR *xdrs, ndmp2_config_get_auth_attr_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp2_auth_attr (xdrs, &objp->server_attr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp2_auth_attr (xdrs, &objp->server_attr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_open_request (XDR *xdrs, ndmp2_scsi_open_request *objp)
 {
-       if (!xdr_ndmp2_scsi_device (xdrs, &objp->device))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_scsi_device (xdrs, &objp->device))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_open_reply (XDR *xdrs, ndmp2_scsi_open_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_close_reply (XDR *xdrs, ndmp2_scsi_close_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_get_state_reply (XDR *xdrs, ndmp2_scsi_get_state_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_controller))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_id))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_lun))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_controller))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_id))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_lun))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_set_target_request (XDR *xdrs, ndmp2_scsi_set_target_request *objp)
 {
-       if (!xdr_ndmp2_scsi_device (xdrs, &objp->device))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->target_controller))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->target_id))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->target_lun))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_scsi_device (xdrs, &objp->device))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->target_controller))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->target_id))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->target_lun))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_set_target_reply (XDR *xdrs, ndmp2_scsi_set_target_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_reset_device_reply (XDR *xdrs, ndmp2_scsi_reset_device_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_reset_bus_reply (XDR *xdrs, ndmp2_scsi_reset_bus_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
@@ -361,124 +430,139 @@ xdr_ndmp2_execute_cdb_request (XDR *xdrs, ndmp2_execute_cdb_request *objp)
 {
        register int32_t *buf;
 
+
        if (xdrs->x_op == XDR_ENCODE) {
                buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->timeout))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->datain_len))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->timeout))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->datain_len))
+                                return FALSE;
 
                } else {
                IXDR_PUT_U_LONG(buf, objp->flags);
                IXDR_PUT_U_LONG(buf, objp->timeout);
                IXDR_PUT_U_LONG(buf, objp->datain_len);
                }
-               if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
-                       return FALSE;
-               if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
-                       return FALSE;
+                if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
+                        return FALSE;
+                if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
+                        return FALSE;
                return TRUE;
        } else if (xdrs->x_op == XDR_DECODE) {
                buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->timeout))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->datain_len))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->timeout))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->datain_len))
+                                return FALSE;
 
                } else {
                objp->flags = IXDR_GET_U_LONG(buf);
                objp->timeout = IXDR_GET_U_LONG(buf);
                objp->datain_len = IXDR_GET_U_LONG(buf);
                }
-               if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
-                       return FALSE;
-               if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
-                       return FALSE;
-               return TRUE;
+                if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
+                        return FALSE;
+                if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
+                        return FALSE;
+        return TRUE;
        }
 
-       if (!xdr_u_long (xdrs, &objp->flags))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->timeout))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->datain_len))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
-               return FALSE;
+        if (!xdr_u_long (xdrs, &objp->flags))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->timeout))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->datain_len))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_execute_cdb_reply (XDR *xdrs, ndmp2_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_char (xdrs, &objp->status))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->dataout_len))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->datain.datain_val, (u_int *) &objp->datain.datain_len, ~0))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->ext_sense.ext_sense_val, (u_int *) &objp->ext_sense.ext_sense_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_char (xdrs, &objp->status))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->dataout_len))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->datain.datain_val, (u_int *) &objp->datain.datain_len, ~0))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->ext_sense.ext_sense_val, (u_int *) &objp->ext_sense.ext_sense_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_execute_cdb_request (XDR *xdrs, ndmp2_scsi_execute_cdb_request *objp)
 {
-       if (!xdr_ndmp2_execute_cdb_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_execute_cdb_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_scsi_execute_cdb_reply (XDR *xdrs, ndmp2_scsi_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp2_execute_cdb_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_execute_cdb_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_open_mode (XDR *xdrs, ndmp2_tape_open_mode *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_open_request (XDR *xdrs, ndmp2_tape_open_request *objp)
 {
-       if (!xdr_ndmp2_tape_device (xdrs, &objp->device))
-               return FALSE;
-       if (!xdr_ndmp2_tape_open_mode (xdrs, &objp->mode))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_tape_device (xdrs, &objp->device))
+                return FALSE;
+        if (!xdr_ndmp2_tape_open_mode (xdrs, &objp->mode))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_open_reply (XDR *xdrs, ndmp2_tape_open_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_close_reply (XDR *xdrs, ndmp2_tape_close_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
@@ -487,21 +571,22 @@ xdr_ndmp2_tape_get_state_reply (XDR *xdrs, ndmp2_tape_get_state_reply *objp)
 {
        register int32_t *buf;
 
+
        if (xdrs->x_op == XDR_ENCODE) {
-               if (!xdr_ndmp2_error (xdrs, &objp->error))
-                       return FALSE;
+                if (!xdr_ndmp2_error (xdrs, &objp->error))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->file_num))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->soft_errors))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->block_size))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->blockno))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->file_num))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->soft_errors))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->block_size))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->blockno))
+                                return FALSE;
 
                } else {
                IXDR_PUT_U_LONG(buf, objp->flags);
@@ -510,26 +595,26 @@ xdr_ndmp2_tape_get_state_reply (XDR *xdrs, ndmp2_tape_get_state_reply *objp)
                IXDR_PUT_U_LONG(buf, objp->block_size);
                IXDR_PUT_U_LONG(buf, objp->blockno);
                }
-               if (!xdr_ndmp2_u_quad (xdrs, &objp->total_space))
-                       return FALSE;
-               if (!xdr_ndmp2_u_quad (xdrs, &objp->space_remain))
-                       return FALSE;
+                if (!xdr_ndmp2_u_quad (xdrs, &objp->total_space))
+                        return FALSE;
+                if (!xdr_ndmp2_u_quad (xdrs, &objp->space_remain))
+                        return FALSE;
                return TRUE;
        } else if (xdrs->x_op == XDR_DECODE) {
-               if (!xdr_ndmp2_error (xdrs, &objp->error))
-                       return FALSE;
+                if (!xdr_ndmp2_error (xdrs, &objp->error))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->file_num))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->soft_errors))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->block_size))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->blockno))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->file_num))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->soft_errors))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->block_size))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->blockno))
+                                return FALSE;
 
                } else {
                objp->flags = IXDR_GET_U_LONG(buf);
@@ -538,193 +623,225 @@ xdr_ndmp2_tape_get_state_reply (XDR *xdrs, ndmp2_tape_get_state_reply *objp)
                objp->block_size = IXDR_GET_U_LONG(buf);
                objp->blockno = IXDR_GET_U_LONG(buf);
                }
-               if (!xdr_ndmp2_u_quad (xdrs, &objp->total_space))
-                       return FALSE;
-               if (!xdr_ndmp2_u_quad (xdrs, &objp->space_remain))
-                       return FALSE;
-               return TRUE;
+                if (!xdr_ndmp2_u_quad (xdrs, &objp->total_space))
+                        return FALSE;
+                if (!xdr_ndmp2_u_quad (xdrs, &objp->space_remain))
+                        return FALSE;
+        return TRUE;
        }
 
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->flags))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->file_num))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->soft_errors))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->block_size))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->blockno))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->total_space))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->space_remain))
-               return FALSE;
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->flags))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->file_num))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->soft_errors))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->block_size))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->blockno))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->total_space))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->space_remain))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_mtio_op (XDR *xdrs, ndmp2_tape_mtio_op *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_mtio_request (XDR *xdrs, ndmp2_tape_mtio_request *objp)
 {
-       if (!xdr_ndmp2_tape_mtio_op (xdrs, &objp->tape_op))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_tape_mtio_op (xdrs, &objp->tape_op))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_mtio_reply (XDR *xdrs, ndmp2_tape_mtio_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->resid_count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->resid_count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_write_request (XDR *xdrs, ndmp2_tape_write_request *objp)
 {
-       if (!xdr_bytes (xdrs, (char **)&objp->data_out.data_out_val, (u_int *) &objp->data_out.data_out_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_bytes (xdrs, (char **)&objp->data_out.data_out_val, (u_int *) &objp->data_out.data_out_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_write_reply (XDR *xdrs, ndmp2_tape_write_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_read_request (XDR *xdrs, ndmp2_tape_read_request *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_read_reply (XDR *xdrs, ndmp2_tape_read_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->data_in.data_in_val, (u_int *) &objp->data_in.data_in_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->data_in.data_in_val, (u_int *) &objp->data_in.data_in_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_execute_cdb_request (XDR *xdrs, ndmp2_tape_execute_cdb_request *objp)
 {
-       if (!xdr_ndmp2_execute_cdb_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_execute_cdb_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_tape_execute_cdb_reply (XDR *xdrs, ndmp2_tape_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp2_execute_cdb_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_execute_cdb_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_state (XDR *xdrs, ndmp2_mover_state *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_pause_reason (XDR *xdrs, ndmp2_mover_pause_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_halt_reason (XDR *xdrs, ndmp2_mover_halt_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_get_state_reply (XDR *xdrs, ndmp2_mover_get_state_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp2_mover_state (xdrs, &objp->state))
-               return FALSE;
-       if (!xdr_ndmp2_mover_pause_reason (xdrs, &objp->pause_reason))
-               return FALSE;
-       if (!xdr_ndmp2_mover_halt_reason (xdrs, &objp->halt_reason))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->record_size))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->record_num))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->data_written))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->seek_position))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->bytes_left_to_read))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->window_offset))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->window_length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp2_mover_state (xdrs, &objp->state))
+                return FALSE;
+        if (!xdr_ndmp2_mover_pause_reason (xdrs, &objp->pause_reason))
+                return FALSE;
+        if (!xdr_ndmp2_mover_halt_reason (xdrs, &objp->halt_reason))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->record_size))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->record_num))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->data_written))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->seek_position))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->bytes_left_to_read))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->window_offset))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->window_length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_mode (XDR *xdrs, ndmp2_mover_mode *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_tcp_addr (XDR *xdrs, ndmp2_mover_tcp_addr *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->ip_addr))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->port))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->ip_addr))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->port))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_addr (XDR *xdrs, ndmp2_mover_addr *objp)
 {
-       if (!xdr_ndmp2_mover_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_mover_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        switch (objp->addr_type) {
        case NDMP2_ADDR_LOCAL:
                break;
        case NDMP2_ADDR_TCP:
-               if (!xdr_ndmp2_mover_tcp_addr (xdrs, &objp->ndmp2_mover_addr_u.addr))
-                       return FALSE;
+                if (!xdr_ndmp2_mover_tcp_addr (xdrs, &objp->ndmp2_mover_addr_u.addr))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -735,370 +852,446 @@ xdr_ndmp2_mover_addr (XDR *xdrs, ndmp2_mover_addr *objp)
 bool_t
 xdr_ndmp2_mover_listen_request (XDR *xdrs, ndmp2_mover_listen_request *objp)
 {
-       if (!xdr_ndmp2_mover_mode (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp2_mover_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_mover_mode (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp2_mover_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_listen_reply (XDR *xdrs, ndmp2_mover_listen_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp2_mover_addr (xdrs, &objp->mover))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp2_mover_addr (xdrs, &objp->mover))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_set_record_size_request (XDR *xdrs, ndmp2_mover_set_record_size_request *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->len))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->len))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_set_record_size_reply (XDR *xdrs, ndmp2_mover_set_record_size_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_set_window_request (XDR *xdrs, ndmp2_mover_set_window_request *objp)
 {
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_set_window_reply (XDR *xdrs, ndmp2_mover_set_window_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_continue_reply (XDR *xdrs, ndmp2_mover_continue_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_abort_reply (XDR *xdrs, ndmp2_mover_abort_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_stop_reply (XDR *xdrs, ndmp2_mover_stop_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_read_request (XDR *xdrs, ndmp2_mover_read_request *objp)
 {
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_read_reply (XDR *xdrs, ndmp2_mover_read_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_mover_close_reply (XDR *xdrs, ndmp2_mover_close_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_operation (XDR *xdrs, ndmp2_data_operation *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_state (XDR *xdrs, ndmp2_data_state *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_halt_reason (XDR *xdrs, ndmp2_data_halt_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_get_state_reply (XDR *xdrs, ndmp2_data_get_state_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp2_data_operation (xdrs, &objp->operation))
-               return FALSE;
-       if (!xdr_ndmp2_data_state (xdrs, &objp->state))
-               return FALSE;
-       if (!xdr_ndmp2_data_halt_reason (xdrs, &objp->halt_reason))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->bytes_processed))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->est_bytes_remain))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->est_time_remain))
-               return FALSE;
-       if (!xdr_ndmp2_mover_addr (xdrs, &objp->mover))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->read_offset))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->read_length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp2_data_operation (xdrs, &objp->operation))
+                return FALSE;
+        if (!xdr_ndmp2_data_state (xdrs, &objp->state))
+                return FALSE;
+        if (!xdr_ndmp2_data_halt_reason (xdrs, &objp->halt_reason))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->bytes_processed))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->est_bytes_remain))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->est_time_remain))
+                return FALSE;
+        if (!xdr_ndmp2_mover_addr (xdrs, &objp->mover))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->read_offset))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->read_length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_start_backup_request (XDR *xdrs, ndmp2_data_start_backup_request *objp)
 {
-       if (!xdr_ndmp2_mover_addr (xdrs, &objp->mover))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->bu_type, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_mover_addr (xdrs, &objp->mover))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->bu_type, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp2_pval), (xdrproc_t) xdr_ndmp2_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_start_backup_reply (XDR *xdrs, ndmp2_data_start_backup_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_name (XDR *xdrs, ndmp2_name *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->dest, ~0))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->ssid))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->fh_info))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->dest, ~0))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->ssid))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->fh_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_start_recover_request (XDR *xdrs, ndmp2_data_start_recover_request *objp)
 {
-       if (!xdr_ndmp2_mover_addr (xdrs, &objp->mover))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_mover_addr (xdrs, &objp->mover))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp2_pval), (xdrproc_t) xdr_ndmp2_pval))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
                sizeof (ndmp2_name), (xdrproc_t) xdr_ndmp2_name))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->bu_type, ~0))
-               return FALSE;
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->bu_type, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_start_recover_reply (XDR *xdrs, ndmp2_data_start_recover_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_start_recover_filehist_request (XDR *xdrs, ndmp2_data_start_recover_filehist_request *objp)
 {
-       if (!xdr_ndmp2_data_start_recover_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_data_start_recover_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_start_recover_filehist_reply (XDR *xdrs, ndmp2_data_start_recover_filehist_reply *objp)
 {
-       if (!xdr_ndmp2_data_start_recover_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_data_start_recover_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_abort_reply (XDR *xdrs, ndmp2_data_abort_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_stop_reply (XDR *xdrs, ndmp2_data_stop_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_data_get_env_reply (XDR *xdrs, ndmp2_data_get_env_reply *objp)
 {
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp2_pval), (xdrproc_t) xdr_ndmp2_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_notify_data_halted_request (XDR *xdrs, ndmp2_notify_data_halted_request *objp)
 {
-       if (!xdr_ndmp2_data_halt_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->text_reason, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_data_halt_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->text_reason, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_connect_reason (XDR *xdrs, ndmp2_connect_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_notify_connected_request (XDR *xdrs, ndmp2_notify_connected_request *objp)
 {
-       if (!xdr_ndmp2_connect_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->protocol_version))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->text_reason, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_connect_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->protocol_version))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->text_reason, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_notify_mover_paused_request (XDR *xdrs, ndmp2_notify_mover_paused_request *objp)
 {
-       if (!xdr_ndmp2_mover_pause_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->seek_position))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_mover_pause_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->seek_position))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_notify_mover_halted_request (XDR *xdrs, ndmp2_notify_mover_halted_request *objp)
 {
-       if (!xdr_ndmp2_mover_halt_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->text_reason, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_mover_halt_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->text_reason, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_notify_data_read_request (XDR *xdrs, ndmp2_notify_data_read_request *objp)
 {
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_log_log_request (XDR *xdrs, ndmp2_log_log_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->entry, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->entry, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_debug_level (XDR *xdrs, ndmp2_debug_level *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_log_debug_request (XDR *xdrs, ndmp2_log_debug_request *objp)
 {
-       if (!xdr_ndmp2_debug_level (xdrs, &objp->level))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->message, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_debug_level (xdrs, &objp->level))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->message, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_log_file_request (XDR *xdrs, ndmp2_log_file_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->ssid))
-               return FALSE;
-       if (!xdr_ndmp2_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->ssid))
+                return FALSE;
+        if (!xdr_ndmp2_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_unix_path (XDR *xdrs, ndmp2_unix_path *objp)
 {
-       if (!xdr_string (xdrs, objp, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, objp, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_unix_file_type (XDR *xdrs, ndmp2_unix_file_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
@@ -1107,23 +1300,24 @@ xdr_ndmp2_unix_file_stat (XDR *xdrs, ndmp2_unix_file_stat *objp)
 {
        register int32_t *buf;
 
+
        if (xdrs->x_op == XDR_ENCODE) {
-               if (!xdr_ndmp2_unix_file_type (xdrs, &objp->ftype))
-                       return FALSE;
+                if (!xdr_ndmp2_unix_file_type (xdrs, &objp->ftype))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->mtime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->atime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->ctime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->uid))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->gid))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->mode))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->mtime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->atime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->ctime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->uid))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->gid))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->mode))
+                                return FALSE;
 
                } else {
                IXDR_PUT_U_LONG(buf, objp->mtime);
@@ -1133,28 +1327,28 @@ xdr_ndmp2_unix_file_stat (XDR *xdrs, ndmp2_unix_file_stat *objp)
                IXDR_PUT_U_LONG(buf, objp->gid);
                IXDR_PUT_U_LONG(buf, objp->mode);
                }
-               if (!xdr_ndmp2_u_quad (xdrs, &objp->size))
-                       return FALSE;
-               if (!xdr_ndmp2_u_quad (xdrs, &objp->fh_info))
-                       return FALSE;
+                if (!xdr_ndmp2_u_quad (xdrs, &objp->size))
+                        return FALSE;
+                if (!xdr_ndmp2_u_quad (xdrs, &objp->fh_info))
+                        return FALSE;
                return TRUE;
        } else if (xdrs->x_op == XDR_DECODE) {
-               if (!xdr_ndmp2_unix_file_type (xdrs, &objp->ftype))
-                       return FALSE;
+                if (!xdr_ndmp2_unix_file_type (xdrs, &objp->ftype))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->mtime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->atime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->ctime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->uid))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->gid))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->mode))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->mtime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->atime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->ctime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->uid))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->gid))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->mode))
+                                return FALSE;
 
                } else {
                objp->mtime = IXDR_GET_U_LONG(buf);
@@ -1164,90 +1358,102 @@ xdr_ndmp2_unix_file_stat (XDR *xdrs, ndmp2_unix_file_stat *objp)
                objp->gid = IXDR_GET_U_LONG(buf);
                objp->mode = IXDR_GET_U_LONG(buf);
                }
-               if (!xdr_ndmp2_u_quad (xdrs, &objp->size))
-                       return FALSE;
-               if (!xdr_ndmp2_u_quad (xdrs, &objp->fh_info))
-                       return FALSE;
-               return TRUE;
+                if (!xdr_ndmp2_u_quad (xdrs, &objp->size))
+                        return FALSE;
+                if (!xdr_ndmp2_u_quad (xdrs, &objp->fh_info))
+                        return FALSE;
+        return TRUE;
        }
 
-       if (!xdr_ndmp2_unix_file_type (xdrs, &objp->ftype))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->mtime))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->atime))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->ctime))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->uid))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->gid))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->size))
-               return FALSE;
-       if (!xdr_ndmp2_u_quad (xdrs, &objp->fh_info))
-               return FALSE;
+        if (!xdr_ndmp2_unix_file_type (xdrs, &objp->ftype))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->mtime))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->atime))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->ctime))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->uid))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->gid))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->size))
+                return FALSE;
+        if (!xdr_ndmp2_u_quad (xdrs, &objp->fh_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_fh_unix_path (XDR *xdrs, ndmp2_fh_unix_path *objp)
 {
-       if (!xdr_ndmp2_unix_path (xdrs, &objp->name))
-               return FALSE;
-       if (!xdr_ndmp2_unix_file_stat (xdrs, &objp->fstat))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_unix_path (xdrs, &objp->name))
+                return FALSE;
+        if (!xdr_ndmp2_unix_file_stat (xdrs, &objp->fstat))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_fh_add_unix_path_request (XDR *xdrs, ndmp2_fh_add_unix_path_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->paths.paths_val, (u_int *) &objp->paths.paths_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->paths.paths_val, (u_int *) &objp->paths.paths_len, ~0,
                sizeof (ndmp2_fh_unix_path), (xdrproc_t) xdr_ndmp2_fh_unix_path))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_fh_unix_dir (XDR *xdrs, ndmp2_fh_unix_dir *objp)
 {
-       if (!xdr_ndmp2_unix_path (xdrs, &objp->name))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->parent))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_unix_path (xdrs, &objp->name))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->parent))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_fh_add_unix_dir_request (XDR *xdrs, ndmp2_fh_add_unix_dir_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->dirs.dirs_val, (u_int *) &objp->dirs.dirs_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->dirs.dirs_val, (u_int *) &objp->dirs.dirs_len, ~0,
                sizeof (ndmp2_fh_unix_dir), (xdrproc_t) xdr_ndmp2_fh_unix_dir))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_fh_unix_node (XDR *xdrs, ndmp2_fh_unix_node *objp)
 {
-       if (!xdr_ndmp2_unix_file_stat (xdrs, &objp->fstat))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->node))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp2_unix_file_stat (xdrs, &objp->fstat))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->node))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp2_fh_add_unix_node_request (XDR *xdrs, ndmp2_fh_add_unix_node_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->nodes.nodes_val, (u_int *) &objp->nodes.nodes_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->nodes.nodes_val, (u_int *) &objp->nodes.nodes_len, ~0,
                sizeof (ndmp2_fh_unix_node), (xdrproc_t) xdr_ndmp2_fh_unix_node))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 #endif /* !NDMOS_OPTION_NO_NDMP2 */
index 621c665ecd0089ea4d3feab7e1dd96dd7a0938c9..c5484affff1b57ca5ed8a8bdbcccae19c5416d69 100644 (file)
@@ -11,124 +11,149 @@ extern bool_t xdr_ndmp3_u_quad();
 bool_t
 xdr__ndmp3_u_quad (XDR *xdrs, _ndmp3_u_quad *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->high))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->low))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->high))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->low))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_pval (XDR *xdrs, ndmp3_pval *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->value, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->value, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_error (XDR *xdrs, ndmp3_error *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_header_message_type (XDR *xdrs, ndmp3_header_message_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_message (XDR *xdrs, ndmp3_message *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_header (XDR *xdrs, ndmp3_header *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->sequence))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->time_stamp))
-               return FALSE;
-       if (!xdr_ndmp3_header_message_type (xdrs, &objp->message_type))
-               return FALSE;
-       if (!xdr_ndmp3_message (xdrs, &objp->message))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->reply_sequence))
-               return FALSE;
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->sequence))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->time_stamp))
+                return FALSE;
+        if (!xdr_ndmp3_header_message_type (xdrs, &objp->message_type))
+                return FALSE;
+        if (!xdr_ndmp3_message (xdrs, &objp->message))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->reply_sequence))
+                return FALSE;
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_connect_open_request (XDR *xdrs, ndmp3_connect_open_request *objp)
 {
-       if (!xdr_u_short (xdrs, &objp->protocol_version))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_short (xdrs, &objp->protocol_version))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_connect_open_reply (XDR *xdrs, ndmp3_connect_open_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_auth_type (XDR *xdrs, ndmp3_auth_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_auth_text (XDR *xdrs, ndmp3_auth_text *objp)
 {
-       if (!xdr_string (xdrs, &objp->auth_id, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->auth_password, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->auth_id, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->auth_password, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_auth_md5 (XDR *xdrs, ndmp3_auth_md5 *objp)
 {
-       if (!xdr_string (xdrs, &objp->auth_id, ~0))
-               return FALSE;
-       if (!xdr_opaque (xdrs, objp->auth_digest, 16))
-               return FALSE;
+       register int32_t *buf;
+
+       int i;
+        if (!xdr_string (xdrs, &objp->auth_id, ~0))
+                return FALSE;
+        if (!xdr_opaque (xdrs, objp->auth_digest, 16))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_auth_data (XDR *xdrs, ndmp3_auth_data *objp)
 {
-       if (!xdr_ndmp3_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        switch (objp->auth_type) {
        case NDMP3_AUTH_NONE:
                break;
        case NDMP3_AUTH_TEXT:
-               if (!xdr_ndmp3_auth_text (xdrs, &objp->ndmp3_auth_data_u.auth_text))
-                       return FALSE;
+                if (!xdr_ndmp3_auth_text (xdrs, &objp->ndmp3_auth_data_u.auth_text))
+                        return FALSE;
                break;
        case NDMP3_AUTH_MD5:
-               if (!xdr_ndmp3_auth_md5 (xdrs, &objp->ndmp3_auth_data_u.auth_md5))
-                       return FALSE;
+                if (!xdr_ndmp3_auth_md5 (xdrs, &objp->ndmp3_auth_data_u.auth_md5))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -139,32 +164,38 @@ xdr_ndmp3_auth_data (XDR *xdrs, ndmp3_auth_data *objp)
 bool_t
 xdr_ndmp3_connect_client_auth_request (XDR *xdrs, ndmp3_connect_client_auth_request *objp)
 {
-       if (!xdr_ndmp3_auth_data (xdrs, &objp->auth_data))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_auth_data (xdrs, &objp->auth_data))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_connect_client_auth_reply (XDR *xdrs, ndmp3_connect_client_auth_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_auth_attr (XDR *xdrs, ndmp3_auth_attr *objp)
 {
-       if (!xdr_ndmp3_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        switch (objp->auth_type) {
        case NDMP3_AUTH_NONE:
                break;
        case NDMP3_AUTH_TEXT:
                break;
        case NDMP3_AUTH_MD5:
-               if (!xdr_opaque (xdrs, objp->ndmp3_auth_attr_u.challenge, 64))
-                       return FALSE;
+                if (!xdr_opaque (xdrs, objp->ndmp3_auth_attr_u.challenge, 64))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -175,274 +206,322 @@ xdr_ndmp3_auth_attr (XDR *xdrs, ndmp3_auth_attr *objp)
 bool_t
 xdr_ndmp3_connect_server_auth_request (XDR *xdrs, ndmp3_connect_server_auth_request *objp)
 {
-       if (!xdr_ndmp3_auth_attr (xdrs, &objp->client_attr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_auth_attr (xdrs, &objp->client_attr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_connect_server_auth_reply (XDR *xdrs, ndmp3_connect_server_auth_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp3_auth_data (xdrs, &objp->server_result))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp3_auth_data (xdrs, &objp->server_result))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_config_get_host_info_reply (XDR *xdrs, ndmp3_config_get_host_info_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->hostname, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->os_type, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->os_vers, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->hostid, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->hostname, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->os_type, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->os_vers, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->hostid, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_addr_type (XDR *xdrs, ndmp3_addr_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_config_get_connection_type_reply (XDR *xdrs, ndmp3_config_get_connection_type_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->addr_types.addr_types_val, (u_int *) &objp->addr_types.addr_types_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->addr_types.addr_types_val, (u_int *) &objp->addr_types.addr_types_len, ~0,
                sizeof (ndmp3_addr_type), (xdrproc_t) xdr_ndmp3_addr_type))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_config_get_auth_attr_request (XDR *xdrs, ndmp3_config_get_auth_attr_request *objp)
 {
-       if (!xdr_ndmp3_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_config_get_auth_attr_reply (XDR *xdrs, ndmp3_config_get_auth_attr_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp3_auth_attr (xdrs, &objp->server_attr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp3_auth_attr (xdrs, &objp->server_attr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_config_get_server_info_reply (XDR *xdrs, ndmp3_config_get_server_info_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->vendor_name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->product_name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->revision_number, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->auth_type.auth_type_val, (u_int *) &objp->auth_type.auth_type_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->vendor_name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->product_name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->revision_number, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->auth_type.auth_type_val, (u_int *) &objp->auth_type.auth_type_len, ~0,
                sizeof (ndmp3_auth_type), (xdrproc_t) xdr_ndmp3_auth_type))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_butype_info (XDR *xdrs, ndmp3_butype_info *objp)
 {
-       if (!xdr_string (xdrs, &objp->butype_name, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->default_env.default_env_val, (u_int *) &objp->default_env.default_env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->butype_name, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->default_env.default_env_val, (u_int *) &objp->default_env.default_env_len, ~0,
                sizeof (ndmp3_pval), (xdrproc_t) xdr_ndmp3_pval))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->attrs))
-               return FALSE;
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->attrs))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_config_get_butype_info_reply (XDR *xdrs, ndmp3_config_get_butype_info_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->butype_info.butype_info_val, (u_int *) &objp->butype_info.butype_info_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->butype_info.butype_info_val, (u_int *) &objp->butype_info.butype_info_len, ~0,
                sizeof (ndmp3_butype_info), (xdrproc_t) xdr_ndmp3_butype_info))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_fs_info (XDR *xdrs, ndmp3_fs_info *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->invalid))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_type, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_logical_device, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_physical_device, ~0))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->total_size))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->used_size))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->avail_size))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->total_inodes))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->used_inodes))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->fs_env.fs_env_val, (u_int *) &objp->fs_env.fs_env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->invalid))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_type, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_logical_device, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_physical_device, ~0))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->total_size))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->used_size))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->avail_size))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->total_inodes))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->used_inodes))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->fs_env.fs_env_val, (u_int *) &objp->fs_env.fs_env_len, ~0,
                sizeof (ndmp3_pval), (xdrproc_t) xdr_ndmp3_pval))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_status, ~0))
-               return FALSE;
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_status, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_config_get_fs_info_reply (XDR *xdrs, ndmp3_config_get_fs_info_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->fs_info.fs_info_val, (u_int *) &objp->fs_info.fs_info_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->fs_info.fs_info_val, (u_int *) &objp->fs_info.fs_info_len, ~0,
                sizeof (ndmp3_fs_info), (xdrproc_t) xdr_ndmp3_fs_info))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_device_capability (XDR *xdrs, ndmp3_device_capability *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->attr))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->capability.capability_val, (u_int *) &objp->capability.capability_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->attr))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->capability.capability_val, (u_int *) &objp->capability.capability_len, ~0,
                sizeof (ndmp3_pval), (xdrproc_t) xdr_ndmp3_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_device_info (XDR *xdrs, ndmp3_device_info *objp)
 {
-       if (!xdr_string (xdrs, &objp->model, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->caplist.caplist_val, (u_int *) &objp->caplist.caplist_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->model, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->caplist.caplist_val, (u_int *) &objp->caplist.caplist_len, ~0,
                sizeof (ndmp3_device_capability), (xdrproc_t) xdr_ndmp3_device_capability))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_config_get_tape_info_reply (XDR *xdrs, ndmp3_config_get_tape_info_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->tape_info.tape_info_val, (u_int *) &objp->tape_info.tape_info_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->tape_info.tape_info_val, (u_int *) &objp->tape_info.tape_info_len, ~0,
                sizeof (ndmp3_device_info), (xdrproc_t) xdr_ndmp3_device_info))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_config_get_scsi_info_reply (XDR *xdrs, ndmp3_config_get_scsi_info_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->scsi_info.scsi_info_val, (u_int *) &objp->scsi_info.scsi_info_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->scsi_info.scsi_info_val, (u_int *) &objp->scsi_info.scsi_info_len, ~0,
                sizeof (ndmp3_device_info), (xdrproc_t) xdr_ndmp3_device_info))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_scsi_open_request (XDR *xdrs, ndmp3_scsi_open_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_scsi_open_reply (XDR *xdrs, ndmp3_scsi_open_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_scsi_close_reply (XDR *xdrs, ndmp3_scsi_close_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_scsi_get_state_reply (XDR *xdrs, ndmp3_scsi_get_state_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_controller))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_id))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_lun))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_controller))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_id))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_lun))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_scsi_set_target_request (XDR *xdrs, ndmp3_scsi_set_target_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->target_controller))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->target_id))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->target_lun))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->target_controller))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->target_id))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->target_lun))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_scsi_set_target_reply (XDR *xdrs, ndmp3_scsi_set_target_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_scsi_reset_device_reply (XDR *xdrs, ndmp3_scsi_reset_device_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_scsi_reset_bus_reply (XDR *xdrs, ndmp3_scsi_reset_bus_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
@@ -451,124 +530,139 @@ xdr_ndmp3_execute_cdb_request (XDR *xdrs, ndmp3_execute_cdb_request *objp)
 {
        register int32_t *buf;
 
+
        if (xdrs->x_op == XDR_ENCODE) {
                buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->timeout))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->datain_len))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->timeout))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->datain_len))
+                                return FALSE;
 
                } else {
                IXDR_PUT_U_LONG(buf, objp->flags);
                IXDR_PUT_U_LONG(buf, objp->timeout);
                IXDR_PUT_U_LONG(buf, objp->datain_len);
                }
-               if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
-                       return FALSE;
-               if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
-                       return FALSE;
+                if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
+                        return FALSE;
+                if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
+                        return FALSE;
                return TRUE;
        } else if (xdrs->x_op == XDR_DECODE) {
                buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->timeout))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->datain_len))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->timeout))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->datain_len))
+                                return FALSE;
 
                } else {
                objp->flags = IXDR_GET_U_LONG(buf);
                objp->timeout = IXDR_GET_U_LONG(buf);
                objp->datain_len = IXDR_GET_U_LONG(buf);
                }
-               if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
-                       return FALSE;
-               if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
-                       return FALSE;
-               return TRUE;
+                if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
+                        return FALSE;
+                if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
+                        return FALSE;
+        return TRUE;
        }
 
-       if (!xdr_u_long (xdrs, &objp->flags))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->timeout))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->datain_len))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
-               return FALSE;
+        if (!xdr_u_long (xdrs, &objp->flags))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->timeout))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->datain_len))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_execute_cdb_reply (XDR *xdrs, ndmp3_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_char (xdrs, &objp->status))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->dataout_len))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->datain.datain_val, (u_int *) &objp->datain.datain_len, ~0))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->ext_sense.ext_sense_val, (u_int *) &objp->ext_sense.ext_sense_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_char (xdrs, &objp->status))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->dataout_len))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->datain.datain_val, (u_int *) &objp->datain.datain_len, ~0))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->ext_sense.ext_sense_val, (u_int *) &objp->ext_sense.ext_sense_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_scsi_execute_cdb_request (XDR *xdrs, ndmp3_scsi_execute_cdb_request *objp)
 {
-       if (!xdr_ndmp3_execute_cdb_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_execute_cdb_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_scsi_execute_cdb_reply (XDR *xdrs, ndmp3_scsi_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp3_execute_cdb_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_execute_cdb_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_open_mode (XDR *xdrs, ndmp3_tape_open_mode *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_open_request (XDR *xdrs, ndmp3_tape_open_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
-       if (!xdr_ndmp3_tape_open_mode (xdrs, &objp->mode))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
+        if (!xdr_ndmp3_tape_open_mode (xdrs, &objp->mode))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_open_reply (XDR *xdrs, ndmp3_tape_open_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_close_reply (XDR *xdrs, ndmp3_tape_close_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
@@ -577,23 +671,24 @@ xdr_ndmp3_tape_get_state_reply (XDR *xdrs, ndmp3_tape_get_state_reply *objp)
 {
        register int32_t *buf;
 
+
        if (xdrs->x_op == XDR_ENCODE) {
-               if (!xdr_u_long (xdrs, &objp->invalid))
-                       return FALSE;
-               if (!xdr_ndmp3_error (xdrs, &objp->error))
-                       return FALSE;
+                if (!xdr_u_long (xdrs, &objp->invalid))
+                        return FALSE;
+                if (!xdr_ndmp3_error (xdrs, &objp->error))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->file_num))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->soft_errors))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->block_size))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->blockno))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->file_num))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->soft_errors))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->block_size))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->blockno))
+                                return FALSE;
 
                } else {
                IXDR_PUT_U_LONG(buf, objp->flags);
@@ -602,30 +697,30 @@ xdr_ndmp3_tape_get_state_reply (XDR *xdrs, ndmp3_tape_get_state_reply *objp)
                IXDR_PUT_U_LONG(buf, objp->block_size);
                IXDR_PUT_U_LONG(buf, objp->blockno);
                }
-               if (!xdr_ndmp3_u_quad (xdrs, &objp->total_space))
-                       return FALSE;
-               if (!xdr_ndmp3_u_quad (xdrs, &objp->space_remain))
-                       return FALSE;
-               if (!xdr_u_long (xdrs, &objp->partition))
-                       return FALSE;
+                if (!xdr_ndmp3_u_quad (xdrs, &objp->total_space))
+                        return FALSE;
+                if (!xdr_ndmp3_u_quad (xdrs, &objp->space_remain))
+                        return FALSE;
+                if (!xdr_u_long (xdrs, &objp->partition))
+                        return FALSE;
                return TRUE;
        } else if (xdrs->x_op == XDR_DECODE) {
-               if (!xdr_u_long (xdrs, &objp->invalid))
-                       return FALSE;
-               if (!xdr_ndmp3_error (xdrs, &objp->error))
-                       return FALSE;
+                if (!xdr_u_long (xdrs, &objp->invalid))
+                        return FALSE;
+                if (!xdr_ndmp3_error (xdrs, &objp->error))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->file_num))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->soft_errors))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->block_size))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->blockno))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->file_num))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->soft_errors))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->block_size))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->blockno))
+                                return FALSE;
 
                } else {
                objp->flags = IXDR_GET_U_LONG(buf);
@@ -634,195 +729,229 @@ xdr_ndmp3_tape_get_state_reply (XDR *xdrs, ndmp3_tape_get_state_reply *objp)
                objp->block_size = IXDR_GET_U_LONG(buf);
                objp->blockno = IXDR_GET_U_LONG(buf);
                }
-               if (!xdr_ndmp3_u_quad (xdrs, &objp->total_space))
-                       return FALSE;
-               if (!xdr_ndmp3_u_quad (xdrs, &objp->space_remain))
-                       return FALSE;
-               if (!xdr_u_long (xdrs, &objp->partition))
-                       return FALSE;
-               return TRUE;
+                if (!xdr_ndmp3_u_quad (xdrs, &objp->total_space))
+                        return FALSE;
+                if (!xdr_ndmp3_u_quad (xdrs, &objp->space_remain))
+                        return FALSE;
+                if (!xdr_u_long (xdrs, &objp->partition))
+                        return FALSE;
+        return TRUE;
        }
 
-       if (!xdr_u_long (xdrs, &objp->invalid))
-               return FALSE;
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->flags))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->file_num))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->soft_errors))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->block_size))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->blockno))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->total_space))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->space_remain))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->partition))
-               return FALSE;
+        if (!xdr_u_long (xdrs, &objp->invalid))
+                return FALSE;
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->flags))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->file_num))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->soft_errors))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->block_size))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->blockno))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->total_space))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->space_remain))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->partition))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_mtio_op (XDR *xdrs, ndmp3_tape_mtio_op *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_mtio_request (XDR *xdrs, ndmp3_tape_mtio_request *objp)
 {
-       if (!xdr_ndmp3_tape_mtio_op (xdrs, &objp->tape_op))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_tape_mtio_op (xdrs, &objp->tape_op))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_mtio_reply (XDR *xdrs, ndmp3_tape_mtio_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->resid_count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->resid_count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_write_request (XDR *xdrs, ndmp3_tape_write_request *objp)
 {
-       if (!xdr_bytes (xdrs, (char **)&objp->data_out.data_out_val, (u_int *) &objp->data_out.data_out_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_bytes (xdrs, (char **)&objp->data_out.data_out_val, (u_int *) &objp->data_out.data_out_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_write_reply (XDR *xdrs, ndmp3_tape_write_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_read_request (XDR *xdrs, ndmp3_tape_read_request *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_read_reply (XDR *xdrs, ndmp3_tape_read_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->data_in.data_in_val, (u_int *) &objp->data_in.data_in_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->data_in.data_in_val, (u_int *) &objp->data_in.data_in_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_execute_cdb_request (XDR *xdrs, ndmp3_tape_execute_cdb_request *objp)
 {
-       if (!xdr_ndmp3_execute_cdb_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_execute_cdb_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tape_execute_cdb_reply (XDR *xdrs, ndmp3_tape_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp3_execute_cdb_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_execute_cdb_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_state (XDR *xdrs, ndmp3_mover_state *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_pause_reason (XDR *xdrs, ndmp3_mover_pause_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_halt_reason (XDR *xdrs, ndmp3_mover_halt_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_mode (XDR *xdrs, ndmp3_mover_mode *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_tcp_addr (XDR *xdrs, ndmp3_tcp_addr *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->ip_addr))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->port))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->ip_addr))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->port))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_fc_addr (XDR *xdrs, ndmp3_fc_addr *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->loop_id))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->loop_id))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_ipc_addr (XDR *xdrs, ndmp3_ipc_addr *objp)
 {
-       if (!xdr_bytes (xdrs, (char **)&objp->comm_data.comm_data_val, (u_int *) &objp->comm_data.comm_data_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_bytes (xdrs, (char **)&objp->comm_data.comm_data_val, (u_int *) &objp->comm_data.comm_data_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_addr (XDR *xdrs, ndmp3_addr *objp)
 {
-       if (!xdr_ndmp3_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        switch (objp->addr_type) {
        case NDMP3_ADDR_LOCAL:
                break;
        case NDMP3_ADDR_TCP:
-               if (!xdr_ndmp3_tcp_addr (xdrs, &objp->ndmp3_addr_u.tcp_addr))
-                       return FALSE;
+                if (!xdr_ndmp3_tcp_addr (xdrs, &objp->ndmp3_addr_u.tcp_addr))
+                        return FALSE;
                break;
        case NDMP3_ADDR_FC:
-               if (!xdr_ndmp3_fc_addr (xdrs, &objp->ndmp3_addr_u.fc_addr))
-                       return FALSE;
+                if (!xdr_ndmp3_fc_addr (xdrs, &objp->ndmp3_addr_u.fc_addr))
+                        return FALSE;
                break;
        case NDMP3_ADDR_IPC:
-               if (!xdr_ndmp3_ipc_addr (xdrs, &objp->ndmp3_addr_u.ipc_addr))
-                       return FALSE;
+                if (!xdr_ndmp3_ipc_addr (xdrs, &objp->ndmp3_addr_u.ipc_addr))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -833,476 +962,568 @@ xdr_ndmp3_addr (XDR *xdrs, ndmp3_addr *objp)
 bool_t
 xdr_ndmp3_mover_get_state_reply (XDR *xdrs, ndmp3_mover_get_state_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp3_mover_state (xdrs, &objp->state))
-               return FALSE;
-       if (!xdr_ndmp3_mover_pause_reason (xdrs, &objp->pause_reason))
-               return FALSE;
-       if (!xdr_ndmp3_mover_halt_reason (xdrs, &objp->halt_reason))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->record_size))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->record_num))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->data_written))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->seek_position))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->bytes_left_to_read))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->window_offset))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->window_length))
-               return FALSE;
-       if (!xdr_ndmp3_addr (xdrs, &objp->data_connection_addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp3_mover_state (xdrs, &objp->state))
+                return FALSE;
+        if (!xdr_ndmp3_mover_pause_reason (xdrs, &objp->pause_reason))
+                return FALSE;
+        if (!xdr_ndmp3_mover_halt_reason (xdrs, &objp->halt_reason))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->record_size))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->record_num))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->data_written))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->seek_position))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->bytes_left_to_read))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->window_offset))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->window_length))
+                return FALSE;
+        if (!xdr_ndmp3_addr (xdrs, &objp->data_connection_addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_listen_request (XDR *xdrs, ndmp3_mover_listen_request *objp)
 {
-       if (!xdr_ndmp3_mover_mode (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp3_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_mover_mode (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp3_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_listen_reply (XDR *xdrs, ndmp3_mover_listen_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp3_addr (xdrs, &objp->data_connection_addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp3_addr (xdrs, &objp->data_connection_addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_connect_request (XDR *xdrs, ndmp3_mover_connect_request *objp)
 {
-       if (!xdr_ndmp3_mover_mode (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp3_addr (xdrs, &objp->addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_mover_mode (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp3_addr (xdrs, &objp->addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_connect_reply (XDR *xdrs, ndmp3_mover_connect_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_set_record_size_request (XDR *xdrs, ndmp3_mover_set_record_size_request *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->len))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->len))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_set_record_size_reply (XDR *xdrs, ndmp3_mover_set_record_size_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_set_window_request (XDR *xdrs, ndmp3_mover_set_window_request *objp)
 {
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_set_window_reply (XDR *xdrs, ndmp3_mover_set_window_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_continue_reply (XDR *xdrs, ndmp3_mover_continue_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_abort_reply (XDR *xdrs, ndmp3_mover_abort_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_stop_reply (XDR *xdrs, ndmp3_mover_stop_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_read_request (XDR *xdrs, ndmp3_mover_read_request *objp)
 {
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_read_reply (XDR *xdrs, ndmp3_mover_read_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_mover_close_reply (XDR *xdrs, ndmp3_mover_close_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_operation (XDR *xdrs, ndmp3_data_operation *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_state (XDR *xdrs, ndmp3_data_state *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_halt_reason (XDR *xdrs, ndmp3_data_halt_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_get_state_reply (XDR *xdrs, ndmp3_data_get_state_reply *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->invalid))
-               return FALSE;
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp3_data_operation (xdrs, &objp->operation))
-               return FALSE;
-       if (!xdr_ndmp3_data_state (xdrs, &objp->state))
-               return FALSE;
-       if (!xdr_ndmp3_data_halt_reason (xdrs, &objp->halt_reason))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->bytes_processed))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->est_bytes_remain))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->est_time_remain))
-               return FALSE;
-       if (!xdr_ndmp3_addr (xdrs, &objp->data_connection_addr))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->read_offset))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->read_length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->invalid))
+                return FALSE;
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp3_data_operation (xdrs, &objp->operation))
+                return FALSE;
+        if (!xdr_ndmp3_data_state (xdrs, &objp->state))
+                return FALSE;
+        if (!xdr_ndmp3_data_halt_reason (xdrs, &objp->halt_reason))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->bytes_processed))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->est_bytes_remain))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->est_time_remain))
+                return FALSE;
+        if (!xdr_ndmp3_addr (xdrs, &objp->data_connection_addr))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->read_offset))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->read_length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_start_backup_request (XDR *xdrs, ndmp3_data_start_backup_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->bu_type, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->bu_type, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp3_pval), (xdrproc_t) xdr_ndmp3_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_start_backup_reply (XDR *xdrs, ndmp3_data_start_backup_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_name (XDR *xdrs, ndmp3_name *objp)
 {
-       if (!xdr_string (xdrs, &objp->original_path, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->destination_dir, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->new_name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->other_name, ~0))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->fh_info))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->original_path, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->destination_dir, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->new_name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->other_name, ~0))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->fh_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_start_recover_request (XDR *xdrs, ndmp3_data_start_recover_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp3_pval), (xdrproc_t) xdr_ndmp3_pval))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
                sizeof (ndmp3_name), (xdrproc_t) xdr_ndmp3_name))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->bu_type, ~0))
-               return FALSE;
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->bu_type, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_start_recover_reply (XDR *xdrs, ndmp3_data_start_recover_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_start_recover_filehist_request (XDR *xdrs, ndmp3_data_start_recover_filehist_request *objp)
 {
-       if (!xdr_ndmp3_data_start_recover_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_data_start_recover_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_start_recover_filehist_reply (XDR *xdrs, ndmp3_data_start_recover_filehist_reply *objp)
 {
-       if (!xdr_ndmp3_data_start_recover_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_data_start_recover_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_abort_reply (XDR *xdrs, ndmp3_data_abort_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_stop_reply (XDR *xdrs, ndmp3_data_stop_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_get_env_reply (XDR *xdrs, ndmp3_data_get_env_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp3_pval), (xdrproc_t) xdr_ndmp3_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_listen_request (XDR *xdrs, ndmp3_data_listen_request *objp)
 {
-       if (!xdr_ndmp3_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_listen_reply (XDR *xdrs, ndmp3_data_listen_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp3_addr (xdrs, &objp->data_connection_addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp3_addr (xdrs, &objp->data_connection_addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_connect_request (XDR *xdrs, ndmp3_data_connect_request *objp)
 {
-       if (!xdr_ndmp3_addr (xdrs, &objp->addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_addr (xdrs, &objp->addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_data_connect_reply (XDR *xdrs, ndmp3_data_connect_reply *objp)
 {
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_notify_data_halted_request (XDR *xdrs, ndmp3_notify_data_halted_request *objp)
 {
-       if (!xdr_ndmp3_data_halt_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->text_reason, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_data_halt_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->text_reason, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_connect_reason (XDR *xdrs, ndmp3_connect_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_notify_connected_request (XDR *xdrs, ndmp3_notify_connected_request *objp)
 {
-       if (!xdr_ndmp3_connect_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->protocol_version))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->text_reason, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_connect_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->protocol_version))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->text_reason, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_notify_mover_paused_request (XDR *xdrs, ndmp3_notify_mover_paused_request *objp)
 {
-       if (!xdr_ndmp3_mover_pause_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->seek_position))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_mover_pause_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->seek_position))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_notify_mover_halted_request (XDR *xdrs, ndmp3_notify_mover_halted_request *objp)
 {
-       if (!xdr_ndmp3_mover_halt_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->text_reason, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_mover_halt_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->text_reason, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_notify_data_read_request (XDR *xdrs, ndmp3_notify_data_read_request *objp)
 {
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_log_type (XDR *xdrs, ndmp3_log_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_log_message_request (XDR *xdrs, ndmp3_log_message_request *objp)
 {
-       if (!xdr_ndmp3_log_type (xdrs, &objp->log_type))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->message_id))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->entry, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_log_type (xdrs, &objp->log_type))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->message_id))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->entry, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_log_file_request (XDR *xdrs, ndmp3_log_file_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
-       if (!xdr_ndmp3_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
+        if (!xdr_ndmp3_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_fs_type (XDR *xdrs, ndmp3_fs_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_path (XDR *xdrs, ndmp3_path *objp)
 {
-       if (!xdr_string (xdrs, objp, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, objp, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_nt_path (XDR *xdrs, ndmp3_nt_path *objp)
 {
-       if (!xdr_ndmp3_path (xdrs, &objp->nt_path))
-               return FALSE;
-       if (!xdr_ndmp3_path (xdrs, &objp->dos_path))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_path (xdrs, &objp->nt_path))
+                return FALSE;
+        if (!xdr_ndmp3_path (xdrs, &objp->dos_path))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_file_name (XDR *xdrs, ndmp3_file_name *objp)
 {
-       if (!xdr_ndmp3_fs_type (xdrs, &objp->fs_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp3_fs_type (xdrs, &objp->fs_type))
+                return FALSE;
        switch (objp->fs_type) {
        case NDMP3_FS_UNIX:
-               if (!xdr_ndmp3_path (xdrs, &objp->ndmp3_file_name_u.unix_name))
-                       return FALSE;
+                if (!xdr_ndmp3_path (xdrs, &objp->ndmp3_file_name_u.unix_name))
+                        return FALSE;
                break;
        case NDMP3_FS_NT:
-               if (!xdr_ndmp3_nt_path (xdrs, &objp->ndmp3_file_name_u.nt_name))
-                       return FALSE;
+                if (!xdr_ndmp3_nt_path (xdrs, &objp->ndmp3_file_name_u.nt_name))
+                        return FALSE;
                break;
        default:
-               if (!xdr_ndmp3_path (xdrs, &objp->ndmp3_file_name_u.other_name))
-                       return FALSE;
+                if (!xdr_ndmp3_path (xdrs, &objp->ndmp3_file_name_u.other_name))
+                        return FALSE;
                break;
        }
        return TRUE;
@@ -1311,8 +1532,10 @@ xdr_ndmp3_file_name (XDR *xdrs, ndmp3_file_name *objp)
 bool_t
 xdr_ndmp3_file_type (XDR *xdrs, ndmp3_file_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
@@ -1321,27 +1544,28 @@ xdr_ndmp3_file_stat (XDR *xdrs, ndmp3_file_stat *objp)
 {
        register int32_t *buf;
 
+
        if (xdrs->x_op == XDR_ENCODE) {
-               if (!xdr_u_long (xdrs, &objp->invalid))
-                       return FALSE;
-               if (!xdr_ndmp3_fs_type (xdrs, &objp->fs_type))
-                       return FALSE;
-               if (!xdr_ndmp3_file_type (xdrs, &objp->ftype))
-                       return FALSE;
+                if (!xdr_u_long (xdrs, &objp->invalid))
+                        return FALSE;
+                if (!xdr_ndmp3_fs_type (xdrs, &objp->fs_type))
+                        return FALSE;
+                if (!xdr_ndmp3_file_type (xdrs, &objp->ftype))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->mtime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->atime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->ctime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->owner))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->group))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->fattr))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->mtime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->atime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->ctime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->owner))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->group))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->fattr))
+                                return FALSE;
 
                } else {
                IXDR_PUT_U_LONG(buf, objp->mtime);
@@ -1351,32 +1575,32 @@ xdr_ndmp3_file_stat (XDR *xdrs, ndmp3_file_stat *objp)
                IXDR_PUT_U_LONG(buf, objp->group);
                IXDR_PUT_U_LONG(buf, objp->fattr);
                }
-               if (!xdr_ndmp3_u_quad (xdrs, &objp->size))
-                       return FALSE;
-               if (!xdr_u_long (xdrs, &objp->links))
-                       return FALSE;
+                if (!xdr_ndmp3_u_quad (xdrs, &objp->size))
+                        return FALSE;
+                if (!xdr_u_long (xdrs, &objp->links))
+                        return FALSE;
                return TRUE;
        } else if (xdrs->x_op == XDR_DECODE) {
-               if (!xdr_u_long (xdrs, &objp->invalid))
-                       return FALSE;
-               if (!xdr_ndmp3_fs_type (xdrs, &objp->fs_type))
-                       return FALSE;
-               if (!xdr_ndmp3_file_type (xdrs, &objp->ftype))
-                       return FALSE;
+                if (!xdr_u_long (xdrs, &objp->invalid))
+                        return FALSE;
+                if (!xdr_ndmp3_fs_type (xdrs, &objp->fs_type))
+                        return FALSE;
+                if (!xdr_ndmp3_file_type (xdrs, &objp->ftype))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->mtime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->atime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->ctime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->owner))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->group))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->fattr))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->mtime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->atime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->ctime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->owner))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->group))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->fattr))
+                                return FALSE;
 
                } else {
                objp->mtime = IXDR_GET_U_LONG(buf);
@@ -1386,104 +1610,116 @@ xdr_ndmp3_file_stat (XDR *xdrs, ndmp3_file_stat *objp)
                objp->group = IXDR_GET_U_LONG(buf);
                objp->fattr = IXDR_GET_U_LONG(buf);
                }
-               if (!xdr_ndmp3_u_quad (xdrs, &objp->size))
-                       return FALSE;
-               if (!xdr_u_long (xdrs, &objp->links))
-                       return FALSE;
-               return TRUE;
+                if (!xdr_ndmp3_u_quad (xdrs, &objp->size))
+                        return FALSE;
+                if (!xdr_u_long (xdrs, &objp->links))
+                        return FALSE;
+        return TRUE;
        }
 
-       if (!xdr_u_long (xdrs, &objp->invalid))
-               return FALSE;
-       if (!xdr_ndmp3_fs_type (xdrs, &objp->fs_type))
-               return FALSE;
-       if (!xdr_ndmp3_file_type (xdrs, &objp->ftype))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->mtime))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->atime))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->ctime))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->owner))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->group))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->fattr))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->size))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->links))
-               return FALSE;
+        if (!xdr_u_long (xdrs, &objp->invalid))
+                return FALSE;
+        if (!xdr_ndmp3_fs_type (xdrs, &objp->fs_type))
+                return FALSE;
+        if (!xdr_ndmp3_file_type (xdrs, &objp->ftype))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->mtime))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->atime))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->ctime))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->owner))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->group))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->fattr))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->size))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->links))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_file (XDR *xdrs, ndmp3_file *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->names.names_val, (u_int *) &objp->names.names_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->names.names_val, (u_int *) &objp->names.names_len, ~0,
                sizeof (ndmp3_file_name), (xdrproc_t) xdr_ndmp3_file_name))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
                sizeof (ndmp3_file_stat), (xdrproc_t) xdr_ndmp3_file_stat))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->fh_info))
-               return FALSE;
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->fh_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_fh_add_file_request (XDR *xdrs, ndmp3_fh_add_file_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->files.files_val, (u_int *) &objp->files.files_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->files.files_val, (u_int *) &objp->files.files_len, ~0,
                sizeof (ndmp3_file), (xdrproc_t) xdr_ndmp3_file))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_dir (XDR *xdrs, ndmp3_dir *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->names.names_val, (u_int *) &objp->names.names_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->names.names_val, (u_int *) &objp->names.names_len, ~0,
                sizeof (ndmp3_file_name), (xdrproc_t) xdr_ndmp3_file_name))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->parent))
-               return FALSE;
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->parent))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_fh_add_dir_request (XDR *xdrs, ndmp3_fh_add_dir_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->dirs.dirs_val, (u_int *) &objp->dirs.dirs_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->dirs.dirs_val, (u_int *) &objp->dirs.dirs_len, ~0,
                sizeof (ndmp3_dir), (xdrproc_t) xdr_ndmp3_dir))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_node (XDR *xdrs, ndmp3_node *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
                sizeof (ndmp3_file_stat), (xdrproc_t) xdr_ndmp3_file_stat))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_ndmp3_u_quad (xdrs, &objp->fh_info))
-               return FALSE;
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_ndmp3_u_quad (xdrs, &objp->fh_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp3_fh_add_node_request (XDR *xdrs, ndmp3_fh_add_node_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->nodes.nodes_val, (u_int *) &objp->nodes.nodes_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->nodes.nodes_val, (u_int *) &objp->nodes.nodes_len, ~0,
                sizeof (ndmp3_node), (xdrproc_t) xdr_ndmp3_node))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 #endif /* !NDMOS_OPTION_NO_NDMP3 */
index f503645d6cfcdcea430106beea7504dcc2eefa47..e3e8dd9c1cc079341c151b6a284525a98b029794 100644 (file)
@@ -235,6 +235,7 @@ int ndmp4_tape_open_mode_from_str (ndmp4_tape_open_mode *valp, char *str) {
 struct ndmp_enum_str_table ndmp4_tape_open_mode_table[] = {
        { "NDMP4_TAPE_READ_MODE",       NDMP4_TAPE_READ_MODE, },
        { "NDMP4_TAPE_RDWR_MODE",       NDMP4_TAPE_RDWR_MODE, },
+       { "NDMP4_TAPE_RAW_MODE",        NDMP4_TAPE_RAW_MODE, },
        { 0 }
 };
 
index ad1659e281d66dffba9dd59f532c1801af795d29..ace3b6f1356f2cb77e4b14c263befb3fbd65a4ec 100644 (file)
@@ -11,124 +11,149 @@ extern bool_t xdr_ndmp4_u_quad();
 bool_t
 xdr__ndmp4_u_quad (XDR *xdrs, _ndmp4_u_quad *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->high))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->low))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->high))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->low))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_header_message_type (XDR *xdrs, ndmp4_header_message_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_error (XDR *xdrs, ndmp4_error *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_message (XDR *xdrs, ndmp4_message *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_header (XDR *xdrs, ndmp4_header *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->sequence))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->time_stamp))
-               return FALSE;
-       if (!xdr_ndmp4_header_message_type (xdrs, &objp->message_type))
-               return FALSE;
-       if (!xdr_ndmp4_message (xdrs, &objp->message_code))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->reply_sequence))
-               return FALSE;
-       if (!xdr_ndmp4_error (xdrs, &objp->error_code))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->sequence))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->time_stamp))
+                return FALSE;
+        if (!xdr_ndmp4_header_message_type (xdrs, &objp->message_type))
+                return FALSE;
+        if (!xdr_ndmp4_message (xdrs, &objp->message_code))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->reply_sequence))
+                return FALSE;
+        if (!xdr_ndmp4_error (xdrs, &objp->error_code))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_pval (XDR *xdrs, ndmp4_pval *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->value, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->value, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_connect_open_request (XDR *xdrs, ndmp4_connect_open_request *objp)
 {
-       if (!xdr_u_short (xdrs, &objp->protocol_version))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_short (xdrs, &objp->protocol_version))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_connect_open_reply (XDR *xdrs, ndmp4_connect_open_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_auth_type (XDR *xdrs, ndmp4_auth_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_auth_text (XDR *xdrs, ndmp4_auth_text *objp)
 {
-       if (!xdr_string (xdrs, &objp->auth_id, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->auth_password, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->auth_id, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->auth_password, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_auth_md5 (XDR *xdrs, ndmp4_auth_md5 *objp)
 {
-       if (!xdr_string (xdrs, &objp->auth_id, ~0))
-               return FALSE;
-       if (!xdr_opaque (xdrs, objp->auth_digest, 16))
-               return FALSE;
+       register int32_t *buf;
+
+       int i;
+        if (!xdr_string (xdrs, &objp->auth_id, ~0))
+                return FALSE;
+        if (!xdr_opaque (xdrs, objp->auth_digest, 16))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_auth_data (XDR *xdrs, ndmp4_auth_data *objp)
 {
-       if (!xdr_ndmp4_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        switch (objp->auth_type) {
        case NDMP4_AUTH_NONE:
                break;
        case NDMP4_AUTH_TEXT:
-               if (!xdr_ndmp4_auth_text (xdrs, &objp->ndmp4_auth_data_u.auth_text))
-                       return FALSE;
+                if (!xdr_ndmp4_auth_text (xdrs, &objp->ndmp4_auth_data_u.auth_text))
+                        return FALSE;
                break;
        case NDMP4_AUTH_MD5:
-               if (!xdr_ndmp4_auth_md5 (xdrs, &objp->ndmp4_auth_data_u.auth_md5))
-                       return FALSE;
+                if (!xdr_ndmp4_auth_md5 (xdrs, &objp->ndmp4_auth_data_u.auth_md5))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -139,16 +164,18 @@ xdr_ndmp4_auth_data (XDR *xdrs, ndmp4_auth_data *objp)
 bool_t
 xdr_ndmp4_auth_attr (XDR *xdrs, ndmp4_auth_attr *objp)
 {
-       if (!xdr_ndmp4_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        switch (objp->auth_type) {
        case NDMP4_AUTH_NONE:
                break;
        case NDMP4_AUTH_TEXT:
                break;
        case NDMP4_AUTH_MD5:
-               if (!xdr_opaque (xdrs, objp->ndmp4_auth_attr_u.challenge, 64))
-                       return FALSE;
+                if (!xdr_opaque (xdrs, objp->ndmp4_auth_attr_u.challenge, 64))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -159,311 +186,367 @@ xdr_ndmp4_auth_attr (XDR *xdrs, ndmp4_auth_attr *objp)
 bool_t
 xdr_ndmp4_connect_client_auth_request (XDR *xdrs, ndmp4_connect_client_auth_request *objp)
 {
-       if (!xdr_ndmp4_auth_data (xdrs, &objp->auth_data))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_auth_data (xdrs, &objp->auth_data))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_connect_client_auth_reply (XDR *xdrs, ndmp4_connect_client_auth_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_connect_server_auth_request (XDR *xdrs, ndmp4_connect_server_auth_request *objp)
 {
-       if (!xdr_ndmp4_auth_attr (xdrs, &objp->client_attr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_auth_attr (xdrs, &objp->client_attr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_connect_server_auth_reply (XDR *xdrs, ndmp4_connect_server_auth_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp4_auth_data (xdrs, &objp->server_result))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp4_auth_data (xdrs, &objp->server_result))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_get_host_info_reply (XDR *xdrs, ndmp4_config_get_host_info_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->hostname, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->os_type, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->os_vers, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->hostid, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->hostname, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->os_type, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->os_vers, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->hostid, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_get_server_info_reply (XDR *xdrs, ndmp4_config_get_server_info_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->vendor_name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->product_name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->revision_number, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->auth_type.auth_type_val, (u_int *) &objp->auth_type.auth_type_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->vendor_name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->product_name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->revision_number, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->auth_type.auth_type_val, (u_int *) &objp->auth_type.auth_type_len, ~0,
                sizeof (ndmp4_auth_type), (xdrproc_t) xdr_ndmp4_auth_type))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_addr_type (XDR *xdrs, ndmp4_addr_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_get_connection_type_reply (XDR *xdrs, ndmp4_config_get_connection_type_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->addr_types.addr_types_val, (u_int *) &objp->addr_types.addr_types_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->addr_types.addr_types_val, (u_int *) &objp->addr_types.addr_types_len, ~0,
                sizeof (ndmp4_addr_type), (xdrproc_t) xdr_ndmp4_addr_type))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_get_auth_attr_request (XDR *xdrs, ndmp4_config_get_auth_attr_request *objp)
 {
-       if (!xdr_ndmp4_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_get_auth_attr_reply (XDR *xdrs, ndmp4_config_get_auth_attr_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp4_auth_attr (xdrs, &objp->server_attr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp4_auth_attr (xdrs, &objp->server_attr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_butype_info (XDR *xdrs, ndmp4_butype_info *objp)
 {
-       if (!xdr_string (xdrs, &objp->butype_name, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->default_env.default_env_val, (u_int *) &objp->default_env.default_env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->butype_name, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->default_env.default_env_val, (u_int *) &objp->default_env.default_env_len, ~0,
                sizeof (ndmp4_pval), (xdrproc_t) xdr_ndmp4_pval))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->attrs))
-               return FALSE;
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->attrs))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_get_butype_info_reply (XDR *xdrs, ndmp4_config_get_butype_info_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->butype_info.butype_info_val, (u_int *) &objp->butype_info.butype_info_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->butype_info.butype_info_val, (u_int *) &objp->butype_info.butype_info_len, ~0,
                sizeof (ndmp4_butype_info), (xdrproc_t) xdr_ndmp4_butype_info))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_fs_info (XDR *xdrs, ndmp4_fs_info *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->unsupported))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_type, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_logical_device, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_physical_device, ~0))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->total_size))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->used_size))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->avail_size))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->total_inodes))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->used_inodes))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->fs_env.fs_env_val, (u_int *) &objp->fs_env.fs_env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->unsupported))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_type, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_logical_device, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_physical_device, ~0))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->total_size))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->used_size))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->avail_size))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->total_inodes))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->used_inodes))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->fs_env.fs_env_val, (u_int *) &objp->fs_env.fs_env_len, ~0,
                sizeof (ndmp4_pval), (xdrproc_t) xdr_ndmp4_pval))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_status, ~0))
-               return FALSE;
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_status, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_get_fs_info_reply (XDR *xdrs, ndmp4_config_get_fs_info_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->fs_info.fs_info_val, (u_int *) &objp->fs_info.fs_info_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->fs_info.fs_info_val, (u_int *) &objp->fs_info.fs_info_len, ~0,
                sizeof (ndmp4_fs_info), (xdrproc_t) xdr_ndmp4_fs_info))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_device_capability (XDR *xdrs, ndmp4_device_capability *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->attr))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->capability.capability_val, (u_int *) &objp->capability.capability_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->attr))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->capability.capability_val, (u_int *) &objp->capability.capability_len, ~0,
                sizeof (ndmp4_pval), (xdrproc_t) xdr_ndmp4_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_device_info (XDR *xdrs, ndmp4_device_info *objp)
 {
-       if (!xdr_string (xdrs, &objp->model, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->caplist.caplist_val, (u_int *) &objp->caplist.caplist_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->model, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->caplist.caplist_val, (u_int *) &objp->caplist.caplist_len, ~0,
                sizeof (ndmp4_device_capability), (xdrproc_t) xdr_ndmp4_device_capability))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_get_tape_info_reply (XDR *xdrs, ndmp4_config_get_tape_info_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->tape_info.tape_info_val, (u_int *) &objp->tape_info.tape_info_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->tape_info.tape_info_val, (u_int *) &objp->tape_info.tape_info_len, ~0,
                sizeof (ndmp4_device_info), (xdrproc_t) xdr_ndmp4_device_info))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_get_scsi_info_reply (XDR *xdrs, ndmp4_config_get_scsi_info_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->scsi_info.scsi_info_val, (u_int *) &objp->scsi_info.scsi_info_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->scsi_info.scsi_info_val, (u_int *) &objp->scsi_info.scsi_info_len, ~0,
                sizeof (ndmp4_device_info), (xdrproc_t) xdr_ndmp4_device_info))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_class_list (XDR *xdrs, ndmp4_class_list *objp)
 {
-       if (!xdr_u_short (xdrs, &objp->class_id))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->class_version.class_version_val, (u_int *) &objp->class_version.class_version_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_u_short (xdrs, &objp->class_id))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->class_version.class_version_val, (u_int *) &objp->class_version.class_version_len, ~0,
                sizeof (u_short), (xdrproc_t) xdr_u_short))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_class_version (XDR *xdrs, ndmp4_class_version *objp)
 {
-       if (!xdr_u_short (xdrs, &objp->class_id))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->class_version))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_short (xdrs, &objp->class_id))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->class_version))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_get_ext_list_reply (XDR *xdrs, ndmp4_config_get_ext_list_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->class_list.class_list_val, (u_int *) &objp->class_list.class_list_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->class_list.class_list_val, (u_int *) &objp->class_list.class_list_len, ~0,
                sizeof (ndmp4_class_list), (xdrproc_t) xdr_ndmp4_class_list))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_set_ext_list_request (XDR *xdrs, ndmp4_config_set_ext_list_request *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->ndmp4_accepted_ext.ndmp4_accepted_ext_val, (u_int *) &objp->ndmp4_accepted_ext.ndmp4_accepted_ext_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->ndmp4_accepted_ext.ndmp4_accepted_ext_val, (u_int *) &objp->ndmp4_accepted_ext.ndmp4_accepted_ext_len, ~0,
                sizeof (ndmp4_class_list), (xdrproc_t) xdr_ndmp4_class_list))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_config_set_ext_list_reply (XDR *xdrs, ndmp4_config_set_ext_list_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_scsi_open_request (XDR *xdrs, ndmp4_scsi_open_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_scsi_open_reply (XDR *xdrs, ndmp4_scsi_open_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_scsi_close_reply (XDR *xdrs, ndmp4_scsi_close_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_scsi_get_state_reply (XDR *xdrs, ndmp4_scsi_get_state_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_controller))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_id))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_lun))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_controller))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_id))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_lun))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_scsi_reset_device_reply (XDR *xdrs, ndmp4_scsi_reset_device_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
@@ -472,124 +555,139 @@ xdr_ndmp4_execute_cdb_request (XDR *xdrs, ndmp4_execute_cdb_request *objp)
 {
        register int32_t *buf;
 
+
        if (xdrs->x_op == XDR_ENCODE) {
                buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->timeout))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->datain_len))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->timeout))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->datain_len))
+                                return FALSE;
 
                } else {
                IXDR_PUT_U_LONG(buf, objp->flags);
                IXDR_PUT_U_LONG(buf, objp->timeout);
                IXDR_PUT_U_LONG(buf, objp->datain_len);
                }
-               if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
-                       return FALSE;
-               if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
-                       return FALSE;
+                if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
+                        return FALSE;
+                if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
+                        return FALSE;
                return TRUE;
        } else if (xdrs->x_op == XDR_DECODE) {
                buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->timeout))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->datain_len))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->timeout))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->datain_len))
+                                return FALSE;
 
                } else {
                objp->flags = IXDR_GET_U_LONG(buf);
                objp->timeout = IXDR_GET_U_LONG(buf);
                objp->datain_len = IXDR_GET_U_LONG(buf);
                }
-               if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
-                       return FALSE;
-               if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
-                       return FALSE;
-               return TRUE;
+                if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
+                        return FALSE;
+                if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
+                        return FALSE;
+        return TRUE;
        }
 
-       if (!xdr_u_long (xdrs, &objp->flags))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->timeout))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->datain_len))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
-               return FALSE;
+        if (!xdr_u_long (xdrs, &objp->flags))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->timeout))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->datain_len))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_execute_cdb_reply (XDR *xdrs, ndmp4_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_char (xdrs, &objp->status))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->dataout_len))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->datain.datain_val, (u_int *) &objp->datain.datain_len, ~0))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->ext_sense.ext_sense_val, (u_int *) &objp->ext_sense.ext_sense_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_char (xdrs, &objp->status))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->dataout_len))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->datain.datain_val, (u_int *) &objp->datain.datain_len, ~0))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->ext_sense.ext_sense_val, (u_int *) &objp->ext_sense.ext_sense_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_scsi_execute_cdb_request (XDR *xdrs, ndmp4_scsi_execute_cdb_request *objp)
 {
-       if (!xdr_ndmp4_execute_cdb_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_execute_cdb_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_scsi_execute_cdb_reply (XDR *xdrs, ndmp4_scsi_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp4_execute_cdb_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_execute_cdb_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_open_mode (XDR *xdrs, ndmp4_tape_open_mode *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_open_request (XDR *xdrs, ndmp4_tape_open_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
-       if (!xdr_ndmp4_tape_open_mode (xdrs, &objp->mode))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
+        if (!xdr_ndmp4_tape_open_mode (xdrs, &objp->mode))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_open_reply (XDR *xdrs, ndmp4_tape_open_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_close_reply (XDR *xdrs, ndmp4_tape_close_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
@@ -598,23 +696,24 @@ xdr_ndmp4_tape_get_state_reply (XDR *xdrs, ndmp4_tape_get_state_reply *objp)
 {
        register int32_t *buf;
 
+
        if (xdrs->x_op == XDR_ENCODE) {
-               if (!xdr_u_long (xdrs, &objp->unsupported))
-                       return FALSE;
-               if (!xdr_ndmp4_error (xdrs, &objp->error))
-                       return FALSE;
+                if (!xdr_u_long (xdrs, &objp->unsupported))
+                        return FALSE;
+                if (!xdr_ndmp4_error (xdrs, &objp->error))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->file_num))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->soft_errors))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->block_size))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->blockno))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->file_num))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->soft_errors))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->block_size))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->blockno))
+                                return FALSE;
 
                } else {
                IXDR_PUT_U_LONG(buf, objp->flags);
@@ -623,28 +722,28 @@ xdr_ndmp4_tape_get_state_reply (XDR *xdrs, ndmp4_tape_get_state_reply *objp)
                IXDR_PUT_U_LONG(buf, objp->block_size);
                IXDR_PUT_U_LONG(buf, objp->blockno);
                }
-               if (!xdr_ndmp4_u_quad (xdrs, &objp->total_space))
-                       return FALSE;
-               if (!xdr_ndmp4_u_quad (xdrs, &objp->space_remain))
-                       return FALSE;
+                if (!xdr_ndmp4_u_quad (xdrs, &objp->total_space))
+                        return FALSE;
+                if (!xdr_ndmp4_u_quad (xdrs, &objp->space_remain))
+                        return FALSE;
                return TRUE;
        } else if (xdrs->x_op == XDR_DECODE) {
-               if (!xdr_u_long (xdrs, &objp->unsupported))
-                       return FALSE;
-               if (!xdr_ndmp4_error (xdrs, &objp->error))
-                       return FALSE;
+                if (!xdr_u_long (xdrs, &objp->unsupported))
+                        return FALSE;
+                if (!xdr_ndmp4_error (xdrs, &objp->error))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 5 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->flags))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->file_num))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->soft_errors))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->block_size))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->blockno))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->flags))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->file_num))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->soft_errors))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->block_size))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->blockno))
+                                return FALSE;
 
                } else {
                objp->flags = IXDR_GET_U_LONG(buf);
@@ -653,175 +752,205 @@ xdr_ndmp4_tape_get_state_reply (XDR *xdrs, ndmp4_tape_get_state_reply *objp)
                objp->block_size = IXDR_GET_U_LONG(buf);
                objp->blockno = IXDR_GET_U_LONG(buf);
                }
-               if (!xdr_ndmp4_u_quad (xdrs, &objp->total_space))
-                       return FALSE;
-               if (!xdr_ndmp4_u_quad (xdrs, &objp->space_remain))
-                       return FALSE;
-               return TRUE;
+                if (!xdr_ndmp4_u_quad (xdrs, &objp->total_space))
+                        return FALSE;
+                if (!xdr_ndmp4_u_quad (xdrs, &objp->space_remain))
+                        return FALSE;
+        return TRUE;
        }
 
-       if (!xdr_u_long (xdrs, &objp->unsupported))
-               return FALSE;
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->flags))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->file_num))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->soft_errors))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->block_size))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->blockno))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->total_space))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->space_remain))
-               return FALSE;
+        if (!xdr_u_long (xdrs, &objp->unsupported))
+                return FALSE;
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->flags))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->file_num))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->soft_errors))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->block_size))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->blockno))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->total_space))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->space_remain))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_mtio_op (XDR *xdrs, ndmp4_tape_mtio_op *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_mtio_request (XDR *xdrs, ndmp4_tape_mtio_request *objp)
 {
-       if (!xdr_ndmp4_tape_mtio_op (xdrs, &objp->tape_op))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_tape_mtio_op (xdrs, &objp->tape_op))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_mtio_reply (XDR *xdrs, ndmp4_tape_mtio_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->resid_count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->resid_count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_write_request (XDR *xdrs, ndmp4_tape_write_request *objp)
 {
-       if (!xdr_bytes (xdrs, (char **)&objp->data_out.data_out_val, (u_int *) &objp->data_out.data_out_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_bytes (xdrs, (char **)&objp->data_out.data_out_val, (u_int *) &objp->data_out.data_out_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_write_reply (XDR *xdrs, ndmp4_tape_write_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_read_request (XDR *xdrs, ndmp4_tape_read_request *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_read_reply (XDR *xdrs, ndmp4_tape_read_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->data_in.data_in_val, (u_int *) &objp->data_in.data_in_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->data_in.data_in_val, (u_int *) &objp->data_in.data_in_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_execute_cdb_request (XDR *xdrs, ndmp4_tape_execute_cdb_request *objp)
 {
-       if (!xdr_ndmp4_scsi_execute_cdb_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_scsi_execute_cdb_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tape_execute_cdb_reply (XDR *xdrs, ndmp4_tape_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp4_scsi_execute_cdb_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_scsi_execute_cdb_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_operation (XDR *xdrs, ndmp4_data_operation *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_state (XDR *xdrs, ndmp4_data_state *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_halt_reason (XDR *xdrs, ndmp4_data_halt_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_tcp_addr (XDR *xdrs, ndmp4_tcp_addr *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->ip_addr))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->port))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->addr_env.addr_env_val, (u_int *) &objp->addr_env.addr_env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->ip_addr))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->port))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->addr_env.addr_env_val, (u_int *) &objp->addr_env.addr_env_len, ~0,
                sizeof (ndmp4_pval), (xdrproc_t) xdr_ndmp4_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_ipc_addr (XDR *xdrs, ndmp4_ipc_addr *objp)
 {
-       if (!xdr_bytes (xdrs, (char **)&objp->comm_data.comm_data_val, (u_int *) &objp->comm_data.comm_data_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_bytes (xdrs, (char **)&objp->comm_data.comm_data_val, (u_int *) &objp->comm_data.comm_data_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_addr (XDR *xdrs, ndmp4_addr *objp)
 {
-       if (!xdr_ndmp4_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        switch (objp->addr_type) {
        case NDMP4_ADDR_LOCAL:
                break;
        case NDMP4_ADDR_TCP:
-               if (!xdr_array (xdrs, (char **)&objp->ndmp4_addr_u.tcp_addr.tcp_addr_val, (u_int *) &objp->ndmp4_addr_u.tcp_addr.tcp_addr_len, ~0,
+                if (!xdr_array (xdrs, (char **)&objp->ndmp4_addr_u.tcp_addr.tcp_addr_val, (u_int *) &objp->ndmp4_addr_u.tcp_addr.tcp_addr_len, ~0,
                        sizeof (ndmp4_tcp_addr), (xdrproc_t) xdr_ndmp4_tcp_addr))
-                       return FALSE;
+                        return FALSE;
                break;
        case NDMP4_ADDR_IPC:
-               if (!xdr_ndmp4_ipc_addr (xdrs, &objp->ndmp4_addr_u.ipc_addr))
-                       return FALSE;
+                if (!xdr_ndmp4_ipc_addr (xdrs, &objp->ndmp4_addr_u.ipc_addr))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -832,508 +961,606 @@ xdr_ndmp4_addr (XDR *xdrs, ndmp4_addr *objp)
 bool_t
 xdr_ndmp4_data_get_state_reply (XDR *xdrs, ndmp4_data_get_state_reply *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->unsupported))
-               return FALSE;
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp4_data_operation (xdrs, &objp->operation))
-               return FALSE;
-       if (!xdr_ndmp4_data_state (xdrs, &objp->state))
-               return FALSE;
-       if (!xdr_ndmp4_data_halt_reason (xdrs, &objp->halt_reason))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->bytes_processed))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->est_bytes_remain))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->est_time_remain))
-               return FALSE;
-       if (!xdr_ndmp4_addr (xdrs, &objp->data_connection_addr))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->read_offset))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->read_length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->unsupported))
+                return FALSE;
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp4_data_operation (xdrs, &objp->operation))
+                return FALSE;
+        if (!xdr_ndmp4_data_state (xdrs, &objp->state))
+                return FALSE;
+        if (!xdr_ndmp4_data_halt_reason (xdrs, &objp->halt_reason))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->bytes_processed))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->est_bytes_remain))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->est_time_remain))
+                return FALSE;
+        if (!xdr_ndmp4_addr (xdrs, &objp->data_connection_addr))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->read_offset))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->read_length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_listen_request (XDR *xdrs, ndmp4_data_listen_request *objp)
 {
-       if (!xdr_ndmp4_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_listen_reply (XDR *xdrs, ndmp4_data_listen_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp4_addr (xdrs, &objp->connect_addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp4_addr (xdrs, &objp->connect_addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_connect_request (XDR *xdrs, ndmp4_data_connect_request *objp)
 {
-       if (!xdr_ndmp4_addr (xdrs, &objp->addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_addr (xdrs, &objp->addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_connect_reply (XDR *xdrs, ndmp4_data_connect_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_start_backup_request (XDR *xdrs, ndmp4_data_start_backup_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->butype_name, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->butype_name, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp4_pval), (xdrproc_t) xdr_ndmp4_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_start_backup_reply (XDR *xdrs, ndmp4_data_start_backup_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_name (XDR *xdrs, ndmp4_name *objp)
 {
-       if (!xdr_string (xdrs, &objp->original_path, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->destination_path, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->other_name, ~0))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->fh_info))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->original_path, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->destination_path, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->other_name, ~0))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->fh_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_start_recover_request (XDR *xdrs, ndmp4_data_start_recover_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp4_pval), (xdrproc_t) xdr_ndmp4_pval))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
                sizeof (ndmp4_name), (xdrproc_t) xdr_ndmp4_name))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->butype_name, ~0))
-               return FALSE;
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->butype_name, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_start_recover_reply (XDR *xdrs, ndmp4_data_start_recover_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_start_recover_filehist_request (XDR *xdrs, ndmp4_data_start_recover_filehist_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp4_pval), (xdrproc_t) xdr_ndmp4_pval))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
                sizeof (ndmp4_name), (xdrproc_t) xdr_ndmp4_name))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->butype_name, ~0))
-               return FALSE;
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->butype_name, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_start_recover_filehist_reply (XDR *xdrs, ndmp4_data_start_recover_filehist_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_abort_reply (XDR *xdrs, ndmp4_data_abort_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_stop_reply (XDR *xdrs, ndmp4_data_stop_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_data_get_env_reply (XDR *xdrs, ndmp4_data_get_env_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp4_pval), (xdrproc_t) xdr_ndmp4_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_mode (XDR *xdrs, ndmp4_mover_mode *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_state (XDR *xdrs, ndmp4_mover_state *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_pause_reason (XDR *xdrs, ndmp4_mover_pause_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_halt_reason (XDR *xdrs, ndmp4_mover_halt_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_set_record_size_request (XDR *xdrs, ndmp4_mover_set_record_size_request *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->len))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->len))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_set_record_size_reply (XDR *xdrs, ndmp4_mover_set_record_size_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_set_window_request (XDR *xdrs, ndmp4_mover_set_window_request *objp)
 {
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_set_window_reply (XDR *xdrs, ndmp4_mover_set_window_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_connect_request (XDR *xdrs, ndmp4_mover_connect_request *objp)
 {
-       if (!xdr_ndmp4_mover_mode (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp4_addr (xdrs, &objp->addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_mover_mode (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp4_addr (xdrs, &objp->addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_connect_reply (XDR *xdrs, ndmp4_mover_connect_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_listen_request (XDR *xdrs, ndmp4_mover_listen_request *objp)
 {
-       if (!xdr_ndmp4_mover_mode (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp4_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_mover_mode (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp4_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_listen_reply (XDR *xdrs, ndmp4_mover_listen_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp4_addr (xdrs, &objp->connect_addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp4_addr (xdrs, &objp->connect_addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_read_request (XDR *xdrs, ndmp4_mover_read_request *objp)
 {
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_read_reply (XDR *xdrs, ndmp4_mover_read_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_get_state_reply (XDR *xdrs, ndmp4_mover_get_state_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp4_mover_mode (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp4_mover_state (xdrs, &objp->state))
-               return FALSE;
-       if (!xdr_ndmp4_mover_pause_reason (xdrs, &objp->pause_reason))
-               return FALSE;
-       if (!xdr_ndmp4_mover_halt_reason (xdrs, &objp->halt_reason))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->record_size))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->record_num))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->bytes_moved))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->seek_position))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->bytes_left_to_read))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->window_offset))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->window_length))
-               return FALSE;
-       if (!xdr_ndmp4_addr (xdrs, &objp->data_connection_addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp4_mover_mode (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp4_mover_state (xdrs, &objp->state))
+                return FALSE;
+        if (!xdr_ndmp4_mover_pause_reason (xdrs, &objp->pause_reason))
+                return FALSE;
+        if (!xdr_ndmp4_mover_halt_reason (xdrs, &objp->halt_reason))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->record_size))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->record_num))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->bytes_moved))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->seek_position))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->bytes_left_to_read))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->window_offset))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->window_length))
+                return FALSE;
+        if (!xdr_ndmp4_addr (xdrs, &objp->data_connection_addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_continue_reply (XDR *xdrs, ndmp4_mover_continue_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_close_reply (XDR *xdrs, ndmp4_mover_close_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_abort_reply (XDR *xdrs, ndmp4_mover_abort_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_mover_stop_reply (XDR *xdrs, ndmp4_mover_stop_reply *objp)
 {
-       if (!xdr_ndmp4_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_notify_data_halted_post (XDR *xdrs, ndmp4_notify_data_halted_post *objp)
 {
-       if (!xdr_ndmp4_data_halt_reason (xdrs, &objp->reason))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_data_halt_reason (xdrs, &objp->reason))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_connection_status_reason (XDR *xdrs, ndmp4_connection_status_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_notify_connection_status_post (XDR *xdrs, ndmp4_notify_connection_status_post *objp)
 {
-       if (!xdr_ndmp4_connection_status_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->protocol_version))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->text_reason, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_connection_status_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->protocol_version))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->text_reason, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_notify_mover_halted_post (XDR *xdrs, ndmp4_notify_mover_halted_post *objp)
 {
-       if (!xdr_ndmp4_mover_halt_reason (xdrs, &objp->reason))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_mover_halt_reason (xdrs, &objp->reason))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_notify_mover_paused_post (XDR *xdrs, ndmp4_notify_mover_paused_post *objp)
 {
-       if (!xdr_ndmp4_mover_pause_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->seek_position))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_mover_pause_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->seek_position))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_notify_data_read_post (XDR *xdrs, ndmp4_notify_data_read_post *objp)
 {
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_has_associated_message (XDR *xdrs, ndmp4_has_associated_message *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_log_type (XDR *xdrs, ndmp4_log_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_log_message_post (XDR *xdrs, ndmp4_log_message_post *objp)
 {
-       if (!xdr_ndmp4_log_type (xdrs, &objp->log_type))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->message_id))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->entry, ~0))
-               return FALSE;
-       if (!xdr_ndmp4_has_associated_message (xdrs, &objp->associated_message_valid))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->associated_message_sequence))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_log_type (xdrs, &objp->log_type))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->message_id))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->entry, ~0))
+                return FALSE;
+        if (!xdr_ndmp4_has_associated_message (xdrs, &objp->associated_message_valid))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->associated_message_sequence))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_recovery_status (XDR *xdrs, ndmp4_recovery_status *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_log_file_post (XDR *xdrs, ndmp4_log_file_post *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
-       if (!xdr_ndmp4_recovery_status (xdrs, &objp->recovery_status))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
+        if (!xdr_ndmp4_recovery_status (xdrs, &objp->recovery_status))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_fs_type (XDR *xdrs, ndmp4_fs_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_path (XDR *xdrs, ndmp4_path *objp)
 {
-       if (!xdr_string (xdrs, objp, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, objp, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_nt_path (XDR *xdrs, ndmp4_nt_path *objp)
 {
-       if (!xdr_ndmp4_path (xdrs, &objp->nt_path))
-               return FALSE;
-       if (!xdr_ndmp4_path (xdrs, &objp->dos_path))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_path (xdrs, &objp->nt_path))
+                return FALSE;
+        if (!xdr_ndmp4_path (xdrs, &objp->dos_path))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_file_name (XDR *xdrs, ndmp4_file_name *objp)
 {
-       if (!xdr_ndmp4_fs_type (xdrs, &objp->fs_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp4_fs_type (xdrs, &objp->fs_type))
+                return FALSE;
        switch (objp->fs_type) {
        case NDMP4_FS_UNIX:
-               if (!xdr_ndmp4_path (xdrs, &objp->ndmp4_file_name_u.unix_name))
-                       return FALSE;
+                if (!xdr_ndmp4_path (xdrs, &objp->ndmp4_file_name_u.unix_name))
+                        return FALSE;
                break;
        case NDMP4_FS_NT:
-               if (!xdr_ndmp4_nt_path (xdrs, &objp->ndmp4_file_name_u.nt_name))
-                       return FALSE;
+                if (!xdr_ndmp4_nt_path (xdrs, &objp->ndmp4_file_name_u.nt_name))
+                        return FALSE;
                break;
        default:
-               if (!xdr_ndmp4_path (xdrs, &objp->ndmp4_file_name_u.other_name))
-                       return FALSE;
+                if (!xdr_ndmp4_path (xdrs, &objp->ndmp4_file_name_u.other_name))
+                        return FALSE;
                break;
        }
        return TRUE;
@@ -1342,8 +1569,10 @@ xdr_ndmp4_file_name (XDR *xdrs, ndmp4_file_name *objp)
 bool_t
 xdr_ndmp4_file_type (XDR *xdrs, ndmp4_file_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
@@ -1352,27 +1581,28 @@ xdr_ndmp4_file_stat (XDR *xdrs, ndmp4_file_stat *objp)
 {
        register int32_t *buf;
 
+
        if (xdrs->x_op == XDR_ENCODE) {
-               if (!xdr_u_long (xdrs, &objp->unsupported))
-                       return FALSE;
-               if (!xdr_ndmp4_fs_type (xdrs, &objp->fs_type))
-                       return FALSE;
-               if (!xdr_ndmp4_file_type (xdrs, &objp->ftype))
-                       return FALSE;
+                if (!xdr_u_long (xdrs, &objp->unsupported))
+                        return FALSE;
+                if (!xdr_ndmp4_fs_type (xdrs, &objp->fs_type))
+                        return FALSE;
+                if (!xdr_ndmp4_file_type (xdrs, &objp->ftype))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->mtime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->atime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->ctime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->owner))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->group))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->fattr))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->mtime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->atime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->ctime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->owner))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->group))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->fattr))
+                                return FALSE;
 
                } else {
                IXDR_PUT_U_LONG(buf, objp->mtime);
@@ -1382,32 +1612,32 @@ xdr_ndmp4_file_stat (XDR *xdrs, ndmp4_file_stat *objp)
                IXDR_PUT_U_LONG(buf, objp->group);
                IXDR_PUT_U_LONG(buf, objp->fattr);
                }
-               if (!xdr_ndmp4_u_quad (xdrs, &objp->size))
-                       return FALSE;
-               if (!xdr_u_long (xdrs, &objp->links))
-                       return FALSE;
+                if (!xdr_ndmp4_u_quad (xdrs, &objp->size))
+                        return FALSE;
+                if (!xdr_u_long (xdrs, &objp->links))
+                        return FALSE;
                return TRUE;
        } else if (xdrs->x_op == XDR_DECODE) {
-               if (!xdr_u_long (xdrs, &objp->unsupported))
-                       return FALSE;
-               if (!xdr_ndmp4_fs_type (xdrs, &objp->fs_type))
-                       return FALSE;
-               if (!xdr_ndmp4_file_type (xdrs, &objp->ftype))
-                       return FALSE;
+                if (!xdr_u_long (xdrs, &objp->unsupported))
+                        return FALSE;
+                if (!xdr_ndmp4_fs_type (xdrs, &objp->fs_type))
+                        return FALSE;
+                if (!xdr_ndmp4_file_type (xdrs, &objp->ftype))
+                        return FALSE;
                buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
                if (buf == NULL) {
-                       if (!xdr_u_long (xdrs, &objp->mtime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->atime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->ctime))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->owner))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->group))
-                               return FALSE;
-                       if (!xdr_u_long (xdrs, &objp->fattr))
-                               return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->mtime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->atime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->ctime))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->owner))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->group))
+                                return FALSE;
+                        if (!xdr_u_long (xdrs, &objp->fattr))
+                                return FALSE;
 
                } else {
                objp->mtime = IXDR_GET_U_LONG(buf);
@@ -1417,104 +1647,116 @@ xdr_ndmp4_file_stat (XDR *xdrs, ndmp4_file_stat *objp)
                objp->group = IXDR_GET_U_LONG(buf);
                objp->fattr = IXDR_GET_U_LONG(buf);
                }
-               if (!xdr_ndmp4_u_quad (xdrs, &objp->size))
-                       return FALSE;
-               if (!xdr_u_long (xdrs, &objp->links))
-                       return FALSE;
-               return TRUE;
+                if (!xdr_ndmp4_u_quad (xdrs, &objp->size))
+                        return FALSE;
+                if (!xdr_u_long (xdrs, &objp->links))
+                        return FALSE;
+        return TRUE;
        }
 
-       if (!xdr_u_long (xdrs, &objp->unsupported))
-               return FALSE;
-       if (!xdr_ndmp4_fs_type (xdrs, &objp->fs_type))
-               return FALSE;
-       if (!xdr_ndmp4_file_type (xdrs, &objp->ftype))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->mtime))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->atime))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->ctime))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->owner))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->group))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->fattr))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->size))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->links))
-               return FALSE;
+        if (!xdr_u_long (xdrs, &objp->unsupported))
+                return FALSE;
+        if (!xdr_ndmp4_fs_type (xdrs, &objp->fs_type))
+                return FALSE;
+        if (!xdr_ndmp4_file_type (xdrs, &objp->ftype))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->mtime))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->atime))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->ctime))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->owner))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->group))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->fattr))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->size))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->links))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_file (XDR *xdrs, ndmp4_file *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->names.names_val, (u_int *) &objp->names.names_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->names.names_val, (u_int *) &objp->names.names_len, ~0,
                sizeof (ndmp4_file_name), (xdrproc_t) xdr_ndmp4_file_name))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
                sizeof (ndmp4_file_stat), (xdrproc_t) xdr_ndmp4_file_stat))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->fh_info))
-               return FALSE;
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->fh_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_fh_add_file_post (XDR *xdrs, ndmp4_fh_add_file_post *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->files.files_val, (u_int *) &objp->files.files_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->files.files_val, (u_int *) &objp->files.files_len, ~0,
                sizeof (ndmp4_file), (xdrproc_t) xdr_ndmp4_file))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_dir (XDR *xdrs, ndmp4_dir *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->names.names_val, (u_int *) &objp->names.names_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->names.names_val, (u_int *) &objp->names.names_len, ~0,
                sizeof (ndmp4_file_name), (xdrproc_t) xdr_ndmp4_file_name))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->parent))
-               return FALSE;
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->parent))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_fh_add_dir_post (XDR *xdrs, ndmp4_fh_add_dir_post *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->dirs.dirs_val, (u_int *) &objp->dirs.dirs_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->dirs.dirs_val, (u_int *) &objp->dirs.dirs_len, ~0,
                sizeof (ndmp4_dir), (xdrproc_t) xdr_ndmp4_dir))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_node (XDR *xdrs, ndmp4_node *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
                sizeof (ndmp4_file_stat), (xdrproc_t) xdr_ndmp4_file_stat))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_ndmp4_u_quad (xdrs, &objp->fh_info))
-               return FALSE;
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_ndmp4_u_quad (xdrs, &objp->fh_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp4_fh_add_node_post (XDR *xdrs, ndmp4_fh_add_node_post *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->nodes.nodes_val, (u_int *) &objp->nodes.nodes_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->nodes.nodes_val, (u_int *) &objp->nodes.nodes_len, ~0,
                sizeof (ndmp4_node), (xdrproc_t) xdr_ndmp4_node))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 #endif /* !NDMOS_OPTION_NO_NDMP4 */
index 28fc6dcf69a5fca88ca9b8f1cb0641fbb00b9321..7a16ea7b4d961795f38d37677bf05b18badfd504 100644 (file)
@@ -8,16 +8,20 @@
 bool_t
 xdr_ndmp9_error (XDR *xdrs, ndmp9_error *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_message (XDR *xdrs, ndmp9_message *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 extern bool_t xdr_ndmp9_no_arguments();
@@ -26,8 +30,10 @@ extern bool_t xdr_ndmp9_no_arguments();
 bool_t
 xdr_ndmp9_just_error_reply (XDR *xdrs, ndmp9_just_error_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
        return TRUE;
 }
 extern bool_t xdr_ndmp9_u_quad();
@@ -36,8 +42,10 @@ extern bool_t xdr_ndmp9_u_quad();
 bool_t
 xdr_ndmp9_validity (XDR *xdrs, ndmp9_validity *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 #define NDMP9_INVALID_U_LONG 0xFFFFFFFFul
@@ -45,10 +53,12 @@ xdr_ndmp9_validity (XDR *xdrs, ndmp9_validity *objp)
 bool_t
 xdr_ndmp9_valid_u_long (XDR *xdrs, ndmp9_valid_u_long *objp)
 {
-       if (!xdr_ndmp9_validity (xdrs, &objp->valid))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->value))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_validity (xdrs, &objp->valid))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->value))
+                return FALSE;
        return TRUE;
 }
 #define NDMP9_INVALID_U_QUAD 0xFFFFFFFFFFFFFFFFull
@@ -56,44 +66,52 @@ xdr_ndmp9_valid_u_long (XDR *xdrs, ndmp9_valid_u_long *objp)
 bool_t
 xdr_ndmp9_valid_u_quad (XDR *xdrs, ndmp9_valid_u_quad *objp)
 {
-       if (!xdr_ndmp9_validity (xdrs, &objp->valid))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->value))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_validity (xdrs, &objp->valid))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->value))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_pval (XDR *xdrs, ndmp9_pval *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->value, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->value, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_auth_type (XDR *xdrs, ndmp9_auth_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_auth_attr (XDR *xdrs, ndmp9_auth_attr *objp)
 {
-       if (!xdr_ndmp9_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        switch (objp->auth_type) {
        case NDMP9_AUTH_NONE:
                break;
        case NDMP9_AUTH_TEXT:
                break;
        case NDMP9_AUTH_MD5:
-               if (!xdr_opaque (xdrs, objp->ndmp9_auth_attr_u.challenge, 64))
-                       return FALSE;
+                if (!xdr_opaque (xdrs, objp->ndmp9_auth_attr_u.challenge, 64))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -104,38 +122,45 @@ xdr_ndmp9_auth_attr (XDR *xdrs, ndmp9_auth_attr *objp)
 bool_t
 xdr_ndmp9_auth_text (XDR *xdrs, ndmp9_auth_text *objp)
 {
-       if (!xdr_string (xdrs, &objp->auth_id, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->auth_password, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->auth_id, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->auth_password, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_auth_md5 (XDR *xdrs, ndmp9_auth_md5 *objp)
 {
-       if (!xdr_string (xdrs, &objp->auth_id, ~0))
-               return FALSE;
-       if (!xdr_opaque (xdrs, objp->auth_digest, 16))
-               return FALSE;
+       register int32_t *buf;
+
+       int i;
+        if (!xdr_string (xdrs, &objp->auth_id, ~0))
+                return FALSE;
+        if (!xdr_opaque (xdrs, objp->auth_digest, 16))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_auth_data (XDR *xdrs, ndmp9_auth_data *objp)
 {
-       if (!xdr_ndmp9_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        switch (objp->auth_type) {
        case NDMP9_AUTH_NONE:
                break;
        case NDMP9_AUTH_TEXT:
-               if (!xdr_ndmp9_auth_text (xdrs, &objp->ndmp9_auth_data_u.auth_text))
-                       return FALSE;
+                if (!xdr_ndmp9_auth_text (xdrs, &objp->ndmp9_auth_data_u.auth_text))
+                        return FALSE;
                break;
        case NDMP9_AUTH_MD5:
-               if (!xdr_ndmp9_auth_md5 (xdrs, &objp->ndmp9_auth_data_u.auth_md5))
-                       return FALSE;
+                if (!xdr_ndmp9_auth_md5 (xdrs, &objp->ndmp9_auth_data_u.auth_md5))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -146,33 +171,39 @@ xdr_ndmp9_auth_data (XDR *xdrs, ndmp9_auth_data *objp)
 bool_t
 xdr_ndmp9_addr_type (XDR *xdrs, ndmp9_addr_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tcp_addr (XDR *xdrs, ndmp9_tcp_addr *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->ip_addr))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->port))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->ip_addr))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->port))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_addr (XDR *xdrs, ndmp9_addr *objp)
 {
-       if (!xdr_ndmp9_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        switch (objp->addr_type) {
        case NDMP9_ADDR_LOCAL:
        case NDMP9_ADDR_AS_CONNECTED:
                break;
        case NDMP9_ADDR_TCP:
-               if (!xdr_ndmp9_tcp_addr (xdrs, &objp->ndmp9_addr_u.tcp_addr))
-                       return FALSE;
+                if (!xdr_ndmp9_tcp_addr (xdrs, &objp->ndmp9_addr_u.tcp_addr))
+                        return FALSE;
                break;
        default:
                return FALSE;
@@ -183,1282 +214,1540 @@ xdr_ndmp9_addr (XDR *xdrs, ndmp9_addr *objp)
 bool_t
 xdr_ndmp9_connect_open_request (XDR *xdrs, ndmp9_connect_open_request *objp)
 {
-       if (!xdr_u_short (xdrs, &objp->protocol_version))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_short (xdrs, &objp->protocol_version))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_connect_open_reply (XDR *xdrs, ndmp9_connect_open_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_connect_client_auth_request (XDR *xdrs, ndmp9_connect_client_auth_request *objp)
 {
-       if (!xdr_ndmp9_auth_data (xdrs, &objp->auth_data))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_auth_data (xdrs, &objp->auth_data))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_connect_client_auth_reply (XDR *xdrs, ndmp9_connect_client_auth_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_connect_close_request (XDR *xdrs, ndmp9_connect_close_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_connect_close_reply (XDR *xdrs, ndmp9_connect_close_reply *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_connect_server_auth_request (XDR *xdrs, ndmp9_connect_server_auth_request *objp)
 {
-       if (!xdr_ndmp9_auth_attr (xdrs, &objp->client_attr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_auth_attr (xdrs, &objp->client_attr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_connect_server_auth_reply (XDR *xdrs, ndmp9_connect_server_auth_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp9_auth_data (xdrs, &objp->server_result))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp9_auth_data (xdrs, &objp->server_result))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_butype_info (XDR *xdrs, ndmp9_butype_info *objp)
 {
-       if (!xdr_string (xdrs, &objp->butype_name, ~0))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->v2attr))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->v3attr))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->v4attr))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->default_env.default_env_val, (u_int *) &objp->default_env.default_env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->butype_name, ~0))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->v2attr))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->v3attr))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->v4attr))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->default_env.default_env_val, (u_int *) &objp->default_env.default_env_len, ~0,
                sizeof (ndmp9_pval), (xdrproc_t) xdr_ndmp9_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_fs_info (XDR *xdrs, ndmp9_fs_info *objp)
 {
-       if (!xdr_string (xdrs, &objp->fs_type, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_logical_device, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_physical_device, ~0))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->total_size))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->used_size))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->avail_size))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->total_inodes))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->used_inodes))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->fs_env.fs_env_val, (u_int *) &objp->fs_env.fs_env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->fs_type, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_logical_device, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_physical_device, ~0))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->total_size))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->used_size))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->avail_size))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->total_inodes))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->used_inodes))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->fs_env.fs_env_val, (u_int *) &objp->fs_env.fs_env_len, ~0,
                sizeof (ndmp9_pval), (xdrproc_t) xdr_ndmp9_pval))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->fs_status, ~0))
-               return FALSE;
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->fs_status, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_device_capability (XDR *xdrs, ndmp9_device_capability *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->v3attr))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->v4attr))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->capability.capability_val, (u_int *) &objp->capability.capability_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->v3attr))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->v4attr))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->capability.capability_val, (u_int *) &objp->capability.capability_len, ~0,
                sizeof (ndmp9_pval), (xdrproc_t) xdr_ndmp9_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_device_info (XDR *xdrs, ndmp9_device_info *objp)
 {
-       if (!xdr_string (xdrs, &objp->model, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->caplist.caplist_val, (u_int *) &objp->caplist.caplist_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->model, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->caplist.caplist_val, (u_int *) &objp->caplist.caplist_len, ~0,
                sizeof (ndmp9_device_capability), (xdrproc_t) xdr_ndmp9_device_capability))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_info (XDR *xdrs, ndmp9_config_info *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->hostname, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->os_type, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->os_vers, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->hostid, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->vendor_name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->product_name, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->revision_number, ~0))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->authtypes))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->conntypes))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->butype_info.butype_info_val, (u_int *) &objp->butype_info.butype_info_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->hostname, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->os_type, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->os_vers, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->hostid, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->vendor_name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->product_name, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->revision_number, ~0))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->authtypes))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->conntypes))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->butype_info.butype_info_val, (u_int *) &objp->butype_info.butype_info_len, ~0,
                sizeof (ndmp9_butype_info), (xdrproc_t) xdr_ndmp9_butype_info))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->fs_info.fs_info_val, (u_int *) &objp->fs_info.fs_info_len, ~0,
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->fs_info.fs_info_val, (u_int *) &objp->fs_info.fs_info_len, ~0,
                sizeof (ndmp9_fs_info), (xdrproc_t) xdr_ndmp9_fs_info))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->tape_info.tape_info_val, (u_int *) &objp->tape_info.tape_info_len, ~0,
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->tape_info.tape_info_val, (u_int *) &objp->tape_info.tape_info_len, ~0,
                sizeof (ndmp9_device_info), (xdrproc_t) xdr_ndmp9_device_info))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->scsi_info.scsi_info_val, (u_int *) &objp->scsi_info.scsi_info_len, ~0,
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->scsi_info.scsi_info_val, (u_int *) &objp->scsi_info.scsi_info_len, ~0,
                sizeof (ndmp9_device_info), (xdrproc_t) xdr_ndmp9_device_info))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_info_request (XDR *xdrs, ndmp9_config_get_info_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_info_reply (XDR *xdrs, ndmp9_config_get_info_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp9_config_info (xdrs, &objp->config_info))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp9_config_info (xdrs, &objp->config_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_host_info_request (XDR *xdrs, ndmp9_config_get_host_info_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_host_info_reply (XDR *xdrs, ndmp9_config_get_host_info_reply *objp)
 {
-       if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_connection_type_request (XDR *xdrs, ndmp9_config_get_connection_type_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_connection_type_reply (XDR *xdrs, ndmp9_config_get_connection_type_reply *objp)
 {
-       if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_server_info_request (XDR *xdrs, ndmp9_config_get_server_info_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_server_info_reply (XDR *xdrs, ndmp9_config_get_server_info_reply *objp)
 {
-       if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_butype_info_request (XDR *xdrs, ndmp9_config_get_butype_info_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_butype_info_reply (XDR *xdrs, ndmp9_config_get_butype_info_reply *objp)
 {
-       if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_fs_info_request (XDR *xdrs, ndmp9_config_get_fs_info_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_fs_info_reply (XDR *xdrs, ndmp9_config_get_fs_info_reply *objp)
 {
-       if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_tape_info_request (XDR *xdrs, ndmp9_config_get_tape_info_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_tape_info_reply (XDR *xdrs, ndmp9_config_get_tape_info_reply *objp)
 {
-       if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_scsi_info_request (XDR *xdrs, ndmp9_config_get_scsi_info_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_scsi_info_reply (XDR *xdrs, ndmp9_config_get_scsi_info_reply *objp)
 {
-       if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_config_get_info_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_auth_attr_request (XDR *xdrs, ndmp9_config_get_auth_attr_request *objp)
 {
-       if (!xdr_ndmp9_auth_type (xdrs, &objp->auth_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_auth_type (xdrs, &objp->auth_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_config_get_auth_attr_reply (XDR *xdrs, ndmp9_config_get_auth_attr_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp9_auth_attr (xdrs, &objp->server_attr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp9_auth_attr (xdrs, &objp->server_attr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_open_request (XDR *xdrs, ndmp9_scsi_open_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_open_reply (XDR *xdrs, ndmp9_scsi_open_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_close_request (XDR *xdrs, ndmp9_scsi_close_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_close_reply (XDR *xdrs, ndmp9_scsi_close_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_get_state_request (XDR *xdrs, ndmp9_scsi_get_state_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_get_state_reply (XDR *xdrs, ndmp9_scsi_get_state_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_controller))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_id))
-               return FALSE;
-       if (!xdr_short (xdrs, &objp->target_lun))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_controller))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_id))
+                return FALSE;
+        if (!xdr_short (xdrs, &objp->target_lun))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_set_target_request (XDR *xdrs, ndmp9_scsi_set_target_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->target_controller))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->target_id))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->target_lun))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->target_controller))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->target_id))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->target_lun))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_set_target_reply (XDR *xdrs, ndmp9_scsi_set_target_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_reset_device_request (XDR *xdrs, ndmp9_scsi_reset_device_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_reset_device_reply (XDR *xdrs, ndmp9_scsi_reset_device_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_reset_bus_request (XDR *xdrs, ndmp9_scsi_reset_bus_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_reset_bus_reply (XDR *xdrs, ndmp9_scsi_reset_bus_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_data_dir (XDR *xdrs, ndmp9_scsi_data_dir *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_execute_cdb_request (XDR *xdrs, ndmp9_execute_cdb_request *objp)
 {
-       if (!xdr_ndmp9_scsi_data_dir (xdrs, &objp->data_dir))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->timeout))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->datain_len))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_scsi_data_dir (xdrs, &objp->data_dir))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->timeout))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->datain_len))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_execute_cdb_reply (XDR *xdrs, ndmp9_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_char (xdrs, &objp->status))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->dataout_len))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->datain.datain_val, (u_int *) &objp->datain.datain_len, ~0))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->ext_sense.ext_sense_val, (u_int *) &objp->ext_sense.ext_sense_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_char (xdrs, &objp->status))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->dataout_len))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->datain.datain_val, (u_int *) &objp->datain.datain_len, ~0))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->ext_sense.ext_sense_val, (u_int *) &objp->ext_sense.ext_sense_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_execute_cdb_request (XDR *xdrs, ndmp9_scsi_execute_cdb_request *objp)
 {
-       if (!xdr_ndmp9_execute_cdb_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_execute_cdb_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_scsi_execute_cdb_reply (XDR *xdrs, ndmp9_scsi_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp9_execute_cdb_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_execute_cdb_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_open_mode (XDR *xdrs, ndmp9_tape_open_mode *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_state (XDR *xdrs, ndmp9_tape_state *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_open_request (XDR *xdrs, ndmp9_tape_open_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->device, ~0))
-               return FALSE;
-       if (!xdr_ndmp9_tape_open_mode (xdrs, &objp->mode))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->device, ~0))
+                return FALSE;
+        if (!xdr_ndmp9_tape_open_mode (xdrs, &objp->mode))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_open_reply (XDR *xdrs, ndmp9_tape_open_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_close_request (XDR *xdrs, ndmp9_tape_close_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_close_reply (XDR *xdrs, ndmp9_tape_close_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_get_state_request (XDR *xdrs, ndmp9_tape_get_state_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_get_state_reply (XDR *xdrs, ndmp9_tape_get_state_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->flags))
-               return FALSE;
-       if (!xdr_ndmp9_tape_state (xdrs, &objp->state))
-               return FALSE;
-       if (!xdr_ndmp9_tape_open_mode (xdrs, &objp->open_mode))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->file_num))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->soft_errors))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->block_size))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->blockno))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->total_space))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->space_remain))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->partition))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->flags))
+                return FALSE;
+        if (!xdr_ndmp9_tape_state (xdrs, &objp->state))
+                return FALSE;
+        if (!xdr_ndmp9_tape_open_mode (xdrs, &objp->open_mode))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->file_num))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->soft_errors))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->block_size))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->blockno))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->total_space))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->space_remain))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->partition))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_mtio_op (XDR *xdrs, ndmp9_tape_mtio_op *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_mtio_request (XDR *xdrs, ndmp9_tape_mtio_request *objp)
 {
-       if (!xdr_ndmp9_tape_mtio_op (xdrs, &objp->tape_op))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_tape_mtio_op (xdrs, &objp->tape_op))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_mtio_reply (XDR *xdrs, ndmp9_tape_mtio_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->resid_count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->resid_count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_write_request (XDR *xdrs, ndmp9_tape_write_request *objp)
 {
-       if (!xdr_bytes (xdrs, (char **)&objp->data_out.data_out_val, (u_int *) &objp->data_out.data_out_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_bytes (xdrs, (char **)&objp->data_out.data_out_val, (u_int *) &objp->data_out.data_out_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_write_reply (XDR *xdrs, ndmp9_tape_write_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_read_request (XDR *xdrs, ndmp9_tape_read_request *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->count))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->count))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_read_reply (XDR *xdrs, ndmp9_tape_read_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_bytes (xdrs, (char **)&objp->data_in.data_in_val, (u_int *) &objp->data_in.data_in_len, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_bytes (xdrs, (char **)&objp->data_in.data_in_val, (u_int *) &objp->data_in.data_in_len, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_execute_cdb_request (XDR *xdrs, ndmp9_tape_execute_cdb_request *objp)
 {
-       if (!xdr_ndmp9_execute_cdb_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_execute_cdb_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_tape_execute_cdb_reply (XDR *xdrs, ndmp9_tape_execute_cdb_reply *objp)
 {
-       if (!xdr_ndmp9_execute_cdb_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_execute_cdb_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_state (XDR *xdrs, ndmp9_mover_state *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_mode (XDR *xdrs, ndmp9_mover_mode *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_pause_reason (XDR *xdrs, ndmp9_mover_pause_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_halt_reason (XDR *xdrs, ndmp9_mover_halt_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_get_state_request (XDR *xdrs, ndmp9_mover_get_state_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_get_state_reply (XDR *xdrs, ndmp9_mover_get_state_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp9_mover_state (xdrs, &objp->state))
-               return FALSE;
-       if (!xdr_ndmp9_mover_mode (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp9_mover_pause_reason (xdrs, &objp->pause_reason))
-               return FALSE;
-       if (!xdr_ndmp9_mover_halt_reason (xdrs, &objp->halt_reason))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->record_size))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->record_num))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->bytes_moved))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->seek_position))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->bytes_left_to_read))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->window_offset))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->window_length))
-               return FALSE;
-       if (!xdr_ndmp9_addr (xdrs, &objp->data_connection_addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp9_mover_state (xdrs, &objp->state))
+                return FALSE;
+        if (!xdr_ndmp9_mover_mode (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp9_mover_pause_reason (xdrs, &objp->pause_reason))
+                return FALSE;
+        if (!xdr_ndmp9_mover_halt_reason (xdrs, &objp->halt_reason))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->record_size))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->record_num))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->bytes_moved))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->seek_position))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->bytes_left_to_read))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->window_offset))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->window_length))
+                return FALSE;
+        if (!xdr_ndmp9_addr (xdrs, &objp->data_connection_addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_listen_request (XDR *xdrs, ndmp9_mover_listen_request *objp)
 {
-       if (!xdr_ndmp9_mover_mode (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp9_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_mover_mode (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp9_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_listen_reply (XDR *xdrs, ndmp9_mover_listen_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp9_addr (xdrs, &objp->data_connection_addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp9_addr (xdrs, &objp->data_connection_addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_connect_request (XDR *xdrs, ndmp9_mover_connect_request *objp)
 {
-       if (!xdr_ndmp9_mover_mode (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp9_addr (xdrs, &objp->addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_mover_mode (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp9_addr (xdrs, &objp->addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_connect_reply (XDR *xdrs, ndmp9_mover_connect_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_set_record_size_request (XDR *xdrs, ndmp9_mover_set_record_size_request *objp)
 {
-       if (!xdr_u_long (xdrs, &objp->record_size))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_u_long (xdrs, &objp->record_size))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_set_record_size_reply (XDR *xdrs, ndmp9_mover_set_record_size_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_set_window_request (XDR *xdrs, ndmp9_mover_set_window_request *objp)
 {
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_set_window_reply (XDR *xdrs, ndmp9_mover_set_window_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_continue_request (XDR *xdrs, ndmp9_mover_continue_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_continue_reply (XDR *xdrs, ndmp9_mover_continue_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_abort_request (XDR *xdrs, ndmp9_mover_abort_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_abort_reply (XDR *xdrs, ndmp9_mover_abort_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_stop_request (XDR *xdrs, ndmp9_mover_stop_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_stop_reply (XDR *xdrs, ndmp9_mover_stop_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_read_request (XDR *xdrs, ndmp9_mover_read_request *objp)
 {
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_read_reply (XDR *xdrs, ndmp9_mover_read_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_close_request (XDR *xdrs, ndmp9_mover_close_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_mover_close_reply (XDR *xdrs, ndmp9_mover_close_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_operation (XDR *xdrs, ndmp9_data_operation *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_state (XDR *xdrs, ndmp9_data_state *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_halt_reason (XDR *xdrs, ndmp9_data_halt_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_get_state_request (XDR *xdrs, ndmp9_data_get_state_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_get_state_reply (XDR *xdrs, ndmp9_data_get_state_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp9_data_operation (xdrs, &objp->operation))
-               return FALSE;
-       if (!xdr_ndmp9_data_state (xdrs, &objp->state))
-               return FALSE;
-       if (!xdr_ndmp9_data_halt_reason (xdrs, &objp->halt_reason))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->bytes_processed))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->est_bytes_remain))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->est_time_remain))
-               return FALSE;
-       if (!xdr_ndmp9_addr (xdrs, &objp->data_connection_addr))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->read_offset))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->read_length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp9_data_operation (xdrs, &objp->operation))
+                return FALSE;
+        if (!xdr_ndmp9_data_state (xdrs, &objp->state))
+                return FALSE;
+        if (!xdr_ndmp9_data_halt_reason (xdrs, &objp->halt_reason))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->bytes_processed))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->est_bytes_remain))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->est_time_remain))
+                return FALSE;
+        if (!xdr_ndmp9_addr (xdrs, &objp->data_connection_addr))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->read_offset))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->read_length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_name (XDR *xdrs, ndmp9_name *objp)
 {
-       if (!xdr_string (xdrs, &objp->original_path, ~0))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->destination_path, ~0))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->fh_info))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->original_path, ~0))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->destination_path, ~0))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->fh_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_start_backup_request (XDR *xdrs, ndmp9_data_start_backup_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->bu_type, ~0))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->bu_type, ~0))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp9_pval), (xdrproc_t) xdr_ndmp9_pval))
-               return FALSE;
-       if (!xdr_ndmp9_addr (xdrs, &objp->addr))
-               return FALSE;
+                return FALSE;
+        if (!xdr_ndmp9_addr (xdrs, &objp->addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_start_backup_reply (XDR *xdrs, ndmp9_data_start_backup_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_start_recover_request (XDR *xdrs, ndmp9_data_start_recover_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp9_pval), (xdrproc_t) xdr_ndmp9_pval))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
                sizeof (ndmp9_name), (xdrproc_t) xdr_ndmp9_name))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->bu_type, ~0))
-               return FALSE;
-       if (!xdr_ndmp9_addr (xdrs, &objp->addr))
-               return FALSE;
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->bu_type, ~0))
+                return FALSE;
+        if (!xdr_ndmp9_addr (xdrs, &objp->addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_start_recover_reply (XDR *xdrs, ndmp9_data_start_recover_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_start_recover_filehist_request (XDR *xdrs, ndmp9_data_start_recover_filehist_request *objp)
 {
-       if (!xdr_ndmp9_data_start_recover_request (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_data_start_recover_request (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_start_recover_filehist_reply (XDR *xdrs, ndmp9_data_start_recover_filehist_reply *objp)
 {
-       if (!xdr_ndmp9_data_start_recover_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_data_start_recover_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_abort_request (XDR *xdrs, ndmp9_data_abort_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_abort_reply (XDR *xdrs, ndmp9_data_abort_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_stop_request (XDR *xdrs, ndmp9_data_stop_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_stop_reply (XDR *xdrs, ndmp9_data_stop_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_get_env_request (XDR *xdrs, ndmp9_data_get_env_request *objp)
 {
-       if (!xdr_ndmp9_no_arguments (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_no_arguments (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_get_env_reply (XDR *xdrs, ndmp9_data_get_env_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
                sizeof (ndmp9_pval), (xdrproc_t) xdr_ndmp9_pval))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_listen_request (XDR *xdrs, ndmp9_data_listen_request *objp)
 {
-       if (!xdr_ndmp9_addr_type (xdrs, &objp->addr_type))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_addr_type (xdrs, &objp->addr_type))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_listen_reply (XDR *xdrs, ndmp9_data_listen_reply *objp)
 {
-       if (!xdr_ndmp9_error (xdrs, &objp->error))
-               return FALSE;
-       if (!xdr_ndmp9_addr (xdrs, &objp->data_connection_addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_error (xdrs, &objp->error))
+                return FALSE;
+        if (!xdr_ndmp9_addr (xdrs, &objp->data_connection_addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_connect_request (XDR *xdrs, ndmp9_data_connect_request *objp)
 {
-       if (!xdr_ndmp9_addr (xdrs, &objp->addr))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_addr (xdrs, &objp->addr))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_data_connect_reply (XDR *xdrs, ndmp9_data_connect_reply *objp)
 {
-       if (!xdr_ndmp9_just_error_reply (xdrs, objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_just_error_reply (xdrs, objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_notify_data_halted_request (XDR *xdrs, ndmp9_notify_data_halted_request *objp)
 {
-       if (!xdr_ndmp9_data_halt_reason (xdrs, &objp->reason))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_data_halt_reason (xdrs, &objp->reason))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_connect_reason (XDR *xdrs, ndmp9_connect_reason *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_notify_connected_request (XDR *xdrs, ndmp9_notify_connected_request *objp)
 {
-       if (!xdr_ndmp9_connect_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_u_short (xdrs, &objp->protocol_version))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->text_reason, ~0))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_connect_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_u_short (xdrs, &objp->protocol_version))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->text_reason, ~0))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_notify_mover_halted_request (XDR *xdrs, ndmp9_notify_mover_halted_request *objp)
 {
-       if (!xdr_ndmp9_mover_halt_reason (xdrs, &objp->reason))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_mover_halt_reason (xdrs, &objp->reason))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_notify_mover_paused_request (XDR *xdrs, ndmp9_notify_mover_paused_request *objp)
 {
-       if (!xdr_ndmp9_mover_pause_reason (xdrs, &objp->reason))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->seek_position))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_mover_pause_reason (xdrs, &objp->reason))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->seek_position))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_notify_data_read_request (XDR *xdrs, ndmp9_notify_data_read_request *objp)
 {
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->offset))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->length))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->offset))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->length))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_log_type (XDR *xdrs, ndmp9_log_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_log_message_request (XDR *xdrs, ndmp9_log_message_request *objp)
 {
-       if (!xdr_ndmp9_log_type (xdrs, &objp->log_type))
-               return FALSE;
-       if (!xdr_u_long (xdrs, &objp->message_id))
-               return FALSE;
-       if (!xdr_string (xdrs, &objp->entry, ~0))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->associated_message_sequence))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_log_type (xdrs, &objp->log_type))
+                return FALSE;
+        if (!xdr_u_long (xdrs, &objp->message_id))
+                return FALSE;
+        if (!xdr_string (xdrs, &objp->entry, ~0))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->associated_message_sequence))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_recovery_status (XDR *xdrs, ndmp9_recovery_status *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_log_file_request (XDR *xdrs, ndmp9_log_file_request *objp)
 {
-       if (!xdr_string (xdrs, &objp->name, ~0))
-               return FALSE;
-       if (!xdr_ndmp9_recovery_status (xdrs, &objp->recovery_status))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->name, ~0))
+                return FALSE;
+        if (!xdr_ndmp9_recovery_status (xdrs, &objp->recovery_status))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_file_type (XDR *xdrs, ndmp9_file_type *objp)
 {
-       if (!xdr_enum (xdrs, (enum_t *) objp))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_enum (xdrs, (enum_t *) objp))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_file_stat (XDR *xdrs, ndmp9_file_stat *objp)
 {
-       if (!xdr_ndmp9_file_type (xdrs, &objp->ftype))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->mtime))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->atime))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->ctime))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->uid))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->gid))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->mode))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->size))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_long (xdrs, &objp->links))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->fh_info))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_file_type (xdrs, &objp->ftype))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->mtime))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->atime))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->ctime))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->uid))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->gid))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->mode))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->size))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_long (xdrs, &objp->links))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_ndmp9_valid_u_quad (xdrs, &objp->fh_info))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_file (XDR *xdrs, ndmp9_file *objp)
 {
-       if (!xdr_string (xdrs, &objp->unix_path, ~0))
-               return FALSE;
-       if (!xdr_ndmp9_file_stat (xdrs, &objp->fstat))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->unix_path, ~0))
+                return FALSE;
+        if (!xdr_ndmp9_file_stat (xdrs, &objp->fstat))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_fh_add_file_request (XDR *xdrs, ndmp9_fh_add_file_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->files.files_val, (u_int *) &objp->files.files_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->files.files_val, (u_int *) &objp->files.files_len, ~0,
                sizeof (ndmp9_file), (xdrproc_t) xdr_ndmp9_file))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_dir (XDR *xdrs, ndmp9_dir *objp)
 {
-       if (!xdr_string (xdrs, &objp->unix_name, ~0))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->node))
-               return FALSE;
-       if (!xdr_ndmp9_u_quad (xdrs, &objp->parent))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_string (xdrs, &objp->unix_name, ~0))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->node))
+                return FALSE;
+        if (!xdr_ndmp9_u_quad (xdrs, &objp->parent))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_fh_add_dir_request (XDR *xdrs, ndmp9_fh_add_dir_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->dirs.dirs_val, (u_int *) &objp->dirs.dirs_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->dirs.dirs_val, (u_int *) &objp->dirs.dirs_len, ~0,
                sizeof (ndmp9_dir), (xdrproc_t) xdr_ndmp9_dir))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_node (XDR *xdrs, ndmp9_node *objp)
 {
-       if (!xdr_ndmp9_file_stat (xdrs, &objp->fstat))
-               return FALSE;
+       register int32_t *buf;
+
+        if (!xdr_ndmp9_file_stat (xdrs, &objp->fstat))
+                return FALSE;
        return TRUE;
 }
 
 bool_t
 xdr_ndmp9_fh_add_node_request (XDR *xdrs, ndmp9_fh_add_node_request *objp)
 {
-       if (!xdr_array (xdrs, (char **)&objp->nodes.nodes_val, (u_int *) &objp->nodes.nodes_len, ~0,
+       register int32_t *buf;
+
+        if (!xdr_array (xdrs, (char **)&objp->nodes.nodes_val, (u_int *) &objp->nodes.nodes_len, ~0,
                sizeof (ndmp9_node), (xdrproc_t) xdr_ndmp9_node))
-               return FALSE;
+                return FALSE;
        return TRUE;
 }
index d5a5bf2bb3b7677bfb4558e4be7644727578c187..9f9a45274a615829b9aeb0fb5f92e54350ab3f0a 100644 (file)
@@ -489,6 +489,39 @@ ndmp_connection_mover_listen(
     return TRUE;
 }
 
+ndmp_connection_mover_connect(
+       NDMPConnection *self,
+       ndmp9_mover_mode mode,
+       DirectTCPAddr *addrs)
+{
+    unsigned int naddrs, i;
+    ndmp4_tcp_addr *na;
+
+    g_assert(!self->startup_err);
+
+    /* count addrs */
+    g_assert(addrs);
+    for (naddrs = 0; addrs[naddrs].ipv4; naddrs++) ;
+
+    /* convert addrs to an ndmp4_tcp_addr */
+    na = g_new0(ndmp4_tcp_addr, naddrs);
+    for (i = 0; i < naddrs; i++) {
+       na[i].ip_addr = addrs[i].ipv4;
+       na[i].port = addrs[i].port;
+    }
+
+
+    NDMP_TRANS(self, ndmp4_mover_connect)
+       request->mode = mode;
+       request->addr.addr_type = NDMP4_ADDR_TCP;
+       request->addr.ndmp4_addr_u.tcp_addr.tcp_addr_len = naddrs;
+       request->addr.ndmp4_addr_u.tcp_addr.tcp_addr_val = na;
+       NDMP_CALL(self);
+       NDMP_FREE();
+    NDMP_END
+    return TRUE;
+}
+
 gboolean
 ndmp_connection_mover_abort(
        NDMPConnection *self)
@@ -643,6 +676,9 @@ ndmp_connection_wait_for_notify(
 
     while (1) {
        gboolean found = FALSE;
+       int fd;
+       SELECT_ARG_TYPE readset;
+       int nfound;
 
        /* if any desired notifications have been received, then we're
         * done */
@@ -671,7 +707,18 @@ ndmp_connection_wait_for_notify(
            return TRUE;
 
        /* otherwise, wait for an incoming packet and handle it, then try
-        * again */
+        * again.  There's some select trickery here to avoid hogging the
+        * ndmlib_mutex - basically, we want to block as long as possible
+        * outside of the ndmlib_mutex critical section.  This will also be
+        * useful to allow the wait to be aborted. */
+       fd = self->conn->chan.fd;
+       FD_ZERO(&readset);
+       FD_SET(fd, &readset);
+       nfound = select(fd+1, &readset, NULL, NULL, NULL);
+
+       /* fall on through, blind to any errors - presumably the same error
+        * condition will be caught by ndmconn_recv_nmb. */
+
        g_static_mutex_lock(&ndmlib_mutex);
        NDMOS_MACRO_ZEROFILL(&nmb);
        nmb.protocol_version = NDMP4VER;
index ff03751a16740677c648eeeb69a83daeb64d6f14..350243b21313204a1e715f5db2b25cc1795359b6 100644 (file)
@@ -190,6 +190,11 @@ gboolean ndmp_connection_mover_listen(
        ndmp9_addr_type addr_type,
        DirectTCPAddr **addrs);
 
+gboolean ndmp_connection_mover_connect(
+       NDMPConnection *self,
+       ndmp9_mover_mode mode,
+       DirectTCPAddr *addrs);
+
 gboolean ndmp_connection_mover_abort(
        NDMPConnection *self);
 
index 0338d9838d3eb4e5a95d7c7e26afec13db4b797d..24ec01722272c6964556b1fd7212aee556765830 100644 (file)
@@ -53,9 +53,6 @@ uparse.$(OBJEXT): uparse.c
        $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
 
 
-INSTALLPERMS_exec = \
-       dest=$(sbindir) chown=amanda chmod=0750 $(sbin_PROGRAMS)
-
 lint:
        @ f="$(amoldrecover_CSRC)";                                             \
        (cd ../common-src; make listlibsrc);                                    \
index 42c21c4b9f4c4af25ed71df29b21748f930cf639..747ec0bdc921efc0eb0ddb796ab951dee19a11a0 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -132,7 +134,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -160,7 +161,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -173,10 +173,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -190,7 +194,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -203,10 +209,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -218,21 +227,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -320,7 +333,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -340,10 +353,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -399,78 +409,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -481,12 +546,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -501,17 +595,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -520,60 +618,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -581,13 +738,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -596,9 +759,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -634,7 +800,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -643,7 +808,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -651,19 +815,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -689,47 +876,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -737,6 +980,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -759,19 +1003,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -781,13 +1027,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -831,6 +1074,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -890,6 +1134,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/client-src   \
@@ -919,9 +1176,6 @@ amoldrecover_CSRC = amrecover.c                                    \
 amoldrecover_SOURCES = $(amoldrecover_CSRC)    uparse.y        uscan.l
 noinst_HEADERS = amrecover.h uparse.h
 AM_YFLAGS = -d
-INSTALLPERMS_exec = \
-       dest=$(sbindir) chown=amanda chmod=0750 $(sbin_PROGRAMS)
-
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -1275,29 +1529,12 @@ uninstall-am: uninstall-sbinPROGRAMS
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index 2ced84e273cfb4f41856bf90027ed382a8c9c5b8..2add4a33db47e8a030e3140963937e2091bd457b 100644 (file)
@@ -50,7 +50,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -78,7 +77,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -91,10 +89,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -108,7 +110,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -121,10 +125,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -136,21 +143,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -203,7 +214,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -223,10 +234,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -282,78 +290,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -364,12 +427,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -384,17 +476,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -403,60 +499,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -464,13 +619,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -479,9 +640,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -517,7 +681,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -526,7 +689,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -534,19 +696,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -572,47 +757,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -620,6 +861,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -642,19 +884,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -664,13 +908,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -714,6 +955,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
index 1b56bcf738baf3075f4185bf52a8604e10a9a3f9..8b5e38496b58539d401f0b9c7abe4b360d614a54 100755 (executable)
@@ -17,7 +17,7 @@ if ( not -e "packaging/common/substitute.pl" ) {
 
 sub get_version {
        # Two build cases: from checkout (svn info works), or dist tarball
-       # (configure.ac will have the version). First try configure.ac, then
+       # (FULL_VERSION will exist). First try FULL_VERSION, then
        # try svn info, which takes more time and processing. We assume our url
        # is structured something like this:
        # http://<server>/<project>/<trunk|branches|tags>/[<branch>|<tag>]
@@ -25,19 +25,19 @@ sub get_version {
        # file:/// and short DNS names should work too.
        
        my $VERSION;
-       my $version_file = "VERSION";
+       my $version_file = "FULL_VERSION";
        my $version_handle;
        my $versioned_tree = 'packaging/deb';
        if (-e $version_file) {
-               # Autogen has been run, search VERSION file.
+               # Autogen has been run, search FULL_VERSION file.
                if (-e "$version_file") {
                        open($version_handle, "<", "$version_file") or
-                           die "Could not open VERSION.";
+                           die "Could not open FULL_VERSION.";
                        chomp($VERSION = <$version_handle>);
                        close($version_file);
                        
                } else {
-                       die "Could not find VERSION file.";
+                       die "Could not find FULL_VERSION file.";
                }
        }
        if ( ! $VERSION ) {
index c28d53442e43a647db6b5f79e1ea4290c51dd802..ef937084b9275e9dc15dca93354fb3c74dddc42e 100755 (executable)
@@ -1,22 +1,15 @@
 #! /bin/bash
 set -x
 #### Configure variables.  Feel free to change these, but be careful!
-SRCDIR=$(pwd)
+SRCDIR=$PWD
 # You can pass your own temp directory as an environment variable.
-if [ -z $TMPDIR ]
-then
-    TMPDIR="`pwd`/buildpkg.deb"
-fi
 # This prefix is prepended to all directories during "make install" 
-FAKEROOT="${TMPDIR}/froot"
+FAKEROOT="${SRCDIR}/froot"
 # Configure and Compilation directory.
-BUILDDIR="${TMPDIR}/build"
+BUILDDIR="${SRCDIR}/build"
 # Config variables to mirror those in RPM .spec file
 amanda_user=amandabackup
 amanda_group=admin
-udpportrange="700,740"
-tcpportrange="11000,11040"
-low_tcpportrange="700,710"
 PREFIX="/usr"
 EPREFIX="${PREFIX}"
 BINDIR="${EPREFIX}/bin"
index 1fc851306057c535e0880cecde02afe6b370ccc3..874ce4bc0cf2032957c7b4629acf8196606e53d8 100644 (file)
@@ -3,15 +3,15 @@ Section: utils
 Priority: optional
 Maintainer: Zmanda Inc <support@zmanda.com>
 Build-Depends: debhelper, dump, fakeroot, flex, gnuplot|gnuplot-nox, libtool,
-       mailx|bsd-mailx, mtx, perl (>=5.6.0), smbclient, libcurl-dev,
+       mailx|bsd-mailx, mtx, perl (>=5.6.0), procps, smbclient, libcurl-dev,
        libglib2.0-dev, libncurses5-dev, libreadline5-dev|libreadline-dev,
        libssl-dev
 Standards-Version: 3.6.1
 
 Package: amanda-backup-server
 Architecture: any
-Depends: xinetd, perl (>=5.6.0), mailx|bsd-mailx, gnuplot|gnuplot-nox,
-       tar (>=1.15), ${shlibs:Depends}, ${perl:Depends}
+Depends: ca-certificates, xinetd, perl (>=5.6.0), mailx|bsd-mailx,
+       gnuplot|gnuplot-nox, tar (>=1.15), ${shlibs:Depends}, ${perl:Depends}
 Conflicts: amanda-client, amanda-common, amanda-server, amanda-backup-client
 Description: Amanda Network Backup and Archiving software
  .
@@ -27,7 +27,8 @@ Description: Amanda Network Backup and Archiving software
 
 Package: amanda-backup-client
 Architecture: any
-Depends: xinetd, perl (>=5.6.0), grep, ${shlibs:Depends}, ${perl:Depends}
+Depends: ca-certificates, xinetd, perl (>=5.6.0), grep, ${shlibs:Depends},
+       ${perl:Depends}
 Conflicts: amanda-backup-server, amanda-client, amanda-common, amanda-server
 Description: Amanda Network Backup and Archiving software
  .
index 279863b8d89b830f1aa95bdcbf7955402b089e8f..779c5461d2d1f9a272e60c0fa27023d38ccf5f7d 100755 (executable)
@@ -1,14 +1,13 @@
 #!/usr/bin/make -f
 # debian/rules for amanda using debhelper. GNU copyright 2008 by Dan Locks, 
 # based on work by Bdale Garbee.
-# requires automake 1.2d (from experimental tree)
 
 #      Warning - do *not* use -j on an SMP machine, or the build gets
 #              confused... some sort of race condition in the makefiles?
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
-AMVER=2.6.2alpha
+AMVER=3.2alpha
 
 # These are variables that the user can override.  They get used in various
 # places during configure, build, and install.
@@ -76,9 +75,6 @@ build-stamp: /sbin/dump /usr/bin/smbclient
                --with-amandahosts \
                --with-smbclient=$(BINDIR)/smbclient \
                --with-debugging=$(LOGDIR) \
-               --with-tcpportrange=11000,11040 \
-                --with-low-tcpportrange=700,710 \
-               --with-udpportrange=700,740 \
                --with-ssh-security \
                --with-assertions \
                --enable-s3-device \
diff --git a/packaging/rpm/amanda.spec b/packaging/rpm/amanda.spec
deleted file mode 100644 (file)
index 2c487a5..0000000
+++ /dev/null
@@ -1,1768 +0,0 @@
-#
-#                  Copyright (C) 2005 Zmanda Incorporated.
-#                            All Rights Reserved.
-#
-#  This program is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU General Public License version 2 as published
-#  by the Free Software Foundation.
-# 
-#  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
-# 
-#  Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
-#  Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
-#
-
-
-%define build_srpm 0
-%{?srpm_only: %define build_srpm 1}
-
-# Pkg-config sometimes needs its own path set, and we need to allow users to
-# override our guess during detection.  This macro takes care of that.
-# If no --define PKG_CONFIG_PATH was passed and env var $PKG_CONFIG_PATH is 
-# set then use the env var.
-%{!?PKG_CONFIG_PATH: %{expand:%(echo ${PKG_CONFIG_PATH:+"%%define PKG_CONFIG_PATH $PKG_CONFIG_PATH"})}}
-
-%{?PKG_CONFIG_PATH:%{echo:PKG_CONFIG_PATH = %{PKG_CONFIG_PATH}}}
-
-# Define which Distribution we are building:
-# Try to detect the distribution we are building:
-%if %{_vendor} == redhat 
-    # Fedora symlinks /etc/fedora-release to /etc/redhat-release for at least
-    # fc3-8.  So RHEL and Fedora look at the same file.  Different versions have
-    # different numbers of spaces; hence the use if $3 vs. $4..
-    %if %(awk '$1 == "Fedora" && $4 ~ /3.*/ { exit 1; }' /etc/redhat-release; echo $?)
-        %define dist fedora
-        %define disttag fc
-        %define distver 3
-       %define requires_libtermcap Requires: libtermcap.so.2
-    %endif
-    %if %(awk '$1 == "Fedora" && $4 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?)
-        %define dist fedora
-        %define disttag fc
-        %define distver 4
-       %define requires_libtermcap Requires: libtermcap.so.2
-    %endif
-    %if %(awk '$1 == "Fedora" && $4 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?)
-        %define dist fedora
-        %define disttag fc
-        %define distver 5
-       %define requires_libtermcap Requires: libtermcap.so.2
-    %endif
-    %if %(awk '$1 == "Fedora" && $4 ~ /6.*/ { exit 1; }' /etc/redhat-release; echo $?)
-        %define dist fedora
-        %define disttag fc
-        %define distver 6
-       %define requires_libtermcap Requires: libtermcap.so.2
-    %endif
-    %if %(awk '$1 == "Fedora" && $3 ~ /7.*/ { exit 1; }' /etc/redhat-release; echo $?)
-        %define dist fedora
-        %define disttag fc
-        %define distver 7
-       %define requires_libtermcap Requires: libtermcap.so.2
-    %endif
-    # if macro cannot have an empty test and we're just testing the existance
-    %if %{?fedora:yes}%{!?fedora:no} == yes
-        %define dist fedora
-        %define disttag fc
-        %define distver %{fedora}
-       %if %{distver} <= 8
-           %define requires_libtermcap Requires: libtermcap.so.2
-       %endif
-        %if %{_host_cpu} == x86_64 && %{_target_cpu} == i686
-                # Do nothing if PKG_CONFIG_PATH was set by the user above.
-                %{!?PKG_CONFIG_PATH: %define PKG_CONFIG_PATH /usr/lib/pkgconfig}
-        %endif
-    %endif
-    %if %(awk '$1 == "Red" && $7 ~ /3.*/ { exit 1; }' /etc/redhat-release; echo $?)
-        %define dist redhat
-        %define disttag rhel
-        %define distver 3
-        %define tarver 1.14
-       %define requires_libtermcap Requires: libtermcap.so.2
-       %define without_ipv6 --without-ipv6
-    %endif
-    %if %(awk '$1 == "Red" && $7 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?)
-        %define dist redhat
-        %define disttag rhel
-        %define distver 4
-        %define tarver 1.14
-       %define requires_libtermcap Requires: libtermcap.so.2
-    %endif
-    %if %(awk '$1 == "CentOS" && $3 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?)
-       %define dist redhat
-       %define disttag rhel
-       %define distver 4
-       %define tarver 1.14
-       %define requires_libtermcap Requires: libtermcap.so.2
-    %endif
-    %if %(awk '$1 == "Red" && $7 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?)
-        %define dist redhat
-        %define disttag rhel
-        %define distver 5
-       %define requires_libtermcap Requires: libtermcap.so.2
-    %endif
-    %if %(awk '$1 == "CentOS" && $3 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?)
-        %define dist redhat
-        %define disttag rhel
-        %define distver 5
-       %define requires_libtermcap Requires: libtermcap.so.2
-    %endif
-    
-    # If dist is undefined, we didn't detect.
-    %{!?dist:%define dist unknown}
-%endif
-# Detect Suse variants. 
-%if %{_vendor} == "suse"
-    %define dist SuSE
-    %define disttag %(awk '$1=="SUSE" {$3=="Enterprise" ? TAG="sles" : TAG="suse" ; print TAG}' /etc/SuSE-release)
-    %define distver %(awk '$1=="SUSE" {$3=="Enterprise" ? VER=$5 : VER=$3 ; print VER}' /etc/SuSE-release)
-%endif
-
-# Set options per distribution
-%if %{dist} == redhat || %{dist} == fedora
-    %define rpm_group Applications/Archiving
-    %define xinetd_reload restart
-    %define requires_initscripts Requires: initscripts
-%endif
-%if %{dist} == SuSE
-    %define rpm_group Productivity/Archiving/Backup
-    %define xinetd_reload restart
-%endif
-
-# Let's die if we haven't detected the distro. This might save some frustration.
-# RPM does not provide a way to  exit gracefully, hence the tag_to_cause_exit. 
-%{!?distver: %{error:"Your distribution and its version were not detected."}; %tag_to_cause_exit }
-# Set minimum tar version if it wasn't set in the per-distro section
-%{!?tarver: %define tarver 1.15}
-
-%define packer %(%{__id_u} -n)
-
-# --- Definitions ---
-
-# Define amanda_version from configure.in if it is not already defined.
-
-%{!?amanda_version: %define amanda_version %(eval %{__cat} FULL_VERSION) }
-%{!?amanda_release: %define amanda_release 1}
-%define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
-%define amanda_user amandabackup
-%define amanda_group disk
-%define udpportrange "700,740"
-%define tcpportrange "11000,11040"
-%define low_tcpportrange "700,710"
-
-Summary: The Amanda Backup and Archiving System
-Name: amanda
-Version: %{amanda_version}
-%define rpm_release %{amanda_release}.%{disttag}%{distver}
-%if %{build_srpm}
-%define rpm_release %{amanda_release}
-%endif
-Release: %{rpm_release}
-Source: %{name}-%{version}.tar.gz
-License: http://wiki.zmanda.com/index.php/Amanda_Copyright
-Vendor: Zmanda, Inc.
-Packager: www.zmanda.com
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{packer}-buildroot
-Group: %{rpm_group}
-# TODO - Need required versions for these:
-BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: binutils
-BuildRequires: bison
-BuildRequires: flex
-BuildRequires: gcc
-BuildRequires: glibc >= 2.2.0
-BuildRequires: readline
-# Note: newer distros have changed most *-devel to lib*-devel, and added a
-# provides tag for backwards compat.
-BuildRequires: readline-devel
-BuildRequires: curl >= 7.10.0
-BuildRequires: curl-devel >= 7.10.0
-BuildRequires: openssl
-BuildRequires: openssl-devel
-BuildRequires: perl(ExtUtils::Embed)
-Requires: /bin/awk
-Requires: /bin/date
-Requires: /usr/bin/id
-Requires: /sbin/ldconfig
-Requires: /bin/sh
-Requires: /usr/sbin/useradd
-Requires: /usr/sbin/usermod
-Requires: fileutils
-Requires: grep
-Requires: gnuplot
-Requires: libc.so.6
-Requires: libm.so.6
-Requires: libnsl.so.1
-Requires: curl >= 7.10.0
-Requires: openssl
-Requires: xinetd
-Requires: perl >= 5.6.0
-Requires: tar >= %{tarver}
-Requires: readline
-%{?requires_libtermcap}
-%{?requires_initscripts}
-Provides: amanda-backup_client = %{amanda_version}, amanda-backup_server = %{amanda_version}
-
-%package backup_client
-Summary: The Amanda Backup and Archiving Client
-Group: %{rpm_group}
-Requires: /bin/awk
-Requires: fileutils
-Requires: grep
-%{?requires_libtermcap}
-%{?requires_initscripts}
-Requires: xinetd
-Requires: libc.so.6
-Requires: libm.so.6
-Requires: libnsl.so.1
-Requires: perl >= 5.6.0
-Requires: tar >= %{tarver}
-Requires: readline
-Provides: amanda-backup_client = %{amanda_version}
-Provides: libamclient-%{version}.so = %{amanda_version}
-Provides: libamanda-%{version}.so = %{amanda_version}
-Conflicts: amanda-backup_server
-# Native package names
-Obsoletes: amanda, amanda-client, amanda-server
-
-%package backup_server
-Summary: The Amanda Backup and Archiving Server
-Group: %{rpm_group}
-Requires: /bin/awk
-Requires: fileutils
-Requires: grep
-Requires: libc.so.6
-Requires: libm.so.6
-Requires: libnsl.so.1
-%{?requires_libtermcap}
-%{?requires_initscripts}
-Requires: xinetd
-Requires: perl >= 5.6.0
-Requires: tar >= %{tarver}
-Provides: amanda-backup_server = %{amanda_version}
-Provides: amanda-backup_client = %{amanda_version}
-Provides: libamclient-%{version}.so = %{amanda_version}
-Provides: libamanda-%{version}.so = %{amanda_version}
-Provides: libamserver-%{version}.so = %{amanda_version}
-Provides: libamtape-%{version}.so = %{amanda_version}
-Provides: libamdevice-%{version}.so = %{amanda_version}
-Conflicts: amanda-backup_client
-# Native package names
-Obsoletes: amanda, amanda-client, amanda-server
-# --- Package descriptions ---
-
-%description
-Amanda is the leading Open-Source Backup and Archiving software.
-
-The amanda-backup_server package should be installed on the Amanda server, i.e. 
-the machine attached to backup media (such as a tape drive or disk 
-drives) where backups will be written. The amanda-backup_server package
-includes Amanda client.  The amanda-backup_client package needs 
-to be installed on every system that is being backed up.
-
-Amanda Forums is located at: http://forums.zmanda.com/
-Amanda Documentation is available at: http://wiki.zmanda.com/
-
-
-
-%description backup_server
-Amanda is the leading Open-Source Backup and Archiving software.
-
-This package contains the Amanda server.  The amanda-backup_server package 
-should be installed on the Amanda server, i.e. the machine attached 
-to backup media (such as a tape drive or disk drives) where backups 
-will be written.  The amanda-backup_server package includes Amanda client.
-
-Amanda Forums is located at: http://forums.zmanda.com/
-Amanda Documentation is available at: http://wiki.zmanda.com/
-
-
-
-%description backup_client
-Amanda is the leading Open-Source Backup and Archiving software.
-
-This package contains the Amanda client.  The amanda-backup_client package  
-needs to be installed on every system that is being backed up.
-
-Amanda Forums is located at: http://forums.zmanda.com/
-Amanda Documentation is available at: http://wiki.zmanda.com/
-
-# --- Directory setup ---
-
-# Configure directories:
-%define PREFIX          /usr
-%define EPREFIX         %{PREFIX}
-%define BINDIR          %{EPREFIX}/bin
-%define SBINDIR         %{EPREFIX}/sbin
-%define LIBEXECDIR      %{EPREFIX}/libexec
-%define AMLIBEXECDIR    %{LIBEXECDIR}/amanda
-%define DATADIR         %{PREFIX}/share
-%define SYSCONFDIR      /etc
-%define LOCALSTATEDIR   /var
-%define AMANDATES       %{AMANDAHOMEDIR}/amandates
-%define AMANDAHOMEDIR   %{LOCALSTATEDIR}/lib/amanda
-%ifarch x86_64
-%define LIBDIR          %{EPREFIX}/lib64
-%else
-%define LIBDIR          %{EPREFIX}/lib
-%endif
-%define AMLIBDIR        %{LIBDIR}/amanda
-%define INCLUDEDIR      %{PREFIX}/include
-%define MANDIR          %{DATADIR}/man
-%define LOGDIR          /var/log/amanda
-%define PERLSITELIB     %(eval "`perl -V:installsitelib`"; echo $installsitelib)
-%define AMDATADIR      /var/lib/amanda
-
-# Installation directories:
-%define ROOT_SBINDIR            %{buildroot}/%{SBINDIR}
-%define ROOT_LIBEXECDIR         %{buildroot}/%{LIBEXECDIR}
-%define ROOT_DATADIR            %{buildroot}/%{DATADIR}
-%define ROOT_LOCALSTATEDIR      %{buildroot}/%{LOCALSTATEDIR}
-%define ROOT_SYSCONFDIR         %{buildroot}/%{SYSCONFDIR}
-%define ROOT_AMANDAHOMEDIR      %{buildroot}/%{AMANDAHOMEDIR}
-%define ROOT_LIBDIR             %{buildroot}/%{LIBDIR}
-%define ROOT_MANDIR             %{buildroot}/%{MANDIR}
-%define ROOT_LOGDIR             %{buildroot}/%{LOGDIR}
-%define ROOT_AMDATADIR          %{buildroot}/%{AMDATADIR}
-
-# --- Unpack ---
-
-%prep
-%setup -q
-# --- Configure and compile ---
-
-%build
-%define config_user %{amanda_user}
-%define config_group %{amanda_group}
-
-# Set PKG_CONFIG_PATH=some/path if some/path was set on the command line, or by 
-# the platform detection bits.
-# without_ipv6 should only be defined on rhel3.
-./configure \
-        %{?PKG_CONFIG_PATH: PKG_CONFIG_PATH=%PKG_CONFIG_PATH} \
-        CFLAGS="%{optflags} -g -pipe" CXXFLAGS="%{optflags}" \
-        --quiet \
-        --prefix=%{PREFIX} \
-        --sysconfdir=%{SYSCONFDIR} \
-        --sharedstatedir=%{LOCALSTATEDIR} \
-        --localstatedir=%{LOCALSTATEDIR} \
-        --libdir=%{LIBDIR} \
-        --includedir=%{INCLUDEDIR} \
-       --mandir=%{MANDIR} \
-       --with-amdatadir=%{AMDATADIR} \
-        --with-gnuplot=/usr/bin/gnuplot \
-        --with-gnutar=/bin/tar \
-        --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \
-        --with-index-server=localhost \
-        --with-tape-server=localhost \
-        --with-user=%{config_user} \
-        --with-group=%{config_group} \
-        --with-owner=%{packer} \
-        --with-fqdn \
-        --with-bsd-security \
-        --with-bsdtcp-security \
-        --with-bsdudp-security \
-        --with-ssh-security \
-        --with-udpportrange=%{udpportrange} \
-        --with-tcpportrange=%{tcpportrange} \
-        --with-low-tcpportrange=%{low_tcpportrange} \
-        --with-debugging=%{LOGDIR} \
-        --with-assertions \
-        --disable-installperms \
-        %{?without_ipv6}
-
-make -s LIBTOOLFLAGS=--silent
-
-# --- Install to buildroot ---
-
-%install
-if [ "%{buildroot}" != "/" ]; then
-        if [ -d "%{buildroot}" ] ; then
-                rm -rf %{buildroot}
-        fi
-else
-        echo "BuildRoot was somehow set to / !"
-        exit -1
-fi
-
-make -s -j1 LIBTOOLFLAGS=--silent DESTDIR=%{buildroot} install
-
-rm -f %{ROOT_AMANDAHOMEDIR}/example/inetd.conf.amandaclient
-mkdir %{buildroot}/{etc,var/log}
-mkdir %{ROOT_LOCALSTATEDIR}/amanda 
-mkdir %{ROOT_SYSCONFDIR}/amanda
-mkdir %{ROOT_AMANDAHOMEDIR}/gnutar-lists
-mkdir %{ROOT_LOGDIR}
-
-echo "%{amanda_version_info}" >%{ROOT_AMANDAHOMEDIR}/amanda-release
-
-# --- Clean up buildroot ---
-
-%clean
-if [ "%{buildroot}" != "/" ]; then
-        if [ -d "%{buildroot}" ] ; then
-                rm -rf %{buildroot}
-        fi
-else
-        echo "BuildRoot was somehow set to / !"
-        exit -1
-fi
-
-# --- Pre/post (un)installation scripts ---
-
-%pre
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
-
-# Check for the 'amanda' user
-echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
-if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
-        useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
-        if [ %{dist} = "SuSE" ]; then
-                PASSWD_EXIT=$?
-        else
-                # Lock the amanda account until admin sets password
-                passwd -l %{amanda_user} >>/dev/null
-                PASSWD_EXIT=$?
-        fi
-        if [ ${PASSWD_EXIT} -eq 0 ] ; then
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                PASSWD_OK=0
-        else
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                PASSWD_OK=1
-        fi
-else
-        # log information about 'amanda' user parameters
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
-
-        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  user 'amandabackup' is not part of the disk group,Pl !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  make sure it is corrected before start using amanda  !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
-        fi
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        PASSWD_OK=0
-fi
-if [ -d %{AMANDAHOMEDIR} ] ; then
-        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
-        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
-           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
-                echo "correct." >>${TMPFILE}
-                VARLIB_OK=0
-        else
-                echo "incorrect!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
-                VARLIB_OK=1
-        fi
-else
-        VARLIB_OK=0
-fi
-echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-if [ ! -e ${LOGDIR} ] ; then
-        # create log directory
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-elif [ ! -d ${LOGDIR} ] ; then
-        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
-fi
-
-if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
-        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-        exit 1
-else
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda installation started. ===" >${TMPFILE}
-
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}"
-fi
-
-%post
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo -n "`date +'%b %e %Y %T'`: Updating library cache..." >${TMPFILE}
-/sbin/ldconfig >>${TMPFILE} 2>&1
-echo "done." >>${TMPFILE}
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
-        if [ ! -f /etc/xinetd.d/amandaserver ] ; then
-                cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
-                chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1
-                if [ -f /etc/xinetd.d/amandaclient ] ; then
-                        rm /etc/xinetd.d/amandaclient
-                fi
-                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
-                if [ "%{xinetd_reload}" == "reload" ] ; then
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                        if [ ${ret_val} -ne 0 ] ; then
-                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
-                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
-                                ret_val=$?
-                        fi
-                else
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                fi
-                if [ ${ret_val} -eq 0 ] ; then
-                        echo "success." >>${TMPFILE}
-                        cat ${TMPFILE}
-                        cat ${TMPFILE} >>${INSTALL_LOG}
-                else
-                        echo "failed.  Please check your system logs." >>${TMPFILE}
-                        cat ${TMPFILE} 1>&2
-                        cat ${TMPFILE} >>${INSTALL_ERR}
-                fi
-        fi
-fi
-
-echo "`date +'%b %e %Y %T'`: Installing '%{AMANDATES}'." >${TMPFILE}
-ret_val=0
-if [ ! -f %{AMANDATES} ] ; then
-        touch %{AMANDATES} >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The file '%{AMANDATES}' has been created." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDATES}'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{AMANDATES} >>${TMPFILE} 2>&1
-        chmod 0640 %{AMANDATES} >>${TMPFILE} 2>&1
-        if [ -x /sbin/restorecon ] ; then
-              /sbin/restorecon %{AMANDATES}  >>${TMPFILE} 2>&1
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-
-# Install .gnupg directory
-echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
-ret_val=0
-if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
-        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-                ret_val=$?
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-# Install .amandahosts
-echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
-        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-fi
-for host in localhost localhost.localdomain ; do
-        if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
-                echo "${host}   root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts
-        fi
-        if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
-                echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
-        fi
-done
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# SSH RSA key generation for amdump
-KEYDIR="%{AMANDAHOMEDIR}/.ssh"
-KEYFILE="id_rsa_amdump"
-COMMENT="%{amanda_user}@server"
-if [ ! -d ${KEYDIR} ] ; then
-        if [ -f ${KEYDIR} ] ; then
-                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
-                mv ${KEYDIR} ${KEYDIR}.rpmsave
-                cat ${TMPFILE}
-                cat ${TMPFILE} >>${INSTALL_LOG}
-        fi
-        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
-        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
-        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# SSH RSA key generation on client for amrecover
-KEYDIR="%{AMANDAHOMEDIR}/.ssh"
-KEYFILE="id_rsa_amrecover"
-COMMENT="root@client"
-if [ ! -d ${KEYDIR} ] ; then
-        if [ -f ${KEYDIR} ] ; then
-                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
-                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
-                cat ${TMPFILE}
-                cat ${TMPFILE} >>${INSTALL_LOG}
-        fi
-        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
-        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
-        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
-        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# environment variables (~amandabackup/.profile)
-echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
-        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-fi
-if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
-        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
-fi
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >>${TMPFILE}
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
-if [ -x /usr/bin/wget ]; then 
-        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server 
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda installation complete. ===" >${TMPFILE}
-
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}"
-fi
-
-echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-%postun
-/sbin/ldconfig
-%pre backup_server
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
-
-# Check for the 'amanda' user
-echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
-if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
-        useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
-        if [ %{dist} = "SuSE" ]; then
-                PASSWD_EXIT=$?
-        else
-                # Lock the amanda account until admin sets password
-                passwd -l %{amanda_user} >>/dev/null
-                PASSWD_EXIT=$?
-        fi
-        if [ ${PASSWD_EXIT} -eq 0 ] ; then
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                PASSWD_OK=0
-        else
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                     !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                PASSWD_OK=1
-        fi
-else
-        # log information about 'amanda' user parameters
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
-
-        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' is not part of the disk group,Pl  !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! make sure it is corrected before start using Amanda   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
-        fi
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        PASSWD_OK=0
-fi
-if [ -d %{AMANDAHOMEDIR} ] ; then
-        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
-        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
-           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
-                echo "correct." >>${TMPFILE}
-                VARLIB_OK=0
-        else
-                echo "incorrect!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
-                VARLIB_OK=1
-        fi
-else
-        VARLIB_OK=0
-fi
-echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-
-if [ ! -e ${LOGDIR} ] ; then
-        # create log directory
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-elif [ ! -d ${LOGDIR} ] ; then
-        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
-fi
-if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
-        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-        exit 1
-else
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda backup server installation started. ===" >${TMPFILE}
-
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}"
-fi
-%post backup_server
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE}
-/sbin/ldconfig
-echo "done." >>${TMPFILE}
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
-        if [ ! -f /etc/xinetd.d/amandaserver ] ; then
-                cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
-                chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1
-                if [ -f /etc/xinetd.d/amandaclient ] ; then
-                        rm /etc/xinetd.d/amandaclient
-                fi
-
-                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
-                if [ "%{xinetd_reload}" == "reload" ] ; then
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                        if [ ${ret_val} -ne 0 ] ; then
-                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
-                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
-                                ret_val=$?
-                        fi
-                else
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                fi
-                if [ ${ret_val} -eq 0 ] ; then
-                        echo "success." >>${TMPFILE}
-                        cat ${TMPFILE}
-                        cat ${TMPFILE} >>${INSTALL_LOG}
-                else
-                        echo "failed.  Please check your system logs." >>${TMPFILE}
-                        cat ${TMPFILE} 1>&2
-                        cat ${TMPFILE} >>${INSTALL_ERR}
-                fi
-        fi
-fi
-
-echo "`date +'%b %e %Y %T'`: Installing '%{AMANDATES}'." >${TMPFILE}
-ret_val=0
-if [ ! -f %{AMANDATES} ] ; then
-        touch %{AMANDATES} >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The file '%{AMANDATES}' has been created." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDATES}'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{AMANDATES} >>${TMPFILE} 2>&1
-        chmod 0640 %{AMANDATES} >>${TMPFILE} 2>&1
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-# Install .amandahosts to server
-echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
-        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-fi
-for host in localhost localhost.localdomain ; do
-        if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
-                echo "${host}   root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts
-        fi
-        if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
-                echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
-        fi
-done
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# Install amanda client configuration file
-echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE}
-if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then
-        cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-fi
-chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# install am_passphrase file to server
-echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.am_passphrase ] ; then
-        echo "`date +'%b %e %Y %T'`: Create '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE}
-        touch %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
-        phrase=`echo $RANDOM | md5sum | awk '{print $1}'`
-        echo ${phrase} >>%{AMANDAHOMEDIR}/.am_passphrase
-
-        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
-        chmod 0700 %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
-fi
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# Install .gnupg directory
-echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
-ret_val=0
-if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
-        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-                ret_val=$?
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-# SSH RSA key generation on server for amdump
-KEYDIR="%{AMANDAHOMEDIR}/.ssh"
-KEYFILE="id_rsa_amdump"
-COMMENT="%{amanda_user}@server"
-if [ ! -d ${KEYDIR} ] ; then
-        if [ -f ${KEYDIR} ] ; then
-                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
-                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
-                cat ${TMPFILE}
-                cat ${TMPFILE} >>${INSTALL_LOG}
-        fi
-        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
-        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
-        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
-        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# SSH RSA key generation on client for amrecover
-KEYDIR="%{AMANDAHOMEDIR}/.ssh"
-KEYFILE="id_rsa_amrecover"
-COMMENT="root@client"
-if [ ! -d ${KEYDIR} ] ; then
-        if [ -f ${KEYDIR} ] ; then
-                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
-                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
-                cat ${TMPFILE}
-                cat ${TMPFILE} >>${INSTALL_LOG}
-        fi
-        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
-        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
-        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
-        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# environment variables (~amandabackup/.profile)
-echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
-        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-fi
-if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
-        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
-fi
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
-if [ -x /usr/bin/wget ]; then 
-        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server 
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda backup server installation complete. ===" >${TMPFILE}
-
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}" >>${TMPFILE} 2>&1
-fi
-
-echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-%postun backup_server
-/sbin/ldconfig
-%pre backup_client
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
-
-# Check for the 'amanda' user
-echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
-if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
-        useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1
-        if [ %{dist} = "SuSE" ]; then
-                PASSWD_EXIT=$?
-        else
-                # Lock the amanda account until admin sets password
-                passwd -l %{amanda_user} >>/dev/null
-                PASSWD_EXIT=$?
-        fi
-        if [ ${PASSWD_EXIT} -eq 0 ] ; then
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-                PASSWD_OK=0
-        else
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                     !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                PASSWD_OK=1
-        fi
-else
-        # log information about 'amanda' user parameters
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
-        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
-
-        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' is not part of the disk group,Pl  !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! make sure it is corrected before start using Amanda   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
-        fi
-
-        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
-        fi
-        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-        PASSWD_OK=0
-fi
-if [ -d %{AMANDAHOMEDIR} ] ; then
-        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
-        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
-           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
-                echo "correct." >>${TMPFILE}
-                VARLIB_OK=0
-        else
-                echo "incorrect!" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
-                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
-                VARLIB_OK=1
-        fi
-else
-        VARLIB_OK=0
-fi
-echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
-
-if [ ! -e ${LOGDIR} ] ; then
-        # create log directory
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-elif [ ! -d ${LOGDIR} ] ; then
-        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
-        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
-        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
-        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
-fi
-if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
-        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-        exit 1
-else
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda backup client installation started. ===" >${TMPFILE}
-
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}"
-fi
-
-%post backup_client
-TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
-if [ $? -ne 0 ]; then
-        echo "Unable to mktemp!" 1>&2
-        exit 1
-fi
-LOGDIR="%{LOGDIR}"
-INSTALL_LOG="${LOGDIR}/install.log"
-INSTALL_ERR="${LOGDIR}/install.err"
-
-echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE}
-/sbin/ldconfig
-echo "done." >>${TMPFILE}
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
-        if [ ! -f /etc/xinetd.d/amandaclient ] ; then
-                cp %{AMANDAHOMEDIR}/example/xinetd.amandaclient /etc/xinetd.d/amandaclient
-
-                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
-                if [ "%{xinetd_reload}" == "reload" ] ; then
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                        if [ ${ret_val} -ne 0 ] ; then
-                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
-                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
-                                ret_val=$?
-                        fi
-                else
-                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
-                        ret_val=$?
-                fi
-                if [ ${ret_val} -eq 0 ] ; then
-                        echo "success." >>${TMPFILE}
-                        cat ${TMPFILE}
-                        cat ${TMPFILE} >>${INSTALL_LOG}
-                else
-                        echo "failed.  Please check your system logs." >>${TMPFILE}
-                        cat ${TMPFILE}
-                        cat ${TMPFILE} >>${INSTALL_LOG}
-                fi
-        fi
-fi
-
-echo "`date +'%b %e %Y %T'`: Installing '%{AMANDATES}'." >${TMPFILE}
-ret_val=0
-if [ ! -f %{AMANDATES} ] ; then
-        touch %{AMANDATES} >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The file '%{AMANDATES}' has been created." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDATES}'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{AMANDATES} >>${TMPFILE} 2>&1
-        chmod 0640 %{AMANDATES} >>${TMPFILE} 2>&1
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-# Install .amandahosts to client
-echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
-        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-fi
-for host in localhost localhost.localdomain ; do
-                if [ -z "`grep \"^${host}[[:blank:]]\+\" %{AMANDAHOMEDIR}/.amandahosts | grep \"[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\"`" ] ; then
-                        echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
-                fi
-done
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# Install amanda client configuration file
-echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE}
-if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then
-        cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-fi
-chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# Install .gnupg directory
-echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
-ret_val=0
-if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
-        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
-        else
-                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE}
-        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-        ret_val=$?
-        if [ ${ret_val} -eq 0 ]; then
-                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
-                ret_val=$?
-        fi
-fi
-if [ ${ret_val} -eq 0 ]; then
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-else
-        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_ERR}
-fi
-
-# SSH RSA key generation on client for amrecover
-KEYDIR="%{AMANDAHOMEDIR}/.ssh"
-KEYFILE="id_rsa_amrecover"
-COMMENT="root@client"
-if [ ! -d ${KEYDIR} ] ; then
-        if [ -f ${KEYDIR} ] ; then
-                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
-                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
-                cat ${TMPFILE}
-                cat ${TMPFILE} >>${INSTALL_LOG}
-        fi
-        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
-        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
-        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
-        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
-        cat ${TMPFILE}
-        cat ${TMPFILE} >>${INSTALL_LOG}
-fi
-echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
-chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-# environment variables (~amandabackup/.profile)
-echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
-if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
-        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-fi
-if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
-        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
-fi
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE}
-chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
-if [ -x /usr/bin/wget ]; then 
-        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=client 
-fi
-
-echo "`date +'%b %e %Y %T'`: === Amanda backup client installation complete. ===" >>${TMPFILE}
-cat ${TMPFILE}
-cat ${TMPFILE} >>${INSTALL_LOG}
-
-if [ -f "${TMPFILE}" ]; then
-        rm -f "${TMPFILE}"
-fi
-
-echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
-%postun backup_client
-/sbin/ldconfig
-
-# --- Files to install ---
-# Notes:  Do not use wildcards on directories not wholly owned by amanda.  An
-# uninstall of the software will attempt to delete whatever matches here.
-%files backup_client
-%defattr(0755,%{amanda_user},%{amanda_group},0755)
-%{AMLIBEXECDIR}
-%{AMLIBDIR}
-%{PERLSITELIB}/auto/Amanda
-%defattr(4750,root,disk)
-%{AMLIBEXECDIR}/application/amgtar
-%{AMLIBEXECDIR}/application/amstar
-%{AMLIBEXECDIR}/calcsize
-%{AMLIBEXECDIR}/killpgrp
-%{AMLIBEXECDIR}/rundump
-%{AMLIBEXECDIR}/runtar
-%defattr(0750,%{amanda_user},%{amanda_group},0750)
-%{LOGDIR}
-%{SBINDIR}/amaespipe
-%{SBINDIR}/amcryp*
-%{SBINDIR}/amgpgcrypt
-%{SBINDIR}/amoldrecover
-%{SBINDIR}/amrecover
-%{SYSCONFDIR}/amanda
-%defattr(0644,%{amanda_user},%{amanda_group},0755)
-%{LOCALSTATEDIR}/amanda
-%{PERLSITELIB}/Amanda
-%{AMLIBEXECDIR}/amcat.awk
-%{AMANDAHOMEDIR}/gnutar-lists
-%doc %{AMANDAHOMEDIR}/amanda-release
-%doc %{AMANDAHOMEDIR}/example/xinetd.amandaclient
-%doc %{AMANDAHOMEDIR}/example/xinetd.amandaserver
-%doc %{AMANDAHOMEDIR}/example/amanda-client.conf
-%doc %{AMANDAHOMEDIR}/template.d/README
-%doc %{AMANDAHOMEDIR}/template.d/dumptypes
-%defattr(0644,root,root,0755)
-%docdir %{MANDIR}
-%{MANDIR}/man5/amanda.conf.5.gz
-%{MANDIR}/man5/amanda-client.conf.5.gz
-%{MANDIR}/man7/amanda-devices.7.gz
-%{MANDIR}/man7/amanda-applications.7.gz
-%{MANDIR}/man7/amanda-scripts.7.gz
-%{MANDIR}/man8/amaespipe.8.gz
-%{MANDIR}/man8/amanda.8.gz
-%{MANDIR}/man8/amcheckdump.8.gz
-%{MANDIR}/man8/amcrypt*
-%{MANDIR}/man8/amgpgcrypt.8.gz
-%{MANDIR}/man8/amrecover.8.gz
-%doc %{DATADIR}/amanda
-
-%files backup_server
-%defattr(0755,%{amanda_user},%{amanda_group})
-%{AMLIBEXECDIR}
-%{AMLIBDIR}
-%{PERLSITELIB}/Amanda
-%{PERLSITELIB}/auto/Amanda
-%{AMANDAHOMEDIR}
-%{LOCALSTATEDIR}/amanda
-%{SBINDIR}/am*
-%defattr(4750,root,disk)
-%{AMLIBEXECDIR}/application/amgtar
-%{AMLIBEXECDIR}/application/amstar
-%{AMLIBEXECDIR}/calcsize
-%{AMLIBEXECDIR}/killpgrp
-%{AMLIBEXECDIR}/rundump
-%{AMLIBEXECDIR}/runtar
-%{AMLIBEXECDIR}/dumper
-%{AMLIBEXECDIR}/planner
-%{SBINDIR}/amcheck
-%defattr(0750,%{amanda_user},%{amanda_group},0750)
-%{LOGDIR}
-%{SYSCONFDIR}/amanda
-# Files in standard dirs must be listed explicitly
-%{SBINDIR}/activate-devpay
-%{SBINDIR}/amaespipe
-%{SBINDIR}/amcrypt
-%{SBINDIR}/amcrypt-ossl
-%{SBINDIR}/amcrypt-ossl-asym
-%{SBINDIR}/amcryptsimple
-%{SBINDIR}/amgpgcrypt
-%{SBINDIR}/amoldrecover
-%{SBINDIR}/amrecover
-%defattr(0644,%{amanda_user},%{amanda_group})
-%{AMLIBEXECDIR}/amcat.awk
-%{AMLIBEXECDIR}/amplot.awk
-%{AMLIBEXECDIR}/amplot.g
-%{AMLIBEXECDIR}/amplot.gp
-%doc %{AMANDAHOMEDIR}/amanda-release
-%docdir %{AMANDAHOMEDIR}/example
-%docdir %{AMANDAHOMEDIR}/template.d
-%defattr(0644,root,root,0755)
-%docdir %{MANDIR}
-%{MANDIR}/man5/am*
-%{MANDIR}/man5/disklist.5.gz
-%{MANDIR}/man5/tapelist.5.gz
-%{MANDIR}/man7/am*
-%{MANDIR}/man8/am*
-%{MANDIR}/man8/script-email.8.gz
-%doc %{DATADIR}/amanda
-
-# --- ChangeLog
-
-%changelog
-* Mon Sep 15 2008 Dan Locks <dwlocks at zmanda dot com> 2.6.1alpha
-- Added detection of CentOS 4 and 5 as suggested by dswartz
-- graceful failure when Distro/version is not detected correctly
-* Thu Jun 12 2008 Dan Locks <dwlocks at zmanda dot com> 2.6.1alpha
-- install amgtar and amstar suid root
-* Mon Jun 09 2008 Dan Locks <dwlocks at zmanda dot com> 2.6.1alpha
-- Replaced individual SBINDIR/am... entries with SBINDIR/am* in %%files
-* Fri May 02 2008 Dan Locks <dwlocks at zmanda dot com>
-- Changed instances of ${ to %%{ where applicable
-* Tue Mar 11 2008 Dan Locks <dwlocks at zmanda dot com>
-- fixed many rpmlint complaints
-- added --quiet to configure statements
-- added PERLSITELIB to definitions section and perl files to %%files section
-* Wed Feb 13 2008 Dan Locks <dwlocks at zmanda dot com>
-- added an environment check for PKG_CONFIG_PATH
-- added PKG_CONFIG_PATH conditional to handle cross comp on FC8 (environment 
-  var is used if provided)
-* Fri Feb 01 2008 Dan Locks <dwlocks at zmanda dot com>
-- Removed amplot executable and manpages from client installation
-- Added amcheckdump.8 manpage
-- Fixed %%{LOCALSTATEDIR}/amanda dir creation.
-* Wed Jan 23 2008  Dan Locks <dwlocks at zmanda dot com>
-- Change %%{SYSCONFDIR}/amanda/amandates to %%{LOCALSTATEDIR}/amanda/amandates,
-  and added %%{LOCALSTATEDIR}/amanda to the files lists.
-* Mon Jan 14 2008  Dan Locks <dwlocks at zmanda dot com>
-- Updates for perlified amanda, file location moves, gpg setup.
-* Tue Nov  13 2007 Paddy Sreenivasan <paddy at zmanda dot com>
-- Added SYSCONFDIR to client rpm
-- Set xinetd and amanda-client.conf configuration files as part of postinstall
-* Thu Nov  8 2007 Dan Locks <dwlocks at zmanda dot com>
-- Added Linux distribution detection
-* Wed Nov 7 2007 Paddy Sreenivasan <paddy at zmanda dot com>
-- Added amserverconfig, amaddclient, amgpgcrypt, amcryptsimple and libamdevice.
-- Added amanda configuration template files
-* Fri Sep 21 2007 Paddy Sreenivasan <paddy at zmanda dot com>
-- Remove libamserver, libamtape from client rpm
-* Wed Sep 19 2007 Paddy Sreenivasan <paddy at zmanda dot com>
-- Added Fedora 7
-* Tue Jun 26 2007 Kevin Till <ktill at zmanda dot com>
-- set debug log to /var/log/amanda
-* Fri Jan 12 2007 Paddy Sreenivasan <paddy at zmanda dot com>
-- Added label templates
-* Thu Dec 07 2006 Paddy Sreenivasan <paddy at zmanda dot com>
-- Application API changes
-* Fri Jun 16 2006 Kevin Till <ktill at zmanda dot com>
-- make install will install necessary example files. 
-  No need to "cp"
-* Wed Jun 07 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Added amoldrecover and amanda-client.conf man page.
-* Thu Jun 01 2006 Kevin Till <ktill at zmanda dot com> -
-- Added amcrypt-ossl, amcrypt-ossl-asym by Ben Slusky.
-* Thu May 18 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Added SLES10, RHEL3 build options.
-* Tue May 09 2006 Chris Lee <cmlee at zmanda dot com> -
-- Added amanda-release file to amandabackup home directory.
-- Installation message logging cleanup.
-* Thu Apr 27 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Removed dependency on tar version.
-- Moved log directory creation after backup user creation.
-* Wed Apr 19 2006 Chris Lee <cmlee at zmanda dot com> -
-- Added informative message to note the location of pre- and post-
-- install script logs files.
-* Mon Apr 17 2006 Chris Lee <cmlee at zmanda dot com> -
-- Reworked installation message logging and reporting.
-* Fri Apr 14 2006 Chris Lee <cmlee at zmanda dot com> -
-- Changed behavior for creating required localhost entries in the
-- amandahosts file to check for these entries even when the file
-- already exists.
-* Wed Apr 12 2006 Chris Lee <cmlee at zmanda dot com> -
-- Removed pre-install check for "disk" group.  This group should exist
-- by default on almost all modern distributions.
-* Tue Apr 11 2006 Chris Lee <cmlee at zmanda dot com> -
-- Added amandahosts entry for "localhost" without domain.
-* Fri Apr 07 2006 Chris Lee <cmlee at zmanda dot com> -
-- Changed default entries in .amandahosts to use "localdomain" instead
-- of "localnet".
-- Updated amanda_version and release.
-* Mon Apr 03 2006 Chris Lee <cmlee at zmanda dot com> -
-- Added example amanda.conf to files.
-* Thu Mar 16 2006 Chris Lee <cmlee at zmanda dot com> -
-- Corrected an issue with pre-install scripts wrt bug #218.
-- Corrected an issue with post-install scripts and added testing .profile 
-- in amandabackup's home directory for setting environment variables wrt
-- bug #220.
-* Mon Mar 13 2006 Chris Lee <cmlee at zmanda dot com> -
-- Corrected a syntactical error with setting ownership of amandates file
-- wrt bug #216.
-* Wed Mar 08 2006 Chris Lee <cmlee at zmanda dot com> -
-- Added pre-install scripts to verify proper ownership of
-- amandabackup home directory.
-* Thu Feb 2 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Require xinetd. Require termcap and initscripts for Fedora and Redhat.
-* Mon Jan 09 2006 Chris Lee <cmlee at zmanda dot com> -
-- Pre/post install scripts updated:
-- o Resolved an issue where an empty amandates file was installed
--   even if the file already existed on the system.
-- o If .amandahosts does not exist a default is now created.
-- The Amanda user account has been changed to 'amandabackup' for
-- additional security.
-* Tue Jan 03 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Removed amandates from files list.
-* Thu Dec 29 2005 Chris Lee <cmlee at zmanda dot com> -
-- Corrected dependency for awk to "/bin/awk".
-* Thu Dec 29 2005 Kevin Till <ktill at zmanda dot com> -
-- add man pages for amcrypt and amaespipe
-* Thu Dec 29 2005 Chris Lee <cmlee at zmanda dot com> -
-- Updated dependancy info to depend on tar >= 1.15.
-- Included dependancies from top-level package in backup_client and
-- backup_server packages.
-- Reorganized files lists for readability (alphabetically).
-- Updated backup_client files list to include some missing files per
-- bug #129.
-- Updated pre- and post-install to handle potential issue when
-- /var/log/amanda exists and is a file rather than a directory.
-- Corrected permissions for /var/log/amanda in pre-install scripts
-- per bug #78 and 13 December change.
-* Thu Dec 22 2005 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Added amaespipe and amcrypt
-- Added sles9 build definitions
-* Tue Dec 13 2005 Chris Lee <cmlee at zmanda dot com> -
-- Changed permissions for /var/log/amanda, removing set group id bit.
-- Added /etc/amandates to backup_client package.
-* Thu Dec 08 2005 Chris Lee <cmlee at zmanda dot com> -
-- Corrected an issue with detection of existing 'amanda' user account.
-- Corrected ownership of setuid executables per Bug #66.
-- Moved the gnutar and noop files to the backup_client package (where
-- they sould be).
-- Removed amqde from files list.
-- Added logging features to pre- and post-install scripts.
-* Wed Dec 07 2005 Chris Lee <cmlee at zmanda dot com> -
-- Changed a number of directory and file permissions from amanda:root
-- to amanda:disk in response to Bug #57.
-* Fri Dec 02 2005 Chris Lee <cmlee at zmanda dot com> -
-- Corrected SYSCONFDIR path definition.  Closes Bug #58.
-* Mon Nov 28 2005 Chris Lee <cmlee at zmanda dot com> -
-- Really fixed user creation preinstall scripts.
-* Wed Nov 23 2005 Paddy Sreenivasan <paddy at zmanda dot com> -
-- Updated package description.
-- Changed Group for packages.
-* Tue Nov 22 2005 Chris Lee <cmlee at zmanda dot com> -
-- Corrected dependancy packaging issue with amanda libraries.
-- Fixed creation of amanda user on systems which it does not exist.
-- Corrected Group definition for SuSE.
-- Updated descriptions to include amanda-libs package.
-- Updated release number to 2.
-* Tue Nov 08 2005 Chris Lee <cmlee at zmanda dot com> -
-- Permissions changes: now using user=amanda, group=disk
-* Sun Oct 30 2005 Chris Lee <cmlee at zmanda dot com> -
-- Parameters to configure options --with-user and --with-group changed
-- such that when test_build is set to '1' the username of the user who
-- runs rpmbuild is used for both values.  If test_build is set to '0'
-- then root is used for both values.
-- The release field was also changed to automatically reflect the
-- distribution and distribution release version for which the RPM was
-- built.
-* Tue Oct 18 2005 Chris Lee <cmlee at zmanda dot com> - 
-- Initial RPM SPEC file created.
-
diff --git a/packaging/rpm/amanda.spec.src b/packaging/rpm/amanda.spec.src
new file mode 100644 (file)
index 0000000..5155879
--- /dev/null
@@ -0,0 +1,1613 @@
+#
+#                  Copyright (C) 2005 Zmanda Incorporated.
+#                            All Rights Reserved.
+#
+#  This program is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License version 2 as published
+#  by the Free Software Foundation.
+# 
+#  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
+# 
+#  Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
+#  Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+#
+
+
+%define build_srpm 0
+%{?srpm_only: %define build_srpm 1}
+
+# Pkg-config sometimes needs its own path set, and we need to allow users to
+# override our guess during detection.  This macro takes care of that.
+# If no --define PKG_CONFIG_PATH was passed and env var $PKG_CONFIG_PATH is 
+# set then use the env var.
+%{!?PKG_CONFIG_PATH: %{expand:%(echo ${PKG_CONFIG_PATH:+"%%define PKG_CONFIG_PATH $PKG_CONFIG_PATH"})}}
+
+%{?PKG_CONFIG_PATH:%{echo:PKG_CONFIG_PATH = %{PKG_CONFIG_PATH}}}
+
+# Define which Distribution we are building:
+# Try to detect the distribution we are building:
+%if %{_vendor} == redhat 
+    # Fedora symlinks /etc/fedora-release to /etc/redhat-release for at least
+    # fc3-8.  So RHEL and Fedora look at the same file.  Different versions have
+    # different numbers of spaces; hence the use if $3 vs. $4..
+    %if %(awk '$1 == "Fedora" && $4 ~ /3.*/ { exit 1; }' /etc/redhat-release; echo $?)
+        %define dist fedora
+        %define disttag fc
+        %define distver 3
+       %define requires_libtermcap Requires: libtermcap.so.2
+    %endif
+    %if %(awk '$1 == "Fedora" && $4 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?)
+        %define dist fedora
+        %define disttag fc
+        %define distver 4
+       %define requires_libtermcap Requires: libtermcap.so.2
+    %endif
+    %if %(awk '$1 == "Fedora" && $4 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?)
+        %define dist fedora
+        %define disttag fc
+        %define distver 5
+       %define requires_libtermcap Requires: libtermcap.so.2
+    %endif
+    %if %(awk '$1 == "Fedora" && $4 ~ /6.*/ { exit 1; }' /etc/redhat-release; echo $?)
+        %define dist fedora
+        %define disttag fc
+        %define distver 6
+       %define requires_libtermcap Requires: libtermcap.so.2
+    %endif
+    %if %(awk '$1 == "Fedora" && $3 ~ /7.*/ { exit 1; }' /etc/redhat-release; echo $?)
+        %define dist fedora
+        %define disttag fc
+        %define distver 7
+       %define requires_libtermcap Requires: libtermcap.so.2
+    %endif
+    # if macro cannot have an empty test and we're just testing the existance
+    %if %{?fedora:yes}%{!?fedora:no} == yes
+        %define dist fedora
+        %define disttag fc
+        %define distver %{fedora}
+       %if %{distver} <= 8
+           %define requires_libtermcap Requires: libtermcap.so.2
+       %endif
+        %if %{_host_cpu} == x86_64 && %{_target_cpu} == i686
+                # Do nothing if PKG_CONFIG_PATH was set by the user above.
+                %{!?PKG_CONFIG_PATH: %define PKG_CONFIG_PATH /usr/lib/pkgconfig}
+        %endif
+    %endif
+    %if %(awk '$1 == "Red" && $7 ~ /3.*/ { exit 1; }' /etc/redhat-release; echo $?)
+        %define dist redhat
+        %define disttag rhel
+        %define distver 3
+        %define tarver 1.14
+       %define requires_libtermcap Requires: libtermcap.so.2
+       %define without_ipv6 --without-ipv6
+    %endif
+    %if %(awk '$1 == "Red" && $7 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?)
+        %define dist redhat
+        %define disttag rhel
+        %define distver 4
+        %define tarver 1.14
+       %define requires_libtermcap Requires: libtermcap.so.2
+    %endif
+    %if %(awk '$1 == "CentOS" && $3 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?)
+       %define dist redhat
+       %define disttag rhel
+       %define distver 4
+       %define tarver 1.14
+       %define requires_libtermcap Requires: libtermcap.so.2
+    %endif
+    %if %(awk '$1 == "Red" && $7 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?)
+        %define dist redhat
+        %define disttag rhel
+        %define distver 5
+       %define requires_libtermcap Requires: libtermcap.so.2
+    %endif
+    %if %(awk '$1 == "CentOS" && $3 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?)
+        %define dist redhat
+        %define disttag rhel
+        %define distver 5
+       %define requires_libtermcap Requires: libtermcap.so.2
+    %endif
+    
+    # If dist is undefined, we didn't detect.
+    %{!?dist:%define dist unknown}
+%endif
+# Detect Suse variants. 
+%if %{_vendor} == "suse"
+    %define dist SuSE
+    %if %(awk '$1 == "openSUSE" { exit 1; }' /etc/SuSE-release; echo $?)
+        %define disttag suse
+        %define distver %(awk '$1=="openSUSE" {print $2}' /etc/SuSE-release)
+    %endif
+    %if %(awk '$1 == "SUSE" { exit 1; }' /etc/SuSE-release; echo $?)
+        %define disttag %(awk '$1=="SUSE" {$3=="Enterprise" ? TAG="sles" : TAG="suse" ; print TAG}' /etc/SuSE-release)
+        %define distver %(awk '$1=="SUSE" {$3=="Enterprise" ? VER=$5 : VER=$3 ; print VER}' /etc/SuSE-release)
+    %endif
+%endif
+
+# Set options per distribution
+%if %{dist} == redhat || %{dist} == fedora
+    %define rpm_group Applications/Archiving
+    %define xinetd_reload restart
+    %define requires_initscripts Requires: initscripts
+%endif
+%if %{dist} == SuSE
+    %define rpm_group Productivity/Archiving/Backup
+    %define xinetd_reload restart
+%endif
+
+# Let's die if we haven't detected the distro. This might save some frustration.
+# RPM does not provide a way to  exit gracefully, hence the tag_to_cause_exit. 
+%{!?distver: %{error:"Your distribution and its version were not detected."}; %tag_to_cause_exit }
+# Set minimum tar version if it wasn't set in the per-distro section
+%{!?tarver: %define tarver 1.15}
+
+%define packer %(%{__id_u} -n)
+
+# --- Definitions ---
+
+# Define amanda_version using the value determined by
+# packaging/common/substitute.pl.
+%{!?amanda_version: %define amanda_version %%VERSION%% }
+%{!?amanda_release: %define amanda_release 1}
+%define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
+%define amanda_user amandabackup
+%define amanda_group disk
+
+Summary: The Amanda Backup and Archiving System
+Name: amanda
+Version: %{amanda_version}
+%define rpm_release %{amanda_release}.%{disttag}%{distver}
+%if %{build_srpm}
+%define rpm_release %{amanda_release}
+%endif
+Release: %{rpm_release}
+Source: %{name}-%{version}.tar.gz
+License: http://wiki.zmanda.com/index.php/Amanda_Copyright
+Vendor: Zmanda, Inc.
+Packager: www.zmanda.com
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{packer}-buildroot
+Group: %{rpm_group}
+# TODO - Need required versions for these:
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: binutils
+BuildRequires: bison
+BuildRequires: flex
+BuildRequires: gcc
+BuildRequires: glib2 >= 2.2.0
+BuildRequires: glib2-devel
+BuildRequires: readline
+# Note: newer distros have changed most *-devel to lib*-devel, and added a
+# provides tag for backwards compat.
+BuildRequires: readline-devel
+BuildRequires: curl >= 7.10.0
+BuildRequires: curl-devel >= 7.10.0
+BuildRequires: openssl
+BuildRequires: openssl-devel
+BuildRequires: perl(ExtUtils::Embed)
+Requires: /bin/awk
+Requires: /bin/date
+Requires: /usr/bin/id
+Requires: /sbin/ldconfig
+Requires: /bin/sh
+Requires: /usr/sbin/useradd
+Requires: /usr/sbin/usermod
+Requires: fileutils
+Requires: grep
+Requires: gnuplot
+Requires: libc.so.6
+Requires: libm.so.6
+Requires: libnsl.so.1
+Requires: curl >= 7.10.0
+Requires: openssl
+Requires: xinetd
+Requires: perl >= 5.6.0
+Requires: tar >= %{tarver}
+Requires: readline
+%{?requires_libtermcap}
+%{?requires_initscripts}
+
+%package backup_client
+Summary: The Amanda Backup and Archiving Client
+Group: %{rpm_group}
+Requires: /bin/awk
+Requires: fileutils
+Requires: grep
+%{?requires_libtermcap}
+%{?requires_initscripts}
+Requires: xinetd
+Requires: libc.so.6
+Requires: libm.so.6
+Requires: libnsl.so.1
+Requires: perl >= 5.6.0
+Requires: tar >= %{tarver}
+Requires: readline
+Provides: amanda-backup_client = %{amanda_version}
+Provides: libamclient-%{version}.so = %{amanda_version}
+Provides: libamanda-%{version}.so = %{amanda_version}
+Conflicts: amanda-backup_server
+# Native package names
+Obsoletes: amanda, amanda-client, amanda-server
+
+%package backup_server
+Summary: The Amanda Backup and Archiving Server
+Group: %{rpm_group}
+Requires: /bin/awk
+Requires: fileutils
+Requires: grep
+Requires: libc.so.6
+Requires: libm.so.6
+Requires: libnsl.so.1
+%{?requires_libtermcap}
+%{?requires_initscripts}
+Requires: xinetd
+Requires: perl >= 5.6.0
+Requires: tar >= %{tarver}
+Provides: amanda-backup_server = %{amanda_version}
+Provides: libamclient-%{version}.so = %{amanda_version}
+Provides: libamanda-%{version}.so = %{amanda_version}
+Provides: libamserver-%{version}.so = %{amanda_version}
+Provides: libamtape-%{version}.so = %{amanda_version}
+Provides: libamdevice-%{version}.so = %{amanda_version}
+Conflicts: amanda-backup_client
+# Native package names
+Obsoletes: amanda, amanda-client, amanda-server
+# --- Package descriptions ---
+
+%description
+Amanda is the leading Open-Source Backup and Archiving software.
+
+The amanda-backup_server package should be installed on the Amanda server, i.e. 
+the machine attached to backup media (such as a tape drive or disk 
+drives) where backups will be written. The amanda-backup_server package
+includes Amanda client.  The amanda-backup_client package needs 
+to be installed on every system that is being backed up.
+
+Amanda Forums is located at: http://forums.zmanda.com/
+Amanda Documentation is available at: http://wiki.zmanda.com/
+
+
+
+%description backup_server
+Amanda is the leading Open-Source Backup and Archiving software.
+
+This package contains the Amanda server.  The amanda-backup_server package 
+should be installed on the Amanda server, i.e. the machine attached 
+to backup media (such as a tape drive or disk drives) where backups 
+will be written.  The amanda-backup_server package includes Amanda client.
+
+Amanda Forums is located at: http://forums.zmanda.com/
+Amanda Documentation is available at: http://wiki.zmanda.com/
+
+
+
+%description backup_client
+Amanda is the leading Open-Source Backup and Archiving software.
+
+This package contains the Amanda client.  The amanda-backup_client package  
+needs to be installed on every system that is being backed up.
+
+Amanda Forums is located at: http://forums.zmanda.com/
+Amanda Documentation is available at: http://wiki.zmanda.com/
+
+# --- Directory setup ---
+
+# Configure directories:
+%define PREFIX          /usr
+%define EPREFIX         %{PREFIX}
+%define BINDIR          %{EPREFIX}/bin
+%define SBINDIR         %{EPREFIX}/sbin
+%define LIBEXECDIR      %{EPREFIX}/libexec
+%define AMLIBEXECDIR    %{LIBEXECDIR}/amanda
+%define DATADIR         %{PREFIX}/share
+%define SYSCONFDIR      /etc
+%define LOCALSTATEDIR   /var
+%define AMANDATES       %{AMANDAHOMEDIR}/amandates
+%define AMANDAHOMEDIR   %{LOCALSTATEDIR}/lib/amanda
+%ifarch x86_64
+%define LIBDIR          %{EPREFIX}/lib64
+%else
+%define LIBDIR          %{EPREFIX}/lib
+%endif
+%define AMLIBDIR        %{LIBDIR}/amanda
+%define INCLUDEDIR      %{PREFIX}/include
+%define MANDIR          %{DATADIR}/man
+%define LOGDIR          /var/log/amanda
+%define PERLSITELIB     %(eval "`perl -V:installsitelib`"; echo $installsitelib)
+%define AMDATADIR      /var/lib/amanda
+
+# Installation directories:
+%define ROOT_SBINDIR            %{buildroot}/%{SBINDIR}
+%define ROOT_LIBEXECDIR         %{buildroot}/%{LIBEXECDIR}
+%define ROOT_DATADIR            %{buildroot}/%{DATADIR}
+%define ROOT_LOCALSTATEDIR      %{buildroot}/%{LOCALSTATEDIR}
+%define ROOT_SYSCONFDIR         %{buildroot}/%{SYSCONFDIR}
+%define ROOT_AMANDAHOMEDIR      %{buildroot}/%{AMANDAHOMEDIR}
+%define ROOT_LIBDIR             %{buildroot}/%{LIBDIR}
+%define ROOT_MANDIR             %{buildroot}/%{MANDIR}
+%define ROOT_LOGDIR             %{buildroot}/%{LOGDIR}
+%define ROOT_AMDATADIR          %{buildroot}/%{AMDATADIR}
+
+# --- Unpack ---
+
+%prep
+%setup -q
+# --- Configure and compile ---
+
+%build
+%define config_user %{amanda_user}
+%define config_group %{amanda_group}
+
+# Set PKG_CONFIG_PATH=some/path if some/path was set on the command line, or by 
+# the platform detection bits.
+# without_ipv6 should only be defined on rhel3.
+./configure \
+        %{?PKG_CONFIG_PATH: PKG_CONFIG_PATH=%PKG_CONFIG_PATH} \
+        CFLAGS="%{optflags} -g -pipe" CXXFLAGS="%{optflags}" \
+        --quiet \
+        --prefix=%{PREFIX} \
+        --sysconfdir=%{SYSCONFDIR} \
+        --sharedstatedir=%{LOCALSTATEDIR} \
+        --localstatedir=%{LOCALSTATEDIR} \
+        --libdir=%{LIBDIR} \
+        --includedir=%{INCLUDEDIR} \
+       --mandir=%{MANDIR} \
+       --with-amdatadir=%{AMDATADIR} \
+        --with-gnuplot=/usr/bin/gnuplot \
+        --with-gnutar=/bin/tar \
+        --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \
+        --with-index-server=localhost \
+        --with-tape-server=localhost \
+        --with-user=%{config_user} \
+        --with-group=%{config_group} \
+        --with-owner=%{packer} \
+        --with-fqdn \
+        --with-bsd-security \
+        --with-bsdtcp-security \
+        --with-bsdudp-security \
+        --with-ssh-security \
+        --with-debugging=%{LOGDIR} \
+        --with-assertions \
+        --disable-installperms \
+        %{?without_ipv6}
+
+make -s LIBTOOLFLAGS=--silent
+
+# --- Install to buildroot ---
+
+%install
+if [ "%{buildroot}" != "/" ]; then
+        if [ -d "%{buildroot}" ] ; then
+                rm -rf %{buildroot}
+        fi
+else
+        echo "BuildRoot was somehow set to / !"
+        exit -1
+fi
+
+make -s -j1 LIBTOOLFLAGS=--silent DESTDIR=%{buildroot} install
+
+rm -f %{ROOT_AMANDAHOMEDIR}/example/inetd.conf.amandaclient
+mkdir %{buildroot}/{etc,var/log}
+mkdir %{ROOT_LOCALSTATEDIR}/amanda 
+mkdir %{ROOT_SYSCONFDIR}/amanda
+mkdir %{ROOT_AMANDAHOMEDIR}/gnutar-lists
+mkdir %{ROOT_LOGDIR}
+
+echo "%{amanda_version_info}" >%{ROOT_AMANDAHOMEDIR}/amanda-release
+
+# --- Clean up buildroot ---
+
+%clean
+if [ "%{buildroot}" != "/" ]; then
+        if [ -d "%{buildroot}" ] ; then
+                rm -rf %{buildroot}
+        fi
+else
+        echo "BuildRoot was somehow set to / !"
+        exit -1
+fi
+
+# --- Pre/post (un)installation scripts ---
+
+%pre
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
+
+# Check for the 'amanda' user
+echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
+if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
+        useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
+        if [ %{dist} = "SuSE" ]; then
+                PASSWD_EXIT=$?
+        else
+                # Lock the amanda account until admin sets password
+                passwd -l %{amanda_user} >>/dev/null
+                PASSWD_EXIT=$?
+        fi
+        if [ ${PASSWD_EXIT} -eq 0 ] ; then
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                PASSWD_OK=0
+        else
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                PASSWD_OK=1
+        fi
+else
+        # log information about 'amanda' user parameters
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
+
+        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  user 'amandabackup' is not part of the disk group,Pl !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  make sure it is corrected before start using amanda  !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
+        fi
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        PASSWD_OK=0
+fi
+if [ -d %{AMANDAHOMEDIR} ] ; then
+        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
+        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
+           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
+                echo "correct." >>${TMPFILE}
+                VARLIB_OK=0
+        else
+                echo "incorrect!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
+                VARLIB_OK=1
+        fi
+else
+        VARLIB_OK=0
+fi
+echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+if [ ! -e ${LOGDIR} ] ; then
+        # create log directory
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+elif [ ! -d ${LOGDIR} ] ; then
+        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
+fi
+
+if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
+        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+        exit 1
+else
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda installation started. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}"
+fi
+
+%post
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo -n "`date +'%b %e %Y %T'`: Updating library cache..." >${TMPFILE}
+/sbin/ldconfig >>${TMPFILE} 2>&1
+echo "done." >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
+        if [ ! -f /etc/xinetd.d/amandaserver ] ; then
+                cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
+                chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1
+                if [ -f /etc/xinetd.d/amandaclient ] ; then
+                        rm /etc/xinetd.d/amandaclient
+                fi
+                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
+                if [ "%{xinetd_reload}" == "reload" ] ; then
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                        if [ ${ret_val} -ne 0 ] ; then
+                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
+                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
+                                ret_val=$?
+                        fi
+                else
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                fi
+                if [ ${ret_val} -eq 0 ] ; then
+                        echo "success." >>${TMPFILE}
+                        cat ${TMPFILE}
+                        cat ${TMPFILE} >>${INSTALL_LOG}
+                else
+                        echo "failed.  Please check your system logs." >>${TMPFILE}
+                        cat ${TMPFILE} 1>&2
+                        cat ${TMPFILE} >>${INSTALL_ERR}
+                fi
+        fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDATES}'." >${TMPFILE}
+ret_val=0
+if [ ! -f %{AMANDATES} ] ; then
+        touch %{AMANDATES} >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The file '%{AMANDATES}' has been created." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDATES}'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{AMANDATES} >>${TMPFILE} 2>&1
+        chmod 0640 %{AMANDATES} >>${TMPFILE} 2>&1
+        if [ -x /sbin/restorecon ] ; then
+              /sbin/restorecon %{AMANDATES}  >>${TMPFILE} 2>&1
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
+ret_val=0
+if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
+        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+                ret_val=$?
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# Install .amandahosts
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
+        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+fi
+for host in localhost localhost.localdomain ; do
+        if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+                echo "${host}   root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts
+        fi
+        if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+                echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
+        fi
+done
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# SSH RSA key generation for amdump
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amdump"
+COMMENT="%{amanda_user}@server"
+if [ ! -d ${KEYDIR} ] ; then
+        if [ -f ${KEYDIR} ] ; then
+                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+                mv ${KEYDIR} ${KEYDIR}.rpmsave
+                cat ${TMPFILE}
+                cat ${TMPFILE} >>${INSTALL_LOG}
+        fi
+        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+        if [ -f ${KEYDIR} ] ; then
+                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+                cat ${TMPFILE}
+                cat ${TMPFILE} >>${INSTALL_LOG}
+        fi
+        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
+        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+fi
+if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
+        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >>${TMPFILE}
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
+if [ -x /usr/bin/wget ]; then 
+        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server 
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda installation complete. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}"
+fi
+
+echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+%postun
+/sbin/ldconfig
+%pre backup_server
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
+
+# Check for the 'amanda' user
+echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
+if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
+        useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
+        if [ %{dist} = "SuSE" ]; then
+                PASSWD_EXIT=$?
+        else
+                # Lock the amanda account until admin sets password
+                passwd -l %{amanda_user} >>/dev/null
+                PASSWD_EXIT=$?
+        fi
+        if [ ${PASSWD_EXIT} -eq 0 ] ; then
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                PASSWD_OK=0
+        else
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                     !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                PASSWD_OK=1
+        fi
+else
+        # log information about 'amanda' user parameters
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
+
+        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' is not part of the disk group,Pl  !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! make sure it is corrected before start using Amanda   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
+        fi
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        PASSWD_OK=0
+fi
+if [ -d %{AMANDAHOMEDIR} ] ; then
+        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
+        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
+           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
+                echo "correct." >>${TMPFILE}
+                VARLIB_OK=0
+        else
+                echo "incorrect!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
+                VARLIB_OK=1
+        fi
+else
+        VARLIB_OK=0
+fi
+echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+
+if [ ! -e ${LOGDIR} ] ; then
+        # create log directory
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+elif [ ! -d ${LOGDIR} ] ; then
+        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
+fi
+if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
+        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+        exit 1
+else
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup server installation started. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}"
+fi
+%post backup_server
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE}
+/sbin/ldconfig
+echo "done." >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
+        if [ ! -f /etc/xinetd.d/amandaserver ] ; then
+                cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
+                chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1
+                if [ -f /etc/xinetd.d/amandaclient ] ; then
+                        rm /etc/xinetd.d/amandaclient
+                fi
+
+                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
+                if [ "%{xinetd_reload}" == "reload" ] ; then
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                        if [ ${ret_val} -ne 0 ] ; then
+                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
+                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
+                                ret_val=$?
+                        fi
+                else
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                fi
+                if [ ${ret_val} -eq 0 ] ; then
+                        echo "success." >>${TMPFILE}
+                        cat ${TMPFILE}
+                        cat ${TMPFILE} >>${INSTALL_LOG}
+                else
+                        echo "failed.  Please check your system logs." >>${TMPFILE}
+                        cat ${TMPFILE} 1>&2
+                        cat ${TMPFILE} >>${INSTALL_ERR}
+                fi
+        fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDATES}'." >${TMPFILE}
+ret_val=0
+if [ ! -f %{AMANDATES} ] ; then
+        touch %{AMANDATES} >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The file '%{AMANDATES}' has been created." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDATES}'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{AMANDATES} >>${TMPFILE} 2>&1
+        chmod 0640 %{AMANDATES} >>${TMPFILE} 2>&1
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# Install .amandahosts to server
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
+        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+fi
+for host in localhost localhost.localdomain ; do
+        if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+                echo "${host}   root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts
+        fi
+        if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+                echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
+        fi
+done
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install amanda client configuration file
+echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE}
+if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then
+        cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+fi
+chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# install am_passphrase file to server
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.am_passphrase ] ; then
+        echo "`date +'%b %e %Y %T'`: Create '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE}
+        touch %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
+        phrase=`echo $RANDOM | md5sum | awk '{print $1}'`
+        echo ${phrase} >>%{AMANDAHOMEDIR}/.am_passphrase
+
+        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
+        chmod 0700 %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
+fi
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
+ret_val=0
+if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
+        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+                ret_val=$?
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# SSH RSA key generation on server for amdump
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amdump"
+COMMENT="%{amanda_user}@server"
+if [ ! -d ${KEYDIR} ] ; then
+        if [ -f ${KEYDIR} ] ; then
+                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+                cat ${TMPFILE}
+                cat ${TMPFILE} >>${INSTALL_LOG}
+        fi
+        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+        if [ -f ${KEYDIR} ] ; then
+                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+                cat ${TMPFILE}
+                cat ${TMPFILE} >>${INSTALL_LOG}
+        fi
+        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
+        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+fi
+if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
+        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
+fi
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
+if [ -x /usr/bin/wget ]; then 
+        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server 
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup server installation complete. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}" >>${TMPFILE} 2>&1
+fi
+
+echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+%postun backup_server
+/sbin/ldconfig
+%pre backup_client
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
+
+# Check for the 'amanda' user
+echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
+if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
+        useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1
+        if [ %{dist} = "SuSE" ]; then
+                PASSWD_EXIT=$?
+        else
+                # Lock the amanda account until admin sets password
+                passwd -l %{amanda_user} >>/dev/null
+                PASSWD_EXIT=$?
+        fi
+        if [ ${PASSWD_EXIT} -eq 0 ] ; then
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                PASSWD_OK=0
+        else
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                     !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                PASSWD_OK=1
+        fi
+else
+        # log information about 'amanda' user parameters
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
+
+        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' is not part of the disk group,Pl  !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! make sure it is corrected before start using Amanda   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
+        fi
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        PASSWD_OK=0
+fi
+if [ -d %{AMANDAHOMEDIR} ] ; then
+        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
+        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
+           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
+                echo "correct." >>${TMPFILE}
+                VARLIB_OK=0
+        else
+                echo "incorrect!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
+                VARLIB_OK=1
+        fi
+else
+        VARLIB_OK=0
+fi
+echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+
+if [ ! -e ${LOGDIR} ] ; then
+        # create log directory
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+elif [ ! -d ${LOGDIR} ] ; then
+        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
+fi
+if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
+        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+        exit 1
+else
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup client installation started. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}"
+fi
+
+%post backup_client
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE}
+/sbin/ldconfig
+echo "done." >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
+        if [ ! -f /etc/xinetd.d/amandaclient ] ; then
+                cp %{AMANDAHOMEDIR}/example/xinetd.amandaclient /etc/xinetd.d/amandaclient
+
+                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
+                if [ "%{xinetd_reload}" == "reload" ] ; then
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                        if [ ${ret_val} -ne 0 ] ; then
+                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
+                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
+                                ret_val=$?
+                        fi
+                else
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                fi
+                if [ ${ret_val} -eq 0 ] ; then
+                        echo "success." >>${TMPFILE}
+                        cat ${TMPFILE}
+                        cat ${TMPFILE} >>${INSTALL_LOG}
+                else
+                        echo "failed.  Please check your system logs." >>${TMPFILE}
+                        cat ${TMPFILE}
+                        cat ${TMPFILE} >>${INSTALL_LOG}
+                fi
+        fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDATES}'." >${TMPFILE}
+ret_val=0
+if [ ! -f %{AMANDATES} ] ; then
+        touch %{AMANDATES} >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The file '%{AMANDATES}' has been created." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDATES}'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{AMANDATES} >>${TMPFILE} 2>&1
+        chmod 0640 %{AMANDATES} >>${TMPFILE} 2>&1
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# Install .amandahosts to client
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
+        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+fi
+for host in localhost localhost.localdomain ; do
+                if [ -z "`grep \"^${host}[[:blank:]]\+\" %{AMANDAHOMEDIR}/.amandahosts | grep \"[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\"`" ] ; then
+                        echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
+                fi
+done
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install amanda client configuration file
+echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE}
+if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then
+        cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+fi
+chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
+ret_val=0
+if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
+        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+                ret_val=$?
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+        if [ -f ${KEYDIR} ] ; then
+                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+                cat ${TMPFILE}
+                cat ${TMPFILE} >>${INSTALL_LOG}
+        fi
+        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
+        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+fi
+if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
+        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
+fi
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
+if [ -x /usr/bin/wget ]; then 
+        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=client 
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup client installation complete. ===" >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}"
+fi
+
+echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+%postun backup_client
+/sbin/ldconfig
+
+# --- Files to install ---
+# Notes:  Do not use wildcards on directories not wholly owned by amanda.  An
+# uninstall of the software will attempt to delete whatever matches here.
+%files backup_client
+%defattr(0755,%{amanda_user},%{amanda_group},0755)
+%{AMLIBEXECDIR}
+%{AMLIBDIR}
+%{PERLSITELIB}/auto/Amanda
+%defattr(4750,root,disk)
+%{AMLIBEXECDIR}/application/amgtar
+%{AMLIBEXECDIR}/application/amstar
+%{AMLIBEXECDIR}/calcsize
+%{AMLIBEXECDIR}/killpgrp
+%{AMLIBEXECDIR}/rundump
+%{AMLIBEXECDIR}/runtar
+%defattr(0750,%{amanda_user},%{amanda_group},0750)
+%{LOGDIR}
+%{SBINDIR}/amaespipe
+%{SBINDIR}/amcryp*
+%{SBINDIR}/amgpgcrypt
+%{SBINDIR}/amoldrecover
+%{SBINDIR}/amrecover
+%{SYSCONFDIR}/amanda
+%defattr(0644,%{amanda_user},%{amanda_group},0755)
+%{LOCALSTATEDIR}/amanda
+%{PERLSITELIB}/Amanda
+%{AMLIBEXECDIR}/amcat.awk
+%{AMANDAHOMEDIR}/gnutar-lists
+%doc %{AMANDAHOMEDIR}/amanda-release
+%doc %{AMANDAHOMEDIR}/example/xinetd.amandaclient
+%doc %{AMANDAHOMEDIR}/example/xinetd.amandaserver
+%doc %{AMANDAHOMEDIR}/example/amanda-client.conf
+%doc %{AMANDAHOMEDIR}/template.d/README
+%doc %{AMANDAHOMEDIR}/template.d/dumptypes
+%defattr(0644,root,root,0755)
+%docdir %{MANDIR}
+%{MANDIR}/man5/amanda.conf.5.gz
+%{MANDIR}/man5/amanda-client.conf.5.gz
+%{MANDIR}/man7/amanda-devices.7.gz
+%{MANDIR}/man7/amanda-applications.7.gz
+%{MANDIR}/man7/amanda-scripts.7.gz
+%{MANDIR}/man8/amaespipe.8.gz
+%{MANDIR}/man8/amanda.8.gz
+%{MANDIR}/man8/amcheckdump.8.gz
+%{MANDIR}/man8/amcrypt*
+%{MANDIR}/man8/amgpgcrypt.8.gz
+%{MANDIR}/man8/amrecover.8.gz
+%doc %{DATADIR}/amanda
+
+%files backup_server
+%defattr(0755,%{amanda_user},%{amanda_group})
+%{AMLIBEXECDIR}
+%{AMLIBDIR}
+%{PERLSITELIB}/Amanda
+%{PERLSITELIB}/auto/Amanda
+%{AMANDAHOMEDIR}
+%{LOCALSTATEDIR}/amanda
+%{SBINDIR}/am*
+%defattr(4750,root,disk)
+%{AMLIBEXECDIR}/application/amgtar
+%{AMLIBEXECDIR}/application/amstar
+%{AMLIBEXECDIR}/calcsize
+%{AMLIBEXECDIR}/killpgrp
+%{AMLIBEXECDIR}/rundump
+%{AMLIBEXECDIR}/runtar
+%{AMLIBEXECDIR}/dumper
+%{AMLIBEXECDIR}/planner
+%{SBINDIR}/amcheck
+%defattr(0750,%{amanda_user},%{amanda_group},0750)
+%{LOGDIR}
+%{SYSCONFDIR}/amanda
+# Files in standard dirs must be listed explicitly
+%{SBINDIR}/activate-devpay
+%{SBINDIR}/amaespipe
+%{SBINDIR}/amcrypt
+%{SBINDIR}/amcrypt-ossl
+%{SBINDIR}/amcrypt-ossl-asym
+%{SBINDIR}/amcryptsimple
+%{SBINDIR}/amgpgcrypt
+%{SBINDIR}/amoldrecover
+%{SBINDIR}/amrecover
+%defattr(0644,%{amanda_user},%{amanda_group})
+%{AMLIBEXECDIR}/amcat.awk
+%{AMLIBEXECDIR}/amplot.awk
+%{AMLIBEXECDIR}/amplot.g
+%{AMLIBEXECDIR}/amplot.gp
+%doc %{AMANDAHOMEDIR}/amanda-release
+%docdir %{AMANDAHOMEDIR}/example
+%docdir %{AMANDAHOMEDIR}/template.d
+%defattr(0644,root,root,0755)
+%docdir %{MANDIR}
+%{MANDIR}/man5/am*
+%{MANDIR}/man5/disklist.5.gz
+%{MANDIR}/man5/tapelist.5.gz
+%{MANDIR}/man7/am*
+%{MANDIR}/man8/am*
+%{MANDIR}/man8/script-email.8.gz
+%doc %{DATADIR}/amanda
+
+# --- ChangeLog
+
+%changelog
+* Fri Aug 20 2010 Dan Locks <dwlocks at zmanda dot com> 3.2.0alpha
+- use %%VERSION%% macro instead of reading a file.  error reported by ssgelm
+* Thu Aug 19 2010 Dan Locks <dwlocks at zmanda dot com> 3.2.0alpha
+- Added detection of openSuSE 11 as suggested by ssgelm
index 72298a704c75e05a2d4ef6a449e4a9b8f25197cc..7a09a254f0ecbb02911759c6f880ffb91d3bff94 100755 (executable)
@@ -27,6 +27,10 @@ if [ -z $AMVER ]; then
     AMVER=amanda-${VER}
 fi
 
+# Substitute amanda.spec.src
+/usr/bin/perl packaging/common/substitute.pl \
+    packaging/rpm/amanda.spec.src packaging/rpm/amanda.spec
+
 PKG_TARBALL=${AMVER}.tar.gz
 if [ ! -f "${PKG_TARBALL}" ]; then
     mkdir ${AMVER} || exit 1
index ce95880ae7e7ba6a6b3646ffafc6bbf9e42c3b8b..c2d6a1dc06df04555f9655ea3ac4336a5305426a 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
index eada210de48c7ae8c0b1d4b81dba8a900a0690dc..657f6ac20dd7a214accda9e3d747b5018c6b090d 100644 (file)
@@ -169,4 +169,13 @@ sub read_magic_block {
 
     return $type;
 }
+
+sub _set_mesgout {
+    my $self = shift;
+
+    my $mesgout_fd;
+    open ($mesgout_fd, '>&=3') || die("Can't open mesgout_fd: $!");
+    $self->{mesgout} = $mesgout_fd;
+}
+
 1;
index 67edaa0b05cfc86adabbc05f4cd0aadd799275be..c58cfd0f54a920549a175cd325091abcaa69d3e1 100644 (file)
@@ -86,6 +86,15 @@ sub read_magic_block {
 
     return $type;
 }
+
+sub _set_mesgout {
+    my $self = shift;
+
+    my $mesgout_fd;
+    open ($mesgout_fd, '>&=3') || die("Can't open mesgout_fd: $!");
+    $self->{mesgout} = $mesgout_fd;
+}
+
 %}
 
 /* C interfaces used by the above */
index 551366f48a37e23ea724e730253cea8cb960adc2..250b1ea19f3bb4d7f56e615f8de1330fb692edf5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -38,7 +38,7 @@ sub zfs_set_value {
     my $self = shift;
 
     if (defined $self->{execute_where} && $self->{execute_where} ne "client") {
-       $self->print_to_server_and_die(" Script must be run on the client 'execute_where client'", $Amanda::Script_App::ERROR);
+       $self->print_to_server_and_die(" Script must be run on the client 'execute-where client'", $Amanda::Script_App::ERROR);
     }
     if ($self->{df_path} ne "df" && !-e $self->{df_path}) {
        $self->print_to_server_and_die("Can't execute DF-PATH '$self->{df_path}' command",
index 9600e1fa0531e6eaf9f9c335502b2ffde71881a5..a77cc17b9b49ba63a48fe156500646c3f031fc42 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -2434,17 +2437,7 @@ XS(_wrap_amar_attr_add_data_buffer) {
     arg2 = (char *)(buf2);
     arg3 = (gsize)(size2 - 1);
     {
-      if (sizeof(signed int) == 1) {
-        arg4 = amglue_SvI8(ST(2));
-      } else if (sizeof(signed int) == 2) {
-        arg4 = amglue_SvI16(ST(2));
-      } else if (sizeof(signed int) == 4) {
-        arg4 = amglue_SvI32(ST(2));
-      } else if (sizeof(signed int) == 8) {
-        arg4 = amglue_SvI64(ST(2));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg4 = SvTRUE(ST(2));
     }
     amar_attr_add_data_buffer_(arg1,arg2,arg3,arg4);
     ST(argvi) = sv_newmortal();
@@ -2508,17 +2501,7 @@ XS(_wrap_amar_attr_add_data_fd) {
       }
     }
     {
-      if (sizeof(signed int) == 1) {
-        arg3 = amglue_SvI8(ST(2));
-      } else if (sizeof(signed int) == 2) {
-        arg3 = amglue_SvI16(ST(2));
-      } else if (sizeof(signed int) == 4) {
-        arg3 = amglue_SvI32(ST(2));
-      } else if (sizeof(signed int) == 8) {
-        arg3 = amglue_SvI64(ST(2));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg3 = SvTRUE(ST(2));
     }
     result = amar_attr_add_data_fd_(arg1,arg2,arg3);
     {
index a8891fb5714092ffe5b2e9b0e5c723bc5d0d9789..4135986c9d3f240e10f7683d488e236bbcffd21b 100644 (file)
@@ -1032,7 +1032,7 @@ sub make_combined_error {
            reason => $err->{'reason'},
            message => $suberrors->[0][0] . ": " . $err->{'message'});
     } else {
-       my $fatal = $classmeth or grep { $err->[1]{'fatal'} } @$suberrors;
+       my $fatal = $classmeth or grep { $_->[1]{'fatal'} } @$suberrors;
 
        my $reason;
        if (!$fatal) {
index b31ad54b64fa666a4f1d3ebd4787f4e6256ede0e..e633c451385e6c8715157bbe76011bbe6f76a351 100644 (file)
@@ -325,7 +325,7 @@ sub _alloc_drive {
 }
 
 # Internal function to enumerate all available slots.  Slots are described by
-# integers.
+# strings.
 sub _all_slots {
     my ($self) = @_;
     my $dir = _quote_glob($self->{'dir'});
@@ -337,7 +337,7 @@ sub _all_slots {
        push @slots, $slot + 0;
     }
 
-    return sort @slots;
+    return map { "$_"} sort { $a <=> $b } @slots;
 }
 
 # Internal function to determine whether a slot exists.
@@ -376,7 +376,7 @@ sub _is_slot_in_use {
 
            #check if process is alive
            my $pid = $state->{drives}->{$drive}->{pid};
-           if (defined $pid && !Amanda::Util::is_pid_alive($pid)) {
+           if (!defined $pid or !Amanda::Util::is_pid_alive($pid)) {
                unlink("$drive/data")
                    or warn("Could not unlink '$drive/data': $!");
                rmdir("$drive")
index 29c16b364c79c00804ec197baecdcdab5cca32fb..016db8f8af08f8f4ee46819e7457480aca00d8b3 100644 (file)
@@ -208,13 +208,13 @@ sub status {
 send_cdb:
     my $res = $conn->scsi_execute_cdb(
        flags => $NDMP9_SCSI_DATA_DIR_IN,
-       timeout => 2*1000,
+       timeout => 60*1000, # 60-second timeout
        cdb => pack('CCnnCCnxC',
            0xB8, # opcode
            0x10, # VOLTAG, all element types
            0, # start at addr 0
            0xffff, # and give me 65535 elements
-           0, # CURDATA=0, so don't do an inventory
+           2, # CURDATA=1, so the robot should use its cached state
            $bufsize >> 16, # allocation length high byte
            $bufsize & 0xffff, # allocation length low short
            0), # control
index 6561f058c0c9485f211c237ff2923a34d9ab6fe2..5a8a0c9c99aef1086c4ef43d3713961b8cd7e55e 100644 (file)
@@ -304,6 +304,7 @@ sub info_key {
                next unless exists($kid_info{'num_slots'});
                my $kid_num_slots = $kid_info{'num_slots'};
                if (defined $num_slots and $num_slots != $kid_num_slots) {
+                   debug("chg-rait: children have different slot counts!");
                    $num_slots = -1;
                } else {
                    $num_slots = $kid_num_slots;
index 00822452887965e6220ba83191dca18dd4ddebb1..38a10b7a777e53d3687c5f1db6c91ee9a4330993 100644 (file)
@@ -453,7 +453,7 @@ sub load_unlocked {
            }
 
            # otherwise, we can jump all the way to the end of this process
-           return $steps->{'check_device'}->();
+           return $steps->{'start_polling'}->();
        }
 
        # here is where we implement each of the drive-selection algorithms
@@ -637,8 +637,8 @@ sub load_unlocked {
            # update metadata with this new information
            $state->{'slots'}->{$slot}->{'state'} = Amanda::Changer::SLOT_FULL;
            $state->{'slots'}->{$slot}->{'device_status'} = $device->status;
-           if (defined $device->{'header'}) {
-               $state->{'slots'}->{$slot}->{'f_type'} = $device->{'header'}->{type};
+           if (defined $device->{'volume_header'}) {
+               $state->{'slots'}->{$slot}->{'f_type'} = $device->{'volume_header'}->{type};
            } else {
                $state->{'slots'}->{$slot}->{'f_type'} = undef;
            }
@@ -659,8 +659,8 @@ sub load_unlocked {
            # update metadata with this new information
            $state->{'slots'}->{$slot}->{'state'} = Amanda::Changer::SLOT_FULL;
            $state->{'slots'}->{$slot}->{'device_status'} = $device->status;
-           if (defined $device->{'header'}) {
-               $state->{'slots'}->{$slot}->{'f_type'} = $device->{'header'}->{type};
+           if (defined $device->{'volume_header'}) {
+               $state->{'slots'}->{$slot}->{'f_type'} = $device->{'volume_header'}->{type};
            } else {
                $state->{'slots'}->{$slot}->{'f_type'} = undef;
            }
@@ -728,7 +728,8 @@ sub info_key_vendor_string {
 
     $self->{'interface'}->inquiry(make_cb(inquiry_cb => sub {
        my ($err, $info) = @_;
-       return $params{'info_cb'}->($err) if $err;
+       return $self->make_error("fatal", $params{'info_cb'},
+               message => "$err") if $err;
 
        my $vendor_string = sprintf "%s %s",
            ($info->{'vendor id'} or "<unknown>"),
@@ -790,13 +791,13 @@ sub get_device { # (overridden by subclasses)
     my $device = Amanda::Device->new($device_name);
     if ($device->status != $DEVICE_STATUS_SUCCESS) {
        return $self->make_error("failed", undef,
-               reason => "device",
+               reason => "unknown",
                message => "opening '$device_name': " . $device->error_or_status());
     }
 
     if (my $err = $self->{'config'}->configure_device($device)) {
        return $self->make_error("failed", undef,
-               reason => "device",
+               reason => "unknown",
                message => $err);
     }
 
@@ -1285,10 +1286,14 @@ sub move_unlocked {
                message => "slot $from_slot is empty");
     }
 
-    if (defined $state->{'slots'}->{$from_slot}->{'loaded_in'}) {
-       return $self->make_error("failed", $params{'finished_cb'},
-               reason => "invalid",
-               message => "slot $from_slot is currently loaded");
+    my $in_drive = $state->{'slots'}->{$from_slot}->{'loaded_in'};
+    if (defined $in_drive) {
+       my $info = $state->{'drives'}->{$in_drive};
+       if ($info->{'res_info'} and $self->_res_info_verify($info->{'res_info'})) {
+           return $self->make_error("failed", $params{'finished_cb'},
+                   reason => "invalid",
+                   message => "slot $from_slot is currently loaded and reserved");
+       }
     }
 
     if ($state->{'slots'}->{$to_slot}->{'state'} == Amanda::Changer::SLOT_FULL) {
@@ -1305,17 +1310,49 @@ sub move_unlocked {
        return $params{'finished_cb'}->($err) if $err;
 
        # update metadata
-       $state->{'slots'}->{$to_slot} = { %{ $state->{'slots'}->{$from_slot} } };
-       $state->{'slots'}->{$from_slot}->{'state'} =
-                                               Amanda::Changer::SLOT_EMPTY;
-       $state->{'slots'}->{$from_slot}->{'device_status'} = undef;
-       $state->{'slots'}->{$from_slot}->{'f_type'} = undef;
-       $state->{'slots'}->{$from_slot}->{'label'} = undef;
-       $state->{'slots'}->{$from_slot}->{'barcode'} = undef;
+       if ($from_slot ne $to_slot) {
+           my $f = $state->{'slots'}->{$from_slot};
+           my $t = $state->{'slots'}->{$to_slot};
+
+           $t->{'device_status'} = $f->{'device_status'};
+           $f->{'device_status'} = undef;
+
+           $t->{'state'} = $f->{'state'};
+           $f->{'state'} = Amanda::Changer::SLOT_EMPTY;
+
+           $t->{'f_type'} = $f->{'f_type'};
+           $f->{'f_type'} = undef;
+
+           $t->{'label'} = $f->{'label'};
+           $f->{'label'} = undef;
+
+           $t->{'barcode'} = $f->{'barcode'};
+           $f->{'barcode'} = undef;
+       }
+
+       # properly represent the unload operation, if it was performed
+       if (defined $in_drive) {
+           $state->{'slots'}->{$from_slot}->{'loaded_in'} = undef;
+           $state->{'slots'}->{$to_slot}->{'loaded_in'} = undef;
+
+           $state->{'drives'}->{$in_drive}->{'state'} =
+                                                   Amanda::Changer::SLOT_EMPTY;
+           $state->{'drives'}->{$in_drive}->{'label'} = undef;
+           $state->{'drives'}->{$in_drive}->{'barcode'} = undef;
+           $state->{'drives'}->{$in_drive}->{'orig_slot'} = undef;
+       }
 
        $params{'finished_cb'}->();
     });
-    $self->{'interface'}->transfer($from_slot, $to_slot, $transfer_complete);
+
+    # if the source slot is loaded, then this is just a directed unload operation;
+    # otherwise, it's a transfer.
+    if (defined $in_drive) {
+       Amanda::Debug::debug("move(): unloading drive $in_drive to slot $to_slot");
+       $self->{'interface'}->unload($in_drive, $to_slot, $transfer_complete);
+    } else {
+       $self->{'interface'}->transfer($from_slot, $to_slot, $transfer_complete);
+    }
 }
 
 ##
index 2d267ac9c0a0b36e1dde8fba3fb9708b1419bbfe..bc9ea2e3fa5b02db0370896ff23fe77bd7979e7d 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -1613,8 +1616,8 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
 
 
 
-SWIGINTERN dumpspec_t *new_dumpspec_t(char *host,char *disk,char *datestamp,char *level){
-           return dumpspec_new(host, disk, datestamp, level);
+SWIGINTERN dumpspec_t *new_dumpspec_t(char *host,char *disk,char *datestamp,char *level,char *write_timestamp){
+           return dumpspec_new(host, disk, datestamp, level, write_timestamp);
        }
 SWIGINTERN void delete_dumpspec_t(dumpspec_t *self){
            dumpspec_free(self);
@@ -1944,12 +1947,41 @@ XS(_wrap_dumpspec_t_level_get) {
 }
 
 
+XS(_wrap_dumpspec_t_write_timestamp_get) {
+  {
+    dumpspec_t *arg1 = (dumpspec_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpspec_t_write_timestamp_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpspec_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpspec_t_write_timestamp_get" "', argument " "1"" of type '" "dumpspec_t *""'"); 
+    }
+    arg1 = (dumpspec_t *)(argp1);
+    result = (char *) ((arg1)->write_timestamp);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_new_dumpspec_t) {
   {
     char *arg1 = (char *) 0 ;
     char *arg2 = (char *) 0 ;
     char *arg3 = (char *) 0 ;
     char *arg4 = (char *) 0 ;
+    char *arg5 = (char *) 0 ;
     int res1 ;
     char *buf1 = 0 ;
     int alloc1 = 0 ;
@@ -1962,12 +1994,15 @@ XS(_wrap_new_dumpspec_t) {
     int res4 ;
     char *buf4 = 0 ;
     int alloc4 = 0 ;
+    int res5 ;
+    char *buf5 = 0 ;
+    int alloc5 = 0 ;
     int argvi = 0;
     dumpspec_t *result = 0 ;
     dXSARGS;
     
-    if ((items < 4) || (items > 4)) {
-      SWIG_croak("Usage: new_dumpspec_t(host,disk,datestamp,level);");
+    if ((items < 5) || (items > 5)) {
+      SWIG_croak("Usage: new_dumpspec_t(host,disk,datestamp,level,write_timestamp);");
     }
     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
     if (!SWIG_IsOK(res1)) {
@@ -1989,18 +2024,25 @@ XS(_wrap_new_dumpspec_t) {
       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_dumpspec_t" "', argument " "4"" of type '" "char *""'");
     }
     arg4 = (char *)(buf4);
-    result = (dumpspec_t *)new_dumpspec_t(arg1,arg2,arg3,arg4);
+    res5 = SWIG_AsCharPtrAndSize(ST(4), &buf5, NULL, &alloc5);
+    if (!SWIG_IsOK(res5)) {
+      SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_dumpspec_t" "', argument " "5"" of type '" "char *""'");
+    }
+    arg5 = (char *)(buf5);
+    result = (dumpspec_t *)new_dumpspec_t(arg1,arg2,arg3,arg4,arg5);
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpspec_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
     if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
     XSRETURN(argvi);
   fail:
     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
     if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
     SWIG_croak_null();
   }
 }
@@ -2330,6 +2372,7 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Cmdlinec::dumpspec_t_disk_get", _wrap_dumpspec_t_disk_get},
 {"Amanda::Cmdlinec::dumpspec_t_datestamp_get", _wrap_dumpspec_t_datestamp_get},
 {"Amanda::Cmdlinec::dumpspec_t_level_get", _wrap_dumpspec_t_level_get},
+{"Amanda::Cmdlinec::dumpspec_t_write_timestamp_get", _wrap_dumpspec_t_write_timestamp_get},
 {"Amanda::Cmdlinec::new_dumpspec_t", _wrap_new_dumpspec_t},
 {"Amanda::Cmdlinec::delete_dumpspec_t", _wrap_delete_dumpspec_t},
 {"Amanda::Cmdlinec::dumpspec_t_format", _wrap_dumpspec_t_format},
index 3bd405161e54573f0fd7c8dec4c0f45d1080601c..2c49536ae1532029c3bca300e3c95a4dceb137e1 100644 (file)
@@ -68,6 +68,8 @@ use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
 *swig_datestamp_set = *Amanda::Cmdlinec::dumpspec_t_datestamp_set;
 *swig_level_get = *Amanda::Cmdlinec::dumpspec_t_level_get;
 *swig_level_set = *Amanda::Cmdlinec::dumpspec_t_level_set;
+*swig_write_timestamp_get = *Amanda::Cmdlinec::dumpspec_t_write_timestamp_get;
+*swig_write_timestamp_set = *Amanda::Cmdlinec::dumpspec_t_write_timestamp_set;
 sub new {
     my $pkg = shift;
     my $self = Amanda::Cmdlinec::new_dumpspec_t(@_);
@@ -119,7 +121,7 @@ Amanda::Cmdline - utilities for handling command lines
 
   use Amanda::Cmdline;
 
-  my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level);
+  my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level, $write_timestamp);
   print "host: $spec->{'host'}; disk: $spec->{'disk'}\n";
 
   my @specs = Amanda::Cmdline::parse_dumpspecs(["host", "disk", "date"],
@@ -127,17 +129,35 @@ Amanda::Cmdline - utilities for handling command lines
 
 =head1 Amanda::Cmdline::dumpspec_t Objects
 
-=head2 Instance Variables
+Note that this class was called C<Amanda::Cmdline::dumpspec_t> in older versions;
+that name will still work, but is deprecated.
+
+=head2 Keys
+
+Each key contains a match expression, in the form of a string, or undef.  Note
+that the values of these keys are read-only.
 
 =over
 
-=item C<$host>
+=item C<< $ds->{'host'} >>
+
+Hostname
+
+=item C<< $ds->{'disk'} >>
+
+Disk name
+
+=item C<< $ds->{'datestamp'} >>
+
+Dump timestamp.
 
-=item C<$disk>
+=item C<< $ds->{'level'} >>
 
-=item C<$datestamp>
+Dump level
 
-=item C<$level>
+=item C<< $ds->{'write_timestamp'} >>
+
+Timestamp when the dump is written to storage media.
 
 =back
 
@@ -145,13 +165,13 @@ Amanda::Cmdline - utilities for handling command lines
 
 =over
 
-=item C<format()>
+=item C<< $ds->format() >>
 
 Format the dumpspec as a string.
 
 =back
 
-=head1 Functions
+=head1 Package Functions
 
 =over
 
@@ -159,14 +179,25 @@ Format the dumpspec as a string.
 
 This function returns a string representing the formatted form of the
 given dumpspec.  This formatting is the same as performed by
-C<format_dumpspec_components>, but does not need a C<dumpspec_t>.
+C<< $ds->format() >>, but does not need a C<Dumpspec>.
 
 =item C<parse_dumpspecs([@cmdline], $flags)>
 
-This function parses C<@cmdline> into a list of C<dumpspec_t> objects,
+This function parses C<@cmdline> into a list of C<Dumpspec> objects,
 according to C<$flags>, which is a logical combination of zero or more
-of C<$CMDLINE_PARSE_DATESTAMP> to recognize datestamps and
-C<$CMDLINE_PARSE_LEVEL> to recognize levels.
+of
+
+ $CMDLINE_PARSE_DATESTAMP - recognize datestamps
+ $CMDLINE_PARSE_LEVEL - recognize levels
+ $CMDLINE_EMPTY_TO_WILDCARD - if @cmdline is empty, make a wildcard dumpspec
+
+These constants are available in export tag C<:constants>.  The command-line
+format is
+
+  [host [disk [datestamp [level [host [..]]]]]]
+
+Note that there is no facility for specifying C<write_timestamp> on the command
+line.
 
 =item C<header_matches_dumpspecs($hdr, [@dumpspecs])>
 
@@ -226,5 +257,8 @@ push @{$EXPORT_TAGS{"cmdline_parse_dumpspecs_flags"}}, qw($CMDLINE_EMPTY_TO_WILD
 
 $_cmdline_parse_dumpspecs_flags_VALUES{"CMDLINE_EMPTY_TO_WILDCARD"} = $CMDLINE_EMPTY_TO_WILDCARD;
 
-push @EXPORT_OK, qw(header_matches_dumpspecs);
+#copy symbols in cmdline_parse_dumpspecs_flags to constants
+push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"cmdline_parse_dumpspecs_flags"}};
+
+push @EXPORT_OK, qw(header_matches_dumpspecs parse_dumpspecs format_dumpspec_components);
 1;
index 2758acd941959e932e5f2728eeec35a9df25f614..9746795e71183eb0e9325ff25e2d0472de752536 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -28,7 +28,7 @@ Amanda::Cmdline - utilities for handling command lines
 
   use Amanda::Cmdline;
 
-  my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level);
+  my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level, $write_timestamp);
   print "host: $spec->{'host'}; disk: $spec->{'disk'}\n";
 
   my @specs = Amanda::Cmdline::parse_dumpspecs(["host", "disk", "date"],
@@ -36,17 +36,35 @@ Amanda::Cmdline - utilities for handling command lines
 
 =head1 Amanda::Cmdline::dumpspec_t Objects
 
-=head2 Instance Variables
+Note that this class was called C<Amanda::Cmdline::dumpspec_t> in older versions;
+that name will still work, but is deprecated.
+
+=head2 Keys
+
+Each key contains a match expression, in the form of a string, or undef.  Note
+that the values of these keys are read-only.
 
 =over
 
-=item C<$host>
+=item C<< $ds->{'host'} >>
+
+Hostname
+
+=item C<< $ds->{'disk'} >>
+
+Disk name
+
+=item C<< $ds->{'datestamp'} >>
 
-=item C<$disk>
+Dump timestamp.
 
-=item C<$datestamp>
+=item C<< $ds->{'level'} >>
 
-=item C<$level>
+Dump level
+
+=item C<< $ds->{'write_timestamp'} >>
+
+Timestamp when the dump is written to storage media.
 
 =back
 
@@ -54,13 +72,13 @@ Amanda::Cmdline - utilities for handling command lines
 
 =over
 
-=item C<format()>
+=item C<< $ds->format() >>
 
 Format the dumpspec as a string.
 
 =back
 
-=head1 Functions
+=head1 Package Functions
 
 =over
 
@@ -68,14 +86,25 @@ Format the dumpspec as a string.
 
 This function returns a string representing the formatted form of the
 given dumpspec.  This formatting is the same as performed by
-C<format_dumpspec_components>, but does not need a C<dumpspec_t>.
+C<< $ds->format() >>, but does not need a C<Dumpspec>.
 
 =item C<parse_dumpspecs([@cmdline], $flags)>
 
-This function parses C<@cmdline> into a list of C<dumpspec_t> objects,
+This function parses C<@cmdline> into a list of C<Dumpspec> objects,
 according to C<$flags>, which is a logical combination of zero or more
-of C<$CMDLINE_PARSE_DATESTAMP> to recognize datestamps and
-C<$CMDLINE_PARSE_LEVEL> to recognize levels.
+of
+
+ $CMDLINE_PARSE_DATESTAMP - recognize datestamps
+ $CMDLINE_PARSE_LEVEL - recognize levels
+ $CMDLINE_EMPTY_TO_WILDCARD - if @cmdline is empty, make a wildcard dumpspec
+
+These constants are available in export tag C<:constants>.  The command-line
+format is
+
+  [host [disk [datestamp [level [host [..]]]]]]
+
+Note that there is no facility for specifying C<write_timestamp> on the command
+line.
 
 =item C<header_matches_dumpspecs($hdr, [@dumpspecs])>
 
index 678443867fab80019b1f9aadca43a1ff7d650334..b908c9575c4066076721a06bced96f8a27939e2d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -39,12 +39,13 @@ typedef struct dumpspec_t {
     char *disk;
     char *datestamp;
     char *level;
+    char *write_timestamp;
     %mutable;
 
     %extend {
        /* constructor */
-       dumpspec_t(char *host, char *disk, char *datestamp, char *level) {
-           return dumpspec_new(host, disk, datestamp, level);
+       dumpspec_t(char *host, char *disk, char *datestamp, char *level, char *write_timestamp) {
+           return dumpspec_new(host, disk, datestamp, level, write_timestamp);
        }
 
        ~dumpspec_t() {
@@ -93,6 +94,7 @@ amglue_add_flag_tag_fns(cmdline_parse_dumpspecs_flags);
 amglue_add_constant(CMDLINE_PARSE_DATESTAMP, cmdline_parse_dumpspecs_flags);
 amglue_add_constant(CMDLINE_PARSE_LEVEL, cmdline_parse_dumpspecs_flags);
 amglue_add_constant(CMDLINE_EMPTY_TO_WILDCARD, cmdline_parse_dumpspecs_flags);
+amglue_copy_to_tag(cmdline_parse_dumpspecs_flags, constants);
 
 %rename(parse_dumpspecs) cmdline_parse_dumpspecs;
 amglue_dumpspec_list *cmdline_parse_dumpspecs(int argc, char **argv, int flags);
@@ -141,4 +143,4 @@ gboolean header_matches_dumpspecs(dumpfile_t *dumpfile, amglue_dumpspec_list *du
 }
 %}
 
-amglue_export_ok(header_matches_dumpspecs);
+amglue_export_ok(header_matches_dumpspecs parse_dumpspecs format_dumpspec_components);
index 535ca20d8ef1c6790b7619dd039693a3a6ea4034..2725aa9d44298ecad72e13c0e1a0a2c20a201cf9 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -1552,6 +1555,195 @@ SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
 }
 
 
+static int
+val_t_to_sv(val_t *val, SV **results) {
+    if (!val) {
+       results[0] = &PL_sv_undef;
+       return 1;
+    } else {
+       switch (val->type) {
+           case CONFTYPE_RATE: {
+               results[0] = sv_newmortal();
+               sv_setnv(results[0], val_t__rate(val)[0]);
+
+               results[1] = sv_newmortal();
+               sv_setnv(results[1], val_t__rate(val)[1]);
+               return 2;
+           }
+
+           case CONFTYPE_INTRANGE: {
+               results[0] = sv_newmortal();
+               sv_setiv(results[0], val_t__intrange(val)[0]);
+
+               results[1] = sv_newmortal();
+               sv_setiv(results[1], val_t__intrange(val)[1]);
+               return 2;
+           }
+
+           case CONFTYPE_EXINCLUDE: {
+               /* exincludes are represented in perl as {
+                *      'list' : [ 'list1', 'list2', ..],
+                *      'file' : [ 'file1', 'file2', ..],
+                *      'optional' : 1,
+                * }
+                */
+               exinclude_t *ei = &val_t__exinclude(val);
+               AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
+               AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
+               SV *optional = sv_newmortal();
+               HV *hv;
+               sle_t *iter;
+
+               /* first set up each of the hash values */
+
+               if (ei->sl_list) {
+                   for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
+                       av_push(list_entries, newSVpv(iter->name, 0));
+                   }
+               }
+
+               if(ei->sl_file) {
+                   for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
+                       av_push(file_entries, newSVpv(iter->name, 0));
+                   }
+               }
+
+               sv_setiv(optional, ei->optional);
+
+               /* now build the hash */
+               hv = (HV *)sv_2mortal((SV *)newHV());
+               
+               hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
+               hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
+               hv_store(hv, "optional", 8, optional, 0);
+               SvREFCNT_inc(optional);
+
+               results[0] = sv_2mortal(newRV((SV *)hv));
+               return 1;
+           }
+
+           case CONFTYPE_PROPLIST:
+               results[0] = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(val)));
+               return 1;
+
+           case CONFTYPE_SIZE:
+               results[0] = sv_2mortal(amglue_newSVi64(val_t__size(val)));
+               return 1;
+
+           case CONFTYPE_INT64:
+               results[0] = sv_2mortal(amglue_newSVi64(val_t__int64(val)));
+               return 1;
+
+           case CONFTYPE_BOOLEAN:          /* all same as INT.. */
+           case CONFTYPE_COMPRESS:
+           case CONFTYPE_ENCRYPT:
+           case CONFTYPE_STRATEGY:
+           case CONFTYPE_TAPERALGO:
+           case CONFTYPE_PRIORITY:
+           case CONFTYPE_HOLDING:
+           case CONFTYPE_EXECUTE_ON:
+           case CONFTYPE_EXECUTE_WHERE:
+           case CONFTYPE_SEND_AMREPORT_ON:
+           case CONFTYPE_DATA_PATH:
+           case CONFTYPE_PART_CACHE_TYPE:
+           case CONFTYPE_INT:
+               results[0] = sv_2mortal(amglue_newSVi64(val_t__int(val)));
+               return 1;
+
+           case CONFTYPE_ESTIMATELIST: {
+               AV *elist = newAV();
+               estimatelist_t el;
+               for (el=val_t__estimatelist(val); el != NULL; el = el->next) {
+                   av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
+               }
+               results[0] = sv_2mortal(newRV_noinc((SV *)elist));
+               return 1;
+           }
+
+           case CONFTYPE_TIME:
+               results[0] = sv_2mortal(amglue_newSVi64(val_t__time(val)));
+               return 1;
+
+           case CONFTYPE_REAL:
+               results[0] = sv_newmortal();
+               sv_setnv(results[0], val_t__real(val));
+               return 1;
+
+           case CONFTYPE_IDENT:            /* same as STRING */
+           case CONFTYPE_STR:
+           case CONFTYPE_APPLICATION:
+               results[0] = sv_newmortal();
+               sv_setpv(results[0], val_t__str(val));
+               return 1;
+
+           case CONFTYPE_IDENTLIST: {
+               AV *ilist = newAV();
+
+               identlist_t il;
+               for (il=val_t__identlist(val); il != NULL; il = il->next) {
+                   av_push(ilist, newSVpv((char *)il->data, 0));
+               }
+
+               results[0] = sv_2mortal(newRV_noinc((SV *)ilist));
+               return 1;
+           }
+
+           case CONFTYPE_RECOVERY_LIMIT: {
+               AV *av;
+               GSList *iter;
+               recovery_limit_t *rl = &val_t__recovery_limit(val);
+
+               av = newAV();
+               if (rl->same_host)
+                   av_push(av, &PL_sv_undef);
+               for (iter=rl->match_pats; iter != NULL; iter = iter->next) {
+                   av_push(av, newSVpv((char *)iter->data, 0));
+               }
+
+               results[0] = sv_2mortal(newRV_noinc((SV *)av));
+               return 1;
+           }
+
+           case CONFTYPE_AUTOLABEL: {
+               autolabel_t *autolabel = &val_t__autolabel(val);
+               HV *hv;
+
+               /* now build the hash */
+               hv = (HV *)sv_2mortal((SV *)newHV());
+               hv_store(hv, "template", 8,
+                       (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
+                       0);
+               hv_store(hv, "other_config", 12,
+                       (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
+                       0);
+               hv_store(hv, "non_amanda", 10,
+                       (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
+                       0);
+               hv_store(hv, "volume_error", 12,
+                       (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
+                       0);
+               hv_store(hv, "empty", 5,
+                       (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
+                       0);
+
+               results[0] = sv_2mortal(newRV((SV *)hv));
+               return 1;
+           }
+
+           /* No match yet -> not one of the "complex" types */
+           default:
+               SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
+               break;
+       }
+    }
+
+    return 0;
+
+fail:
+    SWIG_croak_null();
+}
+
+
 SWIGINTERN swig_type_info*
 SWIG_pchar_descriptor(void)
 {
@@ -2227,186 +2419,18 @@ XS(_wrap_getconf) {
     }
     result = (val_t *)getconf(arg1);
     {
-      if (!result) {
-        ST(argvi) = &PL_sv_undef;
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
         argvi++;
-      } else {
-        switch (result->type) {
-          case CONFTYPE_RATE: {
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_INTRANGE: {
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_EXINCLUDE: {
-            /* exincludes are represented in perl as {
-                        *      'list' : [ 'list1', 'list2', ..],
-                        *      'file' : [ 'file1', 'file2', ..],
-                        *      'optional' : 1,
-                        * }
-                        */
-            exinclude_t *ei = &val_t__exinclude(result);
-            AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
-            AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
-            SV *optional = sv_newmortal();
-            HV *hv;
-            sle_t *iter;
-            
-            /* first set up each of the hash values */
-            
-            if (ei->sl_list) {
-              for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
-                av_push(list_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            if(ei->sl_file) {
-              for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
-                av_push(file_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            sv_setiv(optional, ei->optional);
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            
-            hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
-            hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
-            hv_store(hv, "optional", 8, optional, 0);
-            SvREFCNT_inc(optional);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_PROPLIST:
-          ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result)));
-          argvi++;
-          break;
-          
-        case CONFTYPE_SIZE:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_INT64:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_BOOLEAN:           /* all same as INT.. */
-        case CONFTYPE_COMPRESS:
-        case CONFTYPE_ENCRYPT:
-        case CONFTYPE_STRATEGY:
-        case CONFTYPE_TAPERALGO:
-        case CONFTYPE_PRIORITY:
-        case CONFTYPE_HOLDING:
-        case CONFTYPE_EXECUTE_ON:
-        case CONFTYPE_EXECUTE_WHERE:
-        case CONFTYPE_SEND_AMREPORT_ON:
-        case CONFTYPE_DATA_PATH:
-        case CONFTYPE_INT:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_ESTIMATELIST: {
-            AV *elist = newAV();
-            estimatelist_t el;
-            for (el=val_t__estimatelist(result); el != NULL; el = el->next) {
-              av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
-            }
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)elist));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_TIME:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_REAL:
-          ST(argvi) = sv_newmortal();
-          sv_setnv(ST(argvi), val_t__real(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENT:     /* same as STRING */
-        case CONFTYPE_STR:
-        case CONFTYPE_APPLICATION:
-          ST(argvi) = sv_newmortal();
-          sv_setpv(ST(argvi), val_t__str(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENTLIST: {
-            AV *ilist = newAV();
-            
-            identlist_t il;
-            for (il=val_t__identlist(result); il != NULL; il = il->next) {
-              av_push(ilist, newSVpv((char *)il->data, 0));
-            }
-            
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)ilist));
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_AUTOLABEL: {
-            autolabel_t *autolabel = &val_t__autolabel(result);
-            HV *hv;
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            hv_store(hv, "template", 8,
-              (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
-              0);
-            hv_store(hv, "other_config", 12,
-              (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "non_amanda", 10,
-              (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "volume_error", 12,
-              (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "empty", 5,
-              (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
-              0);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-          /* No match yet -> not one of the "complex" types */
-        default:
-          SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
-          break;
-        }
       }
     }
     
@@ -2519,186 +2543,18 @@ XS(_wrap_getconf_byname) {
     arg1 = (char *)(buf1);
     result = (val_t *)getconf_byname(arg1);
     {
-      if (!result) {
-        ST(argvi) = &PL_sv_undef;
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
         argvi++;
-      } else {
-        switch (result->type) {
-          case CONFTYPE_RATE: {
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_INTRANGE: {
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_EXINCLUDE: {
-            /* exincludes are represented in perl as {
-                        *      'list' : [ 'list1', 'list2', ..],
-                        *      'file' : [ 'file1', 'file2', ..],
-                        *      'optional' : 1,
-                        * }
-                        */
-            exinclude_t *ei = &val_t__exinclude(result);
-            AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
-            AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
-            SV *optional = sv_newmortal();
-            HV *hv;
-            sle_t *iter;
-            
-            /* first set up each of the hash values */
-            
-            if (ei->sl_list) {
-              for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
-                av_push(list_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            if(ei->sl_file) {
-              for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
-                av_push(file_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            sv_setiv(optional, ei->optional);
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            
-            hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
-            hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
-            hv_store(hv, "optional", 8, optional, 0);
-            SvREFCNT_inc(optional);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_PROPLIST:
-          ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result)));
-          argvi++;
-          break;
-          
-        case CONFTYPE_SIZE:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_INT64:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_BOOLEAN:           /* all same as INT.. */
-        case CONFTYPE_COMPRESS:
-        case CONFTYPE_ENCRYPT:
-        case CONFTYPE_STRATEGY:
-        case CONFTYPE_TAPERALGO:
-        case CONFTYPE_PRIORITY:
-        case CONFTYPE_HOLDING:
-        case CONFTYPE_EXECUTE_ON:
-        case CONFTYPE_EXECUTE_WHERE:
-        case CONFTYPE_SEND_AMREPORT_ON:
-        case CONFTYPE_DATA_PATH:
-        case CONFTYPE_INT:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_ESTIMATELIST: {
-            AV *elist = newAV();
-            estimatelist_t el;
-            for (el=val_t__estimatelist(result); el != NULL; el = el->next) {
-              av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
-            }
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)elist));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_TIME:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_REAL:
-          ST(argvi) = sv_newmortal();
-          sv_setnv(ST(argvi), val_t__real(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENT:     /* same as STRING */
-        case CONFTYPE_STR:
-        case CONFTYPE_APPLICATION:
-          ST(argvi) = sv_newmortal();
-          sv_setpv(ST(argvi), val_t__str(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENTLIST: {
-            AV *ilist = newAV();
-            
-            identlist_t il;
-            for (il=val_t__identlist(result); il != NULL; il = il->next) {
-              av_push(ilist, newSVpv((char *)il->data, 0));
-            }
-            
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)ilist));
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_AUTOLABEL: {
-            autolabel_t *autolabel = &val_t__autolabel(result);
-            HV *hv;
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            hv_store(hv, "template", 8,
-              (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
-              0);
-            hv_store(hv, "other_config", 12,
-              (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "non_amanda", 10,
-              (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "volume_error", 12,
-              (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "empty", 5,
-              (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
-              0);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-          /* No match yet -> not one of the "complex" types */
-        default:
-          SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
-          break;
-        }
       }
     }
     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
@@ -2865,186 +2721,18 @@ XS(_wrap_tapetype_getconf) {
     }
     result = (val_t *)tapetype_getconf(arg1,arg2);
     {
-      if (!result) {
-        ST(argvi) = &PL_sv_undef;
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
         argvi++;
-      } else {
-        switch (result->type) {
-          case CONFTYPE_RATE: {
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_INTRANGE: {
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_EXINCLUDE: {
-            /* exincludes are represented in perl as {
-                        *      'list' : [ 'list1', 'list2', ..],
-                        *      'file' : [ 'file1', 'file2', ..],
-                        *      'optional' : 1,
-                        * }
-                        */
-            exinclude_t *ei = &val_t__exinclude(result);
-            AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
-            AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
-            SV *optional = sv_newmortal();
-            HV *hv;
-            sle_t *iter;
-            
-            /* first set up each of the hash values */
-            
-            if (ei->sl_list) {
-              for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
-                av_push(list_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            if(ei->sl_file) {
-              for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
-                av_push(file_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            sv_setiv(optional, ei->optional);
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            
-            hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
-            hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
-            hv_store(hv, "optional", 8, optional, 0);
-            SvREFCNT_inc(optional);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_PROPLIST:
-          ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result)));
-          argvi++;
-          break;
-          
-        case CONFTYPE_SIZE:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_INT64:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_BOOLEAN:           /* all same as INT.. */
-        case CONFTYPE_COMPRESS:
-        case CONFTYPE_ENCRYPT:
-        case CONFTYPE_STRATEGY:
-        case CONFTYPE_TAPERALGO:
-        case CONFTYPE_PRIORITY:
-        case CONFTYPE_HOLDING:
-        case CONFTYPE_EXECUTE_ON:
-        case CONFTYPE_EXECUTE_WHERE:
-        case CONFTYPE_SEND_AMREPORT_ON:
-        case CONFTYPE_DATA_PATH:
-        case CONFTYPE_INT:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_ESTIMATELIST: {
-            AV *elist = newAV();
-            estimatelist_t el;
-            for (el=val_t__estimatelist(result); el != NULL; el = el->next) {
-              av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
-            }
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)elist));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_TIME:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_REAL:
-          ST(argvi) = sv_newmortal();
-          sv_setnv(ST(argvi), val_t__real(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENT:     /* same as STRING */
-        case CONFTYPE_STR:
-        case CONFTYPE_APPLICATION:
-          ST(argvi) = sv_newmortal();
-          sv_setpv(ST(argvi), val_t__str(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENTLIST: {
-            AV *ilist = newAV();
-            
-            identlist_t il;
-            for (il=val_t__identlist(result); il != NULL; il = il->next) {
-              av_push(ilist, newSVpv((char *)il->data, 0));
-            }
-            
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)ilist));
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_AUTOLABEL: {
-            autolabel_t *autolabel = &val_t__autolabel(result);
-            HV *hv;
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            hv_store(hv, "template", 8,
-              (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
-              0);
-            hv_store(hv, "other_config", 12,
-              (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "non_amanda", 10,
-              (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "volume_error", 12,
-              (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "empty", 5,
-              (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
-              0);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-          /* No match yet -> not one of the "complex" types */
-        default:
-          SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
-          break;
-        }
       }
     }
     
@@ -3198,186 +2886,18 @@ XS(_wrap_dumptype_getconf) {
     }
     result = (val_t *)dumptype_getconf(arg1,arg2);
     {
-      if (!result) {
-        ST(argvi) = &PL_sv_undef;
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
         argvi++;
-      } else {
-        switch (result->type) {
-          case CONFTYPE_RATE: {
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_INTRANGE: {
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_EXINCLUDE: {
-            /* exincludes are represented in perl as {
-                        *      'list' : [ 'list1', 'list2', ..],
-                        *      'file' : [ 'file1', 'file2', ..],
-                        *      'optional' : 1,
-                        * }
-                        */
-            exinclude_t *ei = &val_t__exinclude(result);
-            AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
-            AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
-            SV *optional = sv_newmortal();
-            HV *hv;
-            sle_t *iter;
-            
-            /* first set up each of the hash values */
-            
-            if (ei->sl_list) {
-              for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
-                av_push(list_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            if(ei->sl_file) {
-              for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
-                av_push(file_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            sv_setiv(optional, ei->optional);
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            
-            hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
-            hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
-            hv_store(hv, "optional", 8, optional, 0);
-            SvREFCNT_inc(optional);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_PROPLIST:
-          ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result)));
-          argvi++;
-          break;
-          
-        case CONFTYPE_SIZE:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_INT64:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_BOOLEAN:           /* all same as INT.. */
-        case CONFTYPE_COMPRESS:
-        case CONFTYPE_ENCRYPT:
-        case CONFTYPE_STRATEGY:
-        case CONFTYPE_TAPERALGO:
-        case CONFTYPE_PRIORITY:
-        case CONFTYPE_HOLDING:
-        case CONFTYPE_EXECUTE_ON:
-        case CONFTYPE_EXECUTE_WHERE:
-        case CONFTYPE_SEND_AMREPORT_ON:
-        case CONFTYPE_DATA_PATH:
-        case CONFTYPE_INT:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_ESTIMATELIST: {
-            AV *elist = newAV();
-            estimatelist_t el;
-            for (el=val_t__estimatelist(result); el != NULL; el = el->next) {
-              av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
-            }
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)elist));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_TIME:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_REAL:
-          ST(argvi) = sv_newmortal();
-          sv_setnv(ST(argvi), val_t__real(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENT:     /* same as STRING */
-        case CONFTYPE_STR:
-        case CONFTYPE_APPLICATION:
-          ST(argvi) = sv_newmortal();
-          sv_setpv(ST(argvi), val_t__str(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENTLIST: {
-            AV *ilist = newAV();
-            
-            identlist_t il;
-            for (il=val_t__identlist(result); il != NULL; il = il->next) {
-              av_push(ilist, newSVpv((char *)il->data, 0));
-            }
-            
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)ilist));
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_AUTOLABEL: {
-            autolabel_t *autolabel = &val_t__autolabel(result);
-            HV *hv;
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            hv_store(hv, "template", 8,
-              (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
-              0);
-            hv_store(hv, "other_config", 12,
-              (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "non_amanda", 10,
-              (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "volume_error", 12,
-              (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "empty", 5,
-              (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
-              0);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-          /* No match yet -> not one of the "complex" types */
-        default:
-          SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
-          break;
-        }
       }
     }
     
@@ -3531,186 +3051,18 @@ XS(_wrap_interface_getconf) {
     }
     result = (val_t *)interface_getconf(arg1,arg2);
     {
-      if (!result) {
-        ST(argvi) = &PL_sv_undef;
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
         argvi++;
-      } else {
-        switch (result->type) {
-          case CONFTYPE_RATE: {
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_INTRANGE: {
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_EXINCLUDE: {
-            /* exincludes are represented in perl as {
-                        *      'list' : [ 'list1', 'list2', ..],
-                        *      'file' : [ 'file1', 'file2', ..],
-                        *      'optional' : 1,
-                        * }
-                        */
-            exinclude_t *ei = &val_t__exinclude(result);
-            AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
-            AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
-            SV *optional = sv_newmortal();
-            HV *hv;
-            sle_t *iter;
-            
-            /* first set up each of the hash values */
-            
-            if (ei->sl_list) {
-              for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
-                av_push(list_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            if(ei->sl_file) {
-              for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
-                av_push(file_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            sv_setiv(optional, ei->optional);
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            
-            hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
-            hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
-            hv_store(hv, "optional", 8, optional, 0);
-            SvREFCNT_inc(optional);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_PROPLIST:
-          ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result)));
-          argvi++;
-          break;
-          
-        case CONFTYPE_SIZE:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_INT64:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_BOOLEAN:           /* all same as INT.. */
-        case CONFTYPE_COMPRESS:
-        case CONFTYPE_ENCRYPT:
-        case CONFTYPE_STRATEGY:
-        case CONFTYPE_TAPERALGO:
-        case CONFTYPE_PRIORITY:
-        case CONFTYPE_HOLDING:
-        case CONFTYPE_EXECUTE_ON:
-        case CONFTYPE_EXECUTE_WHERE:
-        case CONFTYPE_SEND_AMREPORT_ON:
-        case CONFTYPE_DATA_PATH:
-        case CONFTYPE_INT:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_ESTIMATELIST: {
-            AV *elist = newAV();
-            estimatelist_t el;
-            for (el=val_t__estimatelist(result); el != NULL; el = el->next) {
-              av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
-            }
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)elist));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_TIME:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_REAL:
-          ST(argvi) = sv_newmortal();
-          sv_setnv(ST(argvi), val_t__real(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENT:     /* same as STRING */
-        case CONFTYPE_STR:
-        case CONFTYPE_APPLICATION:
-          ST(argvi) = sv_newmortal();
-          sv_setpv(ST(argvi), val_t__str(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENTLIST: {
-            AV *ilist = newAV();
-            
-            identlist_t il;
-            for (il=val_t__identlist(result); il != NULL; il = il->next) {
-              av_push(ilist, newSVpv((char *)il->data, 0));
-            }
-            
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)ilist));
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_AUTOLABEL: {
-            autolabel_t *autolabel = &val_t__autolabel(result);
-            HV *hv;
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            hv_store(hv, "template", 8,
-              (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
-              0);
-            hv_store(hv, "other_config", 12,
-              (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "non_amanda", 10,
-              (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "volume_error", 12,
-              (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "empty", 5,
-              (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
-              0);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-          /* No match yet -> not one of the "complex" types */
-        default:
-          SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
-          break;
-        }
       }
     }
     
@@ -3892,186 +3244,18 @@ XS(_wrap_holdingdisk_getconf) {
     }
     result = (val_t *)holdingdisk_getconf(arg1,arg2);
     {
-      if (!result) {
-        ST(argvi) = &PL_sv_undef;
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
         argvi++;
-      } else {
-        switch (result->type) {
-          case CONFTYPE_RATE: {
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_INTRANGE: {
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_EXINCLUDE: {
-            /* exincludes are represented in perl as {
-                        *      'list' : [ 'list1', 'list2', ..],
-                        *      'file' : [ 'file1', 'file2', ..],
-                        *      'optional' : 1,
-                        * }
-                        */
-            exinclude_t *ei = &val_t__exinclude(result);
-            AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
-            AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
-            SV *optional = sv_newmortal();
-            HV *hv;
-            sle_t *iter;
-            
-            /* first set up each of the hash values */
-            
-            if (ei->sl_list) {
-              for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
-                av_push(list_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            if(ei->sl_file) {
-              for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
-                av_push(file_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            sv_setiv(optional, ei->optional);
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            
-            hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
-            hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
-            hv_store(hv, "optional", 8, optional, 0);
-            SvREFCNT_inc(optional);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_PROPLIST:
-          ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result)));
-          argvi++;
-          break;
-          
-        case CONFTYPE_SIZE:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_INT64:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_BOOLEAN:           /* all same as INT.. */
-        case CONFTYPE_COMPRESS:
-        case CONFTYPE_ENCRYPT:
-        case CONFTYPE_STRATEGY:
-        case CONFTYPE_TAPERALGO:
-        case CONFTYPE_PRIORITY:
-        case CONFTYPE_HOLDING:
-        case CONFTYPE_EXECUTE_ON:
-        case CONFTYPE_EXECUTE_WHERE:
-        case CONFTYPE_SEND_AMREPORT_ON:
-        case CONFTYPE_DATA_PATH:
-        case CONFTYPE_INT:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_ESTIMATELIST: {
-            AV *elist = newAV();
-            estimatelist_t el;
-            for (el=val_t__estimatelist(result); el != NULL; el = el->next) {
-              av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
-            }
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)elist));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_TIME:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_REAL:
-          ST(argvi) = sv_newmortal();
-          sv_setnv(ST(argvi), val_t__real(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENT:     /* same as STRING */
-        case CONFTYPE_STR:
-        case CONFTYPE_APPLICATION:
-          ST(argvi) = sv_newmortal();
-          sv_setpv(ST(argvi), val_t__str(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENTLIST: {
-            AV *ilist = newAV();
-            
-            identlist_t il;
-            for (il=val_t__identlist(result); il != NULL; il = il->next) {
-              av_push(ilist, newSVpv((char *)il->data, 0));
-            }
-            
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)ilist));
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_AUTOLABEL: {
-            autolabel_t *autolabel = &val_t__autolabel(result);
-            HV *hv;
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            hv_store(hv, "template", 8,
-              (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
-              0);
-            hv_store(hv, "other_config", 12,
-              (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "non_amanda", 10,
-              (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "volume_error", 12,
-              (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "empty", 5,
-              (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
-              0);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-          /* No match yet -> not one of the "complex" types */
-        default:
-          SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
-          break;
-        }
       }
     }
     
@@ -4225,186 +3409,18 @@ XS(_wrap_application_getconf) {
     }
     result = (val_t *)application_getconf(arg1,arg2);
     {
-      if (!result) {
-        ST(argvi) = &PL_sv_undef;
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
         argvi++;
-      } else {
-        switch (result->type) {
-          case CONFTYPE_RATE: {
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_INTRANGE: {
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_EXINCLUDE: {
-            /* exincludes are represented in perl as {
-                        *      'list' : [ 'list1', 'list2', ..],
-                        *      'file' : [ 'file1', 'file2', ..],
-                        *      'optional' : 1,
-                        * }
-                        */
-            exinclude_t *ei = &val_t__exinclude(result);
-            AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
-            AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
-            SV *optional = sv_newmortal();
-            HV *hv;
-            sle_t *iter;
-            
-            /* first set up each of the hash values */
-            
-            if (ei->sl_list) {
-              for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
-                av_push(list_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            if(ei->sl_file) {
-              for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
-                av_push(file_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            sv_setiv(optional, ei->optional);
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            
-            hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
-            hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
-            hv_store(hv, "optional", 8, optional, 0);
-            SvREFCNT_inc(optional);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_PROPLIST:
-          ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result)));
-          argvi++;
-          break;
-          
-        case CONFTYPE_SIZE:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_INT64:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_BOOLEAN:           /* all same as INT.. */
-        case CONFTYPE_COMPRESS:
-        case CONFTYPE_ENCRYPT:
-        case CONFTYPE_STRATEGY:
-        case CONFTYPE_TAPERALGO:
-        case CONFTYPE_PRIORITY:
-        case CONFTYPE_HOLDING:
-        case CONFTYPE_EXECUTE_ON:
-        case CONFTYPE_EXECUTE_WHERE:
-        case CONFTYPE_SEND_AMREPORT_ON:
-        case CONFTYPE_DATA_PATH:
-        case CONFTYPE_INT:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_ESTIMATELIST: {
-            AV *elist = newAV();
-            estimatelist_t el;
-            for (el=val_t__estimatelist(result); el != NULL; el = el->next) {
-              av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
-            }
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)elist));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_TIME:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_REAL:
-          ST(argvi) = sv_newmortal();
-          sv_setnv(ST(argvi), val_t__real(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENT:     /* same as STRING */
-        case CONFTYPE_STR:
-        case CONFTYPE_APPLICATION:
-          ST(argvi) = sv_newmortal();
-          sv_setpv(ST(argvi), val_t__str(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENTLIST: {
-            AV *ilist = newAV();
-            
-            identlist_t il;
-            for (il=val_t__identlist(result); il != NULL; il = il->next) {
-              av_push(ilist, newSVpv((char *)il->data, 0));
-            }
-            
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)ilist));
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_AUTOLABEL: {
-            autolabel_t *autolabel = &val_t__autolabel(result);
-            HV *hv;
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            hv_store(hv, "template", 8,
-              (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
-              0);
-            hv_store(hv, "other_config", 12,
-              (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "non_amanda", 10,
-              (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "volume_error", 12,
-              (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "empty", 5,
-              (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
-              0);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-          /* No match yet -> not one of the "complex" types */
-        default:
-          SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
-          break;
-        }
       }
     }
     
@@ -4558,186 +3574,18 @@ XS(_wrap_pp_script_getconf) {
     }
     result = (val_t *)pp_script_getconf(arg1,arg2);
     {
-      if (!result) {
-        ST(argvi) = &PL_sv_undef;
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
         argvi++;
-      } else {
-        switch (result->type) {
-          case CONFTYPE_RATE: {
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_INTRANGE: {
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_EXINCLUDE: {
-            /* exincludes are represented in perl as {
-                        *      'list' : [ 'list1', 'list2', ..],
-                        *      'file' : [ 'file1', 'file2', ..],
-                        *      'optional' : 1,
-                        * }
-                        */
-            exinclude_t *ei = &val_t__exinclude(result);
-            AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
-            AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
-            SV *optional = sv_newmortal();
-            HV *hv;
-            sle_t *iter;
-            
-            /* first set up each of the hash values */
-            
-            if (ei->sl_list) {
-              for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
-                av_push(list_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            if(ei->sl_file) {
-              for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
-                av_push(file_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            sv_setiv(optional, ei->optional);
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            
-            hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
-            hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
-            hv_store(hv, "optional", 8, optional, 0);
-            SvREFCNT_inc(optional);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_PROPLIST:
-          ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result)));
-          argvi++;
-          break;
-          
-        case CONFTYPE_SIZE:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_INT64:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_BOOLEAN:           /* all same as INT.. */
-        case CONFTYPE_COMPRESS:
-        case CONFTYPE_ENCRYPT:
-        case CONFTYPE_STRATEGY:
-        case CONFTYPE_TAPERALGO:
-        case CONFTYPE_PRIORITY:
-        case CONFTYPE_HOLDING:
-        case CONFTYPE_EXECUTE_ON:
-        case CONFTYPE_EXECUTE_WHERE:
-        case CONFTYPE_SEND_AMREPORT_ON:
-        case CONFTYPE_DATA_PATH:
-        case CONFTYPE_INT:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_ESTIMATELIST: {
-            AV *elist = newAV();
-            estimatelist_t el;
-            for (el=val_t__estimatelist(result); el != NULL; el = el->next) {
-              av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
-            }
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)elist));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_TIME:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_REAL:
-          ST(argvi) = sv_newmortal();
-          sv_setnv(ST(argvi), val_t__real(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENT:     /* same as STRING */
-        case CONFTYPE_STR:
-        case CONFTYPE_APPLICATION:
-          ST(argvi) = sv_newmortal();
-          sv_setpv(ST(argvi), val_t__str(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENTLIST: {
-            AV *ilist = newAV();
-            
-            identlist_t il;
-            for (il=val_t__identlist(result); il != NULL; il = il->next) {
-              av_push(ilist, newSVpv((char *)il->data, 0));
-            }
-            
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)ilist));
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_AUTOLABEL: {
-            autolabel_t *autolabel = &val_t__autolabel(result);
-            HV *hv;
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            hv_store(hv, "template", 8,
-              (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
-              0);
-            hv_store(hv, "other_config", 12,
-              (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "non_amanda", 10,
-              (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "volume_error", 12,
-              (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "empty", 5,
-              (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
-              0);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-          /* No match yet -> not one of the "complex" types */
-        default:
-          SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
-          break;
-        }
       }
     }
     
@@ -4891,186 +3739,18 @@ XS(_wrap_device_config_getconf) {
     }
     result = (val_t *)device_config_getconf(arg1,arg2);
     {
-      if (!result) {
-        ST(argvi) = &PL_sv_undef;
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
         argvi++;
-      } else {
-        switch (result->type) {
-          case CONFTYPE_RATE: {
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_INTRANGE: {
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_EXINCLUDE: {
-            /* exincludes are represented in perl as {
-                        *      'list' : [ 'list1', 'list2', ..],
-                        *      'file' : [ 'file1', 'file2', ..],
-                        *      'optional' : 1,
-                        * }
-                        */
-            exinclude_t *ei = &val_t__exinclude(result);
-            AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
-            AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
-            SV *optional = sv_newmortal();
-            HV *hv;
-            sle_t *iter;
-            
-            /* first set up each of the hash values */
-            
-            if (ei->sl_list) {
-              for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
-                av_push(list_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            if(ei->sl_file) {
-              for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
-                av_push(file_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            sv_setiv(optional, ei->optional);
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            
-            hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
-            hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
-            hv_store(hv, "optional", 8, optional, 0);
-            SvREFCNT_inc(optional);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_PROPLIST:
-          ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result)));
-          argvi++;
-          break;
-          
-        case CONFTYPE_SIZE:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_INT64:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_BOOLEAN:           /* all same as INT.. */
-        case CONFTYPE_COMPRESS:
-        case CONFTYPE_ENCRYPT:
-        case CONFTYPE_STRATEGY:
-        case CONFTYPE_TAPERALGO:
-        case CONFTYPE_PRIORITY:
-        case CONFTYPE_HOLDING:
-        case CONFTYPE_EXECUTE_ON:
-        case CONFTYPE_EXECUTE_WHERE:
-        case CONFTYPE_SEND_AMREPORT_ON:
-        case CONFTYPE_DATA_PATH:
-        case CONFTYPE_INT:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_ESTIMATELIST: {
-            AV *elist = newAV();
-            estimatelist_t el;
-            for (el=val_t__estimatelist(result); el != NULL; el = el->next) {
-              av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
-            }
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)elist));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_TIME:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_REAL:
-          ST(argvi) = sv_newmortal();
-          sv_setnv(ST(argvi), val_t__real(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENT:     /* same as STRING */
-        case CONFTYPE_STR:
-        case CONFTYPE_APPLICATION:
-          ST(argvi) = sv_newmortal();
-          sv_setpv(ST(argvi), val_t__str(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENTLIST: {
-            AV *ilist = newAV();
-            
-            identlist_t il;
-            for (il=val_t__identlist(result); il != NULL; il = il->next) {
-              av_push(ilist, newSVpv((char *)il->data, 0));
-            }
-            
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)ilist));
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_AUTOLABEL: {
-            autolabel_t *autolabel = &val_t__autolabel(result);
-            HV *hv;
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            hv_store(hv, "template", 8,
-              (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
-              0);
-            hv_store(hv, "other_config", 12,
-              (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "non_amanda", 10,
-              (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "volume_error", 12,
-              (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "empty", 5,
-              (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
-              0);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-          /* No match yet -> not one of the "complex" types */
-        default:
-          SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
-          break;
-        }
       }
     }
     
@@ -5224,186 +3904,18 @@ XS(_wrap_changer_config_getconf) {
     }
     result = (val_t *)changer_config_getconf(arg1,arg2);
     {
-      if (!result) {
-        ST(argvi) = &PL_sv_undef;
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
         argvi++;
-      } else {
-        switch (result->type) {
-          case CONFTYPE_RATE: {
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setnv(ST(argvi), val_t__rate(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_INTRANGE: {
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[0]);
-            argvi++;
-            
-            ST(argvi)= sv_newmortal();
-            sv_setiv(ST(argvi), val_t__intrange(result)[1]);
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_EXINCLUDE: {
-            /* exincludes are represented in perl as {
-                        *      'list' : [ 'list1', 'list2', ..],
-                        *      'file' : [ 'file1', 'file2', ..],
-                        *      'optional' : 1,
-                        * }
-                        */
-            exinclude_t *ei = &val_t__exinclude(result);
-            AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
-            AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
-            SV *optional = sv_newmortal();
-            HV *hv;
-            sle_t *iter;
-            
-            /* first set up each of the hash values */
-            
-            if (ei->sl_list) {
-              for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
-                av_push(list_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            if(ei->sl_file) {
-              for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
-                av_push(file_entries, newSVpv(iter->name, 0));
-              }
-            }
-            
-            sv_setiv(optional, ei->optional);
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            
-            hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
-            hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
-            hv_store(hv, "optional", 8, optional, 0);
-            SvREFCNT_inc(optional);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_PROPLIST:
-          ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result)));
-          argvi++;
-          break;
-          
-        case CONFTYPE_SIZE:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_INT64:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_BOOLEAN:           /* all same as INT.. */
-        case CONFTYPE_COMPRESS:
-        case CONFTYPE_ENCRYPT:
-        case CONFTYPE_STRATEGY:
-        case CONFTYPE_TAPERALGO:
-        case CONFTYPE_PRIORITY:
-        case CONFTYPE_HOLDING:
-        case CONFTYPE_EXECUTE_ON:
-        case CONFTYPE_EXECUTE_WHERE:
-        case CONFTYPE_SEND_AMREPORT_ON:
-        case CONFTYPE_DATA_PATH:
-        case CONFTYPE_INT:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-          case CONFTYPE_ESTIMATELIST: {
-            AV *elist = newAV();
-            estimatelist_t el;
-            for (el=val_t__estimatelist(result); el != NULL; el = el->next) {
-              av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
-            }
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)elist));
-            argvi++;
-            break;
-          }
-          
-        case CONFTYPE_TIME:
-          SP += argvi; PUTBACK;
-          ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
-          SPAGAIN; SP -= argvi; argvi++;
-          break;
-          
-        case CONFTYPE_REAL:
-          ST(argvi) = sv_newmortal();
-          sv_setnv(ST(argvi), val_t__real(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENT:     /* same as STRING */
-        case CONFTYPE_STR:
-        case CONFTYPE_APPLICATION:
-          ST(argvi) = sv_newmortal();
-          sv_setpv(ST(argvi), val_t__str(result));
-          argvi++;
-          break;
-          
-          case CONFTYPE_IDENTLIST: {
-            AV *ilist = newAV();
-            
-            identlist_t il;
-            for (il=val_t__identlist(result); il != NULL; il = il->next) {
-              av_push(ilist, newSVpv((char *)il->data, 0));
-            }
-            
-            ST(argvi) = sv_2mortal(newRV_noinc((SV *)ilist));
-            argvi++;
-            break;
-          }
-          
-          case CONFTYPE_AUTOLABEL: {
-            autolabel_t *autolabel = &val_t__autolabel(result);
-            HV *hv;
-            
-            /* now build the hash */
-            hv = (HV *)sv_2mortal((SV *)newHV());
-            hv_store(hv, "template", 8,
-              (autolabel->template)? newSVpv(autolabel->template, 0) : newSV(0),
-              0);
-            hv_store(hv, "other_config", 12,
-              (autolabel->autolabel & AL_OTHER_CONFIG)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "non_amanda", 10,
-              (autolabel->autolabel & AL_NON_AMANDA)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "volume_error", 12,
-              (autolabel->autolabel & AL_VOLUME_ERROR)? &PL_sv_yes : &PL_sv_no,
-              0);
-            hv_store(hv, "empty", 5,
-              (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
-              0);
-            
-            ST(argvi) = sv_2mortal(newRV((SV *)hv));
-            argvi++;
-            break;
-          }
-          
-          /* No match yet -> not one of the "complex" types */
-        default:
-          SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
-          break;
-        }
       }
     }
     
@@ -6081,6 +4593,35 @@ XS(_wrap_C_string_to_boolean) {
 }
 
 
+XS(_wrap_amandaify_property_name) {
+  {
+    gchar *arg1 = (gchar *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    gchar *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: amandaify_property_name(name);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "amandaify_property_name" "', argument " "1"" of type '" "gchar const *""'");
+    }
+    arg1 = (gchar *)(buf1);
+    result = (gchar *)amandaify_property_name((char const *)arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
@@ -6093,7 +4634,7 @@ static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0,
 static swig_type_info _swigt__p_dumptype_t = {"_p_dumptype_t", "dumptype_t *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_holdingdisk_t = {"_p_holdingdisk_t", "holdingdisk_t *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_int = {"_p_int", "application_key *|strategy_t *|pp_script_key *|int *|autolabel_enum_t *|comp_t *|dump_holdingdisk_t *|device_config_key *|changer_config_key *|confparm_key *|interface_key *|holdingdisk_key *|dumptype_key *|tapetype_key *|cfgerr_level_t *|encrypt_t *|taperalgo_t *|gboolean *|data_path_t *|execute_on_t *|send_amreport_on_t *|estimate_t *|config_init_flags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "application_key *|strategy_t *|pp_script_key *|int *|autolabel_enum_t *|comp_t *|dump_holdingdisk_t *|device_config_key *|changer_config_key *|confparm_key *|interface_key *|holdingdisk_key *|dumptype_key *|tapetype_key *|part_cache_type_t *|cfgerr_level_t *|encrypt_t *|taperalgo_t *|gboolean *|data_path_t *|execute_on_t *|send_amreport_on_t *|estimate_t *|config_init_flags *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_interface_t = {"_p_interface_t", "interface_t *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_p_GSList = {"_p_p_GSList", "GSList **", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
@@ -6246,6 +4787,7 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Configc::taperalgo2str", _wrap_taperalgo2str},
 {"Amanda::Configc::find_multiplier", _wrap_find_multiplier},
 {"Amanda::Configc::C_string_to_boolean", _wrap_C_string_to_boolean},
+{"Amanda::Configc::amandaify_property_name", _wrap_amandaify_property_name},
 {0,0}
 };
 /* -----------------------------------------------------------------------------
@@ -6755,11 +5297,6 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_CTIMEOUT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
-    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPEBUFS", TRUE | 0x2 | GV_ADDMULTI);
-    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPEBUFS)));
-    SvREADONLY_on(sv);
-  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "CNF_DEVICE_OUTPUT_BUFFER_SIZE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEVICE_OUTPUT_BUFFER_SIZE)));
@@ -6975,6 +5512,16 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_SEND_AMREPORT_ON)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPER_PARALLEL_WRITE", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPER_PARALLEL_WRITE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_RECOVERY_LIMIT", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_RECOVERY_LIMIT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_COMMENT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_COMMENT)));
@@ -7011,8 +5558,23 @@ XS(SWIG_init) {
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
-    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_FILE_PAD", TRUE | 0x2 | GV_ADDMULTI);
-    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_FILE_PAD)));
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_PART_SIZE", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_PART_SIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_PART_CACHE_TYPE", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_PART_CACHE_TYPE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_PART_CACHE_DIR", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_PART_CACHE_DIR)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_PART_CACHE_MAX_SIZE", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_PART_CACHE_MAX_SIZE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
@@ -7230,6 +5792,16 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_DATA_PATH)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_ALLOW_SPLIT", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_ALLOW_SPLIT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_RECOVERY_LIMIT", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_RECOVERY_LIMIT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "INTER_COMMENT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(INTER_COMMENT)));
@@ -7615,6 +6187,21 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DATA_PATH_DIRECTTCP)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PART_CACHE_TYPE_NONE", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PART_CACHE_TYPE_NONE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PART_CACHE_TYPE_DISK", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PART_CACHE_TYPE_DISK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PART_CACHE_TYPE_MEMORY", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PART_CACHE_TYPE_MEMORY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "CFGERR_OK", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CFGERR_OK)));
index 79962b35431c60b3d6b931730dee7f3427a86caf..f4ce4d7787f82d4768a7b2ee394ae3d6a07dc1f9 100644 (file)
@@ -109,6 +109,7 @@ package Amanda::Config;
 *taperalgo2str = *Amanda::Configc::taperalgo2str;
 *find_multiplier = *Amanda::Configc::find_multiplier;
 *C_string_to_boolean = *Amanda::Configc::C_string_to_boolean;
+*amandaify_property_name = *Amanda::Configc::amandaify_property_name;
 
 # ------- VARIABLE STUBS --------
 
@@ -157,7 +158,6 @@ package Amanda::Config;
 *CNF_ETIMEOUT = *Amanda::Configc::CNF_ETIMEOUT;
 *CNF_DTIMEOUT = *Amanda::Configc::CNF_DTIMEOUT;
 *CNF_CTIMEOUT = *Amanda::Configc::CNF_CTIMEOUT;
-*CNF_TAPEBUFS = *Amanda::Configc::CNF_TAPEBUFS;
 *CNF_DEVICE_OUTPUT_BUFFER_SIZE = *Amanda::Configc::CNF_DEVICE_OUTPUT_BUFFER_SIZE;
 *CNF_PRINTER = *Amanda::Configc::CNF_PRINTER;
 *CNF_AUTOFLUSH = *Amanda::Configc::CNF_AUTOFLUSH;
@@ -201,6 +201,8 @@ package Amanda::Config;
 *CNF_UNRESERVED_TCP_PORT = *Amanda::Configc::CNF_UNRESERVED_TCP_PORT;
 *CNF_HOLDINGDISK = *Amanda::Configc::CNF_HOLDINGDISK;
 *CNF_SEND_AMREPORT_ON = *Amanda::Configc::CNF_SEND_AMREPORT_ON;
+*CNF_TAPER_PARALLEL_WRITE = *Amanda::Configc::CNF_TAPER_PARALLEL_WRITE;
+*CNF_RECOVERY_LIMIT = *Amanda::Configc::CNF_RECOVERY_LIMIT;
 *TAPETYPE_COMMENT = *Amanda::Configc::TAPETYPE_COMMENT;
 *TAPETYPE_LBL_TEMPL = *Amanda::Configc::TAPETYPE_LBL_TEMPL;
 *TAPETYPE_BLOCKSIZE = *Amanda::Configc::TAPETYPE_BLOCKSIZE;
@@ -208,7 +210,10 @@ package Amanda::Config;
 *TAPETYPE_LENGTH = *Amanda::Configc::TAPETYPE_LENGTH;
 *TAPETYPE_FILEMARK = *Amanda::Configc::TAPETYPE_FILEMARK;
 *TAPETYPE_SPEED = *Amanda::Configc::TAPETYPE_SPEED;
-*TAPETYPE_FILE_PAD = *Amanda::Configc::TAPETYPE_FILE_PAD;
+*TAPETYPE_PART_SIZE = *Amanda::Configc::TAPETYPE_PART_SIZE;
+*TAPETYPE_PART_CACHE_TYPE = *Amanda::Configc::TAPETYPE_PART_CACHE_TYPE;
+*TAPETYPE_PART_CACHE_DIR = *Amanda::Configc::TAPETYPE_PART_CACHE_DIR;
+*TAPETYPE_PART_CACHE_MAX_SIZE = *Amanda::Configc::TAPETYPE_PART_CACHE_MAX_SIZE;
 *DUMPTYPE_COMMENT = *Amanda::Configc::DUMPTYPE_COMMENT;
 *DUMPTYPE_PROGRAM = *Amanda::Configc::DUMPTYPE_PROGRAM;
 *DUMPTYPE_SRVCOMPPROG = *Amanda::Configc::DUMPTYPE_SRVCOMPPROG;
@@ -252,6 +257,8 @@ package Amanda::Config;
 *DUMPTYPE_SCRIPTLIST = *Amanda::Configc::DUMPTYPE_SCRIPTLIST;
 *DUMPTYPE_PROPERTY = *Amanda::Configc::DUMPTYPE_PROPERTY;
 *DUMPTYPE_DATA_PATH = *Amanda::Configc::DUMPTYPE_DATA_PATH;
+*DUMPTYPE_ALLOW_SPLIT = *Amanda::Configc::DUMPTYPE_ALLOW_SPLIT;
+*DUMPTYPE_RECOVERY_LIMIT = *Amanda::Configc::DUMPTYPE_RECOVERY_LIMIT;
 *INTER_COMMENT = *Amanda::Configc::INTER_COMMENT;
 *INTER_MAXUSAGE = *Amanda::Configc::INTER_MAXUSAGE;
 *HOLDING_COMMENT = *Amanda::Configc::HOLDING_COMMENT;
@@ -329,6 +336,9 @@ package Amanda::Config;
 *SEND_AMREPORT_NEVER = *Amanda::Configc::SEND_AMREPORT_NEVER;
 *DATA_PATH_AMANDA = *Amanda::Configc::DATA_PATH_AMANDA;
 *DATA_PATH_DIRECTTCP = *Amanda::Configc::DATA_PATH_DIRECTTCP;
+*PART_CACHE_TYPE_NONE = *Amanda::Configc::PART_CACHE_TYPE_NONE;
+*PART_CACHE_TYPE_DISK = *Amanda::Configc::PART_CACHE_TYPE_DISK;
+*PART_CACHE_TYPE_MEMORY = *Amanda::Configc::PART_CACHE_TYPE_MEMORY;
 *debug_amandad = *Amanda::Configc::debug_amandad;
 *debug_recovery = *Amanda::Configc::debug_recovery;
 *debug_amidxtaped = *Amanda::Configc::debug_amidxtaped;
@@ -379,8 +389,7 @@ Amanda::Config - access to Amanda configuration parameters
 
     print "tape device is ", getconf($CNF_TAPEDEV), "\n";
 
-This API closely parallels the C API.  See F<conffile.h> for details on the
-configuration parameter constants.
+This API closely parallels the C API.
 
 =head1 INITIALIZATION
 
@@ -586,6 +595,9 @@ values is straightforward:
   CONFTYPE_EXECUTE_WHERE              Math::BigInt
   CONFTYPE_SEND_AMREPORT_ON           Math::BigInt
   CONFTYPE_IDENTLIST                  [ string, .. ]
+  CONFTYPE_PART_CACHE_TYPE           Math::BigInt
+  CONFTYPE_RECOVERY_LIMIT             [ string, .. ] (undef if not specified;
+                                           undef in the list means same-host)
 
 Note that C<CONFTYPE_INTRANGE> and C<CONFTYPE_RATE> each return two values, not
 an array reference.
@@ -664,8 +676,15 @@ C<string_to_boolean()> takes a string and returns 0 if it matches any of
 Amanda's names for false, or 1 if matches a name for true. If it can't be
 interpreted, C<undef> is returned.
 
-=cut
+C<amandaify_property_name()> converts a string into Amanda's property style:
+all lower-case and with "-" replacing "_".
+
+=head1 CONSTANTS
+
+This section lists all of the configuration parameter constants defined in this
+module.  All of these constants are available with the C<:getconf> export tag.
 
+=cut
 
 
 push @EXPORT_OK, qw(confparm_key_to_string);
@@ -689,443 +708,20 @@ sub confparm_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw($CNF_ORG);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_ORG);
-
-$_confparm_key_VALUES{"CNF_ORG"} = $CNF_ORG;
-
-push @EXPORT_OK, qw($CNF_CONF);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CONF);
-
-$_confparm_key_VALUES{"CNF_CONF"} = $CNF_CONF;
-
-push @EXPORT_OK, qw($CNF_INDEX_SERVER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_INDEX_SERVER);
-
-$_confparm_key_VALUES{"CNF_INDEX_SERVER"} = $CNF_INDEX_SERVER;
-
-push @EXPORT_OK, qw($CNF_TAPE_SERVER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPE_SERVER);
-
-$_confparm_key_VALUES{"CNF_TAPE_SERVER"} = $CNF_TAPE_SERVER;
-
-push @EXPORT_OK, qw($CNF_AUTH);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AUTH);
-
-$_confparm_key_VALUES{"CNF_AUTH"} = $CNF_AUTH;
-
-push @EXPORT_OK, qw($CNF_SSH_KEYS);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_SSH_KEYS);
-
-$_confparm_key_VALUES{"CNF_SSH_KEYS"} = $CNF_SSH_KEYS;
-
-push @EXPORT_OK, qw($CNF_AMANDAD_PATH);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMANDAD_PATH);
-
-$_confparm_key_VALUES{"CNF_AMANDAD_PATH"} = $CNF_AMANDAD_PATH;
-
-push @EXPORT_OK, qw($CNF_CLIENT_USERNAME);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CLIENT_USERNAME);
-
-$_confparm_key_VALUES{"CNF_CLIENT_USERNAME"} = $CNF_CLIENT_USERNAME;
-
-push @EXPORT_OK, qw($CNF_CLIENT_PORT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CLIENT_PORT);
-
-$_confparm_key_VALUES{"CNF_CLIENT_PORT"} = $CNF_CLIENT_PORT;
-
-push @EXPORT_OK, qw($CNF_GNUTAR_LIST_DIR);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_GNUTAR_LIST_DIR);
-
-$_confparm_key_VALUES{"CNF_GNUTAR_LIST_DIR"} = $CNF_GNUTAR_LIST_DIR;
-
-push @EXPORT_OK, qw($CNF_AMANDATES);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMANDATES);
-
-$_confparm_key_VALUES{"CNF_AMANDATES"} = $CNF_AMANDATES;
-
-push @EXPORT_OK, qw($CNF_MAILER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_MAILER);
-
-$_confparm_key_VALUES{"CNF_MAILER"} = $CNF_MAILER;
-
-push @EXPORT_OK, qw($CNF_MAILTO);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_MAILTO);
-
-$_confparm_key_VALUES{"CNF_MAILTO"} = $CNF_MAILTO;
-
-push @EXPORT_OK, qw($CNF_DUMPUSER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DUMPUSER);
-
-$_confparm_key_VALUES{"CNF_DUMPUSER"} = $CNF_DUMPUSER;
-
-push @EXPORT_OK, qw($CNF_TAPEDEV);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPEDEV);
-
-$_confparm_key_VALUES{"CNF_TAPEDEV"} = $CNF_TAPEDEV;
-
-push @EXPORT_OK, qw($CNF_DEVICE_PROPERTY);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEVICE_PROPERTY);
-
-$_confparm_key_VALUES{"CNF_DEVICE_PROPERTY"} = $CNF_DEVICE_PROPERTY;
-
-push @EXPORT_OK, qw($CNF_PROPERTY);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_PROPERTY);
-
-$_confparm_key_VALUES{"CNF_PROPERTY"} = $CNF_PROPERTY;
-
-push @EXPORT_OK, qw($CNF_CHANGERDEV);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CHANGERDEV);
-
-$_confparm_key_VALUES{"CNF_CHANGERDEV"} = $CNF_CHANGERDEV;
-
-push @EXPORT_OK, qw($CNF_CHANGERFILE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CHANGERFILE);
-
-$_confparm_key_VALUES{"CNF_CHANGERFILE"} = $CNF_CHANGERFILE;
-
-push @EXPORT_OK, qw($CNF_LABELSTR);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_LABELSTR);
-
-$_confparm_key_VALUES{"CNF_LABELSTR"} = $CNF_LABELSTR;
-
-push @EXPORT_OK, qw($CNF_AUTOLABEL);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AUTOLABEL);
-
-$_confparm_key_VALUES{"CNF_AUTOLABEL"} = $CNF_AUTOLABEL;
-
-push @EXPORT_OK, qw($CNF_TAPELIST);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPELIST);
-
-$_confparm_key_VALUES{"CNF_TAPELIST"} = $CNF_TAPELIST;
-
-push @EXPORT_OK, qw($CNF_DISKFILE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DISKFILE);
-
-$_confparm_key_VALUES{"CNF_DISKFILE"} = $CNF_DISKFILE;
-
-push @EXPORT_OK, qw($CNF_INFOFILE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_INFOFILE);
-
-$_confparm_key_VALUES{"CNF_INFOFILE"} = $CNF_INFOFILE;
-
-push @EXPORT_OK, qw($CNF_LOGDIR);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_LOGDIR);
-
-$_confparm_key_VALUES{"CNF_LOGDIR"} = $CNF_LOGDIR;
-
-push @EXPORT_OK, qw($CNF_INDEXDIR);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_INDEXDIR);
-
-$_confparm_key_VALUES{"CNF_INDEXDIR"} = $CNF_INDEXDIR;
-
-push @EXPORT_OK, qw($CNF_TAPETYPE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPETYPE);
-
-$_confparm_key_VALUES{"CNF_TAPETYPE"} = $CNF_TAPETYPE;
-
-push @EXPORT_OK, qw($CNF_DUMPCYCLE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DUMPCYCLE);
-
-$_confparm_key_VALUES{"CNF_DUMPCYCLE"} = $CNF_DUMPCYCLE;
-
-push @EXPORT_OK, qw($CNF_RUNSPERCYCLE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_RUNSPERCYCLE);
-
-$_confparm_key_VALUES{"CNF_RUNSPERCYCLE"} = $CNF_RUNSPERCYCLE;
-
-push @EXPORT_OK, qw($CNF_TAPECYCLE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPECYCLE);
-
-$_confparm_key_VALUES{"CNF_TAPECYCLE"} = $CNF_TAPECYCLE;
-
-push @EXPORT_OK, qw($CNF_NETUSAGE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_NETUSAGE);
-
-$_confparm_key_VALUES{"CNF_NETUSAGE"} = $CNF_NETUSAGE;
-
-push @EXPORT_OK, qw($CNF_INPARALLEL);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_INPARALLEL);
-
-$_confparm_key_VALUES{"CNF_INPARALLEL"} = $CNF_INPARALLEL;
-
-push @EXPORT_OK, qw($CNF_DUMPORDER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DUMPORDER);
-
-$_confparm_key_VALUES{"CNF_DUMPORDER"} = $CNF_DUMPORDER;
-
-push @EXPORT_OK, qw($CNF_BUMPPERCENT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_BUMPPERCENT);
-
-$_confparm_key_VALUES{"CNF_BUMPPERCENT"} = $CNF_BUMPPERCENT;
-
-push @EXPORT_OK, qw($CNF_BUMPSIZE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_BUMPSIZE);
-
-$_confparm_key_VALUES{"CNF_BUMPSIZE"} = $CNF_BUMPSIZE;
-
-push @EXPORT_OK, qw($CNF_BUMPMULT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_BUMPMULT);
-
-$_confparm_key_VALUES{"CNF_BUMPMULT"} = $CNF_BUMPMULT;
-
-push @EXPORT_OK, qw($CNF_BUMPDAYS);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_BUMPDAYS);
-
-$_confparm_key_VALUES{"CNF_BUMPDAYS"} = $CNF_BUMPDAYS;
-
-push @EXPORT_OK, qw($CNF_TPCHANGER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TPCHANGER);
-
-$_confparm_key_VALUES{"CNF_TPCHANGER"} = $CNF_TPCHANGER;
-
-push @EXPORT_OK, qw($CNF_RUNTAPES);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_RUNTAPES);
-
-$_confparm_key_VALUES{"CNF_RUNTAPES"} = $CNF_RUNTAPES;
-
-push @EXPORT_OK, qw($CNF_MAXDUMPS);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_MAXDUMPS);
-
-$_confparm_key_VALUES{"CNF_MAXDUMPS"} = $CNF_MAXDUMPS;
-
-push @EXPORT_OK, qw($CNF_ETIMEOUT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_ETIMEOUT);
-
-$_confparm_key_VALUES{"CNF_ETIMEOUT"} = $CNF_ETIMEOUT;
-
-push @EXPORT_OK, qw($CNF_DTIMEOUT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DTIMEOUT);
-
-$_confparm_key_VALUES{"CNF_DTIMEOUT"} = $CNF_DTIMEOUT;
-
-push @EXPORT_OK, qw($CNF_CTIMEOUT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CTIMEOUT);
-
-$_confparm_key_VALUES{"CNF_CTIMEOUT"} = $CNF_CTIMEOUT;
-
-push @EXPORT_OK, qw($CNF_TAPEBUFS);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPEBUFS);
-
-$_confparm_key_VALUES{"CNF_TAPEBUFS"} = $CNF_TAPEBUFS;
-
-push @EXPORT_OK, qw($CNF_DEVICE_OUTPUT_BUFFER_SIZE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEVICE_OUTPUT_BUFFER_SIZE);
-
-$_confparm_key_VALUES{"CNF_DEVICE_OUTPUT_BUFFER_SIZE"} = $CNF_DEVICE_OUTPUT_BUFFER_SIZE;
-
-push @EXPORT_OK, qw($CNF_PRINTER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_PRINTER);
-
-$_confparm_key_VALUES{"CNF_PRINTER"} = $CNF_PRINTER;
-
-push @EXPORT_OK, qw($CNF_AUTOFLUSH);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AUTOFLUSH);
-
-$_confparm_key_VALUES{"CNF_AUTOFLUSH"} = $CNF_AUTOFLUSH;
-
-push @EXPORT_OK, qw($CNF_RESERVE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_RESERVE);
-
-$_confparm_key_VALUES{"CNF_RESERVE"} = $CNF_RESERVE;
-
-push @EXPORT_OK, qw($CNF_MAXDUMPSIZE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_MAXDUMPSIZE);
-
-$_confparm_key_VALUES{"CNF_MAXDUMPSIZE"} = $CNF_MAXDUMPSIZE;
-
-push @EXPORT_OK, qw($CNF_COLUMNSPEC);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_COLUMNSPEC);
-
-$_confparm_key_VALUES{"CNF_COLUMNSPEC"} = $CNF_COLUMNSPEC;
-
-push @EXPORT_OK, qw($CNF_AMRECOVER_DO_FSF);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMRECOVER_DO_FSF);
-
-$_confparm_key_VALUES{"CNF_AMRECOVER_DO_FSF"} = $CNF_AMRECOVER_DO_FSF;
-
-push @EXPORT_OK, qw($CNF_AMRECOVER_CHECK_LABEL);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMRECOVER_CHECK_LABEL);
-
-$_confparm_key_VALUES{"CNF_AMRECOVER_CHECK_LABEL"} = $CNF_AMRECOVER_CHECK_LABEL;
-
-push @EXPORT_OK, qw($CNF_AMRECOVER_CHANGER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMRECOVER_CHANGER);
-
-$_confparm_key_VALUES{"CNF_AMRECOVER_CHANGER"} = $CNF_AMRECOVER_CHANGER;
-
-push @EXPORT_OK, qw($CNF_TAPERALGO);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPERALGO);
-
-$_confparm_key_VALUES{"CNF_TAPERALGO"} = $CNF_TAPERALGO;
-
-push @EXPORT_OK, qw($CNF_FLUSH_THRESHOLD_DUMPED);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_FLUSH_THRESHOLD_DUMPED);
-
-$_confparm_key_VALUES{"CNF_FLUSH_THRESHOLD_DUMPED"} = $CNF_FLUSH_THRESHOLD_DUMPED;
-
-push @EXPORT_OK, qw($CNF_FLUSH_THRESHOLD_SCHEDULED);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_FLUSH_THRESHOLD_SCHEDULED);
-
-$_confparm_key_VALUES{"CNF_FLUSH_THRESHOLD_SCHEDULED"} = $CNF_FLUSH_THRESHOLD_SCHEDULED;
-
-push @EXPORT_OK, qw($CNF_TAPERFLUSH);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPERFLUSH);
-
-$_confparm_key_VALUES{"CNF_TAPERFLUSH"} = $CNF_TAPERFLUSH;
-
-push @EXPORT_OK, qw($CNF_DISPLAYUNIT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DISPLAYUNIT);
-
-$_confparm_key_VALUES{"CNF_DISPLAYUNIT"} = $CNF_DISPLAYUNIT;
-
-push @EXPORT_OK, qw($CNF_KRB5KEYTAB);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_KRB5KEYTAB);
-
-$_confparm_key_VALUES{"CNF_KRB5KEYTAB"} = $CNF_KRB5KEYTAB;
-
-push @EXPORT_OK, qw($CNF_KRB5PRINCIPAL);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_KRB5PRINCIPAL);
-
-$_confparm_key_VALUES{"CNF_KRB5PRINCIPAL"} = $CNF_KRB5PRINCIPAL;
-
-push @EXPORT_OK, qw($CNF_LABEL_NEW_TAPES);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_LABEL_NEW_TAPES);
-
-$_confparm_key_VALUES{"CNF_LABEL_NEW_TAPES"} = $CNF_LABEL_NEW_TAPES;
-
-push @EXPORT_OK, qw($CNF_USETIMESTAMPS);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_USETIMESTAMPS);
-
-$_confparm_key_VALUES{"CNF_USETIMESTAMPS"} = $CNF_USETIMESTAMPS;
-
-push @EXPORT_OK, qw($CNF_REP_TRIES);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_REP_TRIES);
-
-$_confparm_key_VALUES{"CNF_REP_TRIES"} = $CNF_REP_TRIES;
-
-push @EXPORT_OK, qw($CNF_CONNECT_TRIES);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CONNECT_TRIES);
-
-$_confparm_key_VALUES{"CNF_CONNECT_TRIES"} = $CNF_CONNECT_TRIES;
-
-push @EXPORT_OK, qw($CNF_REQ_TRIES);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_REQ_TRIES);
-
-$_confparm_key_VALUES{"CNF_REQ_TRIES"} = $CNF_REQ_TRIES;
-
-push @EXPORT_OK, qw($CNF_DEBUG_AMANDAD);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_AMANDAD);
-
-$_confparm_key_VALUES{"CNF_DEBUG_AMANDAD"} = $CNF_DEBUG_AMANDAD;
-
-push @EXPORT_OK, qw($CNF_DEBUG_RECOVERY);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_RECOVERY);
-
-$_confparm_key_VALUES{"CNF_DEBUG_RECOVERY"} = $CNF_DEBUG_RECOVERY;
-
-push @EXPORT_OK, qw($CNF_DEBUG_AMIDXTAPED);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_AMIDXTAPED);
-
-$_confparm_key_VALUES{"CNF_DEBUG_AMIDXTAPED"} = $CNF_DEBUG_AMIDXTAPED;
-
-push @EXPORT_OK, qw($CNF_DEBUG_AMINDEXD);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_AMINDEXD);
-
-$_confparm_key_VALUES{"CNF_DEBUG_AMINDEXD"} = $CNF_DEBUG_AMINDEXD;
-
-push @EXPORT_OK, qw($CNF_DEBUG_AMRECOVER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_AMRECOVER);
-
-$_confparm_key_VALUES{"CNF_DEBUG_AMRECOVER"} = $CNF_DEBUG_AMRECOVER;
-
-push @EXPORT_OK, qw($CNF_DEBUG_AUTH);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_AUTH);
-
-$_confparm_key_VALUES{"CNF_DEBUG_AUTH"} = $CNF_DEBUG_AUTH;
-
-push @EXPORT_OK, qw($CNF_DEBUG_EVENT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_EVENT);
-
-$_confparm_key_VALUES{"CNF_DEBUG_EVENT"} = $CNF_DEBUG_EVENT;
-
-push @EXPORT_OK, qw($CNF_DEBUG_HOLDING);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_HOLDING);
-
-$_confparm_key_VALUES{"CNF_DEBUG_HOLDING"} = $CNF_DEBUG_HOLDING;
-
-push @EXPORT_OK, qw($CNF_DEBUG_PROTOCOL);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_PROTOCOL);
-
-$_confparm_key_VALUES{"CNF_DEBUG_PROTOCOL"} = $CNF_DEBUG_PROTOCOL;
-
-push @EXPORT_OK, qw($CNF_DEBUG_PLANNER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_PLANNER);
-
-$_confparm_key_VALUES{"CNF_DEBUG_PLANNER"} = $CNF_DEBUG_PLANNER;
-
-push @EXPORT_OK, qw($CNF_DEBUG_DRIVER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_DRIVER);
-
-$_confparm_key_VALUES{"CNF_DEBUG_DRIVER"} = $CNF_DEBUG_DRIVER;
-
-push @EXPORT_OK, qw($CNF_DEBUG_DUMPER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_DUMPER);
-
-$_confparm_key_VALUES{"CNF_DEBUG_DUMPER"} = $CNF_DEBUG_DUMPER;
-
-push @EXPORT_OK, qw($CNF_DEBUG_CHUNKER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_CHUNKER);
-
-$_confparm_key_VALUES{"CNF_DEBUG_CHUNKER"} = $CNF_DEBUG_CHUNKER;
-
-push @EXPORT_OK, qw($CNF_DEBUG_TAPER);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_TAPER);
-
-$_confparm_key_VALUES{"CNF_DEBUG_TAPER"} = $CNF_DEBUG_TAPER;
-
-push @EXPORT_OK, qw($CNF_DEBUG_SELFCHECK);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_SELFCHECK);
-
-$_confparm_key_VALUES{"CNF_DEBUG_SELFCHECK"} = $CNF_DEBUG_SELFCHECK;
-
-push @EXPORT_OK, qw($CNF_DEBUG_SENDSIZE);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_SENDSIZE);
-
-$_confparm_key_VALUES{"CNF_DEBUG_SENDSIZE"} = $CNF_DEBUG_SENDSIZE;
-
-push @EXPORT_OK, qw($CNF_DEBUG_SENDBACKUP);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_SENDBACKUP);
-
-$_confparm_key_VALUES{"CNF_DEBUG_SENDBACKUP"} = $CNF_DEBUG_SENDBACKUP;
-
-push @EXPORT_OK, qw($CNF_RESERVED_UDP_PORT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_RESERVED_UDP_PORT);
-
-$_confparm_key_VALUES{"CNF_RESERVED_UDP_PORT"} = $CNF_RESERVED_UDP_PORT;
-
-push @EXPORT_OK, qw($CNF_RESERVED_TCP_PORT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_RESERVED_TCP_PORT);
-
-$_confparm_key_VALUES{"CNF_RESERVED_TCP_PORT"} = $CNF_RESERVED_TCP_PORT;
-
-push @EXPORT_OK, qw($CNF_UNRESERVED_TCP_PORT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_UNRESERVED_TCP_PORT);
-
-$_confparm_key_VALUES{"CNF_UNRESERVED_TCP_PORT"} = $CNF_UNRESERVED_TCP_PORT;
+push @EXPORT_OK, qw( $CNF_ORG $CNF_CONF $CNF_INDEX_SERVER $CNF_TAPE_SERVER $CNF_AUTH $CNF_SSH_KEYS $CNF_AMANDAD_PATH $CNF_CLIENT_USERNAME $CNF_CLIENT_PORT $CNF_GNUTAR_LIST_DIR $CNF_AMANDATES $CNF_MAILER $CNF_MAILTO $CNF_DUMPUSER $CNF_TAPEDEV $CNF_DEVICE_PROPERTY $CNF_PROPERTY $CNF_CHANGERDEV $CNF_CHANGERFILE $CNF_LABELSTR $CNF_AUTOLABEL $CNF_TAPELIST $CNF_DISKFILE $CNF_INFOFILE $CNF_LOGDIR $CNF_INDEXDIR $CNF_TAPETYPE $CNF_DUMPCYCLE $CNF_RUNSPERCYCLE $CNF_TAPECYCLE $CNF_NETUSAGE $CNF_INPARALLEL $CNF_DUMPORDER $CNF_BUMPPERCENT $CNF_BUMPSIZE $CNF_BUMPMULT $CNF_BUMPDAYS $CNF_TPCHANGER $CNF_RUNTAPES $CNF_MAXDUMPS $CNF_ETIMEOUT $CNF_DTIMEOUT $CNF_CTIMEOUT $CNF_DEVICE_OUTPUT_BUFFER_SIZE $CNF_PRINTER $CNF_AUTOFLUSH $CNF_RESERVE $CNF_MAXDUMPSIZE $CNF_COLUMNSPEC $CNF_AMRECOVER_DO_FSF $CNF_AMRECOVER_CHECK_LABEL $CNF_AMRECOVER_CHANGER $CNF_TAPERALGO $CNF_FLUSH_THRESHOLD_DUMPED $CNF_FLUSH_THRESHOLD_SCHEDULED $CNF_TAPERFLUSH $CNF_DISPLAYUNIT $CNF_KRB5KEYTAB $CNF_KRB5PRINCIPAL $CNF_LABEL_NEW_TAPES $CNF_USETIMESTAMPS $CNF_REP_TRIES $CNF_CONNECT_TRIES $CNF_REQ_TRIES $CNF_DEBUG_AMANDAD $CNF_DEBUG_RECOVERY $CNF_DEBUG_AMIDXTAPED $CNF_DEBUG_AMINDEXD $CNF_DEBUG_AMRECOVER $CNF_DEBUG_AUTH $CNF_DEBUG_EVENT $CNF_DEBUG_HOLDING $CNF_DEBUG_PROTOCOL $CNF_DEBUG_PLANNER $CNF_DEBUG_DRIVER $CNF_DEBUG_DUMPER $CNF_DEBUG_CHUNKER $CNF_DEBUG_TAPER $CNF_DEBUG_SELFCHECK $CNF_DEBUG_SENDSIZE $CNF_DEBUG_SENDBACKUP $CNF_RESERVED_UDP_PORT $CNF_RESERVED_TCP_PORT $CNF_UNRESERVED_TCP_PORT $CNF_HOLDINGDISK $CNF_SEND_AMREPORT_ON $CNF_TAPER_PARALLEL_WRITE $CNF_RECOVERY_LIMIT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw( $CNF_ORG $CNF_CONF $CNF_INDEX_SERVER $CNF_TAPE_SERVER $CNF_AUTH $CNF_SSH_KEYS $CNF_AMANDAD_PATH $CNF_CLIENT_USERNAME $CNF_CLIENT_PORT $CNF_GNUTAR_LIST_DIR $CNF_AMANDATES $CNF_MAILER $CNF_MAILTO $CNF_DUMPUSER $CNF_TAPEDEV $CNF_DEVICE_PROPERTY $CNF_PROPERTY $CNF_CHANGERDEV $CNF_CHANGERFILE $CNF_LABELSTR $CNF_AUTOLABEL $CNF_TAPELIST $CNF_DISKFILE $CNF_INFOFILE $CNF_LOGDIR $CNF_INDEXDIR $CNF_TAPETYPE $CNF_DUMPCYCLE $CNF_RUNSPERCYCLE $CNF_TAPECYCLE $CNF_NETUSAGE $CNF_INPARALLEL $CNF_DUMPORDER $CNF_BUMPPERCENT $CNF_BUMPSIZE $CNF_BUMPMULT $CNF_BUMPDAYS $CNF_TPCHANGER $CNF_RUNTAPES $CNF_MAXDUMPS $CNF_ETIMEOUT $CNF_DTIMEOUT $CNF_CTIMEOUT $CNF_DEVICE_OUTPUT_BUFFER_SIZE $CNF_PRINTER $CNF_AUTOFLUSH $CNF_RESERVE $CNF_MAXDUMPSIZE $CNF_COLUMNSPEC $CNF_AMRECOVER_DO_FSF $CNF_AMRECOVER_CHECK_LABEL $CNF_AMRECOVER_CHANGER $CNF_TAPERALGO $CNF_FLUSH_THRESHOLD_DUMPED $CNF_FLUSH_THRESHOLD_SCHEDULED $CNF_TAPERFLUSH $CNF_DISPLAYUNIT $CNF_KRB5KEYTAB $CNF_KRB5PRINCIPAL $CNF_LABEL_NEW_TAPES $CNF_USETIMESTAMPS $CNF_REP_TRIES $CNF_CONNECT_TRIES $CNF_REQ_TRIES $CNF_DEBUG_AMANDAD $CNF_DEBUG_RECOVERY $CNF_DEBUG_AMIDXTAPED $CNF_DEBUG_AMINDEXD $CNF_DEBUG_AMRECOVER $CNF_DEBUG_AUTH $CNF_DEBUG_EVENT $CNF_DEBUG_HOLDING $CNF_DEBUG_PROTOCOL $CNF_DEBUG_PLANNER $CNF_DEBUG_DRIVER $CNF_DEBUG_DUMPER $CNF_DEBUG_CHUNKER $CNF_DEBUG_TAPER $CNF_DEBUG_SELFCHECK $CNF_DEBUG_SENDSIZE $CNF_DEBUG_SENDBACKUP $CNF_RESERVED_UDP_PORT $CNF_RESERVED_TCP_PORT $CNF_UNRESERVED_TCP_PORT $CNF_HOLDINGDISK $CNF_SEND_AMREPORT_ON $CNF_TAPER_PARALLEL_WRITE $CNF_RECOVERY_LIMIT);
+      foreach (qw(  CNF_ORG CNF_CONF CNF_INDEX_SERVER CNF_TAPE_SERVER CNF_AUTH CNF_SSH_KEYS CNF_AMANDAD_PATH CNF_CLIENT_USERNAME CNF_CLIENT_PORT CNF_GNUTAR_LIST_DIR CNF_AMANDATES CNF_MAILER CNF_MAILTO CNF_DUMPUSER CNF_TAPEDEV CNF_DEVICE_PROPERTY CNF_PROPERTY CNF_CHANGERDEV CNF_CHANGERFILE CNF_LABELSTR CNF_AUTOLABEL CNF_TAPELIST CNF_DISKFILE CNF_INFOFILE CNF_LOGDIR CNF_INDEXDIR CNF_TAPETYPE CNF_DUMPCYCLE CNF_RUNSPERCYCLE CNF_TAPECYCLE CNF_NETUSAGE CNF_INPARALLEL CNF_DUMPORDER CNF_BUMPPERCENT CNF_BUMPSIZE CNF_BUMPMULT CNF_BUMPDAYS CNF_TPCHANGER CNF_RUNTAPES CNF_MAXDUMPS CNF_ETIMEOUT CNF_DTIMEOUT CNF_CTIMEOUT CNF_DEVICE_OUTPUT_BUFFER_SIZE CNF_PRINTER CNF_AUTOFLUSH CNF_RESERVE CNF_MAXDUMPSIZE CNF_COLUMNSPEC CNF_AMRECOVER_DO_FSF CNF_AMRECOVER_CHECK_LABEL CNF_AMRECOVER_CHANGER CNF_TAPERALGO CNF_FLUSH_THRESHOLD_DUMPED CNF_FLUSH_THRESHOLD_SCHEDULED CNF_TAPERFLUSH CNF_DISPLAYUNIT CNF_KRB5KEYTAB CNF_KRB5PRINCIPAL CNF_LABEL_NEW_TAPES CNF_USETIMESTAMPS CNF_REP_TRIES CNF_CONNECT_TRIES CNF_REQ_TRIES CNF_DEBUG_AMANDAD CNF_DEBUG_RECOVERY CNF_DEBUG_AMIDXTAPED CNF_DEBUG_AMINDEXD CNF_DEBUG_AMRECOVER CNF_DEBUG_AUTH CNF_DEBUG_EVENT CNF_DEBUG_HOLDING CNF_DEBUG_PROTOCOL CNF_DEBUG_PLANNER CNF_DEBUG_DRIVER CNF_DEBUG_DUMPER CNF_DEBUG_CHUNKER CNF_DEBUG_TAPER CNF_DEBUG_SELFCHECK CNF_DEBUG_SENDSIZE CNF_DEBUG_SENDBACKUP CNF_RESERVED_UDP_PORT CNF_RESERVED_TCP_PORT CNF_UNRESERVED_TCP_PORT CNF_HOLDINGDISK CNF_SEND_AMREPORT_ON CNF_TAPER_PARALLEL_WRITE CNF_RECOVERY_LIMIT)) {       $_confparm_key_VALUES{$_} = $$_;      }  
+#copy symbols in confparm_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"confparm_key"}};
 
-push @EXPORT_OK, qw($CNF_HOLDINGDISK);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_HOLDINGDISK);
 
-$_confparm_key_VALUES{"CNF_HOLDINGDISK"} = $CNF_HOLDINGDISK;
+use Amanda::Config::FoldingHash;
 
-push @EXPORT_OK, qw($CNF_SEND_AMREPORT_ON);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_SEND_AMREPORT_ON);
+=pod
 
-$_confparm_key_VALUES{"CNF_SEND_AMREPORT_ON"} = $CNF_SEND_AMREPORT_ON;
+Global Parameters:       C<$CNF_ORG> C<$CNF_CONF> C<$CNF_INDEX_SERVER> C<$CNF_TAPE_SERVER> C<$CNF_AUTH> C<$CNF_SSH_KEYS> C<$CNF_AMANDAD_PATH> C<$CNF_CLIENT_USERNAME> C<$CNF_CLIENT_PORT> C<$CNF_GNUTAR_LIST_DIR> C<$CNF_AMANDATES> C<$CNF_MAILER> C<$CNF_MAILTO> C<$CNF_DUMPUSER> C<$CNF_TAPEDEV> C<$CNF_DEVICE_PROPERTY> C<$CNF_PROPERTY> C<$CNF_CHANGERDEV> C<$CNF_CHANGERFILE> C<$CNF_LABELSTR> C<$CNF_AUTOLABEL> C<$CNF_TAPELIST> C<$CNF_DISKFILE> C<$CNF_INFOFILE> C<$CNF_LOGDIR> C<$CNF_INDEXDIR> C<$CNF_TAPETYPE> C<$CNF_DUMPCYCLE> C<$CNF_RUNSPERCYCLE> C<$CNF_TAPECYCLE> C<$CNF_NETUSAGE> C<$CNF_INPARALLEL> C<$CNF_DUMPORDER> C<$CNF_BUMPPERCENT> C<$CNF_BUMPSIZE> C<$CNF_BUMPMULT> C<$CNF_BUMPDAYS> C<$CNF_TPCHANGER> C<$CNF_RUNTAPES> C<$CNF_MAXDUMPS> C<$CNF_ETIMEOUT> C<$CNF_DTIMEOUT> C<$CNF_CTIMEOUT> C<$CNF_DEVICE_OUTPUT_BUFFER_SIZE> C<$CNF_PRINTER> C<$CNF_AUTOFLUSH> C<$CNF_RESERVE> C<$CNF_MAXDUMPSIZE> C<$CNF_COLUMNSPEC> C<$CNF_AMRECOVER_DO_FSF> C<$CNF_AMRECOVER_CHECK_LABEL> C<$CNF_AMRECOVER_CHANGER> C<$CNF_TAPERALGO> C<$CNF_FLUSH_THRESHOLD_DUMPED> C<$CNF_FLUSH_THRESHOLD_SCHEDULED> C<$CNF_TAPERFLUSH> C<$CNF_DISPLAYUNIT> C<$CNF_KRB5KEYTAB> C<$CNF_KRB5PRINCIPAL> C<$CNF_LABEL_NEW_TAPES> C<$CNF_USETIMESTAMPS> C<$CNF_REP_TRIES> C<$CNF_CONNECT_TRIES> C<$CNF_REQ_TRIES> C<$CNF_DEBUG_AMANDAD> C<$CNF_DEBUG_RECOVERY> C<$CNF_DEBUG_AMIDXTAPED> C<$CNF_DEBUG_AMINDEXD> C<$CNF_DEBUG_AMRECOVER> C<$CNF_DEBUG_AUTH> C<$CNF_DEBUG_EVENT> C<$CNF_DEBUG_HOLDING> C<$CNF_DEBUG_PROTOCOL> C<$CNF_DEBUG_PLANNER> C<$CNF_DEBUG_DRIVER> C<$CNF_DEBUG_DUMPER> C<$CNF_DEBUG_CHUNKER> C<$CNF_DEBUG_TAPER> C<$CNF_DEBUG_SELFCHECK> C<$CNF_DEBUG_SENDSIZE> C<$CNF_DEBUG_SENDBACKUP> C<$CNF_RESERVED_UDP_PORT> C<$CNF_RESERVED_TCP_PORT> C<$CNF_UNRESERVED_TCP_PORT> C<$CNF_HOLDINGDISK> C<$CNF_SEND_AMREPORT_ON> C<$CNF_TAPER_PARALLEL_WRITE> C<$CNF_RECOVERY_LIMIT>
 
-#copy symbols in confparm_key to getconf
-push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"confparm_key"}};
+=cut
 
 push @EXPORT_OK, qw(tapetype_key_to_string);
 push @{$EXPORT_TAGS{"tapetype_key"}}, qw(tapetype_key_to_string);
@@ -1148,48 +744,20 @@ sub tapetype_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw($TAPETYPE_COMMENT);
-push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_COMMENT);
-
-$_tapetype_key_VALUES{"TAPETYPE_COMMENT"} = $TAPETYPE_COMMENT;
-
-push @EXPORT_OK, qw($TAPETYPE_LBL_TEMPL);
-push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_LBL_TEMPL);
-
-$_tapetype_key_VALUES{"TAPETYPE_LBL_TEMPL"} = $TAPETYPE_LBL_TEMPL;
-
-push @EXPORT_OK, qw($TAPETYPE_BLOCKSIZE);
-push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_BLOCKSIZE);
-
-$_tapetype_key_VALUES{"TAPETYPE_BLOCKSIZE"} = $TAPETYPE_BLOCKSIZE;
-
-push @EXPORT_OK, qw($TAPETYPE_READBLOCKSIZE);
-push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_READBLOCKSIZE);
-
-$_tapetype_key_VALUES{"TAPETYPE_READBLOCKSIZE"} = $TAPETYPE_READBLOCKSIZE;
-
-push @EXPORT_OK, qw($TAPETYPE_LENGTH);
-push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_LENGTH);
-
-$_tapetype_key_VALUES{"TAPETYPE_LENGTH"} = $TAPETYPE_LENGTH;
-
-push @EXPORT_OK, qw($TAPETYPE_FILEMARK);
-push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_FILEMARK);
-
-$_tapetype_key_VALUES{"TAPETYPE_FILEMARK"} = $TAPETYPE_FILEMARK;
+push @EXPORT_OK, qw( $TAPETYPE_COMMENT $TAPETYPE_LBL_TEMPL $TAPETYPE_BLOCKSIZE $TAPETYPE_READBLOCKSIZE $TAPETYPE_LENGTH $TAPETYPE_FILEMARK $TAPETYPE_SPEED $TAPETYPE_PART_SIZE $TAPETYPE_PART_CACHE_TYPE $TAPETYPE_PART_CACHE_DIR $TAPETYPE_PART_CACHE_MAX_SIZE);
+push @{$EXPORT_TAGS{"tapetype_key"}}, qw( $TAPETYPE_COMMENT $TAPETYPE_LBL_TEMPL $TAPETYPE_BLOCKSIZE $TAPETYPE_READBLOCKSIZE $TAPETYPE_LENGTH $TAPETYPE_FILEMARK $TAPETYPE_SPEED $TAPETYPE_PART_SIZE $TAPETYPE_PART_CACHE_TYPE $TAPETYPE_PART_CACHE_DIR $TAPETYPE_PART_CACHE_MAX_SIZE);
+      foreach (qw(  TAPETYPE_COMMENT TAPETYPE_LBL_TEMPL TAPETYPE_BLOCKSIZE TAPETYPE_READBLOCKSIZE TAPETYPE_LENGTH TAPETYPE_FILEMARK TAPETYPE_SPEED TAPETYPE_PART_SIZE TAPETYPE_PART_CACHE_TYPE TAPETYPE_PART_CACHE_DIR TAPETYPE_PART_CACHE_MAX_SIZE)) {        $_tapetype_key_VALUES{$_} = $$_;      }  
+#copy symbols in tapetype_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"tapetype_key"}};
 
-push @EXPORT_OK, qw($TAPETYPE_SPEED);
-push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_SPEED);
 
-$_tapetype_key_VALUES{"TAPETYPE_SPEED"} = $TAPETYPE_SPEED;
+use Amanda::Config::FoldingHash;
 
-push @EXPORT_OK, qw($TAPETYPE_FILE_PAD);
-push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_FILE_PAD);
+=pod
 
-$_tapetype_key_VALUES{"TAPETYPE_FILE_PAD"} = $TAPETYPE_FILE_PAD;
+Tapetype Parameters:       C<$TAPETYPE_COMMENT> C<$TAPETYPE_LBL_TEMPL> C<$TAPETYPE_BLOCKSIZE> C<$TAPETYPE_READBLOCKSIZE> C<$TAPETYPE_LENGTH> C<$TAPETYPE_FILEMARK> C<$TAPETYPE_SPEED> C<$TAPETYPE_PART_SIZE> C<$TAPETYPE_PART_CACHE_TYPE> C<$TAPETYPE_PART_CACHE_DIR> C<$TAPETYPE_PART_CACHE_MAX_SIZE>
 
-#copy symbols in tapetype_key to getconf
-push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"tapetype_key"}};
+=cut
 
 push @EXPORT_OK, qw(dumptype_key_to_string);
 push @{$EXPORT_TAGS{"dumptype_key"}}, qw(dumptype_key_to_string);
@@ -1212,223 +780,20 @@ sub dumptype_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw($DUMPTYPE_COMMENT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_COMMENT);
-
-$_dumptype_key_VALUES{"DUMPTYPE_COMMENT"} = $DUMPTYPE_COMMENT;
-
-push @EXPORT_OK, qw($DUMPTYPE_PROGRAM);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_PROGRAM);
-
-$_dumptype_key_VALUES{"DUMPTYPE_PROGRAM"} = $DUMPTYPE_PROGRAM;
-
-push @EXPORT_OK, qw($DUMPTYPE_SRVCOMPPROG);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SRVCOMPPROG);
-
-$_dumptype_key_VALUES{"DUMPTYPE_SRVCOMPPROG"} = $DUMPTYPE_SRVCOMPPROG;
-
-push @EXPORT_OK, qw($DUMPTYPE_CLNTCOMPPROG);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_CLNTCOMPPROG);
-
-$_dumptype_key_VALUES{"DUMPTYPE_CLNTCOMPPROG"} = $DUMPTYPE_CLNTCOMPPROG;
-
-push @EXPORT_OK, qw($DUMPTYPE_SRV_ENCRYPT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SRV_ENCRYPT);
-
-$_dumptype_key_VALUES{"DUMPTYPE_SRV_ENCRYPT"} = $DUMPTYPE_SRV_ENCRYPT;
-
-push @EXPORT_OK, qw($DUMPTYPE_CLNT_ENCRYPT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_CLNT_ENCRYPT);
-
-$_dumptype_key_VALUES{"DUMPTYPE_CLNT_ENCRYPT"} = $DUMPTYPE_CLNT_ENCRYPT;
-
-push @EXPORT_OK, qw($DUMPTYPE_AMANDAD_PATH);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_AMANDAD_PATH);
-
-$_dumptype_key_VALUES{"DUMPTYPE_AMANDAD_PATH"} = $DUMPTYPE_AMANDAD_PATH;
-
-push @EXPORT_OK, qw($DUMPTYPE_CLIENT_USERNAME);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_CLIENT_USERNAME);
-
-$_dumptype_key_VALUES{"DUMPTYPE_CLIENT_USERNAME"} = $DUMPTYPE_CLIENT_USERNAME;
-
-push @EXPORT_OK, qw($DUMPTYPE_CLIENT_PORT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_CLIENT_PORT);
-
-$_dumptype_key_VALUES{"DUMPTYPE_CLIENT_PORT"} = $DUMPTYPE_CLIENT_PORT;
-
-push @EXPORT_OK, qw($DUMPTYPE_SSH_KEYS);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SSH_KEYS);
-
-$_dumptype_key_VALUES{"DUMPTYPE_SSH_KEYS"} = $DUMPTYPE_SSH_KEYS;
-
-push @EXPORT_OK, qw($DUMPTYPE_AUTH);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_AUTH);
-
-$_dumptype_key_VALUES{"DUMPTYPE_AUTH"} = $DUMPTYPE_AUTH;
-
-push @EXPORT_OK, qw($DUMPTYPE_EXCLUDE);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_EXCLUDE);
-
-$_dumptype_key_VALUES{"DUMPTYPE_EXCLUDE"} = $DUMPTYPE_EXCLUDE;
-
-push @EXPORT_OK, qw($DUMPTYPE_INCLUDE);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_INCLUDE);
-
-$_dumptype_key_VALUES{"DUMPTYPE_INCLUDE"} = $DUMPTYPE_INCLUDE;
-
-push @EXPORT_OK, qw($DUMPTYPE_PRIORITY);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_PRIORITY);
-
-$_dumptype_key_VALUES{"DUMPTYPE_PRIORITY"} = $DUMPTYPE_PRIORITY;
-
-push @EXPORT_OK, qw($DUMPTYPE_DUMPCYCLE);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_DUMPCYCLE);
-
-$_dumptype_key_VALUES{"DUMPTYPE_DUMPCYCLE"} = $DUMPTYPE_DUMPCYCLE;
-
-push @EXPORT_OK, qw($DUMPTYPE_MAXDUMPS);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_MAXDUMPS);
-
-$_dumptype_key_VALUES{"DUMPTYPE_MAXDUMPS"} = $DUMPTYPE_MAXDUMPS;
-
-push @EXPORT_OK, qw($DUMPTYPE_MAXPROMOTEDAY);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_MAXPROMOTEDAY);
-
-$_dumptype_key_VALUES{"DUMPTYPE_MAXPROMOTEDAY"} = $DUMPTYPE_MAXPROMOTEDAY;
-
-push @EXPORT_OK, qw($DUMPTYPE_BUMPPERCENT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_BUMPPERCENT);
-
-$_dumptype_key_VALUES{"DUMPTYPE_BUMPPERCENT"} = $DUMPTYPE_BUMPPERCENT;
-
-push @EXPORT_OK, qw($DUMPTYPE_BUMPSIZE);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_BUMPSIZE);
-
-$_dumptype_key_VALUES{"DUMPTYPE_BUMPSIZE"} = $DUMPTYPE_BUMPSIZE;
-
-push @EXPORT_OK, qw($DUMPTYPE_BUMPDAYS);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_BUMPDAYS);
-
-$_dumptype_key_VALUES{"DUMPTYPE_BUMPDAYS"} = $DUMPTYPE_BUMPDAYS;
-
-push @EXPORT_OK, qw($DUMPTYPE_BUMPMULT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_BUMPMULT);
-
-$_dumptype_key_VALUES{"DUMPTYPE_BUMPMULT"} = $DUMPTYPE_BUMPMULT;
-
-push @EXPORT_OK, qw($DUMPTYPE_STARTTIME);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_STARTTIME);
-
-$_dumptype_key_VALUES{"DUMPTYPE_STARTTIME"} = $DUMPTYPE_STARTTIME;
-
-push @EXPORT_OK, qw($DUMPTYPE_STRATEGY);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_STRATEGY);
-
-$_dumptype_key_VALUES{"DUMPTYPE_STRATEGY"} = $DUMPTYPE_STRATEGY;
-
-push @EXPORT_OK, qw($DUMPTYPE_ESTIMATELIST);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_ESTIMATELIST);
-
-$_dumptype_key_VALUES{"DUMPTYPE_ESTIMATELIST"} = $DUMPTYPE_ESTIMATELIST;
-
-push @EXPORT_OK, qw($DUMPTYPE_COMPRESS);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_COMPRESS);
-
-$_dumptype_key_VALUES{"DUMPTYPE_COMPRESS"} = $DUMPTYPE_COMPRESS;
-
-push @EXPORT_OK, qw($DUMPTYPE_ENCRYPT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_ENCRYPT);
-
-$_dumptype_key_VALUES{"DUMPTYPE_ENCRYPT"} = $DUMPTYPE_ENCRYPT;
-
-push @EXPORT_OK, qw($DUMPTYPE_SRV_DECRYPT_OPT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SRV_DECRYPT_OPT);
-
-$_dumptype_key_VALUES{"DUMPTYPE_SRV_DECRYPT_OPT"} = $DUMPTYPE_SRV_DECRYPT_OPT;
-
-push @EXPORT_OK, qw($DUMPTYPE_CLNT_DECRYPT_OPT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_CLNT_DECRYPT_OPT);
-
-$_dumptype_key_VALUES{"DUMPTYPE_CLNT_DECRYPT_OPT"} = $DUMPTYPE_CLNT_DECRYPT_OPT;
-
-push @EXPORT_OK, qw($DUMPTYPE_COMPRATE);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_COMPRATE);
-
-$_dumptype_key_VALUES{"DUMPTYPE_COMPRATE"} = $DUMPTYPE_COMPRATE;
-
-push @EXPORT_OK, qw($DUMPTYPE_TAPE_SPLITSIZE);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_TAPE_SPLITSIZE);
-
-$_dumptype_key_VALUES{"DUMPTYPE_TAPE_SPLITSIZE"} = $DUMPTYPE_TAPE_SPLITSIZE;
-
-push @EXPORT_OK, qw($DUMPTYPE_FALLBACK_SPLITSIZE);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_FALLBACK_SPLITSIZE);
-
-$_dumptype_key_VALUES{"DUMPTYPE_FALLBACK_SPLITSIZE"} = $DUMPTYPE_FALLBACK_SPLITSIZE;
-
-push @EXPORT_OK, qw($DUMPTYPE_SPLIT_DISKBUFFER);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SPLIT_DISKBUFFER);
-
-$_dumptype_key_VALUES{"DUMPTYPE_SPLIT_DISKBUFFER"} = $DUMPTYPE_SPLIT_DISKBUFFER;
-
-push @EXPORT_OK, qw($DUMPTYPE_RECORD);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_RECORD);
-
-$_dumptype_key_VALUES{"DUMPTYPE_RECORD"} = $DUMPTYPE_RECORD;
-
-push @EXPORT_OK, qw($DUMPTYPE_SKIP_INCR);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SKIP_INCR);
-
-$_dumptype_key_VALUES{"DUMPTYPE_SKIP_INCR"} = $DUMPTYPE_SKIP_INCR;
-
-push @EXPORT_OK, qw($DUMPTYPE_SKIP_FULL);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SKIP_FULL);
-
-$_dumptype_key_VALUES{"DUMPTYPE_SKIP_FULL"} = $DUMPTYPE_SKIP_FULL;
-
-push @EXPORT_OK, qw($DUMPTYPE_HOLDINGDISK);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_HOLDINGDISK);
-
-$_dumptype_key_VALUES{"DUMPTYPE_HOLDINGDISK"} = $DUMPTYPE_HOLDINGDISK;
-
-push @EXPORT_OK, qw($DUMPTYPE_KENCRYPT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_KENCRYPT);
-
-$_dumptype_key_VALUES{"DUMPTYPE_KENCRYPT"} = $DUMPTYPE_KENCRYPT;
-
-push @EXPORT_OK, qw($DUMPTYPE_IGNORE);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_IGNORE);
-
-$_dumptype_key_VALUES{"DUMPTYPE_IGNORE"} = $DUMPTYPE_IGNORE;
-
-push @EXPORT_OK, qw($DUMPTYPE_INDEX);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_INDEX);
-
-$_dumptype_key_VALUES{"DUMPTYPE_INDEX"} = $DUMPTYPE_INDEX;
-
-push @EXPORT_OK, qw($DUMPTYPE_APPLICATION);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_APPLICATION);
-
-$_dumptype_key_VALUES{"DUMPTYPE_APPLICATION"} = $DUMPTYPE_APPLICATION;
-
-push @EXPORT_OK, qw($DUMPTYPE_SCRIPTLIST);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SCRIPTLIST);
-
-$_dumptype_key_VALUES{"DUMPTYPE_SCRIPTLIST"} = $DUMPTYPE_SCRIPTLIST;
+push @EXPORT_OK, qw( $DUMPTYPE_COMMENT $DUMPTYPE_PROGRAM $DUMPTYPE_SRVCOMPPROG $DUMPTYPE_CLNTCOMPPROG $DUMPTYPE_SRV_ENCRYPT $DUMPTYPE_CLNT_ENCRYPT $DUMPTYPE_AMANDAD_PATH $DUMPTYPE_CLIENT_USERNAME $DUMPTYPE_CLIENT_PORT $DUMPTYPE_SSH_KEYS $DUMPTYPE_AUTH $DUMPTYPE_EXCLUDE $DUMPTYPE_INCLUDE $DUMPTYPE_PRIORITY $DUMPTYPE_DUMPCYCLE $DUMPTYPE_MAXDUMPS $DUMPTYPE_MAXPROMOTEDAY $DUMPTYPE_BUMPPERCENT $DUMPTYPE_BUMPSIZE $DUMPTYPE_BUMPDAYS $DUMPTYPE_BUMPMULT $DUMPTYPE_STARTTIME $DUMPTYPE_STRATEGY $DUMPTYPE_ESTIMATELIST $DUMPTYPE_COMPRESS $DUMPTYPE_ENCRYPT $DUMPTYPE_SRV_DECRYPT_OPT $DUMPTYPE_CLNT_DECRYPT_OPT $DUMPTYPE_COMPRATE $DUMPTYPE_TAPE_SPLITSIZE $DUMPTYPE_FALLBACK_SPLITSIZE $DUMPTYPE_SPLIT_DISKBUFFER $DUMPTYPE_RECORD $DUMPTYPE_SKIP_INCR $DUMPTYPE_SKIP_FULL $DUMPTYPE_HOLDINGDISK $DUMPTYPE_KENCRYPT $DUMPTYPE_IGNORE $DUMPTYPE_INDEX $DUMPTYPE_APPLICATION $DUMPTYPE_SCRIPTLIST $DUMPTYPE_PROPERTY $DUMPTYPE_DATA_PATH $DUMPTYPE_ALLOW_SPLIT $DUMPTYPE_RECOVERY_LIMIT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw( $DUMPTYPE_COMMENT $DUMPTYPE_PROGRAM $DUMPTYPE_SRVCOMPPROG $DUMPTYPE_CLNTCOMPPROG $DUMPTYPE_SRV_ENCRYPT $DUMPTYPE_CLNT_ENCRYPT $DUMPTYPE_AMANDAD_PATH $DUMPTYPE_CLIENT_USERNAME $DUMPTYPE_CLIENT_PORT $DUMPTYPE_SSH_KEYS $DUMPTYPE_AUTH $DUMPTYPE_EXCLUDE $DUMPTYPE_INCLUDE $DUMPTYPE_PRIORITY $DUMPTYPE_DUMPCYCLE $DUMPTYPE_MAXDUMPS $DUMPTYPE_MAXPROMOTEDAY $DUMPTYPE_BUMPPERCENT $DUMPTYPE_BUMPSIZE $DUMPTYPE_BUMPDAYS $DUMPTYPE_BUMPMULT $DUMPTYPE_STARTTIME $DUMPTYPE_STRATEGY $DUMPTYPE_ESTIMATELIST $DUMPTYPE_COMPRESS $DUMPTYPE_ENCRYPT $DUMPTYPE_SRV_DECRYPT_OPT $DUMPTYPE_CLNT_DECRYPT_OPT $DUMPTYPE_COMPRATE $DUMPTYPE_TAPE_SPLITSIZE $DUMPTYPE_FALLBACK_SPLITSIZE $DUMPTYPE_SPLIT_DISKBUFFER $DUMPTYPE_RECORD $DUMPTYPE_SKIP_INCR $DUMPTYPE_SKIP_FULL $DUMPTYPE_HOLDINGDISK $DUMPTYPE_KENCRYPT $DUMPTYPE_IGNORE $DUMPTYPE_INDEX $DUMPTYPE_APPLICATION $DUMPTYPE_SCRIPTLIST $DUMPTYPE_PROPERTY $DUMPTYPE_DATA_PATH $DUMPTYPE_ALLOW_SPLIT $DUMPTYPE_RECOVERY_LIMIT);
+      foreach (qw(  DUMPTYPE_COMMENT DUMPTYPE_PROGRAM DUMPTYPE_SRVCOMPPROG DUMPTYPE_CLNTCOMPPROG DUMPTYPE_SRV_ENCRYPT DUMPTYPE_CLNT_ENCRYPT DUMPTYPE_AMANDAD_PATH DUMPTYPE_CLIENT_USERNAME DUMPTYPE_CLIENT_PORT DUMPTYPE_SSH_KEYS DUMPTYPE_AUTH DUMPTYPE_EXCLUDE DUMPTYPE_INCLUDE DUMPTYPE_PRIORITY DUMPTYPE_DUMPCYCLE DUMPTYPE_MAXDUMPS DUMPTYPE_MAXPROMOTEDAY DUMPTYPE_BUMPPERCENT DUMPTYPE_BUMPSIZE DUMPTYPE_BUMPDAYS DUMPTYPE_BUMPMULT DUMPTYPE_STARTTIME DUMPTYPE_STRATEGY DUMPTYPE_ESTIMATELIST DUMPTYPE_COMPRESS DUMPTYPE_ENCRYPT DUMPTYPE_SRV_DECRYPT_OPT DUMPTYPE_CLNT_DECRYPT_OPT DUMPTYPE_COMPRATE DUMPTYPE_TAPE_SPLITSIZE DUMPTYPE_FALLBACK_SPLITSIZE DUMPTYPE_SPLIT_DISKBUFFER DUMPTYPE_RECORD DUMPTYPE_SKIP_INCR DUMPTYPE_SKIP_FULL DUMPTYPE_HOLDINGDISK DUMPTYPE_KENCRYPT DUMPTYPE_IGNORE DUMPTYPE_INDEX DUMPTYPE_APPLICATION DUMPTYPE_SCRIPTLIST DUMPTYPE_PROPERTY DUMPTYPE_DATA_PATH DUMPTYPE_ALLOW_SPLIT DUMPTYPE_RECOVERY_LIMIT)) {         $_dumptype_key_VALUES{$_} = $$_;      }  
+#copy symbols in dumptype_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"dumptype_key"}};
 
-push @EXPORT_OK, qw($DUMPTYPE_PROPERTY);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_PROPERTY);
 
-$_dumptype_key_VALUES{"DUMPTYPE_PROPERTY"} = $DUMPTYPE_PROPERTY;
+use Amanda::Config::FoldingHash;
 
-push @EXPORT_OK, qw($DUMPTYPE_DATA_PATH);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_DATA_PATH);
+=pod
 
-$_dumptype_key_VALUES{"DUMPTYPE_DATA_PATH"} = $DUMPTYPE_DATA_PATH;
+Dumptype Parameters:       C<$DUMPTYPE_COMMENT> C<$DUMPTYPE_PROGRAM> C<$DUMPTYPE_SRVCOMPPROG> C<$DUMPTYPE_CLNTCOMPPROG> C<$DUMPTYPE_SRV_ENCRYPT> C<$DUMPTYPE_CLNT_ENCRYPT> C<$DUMPTYPE_AMANDAD_PATH> C<$DUMPTYPE_CLIENT_USERNAME> C<$DUMPTYPE_CLIENT_PORT> C<$DUMPTYPE_SSH_KEYS> C<$DUMPTYPE_AUTH> C<$DUMPTYPE_EXCLUDE> C<$DUMPTYPE_INCLUDE> C<$DUMPTYPE_PRIORITY> C<$DUMPTYPE_DUMPCYCLE> C<$DUMPTYPE_MAXDUMPS> C<$DUMPTYPE_MAXPROMOTEDAY> C<$DUMPTYPE_BUMPPERCENT> C<$DUMPTYPE_BUMPSIZE> C<$DUMPTYPE_BUMPDAYS> C<$DUMPTYPE_BUMPMULT> C<$DUMPTYPE_STARTTIME> C<$DUMPTYPE_STRATEGY> C<$DUMPTYPE_ESTIMATELIST> C<$DUMPTYPE_COMPRESS> C<$DUMPTYPE_ENCRYPT> C<$DUMPTYPE_SRV_DECRYPT_OPT> C<$DUMPTYPE_CLNT_DECRYPT_OPT> C<$DUMPTYPE_COMPRATE> C<$DUMPTYPE_TAPE_SPLITSIZE> C<$DUMPTYPE_FALLBACK_SPLITSIZE> C<$DUMPTYPE_SPLIT_DISKBUFFER> C<$DUMPTYPE_RECORD> C<$DUMPTYPE_SKIP_INCR> C<$DUMPTYPE_SKIP_FULL> C<$DUMPTYPE_HOLDINGDISK> C<$DUMPTYPE_KENCRYPT> C<$DUMPTYPE_IGNORE> C<$DUMPTYPE_INDEX> C<$DUMPTYPE_APPLICATION> C<$DUMPTYPE_SCRIPTLIST> C<$DUMPTYPE_PROPERTY> C<$DUMPTYPE_DATA_PATH> C<$DUMPTYPE_ALLOW_SPLIT> C<$DUMPTYPE_RECOVERY_LIMIT>
 
-#copy symbols in dumptype_key to getconf
-push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"dumptype_key"}};
+=cut
 
 push @EXPORT_OK, qw(interface_key_to_string);
 push @{$EXPORT_TAGS{"interface_key"}}, qw(interface_key_to_string);
@@ -1451,18 +816,20 @@ sub interface_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw($INTER_COMMENT);
-push @{$EXPORT_TAGS{"interface_key"}}, qw($INTER_COMMENT);
+push @EXPORT_OK, qw( $INTER_COMMENT $INTER_MAXUSAGE);
+push @{$EXPORT_TAGS{"interface_key"}}, qw( $INTER_COMMENT $INTER_MAXUSAGE);
+      foreach (qw(  INTER_COMMENT INTER_MAXUSAGE)) {   $_interface_key_VALUES{$_} = $$_;      }  
+#copy symbols in interface_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"interface_key"}};
 
-$_interface_key_VALUES{"INTER_COMMENT"} = $INTER_COMMENT;
 
-push @EXPORT_OK, qw($INTER_MAXUSAGE);
-push @{$EXPORT_TAGS{"interface_key"}}, qw($INTER_MAXUSAGE);
+use Amanda::Config::FoldingHash;
 
-$_interface_key_VALUES{"INTER_MAXUSAGE"} = $INTER_MAXUSAGE;
+=pod
 
-#copy symbols in interface_key to getconf
-push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"interface_key"}};
+Dumptype Parameters:       C<$INTER_COMMENT> C<$INTER_MAXUSAGE>
+
+=cut
 
 push @EXPORT_OK, qw(holdingdisk_key_to_string);
 push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw(holdingdisk_key_to_string);
@@ -1485,28 +852,20 @@ sub holdingdisk_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw($HOLDING_COMMENT);
-push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw($HOLDING_COMMENT);
-
-$_holdingdisk_key_VALUES{"HOLDING_COMMENT"} = $HOLDING_COMMENT;
-
-push @EXPORT_OK, qw($HOLDING_DISKDIR);
-push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw($HOLDING_DISKDIR);
-
-$_holdingdisk_key_VALUES{"HOLDING_DISKDIR"} = $HOLDING_DISKDIR;
+push @EXPORT_OK, qw( $HOLDING_COMMENT $HOLDING_DISKDIR $HOLDING_DISKSIZE $HOLDING_CHUNKSIZE);
+push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw( $HOLDING_COMMENT $HOLDING_DISKDIR $HOLDING_DISKSIZE $HOLDING_CHUNKSIZE);
+      foreach (qw(  HOLDING_COMMENT HOLDING_DISKDIR HOLDING_DISKSIZE HOLDING_CHUNKSIZE)) {     $_holdingdisk_key_VALUES{$_} = $$_;      }  
+#copy symbols in holdingdisk_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"holdingdisk_key"}};
 
-push @EXPORT_OK, qw($HOLDING_DISKSIZE);
-push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw($HOLDING_DISKSIZE);
 
-$_holdingdisk_key_VALUES{"HOLDING_DISKSIZE"} = $HOLDING_DISKSIZE;
+use Amanda::Config::FoldingHash;
 
-push @EXPORT_OK, qw($HOLDING_CHUNKSIZE);
-push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw($HOLDING_CHUNKSIZE);
+=pod
 
-$_holdingdisk_key_VALUES{"HOLDING_CHUNKSIZE"} = $HOLDING_CHUNKSIZE;
+Holdingdisk Parameters:       C<$HOLDING_COMMENT> C<$HOLDING_DISKDIR> C<$HOLDING_DISKSIZE> C<$HOLDING_CHUNKSIZE>
 
-#copy symbols in holdingdisk_key to getconf
-push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"holdingdisk_key"}};
+=cut
 
 push @EXPORT_OK, qw(application_key_to_string);
 push @{$EXPORT_TAGS{"application_key"}}, qw(application_key_to_string);
@@ -1529,23 +888,20 @@ sub application_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw($APPLICATION_COMMENT);
-push @{$EXPORT_TAGS{"application_key"}}, qw($APPLICATION_COMMENT);
-
-$_application_key_VALUES{"APPLICATION_COMMENT"} = $APPLICATION_COMMENT;
+push @EXPORT_OK, qw( $APPLICATION_COMMENT $APPLICATION_PLUGIN $APPLICATION_PROPERTY);
+push @{$EXPORT_TAGS{"application_key"}}, qw( $APPLICATION_COMMENT $APPLICATION_PLUGIN $APPLICATION_PROPERTY);
+      foreach (qw(  APPLICATION_COMMENT APPLICATION_PLUGIN APPLICATION_PROPERTY)) {    $_application_key_VALUES{$_} = $$_;      }  
+#copy symbols in application_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"application_key"}};
 
-push @EXPORT_OK, qw($APPLICATION_PLUGIN);
-push @{$EXPORT_TAGS{"application_key"}}, qw($APPLICATION_PLUGIN);
 
-$_application_key_VALUES{"APPLICATION_PLUGIN"} = $APPLICATION_PLUGIN;
+use Amanda::Config::FoldingHash;
 
-push @EXPORT_OK, qw($APPLICATION_PROPERTY);
-push @{$EXPORT_TAGS{"application_key"}}, qw($APPLICATION_PROPERTY);
+=pod
 
-$_application_key_VALUES{"APPLICATION_PROPERTY"} = $APPLICATION_PROPERTY;
+Application Parameters:       C<$APPLICATION_COMMENT> C<$APPLICATION_PLUGIN> C<$APPLICATION_PROPERTY>
 
-#copy symbols in application_key to getconf
-push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"application_key"}};
+=cut
 
 push @EXPORT_OK, qw(pp_script_key_to_string);
 push @{$EXPORT_TAGS{"pp_script_key"}}, qw(pp_script_key_to_string);
@@ -1568,38 +924,20 @@ sub pp_script_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw($PP_SCRIPT_COMMENT);
-push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_COMMENT);
-
-$_pp_script_key_VALUES{"PP_SCRIPT_COMMENT"} = $PP_SCRIPT_COMMENT;
-
-push @EXPORT_OK, qw($PP_SCRIPT_PLUGIN);
-push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_PLUGIN);
-
-$_pp_script_key_VALUES{"PP_SCRIPT_PLUGIN"} = $PP_SCRIPT_PLUGIN;
-
-push @EXPORT_OK, qw($PP_SCRIPT_PROPERTY);
-push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_PROPERTY);
-
-$_pp_script_key_VALUES{"PP_SCRIPT_PROPERTY"} = $PP_SCRIPT_PROPERTY;
-
-push @EXPORT_OK, qw($PP_SCRIPT_EXECUTE_ON);
-push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_EXECUTE_ON);
-
-$_pp_script_key_VALUES{"PP_SCRIPT_EXECUTE_ON"} = $PP_SCRIPT_EXECUTE_ON;
+push @EXPORT_OK, qw( $PP_SCRIPT_COMMENT $PP_SCRIPT_PLUGIN $PP_SCRIPT_PROPERTY $PP_SCRIPT_EXECUTE_ON $PP_SCRIPT_EXECUTE_WHERE $PP_SCRIPT_ORDER);
+push @{$EXPORT_TAGS{"pp_script_key"}}, qw( $PP_SCRIPT_COMMENT $PP_SCRIPT_PLUGIN $PP_SCRIPT_PROPERTY $PP_SCRIPT_EXECUTE_ON $PP_SCRIPT_EXECUTE_WHERE $PP_SCRIPT_ORDER);
+      foreach (qw(  PP_SCRIPT_COMMENT PP_SCRIPT_PLUGIN PP_SCRIPT_PROPERTY PP_SCRIPT_EXECUTE_ON PP_SCRIPT_EXECUTE_WHERE PP_SCRIPT_ORDER)) {     $_pp_script_key_VALUES{$_} = $$_;      }  
+#copy symbols in pp_script_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"pp_script_key"}};
 
-push @EXPORT_OK, qw($PP_SCRIPT_EXECUTE_WHERE);
-push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_EXECUTE_WHERE);
 
-$_pp_script_key_VALUES{"PP_SCRIPT_EXECUTE_WHERE"} = $PP_SCRIPT_EXECUTE_WHERE;
+use Amanda::Config::FoldingHash;
 
-push @EXPORT_OK, qw($PP_SCRIPT_ORDER);
-push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_ORDER);
+=pod
 
-$_pp_script_key_VALUES{"PP_SCRIPT_ORDER"} = $PP_SCRIPT_ORDER;
+Pre/Post-Script Parameters:       C<$PP_SCRIPT_COMMENT> C<$PP_SCRIPT_PLUGIN> C<$PP_SCRIPT_PROPERTY> C<$PP_SCRIPT_EXECUTE_ON> C<$PP_SCRIPT_EXECUTE_WHERE> C<$PP_SCRIPT_ORDER>
 
-#copy symbols in pp_script_key to getconf
-push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"pp_script_key"}};
+=cut
 
 push @EXPORT_OK, qw(device_config_key_to_string);
 push @{$EXPORT_TAGS{"device_config_key"}}, qw(device_config_key_to_string);
@@ -1622,23 +960,20 @@ sub device_config_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw($DEVICE_CONFIG_COMMENT);
-push @{$EXPORT_TAGS{"device_config_key"}}, qw($DEVICE_CONFIG_COMMENT);
-
-$_device_config_key_VALUES{"DEVICE_CONFIG_COMMENT"} = $DEVICE_CONFIG_COMMENT;
+push @EXPORT_OK, qw( $DEVICE_CONFIG_COMMENT $DEVICE_CONFIG_TAPEDEV $DEVICE_CONFIG_DEVICE_PROPERTY);
+push @{$EXPORT_TAGS{"device_config_key"}}, qw( $DEVICE_CONFIG_COMMENT $DEVICE_CONFIG_TAPEDEV $DEVICE_CONFIG_DEVICE_PROPERTY);
+      foreach (qw(  DEVICE_CONFIG_COMMENT DEVICE_CONFIG_TAPEDEV DEVICE_CONFIG_DEVICE_PROPERTY)) {      $_device_config_key_VALUES{$_} = $$_;      }  
+#copy symbols in device_config_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"device_config_key"}};
 
-push @EXPORT_OK, qw($DEVICE_CONFIG_TAPEDEV);
-push @{$EXPORT_TAGS{"device_config_key"}}, qw($DEVICE_CONFIG_TAPEDEV);
 
-$_device_config_key_VALUES{"DEVICE_CONFIG_TAPEDEV"} = $DEVICE_CONFIG_TAPEDEV;
+use Amanda::Config::FoldingHash;
 
-push @EXPORT_OK, qw($DEVICE_CONFIG_DEVICE_PROPERTY);
-push @{$EXPORT_TAGS{"device_config_key"}}, qw($DEVICE_CONFIG_DEVICE_PROPERTY);
+=pod
 
-$_device_config_key_VALUES{"DEVICE_CONFIG_DEVICE_PROPERTY"} = $DEVICE_CONFIG_DEVICE_PROPERTY;
+Pre/Post-Script Parameters:       C<$DEVICE_CONFIG_COMMENT> C<$DEVICE_CONFIG_TAPEDEV> C<$DEVICE_CONFIG_DEVICE_PROPERTY>
 
-#copy symbols in device_config_key to getconf
-push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"device_config_key"}};
+=cut
 
 push @EXPORT_OK, qw(changer_config_key_to_string);
 push @{$EXPORT_TAGS{"changer_config_key"}}, qw(changer_config_key_to_string);
@@ -1661,43 +996,20 @@ sub changer_config_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw($CHANGER_CONFIG_COMMENT);
-push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_COMMENT);
-
-$_changer_config_key_VALUES{"CHANGER_CONFIG_COMMENT"} = $CHANGER_CONFIG_COMMENT;
-
-push @EXPORT_OK, qw($CHANGER_CONFIG_TAPEDEV);
-push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_TAPEDEV);
-
-$_changer_config_key_VALUES{"CHANGER_CONFIG_TAPEDEV"} = $CHANGER_CONFIG_TAPEDEV;
-
-push @EXPORT_OK, qw($CHANGER_CONFIG_TPCHANGER);
-push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_TPCHANGER);
-
-$_changer_config_key_VALUES{"CHANGER_CONFIG_TPCHANGER"} = $CHANGER_CONFIG_TPCHANGER;
-
-push @EXPORT_OK, qw($CHANGER_CONFIG_CHANGERDEV);
-push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_CHANGERDEV);
-
-$_changer_config_key_VALUES{"CHANGER_CONFIG_CHANGERDEV"} = $CHANGER_CONFIG_CHANGERDEV;
-
-push @EXPORT_OK, qw($CHANGER_CONFIG_CHANGERFILE);
-push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_CHANGERFILE);
-
-$_changer_config_key_VALUES{"CHANGER_CONFIG_CHANGERFILE"} = $CHANGER_CONFIG_CHANGERFILE;
+push @EXPORT_OK, qw( $CHANGER_CONFIG_COMMENT $CHANGER_CONFIG_TAPEDEV $CHANGER_CONFIG_TPCHANGER $CHANGER_CONFIG_CHANGERDEV $CHANGER_CONFIG_CHANGERFILE $CHANGER_CONFIG_PROPERTY $CHANGER_CONFIG_DEVICE_PROPERTY);
+push @{$EXPORT_TAGS{"changer_config_key"}}, qw( $CHANGER_CONFIG_COMMENT $CHANGER_CONFIG_TAPEDEV $CHANGER_CONFIG_TPCHANGER $CHANGER_CONFIG_CHANGERDEV $CHANGER_CONFIG_CHANGERFILE $CHANGER_CONFIG_PROPERTY $CHANGER_CONFIG_DEVICE_PROPERTY);
+      foreach (qw(  CHANGER_CONFIG_COMMENT CHANGER_CONFIG_TAPEDEV CHANGER_CONFIG_TPCHANGER CHANGER_CONFIG_CHANGERDEV CHANGER_CONFIG_CHANGERFILE CHANGER_CONFIG_PROPERTY CHANGER_CONFIG_DEVICE_PROPERTY)) {     $_changer_config_key_VALUES{$_} = $$_;      }  
+#copy symbols in changer_config_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"changer_config_key"}};
 
-push @EXPORT_OK, qw($CHANGER_CONFIG_PROPERTY);
-push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_PROPERTY);
 
-$_changer_config_key_VALUES{"CHANGER_CONFIG_PROPERTY"} = $CHANGER_CONFIG_PROPERTY;
+use Amanda::Config::FoldingHash;
 
-push @EXPORT_OK, qw($CHANGER_CONFIG_DEVICE_PROPERTY);
-push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_DEVICE_PROPERTY);
+=pod
 
-$_changer_config_key_VALUES{"CHANGER_CONFIG_DEVICE_PROPERTY"} = $CHANGER_CONFIG_DEVICE_PROPERTY;
+Pre/Post-Script Parameters:       C<$CHANGER_CONFIG_COMMENT> C<$CHANGER_CONFIG_TAPEDEV> C<$CHANGER_CONFIG_TPCHANGER> C<$CHANGER_CONFIG_CHANGERDEV> C<$CHANGER_CONFIG_CHANGERFILE> C<$CHANGER_CONFIG_PROPERTY> C<$CHANGER_CONFIG_DEVICE_PROPERTY>
 
-#copy symbols in changer_config_key to getconf
-push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"changer_config_key"}};
+=cut
 
 push @EXPORT_OK, qw(dump_holdingdisk_t_to_string);
 push @{$EXPORT_TAGS{"dump_holdingdisk_t"}}, qw(dump_holdingdisk_t_to_string);
@@ -2199,6 +1511,45 @@ $_data_path_t_VALUES{"DATA_PATH_DIRECTTCP"} = $DATA_PATH_DIRECTTCP;
 #copy symbols in data_path_t to getconf
 push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"data_path_t"}};
 
+push @EXPORT_OK, qw(part_cache_type_t_to_string);
+push @{$EXPORT_TAGS{"part_cache_type_t"}}, qw(part_cache_type_t_to_string);
+
+my %_part_cache_type_t_VALUES;
+#Convert an enum value to a single string
+sub part_cache_type_t_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_part_cache_type_t_VALUES) {
+       my $v = $_part_cache_type_t_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($PART_CACHE_TYPE_NONE);
+push @{$EXPORT_TAGS{"part_cache_type_t"}}, qw($PART_CACHE_TYPE_NONE);
+
+$_part_cache_type_t_VALUES{"PART_CACHE_TYPE_NONE"} = $PART_CACHE_TYPE_NONE;
+
+push @EXPORT_OK, qw($PART_CACHE_TYPE_DISK);
+push @{$EXPORT_TAGS{"part_cache_type_t"}}, qw($PART_CACHE_TYPE_DISK);
+
+$_part_cache_type_t_VALUES{"PART_CACHE_TYPE_DISK"} = $PART_CACHE_TYPE_DISK;
+
+push @EXPORT_OK, qw($PART_CACHE_TYPE_MEMORY);
+push @{$EXPORT_TAGS{"part_cache_type_t"}}, qw($PART_CACHE_TYPE_MEMORY);
+
+$_part_cache_type_t_VALUES{"PART_CACHE_TYPE_MEMORY"} = $PART_CACHE_TYPE_MEMORY;
+
+#copy symbols in part_cache_type_t to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"part_cache_type_t"}};
+
 push @EXPORT_OK, qw(getconf getconf_seen getconf_linenum
     getconf_byname getconf_byname_strs
     getconf_list);
@@ -2390,4 +1741,6 @@ sub string_to_boolean {
 
 
 push @EXPORT_OK, qw(string_to_boolean);
+
+push @EXPORT_OK, qw(amandaify_property_name);
 1;
index 5c88281b885073d2d848526eba4204f6c8153432..535869e4a9a2388638dc88b256061977ebb32fa0 100644 (file)
@@ -41,8 +41,7 @@ Amanda::Config - access to Amanda configuration parameters
 
     print "tape device is ", getconf($CNF_TAPEDEV), "\n";
 
-This API closely parallels the C API.  See F<conffile.h> for details on the
-configuration parameter constants.
+This API closely parallels the C API.
 
 =head1 INITIALIZATION
 
@@ -248,6 +247,9 @@ values is straightforward:
   CONFTYPE_EXECUTE_WHERE              Math::BigInt
   CONFTYPE_SEND_AMREPORT_ON           Math::BigInt
   CONFTYPE_IDENTLIST                  [ string, .. ]
+  CONFTYPE_PART_CACHE_TYPE           Math::BigInt
+  CONFTYPE_RECOVERY_LIMIT             [ string, .. ] (undef if not specified;
+                                           undef in the list means same-host)
 
 Note that C<CONFTYPE_INTRANGE> and C<CONFTYPE_RATE> each return two values, not
 an array reference.
@@ -326,7 +328,14 @@ C<string_to_boolean()> takes a string and returns 0 if it matches any of
 Amanda's names for false, or 1 if matches a name for true. If it can't be
 interpreted, C<undef> is returned.
 
-=cut
+C<amandaify_property_name()> converts a string into Amanda's property style:
+all lower-case and with "-" replacing "_".
+
+=head1 CONSTANTS
 
+This section lists all of the configuration parameter constants defined in this
+module.  All of these constants are available with the C<:getconf> export tag.
+
+=cut
 
 %}
index d7589922369dab8c0b83589e73734d54f7997fa6..6a0b6aa21879c43196383278f44c9079ea44979d 100644 (file)
 #include "conffile.h"
 %}
 
+/*
+ * Documentation Macro
+ */
+
+%define constant_pod(DESCRIPTION, FORALL_FN)
+%perlcode %{
+
+use Amanda::Config::FoldingHash;
+
+=pod
+
+DESCRIPTION: amglue_constants_list(FORALL_FN)
+
+=cut
+%}
+%enddef
+
 /*
  * Parameter access
 */
 
 /* All of the CNF_ flags from conffile.h */
 
+#define FOR_ALL_CONFPARM_KEY(APPLY)\
+APPLY(CNF_ORG)\
+APPLY(CNF_CONF)\
+APPLY(CNF_INDEX_SERVER)\
+APPLY(CNF_TAPE_SERVER)\
+APPLY(CNF_AUTH)\
+APPLY(CNF_SSH_KEYS)\
+APPLY(CNF_AMANDAD_PATH)\
+APPLY(CNF_CLIENT_USERNAME)\
+APPLY(CNF_CLIENT_PORT)\
+APPLY(CNF_GNUTAR_LIST_DIR)\
+APPLY(CNF_AMANDATES)\
+APPLY(CNF_MAILER)\
+APPLY(CNF_MAILTO)\
+APPLY(CNF_DUMPUSER)\
+APPLY(CNF_TAPEDEV)\
+APPLY(CNF_DEVICE_PROPERTY)\
+APPLY(CNF_PROPERTY)\
+APPLY(CNF_CHANGERDEV)\
+APPLY(CNF_CHANGERFILE)\
+APPLY(CNF_LABELSTR)\
+APPLY(CNF_AUTOLABEL)\
+APPLY(CNF_TAPELIST)\
+APPLY(CNF_DISKFILE)\
+APPLY(CNF_INFOFILE)\
+APPLY(CNF_LOGDIR)\
+APPLY(CNF_INDEXDIR)\
+APPLY(CNF_TAPETYPE)\
+APPLY(CNF_DUMPCYCLE)\
+APPLY(CNF_RUNSPERCYCLE)\
+APPLY(CNF_TAPECYCLE)\
+APPLY(CNF_NETUSAGE)\
+APPLY(CNF_INPARALLEL)\
+APPLY(CNF_DUMPORDER)\
+APPLY(CNF_BUMPPERCENT)\
+APPLY(CNF_BUMPSIZE)\
+APPLY(CNF_BUMPMULT)\
+APPLY(CNF_BUMPDAYS)\
+APPLY(CNF_TPCHANGER)\
+APPLY(CNF_RUNTAPES)\
+APPLY(CNF_MAXDUMPS)\
+APPLY(CNF_ETIMEOUT)\
+APPLY(CNF_DTIMEOUT)\
+APPLY(CNF_CTIMEOUT)\
+APPLY(CNF_DEVICE_OUTPUT_BUFFER_SIZE)\
+APPLY(CNF_PRINTER)\
+APPLY(CNF_AUTOFLUSH)\
+APPLY(CNF_RESERVE)\
+APPLY(CNF_MAXDUMPSIZE)\
+APPLY(CNF_COLUMNSPEC)\
+APPLY(CNF_AMRECOVER_DO_FSF)\
+APPLY(CNF_AMRECOVER_CHECK_LABEL)\
+APPLY(CNF_AMRECOVER_CHANGER)\
+APPLY(CNF_TAPERALGO)\
+APPLY(CNF_FLUSH_THRESHOLD_DUMPED)\
+APPLY(CNF_FLUSH_THRESHOLD_SCHEDULED)\
+APPLY(CNF_TAPERFLUSH)\
+APPLY(CNF_DISPLAYUNIT)\
+APPLY(CNF_KRB5KEYTAB)\
+APPLY(CNF_KRB5PRINCIPAL)\
+APPLY(CNF_LABEL_NEW_TAPES)\
+APPLY(CNF_USETIMESTAMPS)\
+APPLY(CNF_REP_TRIES)\
+APPLY(CNF_CONNECT_TRIES)\
+APPLY(CNF_REQ_TRIES)\
+APPLY(CNF_DEBUG_AMANDAD)\
+APPLY(CNF_DEBUG_RECOVERY)\
+APPLY(CNF_DEBUG_AMIDXTAPED)\
+APPLY(CNF_DEBUG_AMINDEXD)\
+APPLY(CNF_DEBUG_AMRECOVER)\
+APPLY(CNF_DEBUG_AUTH)\
+APPLY(CNF_DEBUG_EVENT)\
+APPLY(CNF_DEBUG_HOLDING)\
+APPLY(CNF_DEBUG_PROTOCOL)\
+APPLY(CNF_DEBUG_PLANNER)\
+APPLY(CNF_DEBUG_DRIVER)\
+APPLY(CNF_DEBUG_DUMPER)\
+APPLY(CNF_DEBUG_CHUNKER)\
+APPLY(CNF_DEBUG_TAPER)\
+APPLY(CNF_DEBUG_SELFCHECK)\
+APPLY(CNF_DEBUG_SENDSIZE)\
+APPLY(CNF_DEBUG_SENDBACKUP)\
+APPLY(CNF_RESERVED_UDP_PORT)\
+APPLY(CNF_RESERVED_TCP_PORT)\
+APPLY(CNF_UNRESERVED_TCP_PORT)\
+APPLY(CNF_HOLDINGDISK)\
+APPLY(CNF_SEND_AMREPORT_ON)\
+APPLY(CNF_TAPER_PARALLEL_WRITE)\
+APPLY(CNF_RECOVERY_LIMIT)
+
 amglue_add_enum_tag_fns(confparm_key);
-amglue_add_constant(CNF_ORG, confparm_key);
-amglue_add_constant(CNF_CONF, confparm_key);
-amglue_add_constant(CNF_INDEX_SERVER, confparm_key);
-amglue_add_constant(CNF_TAPE_SERVER, confparm_key);
-amglue_add_constant(CNF_AUTH, confparm_key);
-amglue_add_constant(CNF_SSH_KEYS, confparm_key);
-amglue_add_constant(CNF_AMANDAD_PATH, confparm_key);
-amglue_add_constant(CNF_CLIENT_USERNAME, confparm_key);
-amglue_add_constant(CNF_CLIENT_PORT, confparm_key);
-amglue_add_constant(CNF_GNUTAR_LIST_DIR, confparm_key);
-amglue_add_constant(CNF_AMANDATES, confparm_key);
-amglue_add_constant(CNF_MAILER, confparm_key);
-amglue_add_constant(CNF_MAILTO, confparm_key);
-amglue_add_constant(CNF_DUMPUSER, confparm_key);
-amglue_add_constant(CNF_TAPEDEV, confparm_key);
-amglue_add_constant(CNF_DEVICE_PROPERTY, confparm_key);
-amglue_add_constant(CNF_PROPERTY, confparm_key);
-amglue_add_constant(CNF_CHANGERDEV, confparm_key);
-amglue_add_constant(CNF_CHANGERFILE, confparm_key);
-amglue_add_constant(CNF_LABELSTR, confparm_key);
-amglue_add_constant(CNF_AUTOLABEL, confparm_key);
-amglue_add_constant(CNF_TAPELIST, confparm_key);
-amglue_add_constant(CNF_DISKFILE, confparm_key);
-amglue_add_constant(CNF_INFOFILE, confparm_key);
-amglue_add_constant(CNF_LOGDIR, confparm_key);
-amglue_add_constant(CNF_INDEXDIR, confparm_key);
-amglue_add_constant(CNF_TAPETYPE, confparm_key);
-amglue_add_constant(CNF_DUMPCYCLE, confparm_key);
-amglue_add_constant(CNF_RUNSPERCYCLE, confparm_key);
-amglue_add_constant(CNF_TAPECYCLE, confparm_key);
-amglue_add_constant(CNF_NETUSAGE, confparm_key);
-amglue_add_constant(CNF_INPARALLEL, confparm_key);
-amglue_add_constant(CNF_DUMPORDER, confparm_key);
-amglue_add_constant(CNF_BUMPPERCENT, confparm_key);
-amglue_add_constant(CNF_BUMPSIZE, confparm_key);
-amglue_add_constant(CNF_BUMPMULT, confparm_key);
-amglue_add_constant(CNF_BUMPDAYS, confparm_key);
-amglue_add_constant(CNF_TPCHANGER, confparm_key);
-amglue_add_constant(CNF_RUNTAPES, confparm_key);
-amglue_add_constant(CNF_MAXDUMPS, confparm_key);
-amglue_add_constant(CNF_ETIMEOUT, confparm_key);
-amglue_add_constant(CNF_DTIMEOUT, confparm_key);
-amglue_add_constant(CNF_CTIMEOUT, confparm_key);
-amglue_add_constant(CNF_TAPEBUFS, confparm_key);
-amglue_add_constant(CNF_DEVICE_OUTPUT_BUFFER_SIZE, confparm_key);
-amglue_add_constant(CNF_PRINTER, confparm_key);
-amglue_add_constant(CNF_AUTOFLUSH, confparm_key);
-amglue_add_constant(CNF_RESERVE, confparm_key);
-amglue_add_constant(CNF_MAXDUMPSIZE, confparm_key);
-amglue_add_constant(CNF_COLUMNSPEC, confparm_key);
-amglue_add_constant(CNF_AMRECOVER_DO_FSF, confparm_key);
-amglue_add_constant(CNF_AMRECOVER_CHECK_LABEL, confparm_key);
-amglue_add_constant(CNF_AMRECOVER_CHANGER, confparm_key);
-amglue_add_constant(CNF_TAPERALGO, confparm_key);
-amglue_add_constant(CNF_FLUSH_THRESHOLD_DUMPED, confparm_key);
-amglue_add_constant(CNF_FLUSH_THRESHOLD_SCHEDULED, confparm_key);
-amglue_add_constant(CNF_TAPERFLUSH, confparm_key);
-amglue_add_constant(CNF_DISPLAYUNIT, confparm_key);
-amglue_add_constant(CNF_KRB5KEYTAB, confparm_key);
-amglue_add_constant(CNF_KRB5PRINCIPAL, confparm_key);
-amglue_add_constant(CNF_LABEL_NEW_TAPES, confparm_key);
-amglue_add_constant(CNF_USETIMESTAMPS, confparm_key);
-amglue_add_constant(CNF_REP_TRIES, confparm_key);
-amglue_add_constant(CNF_CONNECT_TRIES, confparm_key);
-amglue_add_constant(CNF_REQ_TRIES, confparm_key);
-amglue_add_constant(CNF_DEBUG_AMANDAD, confparm_key);
-amglue_add_constant(CNF_DEBUG_RECOVERY, confparm_key);
-amglue_add_constant(CNF_DEBUG_AMIDXTAPED, confparm_key);
-amglue_add_constant(CNF_DEBUG_AMINDEXD, confparm_key);
-amglue_add_constant(CNF_DEBUG_AMRECOVER, confparm_key);
-amglue_add_constant(CNF_DEBUG_AUTH, confparm_key);
-amglue_add_constant(CNF_DEBUG_EVENT, confparm_key);
-amglue_add_constant(CNF_DEBUG_HOLDING, confparm_key);
-amglue_add_constant(CNF_DEBUG_PROTOCOL, confparm_key);
-amglue_add_constant(CNF_DEBUG_PLANNER, confparm_key);
-amglue_add_constant(CNF_DEBUG_DRIVER, confparm_key);
-amglue_add_constant(CNF_DEBUG_DUMPER, confparm_key);
-amglue_add_constant(CNF_DEBUG_CHUNKER, confparm_key);
-amglue_add_constant(CNF_DEBUG_TAPER, confparm_key);
-amglue_add_constant(CNF_DEBUG_SELFCHECK, confparm_key);
-amglue_add_constant(CNF_DEBUG_SENDSIZE, confparm_key);
-amglue_add_constant(CNF_DEBUG_SENDBACKUP, confparm_key);
-amglue_add_constant(CNF_RESERVED_UDP_PORT, confparm_key);
-amglue_add_constant(CNF_RESERVED_TCP_PORT, confparm_key);
-amglue_add_constant(CNF_UNRESERVED_TCP_PORT, confparm_key);
-amglue_add_constant(CNF_HOLDINGDISK, confparm_key);
-amglue_add_constant(CNF_SEND_AMREPORT_ON, confparm_key);
+amglue_add_constants(FOR_ALL_CONFPARM_KEY, confparm_key);
 amglue_copy_to_tag(confparm_key, getconf);
+constant_pod(Global Parameters, FOR_ALL_CONFPARM_KEY)
+
+#define FOR_ALL_TAPETYPE_KEY(APPLY)\
+APPLY(TAPETYPE_COMMENT)\
+APPLY(TAPETYPE_LBL_TEMPL)\
+APPLY(TAPETYPE_BLOCKSIZE)\
+APPLY(TAPETYPE_READBLOCKSIZE)\
+APPLY(TAPETYPE_LENGTH)\
+APPLY(TAPETYPE_FILEMARK)\
+APPLY(TAPETYPE_SPEED)\
+APPLY(TAPETYPE_PART_SIZE)\
+APPLY(TAPETYPE_PART_CACHE_TYPE)\
+APPLY(TAPETYPE_PART_CACHE_DIR)\
+APPLY(TAPETYPE_PART_CACHE_MAX_SIZE)
 
 amglue_add_enum_tag_fns(tapetype_key);
-amglue_add_constant(TAPETYPE_COMMENT, tapetype_key);
-amglue_add_constant(TAPETYPE_LBL_TEMPL, tapetype_key);
-amglue_add_constant(TAPETYPE_BLOCKSIZE, tapetype_key);
-amglue_add_constant(TAPETYPE_READBLOCKSIZE, tapetype_key);
-amglue_add_constant(TAPETYPE_LENGTH, tapetype_key);
-amglue_add_constant(TAPETYPE_FILEMARK, tapetype_key);
-amglue_add_constant(TAPETYPE_SPEED, tapetype_key);
-amglue_add_constant(TAPETYPE_FILE_PAD, tapetype_key);
+amglue_add_constants(FOR_ALL_TAPETYPE_KEY, tapetype_key);
 amglue_copy_to_tag(tapetype_key, getconf);
+constant_pod(Tapetype Parameters, FOR_ALL_TAPETYPE_KEY)
+
+#define FOR_ALL_DUMPTYPE_KEY(APPLY)\
+APPLY(DUMPTYPE_COMMENT)\
+APPLY(DUMPTYPE_PROGRAM)\
+APPLY(DUMPTYPE_SRVCOMPPROG)\
+APPLY(DUMPTYPE_CLNTCOMPPROG)\
+APPLY(DUMPTYPE_SRV_ENCRYPT)\
+APPLY(DUMPTYPE_CLNT_ENCRYPT)\
+APPLY(DUMPTYPE_AMANDAD_PATH)\
+APPLY(DUMPTYPE_CLIENT_USERNAME)\
+APPLY(DUMPTYPE_CLIENT_PORT)\
+APPLY(DUMPTYPE_SSH_KEYS)\
+APPLY(DUMPTYPE_AUTH)\
+APPLY(DUMPTYPE_EXCLUDE)\
+APPLY(DUMPTYPE_INCLUDE)\
+APPLY(DUMPTYPE_PRIORITY)\
+APPLY(DUMPTYPE_DUMPCYCLE)\
+APPLY(DUMPTYPE_MAXDUMPS)\
+APPLY(DUMPTYPE_MAXPROMOTEDAY)\
+APPLY(DUMPTYPE_BUMPPERCENT)\
+APPLY(DUMPTYPE_BUMPSIZE)\
+APPLY(DUMPTYPE_BUMPDAYS)\
+APPLY(DUMPTYPE_BUMPMULT)\
+APPLY(DUMPTYPE_STARTTIME)\
+APPLY(DUMPTYPE_STRATEGY)\
+APPLY(DUMPTYPE_ESTIMATELIST)\
+APPLY(DUMPTYPE_COMPRESS)\
+APPLY(DUMPTYPE_ENCRYPT)\
+APPLY(DUMPTYPE_SRV_DECRYPT_OPT)\
+APPLY(DUMPTYPE_CLNT_DECRYPT_OPT)\
+APPLY(DUMPTYPE_COMPRATE)\
+APPLY(DUMPTYPE_TAPE_SPLITSIZE)\
+APPLY(DUMPTYPE_FALLBACK_SPLITSIZE)\
+APPLY(DUMPTYPE_SPLIT_DISKBUFFER)\
+APPLY(DUMPTYPE_RECORD)\
+APPLY(DUMPTYPE_SKIP_INCR)\
+APPLY(DUMPTYPE_SKIP_FULL)\
+APPLY(DUMPTYPE_HOLDINGDISK)\
+APPLY(DUMPTYPE_KENCRYPT)\
+APPLY(DUMPTYPE_IGNORE)\
+APPLY(DUMPTYPE_INDEX)\
+APPLY(DUMPTYPE_APPLICATION)\
+APPLY(DUMPTYPE_SCRIPTLIST)\
+APPLY(DUMPTYPE_PROPERTY)\
+APPLY(DUMPTYPE_DATA_PATH)\
+APPLY(DUMPTYPE_ALLOW_SPLIT)\
+APPLY(DUMPTYPE_RECOVERY_LIMIT)
 
 amglue_add_enum_tag_fns(dumptype_key);
-amglue_add_constant(DUMPTYPE_COMMENT, dumptype_key);
-amglue_add_constant(DUMPTYPE_PROGRAM, dumptype_key);
-amglue_add_constant(DUMPTYPE_SRVCOMPPROG, dumptype_key);
-amglue_add_constant(DUMPTYPE_CLNTCOMPPROG, dumptype_key);
-amglue_add_constant(DUMPTYPE_SRV_ENCRYPT, dumptype_key);
-amglue_add_constant(DUMPTYPE_CLNT_ENCRYPT, dumptype_key);
-amglue_add_constant(DUMPTYPE_AMANDAD_PATH, dumptype_key);
-amglue_add_constant(DUMPTYPE_CLIENT_USERNAME, dumptype_key);
-amglue_add_constant(DUMPTYPE_CLIENT_PORT, dumptype_key);
-amglue_add_constant(DUMPTYPE_SSH_KEYS, dumptype_key);
-amglue_add_constant(DUMPTYPE_AUTH, dumptype_key);
-amglue_add_constant(DUMPTYPE_EXCLUDE, dumptype_key);
-amglue_add_constant(DUMPTYPE_INCLUDE, dumptype_key);
-amglue_add_constant(DUMPTYPE_PRIORITY, dumptype_key);
-amglue_add_constant(DUMPTYPE_DUMPCYCLE, dumptype_key);
-amglue_add_constant(DUMPTYPE_MAXDUMPS, dumptype_key);
-amglue_add_constant(DUMPTYPE_MAXPROMOTEDAY, dumptype_key);
-amglue_add_constant(DUMPTYPE_BUMPPERCENT, dumptype_key);
-amglue_add_constant(DUMPTYPE_BUMPSIZE, dumptype_key);
-amglue_add_constant(DUMPTYPE_BUMPDAYS, dumptype_key);
-amglue_add_constant(DUMPTYPE_BUMPMULT, dumptype_key);
-amglue_add_constant(DUMPTYPE_STARTTIME, dumptype_key);
-amglue_add_constant(DUMPTYPE_STRATEGY, dumptype_key);
-amglue_add_constant(DUMPTYPE_ESTIMATELIST, dumptype_key);
-amglue_add_constant(DUMPTYPE_COMPRESS, dumptype_key);
-amglue_add_constant(DUMPTYPE_ENCRYPT, dumptype_key);
-amglue_add_constant(DUMPTYPE_SRV_DECRYPT_OPT, dumptype_key);
-amglue_add_constant(DUMPTYPE_CLNT_DECRYPT_OPT, dumptype_key);
-amglue_add_constant(DUMPTYPE_COMPRATE, dumptype_key);
-amglue_add_constant(DUMPTYPE_TAPE_SPLITSIZE, dumptype_key);
-amglue_add_constant(DUMPTYPE_FALLBACK_SPLITSIZE, dumptype_key);
-amglue_add_constant(DUMPTYPE_SPLIT_DISKBUFFER, dumptype_key);
-amglue_add_constant(DUMPTYPE_RECORD, dumptype_key);
-amglue_add_constant(DUMPTYPE_SKIP_INCR, dumptype_key);
-amglue_add_constant(DUMPTYPE_SKIP_FULL, dumptype_key);
-amglue_add_constant(DUMPTYPE_HOLDINGDISK, dumptype_key);
-amglue_add_constant(DUMPTYPE_KENCRYPT, dumptype_key);
-amglue_add_constant(DUMPTYPE_IGNORE, dumptype_key);
-amglue_add_constant(DUMPTYPE_INDEX, dumptype_key);
-amglue_add_constant(DUMPTYPE_APPLICATION, dumptype_key);
-amglue_add_constant(DUMPTYPE_SCRIPTLIST, dumptype_key);
-amglue_add_constant(DUMPTYPE_PROPERTY, dumptype_key);
-amglue_add_constant(DUMPTYPE_DATA_PATH, dumptype_key);
+amglue_add_constants(FOR_ALL_DUMPTYPE_KEY, dumptype_key);
 amglue_copy_to_tag(dumptype_key, getconf);
+constant_pod(Dumptype Parameters, FOR_ALL_DUMPTYPE_KEY)
+
+#define FOR_ALL_INTERFACE_KEY(APPLY)\
+APPLY(INTER_COMMENT)\
+APPLY(INTER_MAXUSAGE)
 
 amglue_add_enum_tag_fns(interface_key);
-amglue_add_constant(INTER_COMMENT, interface_key);
-amglue_add_constant(INTER_MAXUSAGE, interface_key);
+amglue_add_constants(FOR_ALL_INTERFACE_KEY, interface_key);
 amglue_copy_to_tag(interface_key, getconf);
+constant_pod(Dumptype Parameters, FOR_ALL_INTERFACE_KEY)
+
+#define FOR_ALL_HOLDINGDISK_KEY(APPLY)\
+APPLY(HOLDING_COMMENT)\
+APPLY(HOLDING_DISKDIR)\
+APPLY(HOLDING_DISKSIZE)\
+APPLY(HOLDING_CHUNKSIZE)
 
 amglue_add_enum_tag_fns(holdingdisk_key);
-amglue_add_constant(HOLDING_COMMENT, holdingdisk_key);
-amglue_add_constant(HOLDING_DISKDIR, holdingdisk_key);
-amglue_add_constant(HOLDING_DISKSIZE, holdingdisk_key);
-amglue_add_constant(HOLDING_CHUNKSIZE, holdingdisk_key);
+amglue_add_constants(FOR_ALL_HOLDINGDISK_KEY, holdingdisk_key);
 amglue_copy_to_tag(holdingdisk_key, getconf);
+constant_pod(Holdingdisk Parameters, FOR_ALL_HOLDINGDISK_KEY)
+
+#define FOR_ALL_APPLICATION_KEY(APPLY)\
+APPLY(APPLICATION_COMMENT)\
+APPLY(APPLICATION_PLUGIN)\
+APPLY(APPLICATION_PROPERTY)
 
 amglue_add_enum_tag_fns(application_key);
-amglue_add_constant(APPLICATION_COMMENT, application_key);
-amglue_add_constant(APPLICATION_PLUGIN, application_key);
-amglue_add_constant(APPLICATION_PROPERTY, application_key);
+amglue_add_constants(FOR_ALL_APPLICATION_KEY, application_key);
 amglue_copy_to_tag(application_key, getconf);
+constant_pod(Application Parameters, FOR_ALL_APPLICATION_KEY)
+
+#define FOR_ALL_PP_SCRIPT_KEY(APPLY)\
+APPLY(PP_SCRIPT_COMMENT)\
+APPLY(PP_SCRIPT_PLUGIN)\
+APPLY(PP_SCRIPT_PROPERTY)\
+APPLY(PP_SCRIPT_EXECUTE_ON)\
+APPLY(PP_SCRIPT_EXECUTE_WHERE)\
+APPLY(PP_SCRIPT_ORDER)
 
 amglue_add_enum_tag_fns(pp_script_key);
-amglue_add_constant(PP_SCRIPT_COMMENT, pp_script_key);
-amglue_add_constant(PP_SCRIPT_PLUGIN, pp_script_key);
-amglue_add_constant(PP_SCRIPT_PROPERTY, pp_script_key);
-amglue_add_constant(PP_SCRIPT_EXECUTE_ON, pp_script_key);
-amglue_add_constant(PP_SCRIPT_EXECUTE_WHERE, pp_script_key);
-amglue_add_constant(PP_SCRIPT_ORDER, pp_script_key);
+amglue_add_constants(FOR_ALL_PP_SCRIPT_KEY, pp_script_key);
 amglue_copy_to_tag(pp_script_key, getconf);
+constant_pod(Pre/Post-Script Parameters, FOR_ALL_PP_SCRIPT_KEY)
+
+#define FOR_ALL_DEVICE_CONFIG_KEY(APPLY)\
+APPLY(DEVICE_CONFIG_COMMENT)\
+APPLY(DEVICE_CONFIG_TAPEDEV)\
+APPLY(DEVICE_CONFIG_DEVICE_PROPERTY)
 
 amglue_add_enum_tag_fns(device_config_key);
-amglue_add_constant(DEVICE_CONFIG_COMMENT, device_config_key);
-amglue_add_constant(DEVICE_CONFIG_TAPEDEV, device_config_key);
-amglue_add_constant(DEVICE_CONFIG_DEVICE_PROPERTY, device_config_key);
+amglue_add_constants(FOR_ALL_DEVICE_CONFIG_KEY, device_config_key);
 amglue_copy_to_tag(device_config_key, getconf);
+constant_pod(Pre/Post-Script Parameters, FOR_ALL_DEVICE_CONFIG_KEY)
+
+#define FOR_ALL_CHANGER_CONFIG_KEY(APPLY)\
+APPLY(CHANGER_CONFIG_COMMENT)\
+APPLY(CHANGER_CONFIG_TAPEDEV)\
+APPLY(CHANGER_CONFIG_TPCHANGER)\
+APPLY(CHANGER_CONFIG_CHANGERDEV)\
+APPLY(CHANGER_CONFIG_CHANGERFILE)\
+APPLY(CHANGER_CONFIG_PROPERTY)\
+APPLY(CHANGER_CONFIG_DEVICE_PROPERTY)
 
 amglue_add_enum_tag_fns(changer_config_key);
-amglue_add_constant(CHANGER_CONFIG_COMMENT, changer_config_key);
-amglue_add_constant(CHANGER_CONFIG_TAPEDEV, changer_config_key);
-amglue_add_constant(CHANGER_CONFIG_TPCHANGER, changer_config_key);
-amglue_add_constant(CHANGER_CONFIG_CHANGERDEV, changer_config_key);
-amglue_add_constant(CHANGER_CONFIG_CHANGERFILE, changer_config_key);
-amglue_add_constant(CHANGER_CONFIG_PROPERTY, changer_config_key);
-amglue_add_constant(CHANGER_CONFIG_DEVICE_PROPERTY, changer_config_key);
+amglue_add_constants(FOR_ALL_CHANGER_CONFIG_KEY, changer_config_key);
 amglue_copy_to_tag(changer_config_key, getconf);
+constant_pod(Pre/Post-Script Parameters, FOR_ALL_CHANGER_CONFIG_KEY)
 
 /*
  * Various enumerated conftypes
@@ -310,12 +369,17 @@ amglue_add_constant(DATA_PATH_AMANDA, data_path_t);
 amglue_add_constant(DATA_PATH_DIRECTTCP, data_path_t);
 amglue_copy_to_tag(data_path_t, getconf);
 
+amglue_add_enum_tag_fns(part_cache_type_t);
+amglue_add_constant(PART_CACHE_TYPE_NONE, part_cache_type_t);
+amglue_add_constant(PART_CACHE_TYPE_DISK, part_cache_type_t);
+amglue_add_constant(PART_CACHE_TYPE_MEMORY, part_cache_type_t);
+amglue_copy_to_tag(part_cache_type_t, getconf);
+
 /*
  * val_t typemaps
  */
 
-/* Typemap to convert a val_t, the union in which config values are
- * stored, to a Perl value of the appropriate type.  This converts:
+/* Typemap to convert a val_t to an SV, using a static function since it's huge.  This converts:
  *  - CONFTYPE_SIZE, CONFTYPE_INT, CONFTYPE_INT64,
  *    CONFTYPE_BOOLEAN -> IV
  *  - CONFTYPE_REAL -> NV
@@ -325,40 +389,40 @@ amglue_copy_to_tag(data_path_t, getconf);
  *  - CONFTYPE_COMPRESS, CONFTYPE_ENCRYPT, CONFTYPE_ESTIMATELIST, CONFTYPE_STRATEGY,
  *    CONFTYPE_TAPERALGO, CONFTYPE_PRIORITY, CONFTYPE_HOLDING, CONFTYPE_EXECUTE_ON,
  *    CONFTYPE_EXECUTE_WHERE, CONFTYPE_SEND_AMREPORT_ON,
- *    CONFTYPE_DATA_PATH -> IV (enums)
+ *    CONFTYPE_DATA_PATH, CONFTYPE_PART_CACHE_TYPE -> IV (enums)
  *  - CONFTYPE_RATE -> list of two NVs
  *  - CONFTYPE_INTRANGE -> list of two IVs
  *  - CONFTYPE_EXINCLUDE -> hashref with keys 'list' (listref), 'file' (listref),
  *    and 'optional' (int)
  *  - CONFTYPE_PROPLIST -> hashref of hashref with keys 'append' (IV), 'priority' (IV),
  *                                                     'values' (listref)
+ *  - CONFTYPE_RECOVERY_LIMIT -> listref of match expressions; undef in list is taken
+ *                 to mean 'same-host'
  */
-%typemap (out) val_t * {
-    if (!$1) {
-       $result = &PL_sv_undef;
-       argvi++;
+%{
+static int
+val_t_to_sv(val_t *val, SV **results) {
+    if (!val) {
+       results[0] = &PL_sv_undef;
+       return 1;
     } else {
-       switch ($1->type) {
+       switch (val->type) {
            case CONFTYPE_RATE: {
-               $result= sv_newmortal();
-               sv_setnv($result, val_t__rate($1)[0]);
-               argvi++;
+               results[0] = sv_newmortal();
+               sv_setnv(results[0], val_t__rate(val)[0]);
 
-               $result= sv_newmortal();
-               sv_setnv($result, val_t__rate($1)[1]);
-               argvi++;
-               break;
+               results[1] = sv_newmortal();
+               sv_setnv(results[1], val_t__rate(val)[1]);
+               return 2;
            }
 
            case CONFTYPE_INTRANGE: {
-               $result= sv_newmortal();
-               sv_setiv($result, val_t__intrange($1)[0]);
-               argvi++;
+               results[0] = sv_newmortal();
+               sv_setiv(results[0], val_t__intrange(val)[0]);
 
-               $result= sv_newmortal();
-               sv_setiv($result, val_t__intrange($1)[1]);
-               argvi++;
-               break;
+               results[1] = sv_newmortal();
+               sv_setiv(results[1], val_t__intrange(val)[1]);
+               return 2;
            }
 
            case CONFTYPE_EXINCLUDE: {
@@ -368,7 +432,7 @@ amglue_copy_to_tag(data_path_t, getconf);
                 *      'optional' : 1,
                 * }
                 */
-               exinclude_t *ei = &val_t__exinclude($1);
+               exinclude_t *ei = &val_t__exinclude(val);
                AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
                AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
                SV *optional = sv_newmortal();
@@ -399,27 +463,21 @@ amglue_copy_to_tag(data_path_t, getconf);
                hv_store(hv, "optional", 8, optional, 0);
                SvREFCNT_inc(optional);
 
-               $result = sv_2mortal(newRV((SV *)hv));
-               argvi++;
-               break;
+               results[0] = sv_2mortal(newRV((SV *)hv));
+               return 1;
            }
 
            case CONFTYPE_PROPLIST:
-               $result = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist($1)));
-               argvi++;
-               break;
+               results[0] = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(val)));
+               return 1;
 
            case CONFTYPE_SIZE:
-               SP += argvi; PUTBACK;
-               $result = sv_2mortal(amglue_newSVi64(val_t__size($1)));
-               SPAGAIN; SP -= argvi; argvi++;
-               break;
+               results[0] = sv_2mortal(amglue_newSVi64(val_t__size(val)));
+               return 1;
 
            case CONFTYPE_INT64:
-               SP += argvi; PUTBACK;
-               $result = sv_2mortal(amglue_newSVi64(val_t__int64($1)));
-               SPAGAIN; SP -= argvi; argvi++;
-               break;
+               results[0] = sv_2mortal(amglue_newSVi64(val_t__int64(val)));
+               return 1;
 
            case CONFTYPE_BOOLEAN:          /* all same as INT.. */
            case CONFTYPE_COMPRESS:
@@ -432,58 +490,67 @@ amglue_copy_to_tag(data_path_t, getconf);
            case CONFTYPE_EXECUTE_WHERE:
            case CONFTYPE_SEND_AMREPORT_ON:
            case CONFTYPE_DATA_PATH:
+           case CONFTYPE_PART_CACHE_TYPE:
            case CONFTYPE_INT:
-               SP += argvi; PUTBACK;
-               $result = sv_2mortal(amglue_newSVi64(val_t__int($1)));
-               SPAGAIN; SP -= argvi; argvi++;
-               break;
+               results[0] = sv_2mortal(amglue_newSVi64(val_t__int(val)));
+               return 1;
 
            case CONFTYPE_ESTIMATELIST: {
                AV *elist = newAV();
                estimatelist_t el;
-               for (el=val_t__estimatelist($1); el != NULL; el = el->next) {
+               for (el=val_t__estimatelist(val); el != NULL; el = el->next) {
                    av_push(elist, newSVuv(GPOINTER_TO_INT(el->data)));
                }
-               $result = sv_2mortal(newRV_noinc((SV *)elist));
-               argvi++;
-               break;
+               results[0] = sv_2mortal(newRV_noinc((SV *)elist));
+               return 1;
            }
 
            case CONFTYPE_TIME:
-               SP += argvi; PUTBACK;
-               $result = sv_2mortal(amglue_newSVi64(val_t__time($1)));
-               SPAGAIN; SP -= argvi; argvi++;
-               break;
+               results[0] = sv_2mortal(amglue_newSVi64(val_t__time(val)));
+               return 1;
 
            case CONFTYPE_REAL:
-               $result = sv_newmortal();
-               sv_setnv($result, val_t__real($1));
-               argvi++;
-               break;
+               results[0] = sv_newmortal();
+               sv_setnv(results[0], val_t__real(val));
+               return 1;
 
            case CONFTYPE_IDENT:            /* same as STRING */
            case CONFTYPE_STR:
            case CONFTYPE_APPLICATION:
-               $result = sv_newmortal();
-               sv_setpv($result, val_t__str($1));
-               argvi++;
-               break;
+               results[0] = sv_newmortal();
+               sv_setpv(results[0], val_t__str(val));
+               return 1;
 
            case CONFTYPE_IDENTLIST: {
                AV *ilist = newAV();
 
                identlist_t il;
-               for (il=val_t__identlist($1); il != NULL; il = il->next) {
+               for (il=val_t__identlist(val); il != NULL; il = il->next) {
                    av_push(ilist, newSVpv((char *)il->data, 0));
                }
 
-               $result = sv_2mortal(newRV_noinc((SV *)ilist));
-               argvi++;
-               break;
+               results[0] = sv_2mortal(newRV_noinc((SV *)ilist));
+               return 1;
+           }
+
+           case CONFTYPE_RECOVERY_LIMIT: {
+               AV *av;
+               GSList *iter;
+               recovery_limit_t *rl = &val_t__recovery_limit(val);
+
+               av = newAV();
+               if (rl->same_host)
+                   av_push(av, &PL_sv_undef);
+               for (iter=rl->match_pats; iter != NULL; iter = iter->next) {
+                   av_push(av, newSVpv((char *)iter->data, 0));
+               }
+
+               results[0] = sv_2mortal(newRV_noinc((SV *)av));
+               return 1;
            }
 
            case CONFTYPE_AUTOLABEL: {
-               autolabel_t *autolabel = &val_t__autolabel($1);
+               autolabel_t *autolabel = &val_t__autolabel(val);
                HV *hv;
 
                /* now build the hash */
@@ -504,9 +571,8 @@ amglue_copy_to_tag(data_path_t, getconf);
                        (autolabel->autolabel & AL_EMPTY)? &PL_sv_yes : &PL_sv_no,
                        0);
 
-               $result = sv_2mortal(newRV((SV *)hv));
-               argvi++;
-               break;
+               results[0] = sv_2mortal(newRV((SV *)hv));
+               return 1;
            }
 
            /* No match yet -> not one of the "complex" types */
@@ -515,6 +581,28 @@ amglue_copy_to_tag(data_path_t, getconf);
                break;
        }
     }
+
+    return 0;
+
+fail:
+    SWIG_croak_null();
+}
+%}
+
+%typemap (out) val_t * {
+    SV *results[3], **iter;
+    int nresults;
+
+    /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+    SP += argvi; PUTBACK;
+    nresults = val_t_to_sv($1, results);
+    SPAGAIN; SP -= argvi;
+
+    /* add val_t_to_sv's results to the stack */
+    for (iter = results; nresults; iter++, nresults--) {
+       $result = *iter;
+       argvi++;
+    }
 }
 
 /* Typemap for the return value of getconf_list; this assumes that
@@ -781,3 +869,6 @@ sub string_to_boolean {
 %}
 
 amglue_export_ok(string_to_boolean);
+
+gchar * amandaify_property_name(const gchar *name);
+amglue_export_ok(amandaify_property_name);
diff --git a/perl/Amanda/Config/FoldingHash.pm b/perl/Amanda/Config/FoldingHash.pm
new file mode 100644 (file)
index 0000000..c105071
--- /dev/null
@@ -0,0 +1,48 @@
+package Amanda::Config::FoldingHash;
+use Tie::Hash;
+use base 'Tie::StdHash';
+use Amanda::Config;
+use Amanda::Debug;
+
+use strict;
+use warnings;
+
+sub new {
+    my ($class) = @_;
+
+    my %self;
+    tie(%self, $class);
+    return \%self;
+}
+
+sub _amandaify {
+    return Amanda::Config::amandaify_property_name(@_);
+}
+
+sub TIEHASH {
+    my ($class) = @_;
+    return bless({}, $class);
+}
+
+sub FETCH {
+    my ($self, $key) = @_;
+    my $am = _amandaify($key);
+    return $self->{_amandaify($key)};
+}
+
+sub STORE {
+    my ($self, $key, $value) = @_;
+    return $self->{_amandaify($key)} = $value;
+}
+
+sub EXISTS {
+    my ($self, $key) = @_;
+    return exists($self->{_amandaify($key)});
+}
+
+sub DELETE {
+    my ($self, $key) = @_;
+    return delete($self->{_amandaify($key)});
+}
+
+1;
index fe1a399df24907ba303870ed2be840b375e9ed40..f541ac503f312f525f12022216a84ed2cbe38078 100644 (file)
@@ -89,7 +89,9 @@ or C<"00000000000000"> for dumps in the holding disk.
 
 =item status
 
-(string) -- "OK", "PARTIAL", or "FAIL"
+(string) -- The status of the dump - "OK", "PARTIAL", or "FAIL".  If a disk
+failed to dump at all, then it is not part of the catalog and thus will not
+have an associated dump row.
 
 =item message
 
@@ -101,11 +103,12 @@ or C<"00000000000000"> for dumps in the holding disk.
 
 =item kb
 
-(integer) -- size (in kb) of this part
+(integer) -- size (in kb) of the dump on disk
 
 =item orig_kb
 
-(integer) -- size (in kb) of the complete dump (uncompress and uncrypted).
+(integer) -- size (in kb) of the complete dump (before compression or encryption); undef
+if not available
 
 =item sec
 
@@ -151,7 +154,7 @@ on-media dumps)
 
 =item status
 
-(string) -- "OK", "PARTIAL" or some other descriptor
+(string) -- The status of the part - "OK", "PARTIAL", or "FAILED".
 
 =item partnum
 
@@ -208,10 +211,21 @@ Get a list of all write timestamps, sorted in chronological order.
 
 Return the most recent write timestamp.
 
+=item get_latest_write_timestamp(type => 'amvault')
+=item get_latest_write_timestamp(types => [ 'amvault', .. ])
+
+Return the timestamp of the most recent dump of the given type or types.  The
+available types are given below for C<get_run_type>.
+
 =item get_labels_written_at_timestamp($ts)
 
 Return a list of labels for volumes written at the given timestamp.
 
+=item get_run_type($ts)
+
+Return the type of run made at the given timestamp.  The result is one of
+C<amvault>, C<amdump>, C<amflush>, or the default, C<unknown>.
+
 =back
 
 =head2 PARTS
@@ -351,9 +365,9 @@ access those values via the C<dump> attribute.
 
 This function returns a sequence of dumps.  Values in C<%parameters> restrict
 the set of dumps that are returned.  The same keys as are used for C<get_parts>
-are available here, with the exception of C<label> and C<labels>.  The
-C<status> key applies to the dump status, not the status of its constituent
-parts.
+are available here, with the exception of C<label> and C<labels>.  In this
+case, the C<status> parameter applies to the dump status, not the status of its
+constituent parts.
 
 =item sort_dumps([ $key1, $key2 ], @dumps)
 
@@ -388,12 +402,12 @@ use Amanda::Logfile qw( :constants match_disk match_host
 use Amanda::Tapelist;
 use Amanda::Config qw( :init :getconf config_dir_relative );
 use Amanda::Util qw( quote_string weaken_ref );
+use File::Glob qw( :glob );
 use warnings;
 use strict;
 
 # tapelist cache
 my $tapelist = undef;
-my $tapelist_filename = undef;
 
 # utility function
 sub zeropad {
@@ -419,16 +433,60 @@ sub get_write_timestamps {
 }
 
 sub get_latest_write_timestamp {
+    my %params = @_;
+
+    if ($params{'type'}) {
+       push @{$params{'types'}}, $params{'type'};
+    }
+
     # get all of the timestamps and select the last one
     my @timestamps = get_write_timestamps();
 
     if (@timestamps) {
-       return $timestamps[-1];
+       # if we're not looking for a particular type, then this is easy
+       if (!exists $params{'types'}) {
+           return $timestamps[-1];
+       }
+
+       # otherwise we need to search backward until we find a logfile of
+       # the right type
+       while (@timestamps) {
+           my $ts = pop @timestamps;
+           my $typ = get_run_type($ts);
+           if (grep { $_ eq $typ } @{$params{'types'}}) {
+               return $ts;
+           }
+       }
     }
 
     return undef;
 }
 
+sub get_run_type {
+    my ($write_timestamp) = @_;
+
+    # find all of the logfiles with that name
+    my $logdir = getconf($CNF_LOGDIR);
+    my @matches = File::Glob::bsd_glob("$logdir/log.$write_timestamp.*", GLOB_NOSORT);
+    if ($write_timestamp =~ /000000$/) {
+       my $write_datestamp = substr($write_timestamp, 0, 8);
+       push @matches, File::Glob::bsd_glob("$logdir/log.$write_datestamp.*", GLOB_NOSORT);
+    }
+
+    for my $lf (@matches) {
+       open(my $fh, "<", $lf) or next;
+       while (<$fh>) {
+           # amflush and amvault put their own names in
+           return $1 if (/^START (amflush|amvault)/);
+           # but for amdump we see planner
+           return 'amdump' if (/^START planner/);
+       }
+    }
+
+    return "unknown";
+}
+
+
 # this generic function implements the loop of scanning logfiles to find
 # the requested data; get_parts and get_dumps then adjust the results to
 # match what the user expects.
@@ -560,6 +618,7 @@ sub get_parts_and_dumps {
                and !exists($labels_hash{$find_result->{'label'}}));
            if ($get_what eq 'parts') {
                next if (exists($params{'status'}) 
+                   and defined $find_result->{'status'}
                    and $find_result->{'status'} ne $params{'status'});
            }
 
@@ -572,7 +631,7 @@ sub get_parts_and_dumps {
            my $dump_timestamp = zeropad($find_result->{'timestamp'});
 
            my $dumpkey = join("\0", $find_result->{'hostname'}, $find_result->{'diskname'},
-                                    $write_timestamp, $find_result->{'level'});
+                                    $write_timestamp, $find_result->{'level'}, $dump_timestamp);
            my $dump = $dumps{$dumpkey};
            if (!defined $dump) {
                $dump = $dumps{$dumpkey} = {
@@ -601,7 +660,7 @@ sub get_parts_and_dumps {
                    label => $find_result->{'label'},
                    filenum => $find_result->{'filenum'},
                    dump => $dump,
-                   status => $find_result->{'status'},
+                   status => $find_result->{'status'} || 'FAILED',
                    sec => $find_result->{'sec'},
                    kb => $find_result->{'kb'},
                    orig_kb => $find_result->{'orig_kb'},
@@ -612,14 +671,14 @@ sub get_parts_and_dumps {
                %part = (
                    holding_file => $find_result->{'label'},
                    dump => $dump,
-                   status => $find_result->{'status'},
+                   status => $find_result->{'status'} || 'FAILED',
                    sec => 0.0,
                    kb => $find_result->{'kb'},
                    orig_kb => $find_result->{'orig_kb'},
                    partnum => 1,
                );
                # and fix up the dump, too
-               $dump->{'status'} = $find_result->{'status'};
+               $dump->{'status'} = $find_result->{'status'} || 'FAILED';
                $dump->{'kb'} = $find_result->{'kb'};
                $dump->{'sec'} = $find_result->{'sec'};
            }
@@ -656,6 +715,8 @@ sub get_parts_and_dumps {
                $status = 'PARTIAL';
            } elsif ($type == $L_FAIL) {
                $status = 'FAIL';
+           } elsif ($type == $L_SUCCESS) {
+               $status = "OK";
            } else {
                next;
            }
@@ -666,7 +727,7 @@ sub get_parts_and_dumps {
            ($hostname, $str) = Amanda::Util::skip_quoted_string($str);
            ($diskname, $str) = Amanda::Util::skip_quoted_string($str);
            ($dump_timestamp, $str) = Amanda::Util::skip_quoted_string($str);
-           if ($status ne 'FAIL') {
+           if ($status ne 'FAIL' and $type != $L_SUCCESS) { # nparts is not in SUCCESS lines
                ($nparts, $str) = Amanda::Util::skip_quoted_string($str);
            } else {
                $nparts = 0;
@@ -674,8 +735,9 @@ sub get_parts_and_dumps {
            ($level, $str) = Amanda::Util::skip_quoted_string($str);
            if ($status ne 'FAIL') {
                my $s = $str;
-               ($secs, $kb, $str) = ($str =~ /^\[sec ([0-9.]+) kb (\d+) .*\] ?(.*)$/)
+               ($secs, $kb, $str) = ($str =~ /^\[sec ([-0-9.]+) kb (\d+).*\] ?(.*)$/)
                    or die("'$s'");
+               $secs = 0.1 if ($secs <= 0);
            }
            if ($status ne 'OK') {
                $message = $str;
@@ -720,24 +782,31 @@ sub get_parts_and_dumps {
                            and !match_datestamp("".$ds->{'datestamp'}, $dump_timestamp));
                    next if (defined $ds->{'level'}
                            and !match_level("".$ds->{'level'}, $level));
-
+                   next if (defined $ds->{'write_timestamp'}
+                            and !match_datestamp("".$ds->{'write_timestamp'}, $write_timestamp));
                    $ok = 1;
                    last;
                }
                next unless $ok;
            }
 
-           my $dumpkey = join("\0", $hostname, $diskname, $write_timestamp, $level);
+           my $dumpkey = join("\0", $hostname, $diskname, $write_timestamp,
+                                    $level, zeropad($dump_timestamp));
            my $dump = $dumps{$dumpkey};
            if (!defined $dump) {
                # this will happen when a dump has no parts - a FAILed dump.
                $dump = $dumps{$dumpkey} = {
-                   dump_timestamp => $dump_timestamp,
+                   dump_timestamp => zeropad($dump_timestamp),
                    write_timestamp => $write_timestamp,
                    hostname => $hostname,
                    diskname => $diskname,
                    level => $level+0,
+                   orig_kb => undef,
+                   status => "FAILED",
+                   # message set below
                    nparts => $nparts, # hopefully 0?
+                   # kb set below
+                   # sec set below
                };
            }
 
@@ -932,19 +1001,20 @@ sub add_part {
        print $logfh
            "START taper datestamp $write_timestamp label $dump->{label} tape $i\n";
 
-       if (!defined $tapelist_filename) {
-           $tapelist_filename = config_dir_relative(getconf($CNF_TAPELIST));
+       if (!defined $tapelist) {
+           _load_tapelist();
+       } else {
+           # reload the tapelist immediately, in case it's been modified
+           $tapelist->reload();
        }
 
-       # reload the tapelist immediately, in case it's been modified
-       $tapelist = Amanda::Tapelist::read_tapelist($tapelist_filename);
-
        # see if we need to add an entry to the tapelist for this dump
        if (!grep { $_->{'label'} eq $dump->{'label'}
                    and zeropad($_->{'datestamp'}) eq zeropad($dump->{'write_timestamp'})
-               } @$tapelist) {
-           $tapelist->add_tapelabel($write_timestamp, $dump->{'label'});
-           $tapelist->write($tapelist_filename);
+               } @{$tapelist->{tles}}) {
+           $tapelist->reload(1);
+           $tapelist->add_tapelabel($write_timestamp, $dump->{'label'}, undef, 1);
+           $tapelist->write();
        }
     }
 
@@ -989,13 +1059,13 @@ sub add_part {
 
 sub _load_tapelist {
     if (!defined $tapelist) {
-       $tapelist_filename = config_dir_relative(getconf($CNF_TAPELIST));
-       $tapelist = Amanda::Tapelist::read_tapelist($tapelist_filename);
+       my $tapelist_filename = config_dir_relative(getconf($CNF_TAPELIST));
+       $tapelist = Amanda::Tapelist->new($tapelist_filename);
     }
 }
 
 sub _clear_cache { # (used by installcheck)
-    $tapelist = $tapelist_filename = undef;
+    $tapelist = undef;
 }
 
 1;
index 5943b6d828c0f9d126f37f5b4a4ab21693a0d5b2..c4876fcf3323b9fcfa24f96e8c5802681c56241d 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
index 2ece643b489f70b6c6d1813cb51a917289081fdb..bb3a19d022171735cc56bde5a8b900a415cd2dd5 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -1476,22 +1479,23 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 
 #define SWIGTYPE_p_Device swig_types[0]
 #define SWIGTYPE_p_DevicePropertyBase swig_types[1]
-#define SWIGTYPE_p_DirectTCPConnection swig_types[2]
-#define SWIGTYPE_p_GSList swig_types[3]
-#define SWIGTYPE_p_GValue swig_types[4]
-#define SWIGTYPE_p_a_STRMAX__char swig_types[5]
-#define SWIGTYPE_p_char swig_types[6]
-#define SWIGTYPE_p_double swig_types[7]
-#define SWIGTYPE_p_dumpfile_t swig_types[8]
-#define SWIGTYPE_p_float swig_types[9]
-#define SWIGTYPE_p_guint swig_types[10]
-#define SWIGTYPE_p_guint64 swig_types[11]
-#define SWIGTYPE_p_int swig_types[12]
-#define SWIGTYPE_p_p_DirectTCPAddr swig_types[13]
-#define SWIGTYPE_p_queue_fd_t swig_types[14]
-#define SWIGTYPE_p_unsigned_char swig_types[15]
-static swig_type_info *swig_types[17];
-static swig_module_info swig_module = {swig_types, 16, 0, 0, 0, 0};
+#define SWIGTYPE_p_DirectTCPAddr swig_types[2]
+#define SWIGTYPE_p_DirectTCPConnection swig_types[3]
+#define SWIGTYPE_p_GSList swig_types[4]
+#define SWIGTYPE_p_GValue swig_types[5]
+#define SWIGTYPE_p_a_STRMAX__char swig_types[6]
+#define SWIGTYPE_p_char swig_types[7]
+#define SWIGTYPE_p_double swig_types[8]
+#define SWIGTYPE_p_dumpfile_t swig_types[9]
+#define SWIGTYPE_p_float swig_types[10]
+#define SWIGTYPE_p_guint swig_types[11]
+#define SWIGTYPE_p_guint32 swig_types[12]
+#define SWIGTYPE_p_guint64 swig_types[13]
+#define SWIGTYPE_p_int swig_types[14]
+#define SWIGTYPE_p_p_DirectTCPAddr swig_types[15]
+#define SWIGTYPE_p_unsigned_char swig_types[16]
+static swig_type_info *swig_types[18];
+static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0};
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
@@ -1537,6 +1541,7 @@ SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
 #include "property.h"
 #include "fileheader.h"
 #include "glib-util.h"
+#include "simpleprng.h"
 
 
 
@@ -1566,30 +1571,6 @@ set_sv_from_gvalue(GValue *value)
 
        case G_TYPE_UINT64:
            return sv_2mortal(amglue_newSVu64(g_value_get_uint64(value)));
-
-       case G_TYPE_BOXED: {
-           GType boxed_type = G_VALUE_TYPE(value);
-           QualifiedSize qs;
-           HV *hv;
-
-           if (boxed_type == QUALIFIED_SIZE_TYPE) {
-               qs = *(QualifiedSize*)(g_value_get_boxed(value));
-
-               /* build a hash */
-               hv = (HV *)sv_2mortal((SV *)newHV());
-               hv_store(hv, "accuracy", 8, newSViv(qs.accuracy), 0);
-               hv_store(hv, "bytes", 5, amglue_newSVi64(qs.bytes), 0);
-
-               sv = newRV((SV *)hv);
-               return newRV((SV *)hv);
-           } else {
-               warn("Unsupported boxed property type #%d", (int)boxed_type);
-
-               sv = sv_newmortal();
-               sv_setsv(sv, &PL_sv_undef);
-               return sv;
-           }
-       }
     }
 
     /* simple types that can be constructed with sv_set*v */
@@ -1761,6 +1742,68 @@ SWIG_FromCharPtr(const char *cptr)
 }
 
 
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (SvMAGICAL(obj)) {
+     SV *tmp = sv_newmortal();
+     SvSetSV(tmp, obj);
+     obj = tmp;
+  }
+  if (SvPOK(obj)) {
+    STRLEN len = 0;
+    char *cstr = SvPV(obj, len); 
+    size_t size = len + 1;
+    if (cptr)  {
+      if (alloc) {
+       if (*alloc == SWIG_NEWOBJ) {
+         *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+       } else {
+         *cptr = cstr;
+         *alloc = SWIG_OLDOBJ;
+       }
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      char* vptr = 0; 
+      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
+       if (cptr) *cptr = vptr;
+       if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+       if (alloc) *alloc = SWIG_OLDOBJ;
+       return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+SWIGINTERN Device *new_Device(char *device_name){
+           return device_open(device_name);
+       }
+SWIGINTERN void delete_Device(Device *self){
+           g_object_unref(self);
+       }
+
 #include <limits.h>
 #if !defined(SWIG_NO_LLONG_MAX)
 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
@@ -1888,75 +1931,6 @@ SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
   return res;
 }
 
-SWIGINTERN queue_fd_t *new_queue_fd_t(int fd){
-           return queue_fd_new(fd, NULL);
-       }
-SWIGINTERN void delete_queue_fd_t(queue_fd_t *self){
-           amfree(self->errmsg);
-           g_free(self);
-       }
-
-SWIGINTERN swig_type_info*
-SWIG_pchar_descriptor(void)
-{
-  static int init = 0;
-  static swig_type_info* info = 0;
-  if (!init) {
-    info = SWIG_TypeQuery("_p_char");
-    init = 1;
-  }
-  return info;
-}
-
-
-SWIGINTERN int
-SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
-{
-  if (SvMAGICAL(obj)) {
-     SV *tmp = sv_newmortal();
-     SvSetSV(tmp, obj);
-     obj = tmp;
-  }
-  if (SvPOK(obj)) {
-    STRLEN len = 0;
-    char *cstr = SvPV(obj, len); 
-    size_t size = len + 1;
-    if (cptr)  {
-      if (alloc) {
-       if (*alloc == SWIG_NEWOBJ) {
-         *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
-       } else {
-         *cptr = cstr;
-         *alloc = SWIG_OLDOBJ;
-       }
-      }
-    }
-    if (psize) *psize = size;
-    return SWIG_OK;
-  } else {
-    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
-    if (pchar_descriptor) {
-      char* vptr = 0; 
-      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
-       if (cptr) *cptr = vptr;
-       if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
-       if (alloc) *alloc = SWIG_OLDOBJ;
-       return SWIG_OK;
-      }
-    }
-  }
-  return SWIG_TypeError;
-}
-
-
-
-
-SWIGINTERN Device *new_Device(char *device_name){
-           return device_open(device_name);
-       }
-SWIGINTERN void delete_Device(Device *self){
-           g_object_unref(self);
-       }
 SWIGINTERN gboolean Device_configure(Device *self,gboolean use_global_config){
            return device_configure(self, use_global_config);
        }
@@ -1984,9 +1958,6 @@ SWIGINTERN gboolean Device_start_file(Device *self,dumpfile_t *jobInfo){
 SWIGINTERN gboolean Device_write_block(Device *self,guint size,gpointer data){
            return device_write_block(self, size, data);
        }
-SWIGINTERN gboolean Device_write_from_fd(Device *self,queue_fd_t *queue_fd){
-           return device_write_from_fd(self, queue_fd);
-       }
 SWIGINTERN gboolean Device_finish_file(Device *self){
            return device_finish_file(self);
        }
@@ -1999,9 +1970,6 @@ SWIGINTERN gboolean Device_seek_block(Device *self,guint64 block){
 SWIGINTERN int Device_read_block(Device *self,gpointer buffer,int *size){
            return device_read_block(self, buffer, size);
        }
-SWIGINTERN gboolean Device_read_to_fd(Device *self,queue_fd_t *queue_fd){
-           return device_read_to_fd(self, queue_fd);
-       }
 SWIGINTERN gboolean Device_erase(Device *self){
            return device_erase(self);
        }
@@ -2028,6 +1996,18 @@ SWIGINTERN DirectTCPConnection *Device_accept(Device *self){
            }
            return conn;
        }
+SWIGINTERN DirectTCPConnection *Device_connect(Device *self,gboolean for_writing,DirectTCPAddr *addrs){
+           DirectTCPConnection *conn = NULL;
+           gboolean rv;
+
+           rv = device_connect(self, for_writing, addrs, &conn, NULL, NULL);
+           if (!rv && conn) {
+               /* conn is ref'd for our convenience, but we don't want it */
+               g_object_unref(conn);
+               conn = NULL;
+           }
+           return conn;
+       }
 SWIGINTERN gboolean Device_use_connection(Device *self,DirectTCPConnection *conn){
            return device_use_connection(self, conn);
        }
@@ -2041,7 +2021,11 @@ SWIGINTERN GSList const *Device_property_list(Device *self){
            return device_property_get_list(self);
        }
 SWIGINTERN void Device_property_get(Device *self,DevicePropertyBase *pbase,GValue *out_val,PropertySurety *surety,PropertySource *source,gboolean *val_found){
-           *val_found = device_property_get_ex(self, pbase->ID, out_val, surety, source);
+           if (pbase) {
+               *val_found = device_property_get_ex(self, pbase->ID, out_val, surety, source);
+           } else {
+               *val_found = FALSE;
+           }
        }
 SWIGINTERN gboolean Device_property_set(Device *self,DevicePropertyBase *pbase,SV *sv){
            GValue gval;
@@ -2093,6 +2077,136 @@ SWIGINTERN gsize Device_max_block_size(Device *self){ return self->max_block_siz
 SWIGINTERN gsize Device_block_size(Device *self){ return self->block_size; }
 SWIGINTERN dumpfile_t *Device_volume_header(Device *self){ return self->volume_header; }
 
+
+/* write LENGTH bytes of random data to FILENAME, seeded with SEED */
+gboolean
+write_random_to_device(guint32 seed, size_t length, Device *device) {
+    simpleprng_state_t prng;
+    char *buf;
+    gsize block_size = device->block_size;
+    g_assert(block_size < G_MAXUINT);
+
+    buf = g_malloc(block_size);
+    simpleprng_seed(&prng, seed);
+
+    while (length) {
+       size_t to_write = min(block_size, length);
+
+       simpleprng_fill_buffer(&prng, buf, to_write);
+       if (!device_write_block(device, (guint)block_size, buf)) {
+           g_free(buf);
+           return FALSE;
+       }
+       length -= to_write;
+    }
+
+    g_free(buf);
+    return TRUE;
+}
+
+/* read LENGTH bytes of random data from FILENAME verifying it against
+ * a PRNG seeded with SEED.  Sends any error messages to stderr.
+ */
+gboolean
+verify_random_from_device(guint32 seed, size_t length, Device *device) {
+    simpleprng_state_t prng;
+    char *buf = NULL; /* first device_read_block will get the size */
+    int block_size = 0;
+
+    simpleprng_seed(&prng, seed);
+
+    while (length) {
+       int bytes_read;
+       int size = block_size;
+
+       bytes_read = device_read_block(device, buf, &size);
+       if (bytes_read == 0 && size > block_size) {
+           g_free(buf);
+           block_size = size;
+           buf = g_malloc(block_size);
+           continue;
+       }
+       if (bytes_read == -1) {
+           if (device->status == DEVICE_STATUS_SUCCESS) {
+               g_assert(device->is_eof);
+               g_debug("verify_random_from_device got unexpected EOF");
+           }
+           goto error;
+       }
+
+       /* strip padding */
+       bytes_read = min(bytes_read, length);
+
+       if (!simpleprng_verify_buffer(&prng, buf, bytes_read))
+           goto error;
+
+       length -= bytes_read;
+    }
+
+    g_free(buf);
+    return TRUE;
+
+error:
+    g_free(buf);
+    return FALSE;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) 
+{
+  if (SvUOK(obj)) {
+    if (val) *val = SvUV(obj);
+    return SWIG_OK;
+  } else  if (SvIOK(obj)) {
+    long v = SvIV(obj);
+    if (v >= 0) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      return SWIG_OverflowError;
+    }
+  } else {
+    int dispatch = 0;
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      unsigned long v;
+      errno = 0;
+      v = strtoul(nptr, &endptr,0);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+       if (val) *val = (unsigned long)(d);
+       return res;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
+{
+  unsigned long v;
+  int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
+  if (SWIG_IsOK(res) && val) *val = (size_t)(v);
+  return res;
+}
+
+
 SWIGINTERNINLINE SV *
 SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
 {    
@@ -2173,147 +2287,18 @@ XS(_wrap_DirectTCPConnection_close) {
     char *result = 0 ;
     dXSARGS;
     
-    if ((items < 1) || (items > 1)) {
-      SWIG_croak("Usage: DirectTCPConnection_close(self);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_DirectTCPConnection, 0 |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirectTCPConnection_close" "', argument " "1"" of type '" "DirectTCPConnection *""'"); 
-    }
-    arg1 = (DirectTCPConnection *)(argp1);
-    result = (char *)DirectTCPConnection_close(arg1);
-    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
-    
-    free((char*)result);
-    XSRETURN(argvi);
-  fail:
-    
-    SWIG_croak_null();
-  }
-}
-
-
-XS(_wrap_new_DirectTCPConnection) {
-  {
-    int argvi = 0;
-    DirectTCPConnection *result = 0 ;
-    dXSARGS;
-    
-    if ((items < 0) || (items > 0)) {
-      SWIG_croak("Usage: new_DirectTCPConnection();");
-    }
-    result = (DirectTCPConnection *)calloc(1, sizeof(DirectTCPConnection));
-    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
-    XSRETURN(argvi);
-  fail:
-    SWIG_croak_null();
-  }
-}
-
-
-XS(_wrap_queue_fd_t_fd_get) {
-  {
-    queue_fd_t *arg1 = (queue_fd_t *) 0 ;
-    void *argp1 = 0 ;
-    int res1 = 0 ;
-    int argvi = 0;
-    int result;
-    dXSARGS;
-    
-    if ((items < 1) || (items > 1)) {
-      SWIG_croak("Usage: queue_fd_t_fd_get(self);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_queue_fd_t, 0 |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "queue_fd_t_fd_get" "', argument " "1"" of type '" "queue_fd_t *""'"); 
-    }
-    arg1 = (queue_fd_t *)(argp1);
-    result = (int) ((arg1)->fd);
-    {
-      SV *for_stack;
-      SP += argvi; PUTBACK;
-      for_stack = sv_2mortal(amglue_newSVi64(result));
-      SPAGAIN; SP -= argvi;
-      ST(argvi) = for_stack;
-      argvi++;
-    }
-    
-    XSRETURN(argvi);
-  fail:
-    
-    SWIG_croak_null();
-  }
-}
-
-
-XS(_wrap_queue_fd_t_errmsg_get) {
-  {
-    queue_fd_t *arg1 = (queue_fd_t *) 0 ;
-    void *argp1 = 0 ;
-    int res1 = 0 ;
-    int argvi = 0;
-    char *result = 0 ;
-    dXSARGS;
-    
-    if ((items < 1) || (items > 1)) {
-      SWIG_croak("Usage: queue_fd_t_errmsg_get(self);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_queue_fd_t, 0 |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "queue_fd_t_errmsg_get" "', argument " "1"" of type '" "queue_fd_t *""'"); 
-    }
-    arg1 = (queue_fd_t *)(argp1);
-    result = (char *) ((arg1)->errmsg);
-    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
-    
-    XSRETURN(argvi);
-  fail:
-    
-    SWIG_croak_null();
-  }
-}
-
-
-XS(_wrap_new_queue_fd_t) {
-  {
-    int arg1 ;
-    int argvi = 0;
-    queue_fd_t *result = 0 ;
-    dXSARGS;
-    
-    if ((items < 1) || (items > 1)) {
-      SWIG_croak("Usage: new_queue_fd_t(fd);");
-    }
-    {
-      IO *io = NULL;
-      PerlIO *pio = NULL;
-      int fd = -1;
-      
-      if (SvIOK(ST(0))) {
-        /* plain old integer */
-        arg1 = SvIV(ST(0));
-      } else {
-        /* try extracting as filehandle */
-        
-        /* note: sv_2io may call die() */
-        io = sv_2io(ST(0));
-        if (io) {
-          pio = IoIFP(io);
-        }
-        if (pio) {
-          fd = PerlIO_fileno(pio);
-        }
-        if (fd >= 0) {
-          arg1 = fd;
-        } else {
-          SWIG_exception(SWIG_TypeError, "Expected integer file descriptor "
-            "or file handle for argument 1");
-        }
-      }
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: DirectTCPConnection_close(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_DirectTCPConnection, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirectTCPConnection_close" "', argument " "1"" of type '" "DirectTCPConnection *""'"); 
     }
-    result = (queue_fd_t *)new_queue_fd_t(arg1);
-    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_queue_fd_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+    arg1 = (DirectTCPConnection *)(argp1);
+    result = (char *)DirectTCPConnection_close(arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
     
+    free((char*)result);
     XSRETURN(argvi);
   fail:
     
@@ -2322,28 +2307,19 @@ XS(_wrap_new_queue_fd_t) {
 }
 
 
-XS(_wrap_delete_queue_fd_t) {
+XS(_wrap_new_DirectTCPConnection) {
   {
-    queue_fd_t *arg1 = (queue_fd_t *) 0 ;
-    void *argp1 = 0 ;
-    int res1 = 0 ;
     int argvi = 0;
+    DirectTCPConnection *result = 0 ;
     dXSARGS;
     
-    if ((items < 1) || (items > 1)) {
-      SWIG_croak("Usage: delete_queue_fd_t(self);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_queue_fd_t, SWIG_POINTER_DISOWN |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_queue_fd_t" "', argument " "1"" of type '" "queue_fd_t *""'"); 
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: new_DirectTCPConnection();");
     }
-    arg1 = (queue_fd_t *)(argp1);
-    delete_queue_fd_t(arg1);
-    ST(argvi) = sv_newmortal();
-    
+    result = (DirectTCPConnection *)calloc(1, sizeof(DirectTCPConnection));
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
     XSRETURN(argvi);
   fail:
-    
     SWIG_croak_null();
   }
 }
@@ -2453,17 +2429,7 @@ XS(_wrap_Device_configure) {
     }
     arg1 = (Device *)(argp1);
     {
-      if (sizeof(signed int) == 1) {
-        arg2 = amglue_SvI8(ST(1));
-      } else if (sizeof(signed int) == 2) {
-        arg2 = amglue_SvI16(ST(1));
-      } else if (sizeof(signed int) == 4) {
-        arg2 = amglue_SvI32(ST(1));
-      } else if (sizeof(signed int) == 8) {
-        arg2 = amglue_SvI64(ST(1));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg2 = SvTRUE(ST(1));
     }
     result = (gboolean)Device_configure(arg1,arg2);
     {
@@ -2809,50 +2775,6 @@ XS(_wrap_Device_write_block) {
 }
 
 
-XS(_wrap_Device_write_from_fd) {
-  {
-    Device *arg1 = (Device *) 0 ;
-    queue_fd_t *arg2 = (queue_fd_t *) 0 ;
-    void *argp1 = 0 ;
-    int res1 = 0 ;
-    void *argp2 = 0 ;
-    int res2 = 0 ;
-    int argvi = 0;
-    gboolean result;
-    dXSARGS;
-    
-    if ((items < 2) || (items > 2)) {
-      SWIG_croak("Usage: Device_write_from_fd(self,queue_fd);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_from_fd" "', argument " "1"" of type '" "Device *""'"); 
-    }
-    arg1 = (Device *)(argp1);
-    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_queue_fd_t, 0 |  0 );
-    if (!SWIG_IsOK(res2)) {
-      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_write_from_fd" "', argument " "2"" of type '" "queue_fd_t *""'"); 
-    }
-    arg2 = (queue_fd_t *)(argp2);
-    result = (gboolean)Device_write_from_fd(arg1,arg2);
-    {
-      if (result)
-      ST(argvi) = &PL_sv_yes;
-      else
-      ST(argvi) = &PL_sv_no;
-      argvi++;
-    }
-    
-    
-    XSRETURN(argvi);
-  fail:
-    
-    
-    SWIG_croak_null();
-  }
-}
-
-
 XS(_wrap_Device_finish_file) {
   {
     Device *arg1 = (Device *) 0 ;
@@ -3020,50 +2942,6 @@ XS(_wrap_Device_read_block) {
 }
 
 
-XS(_wrap_Device_read_to_fd) {
-  {
-    Device *arg1 = (Device *) 0 ;
-    queue_fd_t *arg2 = (queue_fd_t *) 0 ;
-    void *argp1 = 0 ;
-    int res1 = 0 ;
-    void *argp2 = 0 ;
-    int res2 = 0 ;
-    int argvi = 0;
-    gboolean result;
-    dXSARGS;
-    
-    if ((items < 2) || (items > 2)) {
-      SWIG_croak("Usage: Device_read_to_fd(self,queue_fd);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_to_fd" "', argument " "1"" of type '" "Device *""'"); 
-    }
-    arg1 = (Device *)(argp1);
-    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_queue_fd_t, 0 |  0 );
-    if (!SWIG_IsOK(res2)) {
-      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_read_to_fd" "', argument " "2"" of type '" "queue_fd_t *""'"); 
-    }
-    arg2 = (queue_fd_t *)(argp2);
-    result = (gboolean)Device_read_to_fd(arg1,arg2);
-    {
-      if (result)
-      ST(argvi) = &PL_sv_yes;
-      else
-      ST(argvi) = &PL_sv_no;
-      argvi++;
-    }
-    
-    
-    XSRETURN(argvi);
-  fail:
-    
-    
-    SWIG_croak_null();
-  }
-}
-
-
 XS(_wrap_Device_erase) {
   {
     Device *arg1 = (Device *) 0 ;
@@ -3190,17 +3068,7 @@ XS(_wrap_Device_listen) {
     }
     arg1 = (Device *)(argp1);
     {
-      if (sizeof(signed int) == 1) {
-        arg2 = amglue_SvI8(ST(1));
-      } else if (sizeof(signed int) == 2) {
-        arg2 = amglue_SvI16(ST(1));
-      } else if (sizeof(signed int) == 4) {
-        arg2 = amglue_SvI32(ST(1));
-      } else if (sizeof(signed int) == 8) {
-        arg2 = amglue_SvI64(ST(1));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg2 = SvTRUE(ST(1));
     }
     Device_listen(arg1,arg2,arg3);
     ST(argvi) = sv_newmortal();
@@ -3269,6 +3137,83 @@ XS(_wrap_Device_accept) {
 }
 
 
+XS(_wrap_Device_connect) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    gboolean arg2 ;
+    DirectTCPAddr *arg3 = (DirectTCPAddr *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    DirectTCPConnection *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 3) || (items > 3)) {
+      SWIG_croak("Usage: Device_connect(self,for_writing,addrs);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_connect" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      arg2 = SvTRUE(ST(1));
+    }
+    {
+      AV *addrs_av;
+      int num_addrs, i;
+      
+      if (!SvROK(ST(2)) || SvTYPE(SvRV(ST(2))) != SVt_PVAV) {
+        SWIG_exception_fail(SWIG_TypeError, "must provide an arrayref of DirectTCPAddrs");
+      }
+      addrs_av = (AV *)SvRV(ST(2));
+      num_addrs = av_len(addrs_av)+1;
+      
+      arg3 = g_new0(DirectTCPAddr, num_addrs+1);
+      
+      for (i = 0; i < num_addrs; i++) {
+        SV **svp = av_fetch(addrs_av, i, 0);
+        AV *addr_av;
+        struct in_addr addr;
+        IV port;
+        
+        if (!svp || !SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVAV
+          || av_len((AV *)SvRV(*svp))+1 != 2) {
+          SWIG_exception_fail(SWIG_TypeError, "each DirectTCPAddr must be a 2-element arrayref");
+        }
+        
+        addr_av = (AV *)SvRV(*svp);
+        
+        /* get address */
+        svp = av_fetch(addr_av, 0, 0);
+        if (!svp || !SvPOK(*svp) || !inet_aton(SvPV_nolen(*svp), &addr)) {
+          SWIG_exception_fail(SWIG_TypeError, "invalid IPv4 addr in address");
+        }
+        arg3[i].ipv4 = ntohl(addr.s_addr);
+        
+        /* get port */
+        svp = av_fetch(addr_av, 1, 0);
+        if (!svp || !SvIOK(*svp) || (port = SvIV(*svp)) <= 0 || port >= 65536) {
+          SWIG_exception_fail(SWIG_TypeError, "invalid port in address");
+        }
+        arg3[i].port = (guint16)port;
+      }
+    }
+    result = (DirectTCPConnection *)Device_connect(arg1,arg2,arg3);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_Device_use_connection) {
   {
     Device *arg1 = (Device *) 0 ;
@@ -3508,10 +3453,10 @@ XS(_wrap_Device_property_get) {
       if (SvPOK(ST(1)))
       pname = SvPV_nolen(ST(1));
       
-      if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
-      if (!pname || !arg2) {
-        SWIG_exception_fail(SWIG_ValueError, "Invalid property name");
-      }
+      if (pname)
+      arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
+      else
+      arg2 = NULL;
     }
     Device_property_get(arg1,arg2,arg3,arg4,arg5,arg6);
     ST(argvi) = sv_newmortal();
@@ -3572,10 +3517,10 @@ XS(_wrap_Device_property_set) {
       if (SvPOK(ST(1)))
       pname = SvPV_nolen(ST(1));
       
-      if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
-      if (!pname || !arg2) {
-        SWIG_exception_fail(SWIG_ValueError, "Invalid property name");
-      }
+      if (pname)
+      arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
+      else
+      arg2 = NULL;
     }
     arg3 = ST(2);
     result = (gboolean)Device_property_set(arg1,arg2,arg3);
@@ -3626,10 +3571,10 @@ XS(_wrap_Device_property_set_ex) {
       if (SvPOK(ST(1)))
       pname = SvPV_nolen(ST(1));
       
-      if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
-      if (!pname || !arg2) {
-        SWIG_exception_fail(SWIG_ValueError, "Invalid property name");
-      }
+      if (pname)
+      arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
+      else
+      arg2 = NULL;
     }
     arg3 = ST(2);
     {
@@ -4239,6 +4184,114 @@ XS(_wrap_rait_device_open_from_children) {
 }
 
 
+XS(_wrap_write_random_to_device) {
+  {
+    guint32 arg1 ;
+    size_t arg2 ;
+    Device *arg3 = (Device *) 0 ;
+    void *argp3 = 0 ;
+    int res3 = 0 ;
+    int argvi = 0;
+    gboolean result;
+    dXSARGS;
+    
+    if ((items < 3) || (items > 3)) {
+      SWIG_croak("Usage: write_random_to_device(seed,length,device);");
+    }
+    {
+      arg1 = amglue_SvU32(ST(0));
+    }
+    {
+      if (sizeof(size_t) == 1) {
+        arg2 = amglue_SvU8(ST(1));
+      } else if (sizeof(size_t) == 2) {
+        arg2 = amglue_SvU16(ST(1));
+      } else if (sizeof(size_t) == 4) {
+        arg2 = amglue_SvU32(ST(1));
+      } else if (sizeof(size_t) == 8) {
+        arg2 = amglue_SvU64(ST(1));
+      } else {
+        croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
+      }
+    }
+    res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "write_random_to_device" "', argument " "3"" of type '" "Device *""'"); 
+    }
+    arg3 = (Device *)(argp3);
+    result = (gboolean)write_random_to_device(arg1,arg2,arg3);
+    {
+      if (result)
+      ST(argvi) = &PL_sv_yes;
+      else
+      ST(argvi) = &PL_sv_no;
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_verify_random_from_device) {
+  {
+    guint32 arg1 ;
+    size_t arg2 ;
+    Device *arg3 = (Device *) 0 ;
+    void *argp3 = 0 ;
+    int res3 = 0 ;
+    int argvi = 0;
+    gboolean result;
+    dXSARGS;
+    
+    if ((items < 3) || (items > 3)) {
+      SWIG_croak("Usage: verify_random_from_device(seed,length,device);");
+    }
+    {
+      arg1 = amglue_SvU32(ST(0));
+    }
+    {
+      if (sizeof(size_t) == 1) {
+        arg2 = amglue_SvU8(ST(1));
+      } else if (sizeof(size_t) == 2) {
+        arg2 = amglue_SvU16(ST(1));
+      } else if (sizeof(size_t) == 4) {
+        arg2 = amglue_SvU32(ST(1));
+      } else if (sizeof(size_t) == 8) {
+        arg2 = amglue_SvU64(ST(1));
+      } else {
+        croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
+      }
+    }
+    res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "verify_random_from_device" "', argument " "3"" of type '" "Device *""'"); 
+    }
+    arg3 = (Device *)(argp3);
+    result = (gboolean)verify_random_from_device(arg1,arg2,arg3);
+    {
+      if (result)
+      ST(argvi) = &PL_sv_yes;
+      else
+      ST(argvi) = &PL_sv_no;
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_IS_WRITABLE_ACCESS_MODE) {
   {
     DeviceAccessMode arg1 ;
@@ -4284,6 +4337,7 @@ XS(_wrap_IS_WRITABLE_ACCESS_MODE) {
 
 static swig_type_info _swigt__p_Device = {"_p_Device", "struct Device *|Device *", 0, 0, (void*)"Amanda::Device::Device", 0};
 static swig_type_info _swigt__p_DevicePropertyBase = {"_p_DevicePropertyBase", "DevicePropertyBase *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_DirectTCPAddr = {"_p_DirectTCPAddr", "DirectTCPAddr *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_DirectTCPConnection = {"_p_DirectTCPConnection", "struct DirectTCPConnection *|DirectTCPConnection *", 0, 0, (void*)"Amanda::Device::DirectTCPConnection", 0};
 static swig_type_info _swigt__p_GSList = {"_p_GSList", "GSList *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_GValue = {"_p_GValue", "GValue *", 0, 0, (void*)0, 0};
@@ -4293,15 +4347,16 @@ static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0,
 static swig_type_info _swigt__p_dumpfile_t = {"_p_dumpfile_t", "dumpfile_t *", 0, 0, (void*)"Amanda::Header::Header", 0};
 static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_guint = {"_p_guint", "guint *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_guint32 = {"_p_guint32", "guint32 *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_guint64 = {"_p_guint64", "guint64 *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_int = {"_p_int", "int *|PropertySurety *|ConcurrencyParadigm *|filetype_t *|PropertySource *|SizeAccuracy *|StreamingRequirement *|gboolean *|DeviceAccessMode *|MediaAccessMode *|DeviceStatusFlags *|PropertyPhaseFlags *|PropertyAccessFlags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|PropertySurety *|ConcurrencyParadigm *|filetype_t *|PropertySource *|StreamingRequirement *|gboolean *|DeviceAccessMode *|MediaAccessMode *|DeviceStatusFlags *|PropertyPhaseFlags *|PropertyAccessFlags *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_p_DirectTCPAddr = {"_p_p_DirectTCPAddr", "DirectTCPAddr **", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_queue_fd_t = {"_p_queue_fd_t", "struct queue_fd_t *|queue_fd_t *", 0, 0, (void*)"Amanda::Device::queue_fd_t", 0};
 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
 
 static swig_type_info *swig_type_initial[] = {
   &_swigt__p_Device,
   &_swigt__p_DevicePropertyBase,
+  &_swigt__p_DirectTCPAddr,
   &_swigt__p_DirectTCPConnection,
   &_swigt__p_GSList,
   &_swigt__p_GValue,
@@ -4311,15 +4366,16 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_dumpfile_t,
   &_swigt__p_float,
   &_swigt__p_guint,
+  &_swigt__p_guint32,
   &_swigt__p_guint64,
   &_swigt__p_int,
   &_swigt__p_p_DirectTCPAddr,
-  &_swigt__p_queue_fd_t,
   &_swigt__p_unsigned_char,
 };
 
 static swig_cast_info _swigc__p_Device[] = {  {&_swigt__p_Device, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_DevicePropertyBase[] = {  {&_swigt__p_DevicePropertyBase, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_DirectTCPAddr[] = {  {&_swigt__p_DirectTCPAddr, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_DirectTCPConnection[] = {  {&_swigt__p_DirectTCPConnection, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_GSList[] = {  {&_swigt__p_GSList, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_GValue[] = {  {&_swigt__p_GValue, 0, 0, 0},{0, 0, 0, 0}};
@@ -4329,15 +4385,16 @@ static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0
 static swig_cast_info _swigc__p_dumpfile_t[] = {  {&_swigt__p_dumpfile_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_guint[] = {  {&_swigt__p_guint, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_guint32[] = {  {&_swigt__p_guint32, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_guint64[] = {  {&_swigt__p_guint64, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_p_DirectTCPAddr[] = {  {&_swigt__p_p_DirectTCPAddr, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_queue_fd_t[] = {  {&_swigt__p_queue_fd_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
 
 static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_Device,
   _swigc__p_DevicePropertyBase,
+  _swigc__p_DirectTCPAddr,
   _swigc__p_DirectTCPConnection,
   _swigc__p_GSList,
   _swigc__p_GValue,
@@ -4347,10 +4404,10 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_dumpfile_t,
   _swigc__p_float,
   _swigc__p_guint,
+  _swigc__p_guint32,
   _swigc__p_guint64,
   _swigc__p_int,
   _swigc__p_p_DirectTCPAddr,
-  _swigc__p_queue_fd_t,
   _swigc__p_unsigned_char,
 };
 
@@ -4370,10 +4427,6 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Devicec::delete_DirectTCPConnection", _wrap_delete_DirectTCPConnection},
 {"Amanda::Devicec::DirectTCPConnection_close", _wrap_DirectTCPConnection_close},
 {"Amanda::Devicec::new_DirectTCPConnection", _wrap_new_DirectTCPConnection},
-{"Amanda::Devicec::queue_fd_t_fd_get", _wrap_queue_fd_t_fd_get},
-{"Amanda::Devicec::queue_fd_t_errmsg_get", _wrap_queue_fd_t_errmsg_get},
-{"Amanda::Devicec::new_queue_fd_t", _wrap_new_queue_fd_t},
-{"Amanda::Devicec::delete_queue_fd_t", _wrap_delete_queue_fd_t},
 {"Amanda::Devicec::unaliased_name", _wrap_unaliased_name},
 {"Amanda::Devicec::new_Device", _wrap_new_Device},
 {"Amanda::Devicec::delete_Device", _wrap_delete_Device},
@@ -4386,17 +4439,16 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Devicec::Device_finish", _wrap_Device_finish},
 {"Amanda::Devicec::Device_start_file", _wrap_Device_start_file},
 {"Amanda::Devicec::Device_write_block", _wrap_Device_write_block},
-{"Amanda::Devicec::Device_write_from_fd", _wrap_Device_write_from_fd},
 {"Amanda::Devicec::Device_finish_file", _wrap_Device_finish_file},
 {"Amanda::Devicec::Device_seek_file", _wrap_Device_seek_file},
 {"Amanda::Devicec::Device_seek_block", _wrap_Device_seek_block},
 {"Amanda::Devicec::Device_read_block", _wrap_Device_read_block},
-{"Amanda::Devicec::Device_read_to_fd", _wrap_Device_read_to_fd},
 {"Amanda::Devicec::Device_erase", _wrap_Device_erase},
 {"Amanda::Devicec::Device_eject", _wrap_Device_eject},
 {"Amanda::Devicec::Device_directtcp_supported", _wrap_Device_directtcp_supported},
 {"Amanda::Devicec::Device_listen", _wrap_Device_listen},
 {"Amanda::Devicec::Device_accept", _wrap_Device_accept},
+{"Amanda::Devicec::Device_connect", _wrap_Device_connect},
 {"Amanda::Devicec::Device_use_connection", _wrap_Device_use_connection},
 {"Amanda::Devicec::Device_write_from_connection", _wrap_Device_write_from_connection},
 {"Amanda::Devicec::Device_read_to_connection", _wrap_Device_read_to_connection},
@@ -4420,6 +4472,8 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Devicec::Device_block_size", _wrap_Device_block_size},
 {"Amanda::Devicec::Device_volume_header", _wrap_Device_volume_header},
 {"Amanda::Devicec::rait_device_open_from_children", _wrap_rait_device_open_from_children},
+{"Amanda::Devicec::write_random_to_device", _wrap_write_random_to_device},
+{"Amanda::Devicec::verify_random_from_device", _wrap_verify_random_from_device},
 {"Amanda::Devicec::IS_WRITABLE_ACCESS_MODE", _wrap_IS_WRITABLE_ACCESS_MODE},
 {0,0}
 };
@@ -4720,7 +4774,6 @@ XS(SWIG_init) {
   device_api_init();
   
   SWIG_TypeClientData(SWIGTYPE_p_DirectTCPConnection, (void*) "Amanda::Device::DirectTCPConnection");
-  SWIG_TypeClientData(SWIGTYPE_p_queue_fd_t, (void*) "Amanda::Device::queue_fd_t");
   SWIG_TypeClientData(SWIGTYPE_p_Device, (void*) "Amanda::Device::Device");
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "ACCESS_NULL", TRUE | 0x2 | GV_ADDMULTI);
@@ -4927,21 +4980,6 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_WRITE_ONLY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
-    SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_UNKNOWN", TRUE | 0x2 | GV_ADDMULTI);
-    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_UNKNOWN)));
-    SvREADONLY_on(sv);
-  } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
-    SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI);
-    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_ESTIMATE)));
-    SvREADONLY_on(sv);
-  } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
-    SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_REAL", TRUE | 0x2 | GV_ADDMULTI);
-    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_REAL)));
-    SvREADONLY_on(sv);
-  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SURETY_BAD", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SURETY_BAD)));
index 11a3c89a5bce06554a690f7c2f82863c7379cfee..17caeecae27b77e7c1ed92cc8564ed8cf17781f5 100644 (file)
@@ -52,6 +52,8 @@ package Amanda::Device;
 
 *unaliased_name = *Amanda::Devicec::unaliased_name;
 *rait_device_open_from_children = *Amanda::Devicec::rait_device_open_from_children;
+*write_random_to_device = *Amanda::Devicec::write_random_to_device;
+*verify_random_from_device = *Amanda::Devicec::verify_random_from_device;
 *IS_WRITABLE_ACCESS_MODE = *Amanda::Devicec::IS_WRITABLE_ACCESS_MODE;
 
 ############# Class : Amanda::Device::DirectTCPConnection ##############
@@ -92,47 +94,6 @@ sub ACQUIRE {
 }
 
 
-############# Class : Amanda::Device::queue_fd_t ##############
-
-package Amanda::Device::queue_fd_t;
-use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
-@ISA = qw( Amanda::Device );
-%OWNER = ();
-%ITERATORS = ();
-*swig_fd_get = *Amanda::Devicec::queue_fd_t_fd_get;
-*swig_fd_set = *Amanda::Devicec::queue_fd_t_fd_set;
-*swig_errmsg_get = *Amanda::Devicec::queue_fd_t_errmsg_get;
-*swig_errmsg_set = *Amanda::Devicec::queue_fd_t_errmsg_set;
-sub new {
-    my $pkg = shift;
-    my $self = Amanda::Devicec::new_queue_fd_t(@_);
-    bless $self, $pkg if defined($self);
-}
-
-sub DESTROY {
-    return unless $_[0]->isa('HASH');
-    my $self = tied(%{$_[0]});
-    return unless defined $self;
-    delete $ITERATORS{$self};
-    if (exists $OWNER{$self}) {
-        Amanda::Devicec::delete_queue_fd_t($self);
-        delete $OWNER{$self};
-    }
-}
-
-sub DISOWN {
-    my $self = shift;
-    my $ptr = tied(%$self);
-    delete $OWNER{$ptr};
-}
-
-sub ACQUIRE {
-    my $self = shift;
-    my $ptr = tied(%$self);
-    $OWNER{$ptr} = 1;
-}
-
-
 ############# Class : Amanda::Device::Device ##############
 
 package Amanda::Device::Device;
@@ -166,17 +127,16 @@ sub DESTROY {
 *finish = *Amanda::Devicec::Device_finish;
 *start_file = *Amanda::Devicec::Device_start_file;
 *write_block = *Amanda::Devicec::Device_write_block;
-*write_from_fd = *Amanda::Devicec::Device_write_from_fd;
 *finish_file = *Amanda::Devicec::Device_finish_file;
 *seek_file = *Amanda::Devicec::Device_seek_file;
 *seek_block = *Amanda::Devicec::Device_seek_block;
 *read_block = *Amanda::Devicec::Device_read_block;
-*read_to_fd = *Amanda::Devicec::Device_read_to_fd;
 *erase = *Amanda::Devicec::Device_erase;
 *eject = *Amanda::Devicec::Device_eject;
 *directtcp_supported = *Amanda::Devicec::Device_directtcp_supported;
 *listen = *Amanda::Devicec::Device_listen;
 *accept = *Amanda::Devicec::Device_accept;
+*connect = *Amanda::Devicec::Device_connect;
 *use_connection = *Amanda::Devicec::Device_use_connection;
 *write_from_connection = *Amanda::Devicec::Device_write_from_connection;
 *read_to_connection = *Amanda::Devicec::Device_read_to_connection;
@@ -257,9 +217,6 @@ package Amanda::Device;
 *MEDIA_ACCESS_MODE_WORM = *Amanda::Devicec::MEDIA_ACCESS_MODE_WORM;
 *MEDIA_ACCESS_MODE_READ_WRITE = *Amanda::Devicec::MEDIA_ACCESS_MODE_READ_WRITE;
 *MEDIA_ACCESS_MODE_WRITE_ONLY = *Amanda::Devicec::MEDIA_ACCESS_MODE_WRITE_ONLY;
-*SIZE_ACCURACY_UNKNOWN = *Amanda::Devicec::SIZE_ACCURACY_UNKNOWN;
-*SIZE_ACCURACY_ESTIMATE = *Amanda::Devicec::SIZE_ACCURACY_ESTIMATE;
-*SIZE_ACCURACY_REAL = *Amanda::Devicec::SIZE_ACCURACY_REAL;
 *PROPERTY_SURETY_BAD = *Amanda::Devicec::PROPERTY_SURETY_BAD;
 *PROPERTY_SURETY_GOOD = *Amanda::Devicec::PROPERTY_SURETY_GOOD;
 *PROPERTY_SOURCE_DEFAULT = *Amanda::Devicec::PROPERTY_SOURCE_DEFAULT;
@@ -510,10 +467,12 @@ C<start>, C<start_file>, C<finish_file>, and C<finish>.  API users that
 understand LEOM should take this as a signal to complete writing to the device
 and move on before hitting PEOM.
 
-Devices which do not support EOM simply return a VOLUME_ERROR when the volume
+Devices which do not support LEOM simply return a VOLUME_ERROR when the volume
 is full.  If this occurs during a C<write_block> operation, then the volume may
 or may not contain the block - the situation is indeterminate.
 
+Devices indicate their support for LEOM with the LEOM property.
+
 =head2 Device Resources
 
 Some device types have a "locking" mechanism that prevents other parts of the
@@ -724,23 +683,6 @@ set C<is_eom> whenever the situation is ambiguous.
 This function ensures that C<block> is correct on exit. Even in an
 error condition, it does not finish the current file for the caller.
 
-=head3 write_from_fd (DEPRECATED)
-
- my $qfd = Amanda::Device::queue_fd_t->new(fileno($fh));
- if (!$dev->write_from_fd($fd)) {
-   print STDERR $qfd->{errmsg}, "\n" if ($qfd->{errmsg});
-   print STDERR $dev->status_or_error(), "\n" if ($dev->status());
- }
-
-This method reads from the given file descriptor until EOF, writing the data to
-a Device file which should already be started, and not returning until the
-operation is complete. The file is not automatically finished. This method is
-deprecated; the better solution is to use the transfer architecture
-(L<Amanda::Xfer>).
-
-This is a virtual method, but the default implementation in the Device class
-uses C<write_block>, so there is no need for subclasses to override it.
-
 =head3 finish_file
 
  $success = $dev->finish_file();
@@ -809,23 +751,6 @@ wait for the next read to fail. It is never an error to call C<read_block>
 after an EOF, so there is no need to check C<is_eof> except when C<read_block>
 returns -1.
 
-=head3 read_to_fd (DEPRECATED)
-
- queue_fd_t *qfd = queue_fd_new(fd, NULL);
- my $qfd = Amanda::Device::queue_fd_t->new(fileno($fh));
- if (!$dev->read_to_fd($fd)) {
-   print STDERR $qfd->{errmsg}, "\n" if ($qfd->{errmsg});
-   print STDERR $dev->status_or_error(), "\n" if ($dev->status());
- }
-
-This method reads the current file from the device and writes to the given file
-descriptor, not returning until the operation is complete. This method is
-deprecated; new uses of devices use the transfer architecture
-(L<Amanda::Xfer>).
-
-This is a virtual method, but the default implementation in the Device class
-uses C<read_block>, so there is no need for subclasses to override it.
-
 =head3 finish
 
  $success = $dev->finish();
@@ -902,6 +827,18 @@ connection ever occurs.  The C implementation returns an already-referenced
 connection object, so the caller should call C<g_object_unref> when the
 connection is no longer needed.
 
+=head3 connect
+
+  $conn = $dev->connect($for_writing, $addrs);
+
+This method initiates a connection to one of the addresses in C<$addrs>,
+returning an established DirectTCPConnection object (see below).  The
+C<$for_writing> parameter is TRUE if the connection will be used to write to
+the device.  It returns C<undef> on failure.  Note that this method may block
+indefinitely if no connection ever occurs.  The C implementation returns an
+already-referenced connection object, so the caller should call
+C<g_object_unref> when the connection is no longer needed.
+
 =head3 use_connection
 
   my $ok = $dev->use_connection($conn);
@@ -909,17 +846,18 @@ connection is no longer needed.
 Call this method to use a DirectTCPConnection object created with another
 device.  The method must be called before the device is started (so
 C<access_mode> is C<$ACCESS_NULL>), as some devices cannot support switching
-connections without rewinding.  Any subsequent C<read_from_connection> or
-C<write_to_connection> calls will use this connection.
+connections without rewinding.  Any subsequent C<read_to_connection> or
+C<write_from_connection> calls will use this connection.
 
 =head3 write_from_connection
 
   ($ok, $actual_size) = $dev->write_from_connection($size);
 
 This method reads data from the DirectTCPConnection specified with
-C<use_connection> or returned from C<accept> and writes it to the volume.   It
-writes at most C<$size> bytes, and returns the number of bytes written in
-C<$actual_size>.  On error, C<$ok> is false.
+C<use_connection> or returned from C<accept> or C<connect> and writes it to the
+volume.   It writes at most C<$size> bytes, and returns the number of bytes
+written in C<$actual_size>.  If C<$size> is zero, it will write until EOF, EOM,
+or a device error.  On error, C<$ok> is false.
 
 When an EOF is received over the connection, signalling the end of the data
 stream, then this method returns without error (C<$ok> is true), with
@@ -962,9 +900,9 @@ or imported with the C<:constant> import tag.
 
 =head2 DirectTCPConnection objects
 
-The C<accept> method returns an object to represent the ongoing DirectTCP
-connection.  This object is mostly useful as a "token" to be passed to
-C<write_from_connection> and C<read_to_connection>.  In particular, a
+The C<accept> and C<connect> methods return an object to represent the ongoing
+DirectTCP connection.  This object is mostly useful as a "token" to be passed
+to C<write_from_connection> and C<read_to_connection>.  In particular, a
 connection created by one device can be used with another device; this is how
 DirectTCP dumps are spanned over multiple volumes.
 
@@ -1368,45 +1306,6 @@ $_MediaAccessMode_VALUES{"WRITE_ONLY"} = $MEDIA_ACCESS_MODE_WRITE_ONLY;
 #copy symbols in MediaAccessMode to constants
 push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"MediaAccessMode"}};
 
-push @EXPORT_OK, qw(SizeAccuracy_to_string);
-push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw(SizeAccuracy_to_string);
-
-my %_SizeAccuracy_VALUES;
-#Convert an enum value to a single string
-sub SizeAccuracy_to_string {
-    my ($enumval) = @_;
-
-    for my $k (keys %_SizeAccuracy_VALUES) {
-       my $v = $_SizeAccuracy_VALUES{$k};
-
-       #is this a matching flag?
-       if ($enumval == $v) {
-           return $k;
-       }
-    }
-
-#default, just return the number
-    return $enumval;
-}
-
-push @EXPORT_OK, qw($SIZE_ACCURACY_UNKNOWN);
-push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw($SIZE_ACCURACY_UNKNOWN);
-
-$_SizeAccuracy_VALUES{"UNKNOWN"} = $SIZE_ACCURACY_UNKNOWN;
-
-push @EXPORT_OK, qw($SIZE_ACCURACY_ESTIMATE);
-push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw($SIZE_ACCURACY_ESTIMATE);
-
-$_SizeAccuracy_VALUES{"ESTIMATE"} = $SIZE_ACCURACY_ESTIMATE;
-
-push @EXPORT_OK, qw($SIZE_ACCURACY_REAL);
-push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw($SIZE_ACCURACY_REAL);
-
-$_SizeAccuracy_VALUES{"REAL"} = $SIZE_ACCURACY_REAL;
-
-#copy symbols in SizeAccuracy to constants
-push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"SizeAccuracy"}};
-
 push @EXPORT_OK, qw(PropertySurety_to_strings);
 push @{$EXPORT_TAGS{"PropertySurety"}}, qw(PropertySurety_to_strings);
 
index 48ce6134e94da5fff4197c12b68f32d6ff216a93..10d3f8b6540f0313d724f119636dd0513497331d 100644 (file)
@@ -260,10 +260,12 @@ C<start>, C<start_file>, C<finish_file>, and C<finish>.  API users that
 understand LEOM should take this as a signal to complete writing to the device
 and move on before hitting PEOM.
 
-Devices which do not support EOM simply return a VOLUME_ERROR when the volume
+Devices which do not support LEOM simply return a VOLUME_ERROR when the volume
 is full.  If this occurs during a C<write_block> operation, then the volume may
 or may not contain the block - the situation is indeterminate.
 
+Devices indicate their support for LEOM with the LEOM property.
+
 =head2 Device Resources
 
 Some device types have a "locking" mechanism that prevents other parts of the
@@ -474,23 +476,6 @@ set C<is_eom> whenever the situation is ambiguous.
 This function ensures that C<block> is correct on exit. Even in an
 error condition, it does not finish the current file for the caller.
 
-=head3 write_from_fd (DEPRECATED)
-
- my $qfd = Amanda::Device::queue_fd_t->new(fileno($fh));
- if (!$dev->write_from_fd($fd)) {
-   print STDERR $qfd->{errmsg}, "\n" if ($qfd->{errmsg});
-   print STDERR $dev->status_or_error(), "\n" if ($dev->status());
- }
-
-This method reads from the given file descriptor until EOF, writing the data to
-a Device file which should already be started, and not returning until the
-operation is complete. The file is not automatically finished. This method is
-deprecated; the better solution is to use the transfer architecture
-(L<Amanda::Xfer>).
-
-This is a virtual method, but the default implementation in the Device class
-uses C<write_block>, so there is no need for subclasses to override it.
-
 =head3 finish_file
 
  $success = $dev->finish_file();
@@ -559,23 +544,6 @@ wait for the next read to fail. It is never an error to call C<read_block>
 after an EOF, so there is no need to check C<is_eof> except when C<read_block>
 returns -1.
 
-=head3 read_to_fd (DEPRECATED)
-
- queue_fd_t *qfd = queue_fd_new(fd, NULL);
- my $qfd = Amanda::Device::queue_fd_t->new(fileno($fh));
- if (!$dev->read_to_fd($fd)) {
-   print STDERR $qfd->{errmsg}, "\n" if ($qfd->{errmsg});
-   print STDERR $dev->status_or_error(), "\n" if ($dev->status());
- }
-
-This method reads the current file from the device and writes to the given file
-descriptor, not returning until the operation is complete. This method is
-deprecated; new uses of devices use the transfer architecture
-(L<Amanda::Xfer>).
-
-This is a virtual method, but the default implementation in the Device class
-uses C<read_block>, so there is no need for subclasses to override it.
-
 =head3 finish
 
  $success = $dev->finish();
@@ -652,6 +620,18 @@ connection ever occurs.  The C implementation returns an already-referenced
 connection object, so the caller should call C<g_object_unref> when the
 connection is no longer needed.
 
+=head3 connect
+
+  $conn = $dev->connect($for_writing, $addrs);
+
+This method initiates a connection to one of the addresses in C<$addrs>,
+returning an established DirectTCPConnection object (see below).  The
+C<$for_writing> parameter is TRUE if the connection will be used to write to
+the device.  It returns C<undef> on failure.  Note that this method may block
+indefinitely if no connection ever occurs.  The C implementation returns an
+already-referenced connection object, so the caller should call
+C<g_object_unref> when the connection is no longer needed.
+
 =head3 use_connection
 
   my $ok = $dev->use_connection($conn);
@@ -659,17 +639,18 @@ connection is no longer needed.
 Call this method to use a DirectTCPConnection object created with another
 device.  The method must be called before the device is started (so
 C<access_mode> is C<$ACCESS_NULL>), as some devices cannot support switching
-connections without rewinding.  Any subsequent C<read_from_connection> or
-C<write_to_connection> calls will use this connection.
+connections without rewinding.  Any subsequent C<read_to_connection> or
+C<write_from_connection> calls will use this connection.
 
 =head3 write_from_connection
 
   ($ok, $actual_size) = $dev->write_from_connection($size);
 
 This method reads data from the DirectTCPConnection specified with
-C<use_connection> or returned from C<accept> and writes it to the volume.   It
-writes at most C<$size> bytes, and returns the number of bytes written in
-C<$actual_size>.  On error, C<$ok> is false.
+C<use_connection> or returned from C<accept> or C<connect> and writes it to the
+volume.   It writes at most C<$size> bytes, and returns the number of bytes
+written in C<$actual_size>.  If C<$size> is zero, it will write until EOF, EOM,
+or a device error.  On error, C<$ok> is false.
 
 When an EOF is received over the connection, signalling the end of the data
 stream, then this method returns without error (C<$ok> is true), with
@@ -712,9 +693,9 @@ or imported with the C<:constant> import tag.
 
 =head2 DirectTCPConnection objects
 
-The C<accept> method returns an object to represent the ongoing DirectTCP
-connection.  This object is mostly useful as a "token" to be passed to
-C<write_from_connection> and C<read_to_connection>.  In particular, a
+The C<accept> and C<connect> methods return an object to represent the ongoing
+DirectTCP connection.  This object is mostly useful as a "token" to be passed
+to C<write_from_connection> and C<read_to_connection>.  In particular, a
 connection created by one device can be used with another device; this is how
 DirectTCP dumps are spanned over multiple volumes.
 
index f044bfdcb84cc49db3dc6ca6b43f07c84eb0dad7..479015d38da21ffffc025d1c39cf4cf2766c49b8 100644 (file)
@@ -30,6 +30,7 @@
 #include "property.h"
 #include "fileheader.h"
 #include "glib-util.h"
+#include "simpleprng.h"
 %}
 
 %init %{
@@ -65,30 +66,6 @@ set_sv_from_gvalue(GValue *value)
 
        case G_TYPE_UINT64:
            return sv_2mortal(amglue_newSVu64(g_value_get_uint64(value)));
-
-       case G_TYPE_BOXED: {
-           GType boxed_type = G_VALUE_TYPE(value);
-           QualifiedSize qs;
-           HV *hv;
-
-           if (boxed_type == QUALIFIED_SIZE_TYPE) {
-               qs = *(QualifiedSize*)(g_value_get_boxed(value));
-
-               /* build a hash */
-               hv = (HV *)sv_2mortal((SV *)newHV());
-               hv_store(hv, "accuracy", 8, newSViv(qs.accuracy), 0);
-               hv_store(hv, "bytes", 5, amglue_newSVi64(qs.bytes), 0);
-
-               sv = newRV((SV *)hv);
-               return newRV((SV *)hv);
-           } else {
-               warn("Unsupported boxed property type #%d", (int)boxed_type);
-
-               sv = sv_newmortal();
-               sv_setsv(sv, &PL_sv_undef);
-               return sv;
-           }
-       }
     }
 
     /* simple types that can be constructed with sv_set*v */
@@ -255,29 +232,6 @@ typedef struct DirectTCPConnection {
  * Device struct, %extend-ed into a Perl class
  */
 
-typedef struct queue_fd_t {
-    /* Instance variables -- all readonly */
-    %immutable;
-    int fd;
-    char *errmsg;
-
-    %mutable;
-
-    /* methods */
-    %extend {
-       /* constructor */
-       queue_fd_t(int fd) {
-           return queue_fd_new(fd, NULL);
-       }
-
-       /* destructor */
-       ~queue_fd_t() {
-           amfree(self->errmsg);
-           g_free(self);
-       }
-    }
-} queue_fd_t;
-
 %name(unaliased_name) extern char *device_unaliased_name(char *);
 
 typedef struct Device {
@@ -338,11 +292,6 @@ typedef struct Device {
            return device_write_block(self, size, data);
        }
 
-       gboolean
-       write_from_fd(queue_fd_t *queue_fd) {
-           return device_write_from_fd(self, queue_fd);
-       }
-
        gboolean
        finish_file() {
            return device_finish_file(self);
@@ -363,10 +312,6 @@ typedef struct Device {
            return device_read_block(self, buffer, size);
        }
 
-       gboolean read_to_fd(queue_fd_t *queue_fd) {
-           return device_read_to_fd(self, queue_fd);
-       }
-
        gboolean
        erase() {
            return device_erase(self);
@@ -404,6 +349,21 @@ typedef struct Device {
            return conn;
        }
 
+       %newobject connect; /* connection is already ref'd, so we own it */
+       DirectTCPConnection *
+       connect(gboolean for_writing, DirectTCPAddr *addrs) {
+           DirectTCPConnection *conn = NULL;
+           gboolean rv;
+
+           rv = device_connect(self, for_writing, addrs, &conn, NULL, NULL);
+           if (!rv && conn) {
+               /* conn is ref'd for our convenience, but we don't want it */
+               g_object_unref(conn);
+               conn = NULL;
+           }
+           return conn;
+       }
+
        gboolean
        use_connection(DirectTCPConnection *conn) {
            return device_use_connection(self, conn);
@@ -467,10 +427,10 @@ typedef struct Device {
            if (SvPOK($input))
                pname = SvPV_nolen($input);
 
-           if (pname) $1 = (DevicePropertyBase *)device_property_get_by_name(pname);
-           if (!pname || !$1) {
-               SWIG_exception_fail(SWIG_ValueError, "Invalid property name");
-           }
+           if (pname)
+               $1 = (DevicePropertyBase *)device_property_get_by_name(pname);
+           else
+               $1 = NULL;
        }
 
        /* A typemap to convert the GValue in property_get to a return value.  The
@@ -516,7 +476,11 @@ typedef struct Device {
        void
        property_get(DevicePropertyBase *pbase, GValue *out_val, PropertySurety *surety,
                     PropertySource *source, gboolean *val_found) {
-           *val_found = device_property_get_ex(self, pbase->ID, out_val, surety, source);
+           if (pbase) {
+               *val_found = device_property_get_ex(self, pbase->ID, out_val, surety, source);
+           } else {
+               *val_found = FALSE;
+           }
        }
 
        /* delete typemaps */
@@ -626,6 +590,86 @@ sub new_rait_from_children {
 }
 %}
 
+/*
+ * Utilities for installchecks (not described in POD)
+ */
+
+%inline %{
+
+/* write LENGTH bytes of random data to FILENAME, seeded with SEED */
+gboolean
+write_random_to_device(guint32 seed, size_t length, Device *device) {
+    simpleprng_state_t prng;
+    char *buf;
+    gsize block_size = device->block_size;
+    g_assert(block_size < G_MAXUINT);
+
+    buf = g_malloc(block_size);
+    simpleprng_seed(&prng, seed);
+
+    while (length) {
+       size_t to_write = min(block_size, length);
+
+       simpleprng_fill_buffer(&prng, buf, to_write);
+       if (!device_write_block(device, (guint)block_size, buf)) {
+           g_free(buf);
+           return FALSE;
+       }
+       length -= to_write;
+    }
+
+    g_free(buf);
+    return TRUE;
+}
+
+/* read LENGTH bytes of random data from FILENAME verifying it against
+ * a PRNG seeded with SEED.  Sends any error messages to stderr.
+ */
+gboolean
+verify_random_from_device(guint32 seed, size_t length, Device *device) {
+    simpleprng_state_t prng;
+    char *buf = NULL; /* first device_read_block will get the size */
+    int block_size = 0;
+
+    simpleprng_seed(&prng, seed);
+
+    while (length) {
+       int bytes_read;
+       int size = block_size;
+
+       bytes_read = device_read_block(device, buf, &size);
+       if (bytes_read == 0 && size > block_size) {
+           g_free(buf);
+           block_size = size;
+           buf = g_malloc(block_size);
+           continue;
+       }
+       if (bytes_read == -1) {
+           if (device->status == DEVICE_STATUS_SUCCESS) {
+               g_assert(device->is_eof);
+               g_debug("verify_random_from_device got unexpected EOF");
+           }
+           goto error;
+       }
+
+       /* strip padding */
+       bytes_read = min(bytes_read, length);
+
+       if (!simpleprng_verify_buffer(&prng, buf, bytes_read))
+           goto error;
+
+       length -= bytes_read;
+    }
+
+    g_free(buf);
+    return TRUE;
+
+error:
+    g_free(buf);
+    return FALSE;
+}
+%}
+
 /*
  * Constants
  */
@@ -706,12 +750,6 @@ amglue_add_constant_short(MEDIA_ACCESS_MODE_READ_WRITE, "READ_WRITE", MediaAcces
 amglue_add_constant_short(MEDIA_ACCESS_MODE_WRITE_ONLY, "WRITE_ONLY", MediaAccessMode);
 amglue_copy_to_tag(MediaAccessMode, constants);
 
-amglue_add_enum_tag_fns(SizeAccuracy);
-amglue_add_constant_short(SIZE_ACCURACY_UNKNOWN, "UNKNOWN", SizeAccuracy);
-amglue_add_constant_short(SIZE_ACCURACY_ESTIMATE, "ESTIMATE", SizeAccuracy);
-amglue_add_constant_short(SIZE_ACCURACY_REAL, "REAL", SizeAccuracy);
-amglue_copy_to_tag(SizeAccuracy, constants);
-
 amglue_add_flag_tag_fns(PropertySurety);
 amglue_add_constant_short(PROPERTY_SURETY_BAD, "SURETY_BAD", PropertySurety);
 amglue_add_constant_short(PROPERTY_SURETY_GOOD, "SURETY_GOOD", PropertySurety);
index 2cd307c4d5ec3fb28e89676321f1852b52e761ce..af9196278e12443525531e9269eea8e07345617c 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -1905,7 +1908,7 @@ static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void
 static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_dumptype_t = {"_p_dumptype_t", "dumptype_t *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_int = {"_p_int", "application_key *|strategy_t *|pp_script_key *|int *|autolabel_enum_t *|comp_t *|dump_holdingdisk_t *|device_config_key *|changer_config_key *|confparm_key *|interface_key *|holdingdisk_key *|dumptype_key *|tapetype_key *|cfgerr_level_t *|encrypt_t *|taperalgo_t *|gboolean *|data_path_t *|execute_on_t *|send_amreport_on_t *|estimate_t *|config_init_flags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "application_key *|strategy_t *|pp_script_key *|int *|autolabel_enum_t *|comp_t *|dump_holdingdisk_t *|device_config_key *|changer_config_key *|confparm_key *|interface_key *|holdingdisk_key *|dumptype_key *|tapetype_key *|part_cache_type_t *|cfgerr_level_t *|encrypt_t *|taperalgo_t *|gboolean *|data_path_t *|execute_on_t *|send_amreport_on_t *|estimate_t *|config_init_flags *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_interface_t = {"_p_interface_t", "interface_t *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
 
index 858286ba045163b80e642e34ad327d9ca9437dc6..77074c5ba5c9e115500da18f9fb46ac424e97741 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -2904,6 +2907,11 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(fe_amrecover_correct_disk_quoting)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "fe_amindexd_quote_label", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(fe_amindexd_quote_label)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "last_feature", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(last_feature)));
index e516ddd5b3b678df4a0e1160180c9b27867d2da9..e99ad94755e5778d483ba87ca5528d38f7da2427 100644 (file)
@@ -194,6 +194,7 @@ package Amanda::Feature;
 *fe_amrecover_origsize_in_header = *Amanda::Featurec::fe_amrecover_origsize_in_header;
 *fe_amidxtaped_abort = *Amanda::Featurec::fe_amidxtaped_abort;
 *fe_amrecover_correct_disk_quoting = *Amanda::Featurec::fe_amrecover_correct_disk_quoting;
+*fe_amindexd_quote_label = *Amanda::Featurec::fe_amindexd_quote_label;
 *last_feature = *Amanda::Featurec::last_feature;
 
 @EXPORT_OK = ();
@@ -407,6 +408,13 @@ This feature is no longer supported.
 Amrecovers that do not have this flag may send incorrectly-quoted DISK lines, so
 those DISK lines should be ignored.
 
+=item fe_amindexd_quote_label
+
+ PROTOCOL: amindexd
+ FEATURE OF: server
+
+If set, amindexd quote the label (holdingdisk filename)
+
 =back
 
 =cut
index 91f10cb81a9a20ca047a3398f7d370d8041c7119..21513563377c2a2b80c7f343350b6367ce4df6f1 100644 (file)
@@ -227,6 +227,13 @@ This feature is no longer supported.
 Amrecovers that do not have this flag may send incorrectly-quoted DISK lines, so
 those DISK lines should be ignored.
 
+=item fe_amindexd_quote_label
+
+ PROTOCOL: amindexd
+ FEATURE OF: server
+
+If set, amindexd quote the label (holdingdisk filename)
+
 =back
 
 =cut
index 85327af7a80a8ff5762eab3c7ba8dad772d4dff8..5ad8837adba81fca4eb70594f6602423d26c13df 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
index c5c516ac1d0779ba6ddec9ce2e42fb372c98dae7..32097b207a18393dbe9c4073024dd0404fb5b0c6 100644 (file)
@@ -301,30 +301,25 @@ uncompression.
 
 
 
-push @EXPORT_OK, qw(filetype_t_to_strings);
-push @{$EXPORT_TAGS{"filetype_t"}}, qw(filetype_t_to_strings);
+push @EXPORT_OK, qw(filetype_t_to_string);
+push @{$EXPORT_TAGS{"filetype_t"}}, qw(filetype_t_to_string);
 
 my %_filetype_t_VALUES;
-#Convert a flag value to a list of names for flags that are set.
-sub filetype_t_to_strings {
-    my ($flags) = @_;
-    my @result = ();
+#Convert an enum value to a single string
+sub filetype_t_to_string {
+    my ($enumval) = @_;
 
     for my $k (keys %_filetype_t_VALUES) {
        my $v = $_filetype_t_VALUES{$k};
 
        #is this a matching flag?
-       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
-           push @result, $k;
+       if ($enumval == $v) {
+           return $k;
        }
     }
 
-#by default, just return the number as a 1-element list
-    if (!@result) {
-       return ($flags);
-    }
-
-    return @result;
+#default, just return the number
+    return $enumval;
 }
 
 push @EXPORT_OK, qw($F_UNKNOWN);
index e11148c807c26dab62f61064024aca36cde6c72d..b224d38fc2b8e7a243102d35900e9fa08d261169 100644 (file)
@@ -28,7 +28,7 @@
 #include "fileheader.h"
 %}
 
-amglue_add_flag_tag_fns(filetype_t);
+amglue_add_enum_tag_fns(filetype_t);
 amglue_add_constant(F_UNKNOWN, filetype_t);
 amglue_add_constant(F_WEIRD, filetype_t);
 amglue_add_constant(F_TAPESTART, filetype_t);
index fbee47fa130558d8c00a963fa4faffb8904fb419..65ae4ac4e7f4dcd6f282ba5ff10bc836b6082f85 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
index 8918dcf11eef7342134b896d9118dd756624a74d..cc9b5d869eccab38420b44864dc5a56cff34cc9e 100644 (file)
@@ -579,7 +579,8 @@ sub _async_read_cb {
     # and process this data
     $self->{'rx_buffer'} .= $data;
 
-    while (my ($line, $rest) = ($self->{'rx_buffer'} =~ /([^\n]*)\n(.*)/)) {
+    while ($self->{'rx_buffer'} =~ /\n/) {
+       my ($line, $rest) = split '\n', $self->{'rx_buffer'}, 2;
        $self->{'rx_buffer'} = $rest;
        $self->_incoming_line($line);
     }
index 7468d95178cb93b259209fb00350f355800847ef..d997f78a58e23666bd10bf2e668992180bb25162 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -1631,6 +1634,10 @@ static void log_add_(logtype_t typ, char *message)
 {
     log_add(typ, "%s", message);
 }
+static void log_add_full_(logtype_t typ, char *pname, char *message)
+{
+    log_add_full(typ, pname, "%s", message);
+}
 
 
 #include <limits.h>
@@ -1990,6 +1997,89 @@ XS(_wrap_log_add) {
 }
 
 
+XS(_wrap_log_add_full) {
+  {
+    logtype_t arg1 ;
+    char *arg2 = (char *) 0 ;
+    char *arg3 = (char *) 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int res3 ;
+    char *buf3 = 0 ;
+    int alloc3 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 3) || (items > 3)) {
+      SWIG_croak("Usage: log_add_full(typ,pname,message);");
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg1 = amglue_SvI8(ST(0));
+      } else if (sizeof(signed int) == 2) {
+        arg1 = amglue_SvI16(ST(0));
+      } else if (sizeof(signed int) == 4) {
+        arg1 = amglue_SvI32(ST(0));
+      } else if (sizeof(signed int) == 8) {
+        arg1 = amglue_SvI64(ST(0));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "log_add_full" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "log_add_full" "', argument " "3"" of type '" "char *""'");
+    }
+    arg3 = (char *)(buf3);
+    log_add_full_(arg1,arg2,arg3);
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_log_rename) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: log_rename(datestamp);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "log_rename" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    log_rename(arg1);
+    ST(argvi) = sv_newmortal();
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_delete_find_result_t) {
   {
     find_result_t *arg1 = (find_result_t *) 0 ;
@@ -2045,6 +2135,34 @@ XS(_wrap_find_result_t_timestamp_get) {
 }
 
 
+XS(_wrap_find_result_t_write_timestamp_get) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_result_t_write_timestamp_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_write_timestamp_get" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    result = (char *) ((arg1)->write_timestamp);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_find_result_t_hostname_get) {
   {
     find_result_t *arg1 = (find_result_t *) 0 ;
@@ -2845,17 +2963,7 @@ XS(_wrap_dumps_match_dumpspecs) {
       }
     }
     {
-      if (sizeof(signed int) == 1) {
-        arg3 = amglue_SvI8(ST(2));
-      } else if (sizeof(signed int) == 2) {
-        arg3 = amglue_SvI16(ST(2));
-      } else if (sizeof(signed int) == 4) {
-        arg3 = amglue_SvI32(ST(2));
-      } else if (sizeof(signed int) == 8) {
-        arg3 = amglue_SvI64(ST(2));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg3 = SvTRUE(ST(2));
     }
     result = (find_result_t *)dumps_match_dumpspecs(arg1,arg2,arg3);
     {
@@ -3169,8 +3277,11 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Logfilec::close_logfile", _wrap_close_logfile},
 {"Amanda::Logfilec::get_logline", _wrap_get_logline},
 {"Amanda::Logfilec::log_add", _wrap_log_add},
+{"Amanda::Logfilec::log_add_full", _wrap_log_add_full},
+{"Amanda::Logfilec::log_rename", _wrap_log_rename},
 {"Amanda::Logfilec::delete_find_result_t", _wrap_delete_find_result_t},
 {"Amanda::Logfilec::find_result_t_timestamp_get", _wrap_find_result_t_timestamp_get},
+{"Amanda::Logfilec::find_result_t_write_timestamp_get", _wrap_find_result_t_write_timestamp_get},
 {"Amanda::Logfilec::find_result_t_hostname_get", _wrap_find_result_t_hostname_get},
 {"Amanda::Logfilec::find_result_t_diskname_get", _wrap_find_result_t_diskname_get},
 {"Amanda::Logfilec::find_result_t_level_get", _wrap_find_result_t_level_get},
@@ -3653,6 +3764,11 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(P_AMCHECKDUMP)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "P_AMVAULT", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(P_AMVAULT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   SWIG_TypeClientData(SWIGTYPE_p_find_result_t, (void*) "Amanda::Logfile::find_result_t");
   ST(0) = &PL_sv_yes;
   XSRETURN(1);
index 475bb9bd3164f0333ea34a3d932a127daf173736..8a18a8e4778c4def2cea99d44666890c9e57ff68 100644 (file)
@@ -54,6 +54,8 @@ package Amanda::Logfile;
 *close_logfile = *Amanda::Logfilec::close_logfile;
 *get_logline = *Amanda::Logfilec::get_logline;
 *log_add = *Amanda::Logfilec::log_add;
+*log_add_full = *Amanda::Logfilec::log_add_full;
+*log_rename = *Amanda::Logfilec::log_rename;
 *find_log = *Amanda::Logfilec::find_log;
 *search_logfile = *Amanda::Logfilec::search_logfile;
 *search_holding_disk = *Amanda::Logfilec::search_holding_disk;
@@ -84,6 +86,8 @@ sub DESTROY {
 
 *swig_timestamp_get = *Amanda::Logfilec::find_result_t_timestamp_get;
 *swig_timestamp_set = *Amanda::Logfilec::find_result_t_timestamp_set;
+*swig_write_timestamp_get = *Amanda::Logfilec::find_result_t_write_timestamp_get;
+*swig_write_timestamp_set = *Amanda::Logfilec::find_result_t_write_timestamp_set;
 *swig_hostname_get = *Amanda::Logfilec::find_result_t_hostname_get;
 *swig_hostname_set = *Amanda::Logfilec::find_result_t_hostname_set;
 *swig_diskname_get = *Amanda::Logfilec::find_result_t_diskname_get;
@@ -166,6 +170,7 @@ package Amanda::Logfile;
 *P_AMIDXTAPED = *Amanda::Logfilec::P_AMIDXTAPED;
 *P_AMFETCHDUMP = *Amanda::Logfilec::P_AMFETCHDUMP;
 *P_AMCHECKDUMP = *Amanda::Logfilec::P_AMCHECKDUMP;
+*P_AMVAULT = *Amanda::Logfilec::P_AMVAULT;
 *amanda_log_trace_log = *Amanda::Logfilec::amanda_log_trace_log;
 
 @EXPORT_OK = ();
@@ -238,20 +243,41 @@ C<$handle>, or nothing at the end of the logfile.
 
 =back
 
-To write a logfile, call C<log_add($logtype, $string)>.  On the first
-call, this function opens and locks C<$logdir/log>; subsequent calls
-just append to this file.  As such, this function is only appropriate
-for situations where C<amlogroll> will be invoked later to rename
-C<$logdir/log> to C<$logdir/log.$timestamp.$n>.
+=head3 Writing a "current" Logfile
+
+To write a logfile, call C<log_add($logtype, $string)>.  On the first call,
+this function opens and locks C<$logdir/log>; subsequent calls just append to
+this file.  As such, this function is only appropriate for situations where
+C<log_rename> will be invoked later to rename C<$logdir/log> to
+C<$logdir/log.$timestamp.$n>.
+
+If you need to write a log entry for another program, for example to simulate
+taper entries, call C<log_add_full($logtype, $pname, $string)>.
 
 All of the functions in this section can be imported by name if
 desired.
 
+=head3 Utilities
+
+Many trace log entries have a statistics entry in what used to be the error
+message slot, of the form C<[sec .. kb .. kps ..]>.  The function C<make_stats>
+will create such an entry for you:
+
+    make_stats($size, $duration, $orig_kb);
+
+Note that C<$orig_kb> can be undefined, in which case it will not appear in
+the statistics output.
+
 =head2 Amanda::Find::find_result_t objects
 
 These objects contain information about dumps, as read from logfiles.
 Instance variables are:
 
+To rename the current logfile to a datestamped logfile, call C<log_rename($ts)>
+where C<$ts> is the write timestamp for this dump.  The
+C<get_current_log_timestamp()> function will calculate this timestamp,
+returning C<undef> on error.
+
 =over
 
 =item C<timestamp>
@@ -362,7 +388,7 @@ trace log.  Use it like this:
 
 
 push @EXPORT_OK, qw(open_logfile get_logline close_logfile
-    log_add);
+    log_add log_add_full);
 
 push @EXPORT_OK, qw(logtype_t_to_string);
 push @{$EXPORT_TAGS{"logtype_t"}}, qw(logtype_t_to_string);
@@ -574,15 +600,22 @@ push @{$EXPORT_TAGS{"program_t"}}, qw($P_AMCHECKDUMP);
 
 $_program_t_VALUES{"P_AMCHECKDUMP"} = $P_AMCHECKDUMP;
 
+push @EXPORT_OK, qw($P_AMVAULT);
+push @{$EXPORT_TAGS{"program_t"}}, qw($P_AMVAULT);
+
+$_program_t_VALUES{"P_AMVAULT"} = $P_AMVAULT;
+
 #copy symbols in program_t to constants
 push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"program_t"}};
 
-push @EXPORT_OK, qw(find_log search_logfile dumps_match
+push @EXPORT_OK, qw(find_log search_logfile dumps_match log_rename
     match_host match_disk match_datestamp match_level);
 
 push @EXPORT_OK, qw($amanda_log_trace_log);
 
-push @EXPORT_OK, qw(find_all_logs find_latest_log);
+push @EXPORT_OK, qw(find_all_logs find_latest_log
+    get_current_log_timestamp
+    make_stats);
 
 
 sub find_all_logs
@@ -602,4 +635,47 @@ sub find_latest_log
     return $logs[-1];
 }
 
+use Amanda::Config;
+use Amanda::Debug;
+
+sub get_current_log_timestamp
+{
+    my $logfile = Amanda::Config::config_dir_relative(
+               Amanda::Config::getconf($Amanda::Config::CNF_LOGDIR)) . "/log";
+    if (! -f $logfile) {
+       Amanda::Debug::warning("no current logfile '$logfile'");
+       return undef;
+    }
+
+    my $logh = open_logfile("$logfile");
+    if (!$logh) {
+       Amanda::Debug::warning("could not open logfile '$logfile'");
+       return undef;
+    }
+    while (my ($type, $prog, $str) = get_logline($logh)) {
+       if ($type == $L_START) {
+           my ($ts) = ($str =~ /date (\d+)/);
+           return $ts if $ts;
+       }
+    }
+
+    # no timestamp, apparently
+    Amanda::Debug::warning("no current timestamp found in logfile");
+    return undef;
+}
+
+sub make_stats {
+    my ($size, $duration, $orig_kb) = @_;
+
+    $duration = 0.1 if $duration <= 0;  # prevent division by zero
+    my $kb = $size/1024;
+    my $kps = "$kb.0"/$duration; # Perlish cast from BigInt to float
+
+    if (defined $orig_kb) {
+       return sprintf("[sec %f kb %d kps %f orig-kb %d]", $duration, $kb, $kps, $orig_kb);
+    } else {
+       return sprintf("[sec %f kb %d kps %f]", $duration, $kb, $kps);
+    }
+}
+
 1;
index 0663f44560dcaca1f92e7e6beb87399eadc7d8ac..6b5bf32116be36018a142c2f376d54ba13a28f5a 100644 (file)
@@ -86,20 +86,41 @@ C<$handle>, or nothing at the end of the logfile.
 
 =back
 
-To write a logfile, call C<log_add($logtype, $string)>.  On the first
-call, this function opens and locks C<$logdir/log>; subsequent calls
-just append to this file.  As such, this function is only appropriate
-for situations where C<amlogroll> will be invoked later to rename
-C<$logdir/log> to C<$logdir/log.$timestamp.$n>.
+=head3 Writing a "current" Logfile
+
+To write a logfile, call C<log_add($logtype, $string)>.  On the first call,
+this function opens and locks C<$logdir/log>; subsequent calls just append to
+this file.  As such, this function is only appropriate for situations where
+C<log_rename> will be invoked later to rename C<$logdir/log> to
+C<$logdir/log.$timestamp.$n>.
+
+If you need to write a log entry for another program, for example to simulate
+taper entries, call C<log_add_full($logtype, $pname, $string)>.
 
 All of the functions in this section can be imported by name if
 desired.
 
+=head3 Utilities
+
+Many trace log entries have a statistics entry in what used to be the error
+message slot, of the form C<[sec .. kb .. kps ..]>.  The function C<make_stats>
+will create such an entry for you:
+
+    make_stats($size, $duration, $orig_kb);
+
+Note that C<$orig_kb> can be undefined, in which case it will not appear in
+the statistics output.
+
 =head2 Amanda::Find::find_result_t objects
 
 These objects contain information about dumps, as read from logfiles.
 Instance variables are:
 
+To rename the current logfile to a datestamped logfile, call C<log_rename($ts)>
+where C<$ts> is the write timestamp for this dump.  The
+C<get_current_log_timestamp()> function will calculate this timestamp,
+returning C<undef> on error.
+
 =over
 
 =item C<timestamp>
index ba04a02c99c59d6aabb61aeaa5d5203d42efd8b6..69b0846ab720a3b3acf41822412b4cac2ab01f22 100644 (file)
@@ -35,7 +35,7 @@
 
 amglue_export_ok(
     open_logfile get_logline close_logfile
-    log_add
+    log_add log_add_full
 );
 
 
@@ -76,6 +76,7 @@ amglue_add_constant(P_AMDUMP, program_t);
 amglue_add_constant(P_AMIDXTAPED, program_t);
 amglue_add_constant(P_AMFETCHDUMP, program_t);
 amglue_add_constant(P_AMCHECKDUMP, program_t);
+amglue_add_constant(P_AMVAULT, program_t);
 amglue_copy_to_tag(program_t, constants);
 
 /* TODO: support for writing logfiles is omitted for the moment. */
@@ -115,13 +116,20 @@ typedef int LOGLINE_RETURN;
 LOGLINE_RETURN get_logline(FILE *logfile);
 
 %rename(log_add) log_add_;
+%rename(log_add_full) log_add_full_;
 %inline %{
 static void log_add_(logtype_t typ, char *message)
 {
     log_add(typ, "%s", message);
 }
+static void log_add_full_(logtype_t typ, char *pname, char *message)
+{
+    log_add_full(typ, pname, "%s", message);
+}
 %}
 
+void log_rename(char *datestamp);
+
 typedef struct {
     %extend {
        /* destructor */
@@ -133,6 +141,7 @@ typedef struct {
 
     %immutable;
     char *timestamp;
+    char *write_timestamp;
     char *hostname;
     char *diskname;
     int level;
@@ -240,7 +249,7 @@ typedef struct {
 }
 
 amglue_export_ok(
-    find_log search_logfile dumps_match
+    find_log search_logfile dumps_match log_rename
     match_host match_disk match_datestamp match_level
 );
 
@@ -296,6 +305,8 @@ amglue_export_ok(
 
 amglue_export_ok(
     find_all_logs find_latest_log
+    get_current_log_timestamp
+    make_stats
 );
 
 %perlcode %{
@@ -317,4 +328,47 @@ sub find_latest_log
     return $logs[-1];
 }
 
+use Amanda::Config;
+use Amanda::Debug;
+
+sub get_current_log_timestamp
+{
+    my $logfile = Amanda::Config::config_dir_relative(
+               Amanda::Config::getconf($Amanda::Config::CNF_LOGDIR)) . "/log";
+    if (! -f $logfile) {
+       Amanda::Debug::warning("no current logfile '$logfile'");
+       return undef;
+    }
+
+    my $logh = open_logfile("$logfile");
+    if (!$logh) {
+       Amanda::Debug::warning("could not open logfile '$logfile'");
+       return undef;
+    }
+    while (my ($type, $prog, $str) = get_logline($logh)) {
+       if ($type == $L_START) {
+           my ($ts) = ($str =~ /date (\d+)/);
+           return $ts if $ts;
+       }
+    }
+
+    # no timestamp, apparently
+    Amanda::Debug::warning("no current timestamp found in logfile");
+    return undef;
+}
+
+sub make_stats {
+    my ($size, $duration, $orig_kb) = @_;
+
+    $duration = 0.1 if $duration <= 0;  # prevent division by zero
+    my $kb = $size/1024;
+    my $kps = "$kb.0"/$duration; # Perlish cast from BigInt to float
+
+    if (defined $orig_kb) {
+       return sprintf("[sec %f kb %d kps %f orig-kb %d]", $duration, $kb, $kps, $orig_kb);
+    } else {
+       return sprintf("[sec %f kb %d kps %f]", $duration, $kb, $kps);
+    }
+}
+
 %}
index ce0ba3fb8250860db0b66ca1bbb1e7426d85194c..ebffa29f20ec8ea923df03803aa52ef25eae6d9b 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
index c26ba917452a3d9e732c1ec20ba2abc29387eb83..5fbec198e81b2f8c0ba64526fd90d2611ad3c346 100644 (file)
@@ -437,7 +437,7 @@ first step defined will be called automatically.
        my ($hostname, $port, $data, $sendfile_cb) = @_;
        my ($addr, $socket); # shared lexical variables
        my $steps = define_steps
-               cb => \$sendfile_cb;
+               cb_ref => \$sendfile_cb;
        step lookup_addr => sub {
            return async_gethostbyname(hostname => $hostname,
                                ghbn_cb => $steps->{'got_addr'});
@@ -490,7 +490,7 @@ achieve this for all callbacks, add C<< immediate => 1 >> to the C<define_steps>
 invocation:
 
     my $steps = define_steps
-           cb => $finished_cb,
+           cb_ref => \$finished_cb,
            immediate => 1;
 
 To do the same for a single step, add the same keyword to the C<step> invocation:
@@ -509,7 +509,7 @@ commands simultaneously and capture their output:
        my $running_commands = 0;
        my ($result1, $result2);
        my $steps = define_steps
-           cb_ref => $finished_cb;
+           cb_ref => \$finished_cb;
        step start => sub {
            $running_commands++;
            run_command($command1,
@@ -518,15 +518,15 @@ commands simultaneously and capture their output:
            run_command($command2,
                run_cb => $steps->{'command2_done'});
        };
-       step command1_done {
+       step command1_done => sub {
            $result1 = $_[0];
            $steps->{'maybe_done'}->();
        };
-       step command2_done {
+       step command2_done => sub {
            $result2 = $_[0];
            $steps->{'maybe_done'}->();
        };
-       step maybe_done {
+       step maybe_done => sub {
            return if --$running_commands; # not done yet
            $finished_cb->($result1, $result2);
        };
index a752b608052c1981d68fddb8cb5ea999eb80dca4..d47a732d03eca627a7dcba771ca120daa19b66f3 100644 (file)
@@ -347,7 +347,7 @@ first step defined will be called automatically.
        my ($hostname, $port, $data, $sendfile_cb) = @_;
        my ($addr, $socket); # shared lexical variables
        my $steps = define_steps
-               cb => \$sendfile_cb;
+               cb_ref => \$sendfile_cb;
        step lookup_addr => sub {
            return async_gethostbyname(hostname => $hostname,
                                ghbn_cb => $steps->{'got_addr'});
@@ -400,7 +400,7 @@ achieve this for all callbacks, add C<< immediate => 1 >> to the C<define_steps>
 invocation:
 
     my $steps = define_steps
-           cb => $finished_cb,
+           cb_ref => \$finished_cb,
            immediate => 1;
 
 To do the same for a single step, add the same keyword to the C<step> invocation:
@@ -419,7 +419,7 @@ commands simultaneously and capture their output:
        my $running_commands = 0;
        my ($result1, $result2);
        my $steps = define_steps
-           cb_ref => $finished_cb;
+           cb_ref => \$finished_cb;
        step start => sub {
            $running_commands++;
            run_command($command1,
@@ -428,15 +428,15 @@ commands simultaneously and capture their output:
            run_command($command2,
                run_cb => $steps->{'command2_done'});
        };
-       step command1_done {
+       step command1_done => sub {
            $result1 = $_[0];
            $steps->{'maybe_done'}->();
        };
-       step command2_done {
+       step command2_done => sub {
            $result2 = $_[0];
            $steps->{'maybe_done'}->();
        };
-       step maybe_done {
+       step maybe_done => sub {
            return if --$running_commands; # not done yet
            $finished_cb->($result1, $result2);
        };
index a552469dcddf0b5ae4ada2b3c80ba74cefe70536..527a74cba90fc3a38109c73dad53f5fc025e0bac 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -2050,17 +2053,7 @@ XS(_wrap_NDMPConnection_set_verbose) {
     }
     arg1 = (NDMPConnection *)(argp1);
     {
-      if (sizeof(signed int) == 1) {
-        arg2 = amglue_SvI8(ST(1));
-      } else if (sizeof(signed int) == 2) {
-        arg2 = amglue_SvI16(ST(1));
-      } else if (sizeof(signed int) == 4) {
-        arg2 = amglue_SvI32(ST(1));
-      } else if (sizeof(signed int) == 8) {
-        arg2 = amglue_SvI64(ST(1));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg2 = SvTRUE(ST(1));
     }
     NDMPConnection_set_verbose(arg1,arg2);
     ST(argvi) = sv_newmortal();
index 7f193bc84d853bf8b2b0bec67f3784f139fb3f9e..1c462aca4ab02ea3826d98d86e7c7763af5915aa 100644 (file)
@@ -179,10 +179,10 @@ user-defined feedback object should inherit from
 C<Amanda::Recovery::Clerk::Feedback>, which implements no-op versions of all of
 the methods.
 
-The C<notif_part> method is called just before each part is restored, and is
+The C<clerk_notif_part> method is called just before each part is restored, and is
 given the label, filenum, and header.  Its return value, if any, is ignored.
-Similarly, C<notif_holding> is called for a holding-disk recovery and is given
-the holding filename and its header.  Note that C<notif_holding> is called
+Similarly, C<clerk_notif_holding> is called for a holding-disk recovery and is given
+the holding filename and its header.  Note that C<clerk_notif_holding> is called
 before the C<xfer_src_cb>, since data will begin flowing from a holding disk
 immediately when the transfer is started.
 
@@ -190,7 +190,7 @@ A typical Clerk feedback class might look like:
 
     use base 'Amanda::Recovery::Clerk::Feedback';
 
-    sub part_notif {
+    sub clerk_notif_part {
        my $self = shift;
        my ($label, $filenum, $hdr) = @_;
        print "restoring part ", $hdr->{'partnum'},
@@ -551,7 +551,7 @@ sub _maybe_start_part {
 
        } else {
            # notify caller of the part
-           $self->{'feedback'}->notif_part($next_label, $next_filenum, $on_vol_hdr);
+           $self->{'feedback'}->clerk_notif_part($next_label, $next_filenum, $on_vol_hdr);
 
            # start the part
            $self->dbg("reading file $next_filenum on '$next_label'");
@@ -574,6 +574,9 @@ sub _maybe_start_part {
            return $steps->{'handle_error'}->();
        }
 
+       # remove CONT_FILENAME from the header, since it's not needed anymore
+       $on_disk_hdr->{'cont_filename'} = '';
+
        if (!$self->_header_expected($on_disk_hdr)) {
            # _header_expected already pushed an error message or two
            return $steps->{'handle_error'}->();
@@ -591,7 +594,7 @@ sub _maybe_start_part {
            $xfer_state->{'xfer_src_ready'} = 1;
 
            # notify caller of the part, *before* xfer_src_cb is called!
-           $self->{'feedback'}->notif_holding($next_filename, $on_disk_hdr);
+           $self->{'feedback'}->clerk_notif_holding($next_filename, $on_disk_hdr);
 
            $self->dbg("successfully located holding file for recovery");
            $cb->(undef, $on_disk_hdr, $xfer_state->{'xfer_src'}, 0);
@@ -622,6 +625,14 @@ sub _maybe_start_part {
     };
 }
 
+sub _zeropad {
+    my ($timestamp) = @_;
+    if (length($timestamp) == 8) {
+       return $timestamp."000000";
+    }
+    return $timestamp;
+}
+
 sub _header_expected {
     my $self = shift;
     my ($on_vol_hdr) = @_;
@@ -637,7 +648,10 @@ sub _header_expected {
        push @errs, "got disk '$on_vol_hdr->{disk}'; " .
                    "expected '$next_part->{dump}->{diskname}'";
     }
-    if ($on_vol_hdr->{'datestamp'} ne $next_part->{'dump'}->{'dump_timestamp'}) {
+    # zeropad the datestamps before comparing them, to avoid any compliations
+    # from usetimestamps=0
+    if (_zeropad($on_vol_hdr->{'datestamp'})
+       ne _zeropad($next_part->{'dump'}->{'dump_timestamp'})) {
        push @errs, "got datestamp '$on_vol_hdr->{datestamp}'; " .
                    "expected '$next_part->{dump}->{dump_timestamp}'";
     }
@@ -681,8 +695,8 @@ sub new {
     return bless {}, shift;
 }
 
-sub notif_part { }
+sub clerk_notif_part { }
 
-sub notif_holding { }
+sub clerk_notif_holding { }
 
 1;
index c0e0a9dc8fb5443445495fa4f85bdb3687d86fcc..03cb3e6acee512d71748975f9601d089456b52af 100644 (file)
@@ -41,7 +41,7 @@ Amanda::Recovery::Planner - use the catalog to plan recoveries
     });
 
     $subs{'start_next_dumpfile'} = make_cb(start_next_dumpfile => sub {
-       my $dump = $plan->shift_dump();
+       my $dump = shift @{$plan->{'dumps'}};
        if (!$dump) {
            # .. all done!
        }
@@ -183,9 +183,9 @@ sub make_plan {
        one_dump_per_part => $params{'one_dump_per_part'},
     });
 
-    if ($params{'holding_file'}) {
+    if (exists $params{'holding_file'}) {
        $plan->make_holding_plan(%params);
-    } elsif ($params{'filelist'}) {
+    } elsif (exists $params{'filelist'}) {
        $plan->make_plan_from_filelist(%params);
     } else {
        $plan->make_plan(%params);
@@ -219,6 +219,11 @@ sub new {
     return bless($self, $class);
 }
 
+sub shift_dump {
+    my $self = shift;
+    return shift @{$self->{'dumps'}};
+}
+
 sub make_plan {
     my $self = shift;
     my %params = @_;
@@ -284,7 +289,7 @@ sub make_plan {
     # the part's filenum.  This should sort the dumps into the order in which
     # they were written, with holding dumps coming in at the head of the list.
     my $tapelist_filename = config_dir_relative(getconf($CNF_TAPELIST));
-    my $tapelist = Amanda::Tapelist::read_tapelist($tapelist_filename);
+    my $tapelist = Amanda::Tapelist->new($tapelist_filename);
 
     my $sortfn = sub {
        my $rv;
@@ -409,13 +414,13 @@ sub make_plan_from_filelist {
            labels => [ @labels ]);
 
     # filter down to the parts that match filelist (using %files)
-    my $in_filelist = sub {
+    @parts = grep {
        my $filenum = $_->{'filenum'};
        grep { $_ == $filenum } @{$files{$_->{'label'}}};
-    };
-    @parts = grep $in_filelist, @parts;
+    } @parts;
 
-    # extract the dumps, using a hash to ensure uniqueness
+    # extract the dumps, using a hash (on the perl identity of the dump) to
+    # ensure uniqueness
     my %dumps = map { my $d = $_->{'dump'}; ($d, $d) } @parts;
     my @dumps = values %dumps;
 
index 8eb1327d083a08f2f09d2cbd3939d4e9c81dc919..e312d4758d57f2548076e04d56a25b08f7eb02a9 100644 (file)
@@ -645,6 +645,9 @@ sub _find_volume_no_inventory {
 
        if ($err) {
            if ($err->failed && $err->notfound) {
+               if ($err->{'message'} eq "all slots have been loaded") {
+                   $err->{'message'} = "label '$label' not found";
+               }
                return $params{'res_cb'}->($err, undef);
            } elsif ($err->failed && $err->volinuse and defined $err->{'slot'}) {
                $last_slot = $err->{'slot'};
index a94912aaa9a2cd925892a546834196585e205516..48bd05a72eb6470ec90b4f032f9b2105dea53b51 100644 (file)
@@ -43,7 +43,9 @@ This module reads the logfile passed to it and aggregates the data in
 a format of nested hashes for convenient output.  All data read in is
 stored in C<< $report->{data} >>.
 
-=head2 my $report = Amanda::Report->new($logfile, $historical);
+=head2 Creating a Report
+
+  my $report = Amanda::Report->new($logfile, $historical);
 
 The constructor reads the logfile and produces the report, which can then be
 queried with the other methods.  C<$logfile> should specify the path to the
@@ -52,25 +54,31 @@ logfile, then C<$historical> should be false.  Non-historical reports may draw
 information from the current Amanda environment, e.g., holding disks and info
 files.
 
-=head2 my $datestamp = $report->get_timestamp();
+=head2 Summary Information
+
+Note that most of the data provided by these methods is simply a reference to
+data stored within the report, and should thus be considered read-only.  For
+example, do not use C<shift> or C<pop> to destructively consume lists.
+
+  my $datestamp = $report->get_timestamp();
 
 This returns the run timestamp for this dump run.  This is determined from one
 of several START entries.  This returns a full 14-digit timestamp regardless of
 the setting of C<usetimestamps> now or during the dump run.
 
-=head2 my @hosts = $report->get_hosts();
+  my @hosts = $report->get_hosts();
 
 This method returns a list containing the hosts that have been seen in
 a logfile.  In a scalar context, C<get_hosts> returns the number of
 hosts seen.
 
-=head2 my @disks = $report->get_disks($hostname);
+  my @disks = $report->get_disks($hostname);
 
 This method returns a list of disks that were archived under the given
 C<$hostname>.  In a scalar context, this method returns the number of
 disks seen, belonging to the hostname.
 
-=head2 my @dles = $report->get_dles();
+  my @dles = $report->get_dles();
 
 This method returns a list of list references.  Each referenced list
 contains a hostname & disk pair that has been reported by either the
@@ -85,70 +93,153 @@ in the logfile.
         [ 'example3', '/var/www' ],
     );
 
-=head2 my $dle = $report->get_dle_info($hostname, $disk [,$field] );
+  if ( $report->get_flag($flag) ) { ... }
+
+The C<get_flag> method accesses a number of flags that represent the state of
+the dump.  A true value is returned if the flag is set, and undef otherwise.
+The available flags are:
+
+=over
 
-This method returns all the information stored in the per-DLE section
-for the given C<$hostname> and C<disk>.  The returned value is a hash
-reference to the data as it is stored in the internal data
-structure. Modifying the return value will modify the values in the
-C<Amanda::Report> object.
+=item C<got_finish>
 
-=head2 my $info = $report->get_program_info($program [,$field, $default] );
+This flag is true when the driver finished
+correctly.  It indicates that the dump run has finished and cleaned
+up.
+
+=item C<degraded_mode>
+
+This flag is set if the taper encounters an
+error that forces it into degraded mode.
 
-This method returns a reference to the data for the given C<$program>.
-If the optional argument C<$field> is provided, that field in the
-indicated program is returned.  If the key C<$field> does not exist in
-the program, then it is inserted with the value C<$default>, The
-returned value is a reference to the internal C<Amanda::Report> data
-structure and will in turn modify the C<$report> object.
+=item C<amflush_run>
 
-=head2 if ( $report->get_flag($flag) ) { ... }
+This flag is set if amflush is run instead of planner.
 
-This method accesses a number of flags that represent the state of the
-dump.  A true value is returned if the flag is set, and undef
-otherwise.
+=item C<amvault_run>
+
+This flag is set if the run was by amvault.
+
+=item C<normal_run>
+
+This flag is set when planner is run.  Its value
+should be opposite of C<amflush_run>.
+
+=item C<dump_failed>
+
+If a dump failed.
+
+=item C<dump_strange>
+
+If a dump end in strange result.
+
+=item C<results_missing>
+
+If this was a normal run, but some DLEs named by the
+planner do not have any results, then this flag is set.  Users should look for
+DLEs with an empty C<dump> key to enumerate the missing results.
+
+=item C<historical>
+
+This flag is set if this is a "historical" report.  It is
+based on the value passed to the constructor.
+
+=back
+
+=head2 Report Data
+
+  my $dle = $report->get_dle_info($hostname, $disk [,$field] );
+
+This method returns the DLE information for the given C<$hostname> and C<disk>,
+or if C<$field> is given, returns that field of the DLE information.  See the
+DATA DESCRIPTION section for the format of this information.
+
+  my $info = $report->get_program_info($program [,$field] );
+
+This method returns the program information for the given C<$program>, or if
+C<$field> is given, returns that field of the DLE information.  See the DATA
+DESCRIPTION section for the format of this information.
 
 =head1 DATA DESCRIPTION
 
-The data in the logfile is stored in the module at
-C<< $report->{data} >>.  Beyond that, there are a number of subdivisions
-that track both global and per-host status of the given Amanda run that
-the logfile represents.
+=head2 Top Level
+
+The data in the logfile is stored in the module at C<< $report->{data} >>.
+Beneath that, there are a number of subdivisions that track both global and
+per-host status of the given Amanda run that the logfile represents.  Note that
+these subdivisions are usually accessed via C<get_dle_info> and
+C<get_program_info>, as described above.
 
-=head2 $data->{programs}
+  $data->{programs}
 
 the C<programs> key of the data points to a hash of global program
-data, with one element per program.  A number of fields are common
-across all of the different programs.
+information, with one element per program.  See the Programs section, below.
+
+  $data->{boguses}
+
+The C<boguses> key refers to a list of arrayrefs of the form
+
+  [$prog, $type, $str]
+
+as returned directly by C<Amanda::Logfile::get_logline>.  These lines are not
+in a recognized trace log format.
+
+  $data->{disklist}
+
+The C<disklist> key points to a two-level hash of hostnames and
+disknames as present in the logfile.  It looks something like this:
+
+    $report->{data}{disklist} = {
+        "server.example.org" => {
+            "/home" => {...},
+            "/var"  => {...},
+        },
+        "workstation.example.org" => {
+            "/etc"     => {...},
+            "/var/www" => {...},
+        },
+    };
+
+Each C<{...}> in the above contains information about the corresponding DLE.  See DLEs, below.
+
+=head2 Programs
+
+Each program involved in a dump has a hash giving information about its
+performance during the run.  A number of fields are common across all of the
+different programs:
 
 =over
 
-=item C<start> - the numeric timestamp at which the process was
-started.
+=item C<start>
 
-=item C<time> - the length of time (in seconds) that the program ran.
+the numeric timestamp at which the process was started.
 
-=item C<notes> - a list which stores all notes reported to the logfile
+=item C<time>
+
+the length of time (in seconds) that the program ran.
+
+=item C<notes>
+
+a list which stores all notes reported to the logfile
 by the corresponding program.
 
-=item C<errors> - a list which stores all errors reported to the
+=item C<errors>
+
+a list which stores all errors reported to the
 logfile by the corresponding program.
 
 =back
 
-In the below, assume
-
-  my $programs = $report->{data}{programs}
+Program-specific fields are described in the following sections.
 
-=head3 $programs->{planner}
+=head3 planner
 
-The planner logs very little DLE-specific information other than
-determining what will be backed up.  It has no special fields other
-than those given above.
+The planner logs very little information other than determining what will be
+backed up.  It has no special fields other than those given above.
 
-=head3 $programs->{driver}
+=head3 driver
 
-The driver has one unique field that the other program-specific
+The driver has one field that the other program-specific
 entries do not:
 
 =over
@@ -157,35 +248,28 @@ entries do not:
 
 =back
 
-=head3 $programs->{amflush}
+=head3 amflush and amdump
 
-When amflush is present, it records what disklist entries need to be
-processed instead of the planner.  It also has no special fields.
+No special fields.
 
-=head3 $programs->{amdump}
-
-This program is a control program that spawns off dumper programs.  It
-has no special fields.
-
-=head3 $programs->{dumper} and $programs->{chunker}
+=head3 dumper and chunker
 
 Most of the chunker's output and the dumper's output can be tied to a
-particular DLE, so their C<programs> hashes are limited to C<notes>
-and C<errors>.
+particular DLE, so their C<programs> hashes are limited to C<notes> and
+C<errors>.
 
-=head3 $programs->{taper}
+=head3 taper
 
-The taper hash holds notes and errors for the per-instance runs of the
-taper program, but also has a unique field which tracks the tapes seen
-in the logfile:
+The taper hash holds notes and errors for the per-instance runs of the taper
+program, but also tracks the tapes seen in the logfile:
 
 =over
 
 =item C<tapes>
 
-The C<tapes> field is a hash reference keyed by the label of the tape.
+This field is a hash reference keyed by the label of the tape.
 each value of the key is another hash which stores date, size, and the
-number of files seen by this backup on the tape.  Here is an example:
+number of files seen by this backup on the tape.  For example:
 
     $report->{data}{programs}{taper}{tapes} = {
         FakeTape01 => {
@@ -202,151 +286,126 @@ number of files seen by this backup on the tape.  Here is an example:
 
 The C<tape_labels> field is a reference to a list which records the
 order that the tapes have been seen.  This list should be used as an
-index for outputting the contents of C<tapes>.
+ordered index for C<tapes>.
 
 =back
 
-=head2 $data->{boguses}
+=head2 DLEs
 
-The C<boguses> key refers to a list of arrayrefs of the form
-
-  [$prog, $type, $str]
+In the below, C<$dle> is the hash representing one disklist entry.
 
-as returned directly by C<Amanda::Logfile::get_logline>.  These lines were not
-parseable because they were not in a recognized format of loglines.
+The C<estimate> key describes the estimate given by the planner.  For
+example:
 
-=head2 $data->{disklist}
+    $dle->{estimate} = {
+       level => 0,     # the level of the backup
+       sec   => 20,    # estimated time to back up (seconds)
+       nkb   => 2048,  # expected uncompressed size (kb)
+       ckb   => 1293,  # expected compressed size (kb)
+       kps   => 934.1, # speed of the backup (kb/sec)
+    };
 
-The C<disklist> key points to a two-level hash of hostnames and
-disknames as present in the logfile.  It looks something like this:
+Each dump of the DLE is represented in C<< $dle->{dumps} >>.  This is a hash,
+keyed by dump timestamp with a list of tries as the value for each dump.  Each
+try represents a specific attempt to finish writing this dump to a volume.  If
+an error occurs during the backup of a DLE and is retried, a second try is
+pushed to the tries list.  For example:
 
-    $report->{data}{disklist} = {
-        "server.example.org" => {
-            "/home" => {...},
-            "/var"  => {...},
-        },
-        "workstation.example.org" => {
-            "/etc"     => {...},
-            "/var/www" => {...},
-        },
+    $dle->{dumps} = {
+       '20100317142122' => [ $try1 ],
+       '20100318141930' => [ $try1, $try2 ],
     };
 
-In the below, C<$dle> represents one disklist entry (C<{ ... }> in the
-above).  Each DLE has three major components: estimates, tries, and
-parts.
+=head3 Tries
 
-=head3 Estimates
+A try is a hash with at least one dumper, taper, and/or chunker DLE program as
+a key.  These entries contain the results from the associated program during
+try.
 
-The value of C<< $dle->{estimate} >> describes the estimate given by
-the planner.
+There are a number of common fields between all three elements:
 
-    $dle->{estimate} = {
-       level => "0",    # the level of the backup
-       sec   => "20",   # estimated time to back up (seconds)
-       nkb   => "2048", # expected uncompressed size (kb)
-       ckb   => "",     # expected compressed size (kb)
-       kps   => "",     # speed of the backup (kb/sec)
-    };
+=over
 
-=head3 Tries
+=item C<date>
 
-Tries are located at C<< $dle->{tries} >>.  This is a list of tries,
-each of which is a hash that represents a specific attempt to back up
-this DLE.  If an error occurs during the backup of a DLE and is
-retried, a second try is pushed to the tries list.
+a timestamp of when the program finished (if the program exited)
 
-A try is a hash with at least one dumper, taper, and/or chunker DLE
-program as a key.  These entries contain the exit conditions of that
-particular program for that particular try.
+=item C<status>
 
-There are a number of common fields between all three elements:
+the status of the dump at this program on this try ("success", "partial",
+"done", or "failed").  The planner adds an extra "skipped" status which is
+added when the planner decides to skip a DLE due to user configuration (e.g.,
+C<skipincr>).
 
-=over
+=item C<level>
 
-=item C<date> - a timestamp of when the program finished.
+the incremental level of the backup.
 
-=item C<status> - the exit status of the program on this try.
+=item C<sec>
 
-=item C<level> - the incremental level of the backup.
+the time in seconds for the program to finish.
 
-=item C<sec> - the time in seconds for the program to finish.
+=item C<kb>
 
-=item C<kb> - the size of the data dumped in kb.
+the size of the data dumped in kb.
 
-=item C<kps> - the rate at which the program was able to process data,
+=item C<kps>
+
+the rate at which the program was able to process data,
 in kb/sec.
 
-=item C<error> - if the program fails, this field is set to record the
-error message.
+=item C<error>
+
+if the program fails, this field contains the error message
 
 =back
 
-The C<dumper> hash has an C<orig_kb> field, giving the size of the
-data dumped from the source, before any compression. If encountered,
-the C<dumper> hash may also contain a C<stranges> field, which is a
-list reference to all the messages of type C<L_STRANGE> encountered
-during the process.
+The C<dumper> hash has an C<orig_kb> field, giving the size of the data dumped
+from the source, before any compression. If encountered, the C<dumper> hash may
+also contain a C<stranges> field, which is a list of all the messages of type
+C<L_STRANGE> encountered during the process.
 
-The C<taper> hash contains all the exit status data given by the
-taper.  Because the taper has timestamped parts, the program itself
-does not have a C<date> field.  Taper has one unique field, C<parts>,
-which is a reference to a list of hash references which describe the
-parts that have been taped during execution.
+The C<taper> hash contains all the exit status data given by the taper.
+Because the same taper process handles multiple dumps, it does not have a
+C<date> field.  However, the taper does have an additional field, C<parts>,
+containing a list of parts written for this dump.
 
 =head3 Parts
 
-Every taper process logs the parts it writes to tape in a list located
-at C<$taper->{parts}>.  Each item in the list is a hash reference with
-the following fields:
+Each item in the list of taper parts is a hash with the following
+fields:
 
 =over
 
-=item C<label> - the name of the tape that the part was written to.
+=item C<label>
 
-=item C<date> - the datestamp at which this part was written.
+the name of the tape that the part was written to.
 
-=item C<file> - the filename of the part.
+=item C<date>
 
-=item C<part> - the sequence number of the part for the DLE that the
-part is archiving.
+the datestamp at which this part was written.
 
-=item C<sec> - the length of time, in seconds, that the part took to
-be written.
+=item C<file>
 
-=item C<kb> - the total size of the part.
+the filename of the part.
 
-=item C<kps> - the speed at which the part was written.
+=item C<part>
 
-=back
-
-=head1 FLAGS
-
-During the reading of a logfile, the module will set and unset a
-number of flags to indicate the state of the backup.  These are used
-to indicate the type of backup or the conditions of success.
+the sequence number of the part for the DLE that the
+part is archiving.
 
-The following is a list of currently recognized flags:
+=item C<sec>
 
-=over
+the length of time, in seconds, that the part took to
+be written.
 
-=item C<got_finish> - This flag is true when the driver finished
-correctly.  It indicates that the dump run has finished and cleaned
-up.
+=item C<kb>
 
-=item C<degraded_mode> - This flag is set if the taper encounters an
-error that forces it into degraded mode.
+the total size of the part.
 
-=item C<amflush_run> - This flag is set if amflush is run instead of planner.
+=item C<kps>
 
-=item C<normal_run> - This flag is set when planner is run.  Its value
-should be opposite of C<amflush_run>.
-
-=item C<results_missing> - If this was a normal run, but some DLEs named by the
-planner do not have any results, then this flag is set.  Users should look for
-DLEs with empty C<tries> to enumerate the missing results.
-
-=item C<historical> - This flag is set if this is a "historical" report.  It is
-based on the value passed to the constructor.
+the speed at which the part was written.
 
 =back
 
@@ -398,6 +457,9 @@ sub read_file
       or die "cannot open '$logfname': $!";
 
     $self->{flags}{exit_status} = 0;
+    $self->{flags}{results_missing} = 0;
+    $self->{flags}{dump_failed} = 0;
+    $self->{flags}{dump_strange} = 0;
 
     while ( my ( $type, $prog, $str ) = Amanda::Logfile::get_logline($logfh) ) {
         $self->read_line( $type, $prog, $str );
@@ -407,17 +469,21 @@ sub read_file
 
     $self->{flags}{historical} = $self->{_historical};
     $self->{flags}{amflush_run} = 0;
-    if (
-        !$self->get_flag("normal_run")
-        && (   ( defined $self->get_program_info("amflush") )
-            && ( scalar %{ $self->get_program_info("amflush") } ) )
-      ) {
-       debug("detected an amflush run");
-        $self->{flags}{amflush_run} = 1;
+    $self->{flags}{amvault_run} = 0;
+    if (!$self->get_flag("normal_run")) {
+        if (   ( defined $self->get_program_info("amflush") )
+            && ( scalar %{ $self->get_program_info("amflush") } ) ) {
+           debug("detected an amflush run");
+           $self->{flags}{amflush_run} = 1;
+       } elsif (   ( defined $self->get_program_info("amvault") )
+                 && ( scalar %{ $self->get_program_info("amvault") } ) ) {
+           debug("detected an amvault run");
+           $self->{flags}{amvault_run} = 1;
+       }
     }
 
-    # check for missing results
-    $self->check_missing() if $self->get_flag('normal_run');
+    # check for missing, fail and strange results
+    $self->check_missing_fail_strange() if $self->get_flag('normal_run');
 
     # clean up any temporary values in the data
     $self->cleanup();
@@ -467,6 +533,9 @@ sub read_line
     } elsif ( $prog == $P_AMFLUSH ) {
         return $self->_handle_amflush_line( $type, $str );
 
+    } elsif ( $prog == $P_AMVAULT ) {
+        return $self->_handle_amvault_line( $type, $str );
+
     } elsif ( $prog == $P_AMDUMP ) {
         return $self->_handle_amdump_line( $type, $str );
 
@@ -556,7 +625,7 @@ sub get_tape
         push @$tape_labels, $label;
         $tapes->{$label} = {date => "",
                            kb => 0,
-                           files => "",
+                           files => 0,
                            dle => 0,
                            time => 0};
     }
@@ -598,6 +667,9 @@ sub _handle_planner_line
     } elsif ( $type == $L_DISK ) {
         return $self->_handle_disk_line( "planner", $str );
 
+    } elsif ( $type == $L_SUCCESS ) {
+        return $self->_handle_success_line( "planner", $str );
+
     } elsif ( $type == $L_ERROR ) {
         return $self->_handle_error_line( "planner", $str );
 
@@ -721,7 +793,7 @@ sub _handle_dumper_line
         $orig_kb =~ s{\]$}{};
 
         my $dle    = $disklist->{$hostname}->{$disk};
-        my $try    = $self->_get_try( $dle, "dumper" );
+        my $try    = $self->_get_try( $dle, "dumper", $self->{'run_timestamp'});
         my $dumper = $try->{dumper} ||= {};
        $dumper->{level} = $level;
        $dumper->{status} = 'strange';
@@ -748,7 +820,7 @@ sub _handle_dumper_line
         $orig_kb =~ s{\]$}{};
 
         my $dle    = $disklist->{$hostname}->{$disk};
-        my $try    = $self->_get_try( $dle, "dumper" );
+        my $try    = $self->_get_try( $dle, "dumper", $timestamp );
         my $dumper = $try->{dumper} ||= {};
 
         $dumper->{date}      = $timestamp;
@@ -787,7 +859,7 @@ sub _handle_chunker_line
     if ( $type == $L_INFO ) {
         return $self->_handle_info_line( "chunker", $str );
 
-    } elsif ( $type == $L_SUCCESS || $L_PARTIAL ) {
+    } elsif ( $type == $L_SUCCESS || $type == $L_PARTIAL ) {
 
         my @info = Amanda::Util::split_quoted_strings($str);
         my ( $hostname, $disk, $timestamp, $level ) = @info[ 0 .. 3 ];
@@ -795,7 +867,7 @@ sub _handle_chunker_line
         $kps =~ s{\]$}{};
 
         my $dle     = $disklist->{$hostname}->{$disk};
-        my $try     = $self->_get_try( $dle, "chunker" );
+        my $try     = $self->_get_try( $dle, "chunker", $timestamp );
         my $chunker = $try->{chunker} ||= {};
 
         $chunker->{date}  = $timestamp;
@@ -861,15 +933,8 @@ sub _handle_taper_line
         $kps =~ s{\]$}{};
         $orig_kb =~ s{\]$}{} if defined($orig_kb);
 
-       if (!$self->{'_current_tape'} || $label ne $self->{'_current_tape'}->{'label'}) {
-           warning("corrupted logfile - PART or PARTPARTIAL does not match previous START taper");
-       }
-
-       # count this as a filesystem if this is the first part
-        $self->{'_current_tape'}->{dle}++ if $currpart == 1;
-
         my $dle   = $disklist->{$hostname}{$disk};
-        my $try   = $self->_get_try($dle, "taper");
+        my $try   = $self->_get_try($dle, "taper", $timestamp);
         my $taper = $try->{taper} ||= {};
         my $parts = $taper->{parts} ||= [];
 
@@ -888,6 +953,8 @@ sub _handle_taper_line
         push @$parts, $part;
 
         my $tape = $self->get_tape($label);
+       # count this as a filesystem if this is the first part
+        $tape->{dle}++ if $currpart == 1;
         $tape->{kb}   += $kb;
         $tape->{time} += $sec;
         $tape->{files}++;
@@ -912,7 +979,7 @@ sub _handle_taper_line
         $orig_kb =~ s{\]$}{} if defined $orig_kb;
 
         my $dle   = $disklist->{$hostname}->{$disk};
-        my $try   = $self->_get_try($dle, "taper");
+        my $try   = $self->_get_try($dle, "taper", $timestamp);
         my $taper = $try->{taper} ||= {};
         my $parts = $taper->{parts};
 
@@ -938,9 +1005,14 @@ sub _handle_taper_line
 
         if ($str =~ m{^no-tape}) {
 
+           my @info = Amanda::Util::split_quoted_strings($str);
+           my $failure_from = $info[1];
+           my $error = join " ", @info[ 2 .. $#info ];
+
             $self->{flags}{exit_status} |= STATUS_TAPE;
             $self->{flags}{degraded_mode} = 1;
-            $taper_p->{tape_error} = $str;
+           $taper_p->{failure_from} = $failure_from;
+            $taper_p->{tape_error} = $error;
 
         } else {
             $self->_handle_error_line("taper", $str);
@@ -981,6 +1053,35 @@ sub _handle_amflush_line
     }
 }
 
+sub _handle_amvault_line
+{
+    my $self = shift @_;
+    my ( $type, $str ) = @_;
+    my $data      = $self->{data};
+    my $disklist  = $data->{disklist};
+    my $programs  = $data->{programs};
+    my $amvault_p = $programs->{amvault} ||= {};
+
+    if ( $type == $L_START ) {
+        return $self->_handle_start_line( "amvault", $str );
+
+    } elsif ( $type == $L_INFO ) {
+        return $self->_handle_info_line( "amvault", $str );
+
+    } elsif ( $type == $L_ERROR ) {
+        return $self->_handle_error_line( "amvault", $str );
+
+    } elsif ( $type == $L_FATAL ) {
+        return $self->_handle_fatal_line( "amvault", $str );
+
+    } elsif ( $type == $L_DISK ) {
+        return $self->_handle_disk_line( "amvault", $str );
+
+    } else {
+        return $self->_handle_bogus_line( $P_AMFLUSH, $type, $str );
+    }
+}
+
 
 sub _handle_amdump_line
 {
@@ -1011,8 +1112,15 @@ sub _handle_fail_line
     my ($self, $program, $str) = @_;
 
     my @info = Amanda::Util::split_quoted_strings($str);
-    my ($hostname, $disk, $date, $level) = @info;
-    my $error = join " ", @info[ 4 .. $#info ];
+    my ($hostname, $disk, $timestamp, $level) = @info;
+    my $error;
+    my $failure_from;
+    if ($program eq 'taper') {
+       $failure_from = $info[4];
+       $error = join " ", @info[ 5 .. $#info ];
+    } else {
+       $error = join " ", @info[ 4 .. $#info ];
+    }
 
     #TODO: verify that this reaches the right try.  Also, DLE or
     #program?
@@ -1023,12 +1131,13 @@ sub _handle_fail_line
         $program eq "driver") {
        $program_d = $dle->{$program} ||= {};
     } else {
-        my $try = $self->_get_try($dle, $program);
+        my $try = $self->_get_try($dle, $program, $timestamp);
         $program_d = $try->{$program} ||= {};
     }
 
     $program_d->{level}  = $level;
     $program_d->{status} = "fail";
+    $program_d->{failure_from}  = $failure_from;
     $program_d->{error}  = $error;
 
     my $errors = $self->get_program_info("program", "errors", []);
@@ -1090,8 +1199,6 @@ sub _handle_start_line
     my $timestamp = $info[1];
     $program_p->{start} = $info[1];
 
-    # extend to 14 digits
-    $timestamp .= '0' x (14 - length($timestamp));
     if ($self->{'run_timestamp'} ne '00000000000000'
                and $self->{'run_timestamp'} ne $timestamp) {
        warning("not all timestamps in this file are the same; "
@@ -1124,8 +1231,27 @@ sub _handle_disk_line
 
         push @$dles, [ $hostname, $disk ];
         my $dle = $disklist->{$hostname}{$disk} = {};
-        $dle->{estimate} = undef;
-        $dle->{tries}    = [];
+        $dle->{'estimate'} = undef;
+        $dle->{'dumps'}    = {};
+    }
+    return;
+}
+
+sub _handle_success_line
+{
+    my $self = shift @_;
+    my ($program, $str) = @_;
+
+    my $data     = $self->{data};
+    my $disklist = $data->{disklist};
+    my $hosts    = $self->{cache}{hosts} ||= [];
+    my $dles     = $self->{cache}{dles}  ||= [];
+
+    my @info = Amanda::Util::split_quoted_strings($str);
+    my ($hostname, $disk, $timestamp, $level, $stat1, $stat2) = @info;
+
+    if ($stat1 =~ /skipped/) {
+        $disklist->{$hostname}{$disk}->{$program}->{'status'} = 'skipped';
     }
     return;
 }
@@ -1171,20 +1297,42 @@ sub _handle_bogus_line
     push @$boguses, [ $prog, $type, $str ];
 }
 
-sub check_missing
+sub check_missing_fail_strange
 {
     my ($self) = @_;
     my @dles = $self->get_dles();
 
     foreach my $dle_entry (@dles) {
-
-        my $tries = $self->get_dle_info(@$dle_entry, "tries");
-
-        if (!@$tries) {
-            $self->{flags}{results_missing} = 1;
-            $self->{flags}{exit_status} |= STATUS_MISSING;
-            last;
-        }
+        my $alldumps = $self->get_dle_info(@$dle_entry, 'dumps');
+       my $planner = $self->get_dle_info(@$dle_entry, 'planner');
+
+       if ($planner && $planner->{'status'} eq 'fail') {
+           $self->{flags}{dump_failed} = 1;
+       } elsif ($planner && $planner->{'status'} eq 'skipped') {
+           # We don't want these to be counted as missing below
+       } elsif (!defined $alldumps->{$self->{'run_timestamp'}}) {
+           $self->{flags}{results_missing} = 1;
+           $self->{flags}{exit_status} |= STATUS_MISSING;
+       } else {
+           #get latest try
+           my $tries = $alldumps->{$self->{'run_timestamp'}};
+           my $try = @$tries[-1];
+
+           if (exists $try->{dumper} && $try->{dumper}->{status} eq 'fail') {
+               $self->{flags}{dump_failed} = 1;
+           } elsif ((defined($try->{'chunker'}) &&
+                $try->{'chunker'}->{status} eq 'success') ||
+               (defined($try->{'taper'}) &&
+                $try->{'taper'}->{status} eq 'done')) {
+               #chunker or taper success, use dumper status
+               if (exists $try->{dumper} && $try->{dumper}->{status} eq 'strange') {
+                   $self->{flags}{dump_strange} = 1;
+               }
+           } else {
+               #chunker or taper failed, the dump is not valid.
+               $self->{flags}{dump_failed} = 1;
+           }
+       }
     }
 }
 
@@ -1195,8 +1343,8 @@ sub check_missing
 sub _get_try
 {
     my $self = shift @_;
-    my ( $dle, $program ) = @_;
-    my $tries = $dle->{tries} ||= [];
+    my ( $dle, $program, $timestamp ) = @_;
+    my $tries = $dle->{'dumps'}{$timestamp} ||= [];
 
     if (
         !@$tries    # no tries
index 2a7d6ec2ab3ab691284dcff4eb2479f38afe8011..84ff5c3ebb21e3bdf619ec2ed04850583982efce 100644 (file)
@@ -45,7 +45,7 @@ use constant COLSPEC_FORMAT    => 5;    # sprintf format
 use constant COLSPEC_TITLE     => 6;    # column title
 
 use constant PROGRAM_ORDER =>
-  qw(amdump planner amflush driver dumper chunker taper reporter);
+  qw(amdump planner amflush amvault driver dumper chunker taper reporter);
 
 
 ## helper functions
@@ -211,72 +211,75 @@ sub calculate_stats
     foreach my $dle_entry (@dles) {
 
         # $dle_entry = [$hostname, $disk]
-        my $dle = $report->get_dle_info(@$dle_entry);
-
-        foreach my $try ( @{ $dle->{tries} } ) {
-
-           my $level = exists $try->{dumper} ? $try->{dumper}{'level'} :
-                       exists $try->{taper} ? $try->{taper}{'level'} :
-                       0;
-           my $stats = ($level > 0) ? $incr_stats : $full_stats;
-
-           # compute out size, skipping flushes (tries without a dumper run)
-           my $outsize = 0;
-           if (exists $try->{dumper}
-               && exists $try->{chunker} && defined $try->{chunker}->{kb}
-               && ( $try->{chunker}{status} eq 'success'
-                 || $try->{chunker}{status} eq 'partial')) {
-               $outsize = $try->{chunker}->{kb};
-           } elsif (exists $try->{dumper}
-               && exists $try->{taper} && defined $try->{taper}->{kb}
-               && (   $try->{taper}{status} eq 'done'
-                   || $try->{taper}{status} eq 'partial')) {
-               $outsize = $try->{taper}->{kb};
-           }
+        my $dle      = $report->get_dle_info(@$dle_entry);
+       my $alldumps = $dle->{'dumps'};
+
+       while( my ($timestamp, $tries) = each %$alldumps ) {
+           foreach my $try ( @$tries ) {
+
+               my $level = exists $try->{dumper} ? $try->{dumper}{'level'} :
+                           exists $try->{taper} ? $try->{taper}{'level'} :
+                           0;
+               my $stats = ($level > 0) ? $incr_stats : $full_stats;
+
+               # compute out size, skipping flushes (tries without a dumper run)
+               my $outsize = 0;
+               if (exists $try->{dumper}
+                   && exists $try->{chunker} && defined $try->{chunker}->{kb}
+                   && ( $try->{chunker}{status} eq 'success'
+                     || $try->{chunker}{status} eq 'partial')) {
+                   $outsize = $try->{chunker}->{kb};
+               } elsif (exists $try->{dumper}
+                   && exists $try->{taper} && defined $try->{taper}->{kb}
+                   && (   $try->{taper}{status} eq 'done'
+                       || $try->{taper}{status} eq 'partial')) {
+                   $outsize = $try->{taper}->{kb};
+               }
 
-           # compute orig size, again skipping flushes
-           my $origsize = 0;
-            if ( exists $try->{dumper}
-                && (   $try->{dumper}{status} eq 'success'
-                    || $try->{dumper}{status} eq 'strange')) {
-
-                $origsize = $try->{dumper}{orig_kb};
-                $stats->{dumper_time} += $try->{dumper}{sec};
-                $stats->{dumpdisk_count}++; # count this as a dumped filesystem
-                $dumpdisks->[$try->{dumper}{'level'}]++; #by level count
-            } elsif (exists $try->{dumper}
-               && exists $try->{taper} && defined $try->{taper}->{kb}
-               && (   $try->{taper}{status} eq 'done'
-                   || $try->{taper}{status} eq 'partial')) {
-               # orig_kb doesn't always exist (older logfiles)
-               if ($try->{taper}->{orig_kb}) {
-                   $origsize = $try->{taper}->{orig_kb};
+               # compute orig size, again skipping flushes
+               my $origsize = 0;
+               if ( exists $try->{dumper}
+                   && (   $try->{dumper}{status} eq 'success'
+                       || $try->{dumper}{status} eq 'strange')) {
+
+                   $origsize = $try->{dumper}{orig_kb};
+                   $stats->{dumper_time} += $try->{dumper}{sec};
+                   $stats->{dumpdisk_count}++; # count this as a dumped filesystem
+                   $dumpdisks->[$try->{dumper}{'level'}]++; #by level count
+               } elsif (exists $try->{dumper}
+                   && exists $try->{taper} && defined $try->{taper}->{kb}
+                   && (   $try->{taper}{status} eq 'done'
+                       || $try->{taper}{status} eq 'partial')) {
+                   # orig_kb doesn't always exist (older logfiles)
+                   if ($try->{taper}->{orig_kb}) {
+                       $origsize = $try->{taper}->{orig_kb};
+                   }
                }
-           }
 
-            if ( exists $try->{taper}
-                && ( $try->{taper}{status} eq 'done'
-                 || $try->{taper}{status} eq 'partial')) {
+               if ( exists $try->{taper}
+                   && ( $try->{taper}{status} eq 'done'
+                     || $try->{taper}{status} eq 'partial')) {
 
-                $stats->{tapesize}   += $try->{taper}{kb};
-                $stats->{taper_time} += $try->{taper}{sec};
-                $stats->{tapepart_count} += @{ $try->{taper}{parts} }
-                   if $try->{taper}{parts};
-                $stats->{tapedisk_count}++;
+                   $stats->{tapesize}   += $try->{taper}{kb};
+                   $stats->{taper_time} += $try->{taper}{sec};
+                   $stats->{tapepart_count} += @{ $try->{taper}{parts} }
+                       if $try->{taper}{parts};
+                   $stats->{tapedisk_count}++;
 
-                $tapedisks->[ $try->{taper}{level} ]++;    #by level count
-                $tapeparts->[$try->{taper}{level}] += @{ $try->{taper}{parts} }
-                   if $try->{taper}{parts};
-           }
+                   $tapedisks->[ $try->{taper}{level} ]++;    #by level count
+                   $tapeparts->[$try->{taper}{level}] += @{ $try->{taper}{parts} }
+                       if $try->{taper}{parts};
+               }
 
-           # add those values to the stats
-           $stats->{'origsize'} += $origsize;
-           $stats->{'outsize'} += $outsize;
+               # add those values to the stats
+               $stats->{'origsize'} += $origsize;
+               $stats->{'outsize'} += $outsize;
 
-           # if the sizes differ, then we have a compressed dump, so also add it to
-           # c{out,orig}size
-           $stats->{'corigsize'} += $origsize;
-           $stats->{'coutsize'} += $outsize;
+               # if the sizes differ, then we have a compressed dump, so also add it to
+               # c{out,orig}size
+               $stats->{'corigsize'} += $origsize;
+               $stats->{'coutsize'} += $outsize;
+           }
         }
     }
 
@@ -395,10 +398,12 @@ sub output_tapeinfo
 
     if (@$tape_labels > 0) {
 
-       # slightly different sentence for amflush and amdump
+       # slightly different sentence depending on the run type
         my $tapelist_str;
        if ($report->get_flag("amflush_run")) {
            $tapelist_str = "The dumps were flushed ";
+       } elsif ($report->get_flag("amvault_run")) {
+           $tapelist_str = "The dumps were vaulted ";
        } else {
            $tapelist_str = "These dumps were ";
        }
@@ -410,14 +415,15 @@ sub output_tapeinfo
     if (my $tape_error =
         $report->get_program_info("taper", "tape_error", undef)) {
 
-        $tape_error =~ s{^no-tape }{};
-       if ($tape_error =~ /^\[CONFIG:/) {
-           $tape_error =~ s/^\[CONFIG://;
+       if ($report->get_program_info("taper", "failure_from", undef) eq "config") {
+           # remove leading [ and trailling ]
+           $tape_error =~ s/^\[//;
            $tape_error =~ s/\]$//;
            print $fh "Not using all tapes because $tape_error.\n";
        } else {
             print $fh "*** A TAPE ERROR OCCURRED: $tape_error.\n";
        }
+        #$tape_error =~ s{^no-tape }{};
     }
 
     ## if this is a historical report, do not generate holding disk
@@ -466,6 +472,14 @@ sub output_tapeinfo
         if ( my $tape_label =
             Amanda::Tapelist::get_last_reusable_tape_label($i) ) {
 
+           if ($nb_new_tape) {
+               print $fh ", " if !$first;
+               print $fh "$nb_new_tape new tape"
+                       . ( $nb_new_tape > 1 ? "s" : "" );
+               $nb_new_tape = 0;
+               $first = 0;
+           }
+
            print $fh
                $first ? "" : ", ",
                $tape_label;
@@ -517,12 +531,12 @@ sub output_error_summaries
     foreach my $dle_entry (@dles) {
 
         my ($hostname, $disk) = @$dle_entry;
-        my $tries = $report->get_dle_info(@$dle_entry, "tries");
+        my $alldumps = $report->get_dle_info(@$dle_entry, "dumps");
        my $dle = $report->get_dle_info($hostname, $disk);
         my $qdisk = quote_string($disk);
-       my $failed = 0;
 
-       if ($report->get_flag('results_missing') and !@$tries and
+       if ($report->get_flag('results_missing') and
+           !defined($alldumps->{$report->{run_timestamp}}) and
            !$dle->{planner}) {
            push @missing_failures, "$hostname $qdisk RESULTS MISSING";
        }
@@ -537,53 +551,70 @@ sub output_error_summaries
            push @planner_failures, "$hostname $qdisk lev $dle->{planner}->{level}  FAILED $dle->{planner}->{error}";
        }
 
-        foreach my $try (@$tries) {
-           if (exists $try->{dumper} &&
-               $try->{dumper}->{status} eq 'fail') {
-               push @dump_failures, "$hostname $qdisk lev $try->{dumper}->{level}  FAILED $try->{dumper}->{error}";
-               $failed = 1;
-           }
-           if (exists $try->{chunker} &&
-               $try->{chunker}->{status} eq 'fail') {
-               push @dump_failures, "$hostname $qdisk lev $try->{chunker}->{level}  FAILED $try->{chunker}->{error}";
-               $failed = 1;
-           }
-           if (   exists $try->{taper}
-               && (   $try->{taper}->{status} eq 'fail'
-                    || (   $try->{taper}->{status} eq 'partial'))) {
-           #&& defined $try->{taper}->{error}
-           #&& $try->{taper}->{error} ne ""))) {
-               my $flush = "FLUSH";
-               $flush = "FAILED" if exists $try->{dumper} && !exists $try->{chunker};
-               if ($flush ne "FLUSH" or $try->{taper}->{error} !~ /CONFIG:/) {
-                   if ($try->{taper}->{status} eq 'partial') {
-                       # if the error message is omitted, then the taper only got a partial
-                       # dump from the dumper/chunker, rather than failing with a taper error
-                       my $errmsg = $try->{taper}{error} || "successfully taped a partial dump";
-                       $flush = "partial taper: $errmsg";
-                   } else {
-                       $flush .= " " . $try->{taper}{error};
+       while( my ($timestamp, $tries) = each %$alldumps ) {
+           my $failed = 0;
+           foreach my $try (@$tries) {
+               if (exists $try->{dumper} &&
+                   $try->{dumper}->{status} &&
+                   $try->{dumper}->{status} eq 'fail') {
+                   push @dump_failures, "$hostname $qdisk lev $try->{dumper}->{level}  FAILED $try->{dumper}->{error}";
+                   $failed = 1;
+               }
+               if (exists $try->{chunker} &&
+                   $try->{chunker}->{status} eq 'fail') {
+                   push @dump_failures, "$hostname $qdisk lev $try->{chunker}->{level}  FAILED $try->{chunker}->{error}";
+                   $failed = 1;
+               }
+               if (   exists $try->{taper}
+                   && (   $try->{taper}->{status} eq 'fail'
+                       || (   $try->{taper}->{status} eq 'partial'))) {
+                   my $flush = "FLUSH";
+                   $flush = "FAILED" if exists $try->{dumper} && !exists $try->{chunker};
+                   if ($flush ne "FLUSH" or !defined $try->{taper}->{failure_from}
+                                         or $try->{taper}->{failure_from} ne 'config') {
+                       if ($try->{taper}->{status} eq 'partial') {
+                           # if the error message is omitted, then the taper only got a partial
+                           # dump from the dumper/chunker, rather than failing with a taper error
+                           my $errmsg = $try->{taper}{error} || "successfully taped a partial dump";
+                           $flush = "partial taper: $errmsg";
+                       } else {
+                           $flush .= " " . $try->{taper}{error};
+                       }
+
+                       push @dump_failures, "$hostname $qdisk lev $try->{taper}->{level}  $flush";
+                       $failed = 1;
                    }
+               }
 
-                   push @dump_failures, "$hostname $qdisk lev $try->{taper}->{level}  $flush";
-                   $failed = 1;
+               # detect retried dumps
+               if (   $failed
+                   && exists $try->{dumper}
+                   && (   $try->{dumper}->{status} eq "success"
+                       || $try->{dumper}->{status} eq "strange")
+                   && (   !exists $try->{chunker}
+                       || $try->{chunker}->{status} eq "success")
+                   && (   !exists $try->{taper}
+                       || $try->{taper}->{status} eq "done")) {
+                   push @dump_failures, "$hostname $qdisk lev $try->{dumper}->{level}  was successfully retried";
+                   $failed = 0;
                }
-           }
-           if (   $failed
-               && exists $try->{dumper}
-                && $try->{dumper}->{status} eq "success"
-               && (   !exists $try->{chunker}
-                   || $try->{chunker}->{status} eq "success")
-               && (   !exists $try->{taper}
-                   || $try->{taper}->{status} eq "done")) {
-               push @dump_failures, "$hostname $qdisk lev $try->{dumper}->{level}  was successfully retried";
-           }
 
-            push @stranges,
-"$hostname $qdisk lev $try->{dumper}->{level}  STRANGE (see below)"
-              if (defined $try->{dumper}
-                && $try->{dumper}->{status} eq 'strange');
-        }
+               # detect dumps re-flushed from holding
+               if (   $failed
+                   && !exists $try->{dumper}
+                   && !exists $try->{chunker}
+                   && exists $try->{taper}
+                   && $try->{taper}->{status} eq "done") {
+                   push @dump_failures, "$hostname $qdisk lev $try->{taper}->{level}  was successfully re-flushed";
+                   $failed = 0;
+               }
+
+               push @stranges,
+    "$hostname $qdisk lev $try->{dumper}->{level}  STRANGE (see below)"
+                 if (defined $try->{dumper}
+                   && $try->{dumper}->{status} eq 'strange');
+           }
+       }
     }
     push @failures, @fatal_failures, @error_failures, @missing_failures,
                    @driver_failures, @planner_failures, @dump_failures;
@@ -601,9 +632,9 @@ sub by_level_count
 
     # start at level 1 - don't include fulls
     foreach my $i (1 .. (@$count - 1)) {
-        push @lc, "$i:$count->[$i]" if $count->[$i] > 0;
+        push @lc, "$i:$count->[$i]" if defined $count->[$i] and $count->[$i] > 0;
     }
-    return '(' . join(' ', @lc) . ')';
+    return join(' ', @lc);
 }
 
 sub output_stats
@@ -616,8 +647,8 @@ sub output_stats
 
 
 STATISTICS:
-                          Total       Full      Incr.
-                        --------   --------   --------
+                          Total       Full      Incr.   Level:#
+                        --------   --------   --------  --------
 EOF
 
     my $st_format = <<EOF;
@@ -664,7 +695,8 @@ EOF
         "Dump Time (hrs:min)",
         hrmn( $total_stats->{dumper_time} ),
         hrmn( $full_stats->{dumper_time} ),
-        hrmn( $incr_stats->{dumper_time} ), ""
+        hrmn( $incr_stats->{dumper_time} ),
+       ""
     );
 
     print $fh swrite(
@@ -696,16 +728,16 @@ EOF
         $comp_size->($total_stats),
         $comp_size->($full_stats),
         $comp_size->($incr_stats),
-        ($self->{dumpdisks}[1] > 0 ? "(level:#disks ...)" : "")
+        "",
     );
 
     print $fh swrite(
         $st_format,
-        "Filesystems Dumped",
+        "DLEs Dumped",
         sprintf("%4d", $total_stats->{dumpdisk_count}),
         sprintf("%4d", $full_stats->{dumpdisk_count}),
         sprintf("%4d", $incr_stats->{dumpdisk_count}),
-        ($self->{dumpdisks}[1] > 0 ? by_level_count($self->{dumpdisks}) : "")
+        (has_incrementals($self->{dumpdisks}) ? by_level_count($self->{dumpdisks}) : "")
     );
 
     print $fh swrite(
@@ -723,7 +755,8 @@ EOF
         "Tape Time (hrs:min)",
         hrmn( $total_stats->{taper_time} ),
         hrmn( $full_stats->{taper_time} ),
-        hrmn( $incr_stats->{taper_time} ), ""
+        hrmn( $incr_stats->{taper_time} ),
+       ""
     );
 
     print $fh swrite(
@@ -753,25 +786,27 @@ EOF
         $tape_usage->($total_stats),
         $tape_usage->($full_stats),
         $tape_usage->($incr_stats),
-        ($self->{tapedisks}[1] > 0 ? "(level:#disks ...)" : "")
+       ""
     );
 
+    my $nb_incr_dle = 0;
+    my @incr_dle = @{$self->{tapedisks}};
+    foreach my $level (1 .. $#incr_dle) {
+       $nb_incr_dle += $incr_dle[$level];
+    }
     print $fh swrite(
         $st_format,
-        "Filesystems Taped",
-        $self->{tapedisks}[0] + $self->{tapedisks}[1],
+        "DLEs Taped",
+        $self->{tapedisks}[0] + $nb_incr_dle,
         $self->{tapedisks}[0],
-        $self->{tapedisks}[1],
+        $nb_incr_dle,
         (
-            ($self->{tapedisks}[1] > 0)
+            (has_incrementals($self->{tapedisks}))
             ? by_level_count($self->{tapedisks})
             : ""
         )
     );
 
-    print $fh swrite($st_format, "", "", "", "", "(level:#parts ...)")
-      if $incr_stats->{tapepart_count} > 0;
-
     # NOTE: only print out the per-level tapeparts if there are
     # incremental tapeparts
     print $fh swrite(
@@ -800,6 +835,16 @@ EOF
     return;
 }
 
+sub has_incrementals
+{
+    my $array = shift;
+
+    for ($a = 1; $a < @$array; $a+=1) {
+       return 1 if $array->[$a] > 0;
+    }
+    return 0;
+}
+
 sub output_tape_stats
 {
     my ($self) = @_;
@@ -822,7 +867,7 @@ sub output_tape_stats
       . "@>>>> @>>>>>>>>>>> @>>>>> @>>>> @>>>>\n";
 
     print $fh "USAGE BY TAPE:\n";
-    print $fh swrite($ts_format, "Label", "Time", "Size", "%", "Nb", "Nc");
+    print $fh swrite($ts_format, "Label", "Time", "Size", "%", "DLEs", "Parts");
 
     my $tapetype_name = getconf($CNF_TAPETYPE);
     my $tapetype      = lookup_tapetype($tapetype_name);
@@ -842,8 +887,8 @@ sub output_tape_stats
             hrmn($tape->{time}),                               # time
             sprintf("%.0f", $self->tounits($tape->{kb})) . $self->{disp_unit},  # size
             divzero(100 * $tapeused, $tapesize),    # % usage
-            int($tape->{dle}),                        # Nb of dles
-            int($tape->{files})                       # Nb of parts
+            int($tape->{dle}),                        # # of dles
+            int($tape->{files})                       # # of parts
         );
     }
     print $fh "\n";
@@ -870,71 +915,73 @@ sub output_details
     foreach my $dle_entry (@dles) {
 
         my ($hostname, $disk) = @$dle_entry;
-        my $dle     = $report->get_dle_info(@$dle_entry);
-        my $tries   = $dle->{tries} || [];
-        my $qdisk   = quote_string($disk);
-        my $outsize = undef;
-
-        foreach my $try (@$tries) {
-
-            #
-            # check for failed dumper details
-            #
-            if (defined $try->{dumper}
-                && $try->{dumper}->{status} eq 'fail') {
-
-                push @failed_dump_details,
-"/-- $hostname $qdisk lev $try->{dumper}->{level} FAILED $try->{dumper}->{error}",
-                  @{ $try->{dumper}->{errors} },
-                  "\\--------";
-
-                if ($try->{dumper}->{nb_errors} > 100) {
-                    my $nb = $try->{dumper}->{nb_errors} - 100;
-
-                    push @failed_dump_details,
-"$nb lines follow, see the corresponding log.* file for the complete list",
-                      "\\--------";
-                }
-            }
+        my $dle      = $report->get_dle_info(@$dle_entry);
+        my $alldumps = $dle->{'dumps'} || {};
+        my $qdisk    = quote_string($disk);
+        my $outsize  = undef;
+
+       while( my ($timestamp, $tries) = each %$alldumps ) {
+           foreach my $try (@$tries) {
+
+               #
+               # check for failed dumper details
+               #
+               if (defined $try->{dumper}
+                   && $try->{dumper}->{status} eq 'fail') {
+
+                   push @failed_dump_details,
+    "/-- $hostname $qdisk lev $try->{dumper}->{level} FAILED $try->{dumper}->{error}",
+                     @{ $try->{dumper}->{errors} },
+                     "\\--------";
+
+                   if ($try->{dumper}->{nb_errors} > 100) {
+                       my $nb = $try->{dumper}->{nb_errors} - 100;
+
+                       push @failed_dump_details,
+    "$nb lines follow, see the corresponding log.* file for the complete list",
+                         "\\--------";
+                   }
+               }
 
-            #
-            # check for strange dumper details
-            #
-            if (defined $try->{dumper}
-                && $try->{dumper}->{status} eq 'strange') {
-
-                push @strange_dump_details,
-                  "/-- $hostname $qdisk lev $try->{dumper}->{level} STRANGE",
-                  @{ $try->{dumper}->{stranges} },
-                  "\\--------";
-
-                if ($try->{dumper}->{nb_stranges} > 100) {
-                    my $nb = $try->{dumper}->{nb_stranges} - 100;
-                    push @strange_dump_details,
-"$nb lines follow, see the corresponding log.* file for the complete list",
-                      "\\--------";
-                }
-            }
+               #
+               # check for strange dumper details
+               #
+               if (defined $try->{dumper}
+                   && $try->{dumper}->{status} eq 'strange') {
+
+                   push @strange_dump_details,
+                     "/-- $hostname $qdisk lev $try->{dumper}->{level} STRANGE",
+                     @{ $try->{dumper}->{stranges} },
+                     "\\--------";
+
+                   if ($try->{dumper}->{nb_stranges} > 100) {
+                       my $nb = $try->{dumper}->{nb_stranges} - 100;
+                       push @strange_dump_details,
+    "$nb lines follow, see the corresponding log.* file for the complete list",
+                         "\\--------";
+                   }
+               }
 
-            # note: copied & modified from calculate_stats.
-            if (
-                   exists $try->{dumper}
-                && exists $try->{taper}
-                && defined $try->{taper}->{kb}
-                && (   $try->{taper}{status} eq 'done'
-                    || $try->{taper}{status} eq 'partial')
-              ) {
-                $outsize = $try->{taper}->{kb};
-            } elsif (
-                exists $try->{dumper}
-                && exists $try->{chunker}
-                && defined $try->{chunker}->{kb}
-                && (   $try->{chunker}{status} eq 'success'
-                    || $try->{chunker}{status} eq 'partial')
-              ) {
-                $outsize = $try->{chunker}->{kb};
-            }
-        }    # end try loop
+               # note: copied & modified from calculate_stats.
+               if (
+                      exists $try->{dumper}
+                   && exists $try->{taper}
+                   && defined $try->{taper}->{kb}
+                   && (   $try->{taper}{status} eq 'done'
+                       || $try->{taper}{status} eq 'partial')
+                 ) {
+                   $outsize = $try->{taper}->{kb};
+               } elsif (
+                   exists $try->{dumper}
+                   && exists $try->{chunker}
+                   && defined $try->{chunker}->{kb}
+                   && (   $try->{chunker}{status} eq 'success'
+                       || $try->{chunker}{status} eq 'partial')
+                 ) {
+                   $outsize = $try->{chunker}->{kb};
+               }
+           }
+       }
 
         #
         # check for bad estimates
@@ -947,7 +994,7 @@ sub output_details
               "big estimate: $hostname $qdisk $dle->{estimate}{level}",
               sprintf('                est: %.0f%s    out %.0f%s',
                 $est->{ckb}, $disp_unit, $outsize, $disp_unit)
-              if ( ($est->{ckb} * .9 > $outsize)
+              if (defined $est->{'ckb'} && ($est->{ckb} * .9 > $outsize)
                 && ($est->{ckb} - $outsize > 1.0e5));
         }
     }
@@ -977,8 +1024,11 @@ sub output_summary
     my $col_spec = $self->set_col_spec();
 
     ## collect all the output line specs (see get_summary_info)
-    my @summary_linespecs =
-      map { [ $self->get_summary_info($_, $report, $col_spec) ] } @dles;
+    my @summary_linespecs = ();
+    foreach my $dle (@dles) {
+       push @summary_linespecs, $self->get_summary_info($dle, $report, $col_spec);
+    }
+
     # shift off the first element of each tuple
     my @summary_linedata =
       map { my @x = @$_; shift @x; [ @x ] } @summary_linespecs;
@@ -994,6 +1044,7 @@ sub output_summary
     my $nodump_PARTIAL_format = get_summary_format($col_spec, 'nodump-PARTIAL', @summary_linedata);
     my $nodump_FAILED_format = get_summary_format($col_spec, 'nodump-FAILED', @summary_linedata);
     my $nodump_FLUSH_format = get_summary_format($col_spec, 'nodump-FLUSH', @summary_linedata);
+    my $skipped_format = get_summary_format($col_spec, 'skipped', @summary_linedata);
 
     ## print the header names
     my $hdl =
@@ -1056,6 +1107,8 @@ sub output_summary
            print $fh sprintf($missing_format, @data[0..2]);
        } elsif ($type eq 'noflush') {
            print $fh sprintf($noflush_format, @data[0..2]);
+       } elsif ($type eq 'skipped') {
+           print $fh sprintf($skipped_format, @data[0..2]);
        }
     }
 
@@ -1072,6 +1125,7 @@ sub output_summary
 ##  ('noflush', host, disk, '' ..) # NO FILE TO FLUSH ------
 ##  ('nodump-$msg', host, disk, level, '', out, '--', '',
 ##         '', tapetime, taperate, taperpartial)  # ... {FLUSH|FAILED|PARTIAL} ...
+##  ('skipped', host, disk, '' ..) # SKIPPED -----
 ##
 ## the taperpartial column is not covered by the columnspec, and "hangs off"
 ## the right side.  It's usually empty, but set to " PARTIAL" when the taper
@@ -1082,6 +1136,7 @@ sub get_summary_info
     my $self = shift;
     my ( $dle, $report, $col_spec ) = @_;
     my ( $hostname, $disk ) = @$dle;
+    my @rvs;
 
     my $dle_info = $report->get_dle_info(@$dle);
 
@@ -1111,176 +1166,203 @@ sub get_summary_info
       ? quote_string($disk)
       : $tail_quote_trunc->($disk, $col_spec->[1]->[COLSPEC_WIDTH]);
 
-    my $last_try = $dle_info->{tries}->[-1];
-    my $level =
-        exists $last_try->{taper}   ? $last_try->{taper}{level}
-      : exists $last_try->{chunker} ? $last_try->{chunker}{level}
-      :                               $last_try->{dumper}{level};
-
-    my $orig_size = undef;
-
-    # find the try with the successful dumper entry
-    my $dumper = undef;
-    foreach my $try ( @{ $dle_info->{tries} } ) {
-       if ( exists $try->{dumper}
-           && exists $try->{dumper}{status}
-           && (   $try->{dumper}{status} eq "success"
-               || $try->{dumper}{status} eq "strange")) {
-           $dumper = $try->{dumper};
-           last;
-       }
+    my $alldumps = $dle_info->{'dumps'};
+    if ($dle_info->{'planner'} &&
+        $dle_info->{'planner'}->{'status'} eq 'fail') {
+       my @rv;
+       push @rv, 'nodump-FAILED';
+       push @rv, $hostname;
+       push @rv, $disk_out;
+       push @rv, ("",) x 9;
+       push @rvs, [@rv];
+    } elsif ($dle_info->{'planner'} &&
+        $dle_info->{'planner'}->{'status'} eq 'skipped') {
+       my @rv;
+       push @rv, 'skipped';
+       push @rv, $hostname;
+       push @rv, $disk_out;
+       push @rv, ("",) x 8;
+       push @rvs, [@rv];
+    } elsif (keys %{$alldumps} == 0) {
+       my @rv;
+       push @rv, $report->get_flag("amflush_run")? 'noflush' : 'missing';
+       push @rv, $hostname;
+       push @rv, $disk_out;
+       push @rv, ("",) x 8;
+       push @rvs, [@rv];
     }
-    $orig_size = $dumper->{orig_kb}
-       if defined $dumper;
-
-    my ( $out_size, $dump_time, $dump_rate, $tape_time, $tape_rate ) = (0) x 5;
-    my ($dumper_status) = "";
-    my $saw_dumper = 0; # no dumper will mean this was a flush
-    my $taper_partial = 0; # was the last taper run partial?
-
-    ## Use this loop to set values
-    foreach my $try ( @{ $dle_info->{tries} } ) {
-
-        ## find the outsize for the output summary
-
-        if (
-            exists $try->{taper}
-            && (   $try->{taper}{status} eq "done"
-                || $try->{taper}{status} eq "part+partial" )
-          ) {
-           $taper_partial = 0;
-            $orig_size = $try->{taper}{orig_kb} if !defined($orig_size);
-            $out_size  = $try->{taper}{kb};
-            $tape_time = $try->{taper}{sec};
-            $tape_rate = $try->{taper}{kps};
-        } elsif ( exists $try->{taper}
-            && ( $try->{taper}{status} eq "partial" ) ) {
-
-           $taper_partial = 1;
-            $orig_size = $try->{taper}{orig_kb} if !defined($orig_size);
-            $out_size  = $try->{taper}{kb};
-            $tape_time = $try->{taper}{sec} if !$tape_time;
-            $tape_rate = $try->{taper}{kps} if !$tape_rate;
-        } elsif (exists $try->{taper} && ( $try->{taper}{status} eq "fail")) {
-           if ($try->{taper}{error} =~ /CONFIG:/) {
-               $tape_time = 0;
-               $tape_rate = 0;
-           } else {
+
+    while( my ($timestamp, $tries) = each %$alldumps ) {
+       my $last_try = $tries->[-1];
+       my $level =
+           exists $last_try->{taper}   ? $last_try->{taper}{level}
+         : exists $last_try->{chunker} ? $last_try->{chunker}{level}
+         :                               $last_try->{dumper}{level};
+
+       my $orig_size = undef;
+
+       # find the try with the successful dumper entry
+       my $dumper = undef;
+       foreach my $try (@$tries) {
+           if ( exists $try->{dumper}
+               && exists $try->{dumper}{status}
+               && (   $try->{dumper}{status} eq "success"
+                   || $try->{dumper}{status} eq "strange")) {
+               $dumper = $try->{dumper};
+               last;
+           }
+       }
+       $orig_size = $dumper->{orig_kb}
+           if defined $dumper;
+
+       my ( $out_size, $dump_time, $dump_rate, $tape_time, $tape_rate ) = (0) x 5;
+       my ($dumper_status) = "";
+       my $saw_dumper = 0; # no dumper will mean this was a flush
+       my $taper_partial = 0; # was the last taper run partial?
+
+       ## Use this loop to set values
+       foreach my $try ( @$tries ) {
+
+           ## find the outsize for the output summary
+
+           if (
+               exists $try->{taper}
+               && (   $try->{taper}{status} eq "done"
+                   || $try->{taper}{status} eq "part+partial" )
+             ) {
+               $taper_partial = 0;
+               $orig_size = $try->{taper}{orig_kb} if !defined($orig_size);
+               $out_size  = $try->{taper}{kb};
+               $tape_time = $try->{taper}{sec};
+               $tape_rate = $try->{taper}{kps};
+           } elsif ( exists $try->{taper}
+               && ( $try->{taper}{status} eq "partial" ) ) {
+
+               $taper_partial = 1;
+               $orig_size = $try->{taper}{orig_kb} if !defined($orig_size);
+               $out_size  = $try->{taper}{kb};
+               $tape_time = $try->{taper}{sec} if !$tape_time;
+               $tape_rate = $try->{taper}{kps} if !$tape_rate;
+           } elsif (exists $try->{taper} && ( $try->{taper}{status} eq "fail")) {
                $tape_time = undef;
                $tape_rate = undef;
            }
-       }
-
-       if (!$out_size &&
-            exists $try->{chunker}
-            && (   $try->{chunker}{status} eq "success"
-                || $try->{chunker}{status} eq "partial" )
-          ) {
-            $out_size = $try->{chunker}{kb};
-       }
-
-        if (!$out_size &&
-           exists $try->{dumper}) {
-            $out_size = $try->{dumper}{kb};
-        }
-
-        if ( exists $try->{dumper}) {
-           $saw_dumper = 1;
-            $dumper_status = $try->{dumper}{status};
-        }
-
-        ## find the dump time
-        if ( exists $try->{dumper}
-           && exists $try->{dumper}{status}
-            && (   $try->{dumper}{status} eq "success"
-               || $try->{dumper}{status} eq "strange")) {
-
-            $dump_time = $try->{dumper}{sec};
-            $dump_rate = $try->{dumper}{kps};
-        }
-    }
 
-    my $compression;
-    if (!defined $orig_size) {
-       $compression = 100;
-    } else {
-        $compression =
-          divzero_col((100 * $out_size), $orig_size, $col_spec->[5]);
-    }
-
-    ## simple formatting macros
+           if (!$out_size &&
+               exists $try->{chunker}
+               && (   $try->{chunker}{status} eq "success"
+                   || $try->{chunker}{status} eq "partial" )
+             ) {
+               $out_size = $try->{chunker}{kb};
+           }
 
-    my $fmt_col_field = sub {
-        my ( $column, $data ) = @_;
+           if (!$out_size &&
+               exists $try->{dumper}) {
+               $out_size = $try->{dumper}{kb};
+           }
 
-        return sprintf(
-            $col_spec->[$column]->[COLSPEC_FORMAT],
-            $col_spec->[$column]->[COLSPEC_WIDTH],
-            $col_spec->[$column]->[COLSPEC_PREC], $data
-        );
-    };
+           if ( exists $try->{dumper}) {
+               $saw_dumper = 1;
+               $dumper_status = $try->{dumper}{status};
+           }
 
-    my $format_space = sub {
-       my ( $column, $data ) = @_;
+           ## find the dump time
+           if ( exists $try->{dumper}
+               && exists $try->{dumper}{status}
+               && (   $try->{dumper}{status} eq "success"
+                   || $try->{dumper}{status} eq "strange")) {
 
-       return sprintf("%*s",$col_spec->[$column]->[COLSPEC_WIDTH], $data);
-    };
+               $dump_time = $try->{dumper}{sec};
+               $dump_rate = $try->{dumper}{kps};
+           }
+       }
 
-    my @rv;
+       # sometimes the driver logs an orig_size of -1, which makes the
+       # compression percent very large and negative
+       $orig_size = 0 if ($orig_size < 0);
 
-    if ( !$orig_size && !$out_size && (!defined($tape_time) || !$tape_time)) {
-       push @rv, $report->get_flag("amflush_run")? 'noflush' : 'missing';
-       push @rv, $hostname;
-       push @rv, $disk_out;
-       push @rv, ("",) x 8;
-       return @rv;
-    }
+       # pre-format the compression column, with '--' replacing 100% (i.e.,
+       # no compression)
+       my $compression;
+       if (!defined $orig_size || $orig_size == $out_size) {
+           $compression = '--';
+       } else {
+           $compression =
+             divzero_col((100 * $out_size), $orig_size, $col_spec->[5]);
+       }
 
-    if ($saw_dumper and ($dumper_status eq 'success' or $dumper_status eq 'strange')) {
-       push @rv, "full";
-       push @rv, $hostname;
-       push @rv, $disk_out;
-       push @rv, $fmt_col_field->(2, $level);
-       push @rv, $orig_size ? $fmt_col_field->(3, $self->tounits($orig_size)) : '';
-       push @rv, $out_size ? $fmt_col_field->(4, $self->tounits($out_size)) : '';
-       push @rv, ($compression == 100) ? '-- ' : $fmt_col_field->(5, $compression);
-       push @rv, $dump_time ? $fmt_col_field->(6, mnsc($dump_time)) : "PARTIAL";
-       push @rv, $dump_rate ? $fmt_col_field->(7, $dump_rate) : "";
-       push @rv, $fmt_col_field->(8,
-               (defined $tape_time) ?
-                       $tape_time ? mnsc($tape_time) : ""
-                     : "FAILED");
-       push @rv, (defined $tape_rate) ?
-           $tape_rate ?
-               $fmt_col_field->(9, $tape_rate)
-             : $format_space->(9, "")
-         : $format_space->(9, "FAILED");
-       push @rv, $taper_partial? " PARTIAL" : ""; # column 10
-    } else {
-       my $message = $saw_dumper?
-                       ($dumper_status eq 'failed') ? 'FAILED' : 'PARTIAL'
-                     : 'FLUSH';
-       push @rv, "nodump-$message";
-       push @rv, $hostname;
-       push @rv, $disk_out;
-       push @rv, $fmt_col_field->(2, $level);
-       push @rv, $orig_size ? $fmt_col_field->(4, $self->tounits($orig_size)) :'';
-       push @rv, $out_size ? $fmt_col_field->(4, $self->tounits($out_size)) : '';
-       push @rv, ($compression == 100) ? '-- ' : $fmt_col_field->(5, $compression);
-       push @rv, '';
-       push @rv, '';
-       push @rv, $fmt_col_field->(8,
-               (defined $tape_time) ?
-                       $tape_time ? mnsc($tape_time) : ""
-                     : "FAILED");
-       push @rv, (defined $tape_rate) ?
-           $tape_rate ?
-               $fmt_col_field->(9, $tape_rate)
-             : $format_space->(9, "")
-         : $format_space->(9, "FAILED");
-       push @rv, $taper_partial? " PARTIAL" : "";
+       ## simple formatting macros
+
+       my $fmt_col_field = sub {
+           my ( $column, $data ) = @_;
+
+           return sprintf(
+               $col_spec->[$column]->[COLSPEC_FORMAT],
+               $col_spec->[$column]->[COLSPEC_WIDTH],
+               $col_spec->[$column]->[COLSPEC_PREC], $data
+           );
+       };
+
+       my $format_space = sub {
+           my ( $column, $data ) = @_;
+
+           return sprintf("%*s",$col_spec->[$column]->[COLSPEC_WIDTH], $data);
+       };
+
+       my @rv;
+
+       if ( !$orig_size && !$out_size && (!defined($tape_time) || !$tape_time)) {
+           push @rv, $report->get_flag("amflush_run")? 'noflush' : 'missing';
+           push @rv, $hostname;
+           push @rv, $disk_out;
+           push @rv, ("",) x 8;
+       } elsif ($saw_dumper and ($dumper_status eq 'success' or $dumper_status eq 'strange')) {
+           push @rv, "full";
+           push @rv, $hostname;
+           push @rv, $disk_out;
+           push @rv, $fmt_col_field->(2, $level);
+           push @rv, $orig_size ? $fmt_col_field->(3, $self->tounits($orig_size)) : '';
+           push @rv, $out_size ? $fmt_col_field->(4, $self->tounits($out_size)) : '';
+           push @rv, $compression;
+           push @rv, $dump_time ? $fmt_col_field->(6, mnsc($dump_time)) : "PARTIAL";
+           push @rv, $dump_rate ? $fmt_col_field->(7, $dump_rate) : "";
+           push @rv, $fmt_col_field->(8,
+                   (defined $tape_time) ?
+                           $tape_time ? mnsc($tape_time) : ""
+                         : "FAILED");
+           push @rv, (defined $tape_rate) ?
+               $tape_rate ?
+                   $fmt_col_field->(9, $tape_rate)
+                 : $format_space->(9, "")
+             : $format_space->(9, "FAILED");
+           push @rv, $taper_partial? " PARTIAL" : ""; # column 10
+       } else {
+           my $message = $saw_dumper?
+                           ($dumper_status eq 'failed') ? 'FAILED' : 'PARTIAL'
+                         : 'FLUSH';
+           push @rv, "nodump-$message";
+           push @rv, $hostname;
+           push @rv, $disk_out;
+           push @rv, $fmt_col_field->(2, $level);
+           push @rv, $orig_size ? $fmt_col_field->(4, $self->tounits($orig_size)) :'';
+           push @rv, $out_size ? $fmt_col_field->(4, $self->tounits($out_size)) : '';
+           push @rv, $compression;
+           push @rv, '';
+           push @rv, '';
+           push @rv, $fmt_col_field->(8,
+                   (defined $tape_time) ?
+                           $tape_time ? mnsc($tape_time) : ""
+                         : "FAILED");
+           push @rv, (defined $tape_rate) ?
+               $tape_rate ?
+                   $fmt_col_field->(9, $tape_rate)
+                 : $format_space->(9, "")
+             : $format_space->(9, "FAILED");
+           push @rv, $taper_partial? " PARTIAL" : "";
+       }
+       push @rvs, [@rv];
     }
-    return @rv;
+    return @rvs;
 }
 
 sub get_summary_format
@@ -1365,6 +1447,14 @@ sub get_summary_format
                  get_summary_col_format( $i, $col_spec->[$i],
                    map { $_->[$i] } @summary_lines );
            }
+       } elsif ($type eq 'skipped') {
+           # add a blank level column and the space for the origkb column
+           push @col_format, ' ' x $col_spec->[2]->[COLSPEC_PRE_SPACE];
+           push @col_format, ' ' x $col_spec->[2]->[COLSPEC_WIDTH];
+           push @col_format, ' ' x $col_spec->[3]->[COLSPEC_PRE_SPACE];
+           my $str = "SKIPPED ";
+           $str .= '-' x ($rulewidth - length($str));
+           push @col_format, $str;
        }
     }
 
index 46b6ad20fee84e69e6cd2806738edd643f46de3b..2a8f589fb06e9211e369755877267366d206b78e 100644 (file)
@@ -126,52 +126,67 @@ sub _write_report_tape
        my ($host, $disk) = @$dle;
         my $dle_info = $self->{'report'}->get_dle_info($host, $disk);
 
-       # run once for each try for this DLE
-       foreach my $try (@{$dle_info->{'tries'}}) {
-
-            next unless exists $try->{taper};
-            my $taper = $try->{taper};
-
-            my $parts = $taper->{parts};
-            next unless @$parts > 0;
-
-            my $first_part = $parts->[0];
-            next unless $first_part->{label} eq $label;
-
-            my $filenum = $first_part->{file};
-
-           # sum the part sizes on this label to get the outsize.  Note that
-           # the postscript output does not contain a row for each part, but
-           # for each part..
-           my $outsize = 0;
-           for my $part (@$parts) {
-               next unless $part->{'label'} eq $label;
-               $outsize += $part->{'kb'};
-           }
-
-           # Get origsize for this try.
-           my $origsize = 0;
-           my $level = -1;
-
-            # TODO: this is complex and should probably be in a parent-class method
-            if (exists $try->{dumper} and ($try->{dumper}{status} ne 'fail')) {
-                my $try_dumper = $try->{dumper};
-                $level    = $try_dumper->{level};
-                $origsize = $try_dumper->{orig_kb};
-            } else {    # we already know a taper run exists in this try
-                $level = $taper->{level};
-                $origsize = $taper->{orig_kb} if $taper->{orig_kb};
-            }
-
-           $total_outsize += $outsize;
-           $total_origsize += $origsize;
-
-           if ($outsize != $origsize) {
-               $comp_outsize += $outsize;
-               $comp_origsize += $origsize;
+       my $alldumps = $dle_info->{'dumps'};
+
+       while( my ($timestamp, $tries) = each %$alldumps ) {
+           # run once for each try for this DLE
+           foreach my $try (@$tries) {
+
+               next unless exists $try->{taper};
+               my $taper = $try->{taper};
+
+               my $parts = $taper->{parts};
+               next unless @$parts > 0;
+
+               my $first_part = $parts->[0];
+               my $dlename = undef;
+               if ($first_part->{label} eq $label) {
+                   $dlename = $disk;
+               } else { #find if one part is on the volume
+                   foreach $parts (@$parts) {
+                       if ($parts->{label} eq $label) {
+                           $dlename = '- ' . $disk;
+                           last;
+                       }
+                   }
+                   next if !defined $dlename;
+               }
+
+               my $filenum = $first_part->{file};
+
+               # sum the part sizes on this label to get the outsize.  Note that
+               # the postscript output does not contain a row for each part, but
+               # for each part..
+               my $outsize = 0;
+               for my $part (@$parts) {
+                   next unless $part->{'label'} eq $label;
+                   $outsize += $part->{'kb'};
+               }
+
+               # Get origsize for this try.
+               my $origsize = 0;
+               my $level = -1;
+
+               # TODO: this is complex and should probably be in a parent-class method
+               if (exists $try->{dumper} and ($try->{dumper}{status} ne 'fail')) {
+                   my $try_dumper = $try->{dumper};
+                   $level    = $try_dumper->{level};
+                   $origsize = $try_dumper->{orig_kb};
+               } else {    # we already know a taper run exists in this try
+                   $level = $taper->{level};
+                   $origsize = $taper->{orig_kb} if $taper->{orig_kb};
+               }
+
+               $total_outsize += $outsize;
+               $total_origsize += $origsize;
+
+               if ($outsize != $origsize) {
+                   $comp_outsize += $outsize;
+                   $comp_origsize += $origsize;
+               }
+
+               push @first_parts, [$host, $dlename, $level, $filenum, $origsize, $outsize];
            }
-
-           push @first_parts, [$host, $disk, $level, $filenum, $origsize, $outsize];
        }
     }
     # count filemarks in the tapeused assessment
index 1a78956686158d2b6dea650a6aea482a160e6de8..6b5ea5038dca757379589ef6aa91cc1a82ce4a04 100644 (file)
@@ -212,6 +212,20 @@ sub make_part_xml
     );
 }
 
+sub make_dump_xml
+{
+    my ($dle, $timestamp) = @_;
+
+    return make_xml_elt(
+       "dump",
+       sub {
+           return join( xml_nl(),
+               make_xml_elt("date", $timestamp),
+               map { make_try_xml($_) } @{$dle->{'dumps'}->{$timestamp}});
+       }
+    );
+}
+
 sub make_dle_xml
 {
     my ( $hostname, $disk, $dle ) = @_;
@@ -221,13 +235,16 @@ sub make_dle_xml
             return join( xml_nl(),
                 make_xml_elt( "hostname", $hostname ),
                 make_xml_elt( "disk",     $disk ),
-                ( defined $dle->{estimate} && %{ $dle->{estimate} } > 0 )
-                ? make_estimate_xml( $dle->{estimate} )
-                : (),
-                exists $dle->{tries} ? map { make_try_xml($_) }
-                  @{ $dle->{tries} } : (),
-                exists $dle->{parts} ? map { make_part_xml($_) }
-                  @{ $dle->{parts} } : () );
+                ( defined $dle->{estimate} && %{ $dle->{estimate} } > 0 )?
+                     make_estimate_xml( $dle->{estimate} )
+                   : (),
+               ( keys %{$dle->{'dumps'}} > 0 ) ?
+                     map { make_dump_xml($dle, $_) } keys %{$dle->{'dumps'}}
+                   : (),
+                exists $dle->{parts} ?
+                     map { make_part_xml($_) } @{ $dle->{parts} }
+                   : ()
+           );
         }
     );
 }
index 9500465d297ccfac80dd21b5f87f5632d6a905dc..c8015d0da3d5a0cd9cc70633b1795ba27ab59b6e 100644 (file)
@@ -86,5 +86,12 @@ sub new {
     return $self;
 }
 
+sub _set_mesgout {
+    my $self = shift;
+
+    my $mesgout_fd;
+    open ($mesgout_fd, '>&=1') || die("Can't open mesgout_fd: $!");
+    $self->{mesgout} = $mesgout_fd;
+}
 
 1;
index 3b6ff69a0e5d378728e26ee01753828720d4061f..2e6026185da7247892a7027cd70051fb738b66cd 100644 (file)
@@ -120,7 +120,7 @@ sub print_to_server {
             print {$self->{mesgout}} "? $msg\n";
        }
     } elsif ($self->{action} eq "restore") {
-        print STDOUT "$msg\n";
+        print STDERR "$msg\n";
     } elsif ($self->{action} eq "validate") {
         print STDERR "$msg\n";
     } else {
@@ -180,6 +180,10 @@ sub do {
        $self->{action} = 'validate';
     }
 
+    if ($action eq 'backup') {
+       $self->_set_mesgout();
+    }
+
     # now convert it to a function name and see if it's
     # defined
     my $function_name = "command_$command";
index f115994a75b55d2a8dc3a384e34e5e48e19f3f0c..d49f67d3b4f801c349e311a665b6d51d840d26b6 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
index b2792b4574befc902276213e1c0e26d333e74ff8..6a746ba623e6df860027e927dcf3f6f0f716cda0 100644 (file)
@@ -71,21 +71,63 @@ Amanda::Tapelist - manipulate the Amanda tapelist
 
     use Amanda::Tapelist;
 
-    my $tl = Amanda::Tapelist::read_tapelist("/path/to/tapefile");
+    # to get a read only copy of the tapelist file:
+    my $tl = Amanda::Tapelist->new("/path/to/tapefile");
+
+    # to read/update/write the tapelist file
+    # read and take lock
+    my $tl = Amanda::Tapelist->new("/path/to/tapefile", 1);
+    # modify the memory copy
     $tl->add_tapelabel($datestamp, $label);
-    $tl->add_tapelabel($datestamp2, $label2, $comment);
-    $tl->write("/path/to/tapefile");
+    $tl->add_tapelabel($datestamp2, $label2, $comment, 1);
+    # write it and unlock
+    $tl->write();
+
+    # If you already have a read only copy and want to modify it
+    # take a read only copy
+    my $tl = Amanda::Tapelist->new("/path/to/tapefile");
+    # reload and take lock
+    $tl->reload(1);
+    # modify the memory copy
+    tl->add_tapelabel($datestamp, $label);
+    $tl->add_tapelabel($datestamp2, $label2, $comment, 1);
+    # write it and unlock
+    $tl->write();
 
 =head1 OBJECT-ORIENTED INTERFACE
 
-The package-level functions C<read_tapelist($filename)> and
-C<clear_tapelist()> both return a new tapelist object.
-C<read_tapelist> returns C<undef> if the tapelist does not exist.
+C<new> returns a hash with no C<tles> set if the tapelist does
+not exist. C<tles> is an empty array if the tapelist is empty.
 Invalid entries are silently ignored.
 
-A tapelist object is a sequence of tapelist elements (referred to as TLEs in
-this document), sorted by datestamp from newest to oldest.  Each TLE is a hash
-with the following keys:
+=head2 tapelist object
+
+A tapelist object is a hash with the following keys:
+
+=over
+
+=item C<filename>
+
+  The filename of the tapelist file.
+
+=item C<filename_lock>
+
+  The filename of the lock file.
+
+=item C<fl>
+
+  A Amanda::Util::file_lock is the file is locked.
+
+=item C<tles>
+
+A sequence of tapelist elements (referred to as TLEs in this document),
+sorted by datestamp from newest to oldest.
+
+=back
+
+=head2 tapelist element
+
+A tapelist elementas a hash with the following keys:
 
 =over
 
@@ -111,10 +153,16 @@ the comment for this tape, or undef if no comment was given
 
 =back
 
+=head1 Method
+
 The following methods are available on a tapelist object C<$tl>:
 
 =over
 
+=item C<relod($lock)>
+
+reload the tapelist file, lock it if $lock is set
+
 =item C<lookup_tapelabel($lbl)>
 
 look up and return a reference to the TLE with the given label
@@ -131,14 +179,24 @@ look up and return a reference to the TLE with the given datestamp
 
 remove the tape with the given label
 
-=item C<add_tapelabel($date, $lbl, $comment)>
+=item C<add_tapelabel($date, $lbl, $comment, $reuse)>
+
+add a tape with the given date, label, comment and reuse to the end of the
+tapelist. reuse can be 1 or undef for a reusable volume, it must be 0 for
+a no-reusable volume.
+
+=item C<write()> or C<write($filename)>
 
-add a tape with the given date, label, and comment to the end of the
-tapelist, marking it reusable.
+write the tapelist out to the same file as when read or to C<$filename> if it
+is set, remove the lock if a lock was taken
 
-=item C<write($filename)>
+=item C<unlock()>
 
-write the tapelist out to C<$filename>.
+remove the lock if a lock was taken
+
+=item C<clear_tapelist()>
+
+remove all tle from the tles.
 
 =back
 
@@ -146,7 +204,7 @@ write the tapelist out to C<$filename>.
 
 The C portions of Amanda treat the tapelist as a global variable,
 while this package treats it as an object (and can thus handle more
-than one tapelist simultaneously).  Every call to C<read_tapelist>
+than one tapelist simultaneously).  Every call to C<reload>
 fills this global variable with a copy of the tapelist, and likewise
 C<clear_tapelist> clears the global.  However, any changes made from
 Perl are not reflected in the C copy, nor are changes made by C
@@ -157,65 +215,60 @@ modules reflected in the Perl copy.
 
 
 use Amanda::Debug qw(:logging);
+use Amanda::Config qw( config_dir_relative );
+use File::Copy;
+use Fcntl qw(:flock); # import LOCK_* constants
 
 ## package functions
 
-sub read_tapelist {
-    my ($filename) = @_;
-
-    # let C read the file
-    C_read_tapelist($filename);
-
-    # and then read it ourselves
-    open(my $fh, "<", $filename) or return undef;
-    my @tles;
-    while (my $line = <$fh>) {
-       my ($datestamp, $label, $reuse, $comment)
-           = $line =~ m/^([0-9]*)\s([^\s]*)\s(reuse|no-reuse)\s*(?:\#(.*))?$/mx;
-       next if !defined $datestamp; # silently filter out bogus lines
-       push @tles, {
-           'datestamp' => $datestamp,
-           'label' => $label,
-           'reuse' => ($reuse eq 'reuse'),
-           'comment' => $comment,
-       };
-    }
-    close($fh);
-
-    # sort in descending order by datestamp, sorting on position, too, to ensure
-    # that entries with the same datestamp stay in the right order
-    update_positions(\@tles); # call a method with an explicit $self
-    @tles = sort {
-          $b->{'datestamp'} cmp $a->{'datestamp'}
-       || $a->{'position'} <=> $b->{'position'}
-       } @tles;
-
-    # and re-calculate the positions
-    update_positions(\@tles);
-
-    my $self = bless \@tles, "Amanda::Tapelist";
+sub new {
+    my ($class)  = shift;
+    my ($filename, $lock ) = @_;
+    my $self = {
+       filename => $filename,
+       lockname => $filename . '.lock',
+    };
+    bless $self, $class;
 
+    $self->reload($lock);
     return $self;
 }
 
 sub clear_tapelist {
+    my $self = shift;
+
     # clear the C version
     C_clear_tapelist();
 
-    # and produce an empty object
-    my $self = bless [], "Amanda::Tapelist";
-    $self->update_positions();
+    $self->{'tles'} = [];
 
     return $self;
 }
 
 ## methods
 
+sub reload {
+    my $self = shift;
+    my ($lock) = @_;
+
+    if ($lock) {
+       $self->_take_lock();
+    }
+
+    # clear the C copy
+    C_clear_tapelist();
+
+    # let C read the file
+    C_read_tapelist($self->{'filename'});
+
+    $self->_read_tapelist();
+}
+
 sub lookup_tapelabel {
     my $self = shift;
     my ($label) = @_;
 
-    for my $tle (@$self) {
+    for my $tle (@{$self->{'tles'}}) {
        return $tle if ($tle->{'label'} eq $label);
     }
 
@@ -226,15 +279,15 @@ sub lookup_tapepos {
     my $self = shift;
     my ($position) = @_;
 
-    $self->update_positions();
-    return $self->[$position-1];
+    $self->_update_positions();
+    return $self->{'tles'}->[$position-1];
 }
 
 sub lookup_tapedate {
     my $self = shift;
     my ($datestamp) = @_;
 
-    for my $tle (@$self) {
+    for my $tle (@{$self->{'tles'}}) {
        return $tle if ($tle->{'datestamp'} eq $datestamp);
     }
 
@@ -245,10 +298,10 @@ sub remove_tapelabel {
     my $self = shift;
     my ($label) = @_;
 
-    for (my $i = 0; $i < @$self; $i++) {
-       if ($self->[$i]->{'label'} eq $label) {
-           splice @$self, $i, 1;
-           $self->update_positions();
+    for (my $i = 0; $i < @{$self->{tles}}; $i++) {
+       if ($self->{tles}->[$i]->{'label'} eq $label) {
+           splice @{$self->{tles}}, $i, 1;
+           $self->_update_positions();
            return;
        }
     }
@@ -256,43 +309,118 @@ sub remove_tapelabel {
 
 sub add_tapelabel {
     my $self = shift;
-    my ($datestamp, $label, $comment) = @_;
+    my ($datestamp, $label, $comment, $reuse) = @_;
+    $reuse = 1 if !defined $reuse;
 
     # prepend this (presumably new) volume to the beginning of the list
-    unshift @$self, {
+    unshift @{$self->{'tles'}}, {
        'datestamp' => $datestamp,
        'label' => $label,
-       'reuse' => 1,
+       'reuse' => $reuse,
        'comment' => $comment,
     };
-    $self->update_positions();
+    $self->_update_positions();
 }
 
 sub write {
     my $self = shift;
     my ($filename) = @_;
+    my $result = TRUE;
+    $filename = $self->{'filename'} if !defined $filename;
+
+    my $new_tapelist_file = $filename . "-new-" . time();
 
-    open(my $fh, ">", $filename) or die("Could not open '$filename' for writing: $!");
-    for my $tle (@$self) {
+    open(my $fhn, ">", $new_tapelist_file) or die("Could not open '$new_tapelist_file' for writing: $!");
+    for my $tle (@{$self->{tles}}) {
        my $datestamp = $tle->{'datestamp'};
        my $label = $tle->{'label'};
        my $reuse = $tle->{'reuse'} ? 'reuse' : 'no-reuse';
        my $comment = (defined $tle->{'comment'})? (" #" . $tle->{'comment'}) : '';
-       print $fh "$datestamp $label $reuse$comment\n";
+       $result &&= print $fhn "$datestamp $label $reuse$comment\n";
+    }
+    my $result_close = close($fhn);
+    $result &&= $result_close;
+
+    return if (!$result);
+
+    unless (move($new_tapelist_file, $filename)) {
+       die ("failed to rename '$new_tapelist_file' to '$filename': $!");
     }
-    close($fh);
 
     # re-read from the C side to synchronize
     C_read_tapelist($filename);
+
+    $self->unlock();
+
+    return undef;
+}
+
+sub unlock {
+    my $self = shift;
+
+    return if !exists $self->{'fl'};
+
+    $self->{'fl'}->unlock();
+    delete $self->{'fl'}
 }
 
 ## private methods
 
+sub _take_lock {
+    my $self = shift;
+
+    if (!-e $self->{'lockname'}) {
+       open(my $fhl, ">>", $self->{'lockname'});
+       close($fhl);
+    }
+    my $fl = Amanda::Util::file_lock->new($self->{'lockname'});
+    while(($r = $fl->lock()) == 1) {
+       sleep(1);
+    }
+    if ($r == 0) {
+       $self->{'fl'} = $fl;
+    }
+}
+
+sub _read_tapelist {
+    my $self = shift;
+
+    my @tles;
+    open(my $fh, "<", $self->{'filename'}) or return $self;
+    while (my $line = <$fh>) {
+       my ($datestamp, $label, $reuse, $comment)
+           = $line =~ m/^([0-9]*)\s([^\s]*)\s(reuse|no-reuse)\s*(?:\#(.*))?$/mx;
+       next if !defined $datestamp; # silently filter out bogus lines
+       push @tles, {
+           'datestamp' => $datestamp,
+           'label' => $label,
+           'reuse' => ($reuse eq 'reuse'),
+           'comment' => $comment,
+       };
+    }
+    close($fh);
+
+    # sort in descending order by datestamp, sorting on position, too, to ensure
+    # that entries with the same datestamp stay in the right order
+    $self->{'tles'} = \@tles;
+    $self->_update_positions();
+    @tles = sort {
+          $b->{'datestamp'} cmp $a->{'datestamp'}
+       || $a->{'position'} <=> $b->{'position'}
+       } @tles;
+
+    $self->{'tles'} = \@tles;
+
+    # and re-calculate the positions
+    $self->_update_positions(\@tles);
+}
+
 # update the 'position' key for each TLE
-sub update_positions {
+sub _update_positions {
     my $self = shift;
-    for (my $i = 0; $i < @$self; $i++) {
-       $self->[$i]->{'position'} = $i+1;
+    my $tles = $self->{'tles'};
+    for (my $i = 0; $i < scalar @$tles; $i++) {
+       $tles->[$i]->{'position'} = $i+1;
     }
 }
 
index 0fe8b7389c2e321ddab6cc15dce5fd8f595977bb..1d266705c4a83f1695713187f97960159d0e10b3 100644 (file)
@@ -28,21 +28,63 @@ Amanda::Tapelist - manipulate the Amanda tapelist
 
     use Amanda::Tapelist;
 
-    my $tl = Amanda::Tapelist::read_tapelist("/path/to/tapefile");
+    # to get a read only copy of the tapelist file:
+    my $tl = Amanda::Tapelist->new("/path/to/tapefile");
+
+    # to read/update/write the tapelist file
+    # read and take lock
+    my $tl = Amanda::Tapelist->new("/path/to/tapefile", 1);
+    # modify the memory copy
     $tl->add_tapelabel($datestamp, $label);
-    $tl->add_tapelabel($datestamp2, $label2, $comment);
-    $tl->write("/path/to/tapefile");
+    $tl->add_tapelabel($datestamp2, $label2, $comment, 1);
+    # write it and unlock
+    $tl->write();
+
+    # If you already have a read only copy and want to modify it
+    # take a read only copy
+    my $tl = Amanda::Tapelist->new("/path/to/tapefile");
+    # reload and take lock
+    $tl->reload(1);
+    # modify the memory copy
+    tl->add_tapelabel($datestamp, $label);
+    $tl->add_tapelabel($datestamp2, $label2, $comment, 1);
+    # write it and unlock
+    $tl->write();
 
 =head1 OBJECT-ORIENTED INTERFACE
 
-The package-level functions C<read_tapelist($filename)> and
-C<clear_tapelist()> both return a new tapelist object.
-C<read_tapelist> returns C<undef> if the tapelist does not exist.
+C<new> returns a hash with no C<tles> set if the tapelist does
+not exist. C<tles> is an empty array if the tapelist is empty.
 Invalid entries are silently ignored.
 
-A tapelist object is a sequence of tapelist elements (referred to as TLEs in
-this document), sorted by datestamp from newest to oldest.  Each TLE is a hash
-with the following keys:
+=head2 tapelist object
+
+A tapelist object is a hash with the following keys:
+
+=over
+
+=item C<filename>
+
+  The filename of the tapelist file.
+
+=item C<filename_lock>
+
+  The filename of the lock file.
+
+=item C<fl>
+
+  A Amanda::Util::file_lock is the file is locked.
+
+=item C<tles>
+
+A sequence of tapelist elements (referred to as TLEs in this document),
+sorted by datestamp from newest to oldest.
+
+=back
+
+=head2 tapelist element
+
+A tapelist elementas a hash with the following keys:
 
 =over
 
@@ -68,10 +110,16 @@ the comment for this tape, or undef if no comment was given
 
 =back
 
+=head1 Method
+
 The following methods are available on a tapelist object C<$tl>:
 
 =over
 
+=item C<relod($lock)>
+
+reload the tapelist file, lock it if $lock is set
+
 =item C<lookup_tapelabel($lbl)>
 
 look up and return a reference to the TLE with the given label
@@ -88,14 +136,24 @@ look up and return a reference to the TLE with the given datestamp
 
 remove the tape with the given label
 
-=item C<add_tapelabel($date, $lbl, $comment)>
+=item C<add_tapelabel($date, $lbl, $comment, $reuse)>
+
+add a tape with the given date, label, comment and reuse to the end of the
+tapelist. reuse can be 1 or undef for a reusable volume, it must be 0 for
+a no-reusable volume.
+
+=item C<write()> or C<write($filename)>
+
+write the tapelist out to the same file as when read or to C<$filename> if it
+is set, remove the lock if a lock was taken
+
+=item C<unlock()>
 
-add a tape with the given date, label, and comment to the end of the
-tapelist, marking it reusable.
+remove the lock if a lock was taken
 
-=item C<write($filename)>
+=item C<clear_tapelist()>
 
-write the tapelist out to C<$filename>.
+remove all tle from the tles.
 
 =back
 
@@ -103,7 +161,7 @@ write the tapelist out to C<$filename>.
 
 The C portions of Amanda treat the tapelist as a global variable,
 while this package treats it as an object (and can thus handle more
-than one tapelist simultaneously).  Every call to C<read_tapelist>
+than one tapelist simultaneously).  Every call to C<reload>
 fills this global variable with a copy of the tapelist, and likewise
 C<clear_tapelist> clears the global.  However, any changes made from
 Perl are not reflected in the C copy, nor are changes made by C
index 5999ea80ab0da7fc2eaa6305cc2a696514d8ca92..510fd29bdd1910480d13233e0fd8104a39176863 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
 
 %perlcode %{
 use Amanda::Debug qw(:logging);
+use Amanda::Config qw( config_dir_relative );
+use File::Copy;
+use Fcntl qw(:flock); # import LOCK_* constants
 
 ## package functions
 
-sub read_tapelist {
-    my ($filename) = @_;
-
-    # let C read the file
-    C_read_tapelist($filename);
-
-    # and then read it ourselves
-    open(my $fh, "<", $filename) or return undef;
-    my @tles;
-    while (my $line = <$fh>) {
-       my ($datestamp, $label, $reuse, $comment)
-           = $line =~ m/^([0-9]*)\s([^\s]*)\s(reuse|no-reuse)\s*(?:\#(.*))?$/mx;
-       next if !defined $datestamp; # silently filter out bogus lines
-       push @tles, {
-           'datestamp' => $datestamp,
-           'label' => $label,
-           'reuse' => ($reuse eq 'reuse'),
-           'comment' => $comment,
-       };
-    }
-    close($fh);
-
-    # sort in descending order by datestamp, sorting on position, too, to ensure
-    # that entries with the same datestamp stay in the right order
-    update_positions(\@tles); # call a method with an explicit $self
-    @tles = sort {
-          $b->{'datestamp'} cmp $a->{'datestamp'}
-       || $a->{'position'} <=> $b->{'position'}
-       } @tles;
-
-    # and re-calculate the positions
-    update_positions(\@tles);
-
-    my $self = bless \@tles, "Amanda::Tapelist";
+sub new {
+    my ($class)  = shift;
+    my ($filename, $lock ) = @_;
+    my $self = {
+       filename => $filename,
+       lockname => $filename . '.lock',
+    };
+    bless $self, $class;
 
+    $self->reload($lock);
     return $self;
 }
 
 sub clear_tapelist {
+    my $self = shift;
+
     # clear the C version
     C_clear_tapelist();
 
-    # and produce an empty object
-    my $self = bless [], "Amanda::Tapelist";
-    $self->update_positions();
+    $self->{'tles'} = [];
 
     return $self;
 }
 
 ## methods
 
+sub reload {
+    my $self = shift;
+    my ($lock) = @_;
+
+    if ($lock) {
+       $self->_take_lock();
+    }
+
+    # clear the C copy
+    C_clear_tapelist();
+
+    # let C read the file
+    C_read_tapelist($self->{'filename'});
+
+    $self->_read_tapelist();
+}
+
 sub lookup_tapelabel {
     my $self = shift;
     my ($label) = @_;
 
-    for my $tle (@$self) {
+    for my $tle (@{$self->{'tles'}}) {
        return $tle if ($tle->{'label'} eq $label);
     }
 
@@ -99,15 +94,15 @@ sub lookup_tapepos {
     my $self = shift;
     my ($position) = @_;
 
-    $self->update_positions();
-    return $self->[$position-1];
+    $self->_update_positions();
+    return $self->{'tles'}->[$position-1];
 }
 
 sub lookup_tapedate {
     my $self = shift;
     my ($datestamp) = @_;
 
-    for my $tle (@$self) {
+    for my $tle (@{$self->{'tles'}}) {
        return $tle if ($tle->{'datestamp'} eq $datestamp);
     }
 
@@ -118,10 +113,10 @@ sub remove_tapelabel {
     my $self = shift;
     my ($label) = @_;
 
-    for (my $i = 0; $i < @$self; $i++) {
-       if ($self->[$i]->{'label'} eq $label) {
-           splice @$self, $i, 1;
-           $self->update_positions();
+    for (my $i = 0; $i < @{$self->{tles}}; $i++) {
+       if ($self->{tles}->[$i]->{'label'} eq $label) {
+           splice @{$self->{tles}}, $i, 1;
+           $self->_update_positions();
            return;
        }
     }
@@ -129,43 +124,118 @@ sub remove_tapelabel {
 
 sub add_tapelabel {
     my $self = shift;
-    my ($datestamp, $label, $comment) = @_;
+    my ($datestamp, $label, $comment, $reuse) = @_;
+    $reuse = 1 if !defined $reuse;
 
     # prepend this (presumably new) volume to the beginning of the list
-    unshift @$self, {
+    unshift @{$self->{'tles'}}, {
        'datestamp' => $datestamp,
        'label' => $label,
-       'reuse' => 1,
+       'reuse' => $reuse,
        'comment' => $comment,
     };
-    $self->update_positions();
+    $self->_update_positions();
 }
 
 sub write {
     my $self = shift;
     my ($filename) = @_;
+    my $result = TRUE;
+    $filename = $self->{'filename'} if !defined $filename;
+
+    my $new_tapelist_file = $filename . "-new-" . time();
 
-    open(my $fh, ">", $filename) or die("Could not open '$filename' for writing: $!");
-    for my $tle (@$self) {
+    open(my $fhn, ">", $new_tapelist_file) or die("Could not open '$new_tapelist_file' for writing: $!");
+    for my $tle (@{$self->{tles}}) {
        my $datestamp = $tle->{'datestamp'};
        my $label = $tle->{'label'};
        my $reuse = $tle->{'reuse'} ? 'reuse' : 'no-reuse';
        my $comment = (defined $tle->{'comment'})? (" #" . $tle->{'comment'}) : '';
-       print $fh "$datestamp $label $reuse$comment\n";
+       $result &&= print $fhn "$datestamp $label $reuse$comment\n";
+    }
+    my $result_close = close($fhn);
+    $result &&= $result_close;
+
+    return if (!$result);
+
+    unless (move($new_tapelist_file, $filename)) {
+       die ("failed to rename '$new_tapelist_file' to '$filename': $!");
     }
-    close($fh);
 
     # re-read from the C side to synchronize
     C_read_tapelist($filename);
+
+    $self->unlock();
+
+    return undef;
+}
+
+sub unlock {
+    my $self = shift;
+
+    return if !exists $self->{'fl'};
+
+    $self->{'fl'}->unlock();
+    delete $self->{'fl'}
 }
 
 ## private methods
 
+sub _take_lock {
+    my $self = shift;
+
+    if (!-e $self->{'lockname'}) {
+       open(my $fhl, ">>", $self->{'lockname'});
+       close($fhl);
+    }
+    my $fl = Amanda::Util::file_lock->new($self->{'lockname'});
+    while(($r = $fl->lock()) == 1) {
+       sleep(1);
+    }
+    if ($r == 0) {
+       $self->{'fl'} = $fl;
+    }
+}
+
+sub _read_tapelist {
+    my $self = shift;
+
+    my @tles;
+    open(my $fh, "<", $self->{'filename'}) or return $self;
+    while (my $line = <$fh>) {
+       my ($datestamp, $label, $reuse, $comment)
+           = $line =~ m/^([0-9]*)\s([^\s]*)\s(reuse|no-reuse)\s*(?:\#(.*))?$/mx;
+       next if !defined $datestamp; # silently filter out bogus lines
+       push @tles, {
+           'datestamp' => $datestamp,
+           'label' => $label,
+           'reuse' => ($reuse eq 'reuse'),
+           'comment' => $comment,
+       };
+    }
+    close($fh);
+
+    # sort in descending order by datestamp, sorting on position, too, to ensure
+    # that entries with the same datestamp stay in the right order
+    $self->{'tles'} = \@tles;
+    $self->_update_positions();
+    @tles = sort {
+          $b->{'datestamp'} cmp $a->{'datestamp'}
+       || $a->{'position'} <=> $b->{'position'}
+       } @tles;
+
+    $self->{'tles'} = \@tles;
+
+    # and re-calculate the positions
+    $self->_update_positions(\@tles);
+}
+
 # update the 'position' key for each TLE
-sub update_positions {
+sub _update_positions {
     my $self = shift;
-    for (my $i = 0; $i < @$self; $i++) {
-       $self->[$i]->{'position'} = $i+1;
+    my $tles = $self->{'tles'};
+    for (my $i = 0; $i < scalar @$tles; $i++) {
+       $tles->[$i]->{'position'} = $i+1;
     }
 }
 
diff --git a/perl/Amanda/Taper/Controller.pm b/perl/Amanda/Taper/Controller.pm
new file mode 100644 (file)
index 0000000..cb0e85c
--- /dev/null
@@ -0,0 +1,290 @@
+#! @PERL@
+# Copyright (c) 2009, 2010 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+=head1 NAME
+
+Amanda::Taper::Controller
+
+=head1 DESCRIPTION
+
+This package is a component of the Amanda taper, and is not intended for use by
+other scripts or applications.
+
+The controller interfaces with the driver (via L<Amanda::Taper::Protocol>) and
+controls one or more workers (L<Amanda::Taper::Worker>).
+
+The controller create an L<Amanda::Taper::Worker> object for each
+START_TAPER command it receive. It dispatch the following commands
+to the correct worker.  
+
+=cut
+
+use lib '@amperldir@';
+use strict;
+use warnings;
+
+package Amanda::Taper::Controller;
+
+use POSIX qw( :errno_h );
+use Amanda::Changer;
+use Amanda::Config qw( :getconf config_dir_relative );
+use Amanda::Header;
+use Amanda::Holding;
+use Amanda::MainLoop qw( :GIOCondition );
+use Amanda::MainLoop;
+use Amanda::Taper::Protocol;
+use Amanda::Taper::Scan;
+use Amanda::Taper::Worker;
+use Amanda::Logfile qw( :logtype_t log_add );
+use Amanda::Xfer qw( :constants );
+use Amanda::Util qw( quote_string );
+use Amanda::Tapelist;
+use File::Temp;
+
+sub new {
+    my $class = shift;
+
+    my $self = bless {
+
+       # filled in at start
+       proto => undef,
+
+       worker => {},
+    }, $class;
+    return $self;
+}
+
+# The feedback object mediates between messages from the driver and the ongoing
+# action with the taper.  This is made a little bit complicated because the
+# driver conversation is fairly contextual, with some responses answering
+# "questions" asked earlier.  This is modeled with the following taper
+# "states":
+#
+# init:
+#   waiting for START-TAPER command
+# starting:
+#   warming up devices; TAPER-OK not sent yet
+# idle:
+#   not currently dumping anything
+# making_xfer:
+#   setting up a transfer for a new dump
+# getting_header:
+#   getting the header before beginning a new dump
+# writing:
+#   in the middle of writing a file (self->{'handle'} set)
+# error:
+#   a fatal error has occurred, so this object won't do anything
+
+sub start {
+    my $self = shift;
+
+    my $message_cb = make_cb(message_cb => sub {
+       my ($msgtype, %params) = @_;
+       my $msg;
+       if (defined $msgtype) {
+           $msg = "unhandled command '$msgtype'";
+       } else {
+           $msg = $params{'error'};
+       }
+       log_add($L_ERROR, $msg);
+       print STDERR "$msg\n";
+       $self->{'proto'}->send(Amanda::Taper::Protocol::BAD_COMMAND,
+           message => $msg);
+    });
+    $self->{'proto'} = Amanda::Taper::Protocol->new(
+       rx_fh => *STDIN,
+       tx_fh => *STDOUT,
+       message_cb => $message_cb,
+       message_obj => $self,
+       debug => $Amanda::Config::debug_taper?'driver/taper':'',
+    );
+
+    my $changer = Amanda::Changer->new();
+    if ($changer->isa("Amanda::Changer::Error")) {
+       # send a TAPE_ERROR right away
+       $self->{'proto'}->send(Amanda::Taper::Protocol::TAPE_ERROR,
+               worker_name => "SETUP",
+               message => "$changer");
+
+       # log the error (note that the message is intentionally not quoted)
+       log_add($L_ERROR, "no-tape error [$changer]");
+
+       # wait for it to be transmitted, then exit
+       $self->{'proto'}->stop(finished_cb => sub {
+           Amanda::MainLoop::quit();
+       });
+
+       # don't finish start()ing
+       return;
+    }
+
+    $self->{'taperscan'} = Amanda::Taper::Scan->new(changer => $changer);
+}
+
+sub quit {
+    my $self = shift;
+    my %params = @_;
+    my @errors = ();
+    my @worker = ();
+
+    my $steps = define_steps
+       cb_ref => \$params{'finished_cb'};
+
+    step init => sub {
+       @worker = values %{$self->{'worker'}};
+       delete $self->{'worker'};
+       $steps->{'quit_scribe'}->();
+    };
+
+    step quit_scribe => sub {
+       my $worker = shift @worker;
+       if (defined $worker and defined $worker->{'scribe'}) {
+           $worker->{'scribe'}->quit(finished_cb => sub {
+               my ($err) = @_;
+               push @errors, $err if ($err);
+
+               $steps->{'quit_scribe'}->();
+           });
+       } else {
+           $steps->{'stop_proto'}->();
+       }
+    };
+
+    step stop_proto => sub {
+       $self->{'proto'}->stop(finished_cb => sub {
+           my ($err) = @_;
+           push @errors, $err if ($err);
+
+           $steps->{'done'}->();
+       });
+    };
+
+    step done => sub {
+       if (@errors) {
+           $params{'finished_cb'}->(join("; ", @errors));
+       } else {
+           $params{'finished_cb'}->();
+       }
+    };
+}
+
+##
+# Driver commands
+
+sub msg_START_TAPER {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    my $worker = new Amanda::Taper::Worker($params{'worker_name'}, $self,
+                                 $params{'timestamp'});
+
+    $self->{'worker'}->{$params{'worker_name'}} = $worker;
+
+    $self->{'timestamp'} = $params{'timestamp'};
+}
+
+# defer both PORT_ and FILE_WRITE to a common method
+sub msg_FILE_WRITE {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    my $worker = $self->{'worker'}->{$params{'worker_name'}};
+    $worker->FILE_WRITE(@_);
+}
+
+sub msg_PORT_WRITE {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    my $worker = $self->{'worker'}->{$params{'worker_name'}};
+    $worker->PORT_WRITE(@_);
+}
+
+sub msg_START_SCAN {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    my $worker = $self->{'worker'}->{$params{'worker_name'}};
+    $worker->START_SCAN(@_);
+}
+
+sub msg_NEW_TAPE {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    my $worker = $self->{'worker'}->{$params{'worker_name'}};
+    $worker->NEW_TAPE(@_);
+}
+
+sub msg_NO_NEW_TAPE {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    my $worker = $self->{'worker'}->{$params{'worker_name'}};
+    $worker->NO_NEW_TAPE(@_);
+}
+
+sub msg_DONE {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    my $worker = $self->{'worker'}->{$params{'worker_name'}};
+    $worker->DONE(@_);
+}
+
+sub msg_FAILED {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    my $worker = $self->{'worker'}->{$params{'worker_name'}};
+    $worker->FAILED(@_);
+}
+
+sub msg_TAKE_SCRIBE_FROM {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    my $worker = $self->{'worker'}->{$params{'worker_name'}};
+    my $worker1 = $self->{'worker'}->{$params{'from_worker_name'}};
+    $worker->TAKE_SCRIBE_FROM($worker1, @_);
+    delete $self->{'worker'}->{$params{'from_worker_name'}};
+}
+
+sub msg_QUIT {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+    my $read_cb;
+
+    # because the driver hangs up on us immediately after sending QUIT,
+    # and EOF also means QUIT, we tend to get this command repeatedly.
+    # So check to make sure this is only called once
+    return if $self->{'quitting'};
+    $self->{'quitting'} = 1;
+
+    my $finished_cb = make_cb(finished_cb => sub {
+       my $err = shift;
+       if ($err) {
+           Amanda::Debug::debug("Quit error: $err");
+       }
+       Amanda::MainLoop::quit();
+    });
+    $self->quit(finished_cb => $finished_cb);
+};
+
+1;
diff --git a/perl/Amanda/Taper/Protocol.pm b/perl/Amanda/Taper/Protocol.pm
new file mode 100644 (file)
index 0000000..4f75ddd
--- /dev/null
@@ -0,0 +1,133 @@
+#! @PERL@
+# Copyright (c) 2009, 2010 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+=head1 NAME
+
+Amanda::Taper::Protocol
+
+=head1 DESCRIPTION
+
+This package is a component of the Amanda taper, and is not intended for use by
+other scripts or applications.
+
+This package define the protocol between the taper and the driver, it is
+used by L<Amanda::Taper::Controller> and L<Amanda::Taper::Worker>
+
+=cut
+
+use lib '@amperldir@';
+use strict;
+use warnings;
+
+package Amanda::Taper::Protocol;
+
+use Amanda::IPC::LineProtocol;
+use base "Amanda::IPC::LineProtocol";
+
+use constant START_TAPER => message("START-TAPER",
+    format => [ qw( worker_name timestamp ) ],
+);
+
+use constant PORT_WRITE => message("PORT-WRITE",
+    format => [ qw( worker_name handle hostname diskname level datestamp
+           dle_tape_splitsize dle_split_diskbuffer dle_fallback_splitsize dle_allow_split
+           part_size part_cache_type part_cache_dir part_cache_max_size
+           data_path ) ],
+);
+
+use constant FILE_WRITE => message("FILE-WRITE",
+    format => [ qw( worker_name handle filename hostname diskname level datestamp
+           dle_tape_splitsize dle_split_diskbuffer dle_fallback_splitsize dle_allow_split
+           part_size part_cache_type part_cache_dir part_cache_max_size
+           orig_kb) ],
+);
+
+use constant START_SCAN => message("START-SCAN",
+    format => [ qw( worker_name handle ) ],
+);
+
+use constant NEW_TAPE => message("NEW-TAPE",
+    format => {
+       in => [ qw( worker_name handle ) ],
+       out => [ qw( handle label ) ],
+    },
+);
+
+use constant NO_NEW_TAPE => message("NO-NEW-TAPE",
+    format => {
+       in => [ qw( worker_name handle reason ) ],
+       out => [ qw( handle ) ],
+    }
+);
+
+use constant FAILED => message("FAILED",
+    format => {
+       in => [ qw( worker_name handle ) ],
+       out => [ qw( handle input taper inputerr tapererr ) ],
+    },
+);
+
+use constant DONE => message("DONE",
+    format => {
+       in => [ qw( worker_name handle orig_kb ) ],
+       out => [ qw( handle input taper stats inputerr tapererr ) ],
+    },
+);
+
+use constant QUIT => message("QUIT",
+    on_eof => 1,
+);
+
+use constant TAPER_OK => message("TAPER-OK",
+    format => [ qw( worker_name ) ],
+);
+
+use constant TAPE_ERROR => message("TAPE-ERROR",
+    format => [ qw( worker_name message ) ],
+);
+
+use constant PARTIAL => message("PARTIAL",
+    format => [ qw( handle input taper stats inputerr tapererr ) ],
+);
+
+use constant PARTDONE => message("PARTDONE",
+    format => [ qw( handle label fileno kb stats ) ],
+);
+
+use constant REQUEST_NEW_TAPE => message("REQUEST-NEW-TAPE",
+    format => [ qw( handle ) ],
+);
+
+use constant PORT => message("PORT",
+    format => [ qw( worker_name handle port ipports ) ],
+);
+
+use constant BAD_COMMAND => message("BAD-COMMAND",
+    format => [ qw( message ) ],
+);
+
+use constant TAKE_SCRIBE_FROM => message("TAKE-SCRIBE-FROM",
+    format => [ qw( worker_name handle from_worker_name) ],
+);
+
+use constant DUMPER_STATUS => message("DUMPER-STATUS",
+    format => [ qw( handle ) ],
+);
+
+1;
index 238c44f8fbb9cf41e0b47a8ed96d6eeddd0d7652..26c5a6d4c03cf9211f95a72bbd74ee8c6f2c037e 100644 (file)
@@ -35,6 +35,7 @@ This is an abstract base class for taperscan algorithms.
     die $err if $err;
     # write to $reservation->{'device'}, using label $label, and opening
     # the device with $access_mode (one of $ACCESS_WRITE or $ACCESS_APPEND)
+    # $is_new is set to 1 if the volume is not already labeled.
     # ..
   });
   my $user_msg_fn = sub {
@@ -48,7 +49,7 @@ C<Amanda::Taper::Scan> subclasses represent algorithms used by
 C<Amanda::Taper::Scribe> (see L<Amanda::Taper::Scribe>) to scan for and select
 volumes for writing.
 
-Call C<Amanda::Taperscan->new()> to create a new taperscan
+Call C<< Amanda::Taperscan->new() >> to create a new taperscan
 algorithm.  The constructor takes the following keyword arguments:
 
     changer       Amanda::Changer object to use (required)
@@ -64,6 +65,9 @@ instantiated.  The remaining options will be taken from the configuration file
 if not specified.  Default values for all of these options are applied before a
 subclass's constructor is called.
 
+The autolabel option should look like the C<CNF_AUTOLABEL> hash - see
+L<Amanda::Config>.
+
 Subclasses must implement a single method: C<scan>.  It takes only one mandatory
 parameter, C<result_cb>:
 
@@ -191,6 +195,7 @@ scan was looking for.
 use strict;
 use warnings;
 use Amanda::Config qw( :getconf );
+use Amanda::Tapelist;
 
 sub new {
     my $class = shift;
@@ -236,6 +241,7 @@ sub new {
     $self->{'tapelist_filename'} = $params{'tapelist_filename'};
     $self->{'labelstr'} = $params{'labelstr'};
     $self->{'autolabel'} = $params{'autolabel'};
+    $self->{'tapelist'} = Amanda::Tapelist->new($self->{'tapelist_filename'});
 
     return $self;
 }
@@ -250,8 +256,7 @@ sub scan {
 sub read_tapelist {
     my $self = shift;
 
-    $self->{'tapelist'} = Amanda::Tapelist::read_tapelist($self->{'tapelist_filename'});
-    return $self->{'tapelist'};
+    $self->{'tapelist'}->reload();
 }
 
 sub oldest_reusable_volume {
@@ -260,7 +265,7 @@ sub oldest_reusable_volume {
 
     my $best = undef;
     my $num_acceptable = 0;
-    for my $tle (@{$self->{'tapelist'}}) {
+    for my $tle (@{$self->{'tapelist'}->{'tles'}}) {
        next unless $tle->{'reuse'};
        next if $tle->{'datestamp'} eq '0' and !$params{'new_label_ok'};
        $num_acceptable++;
@@ -286,7 +291,7 @@ sub is_reusable_volume {
     }
 
     # see if it's in the collection of reusable volumes
-    my @tapelist = @{$self->{'tapelist'}};
+    my @tapelist = @{$self->{'tapelist'}->{'tles'}};
     my @reusable = @tapelist[$self->{'tapecycle'}-1 .. $#tapelist];
     for my $tle (@reusable) {
         return 1 if $tle eq $vol_tle;
@@ -299,6 +304,8 @@ sub is_reusable_volume {
 sub make_new_tape_label {
     my $self = shift;
     my %params = @_;
+
+    my $tl = exists $params{'tapelist'}? $params{'tapelist'} : $self->{'tapelist'};
     my $template = exists $params{'template'}? $params{'template'} : $self->{'autolabel'}->{'template'};
     my $labelstr = exists $params{'labelstr'}? $params{'labelstr'} : $self->{'labelstr'};
 
@@ -311,7 +318,7 @@ sub make_new_tape_label {
        $template) =~ s/(%+)/"%0" . length($1) . "d"/e;
 
     my %existing_labels =
-       map { $_->{'label'} => 1 } @{$self->{'tapelist'}};
+       map { $_->{'label'} => 1 } @{$tl->{'tles'}};
 
     my ($i, $label);
     for ($i = 1; $i < $nlabels; $i++) {
index 54fdf723405881583de27f7ce1cf4c93720b1516..3fa74cd1b0f3deb7cb406bd1eaf63ee3873d0a8f 100644 (file)
@@ -63,7 +63,7 @@ sub scan {
     $self->{'user_msg_fn'} = $params{'user_msg_fn'} || sub {};
 
     # refresh the tapelist at every scan
-    $self->{'tapelist'} = $self->read_tapelist();
+    $self->read_tapelist();
 
     # count the number of scans we do, so we can only load 'current' on the
     # first scan
@@ -180,6 +180,7 @@ sub stage_1 {
     step do_load => sub {
        $self->{'changer'}->load(
            label => $oldest_reusable,
+           set_current => 1,
            res_cb => $steps->{'load_done'});
     };
 
@@ -282,20 +283,15 @@ sub try_volume {
 
     if ($status & $DEVICE_STATUS_VOLUME_UNLABELED and
        $dev->volume_header and
-       $dev->volume_header->{'type'} == $Amanda::Header::F_EMPTY and
-       !$autolabel->{'empty'}) {
-       return 0;
-    }
-
-    if ($status & $DEVICE_STATUS_VOLUME_UNLABELED and
+       $dev->volume_header->{'type'} == $Amanda::Header::F_EMPTY) {
+       return 0 if (!$autolabel->{'empty'});
+    } elsif ($status & $DEVICE_STATUS_VOLUME_UNLABELED and
        $dev->volume_header and
-       $dev->volume_header->{'type'} == $Amanda::Header::F_WEIRD and
-       !$autolabel->{'non_amanda'}) {
-       return 0;
-    }
-
-    if ($status & $DEVICE_STATUS_VOLUME_ERROR and
-       !$autolabel->{'volume_error'}) {
+       $dev->volume_header->{'type'} == $Amanda::Header::F_WEIRD) {
+       return 0 if (!$autolabel->{'non_amanda'});
+    } elsif ($status & $DEVICE_STATUS_VOLUME_ERROR) {
+       return 0 if (!$autolabel->{'volume_error'});
+    } elsif ($status != $DEVICE_STATUS_SUCCESS) {
        return 0;
     }
 
index 44d6621576195fd61c3f787442137a5aee0522b9..3efbbb59607263ab399824fd669a1ca30477aeb5 100644 (file)
 # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-package Amanda::Taper::Scribe;
-
-use strict;
-use warnings;
-use Carp;
-
-use Amanda::Xfer qw( :constants );
-use Amanda::Device qw( :constants );
-use Amanda::Header;
-use Amanda::Debug qw( :logging );
-use Amanda::MainLoop;
-
 =head1 NAME
 
 Amanda::Taper::Scribe
 
 =head1 SYNOPSIS
 
-  my $scribe = Amanda::Taper::Scribe->new(
-       taperscan => $taperscan_algo,
-        feedback => $feedback_obj);
+  step start_scribe => sub {
+      my $scribe = Amanda::Taper::Scribe->new(
+           taperscan => $taperscan_algo,
+           feedback => $feedback_obj);
+    $scribe->start(
+       write_timestamp => $write_timestamp,
+       finished_cb => $steps->{'start_xfer'});
+  };
 
-  $subs{'start_scribe'} = make_cb(start_scribe => sub {
-    $scribe->start($datestamp, finished_cb => $subs{'start_xfer'});
-  });
-
-  $subs{'start_xfer'} = make_cb(start_xfer => sub {
+  step start_xfer => sub {
     my ($err) = @_;
-
     my $xfer_dest = $scribe->get_xfer_dest(
        max_memory => 64 * 1024,
-       split_method => 'disk',
+       can_cache_inform => 0,
        part_size => 150 * 1024**2,
-       disk_cache_dirname => "$tmpdir/splitbuffer");
-
+       part_cache_type => 'disk',
+       part_cache_dir => "$tmpdir/splitbuffer",
+       part_cache_max_size => 20 * 1024**2);
     # .. set up the rest of the transfer ..
-
     $xfer->start(sub {
         my ($src, $msg, $xfer) = @_;
         $scribe->handle_xmsg($src, $msg, $xfer);
         # .. any other processing ..
-    });
-
+    };
     # tell the scribe to start dumping via this transfer
     $scribe->start_dump(
        xfer => $xfer,
         dump_header => $hdr,
-        dump_cb => $subs{'dump_cb'});
-  });
+        dump_cb => $steps->{'dump_cb'});
+  };
 
-  $subs{'dump_cb'} = make_cb(dump_cb => sub {
+  step dump_cb => sub {
       my %params = @_;
       # .. handle dump results ..
-
       print "DONE\n";
-      Amanda::MainLoop::quit();
-  });
-
+      $finished_cb->();
+  };
 
-  $subs{'start_scribe'}->();
-  Amanda::MainLoop::run();
 
 =head1 OVERVIEW
 
@@ -132,7 +115,7 @@ Start the scribe's operation by calling its C<start> method.  This will invoke
 the taperscan algorithm and scan for a volume.  The method takes two parameters:
 
   $scribe->start(
-        dump_timestamp => $ts,
+        write_timestamp => $ts,
        finished_cb => $start_finished_cb);
 
 The timestamp will be written to each volume written by the Scribe.  The
@@ -150,6 +133,27 @@ Scribe, then start the transfer, and finally let the Scribe know that the
 transfer has started.  Note that the Scribe supplies and manages the transfer
 destination, but the transfer itself remains the responsibility of the caller.
 
+=head3 Get device
+
+Call C<get_device> to get the first device the xfer will be working with.
+
+  $device = $scribe->get_device();
+
+This method must be called after C<start> has completed.
+
+=head3 Check device compatibily for the data path
+
+Call C<check_data_path>, supplying the data_path requested by the user.
+
+  if (my $err = $scribe->check_data_path($data_path)) {
+      # handle error message
+  }
+
+This method must be called after C<start> has completed and before
+C<get_xfer_dest> is called. It returns C<undef> on success or an error message
+if the supplied C<data_path> is incompatible with the device.  This is mainly
+used to detect when a DirectTCP dump is going to a non-DirectTCP device.
+
 =head3 Get a Transfer Destination
 
 Call C<get_xfer_dest> to get the transfer element, supplying information on how
@@ -157,44 +161,71 @@ the dump should be split:
 
   $xdest = $scribe->get_xfer_dest(
         max_memory => $max_memory,
-        # .. split parameters
+        # .. splitting parameters
         );
 
 This method must be called after C<start> has completed, and will always return
-a transfer element immediately.
+a transfer element immediately.  The underlying C<Amanda::Xfer::Dest::Taper>
+handles device streaming properly.  It uses C<max_memory> bytes of memory for
+this purpose.
+
+The splitting parameters to C<get_xfer_dest> are:
+
+=over 4
 
-The underlying C<Amanda::Xfer::Dest::Taper> handles device streaming
-properly.  It uses C<max_memory> bytes of memory for this purpose.
+=item C<part_size>
 
-The arguments to C<get_xfer_dest> differ for the various split methods.
-For no splitting:
+the split part size to use, or 0 for no splitting
 
-  $scribe->get_xfer_dest(
-        # ...
-        split_method => 'none');
+=item C<part_cache_type>
 
-For buffering the split parts in memory:
+when caching, the kind of caching to perform ('disk', 'memory' or the default,
+'none')
 
-  $scribe->get_xfer_dest(
-        # ...
-        split_method => 'memory',
-        part_size => $part_size);
+=item C<part_cache_dir>
 
-For buffering the split parts on disk:
+the directory to use for disk caching
 
-  $scribe->get_xfer_dest(
-        # ...
-        split_method => 'disk',
-        part_size => $part_size,
-        disk_cache_dirname => $disk_cache_dirname);
+=item C<part_cache_max_size>
 
-Finally, if the transfer source is capable of calling
-C<Amanda::Xfer::Dest::Taper>'s C<cache_inform> method:
+the maximum part size to use when caching
 
-  $scribe->get_xfer_dest(
-        # ...
-        split_method => 'cache_inform',
-        part_size => $part_size);
+=item C<can_cache_inform>
+
+true if the transfer source can call the destination's C<cache_inform> method
+(e.g., C<Amanda::Xfer::Source::Holding>).
+
+=back
+
+The first four of these parameters correspond exactly to the eponymous tapetype
+configuration parameters, and have the same default values (when omitted or
+C<undef>).  The method will take this information, along with details of the
+device it intends to use, and set up the transfer destination.
+
+The utility function C<get_splitting_args_from_config> can determine the
+appropriate C<get_xfer_dest> splitting parameters based on a
+few Amanda configuration parameters.  If a parameter was not seen in the
+configuration, it should be omitted or passed as C<undef>.  The function
+returns a hash to pass to C<get_xfer_dest>, although that hash may have an
+C<warning> key containing a message if there is a problem that the user
+should know about.
+
+  use Amanda::Taper::Scribe qw( get_splitting_args_from_config );
+  my %splitting_args = get_splitting_args_from_config(
+    # Amanda dumptype configuration parameters,
+    dle_tape_splitsize => ..,
+    dle_split_diskbuffer => ..,
+    dle_fallback_splitsize => ..,
+    dle_allow_split => ..,
+    # Amanda tapetype configuration parameters,
+    part_size => .., ## in bytes, not kb!!
+    part_size_kb => ..., ## or use this, in kb
+    part_cache_type => ..,
+    part_cache_type_enum => ..., ## one of the enums from tapetype_getconf
+    part_cache_dir => ..,
+    part_cache_max_size => ..,
+  );
+  if ($splitting_args{'error'}) { .. }
 
 An C<Amanda::Taper::Scribe> object can only run one transfer at a time, so
 do not call C<get_xfer_dest> until the C<dump_cb> for the previous C<start_dump>
@@ -234,23 +265,42 @@ parameters.
   $dump_cb->(
         result => $result,
         device_errors => $device_errors,
+       config_denial_message => $cdm,
         size => $size,
         duration => $duration,
-       total_duration => $total_duration);
+       total_duration => $total_duration,
+       nparts => $nparts);
 
-All parameters will be present on every call.
+All parameters will be present on every call, although the order is not
+guaranteed.
 
 The C<result> is one of C<"FAILED">, C<"PARTIAL">, or C<"DONE">.  Even when
 C<dump_cb> reports a fatal error, C<result> may be C<"PARTIAL"> if some data
 was written successfully.
 
-The final parameters, C<size> (in bytes), C<duration>, and C<total_duration>
-(in seconds) describe the total transfer, and are a sum of all of the parts
-written to the device.  Note that C<duration> does not include time spent
+The C<device_error> key points to a list of errors, each given as a string,
+that describe what went wrong to cause the dump to fail.  The
+C<config_denial_message> parrots the reason provided by C<$perm_cb> (see below)
+for denying use of a new tape if the cause was 'config', and is C<undef>
+otherwise.
+
+The final parameters, C<size> (in bytes), C<duration>, C<total_duration> (in
+seconds), and C<nparts> describe the total transfer, and are a sum of all of
+the parts written to the device.  Note that C<nparts> does not include any
+empty trailing parts.  Note that C<duration> does not include time spent
 operating the changer, while C<total_duration> reflects the time from the
 C<start_dump> call to the invocation of the C<dump_cb>.
 
-TODO: cancel_dump
+=head3 Cancelling a Dump
+
+After you have requested a transfer destination, the scribe is poised to begin the
+transfer.  If you cannot actually perform the transfer for some reason, you'll need
+to go through the motions all the same, but cancel the operation immediately.  That
+can be done by calling C<cancel_dump>:
+
+  $scribe->cancel_dump(
+       xfer => $xfer,
+       dump_cb => $dump_cb);
 
 =head2 QUIT
 
@@ -270,6 +320,10 @@ is updated at least as each part is finished; for some modes of operation, it
 is updated continuously.  Notably, DirectTCP transfers do not update
 continuously.
 
+=head2 START_SCAN
+
+The C<start_scan> method initiate a scan of the changer to find a usable tape.
+
 =head1 FEEDBACK
 
 The C<Amanda::Taper::Scribe::Feedback> class is intended to be
@@ -283,18 +337,29 @@ to limit the number of volumes the Scribe consumes.  It is called as
 
   $fb->request_volume_permission(perm_cb => $cb);
 
-where the C<perm_cb> is a callback which expects a single argument:
-C<undef> if permission is granted, or reason (as a string) if permission
-is denied.  The default implementation always calls C<< perm_cb->(undef) >>.
+The C<perm_cb> is a callback which expects a hash as arguments. If C<allow>
+is set, then the scribe is allowed to use a new volume, if C<scribe> is set,
+then the xfer must be transfered to that scribe, otherwise a C<cause>
+and a C<message> describing why a new volume should not be used. must be
+set. e.g.
+
+  perm_cb->(allow => 1);
+  perm_cb->(scribe => $new_scribe);
+  perm_cb->(cause => 'config', message => $message);
+  perm_cb->(cause => 'error', message => $message);
+
+A cause of 'config' indicates that the denial is due to the user's
+configuration, and thus should not be presented as an error.  The default
+implementation always calls C<< perm_cb->() >>.
 
 All of the remaining methods are notifications, and do not take a
 callback.
 
-  $fb->notif_new_tape(
+  $fb->scribe_notif_new_tape(
         error => $error,
         volume_label => $volume_label);
 
-The Scribe calls C<notif_new_tape> when a new volume is started.  If the
+The Scribe calls C<scribe_notif_new_tape> when a new volume is started.  If the
 C<volume_label> is undefined, then the volume was not successfully
 relabled, and its previous contents may still be available.  If C<error>
 is defined, then no useful data was written to the volume.  Note that
@@ -303,25 +368,35 @@ contents of the volume were erased, but no useful, new data was written
 to the volume.
 
 This method will be called exactly once for every call to
-C<request_volume_permission> that calls C<< perm_cb->(undef) >>.
+C<request_volume_permission> that calls back with C<< perm_cb->() >>.
+
+  $fb->scribe_notif_tape_done(
+       volume_label => $volume_label,
+       size => $size,
+       num_files => $num_files);
 
-  $fb->notif_part_done(
+The C<scribe_notif_tape_done> method is called after a volume is completely
+written and its reservation has been released.  Note that the scribe waits
+until the last possible moment to release a reservation, so this may be called
+later than expected, e.g., during a C<quit> invocation.
+
+  $fb->scribe_notif_part_done(
         partnum => $partnum,
         fileno => $fileno,
         successful => $successful,
         size => $size,
         duration => $duration);
 
-The Scribe calls C<notif_part_done> for each part written to the volume,
+The Scribe calls C<scribe_notif_part_done> for each part written to the volume,
 including partial parts.  If the part was not written successfully, then
 C<successful> is false.  The C<size> is in bytes, and the C<duration> is
 a floating-point number of seconds.  If a part fails before a new device
 file is created, then C<fileno> may be zero.
 
 Finally, the Scribe sends a few historically significant trace log messages
-via C<notif_log_info>:
+via C<scribe_notif_log_info>:
 
-  $fb->notif_log_info(
+  $fb->scribe_notif_log_info(
        message => $message);
 
 A typical Feedback subclass might begin like this:
@@ -333,24 +408,43 @@ A typical Feedback subclass might begin like this:
     my $self = shift;
     my %params = @_;
 
-    $params{'perm_cb'}->("NO VOLUMES FOR YOU!");
+    $params{'perm_cb'}->(cause => "error", message => "NO VOLUMES FOR YOU!");
   }
 
 =cut
 
+package Amanda::Taper::Scribe;
+
+use strict;
+use warnings;
+use Carp;
+
+use Amanda::Xfer qw( :constants );
+use Amanda::Device qw( :constants );
+use Amanda::Header;
+use Amanda::Debug qw( :logging );
+use Amanda::MainLoop;
+use Amanda::Tapelist;
+use Amanda::Config qw( :getconf config_dir_relative );
+use base qw( Exporter );
+
+our @EXPORT_OK = qw( get_splitting_args_from_config );
+
 sub new {
     my $class = shift;
     my %params = @_;
 
+    my $decide_debug = $Amanda::Config::debug_taper || $params{'debug'};
     for my $rq_param qw(taperscan feedback) {
        croak "required parameter '$rq_param' mising"
            unless exists $params{$rq_param};
     }
 
     my $self = {
+       taperscan => $params{'taperscan'},
        feedback => $params{'feedback'},
-       debug => $params{'debug'},
-       dump_timestamp => undef,
+       debug => $decide_debug,
+       write_timestamp => undef,
        started => 0,
 
        # device handling, and our current device and reservation
@@ -368,7 +462,7 @@ sub new {
 
        # information for the current dumpfile
        dump_header => undef,
-       split_method => undef,
+       retry_part_on_peom => undef,
        xfer => undef,
        xdt => undef,
        xdt_ready => undef,
@@ -379,6 +473,7 @@ sub new {
        last_part_successful => 0,
        started_writing => 0,
        device_errors => [],
+       config_denial_message => undef,
     };
 
     return bless ($self, $class);
@@ -388,7 +483,7 @@ sub start {
     my $self = shift;
     my %params = @_;
 
-    for my $rq_param qw(dump_timestamp finished_cb) {
+    for my $rq_param qw(write_timestamp finished_cb) {
        croak "required parameter '$rq_param' missing"
            unless exists $params{$rq_param};
     }
@@ -396,7 +491,7 @@ sub start {
     die "scribe already started" if $self->{'started'};
 
     $self->dbg("starting");
-    $self->{'dump_timestamp'} = $params{'dump_timestamp'};
+    $self->{'write_timestamp'} = $params{'write_timestamp'};
 
     # start up the DevHandling object, making sure we know
     # when it's done with its startup process
@@ -410,96 +505,115 @@ sub quit {
     my $self = shift;
     my %params = @_;
 
-    for my $rq_param qw(finished_cb) {
-       croak "required parameter '$rq_param' mising"
-           unless exists $params{$rq_param};
-    }
-
-    $self->_log_volume_done();
-
     # since there's little other option than to barrel on through the
     # quitting procedure, quit() just accumulates its error messages
     # and, if necessary, concantenates them for the finished_cb.
     my @errors;
 
-    if ($self->{'xfer'}) {
-       die "Scribe cannot quit while a transfer is active";
-        # Supporting this would be complicated:
-        # - cancel the xfer and wait for it to complete
-        # - ensure that the taperscan not be started afterward
-        # and isn't required for normal Amanda operation.
-    }
-
-    $self->dbg("quitting");
+    my $steps = define_steps
+       cb_ref => \$params{'finished_cb'};
 
-    my $cleanup_cb = make_cb(cleanup_cb => sub {
-       my ($error) = @_;
-       push @errors, $error if $error;
+    step setup => sub {
+       $self->dbg("quitting");
 
-        if (@errors == 1) {
-            $error = $errors[0];
-        } elsif (@errors > 1) {
-            $error = join("; ", @errors);
-        }
+       if ($self->{'xfer'}) {
+           die "Scribe cannot quit while a transfer is active";
+           # Supporting this would be complicated:
+           # - cancel the xfer and wait for it to complete
+           # - ensure that the taperscan not be started afterward
+           # and isn't required for normal Amanda operation.
+       }
 
-        $params{'finished_cb'}->($error);
-    });
+       $steps->{'release'}->();
+    };
 
-    if ($self->{'reservation'}) {
-       if ($self->{'device'}) {
-           if (!$self->{'device'}->finish()) {
-               push @errors, $self->{'device'}->error_or_status();
-           }
+    step release => sub {
+       if ($self->{'reservation'}) {
+           $self->_release_reservation(finished_cb => $steps->{'released'});
+       } else {
+           $steps->{'stop_devhandling'}->();
        }
+    };
 
-       $self->{'reservation'}->release(finished_cb => $cleanup_cb);
-    } else {
-       $cleanup_cb->(undef);
-    }
+    step released => sub {
+       my ($err) = @_;
+       push @errors, "$err" if $err;
+
+       $self->{'reservation'} = undef;
+
+       $steps->{'stop_devhandling'}->();
+    };
+
+    step stop_devhandling => sub {
+       $self->{'devhandling'}->quit(finished_cb => $steps->{'stopped_devhandling'});
+    };
+
+    step stopped_devhandling => sub {
+       my ($err) = @_;
+       push @errors, "$err" if $err;
+
+       my $errmsg = join("; ", @errors) if @errors >= 1;
+       $params{'finished_cb'}->($errmsg);
+    };
 }
 
-# Get a transfer destination; does not use a callback
-sub get_xfer_dest {
+sub get_device {
     my $self = shift;
-    my %params = @_;
 
-    for my $rq_param qw(max_memory split_method) {
-       croak "required parameter '$rq_param' missing"
-           unless exists $params{$rq_param};
+    # Can return a device we already have, or "peek" at the
+    # DevHandling object's device.
+    # It might not have right permission on the device.
+
+    my $device;
+    if (defined $self->{'device'}) {
+       $device = $self->{'device'};
+    } else {
+       $device = $self->{'devhandling'}->peek_device();
     }
+    return $device;
+}
 
-    die "Scribe is not started yet" unless $self->{'started'};
+sub check_data_path {
+    my $self = shift;
+    my $data_path = shift;
 
-    $self->dbg("get_xfer_dest(split_method=$params{split_method})");
+    my $device = $self->get_device();
 
-    if ($params{'split_method'} ne 'none') {
-        croak("required parameter 'part_size' missing")
-            unless exists $params{'part_size'};
+    if (!defined $device) {
+       die "no device is available to check the datapath";
     }
 
-    $self->{'split_method'} = $params{'split_method'};
-    my ($part_size, $use_mem_cache, $disk_cache_dirname) = (0, 0, undef);
-    if ($params{'split_method'} eq 'none') {
-        $part_size = 0;
-    } elsif ($params{'split_method'} eq 'memory') {
-        $part_size = $params{'part_size'};
-        $use_mem_cache = 1;
-    } elsif ($params{'split_method'} eq 'disk') {
-        $part_size = $params{'part_size'};
-        croak("required parameter 'disk_cache_dirname' missing")
-            unless exists $params{'disk_cache_dirname'};
-        $disk_cache_dirname = $params{'disk_cache_dirname'};
-    } elsif ($params{'split_method'} eq 'cache_inform') {
-        $part_size = $params{'part_size'};
-        $use_mem_cache = 0;
-    } else {
-        croak("invalid split_method $params{split_method}");
+    my $use_directtcp = $device->directtcp_supported();
+
+    my $xdt;
+    if (!$use_directtcp) {
+       if ($data_path eq 'DIRECTTCP') {
+           return "Can't dump DIRECTTCP data-path dle to a device ('" .
+                  $device->device_name .
+                  "') that doesn't support it";
+       }
     }
+    return undef;
+}
 
-    debug("Amanda::Taper::Scribe setting up a transfer with split method $params{split_method}");
+sub start_scan {
+    my $self = shift;
+
+    $self->{'devhandling'}->start_scan();
+}
+
+# Get a transfer destination; does not use a callback
+sub get_xfer_dest {
+    my $self = shift;
+    my %params = @_;
+
+    for my $rq_param qw(max_memory) {
+       croak "required parameter '$rq_param' missing"
+           unless exists $params{$rq_param};
+    }
 
     die "not yet started"
-       unless ($self->{'dump_timestamp'});
+       unless $self->{'write_timestamp'} and $self->{'started'};
     die "xfer element already returned"
        if ($self->{'xdt'});
     die "xfer already running"
@@ -509,45 +623,91 @@ sub get_xfer_dest {
     $self->{'xdt'} = undef;
     $self->{'size'} = 0;
     $self->{'duration'} = 0.0;
+    $self->{'nparts'} = undef;
     $self->{'dump_start_time'} = undef;
     $self->{'last_part_successful'} = 1;
     $self->{'started_writing'} = 0;
     $self->{'device_errors'} = [];
+    $self->{'config_denial_message'} = undef;
 
     # set the callback
     $self->{'dump_cb'} = undef;
+    $self->{'retry_part_on_peom'} = 1;
+    $self->{'start_part_on_xdt_ready'} = 0;
 
-    # to build an xfer destination, we need a device, although we don't necessarily
-    # need permission to write to it yet.  So we can either use a device we already
-    # have, or we "peek" at the DevHandling object's device.
-    my $xdt_first_dev;
-    if (defined $self->{'device'}) {
-       $xdt_first_dev = $self->{'device'};
-    } else {
-       $xdt_first_dev = $self->{'devhandling'}->peek_device();
-    }
+    # start getting parameters together to determine what kind of splitting
+    # and caching we're going to do
+    my $part_size = $params{'part_size'} || 0;
+    my ($use_mem_cache, $disk_cache_dirname) = (0, undef);
+    my $can_cache_inform = $params{'can_cache_inform'};
+    my $part_cache_type = $params{'part_cache_type'} || 'none';
 
+    my $xdt_first_dev = $self->get_device();
     if (!defined $xdt_first_dev) {
        die "no device is available to create an xfer_dest";
     }
+    my $leom_supported = $xdt_first_dev->property_get("leom");
+    my $use_directtcp = $xdt_first_dev->directtcp_supported();
+
+    # figure out the destination type we'll use, based on the circumstances
+    my ($dest_type, $dest_text);
+    if ($use_directtcp) {
+       $dest_type = 'directtcp';
+       $dest_text = "using DirectTCP";
+    } elsif ($can_cache_inform && $leom_supported) {
+       $dest_type = 'splitter';
+       $dest_text = "using LEOM (falling back to holding disk as cache)";
+    } elsif ($leom_supported) {
+       $dest_type = 'splitter';
+       $dest_text = "using LEOM detection (no caching)";
+    } elsif ($can_cache_inform) {
+       $dest_type = 'splitter';
+       $dest_text = "using cache_inform";
+    } elsif ($part_cache_type ne 'none') {
+       $dest_type = 'cacher';
+
+       # we'll be caching, so apply the maximum size
+       my $part_cache_max_size = $params{'part_cache_max_size'} || 0;
+       $part_size = $part_cache_max_size
+           if ($part_cache_max_size and $part_cache_max_size < $part_size);
+
+       # and figure out what kind of caching to apply
+       if ($part_cache_type eq 'memory') {
+           $use_mem_cache = 1;
+       } else {
+           # note that we assume this has already been checked; if it's wrong,
+           # the xfer element will just fail immediately
+           $disk_cache_dirname = $params{'part_cache_dir'};
+       }
+       $dest_text = "using cache type '$part_cache_type'";
+    } else {
+       $dest_type = 'splitter';
+       $dest_text = "using no cache (PEOM will be fatal)";
+
+       # no directtcp, no caching, no cache_inform, and no LEOM, so a PEOM will be fatal
+       $self->{'retry_part_on_peom'} = 0;
+    }
+
+    debug("Amanda::Taper::Scribe preparing to write, part size $part_size, "
+       . "$dest_text ($dest_type) "
+       . ($leom_supported? " (LEOM supported)" : " (no LEOM)"));
 
     # set the device to verbose logging if we're in debug mode
     if ($self->{'debug'}) {
        $xdt_first_dev->property_set("verbose", 1);
     }
 
-    my $use_directtcp = $xdt_first_dev->directtcp_supported();
-
     my $xdt;
-    if ($use_directtcp) {
-       # note: using the current configuration scheme, the user must specify either
-       # a disk cache or a fallback_splitsize in order to split a directtcp dump; the
-       # fix is to use a better set of config params for splitting
+    if ($dest_type eq 'directtcp') {
        $xdt = Amanda::Xfer::Dest::Taper::DirectTCP->new(
            $xdt_first_dev, $part_size);
        $self->{'xdt_ready'} = 0; # xdt isn't ready until we get XMSG_READY
-    } else {
+    } elsif ($dest_type eq 'splitter') {
        $xdt = Amanda::Xfer::Dest::Taper::Splitter->new(
+           $xdt_first_dev, $params{'max_memory'}, $part_size, $can_cache_inform);
+       $self->{'xdt_ready'} = 1; # xdt is ready immediately
+    } else {
+       $xdt = Amanda::Xfer::Dest::Taper::Cacher->new(
            $xdt_first_dev, $params{'max_memory'}, $part_size,
            $use_mem_cache, $disk_cache_dirname);
        $self->{'xdt_ready'} = 1; # xdt is ready immediately
@@ -589,16 +749,20 @@ sub cancel_dump {
     $self->{'dump_cb'} = $params{'dump_cb'};
     $self->{'xfer'} = $params{'xfer'};
 
-    # The cancel should call dump_cb, but the xfer stay hanged in accept.
-    # That's why dump_cb is called and xdt and xfer are set to undef.
+    # XXX The cancel should call dump_cb, but right now the xfer stays hung in
+    # accept.  So we leave the xfer to its hang, and dump_cb is called and xdt
+    # and xfer are set to undef.  This should be fixed in 3.2.
+
     $self->{'xfer'}->cancel();
 
     $self->{'dump_cb'}->(
        result => "FAILED",
        device_errors => [],
+       config_denial_message => undef,
        size => 0,
        duration => 0.0,
-       total_duration => 0);
+       total_duration => 0,
+       nparts => 0);
     $self->{'xdt'} = undef;
     $self->{'xfer'} = undef;
 }
@@ -639,8 +803,8 @@ sub _start_part {
     # up to higher-level components to re-try this dump on a new volume, if desired.
     # Note that this should be caught in the XMSG_PART_DONE handler -- this is just
     # here for backup.
-    if (!$self->{'last_part_successful'} and $self->{'split_method'} eq 'none') {
-       $self->_operation_failed("No space left on device (uncaught)");
+    if (!$self->{'last_part_successful'} and !$self->{'retry_part_on_peom'}) {
+       $self->_operation_failed(device_error => "No space left on device (uncaught)");
        return;
     }
 
@@ -678,9 +842,9 @@ sub _xmsg_part_done {
     my $self = shift;
     my ($src, $msg, $xfer) = @_;
 
-       # this handles successful zero-byte parts as a special case - they
-       # are an implementation detail of the splitting done by the transfer
-       # destination.
+    # this handles successful zero-byte parts as a special case - they
+    # are an implementation detail of the splitting done by the transfer
+    # destination.
 
     if ($msg->{'successful'} and $msg->{'size'} == 0) {
        $self->dbg("not notifying for empty, successful part");
@@ -690,12 +854,15 @@ sub _xmsg_part_done {
            unless ($self->{'dump_header'}->{'partnum'} == $msg->{'partnum'});
 
        # notify
-       $self->{'feedback'}->notif_part_done(
+       $self->{'feedback'}->scribe_notif_part_done(
            partnum => $msg->{'partnum'},
            fileno => $msg->{'fileno'},
            successful => $msg->{'successful'},
            size => $msg->{'size'},
            duration => $msg->{'duration'});
+
+       # increment nparts here, so empty parts are not counted
+       $self->{'nparts'} = $msg->{'partnum'};
     }
 
     $self->{'last_part_successful'} = $msg->{'successful'};
@@ -725,7 +892,7 @@ sub _xmsg_part_done {
            # if the part failed..
            if (!$msg->{'successful'}) {
                # if no caching was going on, then the dump has failed
-               if ($self->{'split_method'} eq 'none') {
+               if (!$self->{'retry_part_on_peom'}) {
                    # mark this device as at EOM, since we are not going to look
                    # for another one yet
                    $self->{'device_at_eom'} = 1;
@@ -734,12 +901,12 @@ sub _xmsg_part_done {
                    if ($self->{'device'}->status() != $DEVICE_STATUS_SUCCESS) {
                        $msg = $self->{'device'}->error_or_status();
                    }
-                   $self->_operation_failed($msg);
+                   $self->_operation_failed(device_error => $msg);
                    return;
                }
 
                # log a message for amreport
-               $self->{'feedback'}->notif_log_info(
+               $self->{'feedback'}->scribe_notif_log_info(
                    message => "Will request retry of failed split part.");
            }
 
@@ -753,7 +920,7 @@ sub _xmsg_part_done {
                if ($self->{'device'}->status() != $DEVICE_STATUS_SUCCESS) {
                    $msg = $self->{'device'}->error_or_status();
                }
-               $self->_operation_failed($msg);
+               $self->_operation_failed(device_error => $msg);
                return;
            }
 
@@ -780,7 +947,7 @@ sub _xmsg_error {
     my ($src, $msg, $xfer) = @_;
 
     # XMSG_ERROR from the XDT is always fatal
-    $self->_operation_failed($msg->{'message'});
+    $self->_operation_failed(device_error => $msg->{'message'});
 }
 
 sub _xmsg_done {
@@ -800,7 +967,7 @@ sub _dump_done {
 
     # determine the correct final status - DONE if we're done, PARTIAL
     # if we've started writing to the volume, otherwise FAILED
-    if (@{$self->{'device_errors'}}) {
+    if (@{$self->{'device_errors'}} or $self->{'config_denial_message'}) {
        $result = $self->{'started_writing'}? 'PARTIAL' : 'FAILED';
     } else {
        $result = 'DONE';
@@ -810,9 +977,11 @@ sub _dump_done {
     my %dump_cb_args = (
        result => $result,
        device_errors => $self->{'device_errors'},
+       config_denial_message => $self->{'config_denial_message'},
        size => $self->{'size'},
        duration => $self->{'duration'},
-       total_duration => time - $self->{'dump_start_time'});
+       total_duration => time - $self->{'dump_start_time'},
+       nparts => $self->{'nparts'});
 
     # reset everything and let the original caller know we're done
     $self->{'xfer'} = undef;
@@ -821,51 +990,97 @@ sub _dump_done {
     $self->{'dump_cb'} = undef;
     $self->{'size'} = 0;
     $self->{'duration'} = 0.0;
+    $self->{'nparts'} = undef;
     $self->{'dump_start_time'} = undef;
     $self->{'device_errors'} = [];
+    $self->{'config_denial_message'} = undef;
 
     # and call the callback
     $dump_cb->(%dump_cb_args);
 }
 
+# keyword parameters are utilities to the caller: either specify
+# device_error to add to the device_errors list or config_denial_message
+# to set the corresponding key in $self.
 sub _operation_failed {
     my $self = shift;
-    my ($error) = @_;
+    my %params = @_;
 
-    $self->dbg("operation failed: $error");
+    my $error_message = $params{'device_error'}
+                    || $params{'config_denial_message'}
+                    || 'no reason';
+    $self->dbg("operation failed: $error_message");
 
-    push @{$self->{'device_errors'}}, $error;
+    # tuck the message away as desired
+    push @{$self->{'device_errors'}}, $params{'device_error'}
+       if defined $params{'device_error'};
+    $self->{'config_denial_message'} = $params{'config_denial_message'} 
+       if $params{'config_denial_message'};
 
     # cancelling the xdt will eventually cause an XMSG_DONE, which will notice
     # the error and set the result correctly; but if there's no xfer, then we
     # can just call _dump_done directly.
     if (defined $self->{'xfer'}) {
-        $self->dbg("cancelling the transfer: $error");
+        $self->dbg("cancelling the transfer: $error_message");
 
        $self->{'xfer'}->cancel();
     } else {
         if (defined $self->{'dump_cb'}) {
-            # _dump_done uses device_errors, set above
+            # _dump_done constructs the dump_cb from $self parameters
             $self->_dump_done();
         } else {
-            die "error with no callback to handle it: $error";
+            die "error with no callback to handle it: $error_message";
         }
     }
 }
 
-sub _log_volume_done {
+# release the outstanding reservation, calling scribe_notif_tape_done
+# after the release
+sub _release_reservation {
     my $self = shift;
+    my %params = @_;
+    my @errors;
+
+    my ($label, $fm, $kb);
 
     # if we've already written a volume, log it
     if ($self->{'device'} and defined $self->{'device'}->volume_label) {
-       my $label = $self->{'device'}->volume_label();
-       my $fm = $self->{'device'}->file();
-       my $kb = $self->{'device_size'} / 1024;
+       $label = $self->{'device'}->volume_label();
+       $fm = $self->{'device'}->file();
+       $kb = $self->{'device_size'} / 1024;
 
        # log a message for amreport
-       $self->{'feedback'}->notif_log_info(
+       $self->{'feedback'}->scribe_notif_log_info(
            message => "tape $label kb $kb fm $fm [OK]");
     }
+
+    # finish the device if it isn't finished yet
+    if ($self->{'device'}) {
+       my $already_in_error = $self->{'device'}->status() != $DEVICE_STATUS_SUCCESS;
+
+       if (!$self->{'device'}->finish() && !$already_in_error) {
+           push @errors, $self->{'device'}->error_or_status();
+       }
+    }
+    $self->{'device'} = undef;
+    $self->{'device_at_eom'} = 0;
+
+    $self->{'reservation'}->release(finished_cb => sub {
+       my ($err) = @_;
+       push @errors, "$err" if $err;
+
+       $self->{'reservation'} = undef;
+
+       # notify the feedback that we've finished and released a tape
+       if ($label) {
+           $self->{'feedback'}->scribe_notif_tape_done(
+               volume_label => $label,
+               size => $kb * 1024,
+               num_files => $fm);
+       }
+
+       $params{'finished_cb'}->(@errors? join("; ", @errors) : undef);
+    });
 }
 
 # invoke the devhandling to get a new device, with all of the requisite
@@ -874,22 +1089,13 @@ sub _log_volume_done {
 sub _get_new_volume {
     my $self = shift;
 
-    $self->_log_volume_done();
-    $self->{'device'} = undef;
-    $self->{'device_at_eom'} = 0;
-
     # release first, if necessary
     if ($self->{'reservation'}) {
-       my $res = $self->{'reservation'};
-
-       $self->{'reservation'} = undef;
-       $self->{'device'} = undef;
-
-       $res->release(finished_cb => sub {
+       $self->_release_reservation(finished_cb => sub {
            my ($error) = @_;
 
            if ($error) {
-               $self->_operation_failed($error);
+               $self->_operation_failed(device_error => $error);
            } else {
                $self->_get_new_volume();
            }
@@ -903,32 +1109,73 @@ sub _get_new_volume {
 
 sub _volume_cb  {
     my $self = shift;
-    my ($scan_error, $request_denied_reason, $reservation,
-       $new_label, $access_mode, $is_new) = @_;
+    my ($scan_error, $config_denial_message, $error_denial_message,
+       $reservation, $new_label, $access_mode, $is_new, $new_scribe) = @_;
 
-    # note that we prefer the request_denied_reason over the scan error.  If
+    # note that we prefer the config_denial_message over the scan error.  If
     # both occurred, then the results of the scan are immaterial -- we
     # shouldn't have been looking for a new volume anyway.
 
-    if ($request_denied_reason) {
-       $self->_operation_failed($request_denied_reason);
+    if ($config_denial_message) {
+       $self->_operation_failed(config_denial_message => $config_denial_message);
+       return;
+    }
+
+    if ($error_denial_message) {
+       $self->_operation_failed(device_error => $error_denial_message);
+       return;
+    }
+
+    if ($new_scribe) {
+       # Transfer the xfer to the new scribe
+       $self->dbg("take scribe from");
+
+       $new_scribe->{'dump_cb'} = $self->{'dump_cb'};
+       $new_scribe->{'dump_header'} = $self->{'dump_header'};
+       $new_scribe->{'retry_part_on_peom'} = $self->{'retry_part_on_peom'};
+       $new_scribe->{'split_method'} = $self->{'split_method'};
+       $new_scribe->{'xfer'} = $self->{'xfer'};
+       $new_scribe->{'xdt'} = $self->{'xdt'};
+       $new_scribe->{'xdt_ready'} = $self->{'xdt_ready'};
+       $new_scribe->{'start_part_on_xdt_ready'} = $self->{'start_part_on_xdt_ready'};
+       $new_scribe->{'size'} = $self->{'size'};
+       $new_scribe->{'duration'} = $self->{'duration'};
+       $new_scribe->{'dump_start_time'} = $self->{'dump_start_time'};
+       $new_scribe->{'last_part_successful'} = $self->{'last_part_successful'};
+       $new_scribe->{'started_writing'} = $self->{'started_writing'};
+       $new_scribe->{'feedback'} = $self->{'feedback'};
+       $new_scribe->{'devhandling'}->{'feedback'} = $self->{'feedback'};
+       $self->{'dump_header'} = undef;
+       $self->{'dump_cb'} = undef;
+       $self->{'xfer'} = undef;
+       $self->{'xdt'} = undef;
+       $self->{'xdt_ready'} = undef;
+       $self->{'dump_start_time'} = undef;
+       $self->{'started_writing'} = 0;
+       $self->{'feedback'} = undef;
+       if (defined $new_scribe->{'device'}) {
+           $new_scribe->{'xdt'}->use_device($new_scribe->{'device'});
+       }
+       # start it
+       $new_scribe->_start_part();
+
        return;
     }
 
     if ($scan_error) {
        # we had permission to use a tape, but didn't find a tape, so we need
        # to notify of such
-       $self->{'feedback'}->notif_new_tape(
+       $self->{'feedback'}->scribe_notif_new_tape(
            error => $scan_error,
            volume_label => undef);
 
-       $self->_operation_failed($scan_error);
+       $self->_operation_failed(device_error => $scan_error);
        return;
     }
 
     $self->dbg("got new volume; writing new label");
 
-    # from here on, if an error occurs, we must send notif_new_tape, and look
+    # from here on, if an error occurs, we must send scribe_notif_new_tape, and look
     # for a new volume
     $self->{'reservation'} = $reservation;
     $self->{'device_size'} = 0;
@@ -945,7 +1192,7 @@ sub _volume_cb  {
     if (!$is_new) {
        if (($device->status & ~$DEVICE_STATUS_VOLUME_UNLABELED)
            && !($device->status & $DEVICE_STATUS_VOLUME_UNLABELED)) {
-           $self->{'feedback'}->notif_new_tape(
+           $self->{'feedback'}->scribe_notif_new_tape(
                error => "while reading label on new volume: " . $device->error_or_status(),
                volume_label => undef);
 
@@ -958,7 +1205,8 @@ sub _volume_cb  {
     # inform the xdt about this new device before starting it
     $self->{'xdt'}->use_device($device);
 
-    if (!$device->start($access_mode, $new_label, $self->{'dump_timestamp'})) {
+    my $result = $self->_device_start($device, $access_mode, $new_label, $is_new);
+    if ($result == 0) {
        # try reading the label to see whether we erased the tape
        my $erased = 0;
        CHECK_READ_LABEL: {
@@ -995,15 +1243,22 @@ sub _volume_cb  {
            }
        }
 
-       $self->{'feedback'}->notif_new_tape(
+       $self->{'feedback'}->scribe_notif_new_tape(
            error => "while labeling new volume: " . $device->error_or_status(),
            volume_label => $erased? $new_label : undef);
 
        return $self->_get_new_volume();
+    } elsif ($result != 1) {
+       $self->{'feedback'}->scribe_notif_new_tape(
+           error => $result,
+           volume_label => undef);
+       return $self->_get_new_volume();
     }
 
+    $new_label = $device->volume_label;
+
     # success!
-    $self->{'feedback'}->notif_new_tape(
+    $self->{'feedback'}->scribe_notif_new_tape(
        error => undef,
        volume_label => $new_label);
 
@@ -1011,7 +1266,7 @@ sub _volume_cb  {
     my $label_set_cb = make_cb(label_set_cb => sub {
        my ($err) = @_;
        if ($err) {
-           $self->{'feedback'}->notif_log_info(
+           $self->{'feedback'}->scribe_notif_log_info(
                message => "Error from set_label: $err");
            # fall through to start_part anyway...
        }
@@ -1021,6 +1276,59 @@ sub _volume_cb  {
        finished_cb => $label_set_cb);
 }
 
+# return 0 for device->start error
+# return 1 for success
+# return a message for others error
+sub _device_start {
+    my $self = shift;
+    my ($device, $access_mode, $new_label, $is_new) = @_;
+
+    my $tl = $self->{'taperscan'}->{'tapelist'};
+
+    if (!defined $tl) { # For Mock::Taperscan in installcheck
+       if (!$device->start($access_mode, $new_label, $self->{'write_timestamp'})) {
+           return 0;
+       } else {
+           return 1;
+       }
+    }
+
+    if ($is_new) {
+       # generate the new label and write it to the tapelist file
+       $tl->reload(1);
+       ($new_label, my $err) = $self->{'taperscan'}->make_new_tape_label();
+       if (!defined $new_label) {
+           $tl->unlock();
+           return $err;
+       } else {
+           $tl->add_tapelabel('0', $new_label, undef, 0);
+           $tl->write();
+       }
+       $self->dbg("generate new label '$new_label'");
+    }
+
+    # write the label to the device
+    if (!$device->start($access_mode, $new_label, $self->{'write_timestamp'})) {
+       if ($is_new) {
+           # remove the generated label from the tapelist file
+           $tl->reload(1);
+           $tl->remove_tapelabel($new_label);
+           $tl->write();
+        }
+       return 0;
+    }
+
+    # rewrite the tapelist file
+    $tl->reload(1);
+    my $tle = $tl->lookup_tapelabel($new_label);
+    $tl->remove_tapelabel($new_label);
+    $tl->add_tapelabel($self->{'write_timestamp'}, $new_label,
+                      $tle? $tle->{'comment'} : undef, 1);
+    $tl->write();
+
+    return 1;
+}
+
 sub dbg {
     my ($self, $msg) = @_;
     if ($self->{'debug'}) {
@@ -1028,32 +1336,148 @@ sub dbg {
     }
 }
 
+sub get_splitting_args_from_config {
+    my %params = @_;
+
+    use Data::Dumper;
+    my %splitting_args;
+
+    # if dle_splitting is false, then we don't split - easy.
+    if (defined $params{'dle_allow_split'} and !$params{'dle_allow_split'}) {
+       return ();
+    }
+
+    # utility for below
+    my $have_space = sub {
+       my ($dirname, $part_size) = @_;
+
+       use Carp;
+       my $fsusage = Amanda::Util::get_fs_usage($dirname);
+       confess "$dirname" if (!$fsusage);
+
+       my $avail = $fsusage->{'blocks'} * $fsusage->{'bavail'};
+       if ($avail < $part_size) {
+           Amanda::Debug::debug("disk cache has $avail bytes available on $dirname, but " .
+                                "needs $part_size");
+           return 0;
+       } else {
+           return 1;
+       }
+    };
+
+    # first, handle the alternate spellings for part_size and part_cache_type
+    $params{'part_size'} = $params{'part_size_kb'} * 1024
+       if (defined $params{'part_size_kb'});
+
+    if (defined $params{'part_cache_type_enum'}) {
+       $params{'part_cache_type'} = 'none'
+           if ($params{'part_cache_type_enum'} == $PART_CACHE_TYPE_NONE);
+       $params{'part_cache_type'} = 'memory'
+           if ($params{'part_cache_type_enum'} == $PART_CACHE_TYPE_MEMORY);
+       $params{'part_cache_type'} = 'disk'
+           if ($params{'part_cache_type_enum'} == $PART_CACHE_TYPE_DISK);
+
+       $params{'part_cache_type'} = 'unknown'
+           unless defined $params{'part_cache_type'};
+    }
+
+    # if any of the dle_* parameters are set, use those to set the part_*
+    # parameters, which are emptied out first.
+    if (defined $params{'dle_tape_splitsize'} or
+       defined $params{'dle_split_diskbuffer'} or
+       defined $params{'dle_fallback_splitsize'}) {
+
+       $params{'part_size'} = $params{'dle_tape_splitsize'} || 0;
+       $params{'part_cache_type'} = 'none';
+       $params{'part_cache_dir'} = undef;
+       $params{'part_cache_max_size'} = undef;
+
+       # part cache type is memory unless we have a split_diskbuffer that fits the bill
+       if ($params{'part_size'}) {
+           $params{'part_cache_type'} = 'memory';
+           if (defined $params{'dle_split_diskbuffer'}
+                   and -d $params{'dle_split_diskbuffer'}) {
+               if ($have_space->($params{'dle_split_diskbuffer'}, $params{'part_size'})) {
+                   # disk cache checks out, so use it
+                   $params{'part_cache_type'} = 'disk';
+                   $params{'part_cache_dir'} = $params{'dle_split_diskbuffer'};
+               } else {
+                   my $msg = "falling back to memory buffer for splitting: " .
+                               "insufficient space in disk cache directory";
+                   $splitting_args{'warning'} = $msg;
+               }
+           }
+       }
+
+       if ($params{'part_cache_type'} eq 'memory') {
+           # fall back to 10M if fallback size is not given
+           $params{'part_cache_max_size'} = $params{'dle_fallback_splitsize'} || 10*1024*1024;
+       }
+    } else {
+       my $ps = $params{'part_size'};
+       my $pcms = $params{'part_cache_max_size'};
+       $ps = $pcms if (!defined $ps or (defined $pcms and $pcms < $ps));
+
+       # fail back from 'disk' to 'none' if the disk isn't set up correctly
+       if (defined $params{'part_cache_type'} and
+                   $params{'part_cache_type'} eq 'disk') {
+           my $warning;
+           if (!$params{'part_cache_dir'}) {
+               $warning = "no part-cache-dir specified; "
+                           . "using part cache type 'none'";
+           } elsif (!-d $params{'part_cache_dir'}) {
+               $warning = "part-cache-dir '$params{part_cache_dir} "
+                           . "does not exist; using part cache type 'none'";
+           } elsif (!$have_space->($params{'part_cache_dir'}, $ps)) {
+               $warning = "part-cache-dir '$params{part_cache_dir} "
+                           . "has insufficient space; using part cache type 'none'";
+           }
+
+           if (defined $warning) {
+               $splitting_args{'warning'} = $warning;
+               $params{'part_cache_type'} = 'none';
+               delete $params{'part_cache_dir'};
+           }
+       }
+    }
+
+    $splitting_args{'part_size'} = $params{'part_size'}
+       if defined($params{'part_size'});
+    $splitting_args{'part_cache_type'} = $params{'part_cache_type'}
+       if defined($params{'part_cache_type'});
+    $splitting_args{'part_cache_dir'} = $params{'part_cache_dir'}
+       if defined($params{'part_cache_dir'});
+    $splitting_args{'part_cache_max_size'} = $params{'part_cache_max_size'}
+       if defined($params{'part_cache_max_size'});
+
+    return %splitting_args;
+}
 ##
 ## Feedback
 ##
 
 package Amanda::Taper::Scribe::Feedback;
 
-# request permission to use a volume.
-#
-# $params{'perm_cb'} - callback taking one argument: an error message or 'undef'
 sub request_volume_permission {
     my $self = shift;
     my %params = @_;
 
     # sure, you can have as many volumes as you want!
-    $params{'perm_cb'}->(undef);
+    $params{'perm_cb'}->(allow => 1);
 }
 
-sub notif_new_tape { }
-sub notif_part_done { }
-sub notif_log_info { }
+sub scribe_notif_new_tape { }
+sub scribe_notif_tape_done { }
+sub scribe_notif_part_done { }
+sub scribe_notif_log_info { }
 
 ##
 ## Device Handling
 ##
 
 package Amanda::Taper::Scribe::DevHandling;
+use Amanda::MainLoop;
+use Carp;
 
 # This class handles scanning for volumes, requesting permission for those
 # volumes (the driver likes to feel like it's in control), and providing those
@@ -1091,7 +1515,9 @@ sub new {
        # requests for permissiont to use a new volume
        request_pending => 0,
        request_complete => 0,
-       request_denied_reason => undef,
+       request_denied => 0,
+       config_denial_message => undef,
+       error_denial_message => undef,
 
        volume_cb => undef, # callback for get_volume
        start_finished_cb => undef, # callback for start
@@ -1111,14 +1537,51 @@ sub start {
     $self->_start_scanning();
 }
 
+sub quit {
+    my $self = shift;
+    my %params = @_;
+
+    for my $rq_param qw(finished_cb) {
+       croak "required parameter '$rq_param' mising"
+           unless exists $params{$rq_param};
+    }
+
+    # since there's little other option than to barrel on through the
+    # quitting procedure, quit() just accumulates its error messages
+    # and, if necessary, concantenates them for the finished_cb.
+    my @errors;
+
+    my $cleanup_cb = make_cb(cleanup_cb => sub {
+       my ($error) = @_;
+       push @errors, $error if $error;
+
+       $error = join("; ", @errors) if @errors >= 1;
+
+       $params{'finished_cb'}->($error);
+    });
+
+    if ($self->{'reservation'}) {
+       if ($self->{'device'}) {
+           if (!$self->{'device'}->finish()) {
+               push @errors, $self->{'device'}->error_or_status();
+           }
+       }
+
+       $self->{'reservation'}->release(finished_cb => $cleanup_cb);
+    } else {
+       $cleanup_cb->(undef);
+    }
+}
+
 # Get an open, started device and label to start writing to.  The
 # volume_callback takes the following arguments:
 #   $scan_error -- error message, or undef if no error occurred
-#   $request_denied_reason -- reason volume request was denied, or undef
+#   $config_denial_reason -- config-related reason request was denied, or undef
+#   $error_denial_reason -- error-related reason request was denied, or undef
 #   $reservation -- Amanda::Changer reservation
 #   $device -- open, started device
 # It is the responsibility of the caller to close the device and release the
-# reservation when finished.  If $scan_error or $request_denied_reason are
+# reservation when finished.  If $scan_error or $request_denied_info are
 # defined, then $reservation and $device will be undef.
 sub get_volume {
     my $self = shift;
@@ -1130,7 +1593,6 @@ sub get_volume {
     $self->{'volume_cb'} = $params{'volume_cb'};
 
     # kick off the relevant processes, if they're not already running
-    $self->_start_scanning();
     $self->_start_request();
 
     $self->_maybe_callback();
@@ -1145,6 +1607,14 @@ sub peek_device {
     return $self->{'device'};
 }
 
+sub start_scan {
+    my $self = shift;
+
+    if (!$self->{'scan_running'} && !$self->{'reservation'}) {
+       $self->_start_scanning();
+    }
+}
+
 ## private methods
 
 sub _start_scanning {
@@ -1167,12 +1637,7 @@ sub _start_scanning {
            $self->{'device'} = $reservation->{'device'};
            $self->{'volume_label'} = $volume_label;
            $self->{'access_mode'} = $access_mode;
-           $self->{'is_new'} = $access_mode;
-       }
-
-       if (!$error and $is_new) {
-           $self->{'feedback'}->notif_log_info(
-               message => "Will write new label `$volume_label' to new tape");
+           $self->{'is_new'} = $is_new;
        }
 
        $self->_maybe_callback();
@@ -1186,12 +1651,28 @@ sub _start_request {
 
     $self->{'request_pending'} = 1;
 
-    $self->{'feedback'}->request_volume_permission(perm_cb => sub {
-       my ($refusal_reason) = @_;
+    $self->{'feedback'}->request_volume_permission(
+    perm_cb => sub {
+       my %params = @_;
 
        $self->{'request_pending'} = 0;
        $self->{'request_complete'} = 1;
-       $self->{'request_denied_reason'} = $refusal_reason;
+       if (defined $params{'scribe'}) {
+           $self->{'new_scribe'} = $params{'scribe'};
+           $self->{'scan_finished'} = 1;
+           $self->{'request_complete'} = 1;
+       } elsif (defined $params{'cause'}) {
+           $self->{'request_denied'} = 1;
+           if ($params{'cause'} eq 'config') {
+               $self->{'config_denial_message'} = $params{'message'};
+           } elsif ($params{'cause'} eq 'error') {
+               $self->{'error_denial_message'} = $params{'message'};
+           } else {
+               die "bad cause '" . $params{'cause'} . "'";
+           }
+       } elsif (!defined $params{'allow'}) {
+           die "no allow or cause defined";
+       }
 
        $self->_maybe_callback();
     });
@@ -1202,7 +1683,7 @@ sub _maybe_callback {
 
     # if we have any kind of error, release the reservation and come back
     # later
-    if (($self->{'scan_error'} or $self->{'request_denied_reason'}) and $self->{'reservation'}) {
+    if (($self->{'scan_error'} or $self->{'request_denied'}) and $self->{'reservation'}) {
        $self->{'device'} = undef;
 
        $self->{'reservation'}->release(finished_cb => sub {
@@ -1233,16 +1714,18 @@ sub _maybe_callback {
     }
 
     # if the volume_cb is good to get called, call it and reset to the ground state
-    if ($self->{'volume_cb'} and $self->{'scan_finished'} and $self->{'request_complete'}) {
+    if ($self->{'volume_cb'} and (!$self->{'scan_running'} or $self->{'scan_finished'}) and $self->{'request_complete'}) {
        # get the cb and its arguments lined up before calling it..
        my $volume_cb = $self->{'volume_cb'};
        my @volume_cb_args = (
            $self->{'scan_error'},
-           $self->{'request_denied_reason'},
+           $self->{'config_denial_message'},
+           $self->{'error_denial_message'},
            $self->{'reservation'},
            $self->{'volume_label'},
            $self->{'access_mode'},
            $self->{'is_new'},
+           $self->{'new_scribe'},
        );
 
        # reset everything and prepare for a new scan
@@ -1253,7 +1736,11 @@ sub _maybe_callback {
        $self->{'volume_label'} = undef;
 
        $self->{'request_complete'} = 0;
+       $self->{'request_denied'} = 0;
+       $self->{'config_denial_message'} = undef;
+       $self->{'error_denial_message'} = undef;
        $self->{'volume_cb'} = undef;
+       $self->{'new_scribe'} = undef;
 
        $volume_cb->(@volume_cb_args);
     }
diff --git a/perl/Amanda/Taper/Worker.pm b/perl/Amanda/Taper/Worker.pm
new file mode 100644 (file)
index 0000000..9e23fd9
--- /dev/null
@@ -0,0 +1,742 @@
+#! @PERL@
+# Copyright (c) 2009, 2010 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+=head1 NAME
+
+Amanda::Taper::Worker
+
+=head1 DESCRIPTION
+
+This package is a component of the Amanda taper, and is not intended for use by
+other scripts or applications.
+
+This package interface between L<Amanda::Taper::Controller> and L<Amanda::Taper::Scribe>.
+
+The worker use an L<Amanda::Taper::Scribe> object to execute the request
+received from the L<Amanda::Taper::Controller>.
+
+=cut
+
+use lib '@amperldir@';
+use strict;
+use warnings;
+
+package Amanda::Taper::Worker;
+
+use POSIX qw( :errno_h );
+use Amanda::Changer;
+use Amanda::Config qw( :getconf config_dir_relative );
+use Amanda::Header;
+use Amanda::Holding;
+use Amanda::MainLoop qw( :GIOCondition );
+use Amanda::MainLoop;
+use Amanda::Taper::Protocol;
+use Amanda::Taper::Scan;
+use Amanda::Taper::Scribe qw( get_splitting_args_from_config );
+use Amanda::Logfile qw( :logtype_t log_add make_stats );
+use Amanda::Xfer qw( :constants );
+use Amanda::Util qw( quote_string );
+use Amanda::Tapelist;
+use File::Temp;
+
+use base qw( Amanda::Taper::Scribe::Feedback );
+
+our $tape_num = 0;
+
+sub new {
+    my $class           = shift;
+    my $worker_name     = shift;
+    my $controller      = shift;
+    my $write_timestamp = shift;
+
+    my $self = bless {
+       state       => "init",
+       worker_name => $worker_name,
+       controller  => $controller,
+       scribe      => undef,
+       timestamp   => $write_timestamp,
+
+       # filled in when a write starts:
+       xfer => undef,
+       xfer_source => undef,
+       xfer_dest => undef,
+       handle => undef,
+       hostname => undef,
+       diskname => undef,
+       datestamp => undef,
+       level => undef,
+       header => undef,
+       doing_port_write => undef,
+       input_errors => [],
+
+       # periodic status updates
+       timer => undef,
+       status_filename => undef,
+       status_fh => undef,
+
+       # filled in after the header is available
+       header => undef,
+
+       # filled in when a new tape is started:
+       label => undef
+    }, $class;
+
+    my $scribe = Amanda::Taper::Scribe->new(
+       taperscan => $controller->{'taperscan'},
+       feedback => $self,
+       debug => $Amanda::Config::debug_taper);
+
+    $self->{'scribe'} = $scribe;
+    $self->{'scribe'}->start(write_timestamp => $write_timestamp,
+       finished_cb => sub { $self->_scribe_started_cb(@_); });
+
+    return $self;
+}
+
+# called when the scribe is fully started up and ready to go
+sub _scribe_started_cb {
+    my $self = shift;
+    my ($err) = @_;
+
+    if ($err) {
+       $self->{'controller'}->{'proto'}->send(Amanda::Taper::Protocol::TAPE_ERROR,
+               worker_name  => $self->{'worker_name'},
+               message => "$err");
+       $self->{'state'} = "error";
+
+       # log the error (note that the message is intentionally not quoted)
+       log_add($L_ERROR, "no-tape error [$err]");
+
+    } else {
+       $self->{'controller'}->{'proto'}->send(Amanda::Taper::Protocol::TAPER_OK,
+               worker_name => $self->{'worker_name'});
+       $self->{'state'} = "idle";
+    }
+}
+
+
+sub FILE_WRITE {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+    $self->_assert_in_state("idle") or return;
+
+    $self->{'doing_port_write'} = 0;
+
+    $self->setup_and_start_dump($msgtype,
+       dump_cb => sub { $self->dump_cb(@_); },
+       %params);
+}
+
+sub PORT_WRITE {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    my $read_cb;
+
+    $self->_assert_in_state("idle") or return;
+
+    $self->{'doing_port_write'} = 1;
+
+    $self->setup_and_start_dump($msgtype,
+       dump_cb => sub { $self->dump_cb(@_); },
+       %params);
+}
+
+sub START_SCAN {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    $self->{'scribe'}->start_scan(undef);
+}
+
+sub NEW_TAPE {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    $self->_assert_in_state("writing") or return;
+
+    $self->{'perm_cb'}->(allow => 1);
+}
+
+sub NO_NEW_TAPE {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    $self->_assert_in_state("writing") or return;
+
+    # log the error (note that the message is intentionally not quoted)
+    log_add($L_ERROR, "no-tape config [$params{reason}]");
+
+    $self->{'perm_cb'}->(cause => "config", message => $params{'reason'});
+}
+
+sub TAKE_SCRIBE_FROM {
+    my $self = shift;
+    my ($worker1, $msgtype, %params) = @_;
+
+    $self->_assert_in_state("writing") or return;
+    $worker1->_assert_in_state("idle") or return;
+
+    my $scribe = $self->{'scribe'};
+    my $scribe1 = $worker1->{'scribe'};
+    $self->{'scribe'} = $scribe1;
+    $worker1->{'scribe'} = $scribe;
+    # Change the callback to call the new scribe
+    $self->{'xfer'}->set_callback(sub {
+       my ($src, $msg, $xfer) = @_;
+       $scribe1->handle_xmsg($src, $msg, $xfer);
+
+       # if this is an error message that's not from the scribe's element, then
+       # we'll need to keep track of it ourselves
+       if ($msg->{'type'} == $XMSG_ERROR and $msg->{'elt'} != $self->{'xfer_dest'}) {
+           push @{$self->{'input_errors'}}, $msg->{'message'};
+       }
+    });
+
+    $self->{'label'} = $worker1->{'label'};
+    $self->{'perm_cb'}->(scribe => $scribe1);
+    delete $worker1->{'scribe'};
+    $worker1->{'state'} = 'error';
+    $scribe->quit(finished_cb => sub {});
+ }
+
+sub DONE {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    $self->_assert_in_state("writing") or return;
+    $self->{'dumper_status'} = "DONE";
+    $self->{'orig_kb'} = $params{'orig_kb'};
+    if (defined $self->{'result'}) {
+       $self->result_cb(undef);
+    }
+}
+
+sub FAILED {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+
+    $self->_assert_in_state("writing") or return;
+
+    $self->{'dumper_status'} = "FAILED";
+    if (defined $self->{'result'}) {
+       $self->result_cb(undef);
+    }
+}
+
+sub result_cb {
+    my $self = shift;
+    my %params = %{$self->{'dump_params'}};
+    my $msgtype;
+    my $logtype;
+
+    if ($params{'result'} eq 'DONE') {
+       if (!$self->{'doing_port_write'} or $self->{'dumper_status'} eq "DONE") {
+           $msgtype = Amanda::Taper::Protocol::DONE;
+           $logtype = $L_DONE;
+       } else {
+           $msgtype = Amanda::Taper::Protocol::DONE;
+           $logtype = $L_PARTIAL;
+       }
+    } elsif ($params{'result'} eq 'PARTIAL') {
+       $msgtype = Amanda::Taper::Protocol::PARTIAL;
+       $logtype = $L_PARTIAL;
+    } elsif ($params{'result'} eq 'FAILED') {
+       $msgtype = Amanda::Taper::Protocol::FAILED;
+       $logtype = $L_FAIL;
+    }
+
+    if ($self->{timer}) {
+       $self->{timer}->remove();
+       undef $self->{timer};
+       $self->{status_fh}->close();
+       undef $self->{status_fh};
+       unlink($self->{status_filename});
+       undef $self->{status_filename};
+    }
+
+    # note that we use total_duration here, which is the total time between
+    # start_dump and dump_cb, so the kps generated here is much less than the
+    # actual tape write speed.  Think of this as the *taper* speed, rather than
+    # the *tape* speed.
+    my $stats = make_stats($params{'size'}, $params{'total_duration'}, $self->{'orig_kb'});
+
+    # consider this a config-derived failure only if there were no errors
+    my $failure_from = (@{$params{'device_errors'}})?  'error' : 'config';
+
+    my @all_messages = (@{$params{'device_errors'}}, @{$self->{'input_errors'}});
+    push @all_messages, $params{'config_denial_message'} if $params{'config_denial_message'};
+    my $msg = quote_string(join("; ", @all_messages));
+
+    # write a DONE/PARTIAL/FAIL log line
+    if ($logtype == $L_FAIL) {
+       log_add($L_FAIL, sprintf("%s %s %s %s %s %s",
+           quote_string($self->{'hostname'}.""), # " is required for SWIG..
+           quote_string($self->{'diskname'}.""),
+           $self->{'datestamp'},
+           $self->{'level'},
+           $failure_from,
+           $msg));
+    } else {
+       log_add($logtype, sprintf("%s %s %s %s %s %s%s",
+           quote_string($self->{'hostname'}.""), # " is required for SWIG..
+           quote_string($self->{'diskname'}.""),
+           $self->{'datestamp'},
+           $params{'nparts'},
+           $self->{'level'},
+           $stats,
+           ($logtype == $L_PARTIAL and @all_messages)? " $msg" : ""));
+    }
+
+    # and send a message back to the driver
+    my %msg_params = (
+       handle => $self->{'handle'},
+    );
+
+    # reflect errors in our own elements in INPUT-ERROR or INPUT-GOOD
+    if (@{$self->{'input_errors'}}) {
+       $msg_params{'input'} = 'INPUT-ERROR';
+       $msg_params{'inputerr'} = join("; ", @{$self->{'input_errors'}});
+    } else {
+       $msg_params{'input'} = 'INPUT-GOOD';
+       $msg_params{'inputerr'} = '';
+    }
+
+    # and errors from the scribe in TAPE-ERROR or TAPE-GOOD
+    if (@{$params{'device_errors'}}) {
+       $msg_params{'taper'} = 'TAPE-ERROR';
+       $msg_params{'tapererr'} = join("; ", @{$params{'device_errors'}});
+    } elsif ($params{'config_denial_message'}) {
+       $msg_params{'taper'} = 'TAPE-ERROR';
+       $msg_params{'tapererr'} = $params{'config_denial_message'};
+    } else {
+       $msg_params{'taper'} = 'TAPE-GOOD';
+       $msg_params{'tapererr'} = '';
+    }
+
+    if ($msgtype ne Amanda::Taper::Protocol::FAILED) {
+       $msg_params{'stats'} = $stats;
+    }
+
+    # reset things to 'idle' before sending the message
+    $self->{'xfer'} = undef;
+    $self->{'xfer_source'} = undef;
+    $self->{'xfer_dest'} = undef;
+    $self->{'handle'} = undef;
+    $self->{'header'} = undef;
+    $self->{'hostname'} = undef;
+    $self->{'diskname'} = undef;
+    $self->{'datestamp'} = undef;
+    $self->{'level'} = undef;
+    $self->{'header'} = undef;
+    $self->{'state'} = 'idle';
+    delete $self->{'result'};
+    delete $self->{'dumper_status'};
+    delete $self->{'dump_params'};
+
+    $self->{'controller'}->{'proto'}->send($msgtype, %msg_params);
+}
+
+
+##
+# Scribe feedback
+
+sub request_volume_permission {
+    my $self = shift;
+    my %params = @_;
+
+    $self->{'perm_cb'} = $params{'perm_cb'};
+    # and send the request to the driver
+    $self->{'controller'}->{'proto'}->send(Amanda::Taper::Protocol::REQUEST_NEW_TAPE,
+       handle => $self->{'handle'});
+}
+
+sub scribe_notif_new_tape {
+    my $self = shift;
+    my %params = @_;
+
+    # TODO: if $params{error} is set, report it back to the driver
+    # (this will be a change to the protocol)
+    if ($params{'volume_label'}) {
+       $self->{'label'} = $params{'volume_label'};
+
+       # add to the trace log
+       log_add($L_START, sprintf("datestamp %s label %s tape %s",
+               $self->{'timestamp'},
+               quote_string($self->{'label'}),
+               ++$tape_num));
+
+       # and the amdump log
+       print STDERR "taper: wrote label '$self->{label}'\n";
+
+       # and inform the driver
+       $self->{'controller'}->{'proto'}->send(Amanda::Taper::Protocol::NEW_TAPE,
+           handle => $self->{'handle'},
+           label => $params{'volume_label'});
+    } else {
+       $self->{'label'} = undef;
+
+       $self->{'controller'}->{'proto'}->send(Amanda::Taper::Protocol::NO_NEW_TAPE,
+           handle => $self->{'handle'});
+    }
+}
+
+sub scribe_notif_part_done {
+    my $self = shift;
+    my %params = @_;
+
+    $self->_assert_in_state("writing") or return;
+
+    my $stats = make_stats($params{'size'}, $params{'duration'}, $self->{'orig_kb'});
+
+    # log the part, using PART or PARTPARTIAL
+    my $logbase = sprintf("%s %s %s %s %s %s/%s %s %s",
+       quote_string($self->{'label'}),
+       $params{'fileno'},
+       quote_string($self->{'header'}->{'name'}.""), # " is required for SWIG..
+       quote_string($self->{'header'}->{'disk'}.""),
+       $self->{'datestamp'},
+       $params{'partnum'}, -1, # totalparts is always -1
+       $self->{'level'},
+       $stats);
+    if ($params{'successful'}) {
+       log_add($L_PART, $logbase);
+    } else {
+       log_add($L_PARTPARTIAL, "$logbase \"No space left on device\"");
+    }
+
+    # only send a PARTDONE if it was successful
+    if ($params{'successful'}) {
+       $self->{'controller'}->{'proto'}->send(Amanda::Taper::Protocol::PARTDONE,
+           handle => $self->{'handle'},
+           label => $self->{'label'},
+           fileno => $params{'fileno'},
+           stats => $stats,
+           kb => $params{'size'} / 1024);
+    }
+}
+
+sub scribe_notif_log_info {
+    my $self = shift;
+    my %params = @_;
+
+    log_add($L_INFO, $params{'message'});
+}
+
+##
+# Utilities
+
+sub _assert_in_state {
+    my $self = shift;
+    my ($state) = @_;
+    if ($self->{'state'} eq $state) {
+       return 1;
+    } else {
+       $self->{'controller'}->{'proto'}->send(Amanda::Taper::Protocol::BAD_COMMAND,
+           message => "command not appropriate in state '$self->{state}' : '$state'");
+       return 0;
+    }
+}
+
+sub create_status_file {
+    my $self = shift;
+
+    # create temporary file
+    ($self->{status_fh}, $self->{status_filename}) =
+       File::Temp::tempfile("taper_status_file_XXXXXX",
+                               DIR => $Amanda::Paths::AMANDA_TMPDIR,
+                               UNLINK => 1);
+
+    # tell amstatus about it by writing it to the dump log
+    my $qdisk = Amanda::Util::quote_string($self->{'diskname'});
+    my $qhost = Amanda::Util::quote_string($self->{'hostname'});
+    print STDERR "taper: status file $qhost $qdisk:" .
+                   "$self->{status_filename}\n";
+    print {$self->{status_fh}} "0";
+
+    # create timer callback, firing every 5s (=5000msec)
+    $self->{timer} = Amanda::MainLoop::timeout_source(5000);
+    $self->{timer}->set_callback(sub {
+       my $size = $self->{scribe}->get_bytes_written();
+       seek $self->{status_fh}, 0, 0;
+       print {$self->{status_fh}} $size;
+       $self->{status_fh}->flush();
+    });
+}
+
+sub send_port_and_get_header {
+    my $self = shift;
+    my ($finished_cb) = @_;
+
+    my $header_xfer;
+    my ($xsrc, $xdst);
+    my $errmsg;
+
+    my $steps = define_steps
+       cb_ref => \$finished_cb;
+
+    step send_port => sub {
+       # get the ip:port pairs for the data connection from the data xfer source,
+       # which should be an Amanda::Xfer::Source::DirectTCPListen
+       my $data_addrs = $self->{'xfer_source'}->get_addrs();
+       $data_addrs = join ";", map { $_->[0] . ':' . $_->[1] } @$data_addrs;
+
+       # and set up an xfer for the header, too, using DirectTCP as an easy
+       # way to implement a listen/accept/read process.  Note that this does
+       # not enforce a maximum size, so this portion of Amanda at least can
+       # handle any size header
+       ($xsrc, $xdst) = (
+           Amanda::Xfer::Source::DirectTCPListen->new(),
+           Amanda::Xfer::Dest::Buffer->new(0));
+       $header_xfer = Amanda::Xfer->new([$xsrc, $xdst]);
+       $header_xfer->start($steps->{'header_xfer_xmsg_cb'});
+
+       my $header_addrs = $xsrc->get_addrs();
+       $header_addrs = [ grep { $_->[0] eq '127.0.0.1' } @$header_addrs ];
+       die "Source::DirectTCPListen did not return a localhost address"
+           unless @$header_addrs;
+       my $header_port = $header_addrs->[0][1];
+
+       # and tell the driver which ports we're listening on
+       $self->{'controller'}->{'proto'}->send(Amanda::Taper::Protocol::PORT,
+           worker_name => $self->{'worker_name'},
+           handle => $self->{'handle'},
+           port => $header_port,
+           ipports => $data_addrs);
+    };
+
+    step header_xfer_xmsg_cb => sub {
+       my ($src, $xmsg, $xfer) = @_;
+       if ($xmsg->{'type'} == $XMSG_INFO) {
+           info($xmsg->{'message'});
+       } elsif ($xmsg->{'type'} == $XMSG_ERROR) {
+           $errmsg = $xmsg->{'messsage'};
+       } elsif ($xmsg->{'type'} == $XMSG_DONE) {
+           if ($errmsg) {
+               $finished_cb->($errmsg);
+           } else {
+               $steps->{'got_header'}->();
+           }
+       }
+    };
+
+    step got_header => sub {
+       my $hdr_buf = $xdst->get();
+
+       # close stuff up
+       $header_xfer = $xsrc = $xdst = undef;
+
+       if (!defined $hdr_buf) {
+           return $finished_cb->("Got empty header");
+       }
+
+       # parse the header, finally!
+       $self->{'header'} = Amanda::Header->from_string($hdr_buf);
+
+       $finished_cb->(undef);
+    };
+}
+
+# do the work of starting a new xfer; this contains the code common to
+# msg_PORT_WRITE and msg_FILE_WRITE.
+sub setup_and_start_dump {
+    my $self = shift;
+    my ($msgtype, %params) = @_;
+    my %get_xfer_dest_args;
+
+    # setting up the dump is a bit complex, due to the requirements of
+    # a directtcp port_write.  This function:
+    # 1. creates and starts a transfer (make_xfer)
+    # 2. gets the header
+    # 3. calls the scribe's start_dump method with the new header
+
+    my $steps = define_steps
+       cb_ref => \$params{'dump_cb'};
+
+    step setup => sub {
+       $self->{'handle'} = $params{'handle'};
+       $self->{'hostname'} = $params{'hostname'};
+       $self->{'diskname'} = $params{'diskname'};
+       $self->{'datestamp'} = $params{'datestamp'};
+       $self->{'level'} = $params{'level'};
+       $self->{'header'} = undef; # no header yet
+       $self->{'orig_kb'} = $params{'orig_kb'};
+       $self->{'input_errors'} = [];
+
+       if ($msgtype eq Amanda::Taper::Protocol::PORT_WRITE &&
+           (my $err = $self->{'scribe'}->check_data_path($params{'data_path'}))) {
+           return $params{'dump_cb'}->(
+               result => "FAILED",
+               device_errors => [ ['error', "$err"] ],
+               size => 0,
+               duration => 0.0,
+               total_duration => 0);
+       }
+       $steps->{'process_args'}->();
+    };
+
+    step process_args => sub {
+       # extract the splitting-related parameters, stripping out empty strings
+       my %splitting_args = map {
+           ($params{$_} ne '')? ($_, $params{$_}) : ()
+       } qw(
+           dle_tape_splitsize dle_split_diskbuffer dle_fallback_splitsize dle_allow_split
+           part_size part_cache_type part_cache_dir part_cache_max_size
+       );
+
+       # convert numeric values to BigInts
+       for (qw(dle_tape_splitsize dle_fallback_splitsize part_size part_cache_max_size)) {
+           $splitting_args{$_} = Math::BigInt->new($splitting_args{$_})
+               if (exists $splitting_args{$_});
+       }
+
+       # and convert those to get_xfer_dest args
+        %get_xfer_dest_args = get_splitting_args_from_config(
+               %splitting_args);
+       $get_xfer_dest_args{'max_memory'} = getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE);
+       $get_xfer_dest_args{'can_cache_inform'} = ($msgtype eq Amanda::Taper::Protocol::FILE_WRITE);
+
+       # if we're unable to fulfill the user's splitting needs, we can still give
+       # the dump a shot - but we'll warn them about the problem
+       if ($get_xfer_dest_args{'warning'}) {
+           log_add($L_WARNING, sprintf("%s:%s: %s",
+                   $params{'hostname'}, $params{'diskname'},
+                   $get_xfer_dest_args{'warning'}));
+           delete $get_xfer_dest_args{'warning'};
+       }
+
+       $steps->{'make_xfer'}->();
+    };
+
+    step make_xfer => sub {
+        $self->_assert_in_state("idle") or return;
+        $self->{'state'} = 'making_xfer';
+
+        $self->{'xfer_dest'} = $self->{'scribe'}->get_xfer_dest(%get_xfer_dest_args);
+
+       my $xfer_source;
+       if ($msgtype eq Amanda::Taper::Protocol::PORT_WRITE) {
+           $xfer_source = Amanda::Xfer::Source::DirectTCPListen->new();
+       } else {
+           $xfer_source = Amanda::Xfer::Source::Holding->new($params{'filename'});
+       }
+       $self->{'xfer_source'} = $xfer_source;
+
+        $self->{'xfer'} = Amanda::Xfer->new([$xfer_source, $self->{'xfer_dest'}]);
+        $self->{'xfer'}->start(sub {
+           my ($src, $msg, $xfer) = @_;
+            $self->{'scribe'}->handle_xmsg($src, $msg, $xfer);
+
+           # if this is an error message that's not from the scribe's element, then
+           # we'll need to keep track of it ourselves
+           if ($msg->{'type'} == $XMSG_ERROR and $msg->{'elt'} != $self->{'xfer_dest'}) {
+               push @{$self->{'input_errors'}}, $msg->{'message'};
+           }
+        });
+
+       # we've started the xfer now, but the destination won't actually write
+       # any data until we call start_dump.  And we'll need a header for that.
+
+       $steps->{'get_header'}->();
+    };
+
+    step get_header => sub {
+        $self->_assert_in_state("making_xfer") or return;
+        $self->{'state'} = 'getting_header';
+
+       if ($msgtype eq Amanda::Taper::Protocol::FILE_WRITE) {
+           # getting the header is easy for FILE-WRITE..
+           my $hdr = $self->{'header'} = Amanda::Holding::get_header($params{'filename'});
+
+           # stip out header fields we don't need
+           $hdr->{'cont_filename'} = '';
+
+           if (!defined $hdr || $hdr->{'type'} != $Amanda::Header::F_DUMPFILE) {
+               die("Could not read header from '$params{filename}'");
+           }
+           $steps->{'start_dump'}->(undef);
+       } else {
+           # ..but quite a bit harder for PORT-WRITE; this method will send the
+           # proper PORT command, then read the header from the dumper and parse
+           # it, placing the result in $self->{'header'}
+           $self->send_port_and_get_header($steps->{'start_dump'});
+       }
+    };
+
+    step start_dump => sub {
+       my ($err) = @_;
+
+        $self->_assert_in_state("getting_header") or return;
+        $self->{'state'} = 'writing';
+
+        # if $err is set, cancel the dump, treating it as a input error
+        if ($err) {
+           push @{$self->{'input_errors'}}, $err;
+           return $self->{'scribe'}->cancel_dump(
+               xfer => $self->{'xfer'},
+               dump_cb => $params{'dump_cb'});
+        }
+
+        # sanity check the header..
+        my $hdr = $self->{'header'};
+        if ($hdr->{'dumplevel'} != $params{'level'}
+            or $hdr->{'name'} ne $params{'hostname'}
+            or $hdr->{'disk'} ne $params{'diskname'}
+           or $hdr->{'datestamp'} ne $params{'datestamp'}) {
+            die("Header of dumpfile does not match command from driver");
+        }
+
+       # start producing status
+       $self->create_status_file();
+
+       # and fix it up before writing it
+        $hdr->{'totalparts'} = -1;
+        $hdr->{'type'} = $Amanda::Header::F_SPLIT_DUMPFILE;
+
+        $self->{'scribe'}->start_dump(
+           xfer => $self->{'xfer'},
+            dump_header => $hdr,
+            dump_cb => $params{'dump_cb'});
+    };
+}
+
+sub dump_cb {
+    my $self = shift;
+    my %params = @_;
+
+    $self->{'dump_params'} = \%params;
+    $self->{'result'} = $params{'result'};
+
+    # if we need to the dumper status (to differentiate a dropped network
+    # connection from a normal EOF) and have not done so yet, then send a
+    # DUMPER_STATUS message and re-call this method (dump_cb) with the result.
+    if ($params{'result'} eq "DONE"
+           and $self->{'doing_port_write'}
+           and !exists $self->{'dumper_status'}) {
+       my $controller = $self->{'controller'};
+       my $proto = $controller->{'proto'};
+       my $handle = $self->{'handle'};
+       $proto->send(Amanda::Taper::Protocol::DUMPER_STATUS,
+               handle => "$handle");
+    } else {
+       $self->result_cb();
+    }
+}
+
+1;
index 57d00e87dd1e1564cc69497841be68eefd08b3b3..44697d7ecdacf5bdc623bf2ffe99941885b49b72 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -2614,17 +2617,7 @@ XS(_wrap_verify_random_file) {
     }
     arg3 = (char *)(buf3);
     {
-      if (sizeof(signed int) == 1) {
-        arg4 = amglue_SvI8(ST(3));
-      } else if (sizeof(signed int) == 2) {
-        arg4 = amglue_SvI16(ST(3));
-      } else if (sizeof(signed int) == 4) {
-        arg4 = amglue_SvI32(ST(3));
-      } else if (sizeof(signed int) == 8) {
-        arg4 = amglue_SvI64(ST(3));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg4 = SvTRUE(ST(3));
     }
     result = (gboolean)verify_random_file(arg1,arg2,arg3,arg4);
     {
index 3f3088234c33c566cd8257e93957bb8b0ffd6ee7..c3b1725b6d43903d183b5c17181868df0c8dba82 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -2380,17 +2383,7 @@ XS(_wrap_set_blocking) {
       }
     }
     {
-      if (sizeof(signed int) == 1) {
-        arg2 = amglue_SvI8(ST(1));
-      } else if (sizeof(signed int) == 2) {
-        arg2 = amglue_SvI16(ST(1));
-      } else if (sizeof(signed int) == 4) {
-        arg2 = amglue_SvI32(ST(1));
-      } else if (sizeof(signed int) == 8) {
-        arg2 = amglue_SvI64(ST(1));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg2 = SvTRUE(ST(1));
     }
     result = (int)set_blocking(arg1,arg2);
     {
@@ -2731,17 +2724,7 @@ XS(_wrap_stream_server) {
       }
     }
     {
-      if (sizeof(signed int) == 1) {
-        arg5 = amglue_SvI8(ST(3));
-      } else if (sizeof(signed int) == 2) {
-        arg5 = amglue_SvI16(ST(3));
-      } else if (sizeof(signed int) == 4) {
-        arg5 = amglue_SvI32(ST(3));
-      } else if (sizeof(signed int) == 8) {
-        arg5 = amglue_SvI64(ST(3));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg5 = SvTRUE(ST(3));
     }
     result = stream_server(arg1,arg2,arg3,arg4,arg5);
     {
index 70774cb4f5864d09d8ca26405293480793b3854c..0a9f143aa37e0bc01b9bf7d677a9b86405b6f220 100644 (file)
@@ -400,14 +400,25 @@ Unquote a string as quoted with C<quote_string>.
 
 my($q, $remaider) = skip_quoted_string($str)
 
-Return the first quoted string and the remainder of the string.
+Return the first quoted string and the remainder of the string, as separated by
+any whitespace.  Note that the remainder of the string does not include the
+single separating whitespace character, but will include any subsequent
+whitespace.  The C<$q> is not unquoted.
 
 =item C<split_quoted_strings($str)>
 
-Split string on unquoted whitespace.  Multiple consecutive spaces are not
+Split string on unquoted whitespace.  Multiple consecutive spaces are I<not>
 collapsed into a single space: C<"x  y"> (with two spaces) parses as C<( "x",
 "", "y")>.  The strings are unquoted before they are returned.  An empty string
-is split into C<( "" )>.
+is split into C<( "" )>.  This method is generally used for parsing IPC messages,
+where blank space is significant and well-controlled.
+
+=item C<split_quoted_strings_friendly($str)>
+
+Similar to C<split_quoted_strings>, but intended for user-friendly uses.  In
+particular, this function treats any sequence of zero or more whitespace
+characters as a separator, rather than the more strict interpretation applied
+by C<split_quoted_strings>.  All of the strings are unquoted.
 
 All of these quoting-related functions are available under the export
 tag C<:quoting>.
@@ -438,8 +449,19 @@ For example:
   "{a,b}-{1,2}"     [ "a-1", "a-2", "b-1", "b-2" ]
 
 Note that nested braces are not processed.  Braces, commas, and
-backslashes may be escaped with backslashes.  On error,
-C<expand_braced_altnerates> returns undef.  These two functions are
+backslashes may be escaped with backslashes.
+
+As a special case for numeric ranges, if the braces contain only digits
+followed by two dots followed by more digits, and the digits sort in the
+correct order, then they will be treated as a sequence.  If the first number in
+the sequence has leading zeroes, then all generated numbers will have that
+length, padded with leading zeroes.
+
+  "tape-{01..10}"   [ "tape-01", "tape-02", "tape-03", "tape-04",
+                      "tape-05", "tape-06", "tape-07", "tape-08",
+                     "tape-09", "tape-10" ]
+
+On error, C<expand_braced_altnerates> returns undef.  These two functions are
 available in the export tag C<:alternates>.
 
 =item generate_timestamp()
@@ -769,6 +791,21 @@ sub skip_quoted_string {
     return ($quoted_string, $remainder);
 }
 
+sub split_quoted_string_friendly {
+    my $str = shift;
+    my @result;
+
+    chomp $str;
+    $str =~ s/^\s+//;
+    while ($str) {
+       (my $elt, $str) = skip_quoted_string($str);
+       push @result, unquote_string($elt);
+       $str =~ s/^\s+// if $str;
+    }
+
+    return @result;
+}
+
 
 push @EXPORT_OK, qw(slurp);
 
@@ -809,8 +846,10 @@ sub safe_overwrite_file {
 push @EXPORT_OK, qw(hexencode hexdecode);
 push @{$EXPORT_TAGS{"encoding"}}, qw(hexencode hexdecode);
 
-push @EXPORT_OK, qw(quote_string unquote_string skip_quoted_string sanitise_filename split_quoted_strings);
-push @{$EXPORT_TAGS{"quoting"}}, qw(quote_string unquote_string skip_quoted_string sanitise_filename split_quoted_strings);
+push @EXPORT_OK, qw(quote_string unquote_string skip_quoted_string
+               sanitise_filename split_quoted_strings split_quoted_strings_friendly);
+push @{$EXPORT_TAGS{"quoting"}}, qw(quote_string unquote_string skip_quoted_string
+               sanitise_filename split_quoted_strings split_quoted_strings_friendly);
 
 push @EXPORT_OK, qw(expand_braced_alternates collapse_braced_alternates);
 push @{$EXPORT_TAGS{"alternates"}}, qw(expand_braced_alternates collapse_braced_alternates);
index b33627ce7bdee00cdf66554fa59eba697c95c49a..a78e50a32c23566a79cb8c8e6fef36c379bf0a6c 100644 (file)
@@ -282,14 +282,25 @@ Unquote a string as quoted with C<quote_string>.
 
 my($q, $remaider) = skip_quoted_string($str)
 
-Return the first quoted string and the remainder of the string.
+Return the first quoted string and the remainder of the string, as separated by
+any whitespace.  Note that the remainder of the string does not include the
+single separating whitespace character, but will include any subsequent
+whitespace.  The C<$q> is not unquoted.
 
 =item C<split_quoted_strings($str)>
 
-Split string on unquoted whitespace.  Multiple consecutive spaces are not
+Split string on unquoted whitespace.  Multiple consecutive spaces are I<not>
 collapsed into a single space: C<"x  y"> (with two spaces) parses as C<( "x",
 "", "y")>.  The strings are unquoted before they are returned.  An empty string
-is split into C<( "" )>.
+is split into C<( "" )>.  This method is generally used for parsing IPC messages,
+where blank space is significant and well-controlled.
+
+=item C<split_quoted_strings_friendly($str)>
+
+Similar to C<split_quoted_strings>, but intended for user-friendly uses.  In
+particular, this function treats any sequence of zero or more whitespace
+characters as a separator, rather than the more strict interpretation applied
+by C<split_quoted_strings>.  All of the strings are unquoted.
 
 All of these quoting-related functions are available under the export
 tag C<:quoting>.
@@ -320,8 +331,19 @@ For example:
   "{a,b}-{1,2}"     [ "a-1", "a-2", "b-1", "b-2" ]
 
 Note that nested braces are not processed.  Braces, commas, and
-backslashes may be escaped with backslashes.  On error,
-C<expand_braced_altnerates> returns undef.  These two functions are
+backslashes may be escaped with backslashes.
+
+As a special case for numeric ranges, if the braces contain only digits
+followed by two dots followed by more digits, and the digits sort in the
+correct order, then they will be treated as a sequence.  If the first number in
+the sequence has leading zeroes, then all generated numbers will have that
+length, padded with leading zeroes.
+
+  "tape-{01..10}"   [ "tape-01", "tape-02", "tape-03", "tape-04",
+                      "tape-05", "tape-06", "tape-07", "tape-08",
+                     "tape-09", "tape-10" ]
+
+On error, C<expand_braced_altnerates> returns undef.  These two functions are
 available in the export tag C<:alternates>.
 
 =item generate_timestamp()
index 2043b44122b87fddc0dcbae06cb76c9a0d88131d..e4a3e6b655835fd6c893c5df728bb8078b21b17b 100644 (file)
@@ -209,6 +209,21 @@ sub skip_quoted_string {
     return ($quoted_string, $remainder);
 }
 
+sub split_quoted_string_friendly {
+    my $str = shift;
+    my @result;
+
+    chomp $str;
+    $str =~ s/^\s+//;
+    while ($str) {
+       (my $elt, $str) = skip_quoted_string($str);
+       push @result, unquote_string($elt);
+       $str =~ s/^\s+// if $str;
+    }
+
+    return @result;
+}
+
 %}
 
 amglue_export_ok(slurp);
@@ -330,7 +345,8 @@ GPtrArray *expand_braced_alternates(char *);
 %newobject collapse_braced_alternates;
 char *collapse_braced_alternates(GPtrArray *source);
 gchar **split_quoted_strings(const gchar *string);
-amglue_export_tag(quoting, quote_string unquote_string skip_quoted_string sanitise_filename split_quoted_strings);
+amglue_export_tag(quoting, quote_string unquote_string skip_quoted_string
+               sanitise_filename split_quoted_strings split_quoted_strings_friendly);
 amglue_export_tag(alternates, expand_braced_alternates collapse_braced_alternates);
 
 %perlcode %{
index f10e474315ac8c9fa5cd4ce0c2e866532e276619..bb83f2ad7bbd6843e67b2648209f3816a3aed0c1 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -2497,7 +2500,7 @@ XS(_wrap_xfer_source_directtcp_connect) {
       addrs_av = (AV *)SvRV(ST(0));
       num_addrs = av_len(addrs_av)+1;
       
-      arg1 = g_new0(DirectTCPAddr, num_addrs);
+      arg1 = g_new0(DirectTCPAddr, num_addrs+1);
       
       for (i = 0; i < num_addrs; i++) {
         SV **svp = av_fetch(addrs_av, i, 0);
@@ -2582,12 +2585,13 @@ XS(_wrap_xfer_filter_process) {
   {
     gchar **arg1 = (gchar **) 0 ;
     gboolean arg2 ;
+    gboolean arg3 ;
     int argvi = 0;
     XferElement *result = 0 ;
     dXSARGS;
     
-    if ((items < 2) || (items > 2)) {
-      SWIG_croak("Usage: xfer_filter_process(argv,need_root);");
+    if ((items < 3) || (items > 3)) {
+      SWIG_croak("Usage: xfer_filter_process(argv,need_root,log_stderr);");
     }
     {
       AV *av;
@@ -2617,25 +2621,19 @@ XS(_wrap_xfer_filter_process) {
            * care of freeing this array, so we don't have to */
     }
     {
-      if (sizeof(signed int) == 1) {
-        arg2 = amglue_SvI8(ST(1));
-      } else if (sizeof(signed int) == 2) {
-        arg2 = amglue_SvI16(ST(1));
-      } else if (sizeof(signed int) == 4) {
-        arg2 = amglue_SvI32(ST(1));
-      } else if (sizeof(signed int) == 8) {
-        arg2 = amglue_SvI64(ST(1));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg2 = SvTRUE(ST(1));
     }
-    result = (XferElement *)xfer_filter_process(arg1,arg2);
+    {
+      arg3 = SvTRUE(ST(2));
+    }
+    result = (XferElement *)xfer_filter_process(arg1,arg2,arg3);
     {
       ST(argvi) = sv_2mortal(new_sv_for_xfer_element(result));
       argvi++;
     }
     
     
+    
     {
       xfer_element_unref(result);
     }
@@ -2643,6 +2641,7 @@ XS(_wrap_xfer_filter_process) {
   fail:
     
     
+    
     SWIG_croak_null();
   }
 }
@@ -2897,7 +2896,7 @@ XS(_wrap_xfer_dest_directtcp_connect) {
       addrs_av = (AV *)SvRV(ST(0));
       num_addrs = av_len(addrs_av)+1;
       
-      arg1 = g_new0(DirectTCPAddr, num_addrs);
+      arg1 = g_new0(DirectTCPAddr, num_addrs+1);
       
       for (i = 0; i < num_addrs; i++) {
         SV **svp = av_fetch(addrs_av, i, 0);
index 60d1af4b934d1b768c1f056235bc1199fe573fc7..724e618ca3cc2470088cdc6263b92d6d6c3f852e 100644 (file)
@@ -212,7 +212,7 @@ the file for you!
 
 This source reads data from a holding file (see L<Amanda::Holding>).
 If the transfer only consists of a C<Amanda::Xfer::Source::Holding>
-and an C<Amanda::Xfer::Dest::Taper::Splitter> (with no filters), then the source
+and an C<Amanda::Xfer::Dest::Taper::Cacher> (with no filters), then the source
 will call the destination's C<cache_inform> method so that it can use
 holding chunks for a split-part cache.
 
@@ -282,11 +282,12 @@ be called before the C<start_part> method is called with a new device.
   Amanda::Xfer::Source::DirectTCPListen->new();
 
 This source is for use when the transfer data will come in via DirectTCP, with
-the data's I<source> connecting to the data's I<destination>.  Set up the
-transfer, and after starting it, call its C<get_addrs> method to get an
-arrayref of ip/port pairs, e.g., C<[ "192.168.4.5", 9924 ]>, all of which are
-listening for an incoming data connection.  Once a connection arrives, this
-element will read data from it and send those data into the transfer.
+the data's I<source> connecting to the data's I<destination>.  That is, the
+data source is the connection initiator.  Set up the transfer, and after
+starting it, call this element's C<get_addrs> method to get an arrayref of ip/port pairs,
+e.g., C<[ "192.168.4.5", 9924 ]>, all of which are listening for an incoming
+data connection.  Once a connection arrives, this element will read data from
+it and send those data into the transfer.
 
   my $addrs = $src->get_addrs();
 
@@ -295,21 +296,23 @@ element will read data from it and send those data into the transfer.
   Amanda::Xfer::Source::DirectTCPConnect->new($addrs);
 
 This source is for use when the transfer data will come in via DirectTCP, with
-the data's I<destination> connecting to the the data's I<source>.  The element
-connects to C<$addrs> and reads the transfer data from the connection.
+the data's I<destination> connecting to the the data's I<source>.  That is, the
+data destination is the connection initiator.  The element connects to
+C<$addrs> and reads the transfer data from the connection.
 
 =head2 Transfer Filters
 
 =head3 Amanda::Xfer::Filter:Process
 
-  Amanda::Xfer::Filter::Process->new([@args], $need_root);
+  Amanda::Xfer::Filter::Process->new([@args], $need_root, $log_stderr);
 
 This filter will pipe data through the standard file descriptors of the
 subprocess specified by C<@args>.  If C<$need_root> is true, it will attempt to
 change to uid 0 before executing the process.  Standard output from the process
 is redirected to the debug log.  Note that the process is invoked directly, not
 via a shell, so shell metacharcters (e.g., C<< 2>&1 >>) will not function as
-expected.
+expected.  If C<$log_stderr> is set, then the filter's standard error is sent
+to the debug log; otherwise, it is sent to the parent process's stderr.
 
 =head3 Amanda::Xfer::Filter:Xor
 
@@ -322,12 +325,14 @@ through it.
 
 =head3 Amanda::Xfer::Dest::Device (SERVER ONLY)
 
-  Amanda::Xfer::Dest::Device->new($device, $max_memory);
+  Amanda::Xfer::Dest::Device->new($device, $cancel_at_eom);
 
-This source writes data to a device.  The device should be ready for
-writing (C<< $device->start_file(..) >>).  No more than C<$max_memory>
-will be used for buffers.  Use zero for the default buffer size.  On
-completion of the transfer, the file will be finished.
+This source writes data to a device.  The device should be ready for writing
+(C<< $device->start_file(..) >>).  On completion of the transfer, the file will
+be finished.  If an error occurs, or if C<$cancel_at_eom> is true and the
+device signals LEOM, the transfer will be cancelled.
+
+Note that this element does not apply any sort of stream buffering.
 
 =head3 Amanda::Xfer::Dest::Buffer
 
@@ -344,11 +349,12 @@ returns a copy of the buffer as a perl scalar:
   Amanda::Xfer::Dest::DirectTCPListen->new();
 
 This destination is for use when the transfer data will come in via DirectTCP,
-with the data's I<destination> connecting to the data's I<source>.  Set up the
-transfer, and after starting it, call this element's C<get_addrs> method to get
-an arrayref of ip/port pairs, e.g., C<[ "192.168.4.5", 9924 ]>, all of which
-are listening for an incoming data connection.  Once a connection arrives, this
-element will write the transfer data to it.
+with the data's I<destination> connecting to the data's I<source>.  That is,
+the data destination is the connection initiator.  Set up the transfer, and
+after starting it, call this element's C<get_addrs> method to get an arrayref
+of ip/port pairs, e.g., C<[ "192.168.4.5", 9924 ]>, all of which are listening
+for an incoming data connection.  Once a connection arrives, this element will
+write the transfer data to it.
 
   my $addrs = $src->get_addrs();
 
@@ -357,8 +363,9 @@ element will write the transfer data to it.
   Amanda::Xfer::Dest::DirectTCPConnect->new($addrs);
 
 This destination is for use when the transfer data will come in via DirectTCP,
-with the data's I<source> connecting to the the data's I<destination>.  The
-element connects to C<$addrs> and writes the transfer data to the connection.
+with the data's I<source> connecting to the the data's I<destination>.  That
+is, the data source is the connection initiator.  The element connects to
+C<$addrs> and writes the transfer data to the connection.
 
 =head3 Amanda::Xfer::Dest::Fd
 
@@ -379,7 +386,7 @@ validation is performed if C<$seed> is zero.
 
 =head3 Amanda::Xfer::Dest::Taper (SERVER ONLY)
 
-This is the parent class to C<Amanda::Xfer::Dest::Taper::Splitter> and
+This is the parent class to C<Amanda::Xfer::Dest::Taper::Cacher> and
 C<Amanda::Xfer::Dest::Taper::DirectTCP>. These subclasses allow a single
 transfer to write to multiple files (parts) on a device, and even spread those
 parts over multiple devices, without interrupting the transfer itself.
@@ -448,25 +455,40 @@ to the device.
 =head3 Amanda::Xfer::Dest::Taper::Splitter
 
   Amanda::Xfer::Dest::Taper::Splitter->new($first_device, $max_memory,
+                        $part_size, $expect_cache_inform);
+
+This class splits a data stream into parts on the storage media.  It is for use
+when the device supports LEOM, when the dump is already available on disk
+(C<cache_inform>), or when no caching is desired.  It does not cache parts, so
+it can only retry a partial part if the transfer source is calling
+C<cache_inform>.  If the element is used with devices that do not support LEOM,
+then it will cancel the entire transfer if the device reaches EOM and
+C<cache_inform> is not in use.  Set C<$expect_cache_inform> appropriately based
+on the incoming data.
+
+The C<$part_size> and C<$first_device> parameters are described above for
+C<Amanda::Xfer::Dest::Taper>.
+
+=head3 Amanda::Xfer::Dest::Taper::Cacher
+
+  Amanda::Xfer::Dest::Taper::Cacher->new($first_device, $max_memory,
                         $part_size, $use_mem_cache, $disk_cache_dirname);
 
-This class caches data from each part in one of a variety of ways, and supports
-"rewinding" to retry a failed part (e.g., one that does not fit on a device).
-It assumes that when a device reaches EOM while writing, the entire file is
-corrupt.  It does not (yet) support logical EOM, which can render this
-assumption incorrect.
+This class is similar to the splitter, but caches data from each part in one of
+a variety of ways to support "rewinding" to retry a failed part (e.g., one that
+does not fit on a device).  It assumes that when a device reaches EOM while
+writing, the entire on-volume file is corrupt - that is, that the device does
+not support logical EOM.  The class does not support C<cache_inform>.
 
-The C<$first_device> is used to calculate some internal constants, notably the
-slab size, based on the device characteristics.   Subsequent devices must have
-the same block size.  The C<$part_size> and C<$first_device> parameters are
-described above.
+The C<$part_size> and C<$first_device> parameters are described above for
+C<Amanda::Xfer::Dest::Taper>.
 
 If C<$use_mem_cache> is true, each part will be cached in memory (using
 C<$part_size> bytes of memory; plan accordingly!).  If C<$disk_cache_dirname>
 is defined, then each part will be cached on-disk in a file in this directory.
 It is an error to specify both in-memory and on-disk caching.  If neither
 option is specified, the element will operate successfully, but will not be
-able to retry a part unless C<cache_inform> has been used properly (see above).
+able to retry a part, and will cancel the transfer if a part fails.
 
 =head3 Amanda::Xfer::Dest::Taper::DirectTCP
 
@@ -631,6 +653,22 @@ sub xfer_start_with_callback {
     xfer_start($xfer);
 }
 
+sub xfer_set_callback {
+    my ($xfer, $cb) = @_;
+    if (defined $cb) {
+       my $releasing_cb = sub {
+           my ($src, $msg, $xfer) = @_;
+           my $done = $msg->{'type'} == $XMSG_DONE;
+           $src->remove() if $done;
+           $cb->(@_);
+           $cb = undef if $done; # break potential reference loop
+       };
+       $xfer->get_source()->set_callback($releasing_cb);
+    } else {
+       $xfer->get_source()->set_callback(undef);
+    }
+}
+
 package Amanda::Xfer::Xfer;
 
 sub new { 
@@ -649,6 +687,7 @@ use overload '!=' => sub { not Amanda::Xfer::same_elements($_[0], $_[1]); };
 *get_status = *Amanda::Xfer::xfer_get_status;
 *get_source = *Amanda::Xfer::xfer_get_amglue_source;
 *start = *Amanda::Xfer::xfer_start_with_callback;
+*set_callback = *Amanda::Xfer::xfer_set_callback;
 *cancel = *Amanda::Xfer::xfer_cancel;
 
 package Amanda::Xfer::Element;
@@ -848,6 +887,9 @@ package Amanda::Xfer;
 # try to load Amanda::XferServer, which is server-only.  If it's not found, then
 # its classes just remain undefined.
 BEGIN {
-    eval "use Amanda::XferServer;";
+    use Amanda::Util;
+    if (Amanda::Util::built_with_component("server")) {
+       eval "use Amanda::XferServer;";
+    }
 }
 1;
index 772474b0b38c970ec4e07e0c6fc2ff3658cf388f..d09923c7e5c291e32fd16ec0ef95728202072448 100644 (file)
@@ -136,7 +136,7 @@ the file for you!
 
 This source reads data from a holding file (see L<Amanda::Holding>).
 If the transfer only consists of a C<Amanda::Xfer::Source::Holding>
-and an C<Amanda::Xfer::Dest::Taper::Splitter> (with no filters), then the source
+and an C<Amanda::Xfer::Dest::Taper::Cacher> (with no filters), then the source
 will call the destination's C<cache_inform> method so that it can use
 holding chunks for a split-part cache.
 
@@ -206,11 +206,12 @@ be called before the C<start_part> method is called with a new device.
   Amanda::Xfer::Source::DirectTCPListen->new();
 
 This source is for use when the transfer data will come in via DirectTCP, with
-the data's I<source> connecting to the data's I<destination>.  Set up the
-transfer, and after starting it, call its C<get_addrs> method to get an
-arrayref of ip/port pairs, e.g., C<[ "192.168.4.5", 9924 ]>, all of which are
-listening for an incoming data connection.  Once a connection arrives, this
-element will read data from it and send those data into the transfer.
+the data's I<source> connecting to the data's I<destination>.  That is, the
+data source is the connection initiator.  Set up the transfer, and after
+starting it, call this element's C<get_addrs> method to get an arrayref of ip/port pairs,
+e.g., C<[ "192.168.4.5", 9924 ]>, all of which are listening for an incoming
+data connection.  Once a connection arrives, this element will read data from
+it and send those data into the transfer.
 
   my $addrs = $src->get_addrs();
 
@@ -219,21 +220,23 @@ element will read data from it and send those data into the transfer.
   Amanda::Xfer::Source::DirectTCPConnect->new($addrs);
 
 This source is for use when the transfer data will come in via DirectTCP, with
-the data's I<destination> connecting to the the data's I<source>.  The element
-connects to C<$addrs> and reads the transfer data from the connection.
+the data's I<destination> connecting to the the data's I<source>.  That is, the
+data destination is the connection initiator.  The element connects to
+C<$addrs> and reads the transfer data from the connection.
 
 =head2 Transfer Filters
 
 =head3 Amanda::Xfer::Filter:Process
 
-  Amanda::Xfer::Filter::Process->new([@args], $need_root);
+  Amanda::Xfer::Filter::Process->new([@args], $need_root, $log_stderr);
 
 This filter will pipe data through the standard file descriptors of the
 subprocess specified by C<@args>.  If C<$need_root> is true, it will attempt to
 change to uid 0 before executing the process.  Standard output from the process
 is redirected to the debug log.  Note that the process is invoked directly, not
 via a shell, so shell metacharcters (e.g., C<< 2>&1 >>) will not function as
-expected.
+expected.  If C<$log_stderr> is set, then the filter's standard error is sent
+to the debug log; otherwise, it is sent to the parent process's stderr.
 
 =head3 Amanda::Xfer::Filter:Xor
 
@@ -246,12 +249,14 @@ through it.
 
 =head3 Amanda::Xfer::Dest::Device (SERVER ONLY)
 
-  Amanda::Xfer::Dest::Device->new($device, $max_memory);
+  Amanda::Xfer::Dest::Device->new($device, $cancel_at_eom);
 
-This source writes data to a device.  The device should be ready for
-writing (C<< $device->start_file(..) >>).  No more than C<$max_memory>
-will be used for buffers.  Use zero for the default buffer size.  On
-completion of the transfer, the file will be finished.
+This source writes data to a device.  The device should be ready for writing
+(C<< $device->start_file(..) >>).  On completion of the transfer, the file will
+be finished.  If an error occurs, or if C<$cancel_at_eom> is true and the
+device signals LEOM, the transfer will be cancelled.
+
+Note that this element does not apply any sort of stream buffering.
 
 =head3 Amanda::Xfer::Dest::Buffer
 
@@ -268,11 +273,12 @@ returns a copy of the buffer as a perl scalar:
   Amanda::Xfer::Dest::DirectTCPListen->new();
 
 This destination is for use when the transfer data will come in via DirectTCP,
-with the data's I<destination> connecting to the data's I<source>.  Set up the
-transfer, and after starting it, call this element's C<get_addrs> method to get
-an arrayref of ip/port pairs, e.g., C<[ "192.168.4.5", 9924 ]>, all of which
-are listening for an incoming data connection.  Once a connection arrives, this
-element will write the transfer data to it.
+with the data's I<destination> connecting to the data's I<source>.  That is,
+the data destination is the connection initiator.  Set up the transfer, and
+after starting it, call this element's C<get_addrs> method to get an arrayref
+of ip/port pairs, e.g., C<[ "192.168.4.5", 9924 ]>, all of which are listening
+for an incoming data connection.  Once a connection arrives, this element will
+write the transfer data to it.
 
   my $addrs = $src->get_addrs();
 
@@ -281,8 +287,9 @@ element will write the transfer data to it.
   Amanda::Xfer::Dest::DirectTCPConnect->new($addrs);
 
 This destination is for use when the transfer data will come in via DirectTCP,
-with the data's I<source> connecting to the the data's I<destination>.  The
-element connects to C<$addrs> and writes the transfer data to the connection.
+with the data's I<source> connecting to the the data's I<destination>.  That
+is, the data source is the connection initiator.  The element connects to
+C<$addrs> and writes the transfer data to the connection.
 
 =head3 Amanda::Xfer::Dest::Fd
 
@@ -303,7 +310,7 @@ validation is performed if C<$seed> is zero.
 
 =head3 Amanda::Xfer::Dest::Taper (SERVER ONLY)
 
-This is the parent class to C<Amanda::Xfer::Dest::Taper::Splitter> and
+This is the parent class to C<Amanda::Xfer::Dest::Taper::Cacher> and
 C<Amanda::Xfer::Dest::Taper::DirectTCP>. These subclasses allow a single
 transfer to write to multiple files (parts) on a device, and even spread those
 parts over multiple devices, without interrupting the transfer itself.
@@ -372,25 +379,40 @@ to the device.
 =head3 Amanda::Xfer::Dest::Taper::Splitter
 
   Amanda::Xfer::Dest::Taper::Splitter->new($first_device, $max_memory,
+                        $part_size, $expect_cache_inform);
+
+This class splits a data stream into parts on the storage media.  It is for use
+when the device supports LEOM, when the dump is already available on disk
+(C<cache_inform>), or when no caching is desired.  It does not cache parts, so
+it can only retry a partial part if the transfer source is calling
+C<cache_inform>.  If the element is used with devices that do not support LEOM,
+then it will cancel the entire transfer if the device reaches EOM and
+C<cache_inform> is not in use.  Set C<$expect_cache_inform> appropriately based
+on the incoming data.
+
+The C<$part_size> and C<$first_device> parameters are described above for
+C<Amanda::Xfer::Dest::Taper>.
+
+=head3 Amanda::Xfer::Dest::Taper::Cacher
+
+  Amanda::Xfer::Dest::Taper::Cacher->new($first_device, $max_memory,
                         $part_size, $use_mem_cache, $disk_cache_dirname);
 
-This class caches data from each part in one of a variety of ways, and supports
-"rewinding" to retry a failed part (e.g., one that does not fit on a device).
-It assumes that when a device reaches EOM while writing, the entire file is
-corrupt.  It does not (yet) support logical EOM, which can render this
-assumption incorrect.
+This class is similar to the splitter, but caches data from each part in one of
+a variety of ways to support "rewinding" to retry a failed part (e.g., one that
+does not fit on a device).  It assumes that when a device reaches EOM while
+writing, the entire on-volume file is corrupt - that is, that the device does
+not support logical EOM.  The class does not support C<cache_inform>.
 
-The C<$first_device> is used to calculate some internal constants, notably the
-slab size, based on the device characteristics.   Subsequent devices must have
-the same block size.  The C<$part_size> and C<$first_device> parameters are
-described above.
+The C<$part_size> and C<$first_device> parameters are described above for
+C<Amanda::Xfer::Dest::Taper>.
 
 If C<$use_mem_cache> is true, each part will be cached in memory (using
 C<$part_size> bytes of memory; plan accordingly!).  If C<$disk_cache_dirname>
 is defined, then each part will be cached on-disk in a file in this directory.
 It is an error to specify both in-memory and on-disk caching.  If neither
 option is specified, the element will operate successfully, but will not be
-able to retry a part unless C<cache_inform> has been used properly (see above).
+able to retry a part, and will cancel the transfer if a part fails.
 
 =head3 Amanda::Xfer::Dest::Taper::DirectTCP
 
index 6b980b1635d731d14c61858401cd51d7790ee7d9..f9527ccf3beae000cc5282f6933d50d9e44f7e93 100644 (file)
@@ -256,6 +256,25 @@ sub xfer_start_with_callback {
 }
 %}
 
+/* Change the callback */
+%perlcode %{
+sub xfer_set_callback {
+    my ($xfer, $cb) = @_;
+    if (defined $cb) {
+       my $releasing_cb = sub {
+           my ($src, $msg, $xfer) = @_;
+           my $done = $msg->{'type'} == $XMSG_DONE;
+           $src->remove() if $done;
+           $cb->(@_);
+           $cb = undef if $done; # break potential reference loop
+       };
+       $xfer->get_source()->set_callback($releasing_cb);
+    } else {
+       $xfer->get_source()->set_callback(undef);
+    }
+}
+%}
+
 /*
  * XferElement functions
  *
@@ -358,7 +377,8 @@ XferElement *xfer_filter_xor(
 %newobject xfer_filter_process;
 XferElement *xfer_filter_process(
     gchar **argv,
-    gboolean need_root);
+    gboolean need_root,
+    gboolean log_stderr);
 
 %newobject xfer_dest_null;
 XferElement *xfer_dest_null(
@@ -534,6 +554,7 @@ DECLARE_METHOD(repr, Amanda::Xfer::xfer_repr);
 DECLARE_METHOD(get_status, Amanda::Xfer::xfer_get_status);
 DECLARE_METHOD(get_source, Amanda::Xfer::xfer_get_amglue_source);
 DECLARE_METHOD(start, Amanda::Xfer::xfer_start_with_callback);
+DECLARE_METHOD(set_callback, Amanda::Xfer::xfer_set_callback);
 DECLARE_METHOD(cancel, Amanda::Xfer::xfer_cancel);
 
 /* ---- */
@@ -665,6 +686,9 @@ PACKAGE(Amanda::Xfer)
 # try to load Amanda::XferServer, which is server-only.  If it's not found, then
 # its classes just remain undefined.
 BEGIN {
-    eval "use Amanda::XferServer;";
+    use Amanda::Util;
+    if (Amanda::Util::built_with_component("server")) {
+       eval "use Amanda::XferServer;";
+    }
 }
 %}
index 91859929e0f01cbc8398877abb75594d35b606c0..8498069c6064b5d52a704c10dbe30781d2563409 100644 (file)
@@ -8,6 +8,9 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
@@ -1486,10 +1489,9 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 #define SWIGTYPE_p_guint64 swig_types[9]
 #define SWIGTYPE_p_int swig_types[10]
 #define SWIGTYPE_p_off_t swig_types[11]
-#define SWIGTYPE_p_queue_fd_t swig_types[12]
-#define SWIGTYPE_p_unsigned_char swig_types[13]
-static swig_type_info *swig_types[15];
-static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0};
+#define SWIGTYPE_p_unsigned_char swig_types[12]
+static swig_type_info *swig_types[14];
+static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0};
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
@@ -1537,6 +1539,16 @@ SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
 #include "xfer-server.h"
 
 
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
 SWIGINTERN int
 SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
 {
@@ -1603,27 +1615,19 @@ SWIG_CanCastAsInteger(double *d, double min, double max) {
 
 
 SWIGINTERN int
-SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) 
+SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
 {
-  if (SvUOK(obj)) {
-    if (val) *val = SvUV(obj);
+  if (SvIOK(obj)) {
+    if (val) *val = SvIV(obj);
     return SWIG_OK;
-  } else  if (SvIOK(obj)) {
-    long v = SvIV(obj);
-    if (v >= 0) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      return SWIG_OverflowError;
-    }
   } else {
     int dispatch = 0;
     const char *nptr = SvPV_nolen(obj);
     if (nptr) {
       char *endptr;
-      unsigned long v;
+      long v;
       errno = 0;
-      v = strtoul(nptr, &endptr,0);
+      v = strtol(nptr, &endptr,0);
       if (errno == ERANGE) {
        errno = 0;
        return SWIG_OverflowError;
@@ -1637,8 +1641,8 @@ SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
     if (!dispatch) {
       double d;
       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
-      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
-       if (val) *val = (unsigned long)(d);
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+       if (val) *val = (long)(d);
        return res;
       }
     }
@@ -1647,12 +1651,18 @@ SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
 }
 
 
-SWIGINTERNINLINE int
-SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
+SWIGINTERN int
+SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
 {
-  unsigned long v;
-  int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
-  if (SWIG_IsOK(res) && val) *val = (size_t)(v);
+  long v;
+  int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = (int)(v);
+    }
+  }  
   return res;
 }
 
@@ -1713,30 +1723,28 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
 
 
 
-#include <limits.h>
-#if !defined(SWIG_NO_LLONG_MAX)
-# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
-#   define LLONG_MAX __LONG_LONG_MAX__
-#   define LLONG_MIN (-LLONG_MAX - 1LL)
-#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
-# endif
-#endif
-
-
 SWIGINTERN int
-SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
+SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) 
 {
-  if (SvIOK(obj)) {
-    if (val) *val = SvIV(obj);
+  if (SvUOK(obj)) {
+    if (val) *val = SvUV(obj);
     return SWIG_OK;
+  } else  if (SvIOK(obj)) {
+    long v = SvIV(obj);
+    if (v >= 0) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      return SWIG_OverflowError;
+    }
   } else {
     int dispatch = 0;
     const char *nptr = SvPV_nolen(obj);
     if (nptr) {
       char *endptr;
-      long v;
+      unsigned long v;
       errno = 0;
-      v = strtol(nptr, &endptr,0);
+      v = strtoul(nptr, &endptr,0);
       if (errno == ERANGE) {
        errno = 0;
        return SWIG_OverflowError;
@@ -1750,8 +1758,8 @@ SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
     if (!dispatch) {
       double d;
       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
-      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
-       if (val) *val = (long)(d);
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+       if (val) *val = (unsigned long)(d);
        return res;
       }
     }
@@ -1760,18 +1768,12 @@ SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
 }
 
 
-SWIGINTERN int
-SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
+SWIGINTERNINLINE int
+SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
 {
-  long v;
-  int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
-  if (SWIG_IsOK(res)) {
-    if ((v < INT_MIN || v > INT_MAX)) {
-      return SWIG_OverflowError;
-    } else {
-      if (val) *val = (int)(v);
-    }
-  }  
+  unsigned long v;
+  int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
+  if (SWIG_IsOK(res) && val) *val = (size_t)(v);
   return res;
 }
 
@@ -1841,7 +1843,7 @@ XS(_wrap_xfer_source_device) {
 XS(_wrap_xfer_dest_device) {
   {
     Device *arg1 = (Device *) 0 ;
-    size_t arg2 ;
+    gboolean arg2 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
@@ -1849,7 +1851,7 @@ XS(_wrap_xfer_dest_device) {
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
-      SWIG_croak("Usage: xfer_dest_device(device,max_memory);");
+      SWIG_croak("Usage: xfer_dest_device(device,cancel_at_leom);");
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
@@ -1857,17 +1859,7 @@ XS(_wrap_xfer_dest_device) {
     }
     arg1 = (Device *)(argp1);
     {
-      if (sizeof(size_t) == 1) {
-        arg2 = amglue_SvU8(ST(1));
-      } else if (sizeof(size_t) == 2) {
-        arg2 = amglue_SvU16(ST(1));
-      } else if (sizeof(size_t) == 4) {
-        arg2 = amglue_SvU32(ST(1));
-      } else if (sizeof(size_t) == 8) {
-        arg2 = amglue_SvU64(ST(1));
-      } else {
-        croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
-      }
+      arg2 = SvTRUE(ST(1));
     }
     result = (XferElement *)xfer_dest_device(arg1,arg2);
     {
@@ -1924,6 +1916,66 @@ XS(_wrap_xfer_source_holding) {
 
 
 XS(_wrap_xfer_dest_taper_splitter) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    size_t arg2 ;
+    guint64 arg3 ;
+    gboolean arg4 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    XferElement *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 4) || (items > 4)) {
+      SWIG_croak("Usage: xfer_dest_taper_splitter(first_device,max_memory,part_size,expect_cache_inform);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "xfer_dest_taper_splitter" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      if (sizeof(size_t) == 1) {
+        arg2 = amglue_SvU8(ST(1));
+      } else if (sizeof(size_t) == 2) {
+        arg2 = amglue_SvU16(ST(1));
+      } else if (sizeof(size_t) == 4) {
+        arg2 = amglue_SvU32(ST(1));
+      } else if (sizeof(size_t) == 8) {
+        arg2 = amglue_SvU64(ST(1));
+      } else {
+        croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
+      }
+    }
+    {
+      arg3 = amglue_SvU64(ST(2));
+    }
+    {
+      arg4 = SvTRUE(ST(3));
+    }
+    result = (XferElement *)xfer_dest_taper_splitter(arg1,arg2,arg3,arg4);
+    {
+      ST(argvi) = sv_2mortal(new_sv_for_xfer_element(result));
+      argvi++;
+    }
+    
+    
+    
+    {
+      xfer_element_unref(result);
+    }
+    XSRETURN(argvi);
+  fail:
+    
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_xfer_dest_taper_cacher) {
   {
     Device *arg1 = (Device *) 0 ;
     size_t arg2 ;
@@ -1940,11 +1992,11 @@ XS(_wrap_xfer_dest_taper_splitter) {
     dXSARGS;
     
     if ((items < 5) || (items > 5)) {
-      SWIG_croak("Usage: xfer_dest_taper_splitter(first_device,max_memory,part_size,use_mem_cache,disk_cache_dirname);");
+      SWIG_croak("Usage: xfer_dest_taper_cacher(first_device,max_memory,part_size,use_mem_cache,disk_cache_dirname);");
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "xfer_dest_taper_splitter" "', argument " "1"" of type '" "Device *""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "xfer_dest_taper_cacher" "', argument " "1"" of type '" "Device *""'"); 
     }
     arg1 = (Device *)(argp1);
     {
@@ -1964,24 +2016,14 @@ XS(_wrap_xfer_dest_taper_splitter) {
       arg3 = amglue_SvU64(ST(2));
     }
     {
-      if (sizeof(signed int) == 1) {
-        arg4 = amglue_SvI8(ST(3));
-      } else if (sizeof(signed int) == 2) {
-        arg4 = amglue_SvI16(ST(3));
-      } else if (sizeof(signed int) == 4) {
-        arg4 = amglue_SvI32(ST(3));
-      } else if (sizeof(signed int) == 8) {
-        arg4 = amglue_SvI64(ST(3));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg4 = SvTRUE(ST(3));
     }
     res5 = SWIG_AsCharPtrAndSize(ST(4), &buf5, NULL, &alloc5);
     if (!SWIG_IsOK(res5)) {
-      SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "xfer_dest_taper_splitter" "', argument " "5"" of type '" "char const *""'");
+      SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "xfer_dest_taper_cacher" "', argument " "5"" of type '" "char const *""'");
     }
     arg5 = (char *)(buf5);
-    result = (XferElement *)xfer_dest_taper_splitter(arg1,arg2,arg3,arg4,(char const *)arg5);
+    result = (XferElement *)xfer_dest_taper_cacher(arg1,arg2,arg3,arg4,(char const *)arg5);
     {
       ST(argvi) = sv_2mortal(new_sv_for_xfer_element(result));
       argvi++;
@@ -2059,17 +2101,7 @@ XS(_wrap_xfer_dest_taper_start_part) {
       arg1 = xfer_element_from_sv(ST(0));
     }
     {
-      if (sizeof(signed int) == 1) {
-        arg2 = amglue_SvI8(ST(1));
-      } else if (sizeof(signed int) == 2) {
-        arg2 = amglue_SvI16(ST(1));
-      } else if (sizeof(signed int) == 4) {
-        arg2 = amglue_SvI32(ST(1));
-      } else if (sizeof(signed int) == 8) {
-        arg2 = amglue_SvI64(ST(1));
-      } else {
-        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
-      }
+      arg2 = SvTRUE(ST(1));
     }
     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_dumpfile_t, 0 |  0 );
     if (!SWIG_IsOK(res3)) {
@@ -2330,9 +2362,8 @@ static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0,
 static swig_type_info _swigt__p_dumpfile_t = {"_p_dumpfile_t", "dumpfile_t *", 0, 0, (void*)"Amanda::Header::Header", 0};
 static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_guint64 = {"_p_guint64", "guint64 *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_int = {"_p_int", "SizeAccuracy *|xmsg_type *|int *|DeviceAccessMode *|MediaAccessMode *|ConcurrencyParadigm *|filetype_t *|gboolean *|GIOCondition *|PropertySource *|DeviceStatusFlags *|PropertyAccessFlags *|PropertyPhaseFlags *|xfer_status *|PropertySurety *|StreamingRequirement *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "xmsg_type *|int *|DeviceAccessMode *|MediaAccessMode *|ConcurrencyParadigm *|filetype_t *|gboolean *|GIOCondition *|PropertySource *|DeviceStatusFlags *|PropertyAccessFlags *|PropertyPhaseFlags *|xfer_status *|PropertySurety *|StreamingRequirement *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_off_t = {"_p_off_t", "off_t *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_queue_fd_t = {"_p_queue_fd_t", "struct queue_fd_t *|queue_fd_t *", 0, 0, (void*)"Amanda::Device::queue_fd_t", 0};
 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
 
 static swig_type_info *swig_type_initial[] = {
@@ -2348,7 +2379,6 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_guint64,
   &_swigt__p_int,
   &_swigt__p_off_t,
-  &_swigt__p_queue_fd_t,
   &_swigt__p_unsigned_char,
 };
 
@@ -2364,7 +2394,6 @@ static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0,
 static swig_cast_info _swigc__p_guint64[] = {  {&_swigt__p_guint64, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_off_t[] = {  {&_swigt__p_off_t, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_queue_fd_t[] = {  {&_swigt__p_queue_fd_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
 
 static swig_cast_info *swig_cast_initial[] = {
@@ -2380,7 +2409,6 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_guint64,
   _swigc__p_int,
   _swigc__p_off_t,
-  _swigc__p_queue_fd_t,
   _swigc__p_unsigned_char,
 };
 
@@ -2401,6 +2429,7 @@ static swig_command_info swig_commands[] = {
 {"Amanda::XferServerc::xfer_dest_device", _wrap_xfer_dest_device},
 {"Amanda::XferServerc::xfer_source_holding", _wrap_xfer_source_holding},
 {"Amanda::XferServerc::xfer_dest_taper_splitter", _wrap_xfer_dest_taper_splitter},
+{"Amanda::XferServerc::xfer_dest_taper_cacher", _wrap_xfer_dest_taper_cacher},
 {"Amanda::XferServerc::xfer_dest_taper_directtcp", _wrap_xfer_dest_taper_directtcp},
 {"Amanda::XferServerc::xfer_dest_taper_start_part", _wrap_xfer_dest_taper_start_part},
 {"Amanda::XferServerc::xfer_dest_taper_use_device", _wrap_xfer_dest_taper_use_device},
index 859b2ec7213f19bdcf79f3b468e05ee53f096954..9ab00da0cebc30af6ff22ebc6d1718813c150b00 100644 (file)
@@ -57,6 +57,7 @@ package Amanda::XferServer;
 *xfer_dest_device = *Amanda::XferServerc::xfer_dest_device;
 *xfer_source_holding = *Amanda::XferServerc::xfer_source_holding;
 *xfer_dest_taper_splitter = *Amanda::XferServerc::xfer_dest_taper_splitter;
+*xfer_dest_taper_cacher = *Amanda::XferServerc::xfer_dest_taper_cacher;
 *xfer_dest_taper_directtcp = *Amanda::XferServerc::xfer_dest_taper_directtcp;
 *xfer_dest_taper_start_part = *Amanda::XferServerc::xfer_dest_taper_start_part;
 *xfer_dest_taper_use_device = *Amanda::XferServerc::xfer_dest_taper_use_device;
@@ -143,6 +144,18 @@ sub new {
     Amanda::XferServer::xfer_dest_taper_splitter(@_);
 }
 
+package Amanda::Xfer::Dest::Taper::Cacher;
+
+use vars qw(@ISA);
+@ISA = qw( Amanda::Xfer::Dest::Taper );
+
+sub new { 
+    my $pkg = shift;
+
+
+    Amanda::XferServer::xfer_dest_taper_cacher(@_);
+}
+
 package Amanda::Xfer::Dest::Taper::DirectTCP;
 
 use vars qw(@ISA);
index 22b98a0bd2e95753ea5370e4797201644a132715..becc5792d81b6b4381f556cb9be0483bc1d53f81 100644 (file)
@@ -41,7 +41,7 @@ XferElement *xfer_source_device(
 %newobject xfer_dest_device;
 XferElement *xfer_dest_device(
     Device *device,
-    size_t max_memory);
+    gboolean cancel_at_leom);
 
 %newobject xfer_source_holding;
 XferElement * xfer_source_holding(
@@ -49,6 +49,13 @@ XferElement * xfer_source_holding(
 
 %newobject xfer_dest_taper_splitter;
 XferElement *xfer_dest_taper_splitter(
+    Device *first_device,
+    size_t max_memory,
+    guint64 part_size,
+    gboolean expect_cache_inform);
+
+%newobject xfer_dest_taper_cacher;
+XferElement *xfer_dest_taper_cacher(
     Device *first_device,
     size_t max_memory,
     guint64 part_size,
@@ -124,6 +131,12 @@ DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_taper_splitter)
 
 /* ---- */
 
+PACKAGE(Amanda::Xfer::Dest::Taper::Cacher)
+XFER_ELEMENT_SUBCLASS_OF(Amanda::Xfer::Dest::Taper)
+DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_taper_cacher)
+
+/* ---- */
+
 PACKAGE(Amanda::Xfer::Dest::Taper::DirectTCP)
 XFER_ELEMENT_SUBCLASS_OF(Amanda::Xfer::Dest::Taper)
 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_taper_directtcp)
index 302bf3d9394d1957b12769e70940d08bd23ba0c2..ca02080eb141aeaad9624e7a761b947b796c0aee 100644 (file)
@@ -5,6 +5,9 @@
 include $(top_srcdir)/config/automake/vars.am
 include $(top_srcdir)/config/automake/scripts.am
 
+# build amglue *first*
+SUBDIRS = amglue .
+
 # add the SWIG symbol to avoid conflicts with perl definitions.
 # $AMANDA_WARNING_CFLAGS is omitted because SWIG-generated files tend
 # to trigger warnings.
@@ -38,24 +41,6 @@ endif
 
 # (amplot has a conditional, but doesn't have any header files)
 
-##
-## libamglue -- helper functions for gluing amanda to perl
-##
-
-amlib_LTLIBRARIES = libamglue.la
-libamglue_la_SOURCES = \
-       amglue/ghashtable.c \
-       amglue/gerror.c \
-       amglue/bigint.c \
-       amglue/source.c \
-       amglue/objwrap.c \
-       amglue/xferwrap.c \
-       amglue/amglue.h
-libamglue_la_LDFLAGS = $(PERL_EXT_LDFLAGS) -release $(VERSION)
-libamglue_la_LIBADD = \
-       $(top_builddir)/xfer-src/libamxfer.la
-EXTRA_DIST += $(libamglue_la_SOURCES)
-
 ##
 ## HTML Generation
 ##
@@ -83,7 +68,7 @@ PERL_EXT_LDFLAGS = -avoid-version -shared
 # threading library
 PERL_EXT_LDFLAGS += $(PERLEXTLIBS)
 
-# list our SWIG libraries.
+# list our SWIG libraries; these are %included from .swg files
 AMGLUE_SWG = amglue/amglue.swg \
        amglue/amglue.swg \
        amglue/constants.swg \
@@ -133,7 +118,7 @@ libArchivedir = $(amperldir)/auto/Amanda/Archive
 libArchive_LTLIBRARIES = libArchive.la
 libArchive_la_SOURCES = Amanda/Archive.c $(AMGLUE_SWG)
 libArchive_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libArchive_la_LIBADD = libamglue.la \
+libArchive_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/amar-src/libamar.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Archive.pm
@@ -150,7 +135,7 @@ libDevicedir = $(amperldir)/auto/Amanda/Device
 libDevice_LTLIBRARIES = libDevice.la
 libDevice_la_SOURCES = Amanda/Device.c $(AMGLUE_SWG)
 libDevice_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libDevice_la_LIBADD = libamglue.la \
+libDevice_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/device-src/libamdevice.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Device.pm
@@ -164,7 +149,7 @@ libLogfiledir = $(amperldir)/auto/Amanda/Logfile
 libLogfile_LTLIBRARIES = libLogfile.la
 libLogfile_la_SOURCES = Amanda/Logfile.c $(AMGLUE_SWG)
 libLogfile_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libLogfile_la_LIBADD = libamglue.la \
+libLogfile_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/server-src/libamserver.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Logfile.pm
@@ -178,7 +163,7 @@ libCmdlinedir = $(amperldir)/auto/Amanda/Cmdline
 libCmdline_LTLIBRARIES = libCmdline.la
 libCmdline_la_SOURCES = Amanda/Cmdline.c $(AMGLUE_SWG)
 libCmdline_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libCmdline_la_LIBADD = libamglue.la \
+libCmdline_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/server-src/libamserver.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Cmdline.pm
@@ -192,7 +177,7 @@ libTapelistdir = $(amperldir)/auto/Amanda/Tapelist
 libTapelist_LTLIBRARIES = libTapelist.la
 libTapelist_la_SOURCES = Amanda/Tapelist.c $(AMGLUE_SWG)
 libTapelist_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libTapelist_la_LIBADD = libamglue.la \
+libTapelist_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/server-src/libamserver.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Tapelist.pm
@@ -206,7 +191,7 @@ libDisklistdir = $(amperldir)/auto/Amanda/Disklist
 libDisklist_LTLIBRARIES = libDisklist.la
 libDisklist_la_SOURCES = Amanda/Disklist.c $(AMGLUE_SWG)
 libDisklist_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libDisklist_la_LIBADD = libamglue.la \
+libDisklist_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/server-src/libamserver.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Disklist.pm
@@ -220,7 +205,7 @@ libFeaturedir = $(amperldir)/auto/Amanda/Feature
 libFeature_LTLIBRARIES = libFeature.la
 libFeature_la_SOURCES = Amanda/Feature.c $(AMGLUE_SWG)
 libFeature_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libFeature_la_LIBADD = libamglue.la \
+libFeature_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Feature.pm
 MAINTAINERCLEANFILES += Amanda/Feature.c Amanda/Feature.pm
@@ -299,8 +284,11 @@ if WANT_SERVER
 # PACKAGE: Amanda::Taper::*
 AmandaTaperdir = $(amperldir)/Amanda/Taper
 AmandaTaper_DATA = \
+       Amanda/Taper/Controller.pm \
+       Amanda/Taper/Protocol.pm \
        Amanda/Taper/Scan.pm \
-       Amanda/Taper/Scribe.pm
+       Amanda/Taper/Scribe.pm \
+       Amanda/Taper/Worker.pm
 PM_FILES += $(AmandaTaper_DATA)
 endif
 EXTRA_DIST += $(AmandaTaper_DATA)
@@ -332,7 +320,7 @@ libXferdir = $(amperldir)/auto/Amanda/Xfer
 libXfer_LTLIBRARIES = libXfer.la
 libXfer_la_SOURCES = Amanda/Xfer.c $(AMGLUE_SWG)
 libXfer_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libXfer_la_LIBADD = libamglue.la \
+libXfer_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/xfer-src/libamxfer.la
 Amanda_DATA += Amanda/Xfer.pm
 MAINTAINERCLEANFILES += Amanda/Xfer.c Amanda/Xfer.pm
@@ -344,7 +332,7 @@ libNDMPdir = $(amperldir)/auto/Amanda/NDMP
 libNDMP_LTLIBRARIES = libNDMP.la
 libNDMP_la_SOURCES = Amanda/NDMP.c $(AMGLUE_SWG)
 libNDMP_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libNDMP_la_LIBADD = libamglue.la \
+libNDMP_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la \
        $(top_builddir)/ndmp-src/libndmlib.la
 Amanda_DATA += Amanda/NDMP.pm
@@ -358,7 +346,7 @@ libXferServerdir = $(amperldir)/auto/Amanda/XferServer
 libXferServer_LTLIBRARIES = libXferServer.la
 libXferServer_la_SOURCES = Amanda/XferServer.c $(AMGLUE_SWG)
 libXferServer_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libXferServer_la_LIBADD = libamglue.la \
+libXferServer_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/server-src/libamserver.la
 Amanda_DATA += Amanda/XferServer.pm
 MAINTAINERCLEANFILES += Amanda/XferServer.c Amanda/XferServer.pm
@@ -391,7 +379,7 @@ libDebugdir = $(amperldir)/auto/Amanda/Debug
 libDebug_LTLIBRARIES = libDebug.la
 libDebug_la_SOURCES = Amanda/Debug.c $(AMGLUE_SWG)
 libDebug_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libDebug_la_LIBADD = libamglue.la \
+libDebug_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Debug.pm
 EXTRA_DIST += Amanda/Debug.swg Amanda/Debug.pm Amanda/Debug.pod
@@ -402,18 +390,23 @@ libConfigdir = $(amperldir)/auto/Amanda/Config
 libConfig_LTLIBRARIES = libConfig.la
 libConfig_la_SOURCES = Amanda/Config.c $(AMGLUE_SWG)
 libConfig_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libConfig_la_LIBADD = libamglue.la \
+libConfig_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Config.pm
 EXTRA_DIST += Amanda/Config.swg Amanda/Config.pm Amanda/Config.pod
 MAINTAINERCLEANFILES += Amanda/Config.c Amanda/Config.pm
 
+# PACKAGE: Amanda::Config::*
+AmandaConfigdir = $(amperldir)/Amanda/Config
+AmandaConfig_DATA = Amanda/Config/FoldingHash.pm
+EXTRA_DIST += $(AmandaConfig_DATA)
+
 # PACKAGE: Amanda::Util
 libUtildir = $(amperldir)/auto/Amanda/Util
 libUtil_LTLIBRARIES = libUtil.la
 libUtil_la_SOURCES = Amanda/Util.c $(AMGLUE_SWG)
 libUtil_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libUtil_la_LIBADD = libamglue.la \
+libUtil_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Util.pm
 EXTRA_DIST += Amanda/Util.swg Amanda/Util.pm Amanda/Util.pod
@@ -424,7 +417,7 @@ libHeaderdir = $(amperldir)/auto/Amanda/Header
 libHeader_LTLIBRARIES = libHeader.la
 libHeader_la_SOURCES = Amanda/Header.c $(AMGLUE_SWG)
 libHeader_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libHeader_la_LIBADD = libamglue.la \
+libHeader_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Header.pm
 EXTRA_DIST += Amanda/Header.swg Amanda/Header.pm Amanda/Header.pod
@@ -435,7 +428,7 @@ libTestsdir = $(amperldir)/auto/Amanda/Tests
 libTests_LTLIBRARIES = libTests.la
 libTests_la_SOURCES = Amanda/Tests.c $(AMGLUE_SWG)
 libTests_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libTests_la_LIBADD = libamglue.la \
+libTests_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/Tests.pm
 EXTRA_DIST += Amanda/Tests.swg Amanda/Tests.pm Amanda/Tests.pod
@@ -446,7 +439,7 @@ libMainLoopdir = $(amperldir)/auto/Amanda/MainLoop
 libMainLoop_LTLIBRARIES = libMainLoop.la
 libMainLoop_la_SOURCES = Amanda/MainLoop.c $(AMGLUE_SWG)
 libMainLoop_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libMainLoop_la_LIBADD = libamglue.la \
+libMainLoop_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 Amanda_DATA += Amanda/MainLoop.pm
 EXTRA_DIST += Amanda/MainLoop.swg Amanda/MainLoop.pm Amanda/MainLoop.pod
@@ -463,7 +456,7 @@ libIPCBinarydir = $(amperldir)/auto/Amanda/IPC/Binary
 libIPCBinary_LTLIBRARIES = libBinary.la
 libBinary_la_SOURCES = Amanda/IPC/Binary.c $(AMGLUE_SWG)
 libBinary_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libBinary_la_LIBADD = libamglue.la \
+libBinary_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 AmandaIPC_DATA += Amanda/IPC/Binary.pm
 EXTRA_DIST += Amanda/IPC/Binary.swg Amanda/IPC/Binary.pm Amanda/IPC/Binary.pod
@@ -496,7 +489,7 @@ libApplicationdir = $(amperldir)/auto/Amanda/Application
 libApplication_LTLIBRARIES = libApplication.la
 libApplication_la_SOURCES = Amanda/Application.c $(AMGLUE_SWG)
 libApplication_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libApplication_la_LIBADD = libamglue.la \
+libApplication_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/client-src/libamclient.la
 Amanda_DATA += Amanda/Application.pm
 MAINTAINERCLEANFILES += Amanda/Application.c Amanda/Application.pm
@@ -526,28 +519,34 @@ install-data-hook:
        done
 endif
 
-check-local: syntax-check thread-check
-
-syntax-check:
+# only syntax-check the .pm files if SYNTAX_CHECKS are enabled
+check-pm:
        @MODULES_TO_CHECK="$(PM_FILES)"; \
        if test -f $(top_builddir)/perl/.libs/libConfig.so -o -f $(top_builddir)/perl/libConfig.so; then \
-               if test -n "$(PERL)"; then \
-                       for perlobj in $$MODULES_TO_CHECK; do \
-                               if test -f $$perlobj; then \
-                                       $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -T $$perlobj || exit 1; \
-                               else \
-                                       $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -T $(top_srcdir)/perl/$$perlobj || exit 1; \
-                               fi \
-                       done; \
+           for perlobj in $$MODULES_TO_CHECK; do \
+               if test -f $$perlobj; then \
+                   $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -T $$perlobj || exit 1; \
+               else \
+                   $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -T $(top_srcdir)/perl/$$perlobj || exit 1; \
                fi \
+           done; \
         fi
+if SYNTAX_CHECKS
+check-local: check-pm
+endif
+
+if WANT_MANDATORY_THREAD_CHECK
+install-data-local: thread-check
+else
+installcheck-local: thread-check
+endif
 
 if WANT_SERVER
 thread-check: libTests.la
        $(PERL) -I$(builddir) -I$(builddir)/.libs -I$(srcdir) \
                        -MAmanda::Tests -e 'alarm(10); Amanda::Tests::try_threads' \
-       || echo "Perl cannot run extensions which use threads; consider linking perl" \
-               "with -pthreads or compiling perl with threading enabled"
+       || echo "Perl cannot run extensions which use threads; consider linking perl" \
+               "with -pthread or compiling perl with threading enabled"; false; }
 else
 thread-check:
        @echo "skipping thread check: server component not being built"
index 8fd004230a74eab2b5f5c3fd812cd54f75c376ab..90090d83f2863d8fb840725525d392b5532aaea5 100644 (file)
@@ -190,7 +190,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -218,7 +217,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -231,10 +229,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -248,7 +250,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -261,10 +265,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -276,21 +283,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -340,34 +351,34 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(amlibdir)" \
-       "$(DESTDIR)$(libApplicationdir)" "$(DESTDIR)$(libArchivedir)" \
-       "$(DESTDIR)$(libCmdlinedir)" "$(DESTDIR)$(libConfigdir)" \
-       "$(DESTDIR)$(libDebugdir)" "$(DESTDIR)$(libDevicedir)" \
-       "$(DESTDIR)$(libDisklistdir)" "$(DESTDIR)$(libFeaturedir)" \
-       "$(DESTDIR)$(libHeaderdir)" "$(DESTDIR)$(libIPCBinarydir)" \
-       "$(DESTDIR)$(libLogfiledir)" "$(DESTDIR)$(libMainLoopdir)" \
-       "$(DESTDIR)$(libNDMPdir)" "$(DESTDIR)$(libTapelistdir)" \
-       "$(DESTDIR)$(libTestsdir)" "$(DESTDIR)$(libUtildir)" \
-       "$(DESTDIR)$(libXferdir)" "$(DESTDIR)$(libXferServerdir)" \
-       "$(DESTDIR)$(Amandadir)" "$(DESTDIR)$(AmandaApplicationdir)" \
-       "$(DESTDIR)$(AmandaChangerdir)" \
+am__installdirs = "$(DESTDIR)$(libApplicationdir)" \
+       "$(DESTDIR)$(libArchivedir)" "$(DESTDIR)$(libCmdlinedir)" \
+       "$(DESTDIR)$(libConfigdir)" "$(DESTDIR)$(libDebugdir)" \
+       "$(DESTDIR)$(libDevicedir)" "$(DESTDIR)$(libDisklistdir)" \
+       "$(DESTDIR)$(libFeaturedir)" "$(DESTDIR)$(libHeaderdir)" \
+       "$(DESTDIR)$(libIPCBinarydir)" "$(DESTDIR)$(libLogfiledir)" \
+       "$(DESTDIR)$(libMainLoopdir)" "$(DESTDIR)$(libNDMPdir)" \
+       "$(DESTDIR)$(libTapelistdir)" "$(DESTDIR)$(libTestsdir)" \
+       "$(DESTDIR)$(libUtildir)" "$(DESTDIR)$(libXferdir)" \
+       "$(DESTDIR)$(libXferServerdir)" "$(DESTDIR)$(Amandadir)" \
+       "$(DESTDIR)$(AmandaApplicationdir)" \
+       "$(DESTDIR)$(AmandaChangerdir)" "$(DESTDIR)$(AmandaConfigdir)" \
        "$(DESTDIR)$(AmandaCurinfodir)" "$(DESTDIR)$(AmandaIPCdir)" \
        "$(DESTDIR)$(AmandaInteractivedir)" \
        "$(DESTDIR)$(AmandaRecoverydir)" \
        "$(DESTDIR)$(AmandaReportdir)" "$(DESTDIR)$(AmandaTaperdir)" \
        "$(DESTDIR)$(AmandaTaperScandir)" "$(DESTDIR)$(Amanda_DBdir)"
-LTLIBRARIES = $(amlib_LTLIBRARIES) $(libApplication_LTLIBRARIES) \
-       $(libArchive_LTLIBRARIES) $(libCmdline_LTLIBRARIES) \
-       $(libConfig_LTLIBRARIES) $(libDebug_LTLIBRARIES) \
-       $(libDevice_LTLIBRARIES) $(libDisklist_LTLIBRARIES) \
-       $(libFeature_LTLIBRARIES) $(libHeader_LTLIBRARIES) \
-       $(libIPCBinary_LTLIBRARIES) $(libLogfile_LTLIBRARIES) \
-       $(libMainLoop_LTLIBRARIES) $(libNDMP_LTLIBRARIES) \
-       $(libTapelist_LTLIBRARIES) $(libTests_LTLIBRARIES) \
-       $(libUtil_LTLIBRARIES) $(libXfer_LTLIBRARIES) \
-       $(libXferServer_LTLIBRARIES)
-@WANT_CLIENT_TRUE@libApplication_la_DEPENDENCIES = libamglue.la \
+LTLIBRARIES = $(libApplication_LTLIBRARIES) $(libArchive_LTLIBRARIES) \
+       $(libCmdline_LTLIBRARIES) $(libConfig_LTLIBRARIES) \
+       $(libDebug_LTLIBRARIES) $(libDevice_LTLIBRARIES) \
+       $(libDisklist_LTLIBRARIES) $(libFeature_LTLIBRARIES) \
+       $(libHeader_LTLIBRARIES) $(libIPCBinary_LTLIBRARIES) \
+       $(libLogfile_LTLIBRARIES) $(libMainLoop_LTLIBRARIES) \
+       $(libNDMP_LTLIBRARIES) $(libTapelist_LTLIBRARIES) \
+       $(libTests_LTLIBRARIES) $(libUtil_LTLIBRARIES) \
+       $(libXfer_LTLIBRARIES) $(libXferServer_LTLIBRARIES)
+@WANT_CLIENT_TRUE@libApplication_la_DEPENDENCIES =  \
+@WANT_CLIENT_TRUE@     amglue/libamglue.la \
 @WANT_CLIENT_TRUE@     $(top_builddir)/client-src/libamclient.la
 am__libApplication_la_SOURCES_DIST = Amanda/Application.c \
        amglue/amglue.swg amglue/constants.swg amglue/directtcp.swg \
@@ -382,7 +393,7 @@ libApplication_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(libApplication_la_LDFLAGS) $(LDFLAGS) -o $@
 @WANT_CLIENT_TRUE@am_libApplication_la_rpath = -rpath \
 @WANT_CLIENT_TRUE@     $(libApplicationdir)
-libArchive_la_DEPENDENCIES = libamglue.la \
+libArchive_la_DEPENDENCIES = amglue/libamglue.la \
        $(top_builddir)/amar-src/libamar.la \
        $(top_builddir)/common-src/libamanda.la
 am_libArchive_la_OBJECTS = Archive.lo $(am__objects_1)
@@ -390,14 +401,14 @@ libArchive_la_OBJECTS = $(am_libArchive_la_OBJECTS)
 libArchive_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libArchive_la_LDFLAGS) $(LDFLAGS) -o $@
-libBinary_la_DEPENDENCIES = libamglue.la \
+libBinary_la_DEPENDENCIES = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 am_libBinary_la_OBJECTS = Binary.lo $(am__objects_1)
 libBinary_la_OBJECTS = $(am_libBinary_la_OBJECTS)
 libBinary_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libBinary_la_LDFLAGS) $(LDFLAGS) -o $@
-@WANT_SERVER_TRUE@libCmdline_la_DEPENDENCIES = libamglue.la \
+@WANT_SERVER_TRUE@libCmdline_la_DEPENDENCIES = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
 am__libCmdline_la_SOURCES_DIST = Amanda/Cmdline.c amglue/amglue.swg \
@@ -411,21 +422,21 @@ libCmdline_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libCmdline_la_LDFLAGS) $(LDFLAGS) -o $@
 @WANT_SERVER_TRUE@am_libCmdline_la_rpath = -rpath $(libCmdlinedir)
-libConfig_la_DEPENDENCIES = libamglue.la \
+libConfig_la_DEPENDENCIES = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 am_libConfig_la_OBJECTS = Config.lo $(am__objects_1)
 libConfig_la_OBJECTS = $(am_libConfig_la_OBJECTS)
 libConfig_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libConfig_la_LDFLAGS) $(LDFLAGS) -o $@
-libDebug_la_DEPENDENCIES = libamglue.la \
+libDebug_la_DEPENDENCIES = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 am_libDebug_la_OBJECTS = Debug.lo $(am__objects_1)
 libDebug_la_OBJECTS = $(am_libDebug_la_OBJECTS)
 libDebug_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libDebug_la_LDFLAGS) $(LDFLAGS) -o $@
-@WANT_SERVER_TRUE@libDevice_la_DEPENDENCIES = libamglue.la \
+@WANT_SERVER_TRUE@libDevice_la_DEPENDENCIES = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/device-src/libamdevice.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
 am__libDevice_la_SOURCES_DIST = Amanda/Device.c amglue/amglue.swg \
@@ -438,7 +449,7 @@ libDevice_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libDevice_la_LDFLAGS) $(LDFLAGS) -o $@
 @WANT_SERVER_TRUE@am_libDevice_la_rpath = -rpath $(libDevicedir)
-@WANT_SERVER_TRUE@libDisklist_la_DEPENDENCIES = libamglue.la \
+@WANT_SERVER_TRUE@libDisklist_la_DEPENDENCIES = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
 am__libDisklist_la_SOURCES_DIST = Amanda/Disklist.c amglue/amglue.swg \
@@ -452,21 +463,21 @@ libDisklist_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libDisklist_la_LDFLAGS) $(LDFLAGS) -o $@
 @WANT_SERVER_TRUE@am_libDisklist_la_rpath = -rpath $(libDisklistdir)
-libFeature_la_DEPENDENCIES = libamglue.la \
+libFeature_la_DEPENDENCIES = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 am_libFeature_la_OBJECTS = Feature.lo $(am__objects_1)
 libFeature_la_OBJECTS = $(am_libFeature_la_OBJECTS)
 libFeature_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libFeature_la_LDFLAGS) $(LDFLAGS) -o $@
-libHeader_la_DEPENDENCIES = libamglue.la \
+libHeader_la_DEPENDENCIES = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 am_libHeader_la_OBJECTS = Header.lo $(am__objects_1)
 libHeader_la_OBJECTS = $(am_libHeader_la_OBJECTS)
 libHeader_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libHeader_la_LDFLAGS) $(LDFLAGS) -o $@
-@WANT_SERVER_TRUE@libLogfile_la_DEPENDENCIES = libamglue.la \
+@WANT_SERVER_TRUE@libLogfile_la_DEPENDENCIES = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
 am__libLogfile_la_SOURCES_DIST = Amanda/Logfile.c amglue/amglue.swg \
@@ -480,14 +491,14 @@ libLogfile_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libLogfile_la_LDFLAGS) $(LDFLAGS) -o $@
 @WANT_SERVER_TRUE@am_libLogfile_la_rpath = -rpath $(libLogfiledir)
-libMainLoop_la_DEPENDENCIES = libamglue.la \
+libMainLoop_la_DEPENDENCIES = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 am_libMainLoop_la_OBJECTS = MainLoop.lo $(am__objects_1)
 libMainLoop_la_OBJECTS = $(am_libMainLoop_la_OBJECTS)
 libMainLoop_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libMainLoop_la_LDFLAGS) $(LDFLAGS) -o $@
-@WANT_NDMP_TRUE@libNDMP_la_DEPENDENCIES = libamglue.la \
+@WANT_NDMP_TRUE@libNDMP_la_DEPENDENCIES = amglue/libamglue.la \
 @WANT_NDMP_TRUE@       $(top_builddir)/common-src/libamanda.la \
 @WANT_NDMP_TRUE@       $(top_builddir)/ndmp-src/libndmlib.la
 am__libNDMP_la_SOURCES_DIST = Amanda/NDMP.c amglue/amglue.swg \
@@ -500,7 +511,7 @@ libNDMP_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libNDMP_la_LDFLAGS) $(LDFLAGS) -o $@
 @WANT_NDMP_TRUE@am_libNDMP_la_rpath = -rpath $(libNDMPdir)
-@WANT_SERVER_TRUE@libTapelist_la_DEPENDENCIES = libamglue.la \
+@WANT_SERVER_TRUE@libTapelist_la_DEPENDENCIES = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
 am__libTapelist_la_SOURCES_DIST = Amanda/Tapelist.c amglue/amglue.swg \
@@ -514,28 +525,28 @@ libTapelist_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libTapelist_la_LDFLAGS) $(LDFLAGS) -o $@
 @WANT_SERVER_TRUE@am_libTapelist_la_rpath = -rpath $(libTapelistdir)
-libTests_la_DEPENDENCIES = libamglue.la \
+libTests_la_DEPENDENCIES = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 am_libTests_la_OBJECTS = Tests.lo $(am__objects_1)
 libTests_la_OBJECTS = $(am_libTests_la_OBJECTS)
 libTests_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libTests_la_LDFLAGS) $(LDFLAGS) -o $@
-libUtil_la_DEPENDENCIES = libamglue.la \
+libUtil_la_DEPENDENCIES = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 am_libUtil_la_OBJECTS = Util.lo $(am__objects_1)
 libUtil_la_OBJECTS = $(am_libUtil_la_OBJECTS)
 libUtil_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libUtil_la_LDFLAGS) $(LDFLAGS) -o $@
-libXfer_la_DEPENDENCIES = libamglue.la \
+libXfer_la_DEPENDENCIES = amglue/libamglue.la \
        $(top_builddir)/xfer-src/libamxfer.la
 am_libXfer_la_OBJECTS = Xfer.lo $(am__objects_1)
 libXfer_la_OBJECTS = $(am_libXfer_la_OBJECTS)
 libXfer_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libXfer_la_LDFLAGS) $(LDFLAGS) -o $@
-@WANT_SERVER_TRUE@libXferServer_la_DEPENDENCIES = libamglue.la \
+@WANT_SERVER_TRUE@libXferServer_la_DEPENDENCIES = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la
 am__libXferServer_la_SOURCES_DIST = Amanda/XferServer.c \
        amglue/amglue.swg amglue/constants.swg amglue/directtcp.swg \
@@ -549,13 +560,6 @@ libXferServer_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(libXferServer_la_LDFLAGS) $(LDFLAGS) -o $@
 @WANT_SERVER_TRUE@am_libXferServer_la_rpath = -rpath \
 @WANT_SERVER_TRUE@     $(libXferServerdir)
-libamglue_la_DEPENDENCIES = $(top_builddir)/xfer-src/libamxfer.la
-am_libamglue_la_OBJECTS = ghashtable.lo gerror.lo bigint.lo source.lo \
-       objwrap.lo xferwrap.lo
-libamglue_la_OBJECTS = $(am_libamglue_la_OBJECTS)
-libamglue_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(libamglue_la_LDFLAGS) $(LDFLAGS) -o $@
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
@@ -577,8 +581,7 @@ SOURCES = $(libApplication_la_SOURCES) $(libArchive_la_SOURCES) \
        $(libLogfile_la_SOURCES) $(libMainLoop_la_SOURCES) \
        $(libNDMP_la_SOURCES) $(libTapelist_la_SOURCES) \
        $(libTests_la_SOURCES) $(libUtil_la_SOURCES) \
-       $(libXfer_la_SOURCES) $(libXferServer_la_SOURCES) \
-       $(libamglue_la_SOURCES)
+       $(libXfer_la_SOURCES) $(libXferServer_la_SOURCES)
 DIST_SOURCES = $(am__libApplication_la_SOURCES_DIST) \
        $(libArchive_la_SOURCES) $(libBinary_la_SOURCES) \
        $(am__libCmdline_la_SOURCES_DIST) $(libConfig_la_SOURCES) \
@@ -588,15 +591,53 @@ DIST_SOURCES = $(am__libApplication_la_SOURCES_DIST) \
        $(libMainLoop_la_SOURCES) $(am__libNDMP_la_SOURCES_DIST) \
        $(am__libTapelist_la_SOURCES_DIST) $(libTests_la_SOURCES) \
        $(libUtil_la_SOURCES) $(libXfer_la_SOURCES) \
-       $(am__libXferServer_la_SOURCES_DIST) $(libamglue_la_SOURCES)
+       $(am__libXferServer_la_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-dvi-recursive install-exec-recursive \
+       install-html-recursive install-info-recursive \
+       install-pdf-recursive install-ps-recursive install-recursive \
+       installcheck-recursive installdirs-recursive pdf-recursive \
+       ps-recursive uninstall-recursive
 DATA = $(Amanda_DATA) $(AmandaApplication_DATA) $(AmandaChanger_DATA) \
-       $(AmandaCurinfo_DATA) $(AmandaIPC_DATA) \
+       $(AmandaConfig_DATA) $(AmandaCurinfo_DATA) $(AmandaIPC_DATA) \
        $(AmandaInteractive_DATA) $(AmandaRecovery_DATA) \
        $(AmandaReport_DATA) $(AmandaTaper_DATA) \
        $(AmandaTaperScan_DATA) $(Amanda_DB_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+       distdir
 ETAGS = etags
 CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
 AIX_BACKUP = @AIX_BACKUP@
 ALLOCA = @ALLOCA@
@@ -618,7 +659,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -638,10 +679,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -697,78 +735,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -779,12 +872,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -799,17 +921,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -818,60 +944,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -879,13 +1064,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -894,9 +1085,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -932,7 +1126,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -941,7 +1134,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -949,19 +1141,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -987,47 +1202,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -1035,6 +1306,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -1057,19 +1329,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -1079,13 +1353,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -1129,6 +1400,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -1159,23 +1431,23 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUFFIXES = 
-EXTRA_DIST = $(libamglue_la_SOURCES) $(AMGLUE_SWG) Amanda/Archive.swg \
-       Amanda/Archive.pm Amanda/Archive.pod Amanda/Process.pm \
-       Amanda/Device.swg Amanda/Device.pm Amanda/Device.pod \
-       Amanda/Logfile.swg Amanda/Logfile.pm Amanda/Logfile.pod \
-       Amanda/Cmdline.swg Amanda/Cmdline.pm Amanda/Cmdline.pod \
-       Amanda/Tapelist.swg Amanda/Tapelist.pm Amanda/Tapelist.pod \
-       Amanda/Disklist.swg Amanda/Disklist.pm Amanda/Disklist.pod \
-       Amanda/Feature.swg Amanda/Feature.pm Amanda/Feature.pod \
-       Amanda/Interactive.pm Amanda/ClientService.pm \
-       $(AmandaInteractive_DATA) Amanda/Changer.pm \
-       $(AmandaChanger_DATA) Amanda/Curinfo.pm $(AmandaCurinfo_DATA) \
-       $(AmandaRecovery_DATA) $(AmandaTaper_DATA) \
-       $(AmandaTaperScan_DATA) Amanda/DB/Catalog.pm Amanda/Xfer.swg \
-       Amanda/Xfer.pm Amanda/Xfer.pod $(am__append_12) \
-       $(am__append_15) Amanda/BigIntCompat.pm Amanda/Debug.swg \
-       Amanda/Debug.pm Amanda/Debug.pod Amanda/Config.swg \
-       Amanda/Config.pm Amanda/Config.pod Amanda/Util.swg \
+EXTRA_DIST = $(AMGLUE_SWG) Amanda/Archive.swg Amanda/Archive.pm \
+       Amanda/Archive.pod Amanda/Process.pm Amanda/Device.swg \
+       Amanda/Device.pm Amanda/Device.pod Amanda/Logfile.swg \
+       Amanda/Logfile.pm Amanda/Logfile.pod Amanda/Cmdline.swg \
+       Amanda/Cmdline.pm Amanda/Cmdline.pod Amanda/Tapelist.swg \
+       Amanda/Tapelist.pm Amanda/Tapelist.pod Amanda/Disklist.swg \
+       Amanda/Disklist.pm Amanda/Disklist.pod Amanda/Feature.swg \
+       Amanda/Feature.pm Amanda/Feature.pod Amanda/Interactive.pm \
+       Amanda/ClientService.pm $(AmandaInteractive_DATA) \
+       Amanda/Changer.pm $(AmandaChanger_DATA) Amanda/Curinfo.pm \
+       $(AmandaCurinfo_DATA) $(AmandaRecovery_DATA) \
+       $(AmandaTaper_DATA) $(AmandaTaperScan_DATA) \
+       Amanda/DB/Catalog.pm Amanda/Xfer.swg Amanda/Xfer.pm \
+       Amanda/Xfer.pod $(am__append_12) $(am__append_15) \
+       Amanda/BigIntCompat.pm Amanda/Debug.swg Amanda/Debug.pm \
+       Amanda/Debug.pod Amanda/Config.swg Amanda/Config.pm \
+       Amanda/Config.pod $(AmandaConfig_DATA) Amanda/Util.swg \
        Amanda/Util.pm Amanda/Util.pod Amanda/Header.swg \
        Amanda/Header.pm Amanda/Header.pod Amanda/Tests.swg \
        Amanda/Tests.pm Amanda/Tests.pod Amanda/MainLoop.swg \
@@ -1204,6 +1476,9 @@ MAINTAINERCLEANFILES = Amanda/Archive.c Amanda/Archive.pm \
        Amanda/MainLoop.c Amanda/MainLoop.pm Amanda/IPC/Binary.c \
        Amanda/IPC/Binary.pm $(am__append_18)
 
+# build amglue *first*
+SUBDIRS = amglue .
+
 # add the SWIG symbol to avoid conflicts with perl definitions.
 # $AMANDA_WARNING_CFLAGS is omitted because SWIG-generated files tend
 # to trigger warnings.
@@ -1217,22 +1492,6 @@ INCLUDES = -I$(top_builddir)/common-src -I$(top_srcdir)/common-src \
        -I$(top_srcdir)/gnulib -I$(top_srcdir)/ndmp-src $(PERL_INC) \
        $(am__append_1) $(am__append_2) $(am__append_3)
 
-# (amplot has a conditional, but doesn't have any header files)
-amlib_LTLIBRARIES = libamglue.la
-libamglue_la_SOURCES = \
-       amglue/ghashtable.c \
-       amglue/gerror.c \
-       amglue/bigint.c \
-       amglue/source.c \
-       amglue/objwrap.c \
-       amglue/xferwrap.c \
-       amglue/amglue.h
-
-libamglue_la_LDFLAGS = $(PERL_EXT_LDFLAGS) -release $(VERSION)
-libamglue_la_LIBADD = \
-       $(top_builddir)/xfer-src/libamxfer.la
-
-
 # Tell libtool to not bother versioning the libs we build, since perl won't
 # pay attention to such things, anyway.
 
@@ -1240,7 +1499,7 @@ libamglue_la_LIBADD = \
 # threading library
 PERL_EXT_LDFLAGS = -avoid-version -shared $(PERLEXTLIBS)
 
-# list our SWIG libraries.
+# list our SWIG libraries; these are %included from .swg files
 AMGLUE_SWG = amglue/amglue.swg \
        amglue/amglue.swg \
        amglue/constants.swg \
@@ -1297,7 +1556,7 @@ libArchivedir = $(amperldir)/auto/Amanda/Archive
 libArchive_LTLIBRARIES = libArchive.la
 libArchive_la_SOURCES = Amanda/Archive.c $(AMGLUE_SWG)
 libArchive_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libArchive_la_LIBADD = libamglue.la \
+libArchive_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/amar-src/libamar.la \
        $(top_builddir)/common-src/libamanda.la
 
@@ -1307,7 +1566,7 @@ libArchive_la_LIBADD = libamglue.la \
 @WANT_SERVER_TRUE@libDevice_LTLIBRARIES = libDevice.la
 @WANT_SERVER_TRUE@libDevice_la_SOURCES = Amanda/Device.c $(AMGLUE_SWG)
 @WANT_SERVER_TRUE@libDevice_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-@WANT_SERVER_TRUE@libDevice_la_LIBADD = libamglue.la \
+@WANT_SERVER_TRUE@libDevice_la_LIBADD = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/device-src/libamdevice.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
 
@@ -1317,7 +1576,7 @@ libArchive_la_LIBADD = libamglue.la \
 @WANT_SERVER_TRUE@libLogfile_LTLIBRARIES = libLogfile.la
 @WANT_SERVER_TRUE@libLogfile_la_SOURCES = Amanda/Logfile.c $(AMGLUE_SWG)
 @WANT_SERVER_TRUE@libLogfile_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-@WANT_SERVER_TRUE@libLogfile_la_LIBADD = libamglue.la \
+@WANT_SERVER_TRUE@libLogfile_la_LIBADD = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
 
@@ -1327,7 +1586,7 @@ libArchive_la_LIBADD = libamglue.la \
 @WANT_SERVER_TRUE@libCmdline_LTLIBRARIES = libCmdline.la
 @WANT_SERVER_TRUE@libCmdline_la_SOURCES = Amanda/Cmdline.c $(AMGLUE_SWG)
 @WANT_SERVER_TRUE@libCmdline_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-@WANT_SERVER_TRUE@libCmdline_la_LIBADD = libamglue.la \
+@WANT_SERVER_TRUE@libCmdline_la_LIBADD = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
 
@@ -1337,7 +1596,7 @@ libArchive_la_LIBADD = libamglue.la \
 @WANT_SERVER_TRUE@libTapelist_LTLIBRARIES = libTapelist.la
 @WANT_SERVER_TRUE@libTapelist_la_SOURCES = Amanda/Tapelist.c $(AMGLUE_SWG)
 @WANT_SERVER_TRUE@libTapelist_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-@WANT_SERVER_TRUE@libTapelist_la_LIBADD = libamglue.la \
+@WANT_SERVER_TRUE@libTapelist_la_LIBADD = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
 
@@ -1347,7 +1606,7 @@ libArchive_la_LIBADD = libamglue.la \
 @WANT_SERVER_TRUE@libDisklist_LTLIBRARIES = libDisklist.la
 @WANT_SERVER_TRUE@libDisklist_la_SOURCES = Amanda/Disklist.c $(AMGLUE_SWG)
 @WANT_SERVER_TRUE@libDisklist_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-@WANT_SERVER_TRUE@libDisklist_la_LIBADD = libamglue.la \
+@WANT_SERVER_TRUE@libDisklist_la_LIBADD = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
 
@@ -1355,7 +1614,7 @@ libFeaturedir = $(amperldir)/auto/Amanda/Feature
 libFeature_LTLIBRARIES = libFeature.la
 libFeature_la_SOURCES = Amanda/Feature.c $(AMGLUE_SWG)
 libFeature_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libFeature_la_LIBADD = libamglue.la \
+libFeature_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 
 
@@ -1392,8 +1651,11 @@ libFeature_la_LIBADD = libamglue.la \
 # PACKAGE: Amanda::Taper::*
 @WANT_SERVER_TRUE@AmandaTaperdir = $(amperldir)/Amanda/Taper
 @WANT_SERVER_TRUE@AmandaTaper_DATA = \
+@WANT_SERVER_TRUE@     Amanda/Taper/Controller.pm \
+@WANT_SERVER_TRUE@     Amanda/Taper/Protocol.pm \
 @WANT_SERVER_TRUE@     Amanda/Taper/Scan.pm \
-@WANT_SERVER_TRUE@     Amanda/Taper/Scribe.pm
+@WANT_SERVER_TRUE@     Amanda/Taper/Scribe.pm \
+@WANT_SERVER_TRUE@     Amanda/Taper/Worker.pm
 
 
 # PACKAGE: Amanda::Taper::Scan::*
@@ -1413,7 +1675,7 @@ libXferdir = $(amperldir)/auto/Amanda/Xfer
 libXfer_LTLIBRARIES = libXfer.la
 libXfer_la_SOURCES = Amanda/Xfer.c $(AMGLUE_SWG)
 libXfer_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libXfer_la_LIBADD = libamglue.la \
+libXfer_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/xfer-src/libamxfer.la
 
 
@@ -1422,7 +1684,7 @@ libXfer_la_LIBADD = libamglue.la \
 @WANT_NDMP_TRUE@libNDMP_LTLIBRARIES = libNDMP.la
 @WANT_NDMP_TRUE@libNDMP_la_SOURCES = Amanda/NDMP.c $(AMGLUE_SWG)
 @WANT_NDMP_TRUE@libNDMP_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-@WANT_NDMP_TRUE@libNDMP_la_LIBADD = libamglue.la \
+@WANT_NDMP_TRUE@libNDMP_la_LIBADD = amglue/libamglue.la \
 @WANT_NDMP_TRUE@       $(top_builddir)/common-src/libamanda.la \
 @WANT_NDMP_TRUE@       $(top_builddir)/ndmp-src/libndmlib.la
 
@@ -1432,7 +1694,7 @@ libXfer_la_LIBADD = libamglue.la \
 @WANT_SERVER_TRUE@libXferServer_LTLIBRARIES = libXferServer.la
 @WANT_SERVER_TRUE@libXferServer_la_SOURCES = Amanda/XferServer.c $(AMGLUE_SWG)
 @WANT_SERVER_TRUE@libXferServer_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-@WANT_SERVER_TRUE@libXferServer_la_LIBADD = libamglue.la \
+@WANT_SERVER_TRUE@libXferServer_la_LIBADD = amglue/libamglue.la \
 @WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la
 
 
@@ -1449,7 +1711,7 @@ libDebugdir = $(amperldir)/auto/Amanda/Debug
 libDebug_LTLIBRARIES = libDebug.la
 libDebug_la_SOURCES = Amanda/Debug.c $(AMGLUE_SWG)
 libDebug_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libDebug_la_LIBADD = libamglue.la \
+libDebug_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 
 
@@ -1458,16 +1720,20 @@ libConfigdir = $(amperldir)/auto/Amanda/Config
 libConfig_LTLIBRARIES = libConfig.la
 libConfig_la_SOURCES = Amanda/Config.c $(AMGLUE_SWG)
 libConfig_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libConfig_la_LIBADD = libamglue.la \
+libConfig_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 
 
+# PACKAGE: Amanda::Config::*
+AmandaConfigdir = $(amperldir)/Amanda/Config
+AmandaConfig_DATA = Amanda/Config/FoldingHash.pm
+
 # PACKAGE: Amanda::Util
 libUtildir = $(amperldir)/auto/Amanda/Util
 libUtil_LTLIBRARIES = libUtil.la
 libUtil_la_SOURCES = Amanda/Util.c $(AMGLUE_SWG)
 libUtil_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libUtil_la_LIBADD = libamglue.la \
+libUtil_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 
 
@@ -1476,7 +1742,7 @@ libHeaderdir = $(amperldir)/auto/Amanda/Header
 libHeader_LTLIBRARIES = libHeader.la
 libHeader_la_SOURCES = Amanda/Header.c $(AMGLUE_SWG)
 libHeader_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libHeader_la_LIBADD = libamglue.la \
+libHeader_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 
 
@@ -1485,7 +1751,7 @@ libTestsdir = $(amperldir)/auto/Amanda/Tests
 libTests_LTLIBRARIES = libTests.la
 libTests_la_SOURCES = Amanda/Tests.c $(AMGLUE_SWG)
 libTests_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libTests_la_LIBADD = libamglue.la \
+libTests_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 
 
@@ -1494,7 +1760,7 @@ libMainLoopdir = $(amperldir)/auto/Amanda/MainLoop
 libMainLoop_LTLIBRARIES = libMainLoop.la
 libMainLoop_la_SOURCES = Amanda/MainLoop.c $(AMGLUE_SWG)
 libMainLoop_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libMainLoop_la_LIBADD = libamglue.la \
+libMainLoop_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 
 
@@ -1507,7 +1773,7 @@ libIPCBinarydir = $(amperldir)/auto/Amanda/IPC/Binary
 libIPCBinary_LTLIBRARIES = libBinary.la
 libBinary_la_SOURCES = Amanda/IPC/Binary.c $(AMGLUE_SWG)
 libBinary_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-libBinary_la_LIBADD = libamglue.la \
+libBinary_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 
 
@@ -1516,7 +1782,7 @@ libBinary_la_LIBADD = libamglue.la \
 @WANT_CLIENT_TRUE@libApplication_LTLIBRARIES = libApplication.la
 @WANT_CLIENT_TRUE@libApplication_la_SOURCES = Amanda/Application.c $(AMGLUE_SWG)
 @WANT_CLIENT_TRUE@libApplication_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
-@WANT_CLIENT_TRUE@libApplication_la_LIBADD = libamglue.la \
+@WANT_CLIENT_TRUE@libApplication_la_LIBADD = amglue/libamglue.la \
 @WANT_CLIENT_TRUE@     $(top_builddir)/client-src/libamclient.la
 
 
@@ -1528,7 +1794,7 @@ libBinary_la_LIBADD = libamglue.la \
 # directory, dll must be copied to their modules directories.
 @WANT_CYGWIN_COPY_PERL_DLL_TRUE@amperldirauto = "$(DESTDIR)$(amperldir)/auto/Amanda"
 all: $(BUILT_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) all-am
+       $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
 .SUFFIXES: .c .lo .o .obj
@@ -1562,37 +1828,6 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES)
-       @$(NORMAL_INSTALL)
-       test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)"
-       @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || list=; \
-       list2=; for p in $$list; do \
-         if test -f $$p; then \
-           list2="$$list2 $$p"; \
-         else :; fi; \
-       done; \
-       test -z "$$list2" || { \
-         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(amlibdir)'"; \
-         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(amlibdir)"; \
-       }
-
-uninstall-amlibLTLIBRARIES:
-       @$(NORMAL_UNINSTALL)
-       @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || list=; \
-       for p in $$list; do \
-         $(am__strip_dir) \
-         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$f'"; \
-         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$f"; \
-       done
-
-clean-amlibLTLIBRARIES:
-       -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES)
-       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
-         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" != "$$p" || dir=.; \
-         echo "rm -f \"$${dir}/so_locations\""; \
-         rm -f "$${dir}/so_locations"; \
-       done
 install-libApplicationLTLIBRARIES: $(libApplication_LTLIBRARIES)
        @$(NORMAL_INSTALL)
        test -z "$(libApplicationdir)" || $(MKDIR_P) "$(DESTDIR)$(libApplicationdir)"
@@ -2187,8 +2422,6 @@ libXfer.la: $(libXfer_la_OBJECTS) $(libXfer_la_DEPENDENCIES)
        $(libXfer_la_LINK) -rpath $(libXferdir) $(libXfer_la_OBJECTS) $(libXfer_la_LIBADD) $(LIBS)
 libXferServer.la: $(libXferServer_la_OBJECTS) $(libXferServer_la_DEPENDENCIES) 
        $(libXferServer_la_LINK) $(am_libXferServer_la_rpath) $(libXferServer_la_OBJECTS) $(libXferServer_la_LIBADD) $(LIBS)
-libamglue.la: $(libamglue_la_OBJECTS) $(libamglue_la_DEPENDENCIES) 
-       $(libamglue_la_LINK) -rpath $(amlibdir) $(libamglue_la_OBJECTS) $(libamglue_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -2214,12 +2447,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Util.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xfer.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XferServer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bigint.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gerror.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghashtable.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objwrap.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/source.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xferwrap.Plo@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -2368,48 +2595,6 @@ XferServer.lo: Amanda/XferServer.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o XferServer.lo `test -f 'Amanda/XferServer.c' || echo '$(srcdir)/'`Amanda/XferServer.c
 
-ghashtable.lo: amglue/ghashtable.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ghashtable.lo -MD -MP -MF $(DEPDIR)/ghashtable.Tpo -c -o ghashtable.lo `test -f 'amglue/ghashtable.c' || echo '$(srcdir)/'`amglue/ghashtable.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/ghashtable.Tpo $(DEPDIR)/ghashtable.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='amglue/ghashtable.c' object='ghashtable.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ghashtable.lo `test -f 'amglue/ghashtable.c' || echo '$(srcdir)/'`amglue/ghashtable.c
-
-gerror.lo: amglue/gerror.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gerror.lo -MD -MP -MF $(DEPDIR)/gerror.Tpo -c -o gerror.lo `test -f 'amglue/gerror.c' || echo '$(srcdir)/'`amglue/gerror.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/gerror.Tpo $(DEPDIR)/gerror.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='amglue/gerror.c' object='gerror.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gerror.lo `test -f 'amglue/gerror.c' || echo '$(srcdir)/'`amglue/gerror.c
-
-bigint.lo: amglue/bigint.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bigint.lo -MD -MP -MF $(DEPDIR)/bigint.Tpo -c -o bigint.lo `test -f 'amglue/bigint.c' || echo '$(srcdir)/'`amglue/bigint.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/bigint.Tpo $(DEPDIR)/bigint.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='amglue/bigint.c' object='bigint.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bigint.lo `test -f 'amglue/bigint.c' || echo '$(srcdir)/'`amglue/bigint.c
-
-source.lo: amglue/source.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT source.lo -MD -MP -MF $(DEPDIR)/source.Tpo -c -o source.lo `test -f 'amglue/source.c' || echo '$(srcdir)/'`amglue/source.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/source.Tpo $(DEPDIR)/source.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='amglue/source.c' object='source.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o source.lo `test -f 'amglue/source.c' || echo '$(srcdir)/'`amglue/source.c
-
-objwrap.lo: amglue/objwrap.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT objwrap.lo -MD -MP -MF $(DEPDIR)/objwrap.Tpo -c -o objwrap.lo `test -f 'amglue/objwrap.c' || echo '$(srcdir)/'`amglue/objwrap.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/objwrap.Tpo $(DEPDIR)/objwrap.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='amglue/objwrap.c' object='objwrap.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o objwrap.lo `test -f 'amglue/objwrap.c' || echo '$(srcdir)/'`amglue/objwrap.c
-
-xferwrap.lo: amglue/xferwrap.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xferwrap.lo -MD -MP -MF $(DEPDIR)/xferwrap.Tpo -c -o xferwrap.lo `test -f 'amglue/xferwrap.c' || echo '$(srcdir)/'`amglue/xferwrap.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xferwrap.Tpo $(DEPDIR)/xferwrap.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='amglue/xferwrap.c' object='xferwrap.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xferwrap.lo `test -f 'amglue/xferwrap.c' || echo '$(srcdir)/'`amglue/xferwrap.c
-
 mostlyclean-libtool:
        -rm -f *.lo
 
@@ -2475,6 +2660,26 @@ uninstall-AmandaChangerDATA:
        test -n "$$files" || exit 0; \
        echo " ( cd '$(DESTDIR)$(AmandaChangerdir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(AmandaChangerdir)" && rm -f $$files
+install-AmandaConfigDATA: $(AmandaConfig_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(AmandaConfigdir)" || $(MKDIR_P) "$(DESTDIR)$(AmandaConfigdir)"
+       @list='$(AmandaConfig_DATA)'; test -n "$(AmandaConfigdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(AmandaConfigdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(AmandaConfigdir)" || exit $$?; \
+       done
+
+uninstall-AmandaConfigDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(AmandaConfig_DATA)'; test -n "$(AmandaConfigdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(AmandaConfigdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(AmandaConfigdir)" && rm -f $$files
 install-AmandaCurinfoDATA: $(AmandaCurinfo_DATA)
        @$(NORMAL_INSTALL)
        test -z "$(AmandaCurinfodir)" || $(MKDIR_P) "$(DESTDIR)$(AmandaCurinfodir)"
@@ -2636,6 +2841,76 @@ uninstall-Amanda_DBDATA:
        echo " ( cd '$(DESTDIR)$(Amanda_DBdir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(Amanda_DBdir)" && rm -f $$files
 
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       rev=''; for subdir in $$list; do \
+         if test "$$subdir" = "."; then :; else \
+           rev="$$subdir $$rev"; \
+         fi; \
+       done; \
+       rev="$$rev ."; \
+       target=`echo $@ | sed s/-recursive//`; \
+       for subdir in $$rev; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done && test -z "$$fail"
+tags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+       done
+ctags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+       done
+
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -2646,10 +2921,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        mkid -fID $$unique
 tags: TAGS
 
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
                $(TAGS_FILES) $(LISP)
        set x; \
        here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
        list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
@@ -2668,7 +2956,7 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
          fi; \
        fi
 ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
                $(TAGS_FILES) $(LISP)
        list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -2718,28 +3006,58 @@ distdir: $(DISTFILES)
            || exit 1; \
          fi; \
        done
+       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test -d "$(distdir)/$$subdir" \
+           || $(MKDIR_P) "$(distdir)/$$subdir" \
+           || exit 1; \
+         fi; \
+       done
+       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+           $(am__relativize); \
+           new_distdir=$$reldir; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
        $(MAKE) $(AM_MAKEFLAGS) \
          top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-hook
+@SYNTAX_CHECKS_FALSE@check-local:
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-local
 check: $(BUILT_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) check-am
+       $(MAKE) $(AM_MAKEFLAGS) check-recursive
 all-am: Makefile $(LTLIBRARIES) $(DATA)
-installdirs:
-       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(libApplicationdir)" "$(DESTDIR)$(libArchivedir)" "$(DESTDIR)$(libCmdlinedir)" "$(DESTDIR)$(libConfigdir)" "$(DESTDIR)$(libDebugdir)" "$(DESTDIR)$(libDevicedir)" "$(DESTDIR)$(libDisklistdir)" "$(DESTDIR)$(libFeaturedir)" "$(DESTDIR)$(libHeaderdir)" "$(DESTDIR)$(libIPCBinarydir)" "$(DESTDIR)$(libLogfiledir)" "$(DESTDIR)$(libMainLoopdir)" "$(DESTDIR)$(libNDMPdir)" "$(DESTDIR)$(libTapelistdir)" "$(DESTDIR)$(libTestsdir)" "$(DESTDIR)$(libUtildir)" "$(DESTDIR)$(libXferdir)" "$(DESTDIR)$(libXferServerdir)" "$(DESTDIR)$(Amandadir)" "$(DESTDIR)$(AmandaApplicationdir)" "$(DESTDIR)$(AmandaChangerdir)" "$(DESTDIR)$(AmandaCurinfodir)" "$(DESTDIR)$(AmandaIPCdir)" "$(DESTDIR)$(AmandaInteractivedir)" "$(DESTDIR)$(AmandaRecoverydir)" "$(DESTDIR)$(AmandaReportdir)" "$(DESTDIR)$(AmandaTaperdir)" "$(DESTDIR)$(AmandaTaperScandir)" "$(DESTDIR)$(Amanda_DBdir)"; do \
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(libApplicationdir)" "$(DESTDIR)$(libArchivedir)" "$(DESTDIR)$(libCmdlinedir)" "$(DESTDIR)$(libConfigdir)" "$(DESTDIR)$(libDebugdir)" "$(DESTDIR)$(libDevicedir)" "$(DESTDIR)$(libDisklistdir)" "$(DESTDIR)$(libFeaturedir)" "$(DESTDIR)$(libHeaderdir)" "$(DESTDIR)$(libIPCBinarydir)" "$(DESTDIR)$(libLogfiledir)" "$(DESTDIR)$(libMainLoopdir)" "$(DESTDIR)$(libNDMPdir)" "$(DESTDIR)$(libTapelistdir)" "$(DESTDIR)$(libTestsdir)" "$(DESTDIR)$(libUtildir)" "$(DESTDIR)$(libXferdir)" "$(DESTDIR)$(libXferServerdir)" "$(DESTDIR)$(Amandadir)" "$(DESTDIR)$(AmandaApplicationdir)" "$(DESTDIR)$(AmandaChangerdir)" "$(DESTDIR)$(AmandaConfigdir)" "$(DESTDIR)$(AmandaCurinfodir)" "$(DESTDIR)$(AmandaIPCdir)" "$(DESTDIR)$(AmandaInteractivedir)" "$(DESTDIR)$(AmandaRecoverydir)" "$(DESTDIR)$(AmandaReportdir)" "$(DESTDIR)$(AmandaTaperdir)" "$(DESTDIR)$(AmandaTaperScandir)" "$(DESTDIR)$(Amanda_DBdir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: $(BUILT_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
+       $(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
 
 install-am: all-am
        @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
-installcheck: installcheck-am
+installcheck: installcheck-recursive
 install-strip:
        $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
          install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
@@ -2761,44 +3079,46 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
        -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
        -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+@WANT_MANDATORY_THREAD_CHECK_FALSE@install-data-local:
+@WANT_MANDATORY_THREAD_CHECK_TRUE@installcheck-local:
 @WANT_CYGWIN_COPY_PERL_DLL_FALSE@install-data-hook:
-clean: clean-am
-
-clean-am: clean-amlibLTLIBRARIES clean-generic \
-       clean-libApplicationLTLIBRARIES clean-libArchiveLTLIBRARIES \
-       clean-libCmdlineLTLIBRARIES clean-libConfigLTLIBRARIES \
-       clean-libDebugLTLIBRARIES clean-libDeviceLTLIBRARIES \
-       clean-libDisklistLTLIBRARIES clean-libFeatureLTLIBRARIES \
-       clean-libHeaderLTLIBRARIES clean-libIPCBinaryLTLIBRARIES \
-       clean-libLogfileLTLIBRARIES clean-libMainLoopLTLIBRARIES \
-       clean-libNDMPLTLIBRARIES clean-libTapelistLTLIBRARIES \
-       clean-libTestsLTLIBRARIES clean-libUtilLTLIBRARIES \
-       clean-libXferLTLIBRARIES clean-libXferServerLTLIBRARIES \
-       clean-libtool mostlyclean-am
-
-distclean: distclean-am
+clean: clean-recursive
+
+clean-am: clean-generic clean-libApplicationLTLIBRARIES \
+       clean-libArchiveLTLIBRARIES clean-libCmdlineLTLIBRARIES \
+       clean-libConfigLTLIBRARIES clean-libDebugLTLIBRARIES \
+       clean-libDeviceLTLIBRARIES clean-libDisklistLTLIBRARIES \
+       clean-libFeatureLTLIBRARIES clean-libHeaderLTLIBRARIES \
+       clean-libIPCBinaryLTLIBRARIES clean-libLogfileLTLIBRARIES \
+       clean-libMainLoopLTLIBRARIES clean-libNDMPLTLIBRARIES \
+       clean-libTapelistLTLIBRARIES clean-libTestsLTLIBRARIES \
+       clean-libUtilLTLIBRARIES clean-libXferLTLIBRARIES \
+       clean-libXferServerLTLIBRARIES clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
        -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
 
-dvi: dvi-am
+dvi: dvi-recursive
 
 dvi-am:
 
 html-am:
 
-info: info-am
+info: info-recursive
 
 info-am:
 
 install-data-am: install-AmandaApplicationDATA \
-       install-AmandaChangerDATA install-AmandaCurinfoDATA \
-       install-AmandaDATA install-AmandaIPCDATA \
-       install-AmandaInteractiveDATA install-AmandaRecoveryDATA \
-       install-AmandaReportDATA install-AmandaTaperDATA \
-       install-AmandaTaperScanDATA install-Amanda_DBDATA \
-       install-amlibLTLIBRARIES install-libApplicationLTLIBRARIES \
+       install-AmandaChangerDATA install-AmandaConfigDATA \
+       install-AmandaCurinfoDATA install-AmandaDATA \
+       install-AmandaIPCDATA install-AmandaInteractiveDATA \
+       install-AmandaRecoveryDATA install-AmandaReportDATA \
+       install-AmandaTaperDATA install-AmandaTaperScanDATA \
+       install-Amanda_DBDATA install-data-local \
+       install-libApplicationLTLIBRARIES \
        install-libArchiveLTLIBRARIES install-libCmdlineLTLIBRARIES \
        install-libConfigLTLIBRARIES install-libDebugLTLIBRARIES \
        install-libDeviceLTLIBRARIES install-libDisklistLTLIBRARIES \
@@ -2810,57 +3130,57 @@ install-data-am: install-AmandaApplicationDATA \
        install-libXferServerLTLIBRARIES
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-data-hook
-install-dvi: install-dvi-am
+install-dvi: install-dvi-recursive
 
 install-dvi-am:
 
 install-exec-am:
 
-install-html: install-html-am
+install-html: install-html-recursive
 
 install-html-am:
 
-install-info: install-info-am
+install-info: install-info-recursive
 
 install-info-am:
 
 install-man:
 
-install-pdf: install-pdf-am
+install-pdf: install-pdf-recursive
 
 install-pdf-am:
 
-install-ps: install-ps-am
+install-ps: install-ps-recursive
 
 install-ps-am:
 
 installcheck-am: installcheck-local
 
-maintainer-clean: maintainer-clean-am
+maintainer-clean: maintainer-clean-recursive
        -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
-mostlyclean: mostlyclean-am
+mostlyclean: mostlyclean-recursive
 
 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
        mostlyclean-libtool
 
-pdf: pdf-am
+pdf: pdf-recursive
 
 pdf-am:
 
-ps: ps-am
+ps: ps-recursive
 
 ps-am:
 
 uninstall-am: uninstall-AmandaApplicationDATA \
-       uninstall-AmandaChangerDATA uninstall-AmandaCurinfoDATA \
-       uninstall-AmandaDATA uninstall-AmandaIPCDATA \
-       uninstall-AmandaInteractiveDATA uninstall-AmandaRecoveryDATA \
-       uninstall-AmandaReportDATA uninstall-AmandaTaperDATA \
-       uninstall-AmandaTaperScanDATA uninstall-Amanda_DBDATA \
-       uninstall-amlibLTLIBRARIES uninstall-libApplicationLTLIBRARIES \
+       uninstall-AmandaChangerDATA uninstall-AmandaConfigDATA \
+       uninstall-AmandaCurinfoDATA uninstall-AmandaDATA \
+       uninstall-AmandaIPCDATA uninstall-AmandaInteractiveDATA \
+       uninstall-AmandaRecoveryDATA uninstall-AmandaReportDATA \
+       uninstall-AmandaTaperDATA uninstall-AmandaTaperScanDATA \
+       uninstall-Amanda_DBDATA uninstall-libApplicationLTLIBRARIES \
        uninstall-libArchiveLTLIBRARIES \
        uninstall-libCmdlineLTLIBRARIES uninstall-libConfigLTLIBRARIES \
        uninstall-libDebugLTLIBRARIES uninstall-libDeviceLTLIBRARIES \
@@ -2873,11 +3193,12 @@ uninstall-am: uninstall-AmandaApplicationDATA \
        uninstall-libUtilLTLIBRARIES uninstall-libXferLTLIBRARIES \
        uninstall-libXferServerLTLIBRARIES
 
-.MAKE: all check check-am install install-am install-data-am \
-       install-strip
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
+       check-am ctags-recursive install install-am install-data-am \
+       install-strip tags-recursive
 
-.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
-       clean-amlibLTLIBRARIES clean-generic \
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+       all all-am check check-am check-local clean clean-generic \
        clean-libApplicationLTLIBRARIES clean-libArchiveLTLIBRARIES \
        clean-libCmdlineLTLIBRARIES clean-libConfigLTLIBRARIES \
        clean-libDebugLTLIBRARIES clean-libDeviceLTLIBRARIES \
@@ -2887,16 +3208,17 @@ uninstall-am: uninstall-AmandaApplicationDATA \
        clean-libNDMPLTLIBRARIES clean-libTapelistLTLIBRARIES \
        clean-libTestsLTLIBRARIES clean-libUtilLTLIBRARIES \
        clean-libXferLTLIBRARIES clean-libXferServerLTLIBRARIES \
-       clean-libtool ctags dist-hook distclean distclean-compile \
-       distclean-generic distclean-libtool distclean-tags distdir dvi \
-       dvi-am html html-am info info-am install \
-       install-AmandaApplicationDATA install-AmandaChangerDATA \
+       clean-libtool ctags ctags-recursive dist-hook distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-AmandaApplicationDATA \
+       install-AmandaChangerDATA install-AmandaConfigDATA \
        install-AmandaCurinfoDATA install-AmandaDATA \
        install-AmandaIPCDATA install-AmandaInteractiveDATA \
        install-AmandaRecoveryDATA install-AmandaReportDATA \
        install-AmandaTaperDATA install-AmandaTaperScanDATA \
-       install-Amanda_DBDATA install-am install-amlibLTLIBRARIES \
-       install-data install-data-am install-data-hook install-dvi \
+       install-Amanda_DBDATA install-am install-data install-data-am \
+       install-data-hook install-data-local install-dvi \
        install-dvi-am install-exec install-exec-am install-html \
        install-html-am install-info install-info-am \
        install-libApplicationLTLIBRARIES \
@@ -2911,16 +3233,17 @@ uninstall-am: uninstall-AmandaApplicationDATA \
        install-libXferServerLTLIBRARIES install-man install-pdf \
        install-pdf-am install-ps install-ps-am install-strip \
        installcheck installcheck-am installcheck-local installdirs \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-       pdf pdf-am ps ps-am tags uninstall \
-       uninstall-AmandaApplicationDATA uninstall-AmandaChangerDATA \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+       uninstall uninstall-AmandaApplicationDATA \
+       uninstall-AmandaChangerDATA uninstall-AmandaConfigDATA \
        uninstall-AmandaCurinfoDATA uninstall-AmandaDATA \
        uninstall-AmandaIPCDATA uninstall-AmandaInteractiveDATA \
        uninstall-AmandaRecoveryDATA uninstall-AmandaReportDATA \
        uninstall-AmandaTaperDATA uninstall-AmandaTaperScanDATA \
        uninstall-Amanda_DBDATA uninstall-am \
-       uninstall-amlibLTLIBRARIES uninstall-libApplicationLTLIBRARIES \
+       uninstall-libApplicationLTLIBRARIES \
        uninstall-libArchiveLTLIBRARIES \
        uninstall-libCmdlineLTLIBRARIES uninstall-libConfigLTLIBRARIES \
        uninstall-libDebugLTLIBRARIES uninstall-libDeviceLTLIBRARIES \
@@ -2938,11 +3261,13 @@ uninstall-am: uninstall-AmandaApplicationDATA \
 %: %.pl $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          rm $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  fi
+@SYNTAX_CHECKS_TRUE@   @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+@SYNTAX_CHECKS_TRUE@           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
+@SYNTAX_CHECKS_TRUE@           rm $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@   else \
+@SYNTAX_CHECKS_TRUE@           echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
+@SYNTAX_CHECKS_TRUE@   fi
 
 %.pl: %.pl.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
@@ -2966,33 +3291,22 @@ uninstall-am: uninstall-AmandaApplicationDATA \
 %.awk: %.awk.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
 
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
 check-perl: $(SCRIPTS_PERL)
        @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
            test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-           if test -n "$(PERL)"; then \
-                   for perlobj in $$SCRIPTS_PERL; do \
-                           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
-                           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
-                           rm $$perlobj.nouselib; \
-                   done; \
-           fi \
-       fi
-check-local: check-perl
-
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
-       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
-       if test x"$(SKIP_CHECKS)" = x"" && \
-           test -n "$(PERL)"; then \
-               for perlobj in $$SCRIPTS_PERL; do \
-                       $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
-               done; \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
        fi
-installcheck-local: installcheck-perl
+@SYNTAX_CHECKS_TRUE@check-local: check-perl
 
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
 check-shell: $(SCRIPTS_SHELL)
        @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
@@ -3010,7 +3324,7 @@ check-shell: $(SCRIPTS_SHELL)
                        echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
        fi
-check-local: check-shell
+@SYNTAX_CHECKS_TRUE@check-local: check-shell
 
 # make sure that the sources for all shell and perl scripts get included
 # in the distribution
@@ -3047,6 +3361,8 @@ dist-scripts:
        true
 dist-hook: dist-scripts
 
+# (amplot has a conditional, but doesn't have any header files)
+
 # This isn't a very robust implementation, as it's only meant to make the HTML
 # available online as part of the automated compilation process.  It assumes
 # that all perl modules were built (not just server or client), and that the
@@ -3080,27 +3396,28 @@ Amanda/Feature.pm: ../common-src/amfeatures.h
 @WANT_CYGWIN_COPY_PERL_DLL_TRUE@          cp "$$cygdll" "$$destfname"; \
 @WANT_CYGWIN_COPY_PERL_DLL_TRUE@       done
 
-check-local: syntax-check thread-check
-
-syntax-check:
+# only syntax-check the .pm files if SYNTAX_CHECKS are enabled
+check-pm:
        @MODULES_TO_CHECK="$(PM_FILES)"; \
        if test -f $(top_builddir)/perl/.libs/libConfig.so -o -f $(top_builddir)/perl/libConfig.so; then \
-               if test -n "$(PERL)"; then \
-                       for perlobj in $$MODULES_TO_CHECK; do \
-                               if test -f $$perlobj; then \
-                                       $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -T $$perlobj || exit 1; \
-                               else \
-                                       $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -T $(top_srcdir)/perl/$$perlobj || exit 1; \
-                               fi \
-                       done; \
+           for perlobj in $$MODULES_TO_CHECK; do \
+               if test -f $$perlobj; then \
+                   $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -T $$perlobj || exit 1; \
+               else \
+                   $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -T $(top_srcdir)/perl/$$perlobj || exit 1; \
                fi \
+           done; \
         fi
+@SYNTAX_CHECKS_TRUE@check-local: check-pm
+
+@WANT_MANDATORY_THREAD_CHECK_TRUE@install-data-local: thread-check
+@WANT_MANDATORY_THREAD_CHECK_FALSE@installcheck-local: thread-check
 
 @WANT_SERVER_TRUE@thread-check: libTests.la
 @WANT_SERVER_TRUE@     $(PERL) -I$(builddir) -I$(builddir)/.libs -I$(srcdir) \
 @WANT_SERVER_TRUE@                     -MAmanda::Tests -e 'alarm(10); Amanda::Tests::try_threads' \
-@WANT_SERVER_TRUE@     || echo "Perl cannot run extensions which use threads; consider linking perl" \
-@WANT_SERVER_TRUE@             "with -pthreads or compiling perl with threading enabled"
+@WANT_SERVER_TRUE@     || echo "Perl cannot run extensions which use threads; consider linking perl" \
+@WANT_SERVER_TRUE@             "with -pthread or compiling perl with threading enabled"; false; }
 @WANT_SERVER_FALSE@thread-check:
 @WANT_SERVER_FALSE@    @echo "skipping thread check: server component not being built"
 
diff --git a/perl/amglue/Makefile.am b/perl/amglue/Makefile.am
new file mode 100644 (file)
index 0000000..fa1720b
--- /dev/null
@@ -0,0 +1,35 @@
+include $(top_srcdir)/config/automake/vars.am
+include $(top_srcdir)/config/automake/scripts.am
+
+##
+## libamglue -- helper functions for gluing amanda to perl
+##
+
+# add the SWIG symbol to avoid conflicts with perl definitions.
+# $AMANDA_WARNING_CFLAGS is omitted because SWIG-generated files tend
+# to trigger warnings.
+AM_CFLAGS = -DSWIG $(AMANDA_SWIG_PERL_CFLAGS)
+
+# Appropriate INCLUDES depends on which components (server or client) are
+# being built
+INCLUDES =  \
+            -I$(top_builddir)/common-src \
+            -I$(top_srcdir)/common-src \
+            -I$(top_srcdir)/xfer-src \
+            -I$(top_srcdir)/gnulib \
+            -I$(top_srcdir)/ndmp-src \
+            $(PERL_INC)
+
+amlib_LTLIBRARIES = libamglue.la
+libamglue_la_SOURCES = \
+       ghashtable.c \
+       gerror.c \
+       bigint.c \
+       source.c \
+       objwrap.c \
+       xferwrap.c \
+       amglue.h
+libamglue_la_LDFLAGS = $(PERL_EXT_LDFLAGS) -release $(VERSION)
+libamglue_la_LIBADD = \
+       $(top_builddir)/xfer-src/libamxfer.la
+EXTRA_DIST += $(libamglue_la_SOURCES)
diff --git a/perl/amglue/Makefile.in b/perl/amglue/Makefile.in
new file mode 100644 (file)
index 0000000..6f7d85b
--- /dev/null
@@ -0,0 +1,1601 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# vim:ft=automake
+# Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# simple include file to pre-define variables which are then +='d by other
+# scripts in this directory.
+
+# vim:ft=automake
+# Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# SYNOPSIS:
+#
+# Automake magic to handle the various tasks of building scripts.  Scripts can
+# be built down to extensionless executables (e.g., foo.pl -> foo), or to 
+# files with the usual extension (foo-lib.sh.in -> foo.sh).
+#
+# Files which support it are syntax-checked when the user invokes 'make check',
+# unless the Makefile.am defines SKIP_CHECKS.
+#
+# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and
+# SCRIPTS_AWK to support 'make dist', and 'make distclean'. No files which are
+# not substituted by config.status should be included in SCRIPTS_PERL,
+# SCRIPTS_SHELL, or SCRIPTS_AWK.  If non-generated files are listed for
+# installation, then Automake will figure out that they should be distributed;
+# otherwise, include them in EXTRA_DIST.
+#
+# All SCRIPTS_SHELL and SCRIPTS_PERL are syntax-checked on 'make check'.  There is
+# a fix in place to run these syntax checks against the perl modules in the build
+# tree, rather than against the (potentially old) installed perl modules.
+#
+# To emulate EXTRA_DIST for scripts, use SCRIPTS_EXTRA_DIST, e.g.,
+#   SCRIPTS_SHELL = $(selected_scripts)
+#   SCRIPTS_EXTRA_DIST = $(all_scripts)
+#
+# USAGE:
+#
+#   include $(top_srcdir)/config/automake/vars.am
+#   include $(top_srcdir)/config/automake/scripts.am
+#   ...
+#   SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
+#   SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
+#   SCRIPTS_AWK = talk balk chalk awk-lib.awk
+#   sbin_SCRIPTS = not-subbed
+#   SCRIPTS_EXTRA_DIST = util-script
+#
+# with the corresponding files in the repository:
+#
+#   fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
+#   shell1.sh shell2.sh sh-lib.sh.in
+#   talk.awk balk.awk chalk.awk awk-lib.awk.in
+#   not-subbed util-script.pl
+#
+# To add extra flags to the perl checks (e.g., to add new -I flags), set
+# CHECK_PERL_FLAGS.
+
+# Implementation note:
+#
+# This file uses config.status to substitute @foo@ in those scripts while
+# converting them. It also adds the executable bits (a+x) to extensionless
+# files.  The substitution works even though the files are not listed in 
+# configure.in
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/scripts.am \
+       $(top_srcdir)/config/automake/vars.am
+subdir = perl/amglue
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/dvdrw-device.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/ndmp-device.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/ps.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
+       $(top_srcdir)/config/gnulib/00gnulib.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
+       $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
+       $(top_srcdir)/config/gnulib/errno_h.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fseeko.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
+       $(top_srcdir)/config/gnulib/ftello.m4 \
+       $(top_srcdir)/config/gnulib/ftruncate.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/getopt.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/hostent.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
+       $(top_srcdir)/config/gnulib/localcharset.m4 \
+       $(top_srcdir)/config/gnulib/locale-fr.m4 \
+       $(top_srcdir)/config/gnulib/locale-ja.m4 \
+       $(top_srcdir)/config/gnulib/locale-zh.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/lseek.m4 \
+       $(top_srcdir)/config/gnulib/lstat.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mbrtowc.m4 \
+       $(top_srcdir)/config/gnulib/mbsinit.m4 \
+       $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
+       $(top_srcdir)/config/gnulib/multiarch.m4 \
+       $(top_srcdir)/config/gnulib/netdb_h.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
+       $(top_srcdir)/config/gnulib/onceonly.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/printf.m4 \
+       $(top_srcdir)/config/gnulib/regex.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
+       $(top_srcdir)/config/gnulib/servent.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
+       $(top_srcdir)/config/gnulib/wcrtomb.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
+       $(top_srcdir)/config/gnulib/write.m4 \
+       $(top_srcdir)/config/gettext-macros/codeset.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/glibc21.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(amlibdir)"
+LTLIBRARIES = $(amlib_LTLIBRARIES)
+libamglue_la_DEPENDENCIES = $(top_builddir)/xfer-src/libamxfer.la
+am_libamglue_la_OBJECTS = ghashtable.lo gerror.lo bigint.lo source.lo \
+       objwrap.lo xferwrap.lo
+libamglue_la_OBJECTS = $(am_libamglue_la_OBJECTS)
+libamglue_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libamglue_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+SOURCES = $(libamglue_la_SOURCES)
+DIST_SOURCES = $(libamglue_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AIX_BACKUP = @AIX_BACKUP@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMANDA_COMPONENTS = @AMANDA_COMPONENTS@
+AMANDA_DBGDIR = @AMANDA_DBGDIR@
+AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
+AMANDA_SWIG_PERL_CFLAGS = @AMANDA_SWIG_PERL_CFLAGS@
+AMANDA_TMPDIR = @AMANDA_TMPDIR@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
+AMLINT = @AMLINT@
+AMLINTFLAGS = @AMLINTFLAGS@
+AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
+AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
+AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
+AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
+AMTAR = @AMTAR@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+APPLICATION_DIR = @APPLICATION_DIR@
+AR = @AR@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
+ASSERTIONS = @ASSERTIONS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASH = @BASH@
+BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+BSDTCP_SECURITY = @BSDTCP_SECURITY@
+BSDUDP_SECURITY = @BSDUDP_SECURITY@
+BSD_SECURITY = @BSD_SECURITY@
+CAT = @CAT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_USERID = @CHECK_USERID@
+CLIENT_LOGIN = @CLIENT_LOGIN@
+CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
+COMPRESS = @COMPRESS@
+COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@
+COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@
+COMPRESS_PATH = @COMPRESS_PATH@
+COMPRESS_SUFFIX = @COMPRESS_SUFFIX@
+CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@
+CONFIG_DIR = @CONFIG_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CYGPATH_W = @CYGPATH_W@
+DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
+DEFAULT_CONFIG = @DEFAULT_CONFIG@
+DEFAULT_MAILER = @DEFAULT_MAILER@
+DEFAULT_SERVER = @DEFAULT_SERVER@
+DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
+DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOC_BUILD_DATE = @DOC_BUILD_DATE@
+DSYMUTIL = @DSYMUTIL@
+DUMP = @DUMP@
+DUMPBIN = @DUMPBIN@
+DUMP_RETURNS_1 = @DUMP_RETURNS_1@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+GETADDRINFO_LIB = @GETADDRINFO_LIB@
+GETCONF = @GETCONF@
+GETOPT_H = @GETOPT_H@
+GETTEXT = @GETTEXT@
+GIT = @GIT@
+GLIBC21 = @GLIBC21@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
+GNULIB_ATOLL = @GNULIB_ATOLL@
+GNULIB_BIND = @GNULIB_BIND@
+GNULIB_BTOWC = @GNULIB_BTOWC@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CONNECT = @GNULIB_CONNECT@
+GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
+GNULIB_ENVIRON = @GNULIB_ENVIRON@
+GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
+GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FOPEN = @GNULIB_FOPEN@
+GNULIB_FPRINTF = @GNULIB_FPRINTF@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
+GNULIB_FPUTC = @GNULIB_FPUTC@
+GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREOPEN = @GNULIB_FREOPEN@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
+GNULIB_FSYNC = @GNULIB_FSYNC@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
+GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
+GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
+GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
+GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
+GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
+GNULIB_INET_PTON = @GNULIB_INET_PTON@
+GNULIB_LCHMOD = @GNULIB_LCHMOD@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LISTEN = @GNULIB_LISTEN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_LSTAT = @GNULIB_LSTAT@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBRLEN = @GNULIB_MBRLEN@
+GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
+GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
+GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
+GNULIB_PRINTF = @GNULIB_PRINTF@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PUTC = @GNULIB_PUTC@
+GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
+GNULIB_PUTENV = @GNULIB_PUTENV@
+GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_RECV = @GNULIB_RECV@
+GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
+GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SEND = @GNULIB_SEND@
+GNULIB_SENDTO = @GNULIB_SENDTO@
+GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@
+GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SOCKET = @GNULIB_SOCKET@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
+GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_STRTOLL = @GNULIB_STRTOLL@
+GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
+GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
+GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF = @GNULIB_VPRINTF@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
+GNUPLOT = @GNUPLOT@
+GNUTAR = @GNUTAR@
+GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
+HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
+HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GZIP = @HAVE_GZIP@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETDB_H = @HAVE_NETDB_H@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_UNSETENV = @HAVE_UNSETENV@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+HOSTENT_LIB = @HOSTENT_LIB@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+KRB5_SECURITY = @KRB5_SECURITY@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LOCKING = @LOCKING@
+LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
+LPR = @LPR@
+LPRFLAG = @LPRFLAG@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAILER = @MAILER@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+MT = @MT@
+MTX = @MTX@
+MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_NETDB_H = @NEXT_NETDB_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PCAT = @PCAT@
+PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PS = @PS@
+PS_ARGUMENT = @PS_ARGUMENT@
+PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+RESTORE = @RESTORE@
+RPCGEN = @RPCGEN@
+RSH_SECURITY = @RSH_SECURITY@
+SAMBA_CLIENT = @SAMBA_CLIENT@
+SED = @SED@
+SERVENT_LIB = @SERVENT_LIB@
+SERVICE_SUFFIX = @SERVICE_SUFFIX@
+SETUID_GROUP = @SETUID_GROUP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
+SORT = @SORT@
+SSH = @SSH@
+SSH_SECURITY = @SSH_SECURITY@
+STAR = @STAR@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+UDPPORTRANGE = @UDPPORTRANGE@
+UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
+UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
+USE_NLS = @USE_NLS@
+USE_RUNDUMP = @USE_RUNDUMP@
+VDUMP = @VDUMP@
+VERSION = @VERSION@
+VERSION_COMMENT = @VERSION_COMMENT@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MINOR = @VERSION_MINOR@
+VERSION_PATCH = @VERSION_PATCH@
+VRESTORE = @VRESTORE@
+VXDUMP = @VXDUMP@
+VXRESTORE = @VXRESTORE@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XFSDUMP = @XFSDUMP@
+XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+amdatadir = @amdatadir@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUFFIXES = 
+EXTRA_DIST = $(libamglue_la_SOURCES)
+BUILT_SOURCES = 
+MOSTLYCLEANFILES = 
+
+# config.status leaves config.log files around
+CLEANFILES = config.log
+
+# and we'll need to clean up our generated files for distclean
+DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \
+       $(SCRIPTS_INCLUDE)
+MAINTAINERCLEANFILES = 
+
+# add the SWIG symbol to avoid conflicts with perl definitions.
+# $AMANDA_WARNING_CFLAGS is omitted because SWIG-generated files tend
+# to trigger warnings.
+AM_CFLAGS = -DSWIG $(AMANDA_SWIG_PERL_CFLAGS)
+
+# Appropriate INCLUDES depends on which components (server or client) are
+# being built
+INCLUDES = \
+            -I$(top_builddir)/common-src \
+            -I$(top_srcdir)/common-src \
+            -I$(top_srcdir)/xfer-src \
+            -I$(top_srcdir)/gnulib \
+            -I$(top_srcdir)/ndmp-src \
+            $(PERL_INC)
+
+amlib_LTLIBRARIES = libamglue.la
+libamglue_la_SOURCES = \
+       ghashtable.c \
+       gerror.c \
+       bigint.c \
+       source.c \
+       objwrap.c \
+       xferwrap.c \
+       amglue.h
+
+libamglue_la_LDFLAGS = $(PERL_EXT_LDFLAGS) -release $(VERSION)
+libamglue_la_LIBADD = \
+       $(top_builddir)/xfer-src/libamxfer.la
+
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu perl/amglue/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu perl/amglue/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)"
+       @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || list=; \
+       list2=; for p in $$list; do \
+         if test -f $$p; then \
+           list2="$$list2 $$p"; \
+         else :; fi; \
+       done; \
+       test -z "$$list2" || { \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(amlibdir)'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(amlibdir)"; \
+       }
+
+uninstall-amlibLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(amlib_LTLIBRARIES)'; test -n "$(amlibdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$f'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$f"; \
+       done
+
+clean-amlibLTLIBRARIES:
+       -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libamglue.la: $(libamglue_la_OBJECTS) $(libamglue_la_DEPENDENCIES) 
+       $(libamglue_la_LINK) -rpath $(amlibdir) $(libamglue_la_OBJECTS) $(libamglue_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bigint.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gerror.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghashtable.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objwrap.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/source.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xferwrap.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
+@SYNTAX_CHECKS_FALSE@check-local:
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+       for dir in "$(DESTDIR)$(amlibdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-amlibLTLIBRARIES clean-generic clean-libtool \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-amlibLTLIBRARIES
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-amlibLTLIBRARIES
+
+.MAKE: all check check-am install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
+       clean-amlibLTLIBRARIES clean-generic clean-libtool ctags \
+       dist-hook distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am \
+       install-amlibLTLIBRARIES install-data install-data-am \
+       install-dvi install-dvi-am install-exec install-exec-am \
+       install-html install-html-am install-info install-info-am \
+       install-man install-pdf install-pdf-am install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-amlibLTLIBRARIES
+
+
+# Perl
+%: %.pl $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+@SYNTAX_CHECKS_TRUE@   @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+@SYNTAX_CHECKS_TRUE@           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
+@SYNTAX_CHECKS_TRUE@           rm $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@   else \
+@SYNTAX_CHECKS_TRUE@           echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
+@SYNTAX_CHECKS_TRUE@   fi
+
+%.pl: %.pl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+%.pm: %.pm.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Shell
+%: %.sh $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.sh: %.sh.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Awk
+%: %.awk $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.awk: %.awk.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
+check-perl: $(SCRIPTS_PERL)
+       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
+       if test x"$(SKIP_CHECKS)" = x"" && \
+           test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
+       fi
+@SYNTAX_CHECKS_TRUE@check-local: check-perl
+
+# syntax-check shell scripts on an explicit 'make check'
+check-shell: $(SCRIPTS_SHELL)
+       @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
+       if test x"$(SKIP_CHECKS)" = x"" && \
+           test -n "$$SCRIPTS_SHELL"; then \
+               if test -n "$(BASH)"; then \
+                       for shobj in $$SCRIPTS_SHELL; do \
+                               if $(BASH) -n $$shobj; then \
+                                       echo "$$shobj syntax OK"; \
+                               else \
+                                       echo "$$shobj syntax error"; \
+                                       exit 1; \
+                               fi; \
+                       done; \
+               else \
+                       echo "No 'bash' available -- cannot syntax-check shell scripts"; \
+               fi; \
+       fi
+@SYNTAX_CHECKS_TRUE@check-local: check-shell
+
+# make sure that the sources for all shell and perl scripts get included
+# in the distribution
+dist-scripts:
+       @SCRIPTS_PERL="$(SCRIPTS_PERL) $(SCRIPTS_EXTRA_DIST)"; \
+       SCRIPTS_SHELL="$(SCRIPTS_SHELL) $(SCRIPTS_EXTRA_DIST)"; \
+       SCRIPTS_AWK="$(SCRIPTS_AWK) $(SCRIPTS_EXTRA_DIST)"; \
+       SCRIPTS_DIST=; \
+       for script in $$SCRIPTS_PERL; do \
+               test -f $(srcdir)/$${script}.pl && \
+                       SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.pl"; \
+       done; \
+       for script in $$SCRIPTS_SHELL; do \
+               test -f $(srcdir)/$${script}.sh && \
+                       SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.sh"; \
+       done; \
+       for script in $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.awk && \
+                       SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.awk"; \
+       done; \
+       for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.in && \
+                       SCRIPTS_DIST="$$SCRIPTS_DIST $${script}.in"; \
+       done; \
+       for script in $$SCRIPTS_DIST; do \
+               dir=`dirname $${script}`; \
+               if test -n "$$dir" && test ! -d "$(distdir)/$$dir"; then \
+                       mkdir -p "$(distdir)/$$dir" || exit 1; \
+               fi; \
+               test -f "$(distdir)/$${script}" && continue; \
+               echo "distributing $${script}"; \
+               cp -p "$(srcdir)/$${script}" "$(distdir)/$${script}" || exit 1; \
+       done; \
+       true
+dist-hook: dist-scripts
+
+# 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.
+.NOEXPORT:
index 10fe0ebe92477c94f1b788d505dac8039f0f2985..f5f3b9a0d4611a6a3326bfa8aeac0d731d2a9e6e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
+/* make sure config.h gets included early */
+%begin %{
+#include "../config/config.h"
+%}
+
 %{
 #include "amglue.h"
 %}
index f2d8b9b885e28f2fad06c7b670562cc34c99138b..f194ef2e64f38ae35496ada1238d9304a88df616 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
 
 %include "amglue/exports.swg"
 
+/*
+ * Internal support for iterating over lists of symbols; users will define
+ * the list as e.g.,
+ *
+ *   #define FOR_ALL_WHATEVER(APPLY) APPLY(SYMBOL1) APPLY(SYMBOL2) ..
+ *
+ * and then passes FOR_ALL_WHATEVER as the FORALL_FN argument to one of the
+ * macros below.  This uses the "X Macro" trick; see
+ * http://www.drdobbs.com/blog/archives/2010/06/the_x_macro.html
+ *
+ * NOTE: SWIG's %define macros add C-style comments when they are expanded, so
+ * this method must use #define, not %define.  Also note that this always expands
+ * to a single line, making the result very ugly.
+ */
+
+#define _amglue_apply_null(V) V
+#define _amglue_apply_leading_scalar(V) $V
+#define _amglue_apply_trailing_comma(V) V,
+#define _amglue_apply_C_scalar(V) C<$V>
+#define _amglue_forall_join_whitespace(FORALL_FN) FORALL_FN(_amglue_apply_null)
+#define _amglue_forall_scalars(FORALL_FN) FORALL_FN(_amglue_apply_leading_scalar)
+#define _amglue_forall_terminated_by_comma(FORALL_FN) FORALL_FN(_amglue_apply_trailing_comma)
+
 /* Rather than try to use glib's flag/enum architecture, which is only used
  * for a few constants (mostly in property.h), .swg files define constants using
  * these macros.  A typical definition would look like:
@@ -111,6 +134,21 @@ $_ ## TAG ## _VALUES{`CONSTNAME`} = $CONSTNAME;
 %}
 %enddef
 
+/* Add a bunch of constants all at once; this is more efficient with
+ * a large list of constants
+ *
+ * @param FORALL_FN: the FORALL_FN listing all of the constants (see above)
+ * @param TAG: the tag for these constants
+ */
+#define amglue_add_constants(FORALL_FN, TAG) \
+enum { _amglue_forall_terminated_by_comma(FORALL_FN) }; \
+amglue_export_tag(TAG, _amglue_forall_scalars(FORALL_FN)) \
+%perlcode %{ \
+    foreach (qw( _amglue_forall_join_whitespace(FORALL_FN))) { \
+       $_ ## TAG ## _VALUES{$_} = $$_; \
+    } \
+%}
+
 /* Add the given constant with a short name
  *
  * @param CONSTNAME: the name of the constant, as used in C code
@@ -136,3 +174,12 @@ $_ ## TAG ## _VALUES{`SHORTNAME`} = $CONSTNAME;
 enum { CONSTNAME }; /* pass the constant to SWIG */
 amglue_export_tag(TAG, $CONSTNAME);
 %enddef
+
+/* Return the symbols alone, separated by whitespace.  Note that this will
+ * being with whitespace, too.  Be careful if using it in POD.
+ *
+ * @param FORALL_FN: the forall function to use (see above)
+ */
+#define amglue_constants_list(FORALL_FN) \
+    FORALL_FN(_amglue_apply_C_scalar)
+
index e8773f669d86a8324075f82d10c761c2503710fa..b6804666c629c16166ecea66afa23e6ede65e16b 100644 (file)
@@ -91,7 +91,7 @@
     addrs_av = (AV *)SvRV($input);
     num_addrs = av_len(addrs_av)+1;
 
-    $1 = g_new0(DirectTCPAddr, num_addrs);
+    $1 = g_new0(DirectTCPAddr, num_addrs+1);
 
     for (i = 0; i < num_addrs; i++) {
         SV **svp = av_fetch(addrs_av, i, 0);
index 6ef2e94a45f058bf565266cd657efea527ec6779..50d493ff606b2b670e1652b463cc35b2fdd9441c 100644 (file)
 #include "amglue.h"
 #include "conffile.h"
 
+/* PERL_MAGIC_tied is not defined in perl 5.6 */
+#if !defined PERL_MAGIC_tied
+#define PERL_MAGIC_tied 'P'
+#endif
+
 static void 
 foreach_fn(gpointer key_p, gpointer value_p, gpointer user_data_p)
 {
@@ -75,6 +80,7 @@ foreach_fn_property(gpointer key_p, gpointer value_p, gpointer user_data_p)
     HV         *hv = user_data_p;
     AV         *list = newAV();
     HV         *property_hv = newHV();
+    SV         *val;
 
     hv_store(property_hv, "append", strlen("append"), newSViv(property->append), 0);
     hv_store(property_hv, "priority", strlen("priority"), newSViv(property->priority), 0);
@@ -83,14 +89,26 @@ foreach_fn_property(gpointer key_p, gpointer value_p, gpointer user_data_p)
     }
     hv_store(property_hv, "values", strlen("values"), newRV_noinc((SV*)list), 0);
 
-    hv_store(hv, key, strlen(key), newRV_noinc((SV*)property_hv), 0);
+    val = newRV_noinc((SV*)property_hv);
+    hv_store(hv, key, strlen(key), val, 0);
+    mg_set(val);
+    SvREFCNT_dec(val);
 }
 
 SV *
 g_hash_table_to_hashref_property(GHashTable *hash)
 {
-    HV *hv = (HV *)sv_2mortal((SV *)newHV());
+    HV *hv;
+    HV *stash;
+    SV *tie;
+
+    hv = newHV();
+    tie = newRV_noinc((SV*)newHV());
+    stash = gv_stashpv("Amanda::Config::FoldingHash", GV_ADD);
+    sv_bless(tie, stash);
+    hv_magic(hv, (GV*)tie, PERL_MAGIC_tied);
 
+    hv = (HV *)sv_2mortal((SV *)hv);
     g_hash_table_foreach(hash, foreach_fn_property, hv);
 
     return newRV((SV *)hv);
index 8187643d64cdeb080f0f972dfadf035d92546c40..2c1ce07005db65265c711b510ca616bfed055fd3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
 %}
 
 typedef int gboolean;
+%typemap(in) gboolean {
+    $1 = SvTRUE($input);
+}
+
 %typemap(out) gboolean {
     if ($1)
        $result = &PL_sv_yes;
index 4e3b1e6bf9ec38adbffb761b6e34bb68f6109d9a..4c8869f7d938d58d610cff89f653cb1804aff2d3 100644 (file)
@@ -52,7 +52,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -80,7 +79,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -93,10 +91,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -110,7 +112,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -123,10 +127,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -138,21 +145,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -204,7 +215,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -224,10 +235,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -283,78 +291,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = gmsgfmt
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -365,12 +428,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -385,17 +477,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -404,60 +500,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -465,13 +620,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -480,9 +641,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -518,7 +682,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -527,7 +690,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = msgfmt
 MSGFMT_015 = @MSGFMT_015@
@@ -535,19 +697,42 @@ MSGMERGE = msgmerge
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -575,47 +760,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -623,6 +864,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -645,19 +887,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -667,13 +911,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -717,6 +958,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
index d5859b78fb5d59c377de3b001289790a7b1f63fd..46619a00611b5d79dc814f9a8fc7a657f3792991 100644 (file)
@@ -53,9 +53,6 @@ uscan.$(OBJEXT): uscan.c ../common-src/amanda.h uparse.h
 uparse.$(OBJEXT): uparse.c ../common-src/amanda.h amrecover.h
        $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
 
-INSTALLPERMS_exec = \
-       dest=$(sbindir) chown=amanda chmod=0750 $(sbin_PROGRAMS)
-
 lint:
        @f="$(amrecover_CSRC)";                                                 \
        (cd ../common-src; make listlibsrc);                                    \
index 1ff18f30d6a7346790e81b5bb987e2523ca5018d..28060da0e2ebe9c057e3516abf11100892d7a293 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -132,7 +134,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -160,7 +161,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -173,10 +173,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -190,7 +194,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -203,10 +209,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -218,21 +227,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -320,7 +333,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -340,10 +353,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -399,78 +409,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -481,12 +546,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -501,17 +595,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -520,60 +618,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -581,13 +738,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -596,9 +759,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -634,7 +800,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -643,7 +808,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -651,19 +815,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -689,47 +876,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -737,6 +980,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -759,19 +1003,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -781,13 +1027,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -831,6 +1074,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -890,6 +1134,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/client-src   \
@@ -920,9 +1177,6 @@ amrecover_CSRC = amrecover.c                                       \
 amrecover_SOURCES = $(amrecover_CSRC)  uparse.y        uscan.l
 noinst_HEADERS = amrecover.h uparse.h
 AM_YFLAGS = -d
-INSTALLPERMS_exec = \
-       dest=$(sbindir) chown=amanda chmod=0750 $(sbin_PROGRAMS)
-
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -1276,29 +1530,12 @@ uninstall-am: uninstall-sbinPROGRAMS
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index 3ec633da6321ef45bde6e3cef4c066a35a06f851..2764abbbbb2dbff4a0e8d201c5471ddd791d5ec9 100644 (file)
@@ -137,6 +137,7 @@ get_line(void)
     server_line = newstralloc(server_line, mesg_buffer);
     amfree(mesg_buffer);
     mesg_buffer = newbuf;
+    amrecover_debug(1, "server_line: %s\n", server_line);
     amrecover_debug(1, "get: %s\n", mesg_buffer);
     return 0;
 }
@@ -300,8 +301,6 @@ quit(void)
     stop_amindexd();
 }
 
-char *localhost = NULL;
-
 #ifdef DEFAULT_TAPE_SERVER
 # define DEFAULT_TAPE_SERVER_FAILOVER (DEFAULT_TAPE_SERVER)
 #else
@@ -325,6 +324,7 @@ main(
     int response_error;
     struct tm *tm;
     config_overrides_t *cfg_ovr;
+    char *starting_hostname = NULL;
 
     /*
      * Configure program for internationalization:
@@ -344,13 +344,6 @@ main(
 
     dbopen(DBG_SUBDIR_CLIENT);
 
-    localhost = alloc(MAX_HOSTNAME_LENGTH+1);
-    if (gethostname(localhost, MAX_HOSTNAME_LENGTH) != 0) {
-       error(_("cannot determine local host name\n"));
-       /*NOTREACHED*/
-    }
-    localhost[MAX_HOSTNAME_LENGTH] = '\0';
-
     /* treat amrecover-specific command line options as the equivalent
      * -o command-line options to set configuration values */
     cfg_ovr = new_config_overrides(argc/2);
@@ -367,7 +360,7 @@ main(
     }
 
     /* now parse regular command-line '-' options */
-    while ((i = getopt(argc, argv, "o:C:s:t:d:U")) != EOF) {
+    while ((i = getopt(argc, argv, "o:C:s:t:d:Uh:")) != EOF) {
        switch (i) {
            case 'C':
                add_config_override(cfg_ovr, "conf", optarg);
@@ -389,6 +382,10 @@ main(
                add_config_override_opt(cfg_ovr, optarg);
                break;
 
+           case 'h':
+               starting_hostname = g_strdup(optarg);
+               break;
+
            case 'U':
            case '?':
                (void)g_printf(USAGE);
@@ -422,6 +419,15 @@ main(
     our_features = am_init_feature_set();
     our_features_string = am_feature_to_string(our_features);
 
+    if (!starting_hostname) {
+       starting_hostname = alloc(MAX_HOSTNAME_LENGTH+1);
+       if (gethostname(starting_hostname, MAX_HOSTNAME_LENGTH) != 0) {
+           error(_("cannot determine local host name\n"));
+           /*NOTREACHED*/
+       }
+       starting_hostname[MAX_HOSTNAME_LENGTH] = '\0';
+    }
+
     server_name = NULL;
     if (getconf_seen(CNF_INDEX_SERVER) == -2) { /* command line argument */
        server_name = getconf_str(CNF_INDEX_SERVER);
@@ -584,7 +590,7 @@ main(
     if (server_happy()) {
        /* set host we are restoring to this host by default */
        amfree(dump_hostname);
-       set_host(localhost);
+       set_host(starting_hostname);
        if (dump_hostname)
            g_printf(_("Use the setdisk command to choose dump disk to recover\n"));
        else
index 92a9e7d20dcf023998a49abb24efdebb23baf5a4..165de61a2c2ddb5f54330b183b38f98bcff83065 100644 (file)
@@ -230,10 +230,11 @@ suck_dir_list_from_server(void)
            continue;
        }
        tape = s - 1;
-       skip_non_whitespace(s, ch);
+       skip_quoted_string(s, ch);
        tape_undo = s - 1;
        tape_undo_ch = *tape_undo;
        *tape_undo = '\0';
+       tape = unquote_string(tape);
 
        if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_OLSD)) {
            long long fileno_ = (long long)0;
@@ -263,6 +264,7 @@ suck_dir_list_from_server(void)
            dir = stralloc(disk_path_slash_dot);
        }
        add_dir_list_item(date, level, tape, fileno, dir);
+       amfree(tape);
        amfree(dir);
     }
     amfree(disk_path_slash_dot);
index d254022ed573a72b3efe060ef171ffec3fa746ab..baac50775b4705014b229ac80b813ffb2a5f6e05 100644 (file)
@@ -72,6 +72,7 @@ typedef struct ctl_data_s {
   data_path_t              data_path;
   char                    *addrs;
   backup_support_option_t *bsu;
+  gint64                   bytes_read;
 } ctl_data_t;
 
 #define SKIP_TAPE 2
@@ -972,9 +973,10 @@ add_file(
                        continue;
                    }
                     fp = s-1;
-                    skip_non_whitespace(s, ch);
+                    skip_quoted_string(s, ch);
                     s[-1] = '\0';
-                    lditem.tape = newstralloc(lditem.tape, fp);
+                   amfree(lditem.tape);
+                   lditem.tape = unquote_string(fp);
                     s[-1] = (char)ch;
 
                    if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
@@ -1886,6 +1888,8 @@ extract_files_child(
     case IS_TAR:
     case IS_GNUTAR:
        g_ptr_array_add(argv_ptr, stralloc("tar"));
+       /* ignore trailing zero blocks on input (this was the default until tar-1.21) */
+       g_ptr_array_add(argv_ptr, stralloc("--ignore-zeros"));
        g_ptr_array_add(argv_ptr, stralloc("--numeric-owner"));
        g_ptr_array_add(argv_ptr, stralloc("-xpGvf"));
        g_ptr_array_add(argv_ptr, stralloc("-"));       /* data on stdin */
@@ -1961,7 +1965,7 @@ extract_files_child(
            }
 
        } else if (proplist) {
-           g_hash_table_foreach(proplist, &proplist_add_to_argv, argv_ptr);
+           property_add_to_argv(argv_ptr, proplist);
        }
        break;
     }
@@ -2100,6 +2104,7 @@ writer_intermediary(
     ctl_data.data_path     = DATA_PATH_AMANDA;
     ctl_data.addrs         = NULL;
     ctl_data.bsu           = NULL;
+    ctl_data.bytes_read    = 0;
 
     security_stream_read(amidxtaped_streams[DATAFD].fd,
                         read_amidxtaped_data, &ctl_data);
@@ -2169,6 +2174,7 @@ writer_intermediary(
            return -1;
        }
     }
+    g_debug("bytes read: %jd", (intmax_t)ctl_data.bytes_read);
     return(0);
 }
 
@@ -2739,6 +2745,7 @@ read_amidxtaped_data(
            start_processing_data(ctl_data);
        }
     } else {
+       ctl_data->bytes_read += size;
        /* Only the data is sent to the child */
        /*
         * We ignore errors while writing to the index file.
index 867e3e3f2cb2f13c6a80d0f81a4fa68bb69a785d..f326b328e5e39e8b88b87178b8665f7f6109b877 100644 (file)
@@ -24,12 +24,13 @@ sbin_PROGRAMS =             amadmin         amcheck         \
                        amflush         \
                        amservice
 
-amlibexec_PROGRAMS =   amindexd        amlogroll       amtrmidx        \
+amlibexec_PROGRAMS =   amindexd        amtrmidx        \
                        amtrmlog        driver          dumper          \
                        planner         amcleanupdisk   \
                        chunker
 
 amlibexec_SCRIPTS_PERL = \
+           amlogroll \
            taper \
            amcheck-device
 
@@ -45,6 +46,7 @@ sbin_SCRIPTS_PERL = \
            amreport \
            amtape \
            amvault \
+           amdump \
            amstatus
 if WANT_RESTORE
 amlibexec_SCRIPTS_PERL += \
@@ -55,8 +57,8 @@ sbin_SCRIPTS_PERL += \
 endif
 
 sbin_SCRIPTS_SHELL = \
-           amcheckdb \
-           amdump
+           amcheckdb
+
 
 SCRIPTS_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL)
 SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL)
@@ -64,22 +66,11 @@ sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL)
 amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL)
 
 INSTALLPERMS_exec = \
-       dest=$(sbindir) chown=amanda chmod= \
-               $(sbin_PROGRAMS) \
-       chown=root chmod=04750 \
+       dest=$(sbindir) chown=root:setuid chmod=04750 \
                amcheck amservice \
-       dest=$(amlibexecdir) chown=amanda chmod= \
-               $(amlibexec_PROGRAMS) \
-               $(amlibexec_SCRIPTS) \
-       chown=root chmod=04750 \
+       dest=$(amlibexecdir) \
                dumper planner
 
-INSTALLPERMS_data = \
-       dest=$(sbindir) chown=amanda chmod= \
-               $(sbin_SCRIPTS) \
-       dest=$(amlibexecdir) chown=amanda chmod= \
-               $(amlibexec_SCRIPTS)
-
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
 # libraries, and because of the way libtool sets up the command line, we
@@ -90,8 +81,7 @@ INSTALLPERMS_data = \
 LDADD = ../common-src/libamanda.la   \
        libamserver.la               \
        ../device-src/libamdevice.la     \
-       ../common-src/libamanda.la   \
-        $(READLINE_LIBS)
+       ../common-src/libamanda.la
 
 libamserver_la_SOURCES=        amindex.c       \
                        diskfile.c      driverio.c      cmdline.c  \
index e8e9f0e347b1ca5f2b4238769720c5a84a74d148..554a5bf8e5dbe94d71ee5cec7f89909a976f01ed 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -190,10 +192,9 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
 @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh)
 sbin_PROGRAMS = amadmin$(EXEEXT) amcheck$(EXEEXT) amflush$(EXEEXT) \
        amservice$(EXEEXT)
-amlibexec_PROGRAMS = amindexd$(EXEEXT) amlogroll$(EXEEXT) \
-       amtrmidx$(EXEEXT) amtrmlog$(EXEEXT) driver$(EXEEXT) \
-       dumper$(EXEEXT) planner$(EXEEXT) amcleanupdisk$(EXEEXT) \
-       chunker$(EXEEXT)
+amlibexec_PROGRAMS = amindexd$(EXEEXT) amtrmidx$(EXEEXT) \
+       amtrmlog$(EXEEXT) driver$(EXEEXT) dumper$(EXEEXT) \
+       planner$(EXEEXT) amcleanupdisk$(EXEEXT) chunker$(EXEEXT)
 @WANT_RESTORE_TRUE@am__append_2 = \
 @WANT_RESTORE_TRUE@        amidxtaped
 
@@ -218,7 +219,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -246,7 +246,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -259,10 +258,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -276,7 +279,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -289,10 +294,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -304,21 +312,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -386,97 +398,73 @@ PROGRAMS = $(amlibexec_PROGRAMS) $(sbin_PROGRAMS)
 amadmin_SOURCES = amadmin.c
 amadmin_OBJECTS = amadmin.$(OBJEXT)
 amadmin_LDADD = $(LDADD)
-am__DEPENDENCIES_1 =
 amadmin_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 amcheck_SOURCES = amcheck.c
 amcheck_OBJECTS = amcheck.$(OBJEXT)
 amcheck_LDADD = $(LDADD)
 amcheck_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 amcleanupdisk_SOURCES = amcleanupdisk.c
 amcleanupdisk_OBJECTS = amcleanupdisk.$(OBJEXT)
 amcleanupdisk_LDADD = $(LDADD)
 amcleanupdisk_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 amflush_SOURCES = amflush.c
 amflush_OBJECTS = amflush.$(OBJEXT)
 amflush_LDADD = $(LDADD)
 amflush_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 am__objects_1 = amindexd.$(OBJEXT) disk_history.$(OBJEXT) \
        list_dir.$(OBJEXT)
 am_amindexd_OBJECTS = $(am__objects_1)
 amindexd_OBJECTS = $(am_amindexd_OBJECTS)
-am__DEPENDENCIES_2 = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
-amindexd_DEPENDENCIES = $(am__DEPENDENCIES_2) \
-       ../amandad-src/libamandad.la
-amlogroll_SOURCES = amlogroll.c
-amlogroll_OBJECTS = amlogroll.$(OBJEXT)
-amlogroll_LDADD = $(LDADD)
-amlogroll_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+amindexd_DEPENDENCIES = $(LDADD) ../amandad-src/libamandad.la
 amservice_SOURCES = amservice.c
 amservice_OBJECTS = amservice.$(OBJEXT)
 amservice_LDADD = $(LDADD)
 amservice_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 amtrmidx_SOURCES = amtrmidx.c
 amtrmidx_OBJECTS = amtrmidx.$(OBJEXT)
 amtrmidx_LDADD = $(LDADD)
 amtrmidx_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 amtrmlog_SOURCES = amtrmlog.c
 amtrmlog_OBJECTS = amtrmlog.$(OBJEXT)
 amtrmlog_LDADD = $(LDADD)
 amtrmlog_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 chunker_SOURCES = chunker.c
 chunker_OBJECTS = chunker.$(OBJEXT)
 chunker_LDADD = $(LDADD)
 chunker_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 am_diskfile_OBJECTS = diskfile.test.$(OBJEXT)
 diskfile_OBJECTS = $(am_diskfile_OBJECTS)
 diskfile_LDADD = $(LDADD)
 diskfile_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 driver_SOURCES = driver.c
 driver_OBJECTS = driver.$(OBJEXT)
 driver_LDADD = $(LDADD)
 driver_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 dumper_SOURCES = dumper.c
 dumper_OBJECTS = dumper.$(OBJEXT)
 dumper_LDADD = $(LDADD)
 dumper_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 am_infofile_OBJECTS = infofile.test.$(OBJEXT)
 infofile_OBJECTS = $(am_infofile_OBJECTS)
 infofile_LDADD = $(LDADD)
 infofile_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 planner_SOURCES = planner.c
 planner_OBJECTS = planner.$(OBJEXT)
 planner_LDADD = $(LDADD)
 planner_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la \
-       $(am__DEPENDENCIES_1)
+       ../device-src/libamdevice.la ../common-src/libamanda.la
 SCRIPTS = $(amlibexec_SCRIPTS) $(sbin_SCRIPTS)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
@@ -492,15 +480,13 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
 SOURCES = $(libamserver_la_SOURCES) amadmin.c amcheck.c \
-       amcleanupdisk.c amflush.c $(amindexd_SOURCES) amlogroll.c \
-       amservice.c amtrmidx.c amtrmlog.c chunker.c \
-       $(diskfile_SOURCES) driver.c dumper.c $(infofile_SOURCES) \
-       planner.c
+       amcleanupdisk.c amflush.c $(amindexd_SOURCES) amservice.c \
+       amtrmidx.c amtrmlog.c chunker.c $(diskfile_SOURCES) driver.c \
+       dumper.c $(infofile_SOURCES) planner.c
 DIST_SOURCES = $(libamserver_la_SOURCES) amadmin.c amcheck.c \
-       amcleanupdisk.c amflush.c $(amindexd_SOURCES) amlogroll.c \
-       amservice.c amtrmidx.c amtrmlog.c chunker.c \
-       $(diskfile_SOURCES) driver.c dumper.c $(infofile_SOURCES) \
-       planner.c
+       amcleanupdisk.c amflush.c $(amindexd_SOURCES) amservice.c \
+       amtrmidx.c amtrmlog.c chunker.c $(diskfile_SOURCES) driver.c \
+       dumper.c $(infofile_SOURCES) planner.c
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
@@ -526,7 +512,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -546,10 +532,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -605,78 +588,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -687,12 +725,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -707,17 +774,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -726,60 +797,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -787,13 +917,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -802,9 +938,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -840,7 +979,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -849,7 +987,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -857,19 +994,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -895,47 +1055,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -943,6 +1159,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -965,19 +1182,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -987,13 +1206,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -1037,6 +1253,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -1101,6 +1318,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/amandad-src  \
@@ -1113,35 +1343,24 @@ AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
 LINT = $(AMLINT)
 LINTFLAGS = $(AMLINTFLAGS)
 amlib_LTLIBRARIES = libamserver.la
-amlibexec_SCRIPTS_PERL = taper amcheck-device $(am__append_2)
+amlibexec_SCRIPTS_PERL = amlogroll taper amcheck-device \
+       $(am__append_2)
 sbin_SCRIPTS_PERL = amaddclient amoverview amserverconfig amtoc \
        amcheckdump amcleanup amrmtape amlabel amreport amtape amvault \
-       amstatus $(am__append_3)
+       amdump amstatus $(am__append_3)
 sbin_SCRIPTS_SHELL = \
-           amcheckdb \
-           amdump
+           amcheckdb
 
 SCRIPTS_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL)
 SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL)
 sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL)
 amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL)
 INSTALLPERMS_exec = \
-       dest=$(sbindir) chown=amanda chmod= \
-               $(sbin_PROGRAMS) \
-       chown=root chmod=04750 \
+       dest=$(sbindir) chown=root:setuid chmod=04750 \
                amcheck amservice \
-       dest=$(amlibexecdir) chown=amanda chmod= \
-               $(amlibexec_PROGRAMS) \
-               $(amlibexec_SCRIPTS) \
-       chown=root chmod=04750 \
+       dest=$(amlibexecdir) \
                dumper planner
 
-INSTALLPERMS_data = \
-       dest=$(sbindir) chown=amanda chmod= \
-               $(sbin_SCRIPTS) \
-       dest=$(amlibexecdir) chown=amanda chmod= \
-               $(amlibexec_SCRIPTS)
-
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -1152,8 +1371,7 @@ INSTALLPERMS_data = \
 LDADD = ../common-src/libamanda.la   \
        libamserver.la               \
        ../device-src/libamdevice.la     \
-       ../common-src/libamanda.la   \
-        $(READLINE_LIBS)
+       ../common-src/libamanda.la
 
 libamserver_la_SOURCES = amindex.c     \
                        diskfile.c      driverio.c      cmdline.c  \
@@ -1350,9 +1568,6 @@ amflush$(EXEEXT): $(amflush_OBJECTS) $(amflush_DEPENDENCIES)
 amindexd$(EXEEXT): $(amindexd_OBJECTS) $(amindexd_DEPENDENCIES) 
        @rm -f amindexd$(EXEEXT)
        $(LINK) $(amindexd_OBJECTS) $(amindexd_LDADD) $(LIBS)
-amlogroll$(EXEEXT): $(amlogroll_OBJECTS) $(amlogroll_DEPENDENCIES) 
-       @rm -f amlogroll$(EXEEXT)
-       $(LINK) $(amlogroll_OBJECTS) $(amlogroll_LDADD) $(LIBS)
 amservice$(EXEEXT): $(amservice_OBJECTS) $(amservice_DEPENDENCIES) 
        @rm -f amservice$(EXEEXT)
        $(LINK) $(amservice_OBJECTS) $(amservice_LDADD) $(LIBS)
@@ -1461,7 +1676,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflush.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amindex.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amindexd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amlogroll.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amservice.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amtrmidx.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amtrmlog.Po@am__quote@
@@ -1596,6 +1810,7 @@ distdir: $(DISTFILES)
        $(MAKE) $(AM_MAKEFLAGS) \
          top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-hook
+@SYNTAX_CHECKS_FALSE@check-local:
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-local
 check: $(BUILT_SOURCES)
@@ -1688,7 +1903,7 @@ install-ps: install-ps-am
 
 install-ps-am:
 
-installcheck-am: installcheck-local
+installcheck-am:
 
 maintainer-clean: maintainer-clean-am
        -rm -rf ./$(DEPDIR)
@@ -1727,24 +1942,26 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
        install-html install-html-am install-info install-info-am \
        install-man install-pdf install-pdf-am install-ps \
        install-ps-am install-sbinPROGRAMS install-sbinSCRIPTS \
-       install-strip installcheck installcheck-am installcheck-local \
-       installdirs maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-compile mostlyclean-generic \
-       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
-       uninstall-am uninstall-amlibLTLIBRARIES \
-       uninstall-amlibexecPROGRAMS uninstall-amlibexecSCRIPTS \
-       uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
+       uninstall-amlibexecSCRIPTS uninstall-sbinPROGRAMS \
+       uninstall-sbinSCRIPTS
 
 
 # Perl
 %: %.pl $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@          rm $@.nouselib; \
-@CHECK_SCRIPTS_AT_BUILD_TRUE@  fi
+@SYNTAX_CHECKS_TRUE@   @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
+@SYNTAX_CHECKS_TRUE@           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
+@SYNTAX_CHECKS_TRUE@           rm $@.nouselib; \
+@SYNTAX_CHECKS_TRUE@   else \
+@SYNTAX_CHECKS_TRUE@           echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
+@SYNTAX_CHECKS_TRUE@   fi
 
 %.pl: %.pl.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
@@ -1768,33 +1985,22 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
 %.awk: %.awk.in $(top_builddir)/config.status
        $(top_builddir)/config.status --file=$@:$<
 
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
 check-perl: $(SCRIPTS_PERL)
        @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
            test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
-           if test -n "$(PERL)"; then \
-                   for perlobj in $$SCRIPTS_PERL; do \
-                           sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
-                           $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
-                           rm $$perlobj.nouselib; \
-                   done; \
-           fi \
+           for perlobj in $$SCRIPTS_PERL; do \
+               sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+               $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+               rm $$perlobj.nouselib; \
+           done; \
        fi
-check-local: check-perl
+@SYNTAX_CHECKS_TRUE@check-local: check-perl
 
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
-       @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
-       if test x"$(SKIP_CHECKS)" = x"" && \
-           test -n "$(PERL)"; then \
-               for perlobj in $$SCRIPTS_PERL; do \
-                       $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
-               done; \
-       fi
-installcheck-local: installcheck-perl
-
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
 check-shell: $(SCRIPTS_SHELL)
        @SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
        if test x"$(SKIP_CHECKS)" = x"" && \
@@ -1812,7 +2018,7 @@ check-shell: $(SCRIPTS_SHELL)
                        echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
        fi
-check-local: check-shell
+@SYNTAX_CHECKS_TRUE@check-local: check-shell
 
 # make sure that the sources for all shell and perl scripts get included
 # in the distribution
@@ -1852,29 +2058,12 @@ dist-hook: dist-scripts
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index aa8155fc3a96a47a1a9e6351ae972a763aae1ecf..96e117b41195a1ca5e49288e1174b201c1639831 100644 (file)
@@ -78,6 +78,8 @@ static int next_level0(disk_t *dp, info_t *info);
 int bump_thresh(int level);
 void export_db(int argc, char **argv);
 void import_db(int argc, char **argv);
+void hosts(int argc, char **argv);
+void dles(int argc, char **argv);
 void disklist(int argc, char **argv);
 void disklist_one(disk_t *dp);
 void show_version(int argc, char **argv);
@@ -110,6 +112,10 @@ static const struct {
        T_(" [<hostname> [<disks>]* ]+\t# Clear bump command.") },
     { "disklist", disklist,
        T_(" [<hostname> [<disks>]* ]*\t# Debug disklist entries.") },
+    { "hosts", hosts,
+       T_("\t\t\t\t\t# Show all distinct hosts in disklist.") },
+    { "dles", dles,
+       T_("\t\t\t\t\t# Show all dles in disklist, one per line.") },
     { "reuse", reuse,
        T_(" <tapelabel> ...\t\t # re-use this tape.") },
     { "no-reuse", noreuse,
@@ -1100,6 +1106,8 @@ find(
     char *sort_order = NULL;
     find_result_t *output_find;
     char *errstr;
+    char **output_find_log;
+    char **name;
 
     if(argc < 3) {
        g_fprintf(stderr,
@@ -1147,6 +1155,13 @@ find(
     }
     errstr = match_disklist(&diskq, argc-(start_argc-1), argv+(start_argc-1));
 
+    /* check all log file exists */
+    output_find_log = find_log();
+    for (name = output_find_log; *name != NULL; name++) {
+        amfree(*name);
+    }
+    amfree(output_find_log);
+
     output_find = find_dump(&diskq); /* Add deleted dump to diskq */
     if(argc-(start_argc-1) > 0) {
        amfree(errstr);
@@ -2171,7 +2186,7 @@ disklist_one(
        break;
     case COMP_CUST:
        g_printf("CLIENT CUSTOM\n");
-       g_printf("        client_custom_compress \"%s\"\n",
+       g_printf("        client-custom-compress \"%s\"\n",
                    dp->clntcompprog? dp->clntcompprog : "");
        break;
     case COMP_SERVER_FAST:
@@ -2182,7 +2197,7 @@ disklist_one(
        break;
     case COMP_SERVER_CUST:
        g_printf("SERVER CUSTOM\n");
-       g_printf("        server_custom_compress \"%s\"\n",
+       g_printf("        server-custom-compress \"%s\"\n",
                    dp->srvcompprog? dp->srvcompprog : "");
        break;
     }
@@ -2198,26 +2213,26 @@ disklist_one(
        break;
     case ENCRYPT_CUST:
        g_printf("CLIENT\n");
-       g_printf("        client_encrypt \"%s\"\n",
+       g_printf("        client-encrypt \"%s\"\n",
                    dp->clnt_encrypt? dp->clnt_encrypt : "");
-       g_printf("        client_decrypt_option \"%s\"\n",
+       g_printf("        client-decrypt-option \"%s\"\n",
                    dp->clnt_decrypt_opt? dp->clnt_decrypt_opt : "");
        break;
     case ENCRYPT_SERV_CUST:
        g_printf("SERVER\n");
-       g_printf("        server_encrypt \"%s\"\n",
+       g_printf("        server-encrypt \"%s\"\n",
                    dp->srv_encrypt? dp->srv_encrypt : "");
-       g_printf("        server_decrypt_option \"%s\"\n",
+       g_printf("        server-decrypt-option \"%s\"\n",
                    dp->srv_decrypt_opt? dp->srv_decrypt_opt : "");
        break;
     }
 
     g_printf("        auth \"%s\"\n", dp->auth);
     g_printf("        kencrypt %s\n", (dp->kencrypt? "YES" : "NO"));
-    g_printf("        amandad_path \"%s\"\n", dp->amandad_path);
-    g_printf("        client_username \"%s\"\n", dp->client_username);
-    g_printf("        client_port \"%s\"\n", dp->client_port);
-    g_printf("        ssh_keys \"%s\"\n", dp->ssh_keys);
+    g_printf("        amandad-path \"%s\"\n", dp->amandad_path);
+    g_printf("        client-username \"%s\"\n", dp->client_username);
+    g_printf("        client-port \"%s\"\n", dp->client_port);
+    g_printf("        ssh-keys \"%s\"\n", dp->ssh_keys);
 
     g_printf("        holdingdisk ");
     switch(dp->to_holdingdisk) {
@@ -2236,18 +2251,19 @@ disklist_one(
     g_printf("        index %s\n", (dp->index? "YES" : "NO"));
     g_printf("        starttime %04d\n", (int)dp->starttime);
     if(dp->tape_splitsize > (off_t)0) {
-       g_printf("        tape_splitsize %lld\n",
+       g_printf("        tape-splitsize %lld\n",
               (long long)dp->tape_splitsize);
     }
     if(dp->split_diskbuffer) {
-       g_printf("        split_diskbuffer %s\n", dp->split_diskbuffer);
+       g_printf("        split-diskbuffer %s\n", dp->split_diskbuffer);
     }
     if(dp->fallback_splitsize > (off_t)0) {
-       g_printf("        fallback_splitsize %lldMb\n",
+       g_printf("        fallback-splitsize %lldMb\n",
               (long long)(dp->fallback_splitsize / (off_t)1024));
     }
     g_printf("        skip-incr %s\n", (dp->skip_incr? "YES" : "NO"));
     g_printf("        skip-full %s\n", (dp->skip_full? "YES" : "NO"));
+    g_printf("        allow-split %s\n", (dp->allow_split ? "YES" : "NO"));
     g_printf("        spindle %d\n", dp->spindle);
     pp_scriptlist = dp->pp_scriptlist;
     while (pp_scriptlist != NULL) {
@@ -2286,6 +2302,44 @@ disklist(
            disklist_one(dp);
 }
 
+/* ----------------------------------------------- */
+
+void
+hosts(
+    int                argc G_GNUC_UNUSED,
+    char **    argv G_GNUC_UNUSED)
+{
+    disk_t *dp;
+    gint sentinel = 1;
+    GHashTable *seen = g_hash_table_new(g_str_hash, g_str_equal);
+
+    /* enumerate all hosts, skipping those that have been seen (since
+     * there may be more than one DLE on a host */
+    for(dp = diskq.head; dp != NULL; dp = dp->next) {
+       char *hostname = dp->host->hostname;
+       if (g_hash_table_lookup(seen, hostname))
+           continue;
+       g_printf("%s\n", hostname);
+       g_hash_table_insert(seen, hostname, &sentinel);
+    }
+    g_hash_table_destroy(seen);
+}
+
+/* ----------------------------------------------- */
+
+void
+dles(
+    int                argc G_GNUC_UNUSED,
+    char **    argv G_GNUC_UNUSED)
+{
+    disk_t *dp;
+
+    for(dp = diskq.head; dp != NULL; dp = dp->next)
+       g_printf("%s %s\n", dp->host->hostname, dp->name);
+}
+
+/* ----------------------------------------------- */
+
 void
 show_version(
     int                argc,
index 3b41c700e2b1a6d89ffd8521002f58fd6e8753b2..2c843a9b46b0955efc8e9ebe28c328ec965d1c04 100644 (file)
@@ -660,8 +660,12 @@ start_server_check(
     tapetype_t *tp = NULL;
     char *quoted;
     int res;
-    intmax_t kb_avail;
+    intmax_t kb_avail, kb_needed;
     off_t tape_size;
+    gboolean printed_small_part_size_warning = FALSE;
+    char *small_part_size_warning =
+       _(" This may create > 1000 parts, severely degrading backup/restore performance.\n"
+       " See http://wiki.zmanda.com/index.php/Splitsize_too_small for more information.\n");
 
     switch(pid = fork()) {
     case -1:
@@ -682,6 +686,10 @@ start_server_check(
     
     startclock();
 
+    /* server does not need root privileges, and the access() calls below use the real userid,
+     * so totally drop privileges at this point (making the userid equal to the dumpuser) */
+    set_root_privs(-1);
+
     if((outf = fdopen(fd, "w")) == NULL) {
        error(_("fdopen %d: %s"), fd, strerror(errno));
        /*NOTREACHED*/
@@ -727,14 +735,14 @@ start_server_check(
 
        if (getconf_int(CNF_FLUSH_THRESHOLD_SCHEDULED) <
                                 getconf_int(CNF_FLUSH_THRESHOLD_DUMPED)) {
-           g_fprintf(outf, _("WARNING: flush_threshold_dumped (%d) must be less than or equal to flush_threshold_scheduled (%d).\n"), 
+           g_fprintf(outf, _("WARNING: flush-threshold-dumped (%d) must be less than or equal to flush-threshold-scheduled (%d).\n"),
                      getconf_int(CNF_FLUSH_THRESHOLD_DUMPED),
                      getconf_int(CNF_FLUSH_THRESHOLD_SCHEDULED));
        }
 
        if (getconf_int(CNF_FLUSH_THRESHOLD_SCHEDULED) <
                                 getconf_int(CNF_TAPERFLUSH)) {
-           g_fprintf(outf, _("WARNING: taperflush (%d) must be less than or equal to flush_threshold_scheduled (%d).\n"), 
+           g_fprintf(outf, _("WARNING: taperflush (%d) must be less than or equal to flush-threshold-scheduled (%d).\n"),
                      getconf_int(CNF_TAPERFLUSH),
                      getconf_int(CNF_FLUSH_THRESHOLD_SCHEDULED));
        }
@@ -757,7 +765,6 @@ start_server_check(
                        "the 'tapetype' parameter\n"));
            confbad = 1;
        }
-
     }
 
     /*
@@ -829,7 +836,10 @@ start_server_check(
        char *holdfile;
         char * tapename;
        struct stat statbuf;
-       
+       guint64 part_size, part_cache_max_size, tape_size;
+       part_cache_type_t part_cache_type;
+       char *part_cache_dir;
+
        tapefile = config_dir_relative(getconf_str(CNF_TAPELIST));
        /*
         * XXX There Really Ought to be some error-checking here... dhw
@@ -902,6 +912,121 @@ start_server_check(
                do_tapechk = 0;
            }
        }
+
+       /* check tapetype-based splitting parameters */
+       part_size = tapetype_get_part_size(tp);
+       part_cache_type = tapetype_get_part_cache_type(tp);
+       part_cache_dir = tapetype_get_part_cache_dir(tp);
+       part_cache_max_size = tapetype_get_part_cache_max_size(tp);
+
+       if (!tapetype_seen(tp, TAPETYPE_PART_SIZE)) {
+           if (tapetype_seen(tp, TAPETYPE_PART_CACHE_TYPE)) {
+               g_fprintf(outf, "ERROR: part-cache-type specified, but no part-size\n");
+               tapebad = 1;
+           }
+           if (tapetype_seen(tp, TAPETYPE_PART_CACHE_DIR)) {
+               g_fprintf(outf, "ERROR: part-cache-dir specified, but no part-size\n");
+               tapebad = 1;
+           }
+           if (tapetype_seen(tp, TAPETYPE_PART_CACHE_MAX_SIZE)) {
+               g_fprintf(outf, "ERROR: part-cache-max-size specified, but no part-size\n");
+               tapebad = 1;
+           }
+       } else {
+           switch (part_cache_type) {
+           case PART_CACHE_TYPE_DISK:
+               if (!tapetype_seen(tp, TAPETYPE_PART_CACHE_DIR)
+                           || !part_cache_dir || !*part_cache_dir) {
+                   g_fprintf(outf,
+                       "ERROR: part-cache-type is DISK, but no part-cache-dir specified\n");
+                   tapebad = 1;
+               } else {
+                   if(get_fs_usage(part_cache_dir, NULL, &fsusage) == -1) {
+                       g_fprintf(outf, "ERROR: part-cache-dir '%s': %s\n",
+                               part_cache_dir, strerror(errno));
+                       tapebad = 1;
+                   } else {
+                       kb_avail = fsusage.fsu_bavail_top_bit_set?
+                           0 : fsusage.fsu_bavail / 1024 * fsusage.fsu_blocksize;
+                       kb_needed = part_size;
+                       if (tapetype_seen(tp, TAPETYPE_PART_CACHE_MAX_SIZE)) {
+                           kb_needed = part_cache_max_size;
+                       }
+                       if (kb_avail < kb_needed) {
+                           g_fprintf(outf,
+                               "ERROR: part-cache-dir has %ju %sB available, but needs %ju %sB\n",
+                               kb_avail/(uintmax_t)unitdivisor, displayunit,
+                               kb_needed/(uintmax_t)unitdivisor, displayunit);
+                           tapebad = 1;
+                       }
+                   }
+               }
+               break;
+
+           case PART_CACHE_TYPE_MEMORY:
+               kb_avail = physmem_total() / 1024;
+               kb_needed = part_size;
+               if (tapetype_seen(tp, TAPETYPE_PART_CACHE_MAX_SIZE)) {
+                   kb_needed = part_cache_max_size;
+               }
+               if (kb_avail < kb_needed) {
+                   g_fprintf(outf,
+                       "ERROR: system has %ju %sB memory, but part cache needs %ju %sB\n",
+                       kb_avail/(uintmax_t)unitdivisor, displayunit,
+                       kb_needed/(uintmax_t)unitdivisor, displayunit);
+                   tapebad = 1;
+               }
+
+               /* FALL THROUGH */
+
+           case PART_CACHE_TYPE_NONE:
+               if (tapetype_seen(tp, TAPETYPE_PART_CACHE_DIR)) {
+                   g_fprintf(outf,
+                       "ERROR: part-cache-dir specified, but part-cache-type is not DISK\n");
+                   tapebad = 1;
+               }
+               break;
+           }
+       }
+
+       if (tapetype_seen(tp, TAPETYPE_PART_SIZE) && part_size == 0
+               && part_cache_type != PART_CACHE_TYPE_NONE) {
+           g_fprintf(outf,
+                   "ERROR: part_size is zero, but part-cache-type is not 'none'\n");
+           tapebad = 1;
+       }
+
+       if (tapetype_seen(tp, TAPETYPE_PART_CACHE_MAX_SIZE)) {
+           if (part_cache_type == PART_CACHE_TYPE_NONE) {
+               g_fprintf(outf,
+                   "ERROR: part-cache-max-size is specified but no part cache is in use\n");
+               tapebad = 1;
+           }
+
+           if (part_cache_max_size > part_size) {
+               g_fprintf(outf,
+                   "WARNING: part-cache-max-size is greater than part-size\n");
+           }
+       }
+
+       tape_size = tapetype_get_length(tp);
+       if (part_size && part_size * 1000 < tape_size) {
+           g_fprintf(outf,
+                     _("WARNING: part-size of %ju %sB < 0.1%% of tape length.\n"),
+                     (uintmax_t)part_size/(uintmax_t)unitdivisor, displayunit);
+           if (!printed_small_part_size_warning) {
+               printed_small_part_size_warning = TRUE;
+               g_fprintf(outf, "%s", small_part_size_warning);
+           }
+       } else if (part_cache_max_size && part_cache_max_size * 1000 < tape_size) {
+           g_fprintf(outf,
+                     _("WARNING: part-cache-max-size of %ju %sB < 0.1%% of tape length.\n"),
+                     (uintmax_t)part_cache_max_size/(uintmax_t)unitdivisor, displayunit);
+           if (!printed_small_part_size_warning) {
+               printed_small_part_size_warning = TRUE;
+               g_fprintf(outf, "%s", small_part_size_warning);
+           }
+       }
     }
 
     /* check available disk space */
@@ -1103,18 +1228,6 @@ start_server_check(
        char *disk;
        int conf_tapecycle, conf_runspercycle;
        identlist_t pp_scriptlist;
-       gboolean printed_small_tape_splitsize_warning = FALSE;
-       char *small_tape_splitsize_warning =
-           _(" This may create > 1000 parts, severely degrading backup/restore performance.\n"
-           " To remedy, increase tape_splitsize or disable splitting by setting it to 0\n"
-           " See http://wiki.zmanda.com/index.php/Splitsize_too_small for more information.\n");
-
-       gboolean printed_small_fallback_splitsize_warning = FALSE;
-       char *small_fallback_splitsize_warning =
-           _(" This may create > 1000 parts, severely degrading backup/restore performance.\n"
-           " To remedy, create/set a split_diskbuffer or increase fallback_splitsize\n"
-           " See http://wiki.zmanda.com/index.php/Splitsize_too_small for more information.\n");
-
 
        conf_tapecycle = getconf_int(CNF_TAPECYCLE);
        conf_runspercycle = getconf_int(CNF_RUNSPERCYCLE);
@@ -1342,7 +1455,7 @@ start_server_check(
                if ( dp->encrypt == ENCRYPT_SERV_CUST ) {
                  if ( dp->srv_encrypt[0] == '\0' ) {
                    g_fprintf(outf, _("ERROR: server encryption program not specified\n"));
-                   g_fprintf(outf, _("Specify \"server_custom_encrypt\" in the dumptype\n"));
+                   g_fprintf(outf, _("Specify \"server-custom-encrypt\" in the dumptype\n"));
                    pgmbad = 1;
                  }
                  else if(access(dp->srv_encrypt, X_OK) == -1) {
@@ -1356,7 +1469,7 @@ start_server_check(
                  if ( dp->srvcompprog[0] == '\0' ) {
                    g_fprintf(outf, _("ERROR: server custom compression program "
                                    "not specified\n"));
-                   g_fprintf(outf, _("Specify \"server_custom_compress\" in "
+                   g_fprintf(outf, _("Specify \"server-custom-compress\" in "
                                    "the dumptype\n"));
                    pgmbad = 1;
                  }
@@ -1372,53 +1485,57 @@ start_server_check(
                  }
                }
 
-               /* check tape_splitsize */
-               tape_size = tapetype_get_length(tp);
-               if (dp->tape_splitsize > tape_size) {
-                   g_fprintf(outf,
-                             _("ERROR: %s %s: tape_splitsize > tape size\n"),
-                             hostp->hostname, dp->name);
-                   pgmbad = 1;
-               }
-               if (dp->tape_splitsize && dp->fallback_splitsize * 1024 > physmem_total()) {
-                   g_fprintf(outf,
-                             _("ERROR: %s %s: fallback_splitsize > total available memory\n"),
-                             hostp->hostname, dp->name);
-                   pgmbad = 1;
-               }
-               if (dp->tape_splitsize && dp->fallback_splitsize > tape_size) {
-                   g_fprintf(outf,
-                             _("ERROR: %s %s: fallback_splitsize > tape size\n"),
-                             hostp->hostname, dp->name);
-                   pgmbad = 1;
-               }
+               /* check deprecated splitting parameters */
+               if (dumptype_seen(dp->config, DUMPTYPE_TAPE_SPLITSIZE)
+                   || dumptype_seen(dp->config, DUMPTYPE_SPLIT_DISKBUFFER)
+                   || dumptype_seen(dp->config, DUMPTYPE_FALLBACK_SPLITSIZE)) {
+                   tape_size = tapetype_get_length(tp);
+                   if (dp->tape_splitsize > tape_size) {
+                       g_fprintf(outf,
+                                 _("ERROR: %s %s: tape-splitsize > tape size\n"),
+                                 hostp->hostname, dp->name);
+                       pgmbad = 1;
+                   }
+                   if (dp->tape_splitsize && dp->fallback_splitsize * 1024 > physmem_total()) {
+                       g_fprintf(outf,
+                                 _("ERROR: %s %s: fallback-splitsize > total available memory\n"),
+                                 hostp->hostname, dp->name);
+                       pgmbad = 1;
+                   }
+                   if (dp->tape_splitsize && dp->fallback_splitsize > tape_size) {
+                       g_fprintf(outf,
+                                 _("ERROR: %s %s: fallback-splitsize > tape size\n"),
+                                 hostp->hostname, dp->name);
+                       pgmbad = 1;
+                   }
 
-               /* also check for part sizes that are too small */
-               if (dp->tape_splitsize && dp->tape_splitsize * 1000 < tape_size) {
-                   g_fprintf(outf,
-                             _("WARNING: %s %s: tape_splitsize of %ju %sB < 0.1%% of tape length.\n"),
-                             hostp->hostname, dp->name,
-                             (uintmax_t)dp->tape_splitsize/(uintmax_t)unitdivisor,
-                             displayunit);
-                   if (!printed_small_tape_splitsize_warning) {
-                       printed_small_tape_splitsize_warning = TRUE;
-                       g_fprintf(outf, "%s", small_tape_splitsize_warning);
+                   /* also check for part sizes that are too small */
+                   if (dp->tape_splitsize && dp->tape_splitsize * 1000 < tape_size) {
+                       g_fprintf(outf,
+                                 _("WARNING: %s %s: tape-splitsize of %ju %sB < 0.1%% of tape length.\n"),
+                                 hostp->hostname, dp->name,
+                                 (uintmax_t)dp->tape_splitsize/(uintmax_t)unitdivisor,
+                                 displayunit);
+                       if (!printed_small_part_size_warning) {
+                           printed_small_part_size_warning = TRUE;
+                           g_fprintf(outf, "%s", small_part_size_warning);
+                       }
                    }
-               }
 
-               /* fallback splitsize will be used if split_diskbuffer is empty or NULL */
-               if (dp->tape_splitsize != 0 && dp->fallback_splitsize != 0 &&
-                       (dp->split_diskbuffer == NULL ||
-                        dp->split_diskbuffer[0] == '\0') &&
-                       dp->fallback_splitsize * 1000 < tape_size) {
-                   g_fprintf(outf,
-                         _("WARNING: %s %s: fallback_splitsize of %ju %sB < 0.1%% of tape length.\n"),
-                         hostp->hostname, dp->name,
-                         (uintmax_t)dp->fallback_splitsize/(uintmax_t)unitdivisor,
-                         displayunit);
-                   if (!printed_small_fallback_splitsize_warning) {
-                       printed_small_fallback_splitsize_warning = TRUE;
-                       g_fprintf(outf, "%s", small_fallback_splitsize_warning);
+                   /* fallback splitsize will be used if split_diskbuffer is empty or NULL */
+                   if (dp->tape_splitsize != 0 && dp->fallback_splitsize != 0 &&
+                           (dp->split_diskbuffer == NULL ||
+                            dp->split_diskbuffer[0] == '\0') &&
+                           dp->fallback_splitsize * 1000 < tape_size) {
+                       g_fprintf(outf,
+                             _("WARNING: %s %s: fallback-splitsize of %ju %sB < 0.1%% of tape length.\n"),
+                             hostp->hostname, dp->name,
+                             (uintmax_t)dp->fallback_splitsize/(uintmax_t)unitdivisor,
+                             displayunit);
+                       if (!printed_small_part_size_warning) {
+                           printed_small_part_size_warning = TRUE;
+                           g_fprintf(outf, "%s", small_part_size_warning);
+                       }
                    }
                }
 
@@ -1440,11 +1557,6 @@ start_server_check(
                                  _("ERROR: %s %s: Holding disk can't be use for directtcp data-path\n"),
                                  hostp->hostname, dp->name);
                        pgmbad = 1;
-                   } else if (dp->to_holdingdisk == HOLD_AUTO) {
-                       g_fprintf(outf,
-                                 _("WARNING: %s %s: Holding disk can't be use for directtcp data-path\n"),
-                                 hostp->hostname, dp->name);
-                       pgmbad = 1;
                    }
                }
 
@@ -1839,6 +1951,8 @@ start_host(
            }
            amfree(qname);
            amfree(qdevice);
+           amfree(b64disk);
+           amfree(b64device);
            l_len = strlen(l);
            amfree(o);
 
index 3e45c1d737739544f5e4a92475a2f87195be39b9..b0074562c06c1352f1315cdbd1adfa7db498144c 100644 (file)
@@ -1,5 +1,5 @@
 #! @PERL@
-# Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 # 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published 
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 
 use File::Basename;
 use Getopt::Long;
@@ -32,13 +33,14 @@ use Amanda::Tapelist;
 use Amanda::Logfile;
 use Amanda::Util qw( :constants );
 use Amanda::Changer;
+use Amanda::Recovery::Clerk;
 use Amanda::Recovery::Scan;
+use Amanda::Recovery::Planner;
 use Amanda::Constants;
+use Amanda::DB::Catalog;
+use Amanda::Cmdline;
 use Amanda::MainLoop;
-
-# Have all images been verified successfully so far?
-my $all_success = 1;
-my $verbose = 0;
+use Amanda::Xfer qw( :constants );
 
 sub usage {
     print <<EOF;
@@ -58,595 +60,419 @@ EOF
     exit(1);
 }
 
-## Device management
-
-my $scan;
-my $reservation;
-my $current_device;
-my $current_device_label;
-my $current_command;
-
-sub find_next_device {
-    my $label = shift;
-    my $reset_done_cb;
-    my $find_done_cb;
-    my ($slot, $tapedev);
-
-    # if the scan hasn't been created yet, set it up
-    if (!$scan) {
-       my $inter = Amanda::Interactive->new(name => 'stdin');
-       $scan = Amanda::Recovery::Scan->new(interactive => $inter);
-       if ($scan->isa("Amanda::Changer::Error")) {
-           print "$scan\n";
-           exit 1;
-       }
-    }
-
-    my $load_sub = make_cb(load_sub => sub {
-       my ($err) = @_;
-       if ($err) {
-           print STDERR $err, "\n";
-           exit 1;
-       }
-
-       $scan->find_volume(
-           label => $label,
-           res_cb => sub {
-               (my $err, $reservation) = @_;
-               if ($err) {
-                   print STDERR $err, "\n";
-                   exit 1;
-               }
-               Amanda::MainLoop::quit();
-           },
-       );
-    });
-
-    my $start = make_cb(start => sub {
-       if (defined $reservation) {
-           $reservation->release(finished_cb => $load_sub);
-       } else {
-           $load_sub->(undef);
-       }
-    });
-
-    # let the mainloop run until the find is done.  This is a temporary
-    # hack until all of amcheckdump is event-based.
-    Amanda::MainLoop::call_later($start);
-    Amanda::MainLoop::run();
-
-    return $reservation->{'device'};
-}
-
-# Try to open a device containing a volume with the given label.
-# return ($device, undef) on success
-# return (undef, $err) on error
-sub try_open_device {
-    my ($label, $timestamp) = @_;
+## Application initialization
 
-    # can we use the same device as last time?
-    if ($current_device_label eq $label) {
-       return $current_device;
-    }
+Amanda::Util::setup_application("amcheckdump", "server", $CONTEXT_CMDLINE);
 
-    # nope -- get rid of that device
-    close_device();
+my $exit_code = 0;
 
-    my $device = find_next_device($label);
-    my $device_name = $device->device_name;
+my $opt_timestamp;
+my $opt_verbose = 0;
+my $config_overrides = new_config_overrides($#ARGV+1);
 
-    my $label_status = $device->status;
-    if ($label_status != $DEVICE_STATUS_SUCCESS) {
-       if ($device->error_or_status() ) {
-           return (undef, "Could not read device $device_name: " .
-                           $device->error_or_status());
-       } else {
-           return (undef, "Could not read device $device_name: one of " .
-                   join(", ", DevicestatusFlags_to_strings($label_status)));
-       }
-    }
+Getopt::Long::Configure(qw(bundling));
+GetOptions(
+    'timestamp|t=s' => \$opt_timestamp,
+    'verbose|v'     => \$opt_verbose,
+    'help|usage|?'  => \&usage,
+    'o=s' => sub { add_config_override_opt($config_overrides, $_[1]); },
+) or usage();
 
-    my $start = make_cb(start => sub {
-       $reservation->set_label(label => $device->volume_label(),
-                               finished_cb => sub {
-                                       Amanda::MainLoop::quit();
-                               });
-    });
+usage() if (@ARGV < 1);
 
-    Amanda::MainLoop::call_later($start);
-    Amanda::MainLoop::run();
+my $timestamp = $opt_timestamp;
 
-    if ($device->volume_label() ne $label) {
-       return (undef, "Labels do not match: Expected '$label', but the " .
-                      "device contains '" . $device->volume_label() . "'");
+my $config_name = shift @ARGV;
+set_config_overrides($config_overrides);
+config_init($CONFIG_INIT_EXPLICIT_NAME, $config_name);
+my ($cfgerr_level, @cfgerr_errors) = config_errors();
+if ($cfgerr_level >= $CFGERR_WARNINGS) {
+    config_print_errors();
+    if ($cfgerr_level >= $CFGERR_ERRORS) {
+       die("errors processing config file");
     }
+}
 
-    if ($device->volume_time() ne $timestamp) {
-       return (undef, "Timestamps do not match: Expected '$timestamp', " .
-                      "but the device contains '" .
-                      $device->volume_time() . "'");
-    }
+Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
 
-    if (!$device->start($ACCESS_READ, undef, undef)) {
-       return (undef, "Error reading device $device_name: " .
-                      $device->error_or_status());
-       return undef;
-    }
+# Interactive package
+package Amanda::Interactive::amcheckdump;
+use POSIX qw( :errno_h );
+use Amanda::MainLoop qw( :GIOCondition );
+use vars qw( @ISA );
+@ISA = qw( Amanda::Interactive );
 
-    $current_device = $device;
-    $current_device_label = $device->volume_label();
+sub new {
+    my $class = shift;
 
-    return ($device, undef);
+    my $self = {
+       input_src => undef};
+    return bless ($self, $class);
 }
 
-sub close_device {
-    $current_device = undef;
-    $current_device_label = undef;
+sub abort() {
+    my $self = shift;
+
+    if ($self->{'input_src'}) {
+       $self->{'input_src'}->remove();
+       $self->{'input_src'} = undef;
+    }
 }
 
-## Validation application
+sub user_request {
+    my $self = shift;
+    my %params = @_;
+    my $buffer = "";
+
+    my $message  = $params{'message'};
+    my $label    = $params{'label'};
+    my $err      = $params{'err'};
+    my $chg_name = $params{'chg_name'};
+
+    my $data_in = sub {
+       my $b;
+       my $n_read = POSIX::read(0, $b, 1);
+       if (!defined $n_read) {
+           return if ($! == EINTR);
+           $self->abort();
+           return $params{'finished_cb'}->(
+               Amanda::Changer::Error->new('fatal',
+                       message => "Fail to read from stdin"));
+       } elsif ($n_read == 0) {
+           $self->abort();
+           return $params{'finished_cb'}->(
+               Amanda::Changer::Error->new('fatal',
+                       message => "Aborted by user"));
+       } else {
+           $buffer .= $b;
+           if ($b eq "\n") {
+               my $line = $buffer;
+               chomp $line;
+               $buffer = "";
+               $self->abort();
+               return $params{'finished_cb'}->(undef, $line);
+           }
+       }
+    };
 
-my ($current_validation_pid, $current_validation_pipeline, $current_validation_image);
+    print STDERR "$err\n";
+    print STDERR "Insert volume labeled '$label' in $chg_name\n";
+    print STDERR "and press enter, or ^D to abort.\n";
 
-sub is_part_of_same_image {
-    my ($image, $header) = @_;
+    $self->{'input_src'} = Amanda::MainLoop::fd_source(0, $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+    $self->{'input_src'}->set_callback($data_in);
+    return;
+};
 
-    return ($image->{timestamp} eq $header->{datestamp}
-        and $image->{hostname} eq $header->{name}
-        and $image->{diskname} eq $header->{disk}
-        and $image->{level} == $header->{dumplevel});
-}
+package main::Feedback;
 
-# Return a filehandle for the validation application that will handle this
-# image.  This function takes care of split dumps.  At the moment, we have
-# a single "current" validation application, and as such assume that split dumps
-# are stored contiguously and in order on the volume.
-sub open_validation_app {
-    my ($image, $header) = @_;
-
-    # first, see if this is the same image we were looking at previously
-    if (defined($current_validation_image)
-       and $current_validation_image->{timestamp} eq $image->{timestamp}
-       and $current_validation_image->{hostname} eq $image->{hostname}
-       and $current_validation_image->{diskname} eq $image->{diskname}
-       and $current_validation_image->{level} == $image->{level}) {
-       # TODO: also check that the part number is correct
-        Amanda::Debug::debug("Continuing with previously started validation process");
-       return $current_validation_pipeline, $current_command;
-    }
-
-    my @command = find_validation_command($header);
+use Amanda::Recovery::Clerk;
+use base 'Amanda::Recovery::Clerk::Feedback';
+use Amanda::MainLoop;
 
-    if ($#command == 0) {
-       $command[0]->{fd} = Symbol::gensym;
-       $command[0]->{pid} = open3($current_validation_pipeline, "/dev/null", $command[0]->{stderr}, $command[0]->{pgm});
-    } else {
-       my $nb = $#command;
-       $command[$nb]->{fd} = "VAL_GLOB_$nb";
-       $command[$nb]->{stderr} = Symbol::gensym;
-       $command[$nb]->{pid} = open3($command[$nb]->{fd}, "/dev/null", $command[$nb]->{stderr}, $command[$nb]->{pgm});
-       close($command[$nb]->{stderr});
-       while ($nb-- > 1) {
-           $command[$nb]->{fd} = "VAL_GLOB_$nb";
-           $command[$nb]->{stderr} = Symbol::gensym;
-           $command[$nb]->{pid} = open3($command[$nb]->{fd}, ">&". $command[$nb+1]->{fd}, $command[$nb]->{stderr}, $command[$nb]->{pgm});
-           close($command[$nb+1]->{fd});
-       }
-       $command[$nb]->{stderr} = Symbol::gensym;
-       $command[$nb]->{pid} = open3($current_validation_pipeline, ">&".$command[$nb+1]->{fd}, $command[$nb]->{stderr}, $command[$nb]->{pgm});
-       close($command[$nb+1]->{fd});
-    }
+sub new {
+    my $class = shift;
+    my ($chg, $dev_name) = @_;
 
-    my @com;
-    for my $i (0..$#command) {
-       push @com, $command[$i]->{pgm};
-    }
-    my $validation_command = join (" | ", @com);
-    Amanda::Debug::debug("  using '$validation_command'");
-    print "  using '$validation_command'\n" if $verbose;
-        
-    $current_validation_image = $image;
-    return $current_validation_pipeline, \@command;
+    return bless {
+       chg => $chg,
+       dev_name => $dev_name,
+    }, $class;
 }
 
-# Close any running validation app, checking its exit status for errors.  Sets
-# $all_success to false if there is an error.
-sub close_validation_app {
-    my $command = shift;
-
-    if (!defined($current_validation_pipeline)) {
-       return;
-    }
+sub clerk_notif_part {
+    my $self = shift;
+    my ($label, $filenum, $header) = @_;
 
-    # first close the applications standard input to signal it to stop
-    close($current_validation_pipeline);
-    my $result = 0;
-    while (my $cmd = shift @$command) {
-       #read its stderr
-       my $fd = $cmd->{stderr};
-       while(<$fd>) {
-           print $_;
-           $result++;
-       }
-       waitpid $cmd->{pid}, 0;
-       my $err = $?;
-       my $res = $!;
-
-       if ($err == -1) {
-           Amanda::Debug::debug("failed to execute $cmd->{pgm}: $res");
-           print "failed to execute $cmd->{pgm}: $res\n";
-           $result++;
-       } elsif ($err & 127) {
-           Amanda::Debug::debug(sprintf("$cmd->{pgm} died with signal %d, %s coredump",
-               ($err & 127), ($err & 128) ? 'with' : 'without'));
-           printf "$cmd->{pgm} died with signal %d, %s coredump\n",
-               ($err & 127), ($err & 128) ? 'with' : 'without';
-           $result++;
-       } elsif ($err > 0) {
-           Amanda::Debug::debug(sprintf("$cmd->{pgm} exited with value %d", $err >> 8));
-           printf "$cmd->{pgm} exited with value %d %d\n", $err >> 8, $err;
-           $result++;
-       }
+    print STDERR "Reading volume $label file $filenum\n";
+}
 
-    }
+sub clerk_notif_holding {
+    my $self = shift;
+    my ($filename, $header) = @_;
 
-    if ($result) {
-       Amanda::Debug::debug("Image was not successfully validated");
-       print "Image was not successfully validated\n\n";
-       $all_success = 0; # flag this as a failure
-    } else {
-        Amanda::Debug::debug("Image was successfully validated");
-        print("Image was successfully validated.\n\n") if $verbose;
-    }
-
-    $current_validation_pipeline = undef;
-    $current_validation_image = undef;
+    print STDERR "Reading '$filename'\n";
 }
 
-# Given a dumpfile_t, figure out the command line to validate.
-# return an array of command to execute
+package main;
+
+# Given a dumpfile_t, figure out the command line to validate, specified
+# as an argv array
 sub find_validation_command {
     my ($header) = @_;
 
     my @result = ();
 
-    # We base the actual archiver on our own table, but just trust
-    # whatever is listed as the decrypt/uncompress commands.
+    # We base the actual archiver on our own table
     my $program = uc(basename($header->{program}));
 
     my $validation_program;
 
     if ($program ne "APPLICATION") {
         my %validation_programs = (
-            "STAR" => "$Amanda::Constants::STAR -t -f -",
-            "DUMP" => "$Amanda::Constants::RESTORE tbf 2 -",
-            "VDUMP" => "$Amanda::Constants::VRESTORE tf -",
-            "VXDUMP" => "$Amanda::Constants::VXRESTORE tbf 2 -",
-            "XFSDUMP" => "$Amanda::Constants::XFSRESTORE -t -v silent -",
-            "TAR" => "$Amanda::Constants::GNUTAR tf -",
-            "GTAR" => "$Amanda::Constants::GNUTAR tf -",
-            "GNUTAR" => "$Amanda::Constants::GNUTAR tf -",
-            "SMBCLIENT" => "$Amanda::Constants::GNUTAR tf -",
+            "STAR" => [ $Amanda::Constants::STAR, qw(-t -f -) ],
+            "DUMP" => [ $Amanda::Constants::RESTORE, qw(tbf 2 -) ],
+            "VDUMP" => [ $Amanda::Constants::VRESTORE, qw(tf -) ],
+            "VXDUMP" => [ $Amanda::Constants::VXRESTORE, qw(tbf 2 -) ],
+            "XFSDUMP" => [ $Amanda::Constants::XFSRESTORE, qw(-t -v silent -) ],
+            "TAR" => [ $Amanda::Constants::GNUTAR, qw(--ignore-zeros -tf -) ],
+            "GTAR" => [ $Amanda::Constants::GNUTAR, qw(--ignore-zeros -tf -) ],
+            "GNUTAR" => [ $Amanda::Constants::GNUTAR, qw(--ignore-zeros -tf -) ],
+            "SMBCLIENT" => [ $Amanda::Constants::GNUTAR, qw(--ignore-zeros -tf -) ],
+           "PKZIP" => undef,
         );
-        $validation_program = $validation_programs{$program};
-       if (!defined $validation_program) {
-           Amanda::Debug::debug("Unknown program '$program'");
-           print "Unknown program '$program'.\n" if $program ne "PKZIP";
+       if (!exists $validation_programs{$program}) {
+           debug("Unknown program '$program' in header; no validation to perform");
+           return undef;
        }
+        return $validation_programs{$program};
+
     } else {
        if (!defined $header->{application}) {
-           Amanda::Debug::debug("Application not set");
-            print "Application not set\n";
+           warning("Application not set");
+           return undef;
+       }
+       my $program_path = $Amanda::Paths::APPLICATION_DIR . "/" .
+                          $header->{application};
+       if (!-x $program_path) {
+           debug("Application '" . $header->{application}.
+                        "($program_path)' not available on the server");
+           return undef;
        } else {
-           my $program_path = $Amanda::Paths::APPLICATION_DIR . "/" .
-                               $header->{application};
-            if (!-x $program_path) {
-                Amanda::Debug::debug("Application '" . $header->{application}.
-                            "($program_path)' not available on the server; ".
-                            "Will send dumps to /dev/null instead.");
-               Amanda::Debug::debug("Application '$header->{application}' in path $program_path not available on server");
-           } else {
-               $validation_program = $program_path . " validate";
-           }
+           return [ $program_path, "validate" ];
        }
     }
+}
 
-    if (defined $header->{decrypt_cmd} && 
-        length($header->{decrypt_cmd}) > 0) {
-       if ($header->{dle_str} =~ /<encrypt>CUSTOM/) {
-           # Can't decrypt client encrypted image
-           my $cmd;
-            $cmd->{pgm} = "cat";
-           push @result, $cmd;
-           return @result;
-       }
-       my $cmd;
-       $cmd->{pgm} = $header->{decrypt_cmd};
-       $cmd->{pgm} =~ s/ *\|$//g;
-       push @result, $cmd;
-    }
-    if (defined $header->{uncompress_cmd} && 
-        length($header->{uncompress_cmd}) > 0) {
-       #If the image is not compressed, the decryption is here
-       if ((!defined $header->{decrypt_cmd} ||
-            length($header->{decrypt_cmd}) == 0 ) and
-           $header->{dle_str} =~ /<encrypt>CUSTOM/) {
-           # Can't decrypt client encrypted image
-           my $cmd;
-            $cmd->{pgm} = "cat";
-           push @result, $cmd;
-           return @result;
-       }
-       my $cmd;
-       $cmd->{pgm} = $header->{uncompress_cmd};
-       $cmd->{pgm} =~ s/ *\|$//g;
-       push @result, $cmd;
-    }
+sub main {
+    my ($finished_cb) = @_;
+
+    my $tapelist;
+    my $chg;
+    my $interactive;
+    my $scan;
+    my $clerk;
+    my $plan;
+    my $timestamp;
+    my $all_success = 1;
+    my @xfer_errs;
+
+    my $steps = define_steps
+       cb_ref => \$finished_cb;
+
+    step start => sub {
+       # set up the tapelist
+       my $tapelist_file = config_dir_relative(getconf($CNF_TAPELIST));
+       $tapelist = Amanda::Tapelist->new($tapelist_file);
+
+       # get the timestamp
+       $timestamp = $opt_timestamp;
+       $timestamp = Amanda::DB::Catalog::get_latest_write_timestamp()
+           unless defined $opt_timestamp;
+
+       # make an interactivity plugin
+       $interactive = Amanda::Interactive::amcheckdump->new();
+
+       # make a changer
+       $chg = Amanda::Changer->new();
+       return $steps->{'quit'}->($chg)
+           if $chg->isa("Amanda::Changer::Error");
+
+       # make a scan
+       $scan = Amanda::Recovery::Scan->new(
+                           chg => $chg,
+                           interactive => $interactive);
+       return $steps->{'quit'}->($scan)
+           if $scan->isa("Amanda::Changer::Error");
+
+       # make a clerk
+       $clerk = Amanda::Recovery::Clerk->new(
+           feedback => main::Feedback->new($chg),
+           scan     => $scan);
+
+       # make a plan
+       my $spec = Amanda::Cmdline::dumpspec_t->new(undef, undef, undef, undef, $timestamp);
+        Amanda::Recovery::Planner::make_plan(
+            dumpspecs => [ $spec ],
+            changer => $chg,
+            plan_cb => $steps->{'plan_cb'});
+    };
 
-    my $command;
-    if (!defined $validation_program) {
-        $command->{pgm} = "cat";
-    } else {
-       $command->{pgm} = $validation_program;
-    }
+    step plan_cb => sub {
+       (my $err, $plan) = @_;
+       $steps->{'quit'}->($err) if $err;
 
-    push @result, $command;
+       my @tapes = $plan->get_volume_list();
+       my @holding = $plan->get_holding_file_list();
+       if (!@tapes && !@holding) {
+           print "Could not find any matching dumps.\n";
+           return $steps->{'quit'}->();
+       }
 
-    return @result;
-}
+       if (@tapes) {
+           printf("You will need the following volume%s: %s\n", (@tapes > 1) ? "s" : "",
+                  join(", ", map { $_->{'label'} } @tapes));
+       }
+       if (@holding) {
+           printf("You will need the following holding file%s: %s\n", (@tapes > 1) ? "s" : "",
+                  join(", ", @holding));
+       }
 
-## Application initialization
+       # nothing else is going on right now, so a blocking "Press enter.." is OK
+       print "Press enter when ready\n";
+       <STDIN>;
 
-Amanda::Util::setup_application("amcheckdump", "server", $CONTEXT_CMDLINE);
+       my $dump = shift @{$plan->{'dumps'}};
+       if (!$dump) {
+           return $steps->{'quit'}->("No backup written on timestamp $timestamp.");
+       }
 
-my $timestamp = undef;
-my $config_overrides = new_config_overrides($#ARGV+1);
+       $steps->{'check_dumpfile'}->($dump);
+    };
 
-Getopt::Long::Configure(qw(bundling));
-GetOptions(
-    'timestamp|t=s' => \$timestamp,
-    'verbose|v'     => \$verbose,
-    'help|usage|?'  => \&usage,
-    'o=s' => sub { add_config_override_opt($config_overrides, $_[1]); },
-) or usage();
+    step check_dumpfile => sub {
+       my ($dump) = @_;
 
-usage() if (@ARGV < 1);
+       print "Validating image " . $dump->{hostname} . ":" .
+           $dump->{diskname} . " dumped " . $dump->{dump_timestamp} . " level ".
+           $dump->{level};
+       if ($dump->{'nparts'} > 1) {
+           print " ($dump->{nparts} parts)";
+       }
+       print "\n";
 
-my $timestamp_argument = 0;
-if (defined $timestamp) { $timestamp_argument = 1; }
+       @xfer_errs = ();
+       $clerk->get_xfer_src(
+           dump => $dump,
+           xfer_src_cb => $steps->{'xfer_src_cb'});
+    };
 
-my $config_name = shift @ARGV;
-set_config_overrides($config_overrides);
-config_init($CONFIG_INIT_EXPLICIT_NAME, $config_name);
-my ($cfgerr_level, @cfgerr_errors) = config_errors();
-if ($cfgerr_level >= $CFGERR_WARNINGS) {
-    config_print_errors();
-    if ($cfgerr_level >= $CFGERR_ERRORS) {
-       die("errors processing config file");
-    }
-}
+    step xfer_src_cb => sub {
+       my ($errs, $hdr, $xfer_src, $directtcp_supported) = @_;
+       return $steps->{'quit'}->(join("; ", @$errs)) if $errs;
+
+       # set up any filters that need to be applied; decryption first
+       my @filters;
+       if ($hdr->{'encrypted'}) {
+           if ($hdr->{'srv_encrypt'}) {
+               push @filters,
+                   Amanda::Xfer::Filter::Process->new(
+                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0, 0);
+           } elsif ($hdr->{'clnt_encrypt'}) {
+               push @filters,
+                   Amanda::Xfer::Filter::Process->new(
+                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0, 0);
+           } else {
+               return failure("could not decrypt encrypted dump: no program specified",
+                           $finished_cb);
+           }
 
-Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
+           $hdr->{'encrypted'} = 0;
+           $hdr->{'srv_encrypt'} = '';
+           $hdr->{'srv_decrypt_opt'} = '';
+           $hdr->{'clnt_encrypt'} = '';
+           $hdr->{'clnt_decrypt_opt'} = '';
+           $hdr->{'encrypt_suffix'} = 'N';
+       }
 
-my $tapelist_file = config_dir_relative(getconf($CNF_TAPELIST));
-my $tl = Amanda::Tapelist::read_tapelist($tapelist_file);
-
-# If we weren't given a timestamp, find the newer of
-# amdump.1 or amflush.1 and extract the datestamp from it.
-if (!defined $timestamp) {
-    my $amdump_log = config_dir_relative(getconf($CNF_LOGDIR)) . "/amdump.1";
-    my $amflush_log = config_dir_relative(getconf($CNF_LOGDIR)) . "/amflush.1";
-    my $logfile;
-    if (-f $amflush_log && -f $amdump_log &&
-         -M $amflush_log  < -M $amdump_log) {
-         $logfile=$amflush_log;
-    } elsif (-f $amdump_log) {
-         $logfile=$amdump_log;
-    } elsif (-f $amflush_log) {
-         $logfile=$amflush_log;
-    } else {
-       print "Could not find amdump.1 or amflush.1 files.\n";
-       exit;
-    }
+       if ($hdr->{'compressed'}) {
+           # need to uncompress this file
+
+           if ($hdr->{'srvcompprog'}) {
+               # TODO: this assumes that srvcompprog takes "-d" to decrypt
+               push @filters,
+                   Amanda::Xfer::Filter::Process->new(
+                       [ $hdr->{'srvcompprog'}, "-d" ], 0, 0);
+           } elsif ($hdr->{'clntcompprog'}) {
+               # TODO: this assumes that clntcompprog takes "-d" to decrypt
+               push @filters,
+                   Amanda::Xfer::Filter::Process->new(
+                       [ $hdr->{'clntcompprog'}, "-d" ], 0, 0);
+           } else {
+               push @filters,
+                   Amanda::Xfer::Filter::Process->new(
+                       [ $Amanda::Constants::UNCOMPRESS_PATH,
+                         $Amanda::Constants::UNCOMPRESS_OPT ], 0, 0);
+           }
 
-    # extract the datestamp from the dump log
-    open (AMDUMP, "<$logfile") || die();
-    while(<AMDUMP>) {
-       if (/^amdump: starttime (\d*)$/) {
-           $timestamp = $1;
-       }
-       elsif (/^amflush: starttime (\d*)$/) {
-           $timestamp = $1;
+           # adjust the header
+           $hdr->{'compressed'} = 0;
+           $hdr->{'uncompress_cmd'} = '';
        }
-       elsif (/^planner: timestamp (\d*)$/) {
-           $timestamp = $1;
-       }
-    }
-    close AMDUMP;
-}
 
-# Find all logfiles matching our timestamp
-my $logfile_dir = config_dir_relative(getconf($CNF_LOGDIR));
-my @logfiles =
-    grep { $_ =~ /^log\.$timestamp(?:\.[0-9]+|\.amflush)?$/ }
-    Amanda::Logfile::find_log();
-
-# Check log file directory if find_log didn't find tape written
-# on that tapestamp
-if (!@logfiles) {
-    opendir(DIR, $logfile_dir) || die "can't opendir $logfile_dir: $!";
-    @logfiles = grep { /^log.$timestamp\..*/ } readdir(DIR);
-    closedir DIR;
-
-    if (!@logfiles) {
-       if ($timestamp_argument) {
-           print STDERR "Can't find any logfiles with timestamp $timestamp.\n";
-       } else {
-           print STDERR "Can't find the logfile for last run.\n";
+       # and set up the validation command as a filter element, since
+       # we need to throw out its stdout
+       my $argv = find_validation_command($hdr);
+       if (defined $argv) {
+           push @filters, Amanda::Xfer::Filter::Process->new($argv, 0, 0);
        }
-       exit 1;
-    }
-}
 
-# compile a list of *all* dumps in those logfiles
-my @images;
-for my $logfile (@logfiles) {
-    chomp $logfile;
-    push @images, Amanda::Logfile::search_logfile(undef, $timestamp,
-                                                  "$logfile_dir/$logfile", 1);
-}
-my $nb_images = @images;
-
-# filter only "ok" dumps, removing partial and failed dumps
-@images = Amanda::Logfile::dumps_match([@images],
-       undef, undef, undef, undef, 1);
-
-if (!@images) {
-    if ($nb_images == 0) {
-        if ($timestamp_argument) {
-           print STDERR "No backup written on timestamp $timestamp.\n";
-        } else {
-           print STDERR "No backup written on latest run.\n";
-        }
-    } else {
-        if ($timestamp_argument) {
-           print STDERR "No complete backup available on timestamp $timestamp.\n";
-        } else {
-           print STDERR "No complete backup available on latest run.\n";
-        }
-    }
-    exit 1;
-}
+       # we always throw out stdout
+       my $xfer_dest = Amanda::Xfer::Dest::Null->new(0);
 
-# Find unique tapelist, using a hash to filter duplicate tapes
-my %tapes = map { ($_->{label}, undef) } @images;
-my @tapes = sort { $a cmp $b } keys %tapes;
+       my $xfer = Amanda::Xfer->new([ $xfer_src, @filters, $xfer_dest ]);
+       $xfer->start($steps->{'handle_xmsg'});
+       $clerk->start_recovery(
+           xfer => $xfer,
+           recovery_cb => $steps->{'recovery_cb'});
+    };
 
-if (!@tapes) {
-    print STDERR "Could not find any matching dumps.\n";
-    exit 1;
-}
+    step handle_xmsg => sub {
+       my ($src, $msg, $xfer) = @_;
 
-printf("You will need the following tape%s: %s\n", (@tapes > 1) ? "s" : "",
-       join(", ", @tapes));
-print "Press enter when ready\n";
-<STDIN>;
+       $clerk->handle_xmsg($src, $msg, $xfer);
+       if ($msg->{'type'} == $XMSG_INFO) {
+           Amanda::Debug::info($msg->{'message'});
+       } elsif ($msg->{'type'} == $XMSG_ERROR) {
+           push @xfer_errs, $msg->{'message'};
+       }
+    };
 
-# Now loop over the images, verifying each one.  
+    step recovery_cb => sub {
+       my %params = @_;
 
-my $header;
+       # distinguish device errors from validation errors
+       if (@{$params{'errors'}}) {
+           print STDERR "While reading from volumes:\n";
+           print STDERR "$_\n" for @{$params{'errors'}};
+           return $steps->{'quit'}->("validation aborted");
+       }
 
-IMAGE:
-for my $image (@images) {
-    my $check = sub {
-       my ($ok, $msg) = @_;
-       if (!$ok) {
+       if (@xfer_errs) {
+           print STDERR "Validation errors:\n";
+           print STDERR "$_\n" for @xfer_errs;
            $all_success = 0;
-           Amanda::Debug::debug("Image was not successfully validated: $msg");
-           print "Image was not successfully validated: $msg.\n";
-           next IMAGE;
        }
-    };
-
-    # If it's a new image
-    my $new_image = !(defined $header);
-    if (!$new_image) {
-       if (!is_part_of_same_image($image, $header)) {
-       close_validation_app($current_command);
-       $new_image = 1;
-}
-    }
 
-    Amanda::Debug::debug("Validating image " . $image->{hostname} . ":" .
-       $image->{diskname} . " datestamp " . $image->{timestamp} . " level ".
-       $image->{level} . " part " . $image->{partnum} . "/" .
-       $image->{totalparts} . "on tape " . $image->{label} . " file #" .
-       $image->{filenum});
-
-    if ($new_image) {
-    printf("Validating image %s:%s datestamp %s level %s part %d/%d on tape %s file #%d\n",
-           $image->{hostname}, $image->{diskname}, $image->{timestamp},
-           $image->{level}, $image->{partnum}, $image->{totalparts},
-          $image->{label}, $image->{filenum});
-    } else {
-    printf("           part  %s:%s datestamp %s level %s part %d/%d on tape %s file #%d\n",
-           $image->{hostname}, $image->{diskname}, $image->{timestamp},
-           $image->{level}, $image->{partnum}, $image->{totalparts},
-          $image->{label}, $image->{filenum});
-    }
-
-    # note that if there is a device failure, we may try the same device
-    # again for the next image.  That's OK -- it may give a user with an
-    # intermittent drive some indication of such.
-    my ($device, $err) = try_open_device($image->{label}, $timestamp);
-    $check->(defined $device, "Could not open device: $err");
+       my $dump = shift @{$plan->{'dumps'}};
+       if (!$dump) {
+           return $steps->{'quit'}->();
+       }
 
-    # Now get the header from the device
-    $header = $device->seek_file($image->{filenum});
-    $check->(defined $header,
-      "Could not seek to file $image->{filenum} of volume $image->{label}: " .
-        $device->error_or_status());
+       $steps->{'check_dumpfile'}->($dump);
+    };
 
-    # Make sure that the on-device header matches what the logfile
-    # told us we'd find.
+    step quit => sub {
+       my ($err) = @_;
 
-    my $volume_part = $header->{partnum};
-    if ($volume_part == 0) {
-        $volume_part = 1;
-    }
+       if ($err) {
+           $exit_code = 1;
+           print STDERR $err, "\n";
+           return $clerk->quit(finished_cb => $finished_cb);
+       }
 
-    if ($image->{timestamp} ne $header->{datestamp} ||
-        $image->{hostname} ne $header->{name} ||
-        $image->{diskname} ne $header->{disk} ||
-        $image->{level} != $header->{dumplevel} ||
-        $image->{partnum} != $volume_part) {
-        printf("Volume image is %s:%s datestamp %s level %s part %s\n",
-               $header->{name}, $header->{disk}, $header->{datestamp},
-               $header->{dumplevel}, $volume_part);
-        $check->(0, sprintf("Details of dump at file %d of volume %s do not match logfile",
-                     $image->{filenum}, $image->{label}));
-    }
-    
-    # get the validation application pipeline that will process this dump.
-    (my $pipeline, $current_command) = open_validation_app($image, $header);
-
-    # send the datastream from the device straight to the application
-    my $queue_fd = Amanda::Device::queue_fd_t->new(fileno($pipeline));
-    my $read_ok = $device->read_to_fd($queue_fd);
-    $check->($device->status() == $DEVICE_STATUS_SUCCESS,
-      "Error reading device: " . $device->error_or_status());
-    # if we make it here, the device was ok, but the read perhaps wasn't
-    if (!$read_ok) {
-        my $errmsg = $queue_fd->{errmsg};
-        if (defined $errmsg && length($errmsg) > 0) {
-            $check->($read_ok, "Error writing data to validation command: $errmsg");
+       if ($all_success) {
+           print "All images successfully validated\n";
        } else {
-            $check->($read_ok, "Error writing data to validation command: Unknown reason");
+           print "Some images failed to be correclty validated.\n";
+           $exit_code = 1;
        }
-    }
-}
-
-if (defined $reservation) {
-    my $release = make_cb(start => sub {
-       $reservation->release(finished_cb => sub {
-                               Amanda::MainLoop::quit()});
-    });
 
-    Amanda::MainLoop::call_later($release);
-    Amanda::MainLoop::run();
-}
-
-# clean up
-close_validation_app($current_command);
-close_device();
-
-if ($all_success) {
-    Amanda::Debug::debug("All images successfully validated");
-    print "All images successfully validated\n";
-} else {
-    Amanda::Debug::debug("Some images failed to be correclty validated");
-    print "Some images failed to be correclty validated.\n";
+       return $clerk->quit(finished_cb => $finished_cb);
+    };
 }
 
+main(sub { Amanda::MainLoop::quit(); });
+Amanda::MainLoop::run();
 Amanda::Util::finish_application();
-exit($all_success? 0 : 1);
+exit($exit_code);
index 2ee337790e57a5b6d59a2ddc97830852eba7109d..eb1730fc5540ea042d0e6dc5615c97584815fe18 100644 (file)
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 
 use Getopt::Long;
 use Amanda::Config qw( :init :getconf config_dir_relative );
@@ -26,6 +27,7 @@ use Amanda::Util qw( :constants );
 use Amanda::Paths;
 use Amanda::Constants;
 use Amanda::Process;
+use Amanda::Logfile;
 
 my $kill_enable=0;
 my $process_alive=0;
@@ -70,7 +72,6 @@ Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
 my $logdir=config_dir_relative(getconf($CNF_LOGDIR));
 my $logfile = "$logdir/log";
 my $amreport="$sbindir/amreport";
-my $amlogroll="$amlibexecdir/amlogroll";
 my $amtrmidx="$amlibexecdir/amtrmidx";
 my $amcleanupdisk="$amlibexecdir/amcleanupdisk";
 
@@ -155,7 +156,10 @@ sub run_system {
 if (-f $logfile) {
     Amanda::Debug::debug("Processing log file");
     run_system(0, $amreport, $config_name, "--from-amdump");
-    run_system(1, $amlogroll, $config_name);
+
+    my $ts = Amanda::Logfile::get_current_log_timestamp();
+    Amanda::Logfile::log_rename($ts);
+
     run_system(1, $amtrmidx, $config_name);
 } else {
     print "amcleanup: no unprocessed logfile to clean up.\n";
index 970a931306f9009831d39bb12648b6953122e3a1..2ba6fb0d82b8f1181261416d7b6c302fc4b0b1dc 100644 (file)
@@ -67,8 +67,8 @@ corrupt_dle(
        hostname, disk);
 
     get_info(hostname, disk, &info);
-    info.command &= ~FORCE_BUMP;
-    info.command |= FORCE_NO_BUMP;
+    CLR(info.command, FORCE_BUMP);
+    SET(info.command, FORCE_NO_BUMP);
     if(put_info(hostname, disk, &info)) {
        dbprintf(_("could not put info record for %s:%s: %s"),
              hostname, disk, strerror(errno));
diff --git a/server-src/amdump.pl b/server-src/amdump.pl
new file mode 100644 (file)
index 0000000..383fa85
--- /dev/null
@@ -0,0 +1,332 @@
+#! @PERL@
+# Copyright (c) 2010 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use lib '@amperldir@';
+use strict;
+use warnings;
+
+use Getopt::Long;
+use POSIX qw(WIFEXITED WEXITSTATUS strftime);
+
+use Amanda::Config qw( :init :getconf );
+use Amanda::Util qw( :constants );
+use Amanda::Logfile qw( :logtype_t log_add );
+use Amanda::Debug qw( debug );
+use Amanda::Paths;
+
+##
+# Main
+
+sub usage {
+    my ($msg) = @_;
+    print STDERR <<EOF;
+Usage: amdump <conf> [--no-taper] [-o configoption]* [host/disk]*
+EOF
+    print STDERR "$msg\n" if $msg;
+    exit 1;
+}
+
+Amanda::Util::setup_application("amdump", "server", $CONTEXT_DAEMON);
+
+my $config_overrides = new_config_overrides($#ARGV+1);
+my @config_overrides_opts;
+
+my $opt_no_taper = 0;
+Getopt::Long::Configure(qw(bundling));
+GetOptions(
+    'help|usage|?' => \&usage,
+    'no-taper' => \$opt_no_taper,
+    'o=s' => sub {
+       push @config_overrides_opts, "-o" . $_[1];
+       add_config_override_opt($config_overrides, $_[1]);
+    },
+) or usage();
+
+usage("No config specified") if (@ARGV < 1);
+
+my $config_name = shift @ARGV;
+set_config_overrides($config_overrides);
+config_init($CONFIG_INIT_EXPLICIT_NAME, $config_name);
+my ($cfgerr_level, @cfgerr_errors) = config_errors();
+if ($cfgerr_level >= $CFGERR_WARNINGS) {
+    config_print_errors();
+    if ($cfgerr_level >= $CFGERR_ERRORS) {
+       die("errors processing config file");
+    }
+}
+
+Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
+
+# useful info for below
+my @hostdisk = @ARGV;
+my $logdir = getconf($CNF_LOGDIR);
+my @now = localtime;
+my $longdate = strftime "%a %b %e %H:%M:%S %Z %Y", @now;
+my $timestamp = strftime "%Y%m%d%H%M%S", @now;
+my $datestamp = strftime "%Y%m%d", @now;
+my $starttime_locale_independent = strftime "%Y-%m-%d %H:%M:%S %Z", @now;
+my $trace_log_filename = "$logdir/log";
+my $amdump_log_filename = "$logdir/amdump";
+my $exit_code = 0;
+my $amdump_log = \*STDERR;
+
+##
+# subs for below
+
+sub amdump_log {
+    print $amdump_log "amdump: ", @_, "\n";
+}
+
+sub check_exec {
+    my ($prog) = @_;
+    return if -x $prog;
+
+    log_add($L_ERROR, "Can't execute $prog");
+}
+
+sub run_subprocess {
+    my ($proc, @args) = @_;
+    check_exec($proc);
+
+    my $pid = POSIX::fork();
+    if ($pid == 0) {
+       my $null = POSIX::open("/dev/null", POSIX::O_RDWR);
+       POSIX::dup2($null, 0);
+       POSIX::dup2($null, 1);
+       POSIX::dup2(fileno($amdump_log), 2);
+       close($amdump_log);
+       exec $proc, @args;
+       die "Could not exec $proc: $!";
+    }
+    waitpid($pid, 0);
+    my $s = $? >> 8;
+    debug("$proc exited with code $s");
+    if ($?) {
+       if ($exit_code == 0) {
+           debug("ignoring failing exit code $s from $proc");
+       } else {
+           debug("recording failing exit code $s from $proc for amdump exit");
+           $exit_code = $s;
+       }
+    }
+}
+
+sub wait_for_hold {
+    my $holdfile = "$CONFIG_DIR/$config_name/hold";
+    if (-f $holdfile) {
+       debug("waiting for hold file '$holdfile' to be removed");
+       while (-f $holdfile) {
+           sleep(60);
+       }
+    }
+}
+
+sub bail_already_running {
+    my $msg = "An Amanda process is already running - please run amcleanup manually";
+    debug($msg);
+    amdump_log($msg);
+
+    # put together a fake logfile and send an amreport
+    my $fakelogfile = "$AMANDA_TMPDIR/fakelog.$$";
+    open(my $fakelog, ">", $fakelogfile)
+       or die("cannot open a fake log to send an report - situation is dire");
+    print $fakelog <<EOF;
+INFO amdump amdump pid $$
+START driver date $timestamp
+ERROR amdump $msg
+EOF
+    run_subprocess("$sbindir/amreport", $config_name, '--from-amdump', '-l', $fakelogfile);
+    unlink($fakelogfile);
+
+    # and we're done here
+    exit 1;
+}
+
+sub do_amcleanup {
+    return unless -f $amdump_log_filename || -f $trace_log_filename;
+
+    # logfiles are still around.  First, try an amcleanup -p to see if
+    # the actual processes are already dead
+    debug("runing amcleanup -p");
+    run_subprocess("$sbindir/amcleanup", '-p', $config_name);
+
+    # and check again
+    return unless -f $amdump_log_filename || -f $trace_log_filename;
+
+    bail_already_running();
+}
+
+sub start_logfiles {
+    debug("beginning trace log");
+    # start the trace log by simply writing an INFO line to it
+    log_add($L_INFO, "amdump pid $$");
+
+    # but not so fast!  What if another process has also appended such a line?
+    open(my $tl, "<", $trace_log_filename)
+       or die("could not open trace log file '$trace_log_filename': $!");
+    if (<$tl> !~ /^INFO amdump amdump pid $$/) {
+       # we didn't get there first, so bail out
+       debug("another amdump raced with this one, and won");
+       bail_already_running();
+    }
+    close($tl);
+
+    # redirect the amdump_log to the proper filename instead of stderr
+    # note that perl will overwrite STDERR if we don't set $amdump_log to
+    # undef first.. stupid perl.
+    debug("beginning amdump log");
+    $amdump_log = undef;
+    open($amdump_log, ">", $amdump_log_filename)
+       or die("could not open amdump log file '$amdump_log_filename': $!");
+}
+
+sub planner_driver_pipeline {
+    my $planner = "$amlibexecdir/planner";
+    my $driver = "$amlibexecdir/driver";
+    my @no_taper = $opt_no_taper? ('--no-taper'):();
+
+    check_exec($planner);
+    check_exec($driver);
+
+    # Perl's open3 is an embarassment to the language.  We'll do this manually.
+    debug("invoking planner | driver");
+    my ($rpipe, $wpipe) = POSIX::pipe();
+
+    my $pl_pid = POSIX::fork();
+    if ($pl_pid == 0) {
+       ## child
+       my $null = POSIX::open("/dev/null", POSIX::O_RDWR);
+       POSIX::dup2($null, 0);
+       POSIX::close($null);
+       POSIX::dup2($wpipe, 1);
+       POSIX::close($rpipe);
+       POSIX::close($wpipe);
+       POSIX::dup2(fileno($amdump_log), 2);
+       close($amdump_log);
+       exec $planner,
+           # note that @no_taper must follow --starttime
+           $config_name, '--starttime', $timestamp, @no_taper, @config_overrides_opts, @hostdisk;
+       die "Could not exec $planner: $!";
+    }
+    debug(" planner: $pl_pid");
+
+    my $dr_pid = POSIX::fork();
+    if ($dr_pid == 0) {
+       ## child
+       my $null = POSIX::open("/dev/null", POSIX::O_RDWR);
+       POSIX::dup2($rpipe, 0);
+       POSIX::close($rpipe);
+       POSIX::close($wpipe);
+       POSIX::dup2(fileno($amdump_log), 1); # driver does lots of logging to stdout..
+       POSIX::close($null);
+       POSIX::dup2(fileno($amdump_log), 2);
+       close($amdump_log);
+       exec $driver,
+           $config_name, @no_taper, @config_overrides_opts;
+       die "Could not exec $driver: $!";
+    }
+    debug(" driver: $dr_pid");
+
+    POSIX::close($rpipe);
+    POSIX::close($wpipe);
+
+    my $first_bad_exit = 0;
+    for (my $i = 0; $i < 2; $i++) {
+       my $dead = wait();
+       die("Error waiting: $!") if ($dead <= 0);
+       my $s = $? >> 8;
+       debug("planner finished with exit code $s") if $dead == $pl_pid;
+       debug("driver finished with exit code $s") if $dead == $dr_pid;
+       my $exit = WIFEXITED($?)? WEXITSTATUS($?) : 1;
+       $first_bad_exit = $exit if ($exit && !$first_bad_exit)
+    }
+    $exit_code |= $first_bad_exit;
+}
+
+sub do_amreport {
+    debug("running amreport");
+    run_subprocess("$sbindir/amreport", $config_name, '--from-amdump');
+}
+
+sub roll_trace_logs {
+    my $t = getconf($CNF_USETIMESTAMPS)? $timestamp : $datestamp;
+    debug("renaming trace log");
+    Amanda::Logfile::log_rename($t)
+}
+
+sub trim_trace_logs {
+    debug("trimming old trace logs");
+    run_subprocess("$amlibexecdir/amtrmlog", $config_name);
+}
+
+sub trim_indexes {
+    debug("trimming old indexes");
+    run_subprocess("$amlibexecdir/amtrmidx", $config_name);
+}
+
+sub roll_amdump_logs {
+    debug("renaming amdump log and trimming old amdump logs (beyond tapecycle+2)");
+
+    # rename all the way along the tapecycle
+    my $days = getconf($CNF_TAPECYCLE) + 2;
+    for (my $i = $days-1; $i >= 1; $i--) {
+       next unless -f "$amdump_log_filename.$i";
+       rename("$amdump_log_filename.$i", "$amdump_log_filename.".($i+1));
+    }
+
+    # now swap the current logfile in
+    rename("$amdump_log_filename", "$amdump_log_filename.1");
+}
+
+# now do the meat of the amdump work; these operations are ported directly
+# from the old amdump.sh script
+
+# wait for $confdir/hold to disappear
+wait_for_hold();
+
+# look for a current logfile, and if found run amcleanup -p, and if that fails
+# bail out
+do_amcleanup();
+
+# start up the log file
+start_logfiles();
+
+# amstatus needs a lot of forms of the time, I guess
+amdump_log("start at $longdate");
+amdump_log("datestamp $datestamp");
+amdump_log("starttime $timestamp");
+amdump_log("starttime-locale-independent $starttime_locale_independent");
+
+# run the planner and driver, the one piped to the other
+planner_driver_pipeline();
+
+my $end_longdate = strftime "%a %b %e %H:%M:%S %Z %Y", localtime;
+amdump_log("end at $end_longdate");
+
+# send the dump report
+do_amreport();
+
+# do some house-keeping
+roll_trace_logs();
+trim_trace_logs();
+trim_indexes();
+roll_amdump_logs();
+
+debug("exiting with code $exit_code");
+exit($exit_code);
diff --git a/server-src/amdump.sh b/server-src/amdump.sh
deleted file mode 100644 (file)
index 7449dfe..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-#!@SHELL@
-#
-# Amanda, The Advanced Maryland Automatic Network Disk Archiver
-# Copyright (c) 1991-1998 University of Maryland at College Park
-# All Rights Reserved.
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of U.M. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  U.M. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-# Author: James da Silva, Systems Design and Analysis Group
-#                         Computer Science Department
-#                         University of Maryland at College Park
-#
-
-#
-# amdump: Manage running one night's Amanda dump run.
-#
-
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-sbindir="@sbindir@"
-amlibexecdir="@amlibexecdir@"
-. "${amlibexecdir}/amanda-sh-lib.sh"
-
-confdir=@CONFIG_DIR@
-
-# add sbin and ucb dirs
-PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
-export PATH
-
-if [ $# -lt 1 ]
-then
-        echo `_ 'Usage: %s config [host [disk...]...]' "$0"`  1>&2
-        exit 1
-fi
-
-exit_status=0;
-
-conf=$1
-if [ ! -d $confdir/$conf ]; then
-    echo `_ '%s: could not find directory %s' "amdump" "$confdir/$conf"` 1>&2
-    exit 1
-fi
-shift
-
-cd $confdir/$conf || exit 1
-
-logdir=`amgetconf $conf logdir "$@"`
-[ $? -ne 0 ]  && exit 1
-errfile=$logdir/amdump
-tapecycle=`amgetconf $conf tapecycle "$@"`
-[ $? -ne 0 ]  && exit 1
-dumpuser=`amgetconf $conf dumpuser "$@"`
-[ $? -ne 0 ]  && exit 1
-
-runuser=`{ whoami ; } 2>/dev/null`
-if [ $? -ne 0 ]; then
-       idinfo=`{ id ; } 2>/dev/null`
-       if [ $? -ne 0 ]; then
-               runuser=${LOGNAME:-"??unknown??"}
-       else
-               runuser=`echo $idinfo | sed -e 's/).*//' -e 's/^.*(//'`
-       fi
-fi
-
-if [ $runuser != $dumpuser ]; then
-       echo `_ '%s: must be run as user %s, not %s' "$0" "$dumpuser" "$runuser"` 1>&2
-       exit 1
-fi
-
-if test -f hold; then
-       echo `_ '%s: waiting for hold file to be removed' "$0"` 1>&2
-       while test -f hold; do
-               sleep 60
-       done
-fi
-
-if test -f $errfile || test -f $logdir/log; then
-       amcleanup -p $conf
-fi
-
-gdate=`date +'%a %b %e %H:%M:%S %Z %YAAAAA%Y%m%dBBBBB%Y%m%d%H%M%SCCCCC%Y-%m-%d %H:%M:%S %Z'`
-
-#date=%a %b %e %H:%M:%S %Z %Y
-date=`echo $gdate |sed -e "s/AAAAA.*$//"`
-
-#date_datestamp="%Y%m%d"
-date_datestamp=`echo $gdate |sed -e "s/^.*AAAAA//;s/BBBBB.*$//"`
-
-#date_starttime="%Y%m%d%H%M%S"
-date_starttime=`echo $gdate |sed -e "s/^.*BBBBB//;s/CCCCC.*$//"`
-
-#date_locale_independent=%Y-%m-%d %H:%M:%S %Z
-date_locale_independent=`echo $gdate |sed -e "s/^.*CCCCC//"`
-
-if test -f $errfile || test -f $logdir/log; then
-       process_name=`grep "^INFO .* .* pid " $logdir/log | head -n 1 | awk '{print $2}'`
-       echo `_ '%s: %s is already running, or you must run amcleanup' "$0" "${process_name}"` 1>&2
-       echo "INFO amdump amdump pid $$" > $logdir/log.$$
-       echo "START driver date $date_starttime" >> $logdir/log.$$
-       echo "ERROR amdump " `_ '%s is already running, or you must run amcleanup' "${process_name}"` >> $logdir/log.$$
-       $sbindir/amreport $conf --from-amdump -l $logdir/log.$$ "$@"
-       rm -f $logdir/log.$$
-       exit 1;
-fi
-
-umask 077
-
-echo "INFO amdump amdump pid $$" > $logdir/log
-exit_code=0
-# Plan and drive the dumps.
-#exec </dev/null >$errfile 2>&1
-touch $errfile
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-exec </dev/null 2>>$errfile 1>&2
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-printf '%s: start at %s\n' "amdump" "$date"
-printf '%s: datestamp %s\n' "amdump" "$date_datestamp"
-printf '%s: starttime %s\n' "amdump" "$date_starttime"
-printf '%s: starttime-locale-independent %s\n' "amdump" "$date_locale_independent"
-
-if [ ! -x $amlibexecdir/planner ]; then
-    echo "ERROR amdump Can't execute $amlibexecdir/planner" >> $logdir/log
-fi
-if [ ! -x $amlibexecdir/driver ]; then
-    echo "ERROR amdump Can't execute $amlibexecdir/driver" >> $logdir/log
-fi
-
-# shells don't do well with handling exit values from pipelines, so we emulate
-# a pipeline in perl, in such a way that we can combine both exit statuses in a
-# kind of logical "OR".
-@PERL@ - $amlibexecdir/planner $amlibexecdir/driver $conf $date_starttime "$@" <<'EOPERL'
-use IPC::Open3;
-use POSIX qw(WIFEXITED WEXITSTATUS);
-my ($planner, $driver, $conf, $date_starttime, @args) = @ARGV;
-
-open3("</dev/null", \*PIPE, ">&STDERR", $planner, $conf, '--starttime', $date_starttime, @args)
-    or die "Could not exec $planner: $!";
-open3("<&PIPE", ">&STDOUT", ">&STDERR", $driver, $conf, @args)
-    or die "Could not exec $driver: $!";
-
-my $first_bad_exit = 0;
-for (my $i = 0; $i < 2; $i++) {
-    my $dead = wait();
-    die("Error waiting: $!") if ($dead <= 0);
-    my $exit = WIFEXITED($?)? WEXITSTATUS($?) : 1;
-    $first_bad_exit = $exit if ($exit && !$first_bad_exit)
-}
-exit $first_bad_exit;
-EOPERL
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-printf '%s: end at %s\n' "amdump" "`date`"
-
-# Send out a report on the dumps.
-$sbindir/amreport $conf --from-amdump "$@"
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-# Roll the log file to its datestamped name.
-$amlibexecdir/amlogroll $conf "$@"
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-# Trim the log file to those for dumps that still exist.
-$amlibexecdir/amtrmlog $conf "$@"
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-# Trim the index file to those for dumps that still exist.
-$amlibexecdir/amtrmidx $conf "$@"
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-# Keep a debug log through the tapecycle plus a couple of days.
-maxdays=`expr $tapecycle + 2`
-days=1
-# First, find out the last existing errfile,
-# to avoid ``infinite'' loops if tapecycle is infinite
-while [ $days -lt $maxdays ] && [ -f $errfile.$days ]; do
-       days=`expr $days + 1`
-done
-# Now, renumber the existing log files
-while [ $days -ge 2 ]; do
-       ndays=`expr $days - 1`
-       mv $errfile.$ndays $errfile.$days
-       exit_code=$?
-       [ $exit_code -ne 0 ] && exit_status=$exit_code
-       days=$ndays
-done
-mv $errfile $errfile.1
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-exit $exit_status
index 11a6bc1b924e44c2db4dec11119569c5aa63d696..3cf38a002a97ea1e5dfc184941dd29f4bae73877 100644 (file)
@@ -156,7 +156,7 @@ $opt_compress = 1 if $opt_compress_best;
 
 usage("must specify at least a hostname") unless @ARGV;
 @opt_dumpspecs = Amanda::Cmdline::parse_dumpspecs([@ARGV],
-    $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP);
+    $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
 
 usage("The -b option is no longer supported; set readblocksize in the tapetype section\n" .
       "of amanda.conf instead.")
@@ -212,14 +212,14 @@ sub new {
     }, $class;
 }
 
-sub notif_part {
+sub clerk_notif_part {
     my $self = shift;
     my ($label, $filenum, $header) = @_;
 
     print STDERR "amfetchdump: $filenum: restoring ", $header->summary(), "\n";
 }
 
-sub notif_holding {
+sub clerk_notif_holding {
     my $self = shift;
     my ($filename, $header) = @_;
 
@@ -288,6 +288,11 @@ sub main {
            return failure("No matching dumps found", $finished_cb);
        }
 
+       # if we are doing a -p operation, only keep the first dump
+       if ($opt_pipe) {
+           @{$plan->{'dumps'}} = ($plan->{'dumps'}[0]);
+       }
+
        my @needed_labels = $plan->get_volume_list();
        my @needed_holding = $plan->get_holding_file_list();
        if (@needed_labels) {
@@ -358,11 +363,11 @@ sub main {
            if ($hdr->{'srv_encrypt'}) {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0);
+                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0, 0);
            } elsif ($hdr->{'clnt_encrypt'}) {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0);
+                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0, 0);
            } else {
                return failure("could not decrypt encrypted dump: no program specified",
                            $finished_cb);
@@ -383,17 +388,17 @@ sub main {
                # TODO: this assumes that srvcompprog takes "-d" to decrypt
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'srvcompprog'}, "-d" ], 0);
+                       [ $hdr->{'srvcompprog'}, "-d" ], 0, 0);
            } elsif ($hdr->{'clntcompprog'}) {
                # TODO: this assumes that clntcompprog takes "-d" to decrypt
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'clntcompprog'}, "-d" ], 0);
+                       [ $hdr->{'clntcompprog'}, "-d" ], 0, 0);
            } else {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
                        [ $Amanda::Constants::UNCOMPRESS_PATH,
-                         $Amanda::Constants::UNCOMPRESS_OPT ], 0);
+                         $Amanda::Constants::UNCOMPRESS_OPT ], 0, 0);
            }
 
            # adjust the header
@@ -408,7 +413,7 @@ sub main {
            push @filters,
                Amanda::Xfer::Filter::Process->new(
                    [ $Amanda::Constants::COMPRESS_PATH,
-                     $compress_opt ], 0);
+                     $compress_opt ], 0, 0);
 
            # adjust the header
            $hdr->{'compressed'} = 1;
index d8e11786b29842896e08c0fae4e6d7809fd7294c..4d28e44755118821311cffa1a934d9a8234fa689 100644 (file)
 #include "amanda.h"
 
 #include "match.h"
+#include "find.h"
 #include "conffile.h"
 #include "diskfile.h"
 #include "tapefile.h"
 #include "logfile.h"
 #include "clock.h"
 #include "holding.h"
-#include "driverio.h"
 #include "server_util.h"
 #include "timestamp.h"
 
@@ -92,6 +92,8 @@ main(
     GSList *datestamp_list = NULL;
     config_overrides_t *cfg_ovr;
     char **config_options;
+    find_result_t *holding_files;
+    disklist_t holding_disklist = { NULL, NULL };
 
     /*
      * Configure program for internationalization:
@@ -172,6 +174,13 @@ main(
 
     dbrename(get_config_name(), DBG_SUBDIR_SERVER);
 
+    /* load DLEs from the holding disk, in case there's anything to flush there */
+    search_holding_disk(&holding_files, &holding_disklist);
+    /* note that the dumps are added to the global disklist, so we need not
+     * consult holding_files or holding_disklist after this.  The holding-only
+     * dumps will be filtered properly by match_disklist, setting the dp->todo
+     * flag appropriately. */
+
     errstr = match_disklist(&diskq, argc-1, argv+1);
     if (errstr) {
        g_printf(_("%s"),errstr);
@@ -340,6 +349,7 @@ main(
        holding_file_get_dumpfile((char *)holding_file->data, &file);
 
        if (holding_file_size((char *)holding_file->data, 1) <= 0) {
+           g_debug("%s is empty - ignoring", (char *)holding_file->data);
            log_add(L_INFO, "%s: removing file with no data.",
                    (char *)holding_file->data);
            holding_file_unlink((char *)holding_file->data);
@@ -347,11 +357,12 @@ main(
            continue;
        }
 
+       /* search_holding_disk should have already ensured that every
+        * holding dumpfile has an entry in the dynamic disklist */
        dp = lookup_disk(file.name, file.disk);
-       if (!dp) {
-           error("dp == NULL");
-           /*NOTREACHED*/
-       }
+       assert(dp != NULL);
+
+       /* but match_disklist may have indicated we should not flush it */
        if (dp->todo == 0) continue;
 
        qdisk = quote_string(file.disk);
@@ -363,6 +374,8 @@ main(
                file.datestamp,
                file.dumplevel,
                qhname);
+
+       g_debug("flushing '%s'", (char *)holding_file->data);
        g_fprintf(driver_stream,
                "FLUSH %s %s %s %d %s\n",
                file.name,
@@ -656,6 +669,7 @@ confirm(GSList *datestamp_list)
     }
 
     g_printf(_("Ok, quitting.  Run amflush again when you are ready.\n"));
+    log_add(L_INFO, "pid-done %ld", (long)getpid());
     exit(1);
 }
 
index 43648dcc0d13f44d1c6bd44020eb8149ffc07cff..ea22fc28e9f88e564f22fca30f1c73be6f4bc69d 100644 (file)
@@ -108,44 +108,6 @@ sub user_request {
     };
 };
 
-##
-# Clerk Feedback class
-
-package main::Feedback;
-use Amanda::Recovery::Clerk;
-use Amanda::Util qw( weaken_ref );
-use base 'Amanda::Recovery::Clerk::Feedback';
-
-sub new {
-    my $class = shift;
-    my %params = @_;
-
-    my $self = bless {
-       clientservice => $params{'clientservice'}
-    }, $class;
-
-    # (weak ref here to eliminate reference loop)
-    weaken_ref($self->{'clientservice'});
-
-    return $self;
-}
-
-sub part_notif {
-    my $self = shift;
-
-    my ($label, $filenum, $hdr) = @_;
-    $self->{'clientservice'}->sendmessage("restoring part $hdr->{'partnum'} " .
-         "from '$label' file $filenum");
-}
-
-sub holding_notif {
-    my $self = shift;
-
-    my ($holding_file, $hdr) = @_;
-    $self->{'clientservice'}->sendmessage("restoring from holding " .
-               "file $holding_file");
-}
-
 ##
 # ClientService class
 
@@ -164,6 +126,8 @@ use Amanda::Recovery::Clerk;
 use Amanda::Recovery::Planner;
 use Amanda::Recovery::Scan;
 use Amanda::DB::Catalog;
+use Amanda::Disklist;
+use Amanda::Logfile qw( match_disk match_host );
 
 # Note that this class performs its control IO synchronously.  This is adequate
 # for this service, as it never receives unsolicited input from the remote
@@ -266,13 +230,22 @@ sub read_command {
        $self->{'their_features'} = Amanda::Feature::Set->from_string($command->{'FEATURES'});
     }
 
-    if ($command->{'CONFIG'}) {
-       config_init($CONFIG_INIT_EXPLICIT_NAME, $command->{'CONFIG'});
-       my ($cfgerr_level, @cfgerr_errors) = config_errors();
-       if ($cfgerr_level >= $CFGERR_ERRORS) {
-           die "configuration errors; aborting connection";
-       }
-       Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER_PREFERRED);
+    # load the configuration
+    if (!$command->{'CONFIG'}) {
+       die "no CONFIG line given";
+    }
+    config_init($CONFIG_INIT_EXPLICIT_NAME, $command->{'CONFIG'});
+    my ($cfgerr_level, @cfgerr_errors) = config_errors();
+    if ($cfgerr_level >= $CFGERR_ERRORS) {
+       die "configuration errors; aborting connection";
+    }
+    Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER_PREFERRED);
+
+    # and the disklist
+    my $diskfile = Amanda::Config::config_dir_relative(getconf($CNF_DISKFILE));
+    $cfgerr_level = Amanda::Disklist::read_disklist('filename' => $diskfile);
+    if ($cfgerr_level >= $CFGERR_ERRORS) {
+       die "Errors processing disklist";
     }
 
     $self->setup_data_stream();
@@ -334,7 +307,8 @@ sub make_plan {
            $self->{'command'}{'HOST'},
            $disk,
            $self->{'command'}{'DATESTAMP'},
-           undef); # amidxtaped protocol does not provide a level (!?)
+           undef,  # amidxtaped protocol does not provide a level (!?)
+           undef); # amidxtaped protocol does not provide a write timestamp
     }
 
     # figure out if this is a holding-disk recovery
@@ -382,7 +356,8 @@ sub make_plan {
     $scan->{'scan_conf'}->{'notfound'} = Amanda::Recovery::Scan::SCAN_ASK;
 
     $self->{'clerk'} = Amanda::Recovery::Clerk->new(
-       feedback => main::Feedback->new($chg, undef),
+       # note that we don't have any use for clerk_notif's, so we don't pass
+       # a feedback object
        scan => $scan);
 
     if ($is_holding) {
@@ -438,6 +413,51 @@ sub plan_cb {
        return $self->quit();
     }
 
+    # check that the request-limit for this DLE allows this recovery.  because
+    # of the bass-ackward way that amrecover specifies the dump to us, we can't
+    # check the results until *after* the plan was created.
+    my $dump = $plan->{'dumps'}->[0];
+    my $dle = Amanda::Disklist::get_disk($dump->{'hostname'}, $dump->{'diskname'});
+    my $recovery_limit;
+    if ($dle && dumptype_seen($dle->{'config'}, $DUMPTYPE_RECOVERY_LIMIT)) {
+       debug("using DLE recovery limit");
+       $recovery_limit = dumptype_getconf($dle->{'config'}, $DUMPTYPE_RECOVERY_LIMIT);
+    } elsif (getconf_seen($CNF_RECOVERY_LIMIT)) {
+       debug("using global recovery limit as default");
+       $recovery_limit = getconf($CNF_RECOVERY_LIMIT);
+    }
+    my $peer = $ENV{'AMANDA_AUTHENTICATED_PEER'};
+    if (defined $recovery_limit) { # undef -> no recovery limit
+       if (!$peer) {
+           warning("a recovery limit is specified for this DLE, but no authenticted ".
+                   "peer name is available; rejecting request.");
+           $self->sendmessage("No matching dumps found");
+           return $self->quit();
+       }
+       my $matched = 0;
+       for my $rl (@$recovery_limit) {
+           if (!defined $rl) {
+               # handle same-host with a case-insensitive string compare, not match_host
+               if (lc($peer) eq lc($dump->{'hostname'})) {
+                   $matched = 1;
+                   last;
+               }
+           }
+
+           # otherwise use match_host to allow match expressions
+           if (match_host($rl, $peer)) {
+               $matched = 1;
+               last;
+           }
+       }
+       if (!$matched) {
+           warning("authenticated peer '$peer' did not match recovery-limit ".
+                   "config; rejecting request");
+           $self->sendmessage("No matching dumps found");
+           return $self->quit();
+       }
+    }
+
     if (!$self->{'their_features'}->has($Amanda::Feature::fe_recover_splits)) {
        # if we have greater than one volume, we may need to prompt for a new
        # volume in mid-recovery.  Sadly, we have no way to inform the client of
@@ -476,11 +496,11 @@ sub xfer_src_cb {
        if ($header->{'srv_encrypt'}) {
            push @filters,
                Amanda::Xfer::Filter::Process->new(
-                   [ $header->{'srv_encrypt'}, $header->{'srv_decrypt_opt'} ], 0);
+                   [ $header->{'srv_encrypt'}, $header->{'srv_decrypt_opt'} ], 0, 1);
        } elsif ($header->{'clnt_encrypt'}) {
            push @filters,
                Amanda::Xfer::Filter::Process->new(
-                   [ $header->{'clnt_encrypt'}, $header->{'clnt_decrypt_opt'} ], 0);
+                   [ $header->{'clnt_encrypt'}, $header->{'clnt_decrypt_opt'} ], 0, 1);
        } else {
            $self->sendmessage("could not decrypt encrypted dump: no program specified");
            return $self->quit();
@@ -502,17 +522,17 @@ sub xfer_src_cb {
            # TODO: this assumes that srvcompprog takes "-d" to decrypt
            push @filters,
                Amanda::Xfer::Filter::Process->new(
-                   [ $header->{'srvcompprog'}, "-d" ], 0);
+                   [ $header->{'srvcompprog'}, "-d" ], 0, 1);
        } elsif ($header->{'clntcompprog'}) {
            # TODO: this assumes that clntcompprog takes "-d" to decrypt
            push @filters,
                Amanda::Xfer::Filter::Process->new(
-                   [ $header->{'clntcompprog'}, "-d" ], 0);
+                   [ $header->{'clntcompprog'}, "-d" ], 0, 1);
        } else {
            push @filters,
                Amanda::Xfer::Filter::Process->new(
                    [ $Amanda::Constants::UNCOMPRESS_PATH,
-                     $Amanda::Constants::UNCOMPRESS_OPT ], 0);
+                     $Amanda::Constants::UNCOMPRESS_OPT ], 0, 1);
        }
 
        # adjust the header
index 4ebdb35fdd3ca0ce310d9aa7cc3e38c52db454f7..6465685c38ff94d13b1e97e07d002296136af6bb 100644 (file)
@@ -45,6 +45,7 @@
 #include "diskfile.h"
 #include "arglist.h"
 #include "clock.h"
+#include "match.h"
 #include "amindex.h"
 #include "disk_history.h"
 #include "list_dir.h"
@@ -634,6 +635,63 @@ is_dump_host_valid(
 }
 
 
+static gboolean
+is_disk_allowed(
+    disk_t *disk)
+{
+    dumptype_t *dt = disk->config;
+    recovery_limit_t *rl = NULL;
+    char *peer;
+    char *dle_hostname;
+    GSList *iter;
+
+    /* get the config: either for the DLE or the global config */
+    if (dt) {
+       if (dumptype_seen(dt, DUMPTYPE_RECOVERY_LIMIT)) {
+           g_debug("using recovery limit from DLE");
+           rl = dumptype_get_recovery_limit(dt);
+       }
+    }
+    if (!rl) {
+       if (getconf_seen(CNF_RECOVERY_LIMIT)) {
+           g_debug("using global recovery limit");
+           rl = getconf_recovery_limit(CNF_RECOVERY_LIMIT);
+       }
+    }
+    if (!rl) {
+       g_debug("no recovery limit found; allowing access");
+       return TRUE;
+    }
+
+    peer = getenv("AMANDA_AUTHENTICATED_PEER");
+    if (!peer || !*peer) {
+       g_warning("DLE has a recovery-limit, but no authenticated peer name is "
+                 "available; rejecting");
+       return FALSE;
+    }
+
+    /* check same-host */
+    dle_hostname = disk->host? disk->host->hostname : NULL;
+    if (rl->same_host && dle_hostname) {
+       if (0 == g_ascii_strcasecmp(peer, dle_hostname)) {
+           g_debug("peer matched same-host ('%s')", dle_hostname);
+           return TRUE;
+       }
+    }
+
+    /* check the match list */
+    for (iter = rl->match_pats; iter; iter = iter->next) {
+       char *pat = iter->data;
+       if (match_host(pat, peer))
+           return TRUE;
+    }
+
+    g_warning("peer '%s' does not match any of the recovery-limit restrictions; rejecting",
+           peer);
+
+    return FALSE;
+}
+
 static int
 is_disk_valid(
     char *disk)
@@ -650,11 +708,11 @@ is_disk_valid(
        return -1;
     }
 
-    /* check that the config actually handles that disk */
+    /* check that the config actually handles that disk, and that recovery-limit allows it */
     idisk = lookup_disk(dump_hostname, disk);
-    if(idisk == NULL) {
+    if(idisk == NULL || !is_disk_allowed(idisk)) {
        qdisk = quote_string(disk);
-       reply(501, _("Disk %s:%s is not in your disklist."), dump_hostname, qdisk);
+       reply(501, _("Disk %s:%s is not in the server's disklist."), dump_hostname, qdisk);
        amfree(qdisk);
        return -1;
     }
@@ -1067,8 +1125,9 @@ void opaque_ls_one(
     am_feature_e marshall_feature,
     int                 recursive)
 {
-   char date[20];
-   char *tapelist_str;
+    char date[20];
+    char *tapelist_str;
+    char *qtapelist_str;
     char *qpath;
 
     if (am_has_feature(their_features, marshall_feature)) {
@@ -1077,6 +1136,11 @@ void opaque_ls_one(
        tapelist_str = dir_item->dump->tapes->label;
     }
 
+    if (am_has_feature(their_features, fe_amindexd_quote_label)) {
+       qtapelist_str = quote_string(tapelist_str);
+    } else {
+       qtapelist_str = stralloc(tapelist_str);
+    }
     strncpy(date, dir_item->dump->date, 20);
     date[19] = '\0';
     if(!am_has_feature(their_features,fe_amrecover_timestamp))
@@ -1090,7 +1154,7 @@ void opaque_ls_one(
        fast_lreply(201, " %s %d %s %lld %s",
                    date,
                    dir_item->dump->level,
-                   tapelist_str,
+                   qtapelist_str,
                    (long long)dir_item->dump->file,
                    qpath);
     }
@@ -1098,12 +1162,13 @@ void opaque_ls_one(
 
        fast_lreply(201, " %s %d %s %s",
                    date, dir_item->dump->level,
-                   tapelist_str, qpath);
+                   qtapelist_str, qpath);
     }
     amfree(qpath);
     if(am_has_feature(their_features, marshall_feature)) {
        amfree(tapelist_str);
     }
+    amfree(qtapelist_str);
 }
 
 /*
index e9920dba2af94ec5eb9f56545290daa0666ef1d2..d2fd4fdafdaa7ed7ac03086c97c943a6aac0db19 100644 (file)
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 
 use File::Basename;
 use Getopt::Long;
@@ -113,7 +114,7 @@ sub main {
        }
 
        $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST));
-       $tl = Amanda::Tapelist::read_tapelist($tlf);
+       $tl = Amanda::Tapelist->new($tlf);
        if (!defined $tl) {
            return failure("Can't load tapelist file ($tlf)", $finished_cb);
        }
@@ -216,16 +217,17 @@ sub main {
            }
 
            # update the tapelist
+           $tl->reload(1);
            $tl->remove_tapelabel($opt_label);
-           $tl->add_tapelabel("0", $opt_label, undef);
-           $tl->write($tlf);
+           $tl->add_tapelabel("0", $opt_label, undef, 1);
+           $tl->write();
 
            print "Success!\n";
 
            # notify the changer
            $res->set_label(label => $opt_label, finished_cb => $steps->{'labeled'});
        } else {
-           return failure("Volume not labeled.", $finished_cb);
+           return failure("Not writing label.", $finished_cb);
        }
     };
 
diff --git a/server-src/amlogroll.c b/server-src/amlogroll.c
deleted file mode 100644 (file)
index dd38d21..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: James da Silva, Systems Design and Analysis Group
- *                        Computer Science Department
- *                        University of Maryland at College Park
- */
-/*
- * $Id: amlogroll.c,v 1.14 2006/07/25 18:27:57 martinea Exp $
- *
- * rename a live log file to the datestamped name.
- */
-
-#include "amanda.h"
-#include "conffile.h"
-#include "logfile.h"
-
-char *datestamp;
-
-void handle_start(void);
-int main(int argc, char **argv);
-
-int
-main(
-    int                argc,
-    char **    argv)
-{
-    char *logfname;
-    char *conf_logdir;
-    FILE *logfile;
-    config_overrides_t *cfg_ovr = NULL;
-    char *cfg_opt = NULL;
-
-    /*
-     * Configure program for internationalization:
-     *   1) Only set the message locale for now.
-     *   2) Set textdomain for all amanda related programs to "amanda"
-     *      We don't want to be forced to support dozens of message catalogs.
-     */  
-    setlocale(LC_MESSAGES, "C");
-    textdomain("amanda"); 
-
-    safe_fd(-1, 0);
-
-    set_pname("amlogroll");
-
-    dbopen(DBG_SUBDIR_SERVER);
-
-    add_amanda_log_handler(amanda_log_stderr);
-
-    /* Process options */
-    cfg_ovr = extract_commandline_config_overrides(&argc, &argv);
-
-    if (argc >= 2) {
-       cfg_opt = argv[1];
-    }
-
-    /* read configuration files */
-
-    set_config_overrides(cfg_ovr);
-    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_USE_CWD, cfg_opt);
-
-    if (config_errors(NULL) >= CFGERR_WARNINGS) {
-       config_print_errors();
-       if (config_errors(NULL) >= CFGERR_ERRORS) {
-           g_critical(_("errors processing config file"));
-       }
-    }
-
-    safe_cd(); /* must happen after config_init */
-
-    check_running_as(RUNNING_AS_DUMPUSER);
-
-    dbrename(get_config_name(), DBG_SUBDIR_SERVER);
-
-    conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
-    logfname = vstralloc(conf_logdir, "/", "log", NULL);
-    amfree(conf_logdir);
-
-    if((logfile = fopen(logfname, "r")) == NULL) {
-       error(_("could not open log %s: %s"), logfname, strerror(errno));
-       /*NOTREACHED*/
-    }
-    amfree(logfname);
-
-    add_amanda_log_handler(amanda_log_trace_log);
-
-    while(get_logline(logfile)) {
-       if(curlog == L_START) {
-           handle_start();
-           if(datestamp != NULL) {
-               break;
-           }
-       }
-    }
-    afclose(logfile);
-    log_rename(datestamp);
-
-    amfree(datestamp);
-
-    dbclose();
-
-    return 0;
-}
-
-void handle_start(void)
-{
-    static int started = 0;
-    char *s, *fp;
-    int ch;
-
-    if(!started) {
-       s = curstr;
-       ch = *s++;
-
-       skip_whitespace(s, ch);
-       if(ch == '\0' || strncmp_const_skip(s - 1, "date", s, ch) != 0) {
-           return;                             /* ignore bogus line */
-       }
-
-       skip_whitespace(s, ch);
-       if(ch == '\0') {
-           return;
-       }
-       fp = s - 1;
-       skip_non_whitespace(s, ch);
-       s[-1] = '\0';
-       datestamp = newstralloc(datestamp, fp);
-       s[-1] = (char)ch;
-
-       started = 1;
-    }
-}
diff --git a/server-src/amlogroll.pl b/server-src/amlogroll.pl
new file mode 100644 (file)
index 0000000..7d93747
--- /dev/null
@@ -0,0 +1,67 @@
+#! @PERL@
+# Copyright (c) 2010 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use lib '@amperldir@';
+use strict;
+use warnings;
+
+use Amanda::Util qw( :constants );
+use Amanda::Config qw( :init );
+use Amanda::Logfile qw( log_rename get_current_log_timestamp $amanda_log_trace_log );
+use Amanda::Debug;
+use Getopt::Long;
+
+Amanda::Util::setup_application("amlogroll", "server", $CONTEXT_CMDLINE);
+
+my $config_overrides = new_config_overrides($#ARGV+1);
+Getopt::Long::Configure(qw{bundling});
+GetOptions(
+    'o=s' => sub { add_config_override_opt($config_overrides, $_[1]); },
+) or usage();
+
+if (@ARGV < 1) {
+    die "USAGE: amlogroll <config> <config-overwrites> <ignored-stuff>";
+}
+
+set_config_overrides($config_overrides);
+config_init($CONFIG_INIT_EXPLICIT_NAME, $ARGV[0]);
+my ($cfgerr_level, @cfgerr_errors) = config_errors();
+if ($cfgerr_level >= $CFGERR_WARNINGS) {
+    config_print_errors();
+    if ($cfgerr_level >= $CFGERR_ERRORS) {
+        die "Errors processing config file";
+    }
+}
+
+# our STDERR may be connected to the amdump log file, so be sure to do unbuffered
+# writes to that file
+my $old_fh = select(STDERR);
+$| = 1;
+select($old_fh);
+
+Amanda::Debug::add_amanda_log_handler($amanda_log_trace_log);
+
+Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
+
+# the actual work of the program - very short!
+my $timestamp = get_current_log_timestamp();
+die "could not get current timestamp" unless $timestamp;
+log_rename($timestamp);
+
+Amanda::Util::finish_application();
index e4bda6e0b0a3d808a40d95b9aa0fb4489bdfbfe7..9990635a68b0bca0bb8470d771521544a9d20f32 100644 (file)
@@ -1,55 +1,53 @@
 #!@PERL@
-
-# Catch for sh/csh on systems without #! ability.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-       & eval 'exec @PERL@ -S $0 $argv:q'
-               if 0;
-
-require 5.001;
-
+# Copyright (c) 2010 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# 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
+#
+# Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use lib '@amperldir@';
+use strict;
+use warnings;
+
+use Amanda::Config qw( :init :getconf );
+use Amanda::Disklist;
+use Amanda::DB::Catalog;
 use FileHandle;
 use Getopt::Long;
-use Text::ParseWords;
 use Carp;
 use POSIX;
 
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
 sub Usage {
     print STDERR <<END;
-Usage: $0 [[-config] CONFIG] [-hostwidth width] [-diskwidth width] [-skipmissed] [-last] [-num0] [-togo0] [-verbose]
+Usage: $0 [[--config] CONFIG] [--hostwidth width] [--diskwidth width]
+         [-skipmissed] [--last] [--num0] [--togo0] [--verbose]
 
 This script generates to standard output an overview of the filesystems
 dumped over time and the type of dump done on a particular day, such as
 a full dump, or an incremental, or if the dump failed.
 
 You may override the default configuration `@DEFAULT_CONFIG@' by using
-the -config command line option.  On larger installations, this script
+the --config command line option.  On larger installations, this script
 will take a while to run.  In this case, run it with --verbose to see
 how far along it is.
 END
     exit 1;
 }
 
-# Default paths for this installation of Amanda.
-my $prefix='@prefix@';
-$prefix=$prefix;               # avoid warnings about possible typo
-my $exec_prefix="@exec_prefix@";
-$exec_prefix=$exec_prefix;     # ditto
-my $amlibexecdir="@amlibexecdir@";
-my $sbindir="@sbindir@";
-# The directory where configurations can be found.
-my $confdir="@CONFIG_DIR@";
-
-# The default configuration.
-my $config="@DEFAULT_CONFIG@";
-
-my $amadmin    = "$sbindir/amadmin";
-
 # overrideable defaults
-my $opt_config         = "$config";
+my $opt_config         = undef;
 my $opt_hostwidth      = 8;
 my $opt_diskwidth      = 20;
 my $opt_skipmissed     = 0;
@@ -68,107 +66,62 @@ GetOptions('config=s'              => \$opt_config,
           'verbose'            => \$opt_verbose)
 or Usage();
 
-if($#ARGV == 0) {
+if(@ARGV == 1) {
   $opt_config = $ARGV[0];
-}
-elsif($#ARGV > 0) {
+} else {
   Usage();
 }
 
-#untaint user input $ARGV[0]
-
-if ($opt_config =~ /^([\w.-]+)$/) {          # $1 is untainted
-   $opt_config = $1;
-} else {
-    die "filename '$opt_config' has invalid characters.\n";
+#Initialize configuration
+config_init($CONFIG_INIT_EXPLICIT_NAME, $opt_config);
+my ($cfgerr_level, @cfgerr_errors) = config_errors();
+if ($cfgerr_level >= $CFGERR_WARNINGS) {
+    config_print_errors();
+    if ($cfgerr_level >= $CFGERR_ERRORS) {
+        die("errors processing config file");
+    }
 }
 
-
--d "$confdir/$opt_config" or
-       die "$0: directory `$confdir/$opt_config' does not exist.\n";
-
 # read disklist
+$cfgerr_level = Amanda::Disklist::read_disklist();
+die("Config errors") if ($cfgerr_level >= $CFGERR_WARNINGS);
+
 my %disks = ();
-$::host = '';
-$::disk = '';
-$opt_verbose and
-    print STDERR "Running $amadmin $opt_config disklist\n";
-my $dlfh = new FileHandle "$amadmin $opt_config disklist|" or
-    die "$0: error in opening `$amadmin $opt_config disklist' pipe: $!\n";
-$/ = "";
-while (<$dlfh>) {
-    ($host, $disk) = m/    host (.*?):\n.*    disk (.*?):\n.*strategy (STANDARD|NOFULL|NOINC|HANOI|INCRONLY).*ignore NO/ms;
-    next unless $host;
-    $disks{$host}{$disk}++;
+foreach my $dle (Amanda::Disklist::all_disks()) {
+    $disks{$dle->{"host"}->{"hostname"}}{$dle->{"name"}}++;
 }
 
-$/ = "\n";
-$dlfh->close or
-    die "$0: error in closing `$amadmin $opt_config disklist|' pipe: $!\n";
-
-# Get backup dates
-%::dates = ();
-%::level = ();
-$::level = '';
-my ($date, $tape, $file, $status);
+# Get dumps
+my %dates = ();
+my %level = ();
+my ($date, $host, $disk);
 $opt_verbose and
-    print STDERR "Running $amadmin $opt_config find\n";
-my $fh = new FileHandle "$amadmin $opt_config find|" or
-    die "$0: error in opening `$amadmin $opt_config find' pipe: $!\n";
-<$fh>;
-while (<$fh>) {
-    chomp;
-    next if /found Amanda directory/;
-    next if /skipping cruft directory/;
-    next if /skip-incr/;
-
-    ($date, $time, $host, $disk, $level, $tape, $file, $part, $status, $remaining) = shellwords($_);
-
-    next if $date eq 'date';
-    next if $date eq 'Warning:';
-    next if $date eq 'Scanning';
-    next if $date eq "";
-
-    $status .= " " . $remaining;
-    if($time !~/^\d\d:\d\d:\d\d$/) {
-       $status = $part;
-       $part = $file;
-       $file = $tape;
-       $tape = $level;
-       $level = $disk;
-       $disk = $host;
-       $host = $time;
-    }
-    next if ($part != 1);
-
-    if ($date =~ /^\d\d\d\d-\d\d-\d\d$/) {
-       if(defined $disks{$host}{$disk}) {
-           defined($level{$host}{$disk}{$date}) or
-               $level{$host}{$disk}{$date} = '';
-           $level{$host}{$disk}{$date} .= ($status eq 'OK') ? $level : 'E';
-           $dates{$date}++;
-       }
-    }
-    else {
-       print "bad date $date in $_\n";
+    print STDERR "Processing $opt_config dumps\n";
+foreach my $dump (Amanda::DB::Catalog::sort_dumps(['hostname','diskname','write_timestamp'],Amanda::DB::Catalog::get_dumps())) {
+    $host = $dump->{"hostname"};
+    $disk = $dump->{"diskname"};
+    $date = substr($dump->{"dump_timestamp"},0,8);
+
+    if (defined $disks{$host}{$disk}) {
+        defined($level{$host}{$disk}{$date}) or
+            $level{$host}{$disk}{$date} = '';
+        $level{$host}{$disk}{$date} .= ($dump->{"status"} eq 'OK') ? $dump->{"level"} : 'E';
+        $dates{$date}++;
     }
 }
-$fh->close or
-    die "$0: error in closing `$amadmin $opt_config find|' pipe: $!\n";
 
 # Process the status to arrive at a "last" status
 if ($opt_last) {
     for $host (sort keys %disks) {
         for $disk (sort keys %{$disks{$host}}) {
-           $level{$host}{$disk}{"0000-LA-ST"} = '';
+           $level{$host}{$disk}{"0000LAST"} = '';
            for $date (sort keys %dates) {
+               next unless defined($level{$host}{$disk}{$date});
                if ($level{$host}{$disk}{$date} eq "E"
-                    && $level{$host}{$disk}{"0000-LA-ST"} =~ /^\d/ ) {
-                   $level{$host}{$disk}{"0000-LA-ST"} .= $level{$host}{$disk}{$date};
-               } elsif ($level{$host}{$disk}{$date} eq "") {
-                   $level{$host}{$disk}{"0000-LA-ST"} =~ s/E//;
+                    && $level{$host}{$disk}{"0000LAST"} =~ /^\d/ ) {
+                   $level{$host}{$disk}{"0000LAST"} .= $level{$host}{$disk}{$date};
                } else {
-                   $level{$host}{$disk}{"0000-LA-ST"} = $level{$host}{$disk}{$date};
+                   $level{$host}{$disk}{"0000LAST"} = $level{$host}{$disk}{$date};
                }
            }
         }
@@ -179,10 +132,11 @@ if ($opt_last) {
 if ($opt_num0) {
     for $host (sort keys %disks) {
         for $disk (sort keys %{$disks{$host}}) {
-            $level{$host}{$disk}{'0000-NM-L0'} = 0;
+            $level{$host}{$disk}{'0000NML0'} = 0;
             for $date (sort keys %dates) {
-                if ($level{$host}{$disk}{$date} =~ /0/) {
-                    $level{$host}{$disk}{'0000-NM-L0'} += 1;
+                if (defined($level{$host}{$disk}{$date})
+                       && $level{$host}{$disk}{$date} =~ /0/) {
+                    $level{$host}{$disk}{'0000NML0'} += 1;
                 }
             }
         }
@@ -193,11 +147,12 @@ if ($opt_num0) {
 if ($opt_togo0) {
     for $host (sort keys %disks) {
         for $disk (sort keys %{$disks{$host}}) {
-            $level{$host}{$disk}{'0000-TO-GO'} = 0;
+            $level{$host}{$disk}{'0000TOGO'} = 0;
             my $togo=0;
             for $date (sort keys %dates) {
-                if ($level{$host}{$disk}{$date} =~ /0/) {
-                    $level{$host}{$disk}{'0000-TO-GO'} = $togo;
+                if (defined($level{$host}{$disk}{$date})
+                       && $level{$host}{$disk}{$date} =~ /0/) {
+                    $level{$host}{$disk}{'0000TOGO'} = $togo;
                 }
                 $togo++;
             }
@@ -210,51 +165,59 @@ unless ($opt_skipmissed)
 {
     my ($start, $finish) = 
        map {
-           my($y,$m,$d) = split /-/, $_;
+           my($y,$m,$d) = /(....)(..)(..)/;
            POSIX::mktime(0,0,0,$d,$m-1,$y-1900);
        } (sort keys %dates)[0,-1];
 
-    while ($start < $finish) {
-       my @l = localtime $start;
-       $dates{sprintf("%d-%02d-%02d", 1900+$l[5], $l[4]+1, $l[3])}++;
-       $start += 86400;
+    # Special case of only one date
+    if (defined($finish)) {
+       while ($start < $finish) {
+           my @l = localtime $start;
+           $dates{sprintf("%d%02d%02d", 1900+$l[5], $l[4]+1, $l[3])}++;
+           $start += 86400;
+       }
     }
 }
 
 #Add the "last" entry    
-$dates{"0000-LA-ST"}=1 if ($opt_last);
+$dates{"0000LAST"}=1 if ($opt_last);
 
 #Add the "Number of Level 0s" entry
-$dates{"0000-NM-L0"}=1 if ($opt_num0);
+$dates{"0000NML0"}=1 if ($opt_num0);
 
 #Add the "Runs to go" entry
-$dates{"0000-TO-GO"}=1 if ($opt_togo0);
+$dates{"0000TOGO"}=1 if ($opt_togo0);
 
 # make formats
 
-my $top_format = "format TOP =\n\n" .
-    sprintf("%-0${opt_hostwidth}s %-0${opt_diskwidth}s ", '', 'date') .
-    join(' ', map((split(/-/, $_))[1], sort keys %dates)) . "\n" .
-    sprintf("%-0${opt_hostwidth}s %-0${opt_diskwidth}s ", 'host', 'disk') .
-    join(' ', map((split(/-/, $_))[2], sort keys %dates)) . "\n" .
-    "\n.\n";
+sub row {
+    my ($host, $disk, @cols) = @_;
+    $host = substr($host, 0, $opt_hostwidth);
+    $disk = substr($disk, 0, $opt_diskwidth);
+    print
+       sprintf("%-0${opt_hostwidth}s %-0${opt_diskwidth}s ", $host, $disk) .
+       join(" ", map(sprintf("%-2s ", $_), @cols)) .
+       "\n";
+}
 
-my $out_format = "format STDOUT =\n" .
-    "@" . "<" x ($opt_hostwidth - 1) . ' ' .
-    "@" . "<" x ($opt_diskwidth - 1) . ' ' .
-    '@> ' x scalar(keys %dates) . "\n" .
-    join(', ', '$host', '$disk', 
-        map("substr(\$level{\$host}{\$disk}{'$_'},-2)", sort keys %dates)) . "\n" .
-    ".\n";
+sub fmt_levels {
+    my ($host, $disk, $date) = @_;
+    my $levels = $level{$host}{$disk}{$date};
+
+    # no dumps on this date
+    $levels = '-' unless defined($levels);
+
+    return substr($levels, -2);
+}
 
-eval $top_format;
-die $@ if $@;
-$^ = 'TOP';
-eval $out_format;
-die $@ if $@;
+# header
+row('',     'date', map((/....(..) .. /x)[0], sort keys %dates));
+row('host', 'disk', map((/.... .. (..)/x)[0], sort keys %dates));
 
+# body
 for $host (sort keys %disks) {
     for $disk (sort keys %{$disks{$host}}) {
-       write;
+       row($host, $disk,
+           map(fmt_levels($host, $disk, $_), sort keys %dates));
     }
 }
index b88ba7ceaa51cba2c6e7c3462c2fa45bb0e8d17a..9264e00aafca8bd1a035c47b475dcbcd77c6ce0a 100755 (executable)
@@ -276,38 +276,23 @@ sub legacy_send_amreport
     return 0 if ($cfg_send == $SEND_AMREPORT_NEVER);
 
     my $output_name = join(" ", @{ $output->[FORMAT] }, @{ $output->[OUTPUT] });
-    my ($send_amreport, $process_stranges, $process_fails) = (0, 0, 0);
+    my $send_amreport = 0;
 
     debug("testingamreport_send_on=$cfg_send, output:$output_name");
 
-    foreach my $dle ($report->get_dles()) {
-
-        my $dle_info = $report->get_dle_info(@$dle);
-        my $tries    = $dle_info->{tries};
-
-        foreach my $try (@$tries) {
-
-            foreach my $program (keys %$try) {
-
-                $process_stranges++ if $try->{$program}{status} eq 'strange';
-                $process_fails++    if $try->{$program}{status} eq 'fail';
-            }
-        }
-    }
-
     if ($cfg_send == $SEND_AMREPORT_STRANGE) {
 
         if (   !$report->get_flag("got_finish")
-            || ($report->get_flag("exit_status") != 0)
-            || $process_stranges
-            || $process_fails) {
+           || ($report->get_flag("dump_failed") != 0)
+           || ($report->get_flag("results_missing") != 0)
+           || ($report->get_flag("dump_strange") != 0)) {
 
-            debug("send_amreport_on=$cfg_send, condition filled for $output_name");
+            debug("send-amreport-on=$cfg_send, condition filled for $output_name");
             $send_amreport = 1;
 
         } else {
 
-            debug("send_amreport_on=$cfg_send, condition not filled for $output_name");
+            debug("send-amreport-on=$cfg_send, condition not filled for $output_name");
             $send_amreport = 0;
         }
 
@@ -315,14 +300,16 @@ sub legacy_send_amreport
 
         if (   !$report->get_flag("got_finish")
             || ($report->get_flag("exit_status") != 0)
-            || $process_fails) {
+            || ($report->get_flag("dump_failed") != 0)
+            || ($report->get_flag("results_missing") != 0)
+            || ($report->get_flag("dump_strange") != 0)) {
 
-            debug("send_amreport_on=$cfg_send, condition filled for $output_name");
+            debug("send-amreport-on=$cfg_send, condition filled for $output_name");
             $send_amreport = 1;
 
         } else {
 
-            debug("send_amreport_on=$cfg_send, condition not filled for $output_name");
+            debug("send-amreport-on=$cfg_send, condition not filled for $output_name");
             $send_amreport = 0;
         }
     }
@@ -371,7 +358,7 @@ sub open_mail_output
     my $mailto = $outputspec->[1];
 
     if ($mailto =~ /[*<>()\[\];:\\\/"!$|]/) {
-        error("mail address has invalid characters", 1);
+        error("mail addresses have invalid characters", 1);
     }
 
     my $datestamp =
@@ -386,35 +373,26 @@ sub open_mail_output
     my $date  = POSIX::strftime( '%B %e, %Y', 0, 0, 0, $day, $month, $year );
     $date =~ s/  / /g;
 
-    my $process_fails = 0;
-
-    foreach my $dle ($report->get_dles()) {
-       my $dle_info = $report->get_dle_info(@$dle);
-       my $tries    = $dle_info->{tries};
-
-       foreach my $try (@$tries) {
-           foreach my $program (keys %$try) {
-               $process_fails++    if $try->{$program}{status} eq 'fail';
-           }
-       }
-    }
-
     my $done = "";
     if (  !$report->get_flag("got_finish")
-       || ($report->get_flag("exit_status") != 0)
-       || $process_fails) {
+       || $report->get_flag("dump_failed") != 0) {
        $done = " FAIL:";
+    } elsif ($report->get_flag("results_missing") != 0) {
+       $done = " MISSING:";
+    } elsif ($report->get_flag("dump_strange") != 0) {
+       $done = " STRANGE:";
     }
 
     my $subj_str =
         getconf($CNF_ORG) . $done
-      . ( $report->get_flag("amflush_run") ? " AMFLUSH" : " AMANDA" )
+      . ( $report->get_flag("amflush_run") ? " AMFLUSH" :
+         $report->get_flag("amvault_run") ? " AMVAULT" : " AMANDA" )
       . " MAIL REPORT FOR "
       . $date;
 
     my $cfg_mailer = getconf($CNF_MAILER);
 
-    my @cmd = ("$cfg_mailer", "-s", $subj_str, $mailto);
+    my @cmd = ("$cfg_mailer", "-s", $subj_str, split(/ +/, $mailto));
     debug("invoking mail app: " . join(" ", @cmd));
 
 
@@ -449,13 +427,12 @@ sub run_output {
        ($pid, $fh) = open_mail_output($report, $outputspec);
     }
 
-
     # TODO: add some generic error handling here.  must be compatible
     # with legacy behavior.
 
     # TODO: modularize these better
     if ($reportspec->[0] eq 'xml') {
-       print $fh $report->xml_output();
+        print $fh $report->xml_output("" . getconf($CNF_ORG), $config_name);
     } elsif ($reportspec->[0] eq 'human') {
        my $hr =
          Amanda::Report::human->new( $report, $fh, $config_name, $opt_logfname );
@@ -540,7 +517,7 @@ Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
 
 # read the tapelist
 my $tl_file = config_dir_relative(getconf($CNF_TAPELIST));
-my $tl = Amanda::Tapelist::read_tapelist($tl_file);
+my $tl = Amanda::Tapelist->new($tl_file);
 
 # read the disklist
 my $diskfile = config_dir_relative(getconf($CNF_DISKFILE));
@@ -567,11 +544,6 @@ if ($mode == MODE_CMDLINE) {
     calculate_legacy_outputs();
 }
 
-if (!@outputs) {
-    print "no output specified, nothing to do\n";
-    exit(0);
-}
-
 ## Parse the report & set output
 
 $report = Amanda::Report->new($logfile, $historical);
index c2ec9d441bfaefcafedded12accb2554755f5964..6114336f163f9d59837bda5527d630cb8cb36a53 100644 (file)
@@ -286,11 +286,11 @@ sub main {
            if ($hdr->{'srv_encrypt'}) {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0);
+                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0, 0);
            } elsif ($hdr->{'clnt_encrypt'}) {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0);
+                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0, 0);
            } else {
                return failure("could not decrypt encrypted dump: no program specified",
                            $finished_cb);
@@ -310,17 +310,17 @@ sub main {
                # TODO: this assumes that srvcompprog takes "-d" to decompress
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'srvcompprog'}, "-d" ], 0);
+                       [ $hdr->{'srvcompprog'}, "-d" ], 0, 0);
            } elsif ($hdr->{'clntcompprog'}) {
                # TODO: this assumes that clntcompprog takes "-d" to decompress
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'clntcompprog'}, "-d" ], 0);
+                       [ $hdr->{'clntcompprog'}, "-d" ], 0, 0);
            } else {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
                        [ $Amanda::Constants::UNCOMPRESS_PATH,
-                         $Amanda::Constants::UNCOMPRESS_OPT ], 0);
+                         $Amanda::Constants::UNCOMPRESS_OPT ], 0, 0);
            }
            
            # adjust the header
@@ -335,7 +335,7 @@ sub main {
            @filters = (
                Amanda::Xfer::Filter::Process->new(
                    [ $Amanda::Constants::COMPRESS_PATH,
-                     $compress_opt ], 0),
+                     $compress_opt ], 0, 0),
            );
            
            # adjust the header
@@ -348,7 +348,7 @@ sub main {
        # write the header to the destination if requested
        if ($opt_header) {
            $hdr->{'blocksize'} = Amanda::Holding::DISK_BLOCK_BYTES;
-           print $dest_fh $hdr->to_string(32768, 32768);
+           $dest_fh->syswrite($hdr->to_string(32768, 32768));
        }
        
        my $xfer = Amanda::Xfer->new([ $src, @filters, $dest ]);
index 05a1fb635d5e0e43035d6590447e1f2e4843b4f3..27f6d1eafe27dad07ef716fde799361a16fd8a6e 100644 (file)
@@ -33,6 +33,7 @@ use Amanda::MainLoop;
 use Amanda::Tapelist;
 use Amanda::Util qw( :constants );
 use File::Copy;
+use File::Basename;
 use Getopt::Long;
 
 my $amadmin = "$sbindir/amadmin";
@@ -176,28 +177,31 @@ if ($cfgerr_level >= $CFGERR_ERRORS) {
 
 my $scrub_db = sub {
     my $tapelist_file = config_dir_relative(getconf($CNF_TAPELIST));
-    my $tapelist = Amanda::Tapelist::read_tapelist($tapelist_file);
+    my $tapelist = Amanda::Tapelist->new($tapelist_file, !$dry_run);
     unless ($tapelist) {
         die "Could not read the tapelist";
     }
 
+    my $t = $tapelist->lookup_tapelabel($label);
     if ($keep_label) {
-        my $t = $tapelist->lookup_tapelabel($label);
         $t->{'datestamp'} = 0 if $t;
+    } elsif (!defined $t) {
+       print "label '$label' not found in $tapelist_file\n";
+       exit 0;
     } else {
         $tapelist->remove_tapelabel($label);
     }
-    my $tmp_tapelist_file = "$AMANDA_TMPDIR/tapelist-amrmtape-" . time();
-    my $backup_tapelist_file = "$AMANDA_TMPDIR/tapelist-backup-amrmtape-" . time();
-    unless (copy($tapelist_file, $backup_tapelist_file)) {
-        die "Failed to copy/backup $tapelist_file to $backup_tapelist_file";
+
+    #take a copy in case we roolback
+    my $backup_tapelist_file = dirname($tapelist_file) . "-backup-amrmtape-" . time();
+    if (-x $tapelist_file) {
+       unless (copy($tapelist_file, $backup_tapelist_file)) {
+           die "Failed to copy/backup $tapelist_file to $backup_tapelist_file";
+       }
     }
-    # writing to temp and then moving is generally safer than writing directly
+
     unless ($dry_run) {
-        $tapelist->write($tmp_tapelist_file);
-        unless (move($tmp_tapelist_file, $tapelist_file)) {
-            die "Failed to replace old tapelist  with new tapelist.";
-        }
+        $tapelist->write();
     }
 
     my $tmp_curinfo_file = "$AMANDA_TMPDIR/curinfo-amrmtape-" . time();
index ad0abc4f2a8af00a801ede1a705fe5678ee2275f..accd2164f378495dfeaa3e035ff04f8c9868709b 100755 (executable)
@@ -1,6 +1,6 @@
 #!@PERL@
 #
-# Copyright (c) 2007,2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -23,8 +23,11 @@ use lib '@amperldir@';
 use Getopt::Long;
 use Time::Local;
 use File::Copy;
+use File::Path;
 use Socket;   # for gethostbyname
 use Amanda::Paths;
+use Amanda::Util qw( :constants );
+use Amanda::Constants;
 
 my $confdir="$CONFIG_DIR";
 my $tmpdir="$AMANDA_DBGDIR";
@@ -32,8 +35,8 @@ my $amandahomedir="$localstatedir/lib/amanda";
 my $templatedir="$amdatadir/template.d"; #rpm install template files here
 my $def_tapedev="file:$amandahomedir/vtapes";
 
-my $amanda_user="@CLIENT_LOGIN@";
-my $def_config="@DEFAULT_CONFIG@";
+my $amanda_user="$Amanda::Constants::CLIENT_LOGIN";
+my $def_config="$Amanda::Constants::DEFAULT_CONFIG";
 my $def_dtimeout="1800";
 my $def_ctimeout="30";
 my $def_etimeout="300";
@@ -46,6 +49,8 @@ my $holding_err=0;
 my $template_only=0;
 my $parentdir;
 my $host;
+my @pw = getpwuid($<);
+my $dumpuser = $pw[0];
 
 
 #usage
@@ -104,38 +109,27 @@ sub log_and_die {
 }
 
 
-sub is_user_right {
-    my $user = `whoami`;
-    chomp($user);
-    ( $user eq $amanda_user ) ||
-       die ("ERROR: $0 must be run by $amanda_user\n", 0);
-}
-
-
 # rpm installation should have taken care of these. Create one if it's not there
 sub check_gnutarlist_dir {
     if ( -e "$amandahomedir/gnutar-lists" ) {
        &mprint ("$amandahomedir/gnutar-lists directory exists\n");
     }
     else {
-       mkdir ("$amandahomedir/gnutar-lists", $def_perm) ||
-           &log_and_die ("ERROR: mkdir:$amandahomedir/gnutar-lists failed: $!\n", 0);
+       mkpath ("$amandahomedir/gnutar-lists", $def_perm) ||
+           &log_and_die ("ERROR: mkpath:$amandahomedir/gnutar-lists failed: $!\n", 0);
     }
 }
 
 sub create_conf_dir {
-  unless ( -e $confdir ) {
-    &log_and_die ("ERROR: $confdir does not exist\n", 0);
-  }
   unless ( -e "$confdir/$config" ) {
-    mkdir ("$confdir/$config", $def_perm) ||
-      &log_and_die ("ERROR: mkdir: $confdir/$config failed: $!\n", 0); # $! = system error
+    mkpath ("$confdir/$config", $def_perm) ||
+      &log_and_die ("ERROR: mkpath: $confdir/$config failed: $!\n", 0);        # $! = system error
   } else {
     &log_and_die ("ERROR: Configuration $config exists\n", 0);
   }
   unless ( -e "$confdir/template.d" ) {
-    mkdir ("$confdir/template.d", $def_perm)  ||
-      &log_and_die ("ERROR: mkdir: $confdir/template.d failed: $!\n", 0);
+    mkpath ("$confdir/template.d", $def_perm)  ||
+      &log_and_die ("ERROR: mkpath: $confdir/template.d failed: $!\n", 0);
     &mprint ("$confdir/template.d directory created\n");
   }
 }
@@ -163,10 +157,10 @@ sub copy_template_file {
 
 
 sub create_curinfo_index_dir {
-    mkdir("$confdir/$config/curinfo", $def_perm) ||
-       &log_and_die ("ERROR: mkdir: $confdir/$config/curinfo failed: $!\n", 1);
-    mkdir("$confdir/$config/index", $def_perm) || 
-       &log_and_die ("ERROR: mkdir: $confdir/$config/index failed: $!\n", 1);
+    mkpath("$confdir/$config/curinfo", $def_perm) ||
+       &log_and_die ("ERROR: mkpath: $confdir/$config/curinfo failed: $!\n", 1);
+    mkpath("$confdir/$config/index", $def_perm) || 
+       &log_and_die ("ERROR: mkpath: $confdir/$config/index failed: $!\n", 1);
     &mprint ("curinfo and index directory created\n");
 }
 
@@ -208,23 +202,23 @@ sub create_holding {
     if (( $dfout[10] / $div )  > 1024000 ) { # holding disk is defined 1000 MB
        &mprint ("creating holding disk directory\n");
        unless ( -d "$amandahomedir/holdings" ) { 
-       mkdir ( "$amandahomedir/holdings", $def_perm) ||
-           (&mprint ("WARNING: mkdir $amandahomedir/holdings failed: $!\n"), $holding_err++, return );
+       mkpath ( "$amandahomedir/holdings", $def_perm) ||
+           (&mprint ("WARNING: mkpath $amandahomedir/holdings failed: $!\n"), $holding_err++, return );
     }
-       mkdir ( "$amandahomedir/holdings/$config", $def_perm) ||
-           (&mprint ("WARNING: mkdir $amandahomedir/holdings/$config failed: $!\n"), $holding_err++, return) ;
+       mkpath ( "$amandahomedir/holdings/$config", $def_perm) ||
+           (&mprint ("WARNING: mkpath $amandahomedir/holdings/$config failed: $!\n"), $holding_err++, return) ;
     }
 }
 
 #create default tape dir
 sub create_deftapedir{
     unless ( -e "$amandahomedir/vtapes" ) { 
-       mkdir ( "$amandahomedir/vtapes", $def_perm) ||
-           ( &mprint ("WARNING: mkdir $amandahomedir/$config/vtapes failed: $!\n"), return );
+       mkpath ( "$amandahomedir/vtapes", $def_perm) ||
+           ( &mprint ("WARNING: mkpath $amandahomedir/$config/vtapes failed: $!\n"), return );
     }
     unless ( -e "$amandahomedir/vtapes/$config" ) { 
-       mkdir ( "$amandahomedir/vtapes/$config", $def_perm) ||
-           ( &mprint ("WARNING: mkdir $amandahomedir/vtapes/$config failed: $!\n"), return );
+       mkpath ( "$amandahomedir/vtapes/$config", $def_perm) ||
+           ( &mprint ("WARNING: mkpath $amandahomedir/vtapes/$config failed: $!\n"), return );
     }
        $parentdir="$amandahomedir/vtapes/$config";
 }
@@ -279,8 +273,8 @@ sub create_vtape {
 
        for $i (1..$tp_cyclelimit) {
                unless ( -e "slot$i"){
-               mkdir ("slot$i", $def_perm) ||
-               ( &mprint ("WARNING: mkdir $parentdir/slot$i failed: $!\n"), $vtape_err++, return);
+               mkpath ("slot$i", $def_perm) ||
+               ( &mprint ("WARNING: mkpath $parentdir/slot$i failed: $!\n"), $vtape_err++, return);
                }
                ( @amlabel_out = `$sbindir/amlabel -f $config $mylabelprefix-$i slot $i`) ||
            ( &mprint ("WARNING: amlabel vtapes failed at slot $i: $!\n"), $vtape_err++, return);
@@ -356,6 +350,7 @@ sub create_customconf{
            &log_and_die ("ERROR: Cannot set amanda.conf file access permission: $!\n", 1);
 
        print CONF "org \"$config\"\t\t# your organization name for reports\n";
+       print CONF "dumpuser \"$dumpuser\"\t# the user to run dumps under\n";
        print CONF "mailto \"$mailto\"\t# space separated list of operators at your site\n";
        print CONF "dumpcycle $dumpcycle\t\t# the number of days in the normal dump cycle\n";
         print CONF "runspercycle $runspercycle\t\t# the number of amdump runs in dumpcycle days\n";
@@ -479,10 +474,12 @@ $date=`date +%Y%m%d%H%M%S`;
 chomp($date);
 my $logfile="$tmpdir/amserverconfig.$date.debug";
 
-&is_user_right;
+Amanda::Util::setup_application("amserverconfig", "server", $CONTEXT_CMDLINE);
+Amanda::Util::finish_setup($RUNNING_AS_ANY);
+
 unless ( -e "$tmpdir" ) {
-    mkdir ("$tmpdir", $def_perm) ||
-       die ("ERROR: mkdir: $tmpdir failed: $!\n");
+    mkpath ("$tmpdir", $def_perm) ||
+       die ("ERROR: mkpath: $tmpdir failed: $!\n");
 }
 
 open (LOG, ">$logfile") || die ("ERROR: Cannot create logfile: $!\n");
@@ -655,3 +652,4 @@ $ENV{'PATH'} = $oldPATH;
 
 
 # THE END
+Amanda::Util::finish_application();
index 79803c1d2ae3b440d71f20aad3ca0887173e6f72..80f6c231d1822207b33c22b0ac36f223682600d6 100644 (file)
@@ -419,8 +419,8 @@ while($lineX = <AMDUMP>) {
                        }
                        elsif($line[5] =~ /taper/) {
                                if($line[6] eq "START-TAPER") {
-                                       #7:timestamp
-                                       $gdatestamp=$line[7];
+                                       #7:name 8:timestamp
+                                       $gdatestamp=$line[8];
                                        if(!defined $datestamp{$gdatestamp}) {
                                                $datestamp{$gdatestamp} = 1;
                                                push @datestamp, $gdatestamp;
@@ -428,21 +428,22 @@ while($lineX = <AMDUMP>) {
                                        $status_taper = "Searching for a new tape";
                                }
                                elsif($line[6] eq "NEW-TAPE") {
+                                       #7:name 8:handle
                                        $status_taper = "Searching for a new tape";
                                }
                                elsif($line[6] eq "NO-NEW-TAPE") {
-                                       #7:handle 8:errmsg
-                                       $serial=$line[7];
-                                       $error=$line[8];
+                                       #7:name 8:handle 9:errmsg
+                                       $serial=$line[8];
+                                       $error=$line[9];
                                        $status_taper = $error;
                                }
                                elsif($line[6] eq "FILE-WRITE") {
-                                       #7:handle 8:filename 9:host 10:disk 11:level 12:datestamp 13:splitsize
-                                       $serial=$line[7];
-                                       $host=$line[9];
-                                       $partition=$line[10];
-                                       $level=$line[11];
-                                       $ldatestamp=$line[12];
+                                       #7:name 8:handle 9:filename 10:host 11:disk 12:level 13:datestamp 14:splitsize
+                                       $serial=$line[8];
+                                       $host=$line[10];
+                                       $partition=$line[11];
+                                       $level=$line[12];
+                                       $ldatestamp=$line[13];
                                        $status_taper = "Writing $host:$partition";
                                        if(!defined $datestamp{$ldatestamp}) {
                                                $datestamp{$ldatestamp} = 1;
@@ -459,12 +460,12 @@ while($lineX = <AMDUMP>) {
                                        $ntchunk_size = 0;
                                }
                                elsif($line[6] eq "PORT-WRITE") {
-                                       #7:handle 8:host 9:disk 10:level 11:datestamp 12:splitsize 13:diskbuffer 14:fallback_splitsize
-                                       $serial=$line[7];
-                                       $host=$line[8];
-                                       $partition=$line[9];
-                                       $level=$line[10];
-                                       $ldatestamp=$line[11];
+                                       #7:name 8:handle 9:host 10:disk 11:level 12:datestamp 13:splitsize 14:diskbuffer 15:fallback_splitsize
+                                       $serial=$line[8];
+                                       $host=$line[9];
+                                       $partition=$line[10];
+                                       $level=$line[11];
+                                       $ldatestamp=$line[12];
                                        $status_taper = "Writing $host:$partition";
                                        $hostpart=&make_hostpart($host,$partition,$ldatestamp);
                                        $serial{$serial}=$hostpart;
@@ -636,22 +637,14 @@ while($lineX = <AMDUMP>) {
                                        }
                                }
                                elsif($line[6] eq "TAPER-OK") {
+                                       #7:name #8:label
                                        $status_taper = "Idle";
                                }
-                               elsif($line[6] eq "TRY-AGAIN" || $line[6] eq "TAPE-ERROR") {
-                                       #7:handle 8:errstr
-                                       $serial=$line[7];
+                               elsif($line[6] eq "TAPE-ERROR") {
+                                       #7:name 8:errstr
                                        $error=$line[8];
                                        $status_taper = $error;
-                                       $hostpart=$serial{$serial};
-                                       if(defined $hostpart) {
-                                               $taper_finished{$hostpart}= $line[6] eq 'TAPE-ERROR' ? -2 : -1;
-                                               $busy_time{"taper"}+=($current_time-$taper_time{$hostpart});
-                                               $taper_time{$hostpart}=$current_time;
-                                               $error{$hostpart}="taper: $error";
-                                       } else {
-                                               $exit_status |= $STATUS_TAPE;
-                                       }
+                                       $exit_status |= $STATUS_TAPE;
                                        undef $taper_status_file;
                                }
                                elsif($line[6] eq "FAILED") {
@@ -740,31 +733,10 @@ while($lineX = <AMDUMP>) {
                }
        }
        elsif($line[0] eq "taper") {
-               if($line[1] eq "slot") {
-                       #2:slot 3:"wrote" 4:"label" 5:corrupted...
-                       $nb_tape++;
-                       $lineX =~ /wrote label `(\S*)'/;
-                       $label = $1;
-                       $ntlabel{$nb_tape} = $label;
-                       $ntpartition{$nb_tape} = 0;
-                       $ntsize{$nb_tape} = 0;
-                       $ntesize{$nb_tape} = 0;
-               }
-               elsif($line[1] eq "wrote") {
-                       #1:"wrote" 2:"label" 3:corrupted
-                       $nb_tape++;
-                       $lineX =~ /wrote label `(\S*)'/;
-                       $label = $1;
-                       $ntlabel{$nb_tape} = $label;
-                       $ntpartition{$nb_tape} = 0;
-                       $ntsize{$nb_tape} = 0;
-                       $ntesize{$nb_tape} = 0;
-               }
-               elsif($line[1] eq "using") {
-                       #1:"using" #2:"label" #3:`label' #4:date #5 `timestamp'
+               if($line[1] eq "wrote") {
+                       #1:"wrote" 2:"label" 3:label
                        $nb_tape++;
-                       $lineX =~ /using label `(\S*)'/;
-                       $label = $1;
+                       $label = $line[3];
                        $ntlabel{$nb_tape} = $label;
                        $ntpartition{$nb_tape} = 0;
                        $ntsize{$nb_tape} = 0;
index d733d7016828be287b685e24394d69dfec75d640..490a68eace11054322c7929fc8bc00125887375a 100644 (file)
@@ -19,6 +19,7 @@
 
 use lib '@amperldir@';
 use strict;
+use warnings;
 
 use File::Basename;
 use Getopt::Long;
@@ -44,7 +45,8 @@ my %subcommands;
 
 sub usage {
     my ($finished_cb) = @_;
-    $finished_cb ||= sub { exit(1); };
+
+    $finished_cb = sub { exit(1); } if (!$finished_cb or !(ref($finished_cb) eq "CODE"));
 
     print STDERR <<EOF;
 Usage: amtape <conf> <command> {<args>} [-o configoption]*
@@ -80,7 +82,7 @@ subcommand("usage", "usage", "this message",
 sub {
     my ($finished_cb, @args) = @_;
 
-    usage($finished_cb);
+    return usage($finished_cb);
 });
 
 subcommand("reset", "reset", "reset changer to known state",
@@ -315,7 +317,7 @@ sub {
     # 'current' or 'next' ..  when we have a changer using such slot names,
     # this subcommand will need to support a --literal flag
 
-    usage($finished_cb) unless (@args == 1);
+    return usage($finished_cb) unless (@args == 1);
     my $slot = shift @args;
 
     my $chg = load_changer($finished_cb) or return;
@@ -392,7 +394,7 @@ sub {
     my $inter;
     my $scan;
 
-    usage($finished_cb) unless (@args == 1);
+    return usage($finished_cb) unless (@args == 1);
     my $label = shift @args;
 
     my $steps = define_steps
@@ -520,7 +522,7 @@ sub {
        }
     };
 
-    usage($finished_cb) unless (@args == 0);
+    return usage($finished_cb) unless (@args == 0);
     my $label = shift @args;
 
     my $chg = load_changer($finished_cb) or return;
@@ -639,10 +641,16 @@ select($previous_fh);
 sub main {
     my ($finished_cb) = @_;
 
-    my $subcmd = shift @ARGV;
-    usage($finished_cb) unless defined($subcmd) and exists ($subcommands{$subcmd});
-    invoke_subcommand($subcmd, $finished_cb, @ARGV);
+    my $steps = define_steps
+       cb_ref => \$finished_cb;
+
+    step start => sub {
+       my $subcmd = shift @ARGV;
+       return usage($finished_cb) unless defined($subcmd) and exists ($subcommands{$subcmd});
+       invoke_subcommand($subcmd, $finished_cb, @ARGV);
+    }
 }
+
 main(\&Amanda::MainLoop::quit);
 Amanda::MainLoop::run();
 Amanda::Util::finish_application();
index 2926688850a173f0516ab5a380379ca6e92c06f2..6e20da187e4138c5d304e460feaf6e98aae0bc32 100644 (file)
@@ -171,6 +171,8 @@ main(
                    strcmp(disk, dp_disk) == 0) {
                    matching_dp = g_slist_append(matching_dp, dp);
                }
+               amfree(dp_host);
+               amfree(dp_disk);
            }
 
            dbprintf("%s %s -> %s\n", diskp->host->hostname,
index 988568f845fc1c2fe090c9ba72f14314fbb45015..5071d42d3e39fd9e201da50647c2daa21cc7856f 100644 (file)
 
 use lib '@amperldir@';
 use strict;
+use warnings;
+
+package main::Interactive;
+use POSIX qw( :errno_h );
+use Amanda::MainLoop qw( :GIOCondition );
+use vars qw( @ISA );
+@ISA = qw( Amanda::Interactive );
+
+sub new {
+    my $class = shift;
+
+    my $self = {
+       input_src => undef};
+    return bless ($self, $class);
+}
+
+sub abort() {
+    my $self = shift;
+
+    if ($self->{'input_src'}) {
+       $self->{'input_src'}->remove();
+       $self->{'input_src'} = undef;
+    }
+}
+
+sub user_request {
+    my $self = shift;
+    my %params = @_;
+    my %subs;
+    my $buffer = "";
+
+    my $message  = $params{'message'};
+    my $label    = $params{'label'};
+    my $err      = $params{'err'};
+    my $chg_name = $params{'chg_name'};
+
+    $subs{'data_in'} = sub {
+       my $b;
+       my $n_read = POSIX::read(0, $b, 1);
+       if (!defined $n_read) {
+           return if ($! == EINTR);
+           $self->abort();
+           return $params{'finished_cb'}->(
+               Amanda::Changer::Error->new('fatal',
+                       message => "Fail to read from stdin"));
+       } elsif ($n_read == 0) {
+           $self->abort();
+           return $params{'finished_cb'}->(
+               Amanda::Changer::Error->new('fatal',
+                       message => "Aborted by user"));
+       } else {
+           $buffer .= $b;
+           if ($b eq "\n") {
+               my $line = $buffer;
+               chomp $line;
+               $buffer = "";
+               $self->abort();
+               return $params{'finished_cb'}->(undef, $line);
+           }
+       }
+    };
+
+    print STDERR "$err\n";
+    print STDERR "Insert volume labeled '$label' in $chg_name\n";
+    print STDERR "and press enter, or ^D to abort.\n";
+
+    $self->{'input_src'} = Amanda::MainLoop::fd_source(0, $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+    $self->{'input_src'}->set_callback($subs{'data_in'});
+    return;
+};
 
 package Amvault;
 
 use Amanda::Config qw( :getconf config_dir_relative );
 use Amanda::Debug qw( :logging );
-use Amanda::Device qw( :constants );
 use Amanda::Xfer qw( :constants );
 use Amanda::Header qw( :constants );
 use Amanda::MainLoop;
+use Amanda::Util qw( quote_string );
 use Amanda::DB::Catalog;
-use Amanda::Changer;
+use Amanda::Recovery::Planner;
+use Amanda::Recovery::Scan;
+use Amanda::Recovery::Clerk;
+use Amanda::Taper::Scan;
+use Amanda::Taper::Scribe qw( get_splitting_args_from_config );
+use Amanda::Changer qw( :constants );
+use Amanda::Cmdline;
+use Amanda::Paths;
+use Amanda::Logfile qw( :logtype_t log_add log_add_full
+                       log_rename $amanda_log_trace_log make_stats
+                       match_datestamp match_level );
+
+use base qw(
+    Amanda::Recovery::Clerk::Feedback
+    Amanda::Taper::Scribe::Feedback
+);
 
-sub fail($) {
-    print STDERR @_, "\n";
-    exit 1;
-}
+sub new {
+    my $class = shift;
+    my %params = @_;
 
-sub vlog($) {
-    my $self = shift;
+    bless {
+       quiet => $params{'quiet'},
+       fulls_only => $params{'fulls_only'},
+       opt_export => $params{'opt_export'},
+       opt_dumpspecs => $params{'opt_dumpspecs'},
+       opt_dry_run => $params{'opt_dry_run'},
+       config_name => $params{'config_name'},
 
-    if (!$self->{'quiet'}) {
-       print @_, "\n";
-    }
+       src_write_timestamp => $params{'src_write_timestamp'},
+
+       dst_changer => $params{'dst_changer'},
+       dst_autolabel => $params{'dst_autolabel'},
+       dst_write_timestamp => $params{'dst_write_timestamp'},
+
+       src => undef,
+       dst => undef,
+       cleanup => {},
+
+       exporting => 0, # is an export in progress?
+       call_after_export => undef, # call this when export complete
+
+       # called when the operation is complete, with the exit
+       # status
+       exit_cb => undef,
+    }, $class;
 }
 
-sub new {
-    my ($class, $src_write_timestamp, $dst_changer, $dst_label_template,
-       $quiet, $autolabel) = @_;
+sub run {
+    my $self = shift;
+    my ($exit_cb) = @_;
+
+    die "already called" if $self->{'exit_cb'};
+    $self->{'exit_cb'} = $exit_cb;
 
     # check that the label template is valid
-    fail "Invalid label template '$dst_label_template'"
+    my $dst_label_template = $self->{'dst_autolabel'}->{'template'};
+    return $self->failure("Invalid label template '$dst_label_template'")
        if ($dst_label_template =~ /%[^%]+%/
            or $dst_label_template =~ /^[^%]+$/);
 
-    # translate "latest" into the most recent timestamp
-    if ($src_write_timestamp eq "latest") {
-       $src_write_timestamp = Amanda::DB::Catalog::get_latest_write_timestamp();
+    # open up a trace log file and put our imprimatur on it, unless dry_runing
+    if (!$self->{'opt_dry_run'}) {
+       log_add($L_INFO, "amvault pid $$");
+       log_add($L_START, "date " . $self->{'dst_write_timestamp'});
+       Amanda::Debug::add_amanda_log_handler($amanda_log_trace_log);
+       $self->{'cleanup'}{'roll_trace_log'} = 1;
     }
 
-    fail "No dumps found"
-       unless (defined $src_write_timestamp);
-
-    bless {
-       'src_write_timestamp' => $src_write_timestamp,
-       'dst_changer' => $dst_changer,
-       'dst_label_template' => $dst_label_template,
-       'first_dst_slot' => undef,
-       'quiet' => $quiet,
-       'autolabel' => $autolabel
-    }, $class;
+    $self->setup_src();
 }
 
-# Start a copy of a single file from src_dev to dest_dev.  If there are
-# no more files, call the callback.
-sub run {
+sub setup_src {
     my $self = shift;
 
-    $self->{'remaining_files'} = [
-       Amanda::DB::Catalog::sort_dumps([ "label", "filenum" ],
-           Amanda::DB::Catalog::get_parts(
-               write_timestamp => $self->{'src_write_timestamp'},
-               ok => 1,
-       )) ];
+    my $src = $self->{'src'} = {};
 
-    $self->{'src_chg'} = Amanda::Changer->new();
-    $self->{'src_res'} = undef;
-    $self->{'src_dev'} = undef;
-    $self->{'src_label'} = undef;
+    # put together a clerk, which of course requires a changer, scan,
+    # interactive, and feedback
+    my $chg = Amanda::Changer->new();
+    return $self->failure("Error opening source changer: $chg")
+       if $chg->isa('Amanda::Changer::Error');
+    $src->{'chg'} = $chg;
 
-    $self->{'dst_chg'} = Amanda::Changer->new($self->{'dst_changer'});
-    $self->{'dst_res'} = undef;
-    $self->{'dst_dev'} = undef;
-    $self->{'dst_label'} = undef;
+    $src->{'seen_labels'} = {};
 
-    $self->{'dst_timestamp'} = Amanda::Util::generate_timestamp();
+    $src->{'interactive'} = main::Interactive->new();
 
-    Amanda::MainLoop::call_later(sub { $self->start_next_file(); });
-    Amanda::MainLoop::run();
-}
+    $src->{'scan'} = Amanda::Recovery::Scan->new(
+           chg => $src->{'chg'},
+           interactive => $src->{'interactive'});
 
-sub generate_new_dst_label {
-    my $self = shift;
+    $src->{'clerk'} = Amanda::Recovery::Clerk->new(
+           changer => $src->{'chg'},
+           feedback => $self,
+           scan => $src->{'scan'});
+    $self->{'cleanup'}{'quit_clerk'} = 1;
 
-    # count the number of percents in there
-    (my $npercents =
-       $self->{'dst_label_template'}) =~ s/[^%]*(%+)[^%]*/length($1)/e;
-    my $nlabels = 10 ** $npercents;
+    # translate "latest" into the most recent timestamp that wasn't created by amvault
+    if (defined $self->{'src_write_timestamp'} && $self->{'src_write_timestamp'} eq "latest") {
+       my $ts = $self->{'src_write_timestamp'} =
+           Amanda::DB::Catalog::get_latest_write_timestamp(types => ['amdump', 'amflush']);
+       return $self->failure("No dumps found")
+           unless defined $ts;
 
-    # make up a sprintf pattern
-    (my $sprintf_pat =
-       $self->{'dst_label_template'}) =~ s/(%+)/"%0" . length($1) . "d"/e;
+       $self->vlog("Using latest timestamp: $ts");
+    }
 
-    my $tl = Amanda::Tapelist::read_tapelist(
-       config_dir_relative(getconf($CNF_TAPELIST)));
-    my %existing_labels =
-       map { $_->{'label'} => 1 } @$tl;
+    # we need to combine fulls_only, src_write_timestamp, and the set
+    # of dumpspecs.  If they contradict one another, then drop the
+    # non-matching dumpspec with a warning.
+    my @dumpspecs;
+    if ($self->{'opt_dumpspecs'}) {
+       my $level = $self->{'fulls_only'}? "0" : undef;
+       my $swt = $self->{'src_write_timestamp'};
+
+       # filter and adjust the dumpspecs
+       for my $ds (@{$self->{'opt_dumpspecs'}}) {
+           my $ds_host = $ds->{'host'};
+           my $ds_disk = $ds->{'disk'};
+           my $ds_datestamp = $ds->{'datestamp'};
+           my $ds_level = $ds->{'level'};
+           my $ds_write_timestamp = $ds->{'write_timestamp'};
+
+           if ($swt) {
+               # it's impossible for parse_dumpspecs to set write_timestamp,
+               # so there's no risk of overlap here
+               $ds_write_timestamp = $swt;
+           }
 
-    for (my $i = 0; $i < $nlabels; $i++) {
-       my $label = sprintf($sprintf_pat, $i);
-       next if (exists $existing_labels{$label});
-       return $label;
+           if (defined $level) {
+               if (defined $ds_level &&
+                   !match_level($ds_level, $level)) {
+                   $self->vlog("WARNING: dumpspec " . $ds->format() .
+                           " specifies non-full dumps, contradicting --fulls-only;" .
+                           " ignoring dumpspec");
+                   next;
+               }
+               $ds_level = $level;
+           }
+
+           # create a new dumpspec, since dumpspecs are immutable
+           push @dumpspecs, Amanda::Cmdline::dumpspec_t->new(
+               $ds_host, $ds_disk, $ds_datestamp, $ds_level, $ds_write_timestamp);
+       }
+    } else {
+       # convert the timestamp and level to a dumpspec
+       my $level = $self->{'fulls_only'}? "0" : undef;
+       push @dumpspecs, Amanda::Cmdline::dumpspec_t->new(
+               undef, undef, $self->{'src_write_timestamp'}, $level, undef);
     }
 
-    fail "No unused labels matching '$self->{dst_label_template}' are available";
-}
+    # if we ignored all of the dumpspecs and didn't create any, then dump
+    # nothing.  We do *not* want the wildcard "vault it all!" behavior.
+    if (!@dumpspecs) {
+       return $self->failure("No dumps to vault");
+    }
 
-# add $next_file to the catalog db.  This assumes that the corresponding label
-# is already in the DB.
+    if (!$self->{'opt_dry_run'}) {
+       # summarize the requested dumps
+       my $request;
+       if ($self->{'src_write_timestamp'}) {
+           $request = "vaulting from volumes written " . $self->{'src_write_timestamp'};
+       } else {
+           $request = "vaulting";
+       }
+       if ($self->{'opt_dumpspecs'}) {
+           $request .= " dumps matching dumpspecs:";
+       }
+       if ($self->{'fulls_only'}) {
+           $request .= " (fulls only)";
+       }
+       log_add($L_INFO, $request);
 
-sub add_part_to_db {
-    my $self = shift;
-    my ($next_file, $filenum) = @_;
-
-    my $dump = {
-       'label' => $self->{'dst_label'},
-       'filenum' => $filenum,
-       'dump_timestamp' => $next_file->{'dump'}->{'dump_timestamp'},
-       'write_timestamp' => $self->{'dst_timestamp'},
-       'hostname' => $next_file->{'dump'}->{'hostname'},
-       'diskname' => $next_file->{'dump'}->{'diskname'},
-       'level' => $next_file->{'dump'}->{'level'},
-       'status' => 'OK',
-       'partnum' => $next_file->{'partnum'},
-       'nparts' => $next_file->{'dump'}->{'nparts'},
-       'kb' => 0, # unknown
-       'sec' => 0, # unknown
-    };
+       # and log the dumpspecs if they were given
+       if ($self->{'opt_dumpspecs'}) {
+           for my $ds (@{$self->{'opt_dumpspecs'}}) {
+               log_add($L_INFO, "  " . $ds->format());
+           }
+       }
+    }
 
-    Amanda::DB::Catalog::add_part($dump);
+    Amanda::Recovery::Planner::make_plan(
+           dumpspecs => \@dumpspecs,
+           changer => $src->{'chg'},
+           plan_cb => sub { $self->plan_cb(@_) });
 }
 
-# This function is called to copy the next file in $self->{remaining_files}
-sub start_next_file {
+sub plan_cb {
     my $self = shift;
-    my $next_file = shift @{$self->{'remaining_files'}};
-
-    # bail if we're finished
-    if (!defined $next_file) {
-       $self->vlog("all files copied");
-       $self->release_reservations(sub {
-           Amanda::MainLoop::quit();
-       });
-       return;
+    my ($err, $plan) = @_;
+    my $src = $self->{'src'};
+
+    return $self->failure($err) if $err;
+
+    $src->{'plan'} = $plan;
+
+    if ($self->{'opt_dry_run'}) {
+       my $total_kb = Math::BigInt->new(0);
+
+       # iterate over each part of each dump, printing out the basic information
+       for my $dump (@{$plan->{'dumps'}}) {
+           my @parts = @{$dump->{'parts'}};
+           shift @parts; # skip partnum 0
+           for my $part (@parts) {
+               print STDOUT
+                     ($part->{'label'} || $part->{'holding_file'}) . " " .
+                     ($part->{'filenum'} || '') . " " .
+                     $dump->{'hostname'} . " " .
+                     $dump->{'diskname'} . " " .
+                     $dump->{'dump_timestamp'} . " " .
+                     $dump->{'level'} . "\n";
+           }
+           $total_kb += $dump->{'kb'};
+       }
+
+       print STDOUT "Total Size: $total_kb KB\n";
+
+       return $self->quit(0);
     }
 
-    # make sure we're on the right device.  Note that we always change
-    # both volumes at the same time.
-    if (defined $self->{'src_label'} &&
-               $self->{'src_label'} eq $next_file->{'label'}) {
-       $self->seek_and_copy($next_file);
-    } else {
-       $self->load_next_volumes($next_file);
+    # output some 'DISK amvault' lines to indicate the disks we will be vaulting
+    my %seen;
+    for my $dump (@{$plan->{'dumps'}}) {
+       my $key = $dump->{'hostname'}."\0".$dump->{'diskname'};
+       next if $seen{$key};
+       $seen{$key} = 1;
+       log_add($L_DISK, quote_string($dump->{'hostname'})
+                . " " . quote_string($dump->{'diskname'}));
+    }
+
+    if (@{$plan->{'dumps'}} == 0) {
+       return $self->failure("No dumps to vault");
     }
+
+    $self->setup_dst();
 }
 
-# Start both the source and destination changers seeking to the next volume
-sub load_next_volumes {
+sub setup_dst {
     my $self = shift;
-    my ($next_file) = @_;
-    my $src_and_dst_counter;
-    my ($release_src, $load_src, $got_src, $set_labeled_src,
-        $release_dst, $load_dst, $got_dst,
-       $maybe_done);
-
-    # For the source changer, we release the previous device, load the next
-    # volume by its label, and open the device.
-
-    $release_src = make_cb('release_src' => sub {
-       if ($self->{'src_dev'}) {
-           $self->{'src_dev'}->finish()
-               or fail $self->{'src_dev'}->error_or_status();
-           $self->{'src_dev'} = undef;
-           $self->{'src_label'} = undef;
-
-           $self->{'src_res'}->release(
-               finished_cb => $load_src);
-       } else {
-           $load_src->(undef);
-       }
-    });
+    my $dst = $self->{'dst'} = {};
 
-    $load_src = make_cb('load_src' => sub {
-       my ($err) = @_;
-       fail $err if $err;
-       $self->vlog("Loading source volume $next_file->{label}");
+    $dst->{'label'} = undef;
+    $dst->{'tape_num'} = 0;
+
+    my $chg = Amanda::Changer->new($self->{'dst_changer'});
+    return $self->failure("Error opening destination changer: $chg")
+       if $chg->isa('Amanda::Changer::Error');
+    $dst->{'chg'} = $chg;
+
+    $dst->{'scan'} = Amanda::Taper::Scan->new(
+       changer => $dst->{'chg'},
+       labelstr => getconf($CNF_LABELSTR),
+       autolabel => $self->{'dst_autolabel'});
+
+    $dst->{'scribe'} = Amanda::Taper::Scribe->new(
+       taperscan => $dst->{'scan'},
+       feedback => $self);
+
+    $dst->{'scribe'}->start(
+       write_timestamp => $self->{'dst_write_timestamp'},
+       finished_cb => sub { $self->scribe_started(@_); })
+}
+
+sub scribe_started {
+    my $self = shift;
+    my ($err) = @_;
+
+    return $self->failure($err) if $err;
 
-       $self->{'src_chg'}->load(
-           label => $next_file->{'label'},
-           res_cb => $got_src);
-    });
+    $self->{'cleanup'}{'quit_scribe'} = 1;
 
-    $got_src = make_cb(got_src => sub {
-       my ($err, $res) = @_;
-       fail $err if $err;
+    my $xfers_finished = sub {
+       my ($err) = @_;
+       $self->failure($err) if $err;
+       $self->quit(0);
+    };
 
-       debug("Opened source device");
+    $self->xfer_dumps($xfers_finished);
+}
 
-       $self->{'src_res'} = $res;
-       my $dev = $self->{'src_dev'} = $res->{'device'};
-       my $device_name = $dev->device_name;
+sub xfer_dumps {
+    my $self = shift;
+    my ($finished_cb) = @_;
+
+    my $src = $self->{'src'};
+    my $dst = $self->{'dst'};
+    my ($xfer_src, $xfer_dst, $xfer, $n_threads, $last_partnum);
+    my $current;
 
-       if ($dev->volume_label ne $next_file->{'label'}) {
-           fail ("Volume in $device_name has unexpected label " .
-                $dev->volume_label);
+    my $steps = define_steps
+           cb_ref => \$finished_cb;
+
+    step get_dump => sub {
+       # reset tracking for teh current dump
+       $self->{'current'} = $current = {
+           src_result => undef,
+           src_errors => undef,
+
+           dst_result => undef,
+           dst_errors => undef,
+
+           size => 0,
+           duration => 0.0,
+           total_duration => 0.0,
+           nparts => 0,
+           header => undef,
+           dump => undef,
+       };
+
+       my $dump = $src->{'plan'}->shift_dump();
+       if (!$dump) {
+           return $finished_cb->();
        }
 
-       $dev->start($ACCESS_READ, undef, undef)
-           or fail ("Could not start device $device_name: " .
-               $dev->error_or_status());
+       $current->{'dump'} = $dump;
 
-       # OK, it all matches up now..
-       $self->{'src_label'} = $next_file->{'label'};
+       $steps->{'get_xfer_src'}->();
+    };
+
+    step get_xfer_src => sub {
+       $src->{'clerk'}->get_xfer_src(
+           dump => $current->{'dump'},
+           xfer_src_cb => $steps->{'got_xfer_src'})
+    };
+
+    step got_xfer_src => sub {
+        my ($errors, $header, $xfer_src_, $directtcp_supported) = @_;
+       $xfer_src = $xfer_src_;
+
+       return $finished_cb->(join("\n", @$errors))
+           if $errors;
+
+       $current->{'header'} = $header;
+
+       # set up splitting args from the tapetype only, since we have no DLEs
+       my $tt = lookup_tapetype(getconf($CNF_TAPETYPE));
+       sub empty2undef { $_[0]? $_[0] : undef }
+       my %xfer_dest_args;
+       if ($tt) {
+           %xfer_dest_args = get_splitting_args_from_config(
+               part_size_kb =>
+                   empty2undef(tapetype_getconf($tt, $TAPETYPE_PART_SIZE)),
+               part_cache_type_enum =>
+                   empty2undef(tapetype_getconf($tt, $TAPETYPE_PART_CACHE_TYPE)),
+               part_cache_dir =>
+                   empty2undef(tapetype_getconf($tt, $TAPETYPE_PART_CACHE_DIR)),
+               part_cache_max_size =>
+                   empty2undef(tapetype_getconf($tt, $TAPETYPE_PART_CACHE_MAX_SIZE)),
+           );
+       }
+       # (else leave %xfer_dest_args empty, for no splitting)
+
+       $xfer_dst = $dst->{'scribe'}->get_xfer_dest(
+           max_memory => getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE),
+           can_cache_inform => 0,
+           %xfer_dest_args,
+       );
+
+       # create and start the transfer
+       $xfer = Amanda::Xfer->new([ $xfer_src, $xfer_dst ]);
+       $xfer->start($steps->{'handle_xmsg'});
+
+       # count the "threads" running here (clerk and scribe)
+       $n_threads = 2;
+
+       # and let both the scribe and the clerk know that data is in motion
+       $src->{'clerk'}->start_recovery(
+           xfer => $xfer,
+           recovery_cb => $steps->{'recovery_cb'});
+       $dst->{'scribe'}->start_dump(
+           xfer => $xfer,
+           dump_header => $header,
+           dump_cb => $steps->{'dump_cb'});
+    };
 
-       $maybe_done->();
-    });
+    step handle_xmsg => sub {
+       $src->{'clerk'}->handle_xmsg(@_);
+       $dst->{'scribe'}->handle_xmsg(@_);
+    };
 
-    # For the destination, we release the reservation after noting the 'next'
-    # slot, and either load that slot or "current".  When the slot is loaded,
-    # check that there is no label, invent a label, and write it to the volume.
+    step recovery_cb => sub {
+       my %params = @_;
+       $current->{'src_result'} = $params{'result'};
+       $current->{'src_errors'} = $params{'errors'};
+       $steps->{'maybe_done'}->();
+    };
 
-    $release_dst = make_cb('release_dst' => sub {
-       if ($self->{'dst_dev'}) {
-           $self->{'dst_dev'}->finish()
-               or fail $self->{'dst_dev'}->error_or_status();
-           $self->{'dst_dev'} = undef;
+    step dump_cb => sub {
+       my %params = @_;
+       $current->{'dst_result'} = $params{'result'};
+       $current->{'dst_errors'} = $params{'device_errors'};
+       $current->{'size'} = $params{'size'};
+       $current->{'duration'} = $params{'duration'};
+       $current->{'nparts'} = $params{'nparts'};
+       $current->{'total_duration'} = $params{'total_duration'};
+       $steps->{'maybe_done'}->();
+    };
 
-           $self->{'dst_res'}->release(
-               finished_cb => $load_dst);
+    step maybe_done => sub {
+       return unless --$n_threads == 0;
+       my @errors = (@{$current->{'src_errors'}}, @{$current->{'dst_errors'}});
+
+       # figure out how to log this, based on the results from the clerk (src)
+       # and scribe (dst)
+       my $logtype;
+       if ($current->{'src_result'} eq 'DONE') {
+           if ($current->{'dst_result'} eq 'DONE') {
+               $logtype = $L_DONE;
+           } elsif ($current->{'dst_result'} eq 'PARTIAL') {
+               $logtype = $L_PARTIAL;
+           } else { # ($current->{'dst_result'} eq 'FAILED')
+               $logtype = $L_FAIL;
+           }
        } else {
-           $load_dst->(undef);
+           if ($current->{'size'} > 0) {
+               $logtype = $L_PARTIAL;
+           } else {
+               $logtype = $L_FAIL;
+           }
        }
-    });
 
-    $load_dst = make_cb('load_dst' => sub {
-       my ($err) = @_;
-       fail $err if $err;
-       $self->vlog("Loading next destination slot");
-
-       if (defined $self->{'dst_res'}) {
-           $self->{'dst_chg'}->load(
-               relative_slot => 'next',
-               slot => $self->{'dst_res'}->{'this_slot'},
-               set_current => 1,
-               res_cb => $got_dst);
+       my $dump = $current->{'dump'};
+       my $stats = make_stats($current->{'size'}, $current->{'total_duration'},
+                               $dump->{'orig_kb'});
+       my $msg = quote_string(join("; ", @errors));
+
+       # write a DONE/PARTIAL/FAIL log line
+       if ($logtype == $L_FAIL) {
+           log_add_full($L_FAIL, "taper", sprintf("%s %s %s %s %s %s",
+               quote_string($dump->{'hostname'}.""), # " is required for SWIG..
+               quote_string($dump->{'diskname'}.""),
+               $dump->{'dump_timestamp'},
+               $dump->{'level'},
+               'error',
+               $msg));
        } else {
-           $self->{'dst_chg'}->load(
-               relative_slot => "current",
-               set_current => 1,
-               res_cb => $got_dst);
+           log_add_full($logtype, "taper", sprintf("%s %s %s %s %s %s%s",
+               quote_string($dump->{'hostname'}.""), # " is required for SWIG..
+               quote_string($dump->{'diskname'}.""),
+               $dump->{'dump_timestamp'},
+               $current->{'nparts'},
+               $dump->{'level'},
+               $stats,
+               ($logtype == $L_PARTIAL and @errors)? " $msg" : ""));
        }
-    });
 
-    $got_dst = make_cb('got_dst' => sub {
-       my ($err, $res) = @_;
-       fail $err if $err;
+       if (@errors) {
+           return $finished_cb->("transfer failed: " .  join("; ", @errors));
+       } else {
+           # rinse, wash, and repeat
+           return $steps->{'get_dump'}->();
+       }
+    };
+}
 
-       debug("Opened destination device");
+sub quit {
+    my $self = shift;
+    my ($exit_status) = @_;
+    my $exit_cb = $self->{'exit_cb'};
 
-       # if we've tried this slot before, we're out of destination slots
-       if (defined $self->{'first_dst_slot'}) {
-           if ($res->{'this_slot'} eq $self->{'first_dst_slot'}) {
-               fail("No more unused destination slots");
-           }
+    my $steps = define_steps
+           cb_ref => \$exit_cb;
+
+    # we may have several resources to clean up..
+    step quit_scribe => sub {
+       if ($self->{'cleanup'}{'quit_scribe'}) {
+           debug("quitting scribe..");
+           $self->{'dst'}{'scribe'}->quit(
+               finished_cb => $steps->{'quit_scribe_finished'});
        } else {
-           $self->{'first_dst_slot'} = $res->{'this_slot'};
+           $steps->{'check_exporting'}->();
        }
+    };
 
-       $self->{'dst_res'} = $res;
-       my $dev = $self->{'dst_dev'} = $res->{'device'};
-       my $device_name = $dev->device_name;
-
-       # characterize the device/volume status, and then check if we can
-       # automatically relabel it.
-
-use Data::Dumper;
-debug("". Dumper($dev->volume_header));
-       my $status = $dev->status;
-       my $volstate = '';
-       if ($status & $DEVICE_STATUS_VOLUME_UNLABELED and
-               $dev->volume_header and
-               $dev->volume_header->{'type'} == $F_EMPTY) {
-           $volstate = 'empty';
-       } elsif ($status & $DEVICE_STATUS_VOLUME_UNLABELED and
-               !$dev->volume_header) {
-           $volstate = 'empty';
-       } elsif ($status & $DEVICE_STATUS_VOLUME_UNLABELED and
-               $dev->volume_header and
-               $dev->volume_header->{'type'} != $F_WEIRD) {
-           $volstate = 'non_amanda';
-       } elsif ($status & $DEVICE_STATUS_VOLUME_ERROR) {
-           $volstate = 'volume_error';
-       } elsif ($status == $DEVICE_STATUS_SUCCESS) {
-           # OK, the label was read successfully
-           if (!$dev->volume_header) {
-               $volstate = 'empty';
-           } elsif ($dev->volume_header->{'type'} != $F_TAPESTART) {
-               $volstate = 'non_amanda';
-           } else {
-               my $label = $dev->volume_label;
-               print "got label $label\n";
-               my $labelstr = getconf($CNF_LABELSTR);
-               if ($label =~ /$labelstr/) {
-                   $volstate = 'this_config';
-               } else {
-                   $volstate = 'other_config';
-               }
-           }
-       } else {
-           fail ("Could not read label from $device_name: " .
-                $dev->error_or_status());
+    step quit_scribe_finished => sub {
+       my ($err) = @_;
+       if ($err) {
+           print STDERR "$err\n";
+           $exit_status = 1;
        }
 
-       if (!$self->{'autolabel'}{$volstate}) {
-           $self->vlog("Volume in destination slot $res->{this_slot} ($volstate) "
-                     . "does not meet autolabel requirements; going to next slot");
-           $release_dst->();
-           return;
+       $steps->{'check_exporting'}->();
+    };
+
+    # the export may not start until we quit the scribe, so wait for it now..
+    step check_exporting => sub {
+       # if we're exporting the final volume, wait for that to complete
+       if ($self->{'exporting'}) {
+           $self->{'call_after_export'} = $steps->{'quit_clerk'};
+       } else {
+           $steps->{'quit_clerk'}->();
        }
+    };
 
-       my $new_label = $self->generate_new_dst_label();
+    step quit_clerk => sub {
+       if ($self->{'cleanup'}{'quit_clerk'}) {
+           debug("quitting clerk..");
+           $self->{'src'}{'clerk'}->quit(
+               finished_cb => $steps->{'quit_clerk_finished'});
+       } else {
+           $steps->{'roll_log'}->();
+       }
+    };
 
-       $dev->start($ACCESS_WRITE, $new_label, $self->{'dst_timestamp'})
-           or fail ("Could not start device $device_name: " .
-               $dev->error_or_status());
+    step quit_clerk_finished => sub {
+       my ($err) = @_;
+       if ($err) {
+           print STDERR "$err\n";
+           $exit_status = 1;
+       }
 
-       # OK, it all matches up now..
-       $self->{'dst_label'} = $new_label;
+       $steps->{'roll_log'}->();
+    };
 
-       $res->set_label(label => $dev->volume_label(),
-                       finished_cb => $maybe_done);
-    });
+    step roll_log => sub {
+       if ($self->{'cleanup'}{'roll_trace_log'}) {
+           log_add_full($L_FINISH, "driver", "fake driver finish");
+           log_add($L_INFO, "pid-done $$");
 
-    # and finally, when both src and dst are finished, we move on to
-    # the next step.
-    $maybe_done = make_cb('maybe_done' => sub {
-       return if (--$src_and_dst_counter);
+           debug("invoking amreport..");
+           system("$sbindir/amreport", $self->{'config_name'}, "--from-amdump");
 
-       $self->vlog("Volumes loaded; starting copy");
-       $self->seek_and_copy($next_file);
-    });
+           debug("rolling logfile..");
+           log_rename($self->{'dst_write_timestamp'});
+       }
 
-    # kick it off
-    $src_and_dst_counter++;
-    $release_src->();
-    $src_and_dst_counter++;
-    $release_dst->();
+       $exit_cb->($exit_status);
+    };
 }
 
-sub seek_and_copy {
+## utilities
+
+sub failure {
     my $self = shift;
-    my ($next_file) = @_;
-    my $dst_filenum;
+    my ($msg) = @_;
+    print STDERR "$msg\n";
 
-    $self->vlog("Copying file #$next_file->{filenum}");
+    debug("failure: $msg");
 
-    # seek the source device
-    my $hdr = $self->{'src_dev'}->seek_file($next_file->{'filenum'});
-    if (!defined $hdr) {
-       fail "Error seeking to read next file: " .
-                   $self->{'src_dev'}->error_or_status()
-    }
-    if ($hdr->{'type'} == $F_TAPEEND
-           or $self->{'src_dev'}->file() != $next_file->{'filenum'}) {
-       fail "Attempt to seek to a non-existent file.";
+    # if we've got a logfile open that will be rolled, we might as well log
+    # an error.
+    if ($self->{'cleanup'}{'roll_trace_log'}) {
+       log_add($L_FATAL, "$msg");
     }
+    $self->quit(1);
+}
 
-    if ($hdr->{'type'} != $F_DUMPFILE && $hdr->{'type'} != $F_SPLIT_DUMPFILE) {
-       fail "Unexpected header type $hdr->{type}";
+sub vlog {
+    my $self = shift;
+    if (!$self->{'quiet'}) {
+       print @_, "\n";
     }
+}
 
-    # start the destination device with the same header
-    if (!$self->{'dst_dev'}->start_file($hdr)) {
-       fail "Error starting new file: " . $self->{'dst_dev'}->error_or_status();
-    }
+## scribe feedback methods
 
-    # and track the destination filenum correctly
-    $dst_filenum = $self->{'dst_dev'}->file();
+# note that the trace log calls here all add "taper", as we're dry_runing
+# to be the taper in the logfiles.
 
-    # now put together a transfer to copy that data.
-    my $xfer;
-    my $xfer_cb = sub {
-       my ($src, $msg, $elt) = @_;
-       if ($msg->{type} == $XMSG_INFO) {
-           $self->vlog("while transferring: $msg->{message}\n");
-       }
-       if ($msg->{type} == $XMSG_ERROR) {
-           fail $msg->{elt} . " failed: " . $msg->{message};
-       } elsif ($msg->{'type'} == $XMSG_DONE) {
-           debug("transfer completed");
+sub request_volume_permission {
+    my $self = shift;
+    my %params = @_;
 
-           # add this dump to the logfile
-           $self->add_part_to_db($next_file, $dst_filenum);
+    # sure, use all the volumes you want, no problem!
+    # TODO: limit to a vaulting-specific value of runtapes
+    $self->{'dst'}->{'scribe'}->start_scan();
+    $params{'perm_cb'}->(allow => 1);
+}
 
-           # start up the next copy
-           $self->start_next_file();
-       }
-    };
+sub scribe_notif_new_tape {
+    my $self = shift;
+    my %params = @_;
+
+    if ($params{'volume_label'}) {
+       $self->{'dst'}->{'label'} = $params{'volume_label'};
 
-    $xfer = Amanda::Xfer->new([
-       Amanda::Xfer::Source::Device->new($self->{'src_dev'}),
-       Amanda::Xfer::Dest::Device->new($self->{'dst_dev'},
-                                       getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE)),
-    ]);
+       # add to the trace log
+       log_add_full($L_START, "taper", sprintf("datestamp %s label %s tape %s",
+               $self->{'dst_write_timestamp'},
+               quote_string($self->{'dst'}->{'label'}),
+               ++$self->{'dst'}->{'tape_num'}));
+    } else {
+       $self->{'dst'}->{'label'} = undef;
 
-    debug("starting transfer");
-    $xfer->start($xfer_cb);
+       print STDERR "Could not start new destination volume: $params{error}";
+    }
 }
 
-sub release_reservations {
+sub scribe_notif_part_done {
     my $self = shift;
-    my ($finished_cb) = @_;
+    my %params = @_;
+
+    $self->{'last_partnum'} = $params{'partnum'};
+
+    my $stats = make_stats($params{'size'}, $params{'duration'}, $self->{'orig_kb'});
+
+    # log the part, using PART or PARTPARTIAL
+    my $hdr = $self->{'current'}->{'header'};
+    my $logbase = sprintf("%s %s %s %s %s %s/%s %s %s",
+       quote_string($self->{'dst'}->{'label'}),
+       $params{'fileno'},
+       quote_string($hdr->{'name'}.""), # " is required for SWIG..
+       quote_string($hdr->{'disk'}.""),
+       $hdr->{'datestamp'}."",
+       $params{'partnum'}, -1, # totalparts is always -1
+       $hdr->{'dumplevel'},
+       $stats);
+    if ($params{'successful'}) {
+       log_add_full($L_PART, "taper", $logbase);
+    } else {
+       log_add_full($L_PARTPARTIAL, "taper",
+               "$logbase \"No space left on device\"");
+    }
+
+    if ($params{'successful'}) {
+       $self->vlog("Wrote $self->{dst}->{label}:$params{'fileno'}: " . $hdr->summary());
+    }
+}
+
+sub scribe_notif_log_info {
+    my $self = shift;
+    my %params = @_;
+
+    log_add_full($L_INFO, "taper", $params{'message'});
+}
+
+sub scribe_notif_tape_done {
+    my $self = shift;
+    my %params = @_;
+
+    # immediately flag that we are busy exporting, to prevent amvault from
+    # quitting too soon.  The 'done' step will clear this flag.  We increment
+    # and decrement this to allow for the (unlikely) situation that multiple
+    # exports are going on simultaneously.
+    $self->{'exporting'}++;
+
+    my $finished_cb = sub {};
     my $steps = define_steps
        cb_ref => \$finished_cb;
 
-    step release_src => sub {
-       if ($self->{'src_res'}) {
-           $self->{'src_res'}->release(
-               finished_cb => $steps->{'release_dst'});
-       } else {
-           $steps->{'release_dst'}->(undef);
+    step check_option => sub {
+       if (!$self->{'opt_export'}) {
+           return $steps->{'done'}->();
        }
+
+       $steps->{'get_inventory'}->();
+    };
+    step get_inventory => sub {
+       $self->{'dst'}->{'chg'}->inventory(
+           inventory_cb => $steps->{'inventory_cb'});
     };
 
-    step release_dst => sub {
-       my ($err) = @_;
-       $self->vlog("$err") if $err;
+    step inventory_cb => sub {
+       my ($err, $inventory) = @_;
+       if ($err) {
+           print STDERR "Could not get destination inventory: $err\n";
+           return $steps->{'done'}->();
+       }
 
-       if ($self->{'dst_res'}) {
-           $self->{'dst_res'}->release(
-               finished_cb => $steps->{'done'});
+       # find the slots we want in the inventory
+       my ($ie_slot, $from_slot);
+       for my $info (@$inventory) {
+           if (defined $info->{'state'}
+               && $info->{'state'} != Amanda::Changer::SLOT_FULL
+               && $info->{'import_export'}) {
+               $ie_slot = $info->{'slot'};
+           }
+           if ($info->{'label'} and $info->{'label'} eq $params{'volume_label'}) {
+               $from_slot = $info->{'slot'};
+           }
+       }
+
+       if (!$ie_slot) {
+           print STDERR "No import/export slots available; skipping export\n";
+           return $steps->{'done'}->();
+       } elsif (!$from_slot) {
+           print STDERR "Could not find the just-written tape; skipping export\n";
+           return $steps->{'done'}->();
        } else {
-           $steps->{'done'}->(undef);
+           return $steps->{'do_move'}->($ie_slot, $from_slot);
        }
     };
 
-    step done => sub {
+    step do_move => sub {
+       my ($ie_slot, $from_slot) = @_;
+
+       # TODO: there is a risk here that the volume is no longer in the slot
+       # where we expect it to be, because the taperscan has moved it.  A
+       # failure from move() is not fatal, though, so this will only cause the
+       # volume to be left un-exported.
+
+       $self->{'dst'}->{'chg'}->move(
+           from_slot => $from_slot,
+           to_slot => $ie_slot,
+           finished_cb => $steps->{'moved'});
+    };
+
+    step moved => sub {
        my ($err) = @_;
-       $self->vlog("$err") if $err;
+       if ($err) {
+           print STDERR "While exporting just-written tape: $err (ignored)\n";
+       }
+       $steps->{'done'}->();
+    };
+
+    step done => sub {
+       if (--$self->{'exporting'} == 0) {
+           if ($self->{'call_after_export'}) {
+               my $cae = $self->{'call_after_export'};
+               $self->{'call_after_export'} = undef;
+               $cae->();
+           }
+       }
        $finished_cb->();
     };
 }
 
+## clerk feedback methods
+
+sub clerk_notif_part {
+    my $self = shift;
+    my ($label, $fileno, $header) = @_;
+
+    # see if this is a new label
+    if (!exists $self->{'src'}->{'seen_labels'}->{$label}) {
+       $self->{'src'}->{'seen_labels'}->{$label} = 1;
+       log_add($L_INFO, "reading from source volume '$label'");
+    }
+
+    $self->vlog("Reading $label:$fileno: ", $header->summary());
+}
+
+sub clerk_notif_holding {
+    my $self = shift;
+    my ($filename, $header) = @_;
+
+    # this used to give the fd from which the holding file was being read.. why??
+    $self->vlog("Reading '$filename'", $header->summary());
+}
+
 ## Application initialization
-package Main;
+package main;
+
 use Amanda::Config qw( :init :getconf );
 use Amanda::Debug qw( :logging );
 use Amanda::Util qw( :constants );
 use Getopt::Long;
+use Amanda::Cmdline qw( :constants parse_dumpspecs );
 
 sub usage {
-    print <<EOF;
+    my ($msg) = @_;
+
+    print STDERR <<EOF;
 **NOTE** this interface is under development and will change in future releases!
 
-Usage: amvault [-o configoption]* [-q|--quiet] [--autolabel=AUTOLABEL]
-       <conf> <src-run-timestamp> <dst-changer> <label-template>
+Usage: amvault [-o configoption...] [-q] [--quiet] [-n] [--dry-run]
+          [--fulls-only] [--export] [--src-timestamp src-timestamp]
+          --label-template label-template --dst-changer dst-changer
+          [--autolabel autolabel-arg...]
+          config
+          [hostname [ disk [ date [ level [ hostname [...] ] ] ] ]]
 
-    -o: configuration overwrite (see amanda(8))
+    -o: configuration override (see amanda(8))
     -q: quiet progress messages
-    --autolabel: set conditions under which a volume will be relabeled
-
-Copies data from the run with timestamp <src-run-timestamp> onto volumes using
+    --fulls-only: only copy full (level-0) dumps
+    --export: move completed destination volumes to import/export slots
+    --src-timestamp: the timestamp of the Amanda run that should be vaulted
+    --label-template: the template to use for new volume labels
+    --dst-changer: the changer to which dumps should be written
+    --autolabel: similar to the amanda.conf parameter; may be repeated (default: empty)
+
+Copies data from the run with timestamp <src-timestamp> onto volumes using
 the changer <dst-changer>, labeling new volumes with <label-template>.  If
-<src-run-timestamp> is "latest", then the most recent amdump or amflush run
-will be used.
-
-Each source volume will be copied to a new destination volume; no re-assembly
-or splitting will be performed.  Destination volumes must be at least as large
-as the source volumes.  Without --autolabel, destination volumes must be empty.
+<src-timestamp> is "latest", then the most recent run of amdump or amflush
+will be used.  If any dumpspecs are included (<host-expr> and so on), then only
+dumps matching those dumpspecs will be dumped.  At least one of --fulls-only,
+--src-timestamp, or a dumpspec must be specified.
 
 EOF
+    if ($msg) {
+       print STDERR "ERROR: $msg\n";
+    }
     exit(1);
 }
 
-# options
-my $quiet = 0;
-my %autolabel = ( empty => 1 );
+Amanda::Util::setup_application("amvault", "server", $CONTEXT_CMDLINE);
 
-sub set_autolabel {
-    my ($opt, $val) = @_;
-    $val = lc $val;
+my $config_overrides = new_config_overrides($#ARGV+1);
+my $opt_quiet = 0;
+my $opt_dry_run = 0;
+my $opt_fulls_only = 0;
+my $opt_export = 0;
+my $opt_autolabel = {};
+my $opt_autolabel_seen = 0;
+my $opt_src_write_timestamp;
+my $opt_dst_changer;
+
+sub set_label_template {
+    usage("only one --label-template allowed") if $opt_autolabel->{'template'};
+    $opt_autolabel->{'template'} = $_[1];
+}
 
-    my @allowed_autolabels = qw(other_config non_amanda volume_error empty this_config);
-    if ($val eq 'any') {
-       %autolabel = map { $_ => 1 } @allowed_autolabels;
-       return;
+sub add_autolabel {
+    my ($opt, $val) = @_;
+    $val = lc($val);
+    $val =~ s/-/_/g;
+
+    $opt_autolabel_seen = 1;
+    my @ok = qw(other_config non_amanda volume_error empty);
+    for (@ok) {
+       if ($val eq $_) {
+           $opt_autolabel->{$_} = 1;
+           return;
+       }
     }
-
-    %autolabel = ();
-    for my $al (split /,/, $val) {
-       if (!grep { $_ eq $al } @allowed_autolabels) {
-           print STDERR "invalid autolabel parameter $al\n";
-           exit 1;
+    if ($val eq 'any') {
+       for (@ok) {
+           $opt_autolabel->{$_} = 1;
        }
-       $autolabel{$al} = 1;
+       return;
     }
+    usage("unknown --autolabel value '$val'");
 }
 
-Amanda::Util::setup_application("amvault", "server", $CONTEXT_CMDLINE);
-
-my $config_overrides = new_config_overrides($#ARGV+1);
 Getopt::Long::Configure(qw{ bundling });
 GetOptions(
     'o=s' => sub { add_config_override_opt($config_overrides, $_[1]); },
-    'autolabel=s' => \&set_autolabel,
-    'q|quiet' => \$quiet,
-) or usage();
-
-usage unless (@ARGV == 4);
-
-my ($config_name, $src_write_timestamp, $dst_changer, $label_template) = @ARGV;
+    'q|quiet' => \$opt_quiet,
+    'n|dry-run' => \$opt_dry_run,
+    'fulls-only' => \$opt_fulls_only,
+    'export' => \$opt_export,
+    'label-template=s' => \&set_label_template,
+    'autolabel=s' => \&add_autolabel,
+    'src-timestamp=s' => \$opt_src_write_timestamp,
+    'dst-changer=s' => \$opt_dst_changer,
+    'version' => \&Amanda::Util::version_opt,
+    'help' => \&usage,
+) or usage("usage error");
+$opt_autolabel->{'empty'} = 1 unless $opt_autolabel_seen;
+
+usage("not enough arguments") unless (@ARGV >= 1);
+
+my $config_name = shift @ARGV;
+my @opt_dumpspecs = parse_dumpspecs(\@ARGV, $CMDLINE_PARSE_DATESTAMP|$CMDLINE_PARSE_LEVEL)
+    if (@ARGV);
+
+usage("no --label-template given") unless $opt_autolabel->{'template'};
+usage("no --dst-changer given") unless $opt_dst_changer;
+usage("specify something to select the source dumps") unless
+    $opt_src_write_timestamp or $opt_fulls_only or @opt_dumpspecs;
 
 set_config_overrides($config_overrides);
 config_init($CONFIG_INIT_EXPLICIT_NAME, $config_name);
@@ -537,13 +958,31 @@ if ($cfgerr_level >= $CFGERR_WARNINGS) {
     config_print_errors();
     if ($cfgerr_level >= $CFGERR_ERRORS) {
        print STDERR "errors processing config file\n";
-       exit 1;
+       exit(1);
     }
 }
 
-Amanda::Util::finish_setup($RUNNING_AS_ANY);
+Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
+
+my $exit_status;
+my $exit_cb = sub {
+    ($exit_status) = @_;
+    Amanda::MainLoop::quit();
+};
+
+my $vault = Amvault->new(
+    config_name => $config_name,
+    src_write_timestamp => $opt_src_write_timestamp,
+    dst_changer => $opt_dst_changer,
+    dst_autolabel => $opt_autolabel,
+    dst_write_timestamp => Amanda::Util::generate_timestamp(),
+    opt_dumpspecs => @opt_dumpspecs? \@opt_dumpspecs : undef,
+    opt_dry_run => $opt_dry_run,
+    quiet => $opt_quiet,
+    fulls_only => $opt_fulls_only,
+    opt_export => $opt_export);
+Amanda::MainLoop::call_later(sub { $vault->run($exit_cb) });
+Amanda::MainLoop::run();
 
-# start the copy
-my $vault = Amvault->new($src_write_timestamp, $dst_changer, $label_template, $quiet, \%autolabel);
-$vault->run();
 Amanda::Util::finish_application();
+exit($exit_status);
index bf802f9b99bcdf2c47f97a7f98905e904a6a62c8..bbf8676653fe4f2b747b5e93d8d7a93b2196a316 100644 (file)
 #include "holding.h"
 #include "timestamp.h"
 
-#define chunker_debug(i, ...) do {     \
-       if ((i) <= debug_chunker) {     \
-           dbprintf(__VA_ARGS__);      \
-       }                               \
-} while (0)
-
 #ifndef SEEK_SET
 #define SEEK_SET 0
 #endif
@@ -105,6 +99,11 @@ static int databuf_flush(struct databuf *);
 static int startup_chunker(char *, off_t, off_t, struct databuf *, int *);
 static int do_chunk(int, struct databuf *, int);
 
+/* we use a function pointer for full_write, so that we can "shim" in
+ * full_write_with_fake_enospc for testing */
+static size_t (*db_full_write)(int fd, const void *buf, size_t count);
+static size_t full_write_with_fake_enospc(int fd, const void *buf, size_t count);
+static off_t fake_enospc_at_byte = -1;
 
 int
 main(
@@ -189,6 +188,18 @@ main(
        log_add(L_INFO, "%s pid %ld", get_pname(), (long)getpid());
        error(_("Didn't get START command"));
     }
+    free_cmdargs(cmdargs);
+
+    /* set up a fake ENOSPC for testing purposes.  Note that this counts
+     * headers as well as data written to disk. */
+    if (getenv("CHUNKER_FAKE_ENOSPC_AT")) {
+       char *env = getenv("CHUNKER_FAKE_ENOSPC_AT");
+       fake_enospc_at_byte = (off_t)atoi(env); /* these values are never > MAXINT */
+       db_full_write = full_write_with_fake_enospc;
+       g_debug("will trigger fake ENOSPC at byte %d", (int)fake_enospc_at_byte);
+    } else {
+       db_full_write = full_write;
+    }
 
 /*    do {*/
        cmdargs = getcmd();
@@ -318,6 +329,7 @@ main(
                m = vstrallocf("[%s]", errstr);
                q = quote_string(m);
                amfree(m);
+               free_cmdargs(cmdargs);
                if(command_in_transit != NULL) {
                    cmdargs = command_in_transit;
                    command_in_transit = NULL;
@@ -780,10 +792,14 @@ databuf_flush(
 
            aclose(newfd);
            if(save_errno == ENOSPC) {
+               if (unlink(tmp_filename) < 0) {
+                   g_debug("could not delete '%s'; ignoring", tmp_filename);
+               }
                putresult(NO_ROOM, "%s %lld\n", handle, 
                          (long long)(db->use+db->split_size-dumpsize));
                db->use = (off_t)0;                     /* force RQ_MORE DISK */
                db->split_size = dumpsize;
+               file.type = save_type;
                continue;
            }
            m = vstrallocf(_("write_tapeheader file %s: %s"),
@@ -864,7 +880,7 @@ databuf_flush(
      * Write out the buffer
      */
     size_to_write = (size_t)(db->datain - db->dataout);
-    written = full_write(db->fd, db->dataout, size_to_write);
+    written = db_full_write(db->fd, db->dataout, size_to_write);
     if (written > 0) {
        db->dataout += written;
        dumpbytes += (off_t)written;
@@ -927,7 +943,7 @@ write_tapeheader(
     if (!buffer) /* this shouldn't happen */
        error(_("header does not fit in %zd bytes"), (size_t)DISK_BLOCK_BYTES);
 
-    written = full_write(outfd, buffer, DISK_BLOCK_BYTES);
+    written = db_full_write(outfd, buffer, DISK_BLOCK_BYTES);
     amfree(buffer);
     if(written == DISK_BLOCK_BYTES) return 0;
 
@@ -937,3 +953,41 @@ write_tapeheader(
 
     return (ssize_t)-1;
 }
+
+static size_t
+full_write_with_fake_enospc(
+    int fd,
+    const void *buf,
+    size_t count)
+{
+    size_t rc;
+
+    //g_debug("HERE %zd %zd", count, (size_t)fake_enospc_at_byte);
+
+    if (count <= (size_t)fake_enospc_at_byte) {
+       fake_enospc_at_byte -= count;
+       return full_write(fd, buf, count);
+    }
+
+    /* if we get here, the caller has requested a size that is less
+     * than fake_enospc_at_byte. */
+    count = fake_enospc_at_byte;
+    g_debug("returning fake ENOSPC");
+
+    if (fake_enospc_at_byte) {
+       rc = full_write(fd, buf, fake_enospc_at_byte);
+       if (rc == (size_t)fake_enospc_at_byte) {
+           /* full_write succeeded, so fake a failure */
+           errno = ENOSPC;
+       }
+    } else {
+       /* no bytes to write; just fake an error */
+       errno = ENOSPC;
+       rc = 0;
+    }
+
+    /* switch back to calling full_write directly */
+    fake_enospc_at_byte = -1;
+    db_full_write = full_write;
+    return rc;
+}
index 4a08dad0f1cfab5d11002535a7adb14010f90e83..d29a4f33d0cb6cad3717ca6a0272865fbaa2db51 100644 (file)
@@ -25,8 +25,8 @@
  * Utility routines for handling command lines.
  */
 
-#include <ctype.h>
 #include "amanda.h"
+#include <ctype.h>
 #include "match.h"
 #include "cmdline.h"
 #include "holding.h"
@@ -36,7 +36,8 @@ dumpspec_new(
     char *host, 
     char *disk, 
     char *datestamp,
-    char *level)
+    char *level,
+    char *write_timestamp)
 {
     dumpspec_t *rv;
 
@@ -45,6 +46,7 @@ dumpspec_new(
     if (disk) rv->disk = stralloc(disk);
     if (datestamp) rv->datestamp = stralloc(datestamp);
     if (level) rv->level = stralloc(level);
+    if (write_timestamp) rv->write_timestamp = stralloc(write_timestamp);
 
     return rv;
 }
@@ -58,6 +60,7 @@ dumpspec_free(
     if (dumpspec->disk) free(dumpspec->disk);
     if (dumpspec->datestamp) free(dumpspec->datestamp);
     if (dumpspec->level) free(dumpspec->level);
+    if (dumpspec->write_timestamp) free(dumpspec->write_timestamp);
     free(dumpspec);
 }
 
@@ -90,7 +93,7 @@ cmdline_parse_dumpspecs(
         switch (arg_state) {
             case ARG_GET_HOST:
                 arg_state = ARG_GET_DISK;
-                dumpspec = dumpspec_new(name, NULL, NULL, NULL);
+                dumpspec = dumpspec_new(name, NULL, NULL, NULL, NULL);
                list = g_slist_append(list, (gpointer)dumpspec);
                 break;
 
@@ -124,7 +127,7 @@ cmdline_parse_dumpspecs(
     if (list == NULL && (flags & CMDLINE_EMPTY_TO_WILDCARD)) {
         dumpspec = dumpspec_new("", "", 
                (flags & CMDLINE_PARSE_DATESTAMP)?"":NULL,
-               (flags & CMDLINE_PARSE_LEVEL)?"":NULL);
+               (flags & CMDLINE_PARSE_LEVEL)?"":NULL, "");
        list = g_slist_append(list, (gpointer)dumpspec);
     }
 
index b259aa44f2b786e62bdb0d6244567b1b0a37a96a..bd62e74bbb158ae23f2965a8785cb1d550cf4647 100644 (file)
@@ -43,6 +43,7 @@ typedef struct dumpspec_s {
     char *disk;
     char *datestamp;
     char *level;
+    char *write_timestamp;
 } dumpspec_t;
 
 /*
@@ -55,6 +56,7 @@ typedef struct dumpspec_s {
  * @param disk: disk name
  * @param datestamp: datestamp
  * @param level: level (as a string, allowing regexes)
+ * @param write_timestamp: timestamp written to tape.
  * @returns: dumpspec, or NULL on error
  */
 dumpspec_t *
@@ -62,7 +64,8 @@ dumpspec_new(
     char *host, 
     char *disk, 
     char *datestamp,
-    char *level);
+    char *level,
+    char *write_timestamp);
 
 /* Free memory associated with a single dumpspec.  (Does not chase 
  * next pointers)
index e11ffd83e851025750b6e47c3c8aaf16fdba2171..8a67cbd51de35d57725b5c6a29decf1290ae2555 100644 (file)
@@ -198,6 +198,8 @@ add_disk(
     disk = alloc(SIZEOF(disk_t));
     bzero(disk, SIZEOF(disk_t));
     disk->line = 0;
+    disk->allow_split = 0;
+    disk->splitsize = (off_t)0;
     disk->tape_splitsize = (off_t)0;
     disk->split_diskbuffer = NULL;
     disk->fallback_splitsize = (off_t)0;
@@ -641,6 +643,7 @@ parse_diskline(
     }
 
     disk->dtype_name        = dumptype_name(dtype);
+    disk->config            = dtype;
     disk->program           = dumptype_get_program(dtype);
     disk->exclude_list     = duplicate_sl(dumptype_get_exclude(dtype).sl_list);
     disk->exclude_file     = duplicate_sl(dumptype_get_exclude(dtype).sl_file);
@@ -653,9 +656,16 @@ parse_diskline(
 /*    disk->frequency       = dumptype_get_frequency(dtype);*/
     disk->auth               = dumptype_get_auth(dtype);
     disk->maxdumps          = dumptype_get_maxdumps(dtype);
+    disk->allow_split        = dumptype_get_allow_split(dtype);
     disk->tape_splitsize     = dumptype_get_tape_splitsize(dtype);
     disk->split_diskbuffer   = dumptype_get_split_diskbuffer(dtype);
     disk->fallback_splitsize = dumptype_get_fallback_splitsize(dtype);
+    if (disk->allow_split) {
+       tapetype_t *tapetype = lookup_tapetype(getconf_str(CNF_TAPETYPE));
+       disk->splitsize = tapetype_get_part_size(tapetype);
+    } else {
+       disk->splitsize = disk->tape_splitsize;
+    }
     disk->maxpromoteday             = dumptype_get_maxpromoteday(dtype);
     disk->bumppercent       = dumptype_get_bumppercent(dtype);
     disk->bumpsize          = dumptype_get_bumpsize(dtype);
@@ -1216,13 +1226,13 @@ xml_optionstr(
     disk_t *           dp,
     int                 to_server)
 {
-    char *auth_opt = stralloc("");
-    char *kencrypt_opt = stralloc("");
-    char *compress_opt = stralloc("");
+    char *auth_opt;
+    char *kencrypt_opt;
+    char *compress_opt;
     char *encrypt_opt = stralloc("");
     char *decrypt_opt = stralloc("");
-    char *record_opt = stralloc("");
-    char *index_opt = stralloc("");
+    char *record_opt;
+    char *index_opt;
     char *data_path_opt = stralloc("");
     char *exclude = stralloc("");
     char *exclude_file = NULL;
@@ -1246,14 +1256,16 @@ xml_optionstr(
     qdpname = quote_string(dp->name);
     if (am_has_feature(their_features, fe_options_auth)) {
        auth_opt = vstralloc("  <auth>", dp->auth, "</auth>\n", NULL);
+    } else {
+       auth_opt = stralloc("");
     }
 
     switch(dp->compress) {
     case COMP_FAST:
-       compress_opt = "  <compress>FAST</compress>\n";
+       compress_opt = stralloc("  <compress>FAST</compress>\n");
        break;
     case COMP_BEST:
-       compress_opt = "  <compress>BEST</compress>\n";
+       compress_opt = stralloc("  <compress>BEST</compress>\n");
        break;
     case COMP_CUST:
        compress_opt = vstralloc("  <compress>CUSTOM"
@@ -1263,19 +1275,20 @@ xml_optionstr(
                                 "  </compress>\n", NULL);
        break;
     case COMP_SERVER_FAST:
-       compress_opt = "  <compress>SERVER-FAST</compress>\n";
+       compress_opt = stralloc("  <compress>SERVER-FAST</compress>\n");
        break;
     case COMP_SERVER_BEST:
-       compress_opt = "  <compress>SERVER-BEST</compress>\n";
+       compress_opt = stralloc("  <compress>SERVER-BEST</compress>\n");
        break;
     case COMP_SERVER_CUST:
-       compress_opt = "  <compress>SERVER-CUSTOM</compress>\n";
        compress_opt = vstralloc("  <compress>SERVER-CUSTOM"
                                 "<custom-compress-program>",
                                 dp->srvcompprog,
                                 "</custom-compress-program>\n"
                                 "  </compress>\n", NULL);
        break;
+    default:
+       compress_opt = stralloc("");
     }
 
     switch(dp->encrypt) {
@@ -1321,15 +1334,20 @@ xml_optionstr(
 
     if(dp->index) {
        index_opt = "  <index>YES</index>\n";
+    } else {
+       index_opt = "";
     }
 
     if (dp->kencrypt) {
        kencrypt_opt = "  <kencrypt>YES</kencrypt>\n";
+    } else {
+       kencrypt_opt = "";
     }
 
     if (am_has_feature(their_features, fe_xml_data_path)) {
        switch(dp->data_path) {
        case DATA_PATH_AMANDA:
+           amfree(data_path_opt);
            data_path_opt = stralloc("  <datapath>AMANDA</datapath>\n");
            break;
        case DATA_PATH_DIRECTTCP:
@@ -1338,6 +1356,7 @@ xml_optionstr(
                char *s, *sc;
                char *value, *b64value;
 
+               amfree(data_path_opt);
                data_path_opt = stralloc("  <datapath>DIRECTTCP");
                if (dp->dataport_list) {
                    s = sc = stralloc(dp->dataport_list);
@@ -1441,6 +1460,7 @@ xml_optionstr(
     amfree(qdpname);
     amfree(auth_opt);
     amfree(data_path_opt);
+    amfree(compress_opt);
     amfree(exclude);
     amfree(exclude_list);
     amfree(exclude_file);
@@ -1450,6 +1470,7 @@ xml_optionstr(
     amfree(exc);
     amfree(decrypt_opt);
     amfree(encrypt_opt);
+    amfree(script_opt);
 
     /* result contains at least 'auth=...' */
     return result;
@@ -1707,6 +1728,7 @@ xml_scripts(
        xml_scr = vstrextend(&xml_scr, xml_scr1, xml_app.result, "  </script>\n", NULL);
        amfree(b64plugin);
        amfree(xml_app.result);
+       amfree(xml_scr1);
     }
     return xml_scr;
 }
@@ -1848,6 +1870,37 @@ match_disklist(
     return errstr;
 }
 
+gboolean
+match_dumpfile(
+    dumpfile_t  *file,
+    int                sargc,
+    char **    sargv)
+{
+    disk_t d;
+    am_host_t h;
+    disklist_t dl;
+
+    /* rather than try to reproduce the adaptive matching logic in
+     * match_disklist, this simply creates a new, fake disklist with one
+     * element in it, and calls match_disklist directly */
+
+    bzero(&h, sizeof(h));
+    h.hostname = file->name;
+    h.disks = &d;
+
+    bzero(&d, sizeof(d));
+    d.host = &h;
+    d.hostname = file->name;
+    d.name = file->disk;
+    d.device = file->disk;
+    d.todo = 1;
+
+    dl.head = dl.tail = &d;
+
+    (void)match_disklist(&dl, sargc, sargv);
+    return d.todo;
+}
+
 netif_t *
 disklist_netifs(void)
 {
index b04247561552c73fef65777c7dba5846b290f4d7..5797a18ce262a115e4c8ab7fbd11ff4b1dadc250 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "amanda.h"
 #include "conffile.h"
+#include "fileheader.h"
 #include "amfeatures.h"
 
 typedef struct netif_s {
@@ -67,6 +68,7 @@ typedef struct disk_s {
     char       *name;                  /* label name for disk */
     char       *device;                /* device name for disk, eg "sd0g" */
     char       *dtype_name;            /* name of dump type */
+    dumptype_t *config;                /* pointer to the dumptype config */
     char       *program;               /* dump program, eg DUMP, STAR, GNUTAR */
     char       *srvcompprog;           /* custom compression server filter */
     char       *clntcompprog;          /* custom compression client filter */
@@ -83,9 +85,11 @@ typedef struct disk_s {
     int                exclude_optional;       /* exclude list are optional */
     int                include_optional;       /* include list are optional */
     int                priority;               /* priority of disk */
-    off_t      tape_splitsize;         /* size of dumpfile chunks on tape */
-    char       *split_diskbuffer;      /* place where we can buffer PORT-WRITE dumps other than RAM */
-    off_t      fallback_splitsize;     /* size for in-RAM PORT-WRITE buffers */
+    int                allow_split;
+    off_t      splitsize;
+    off_t      tape_splitsize;         /* size of dumpfile chunks on tape */
+    char       *split_diskbuffer;      /* place where we can buffer PORT-WRITE dumps other than RAM */
+    off_t      fallback_splitsize;     /* size for in-RAM PORT-WRITE buffers */
     int                dumpcycle;              /* days between fulls */
     long       frequency;              /* XXX - not used */
     char       *auth;                  /* type of authentication (per disk) */
@@ -170,6 +174,7 @@ char *xml_scripts(identlist_t pp_scriptlist, am_feature_t *their_features);
 void disable_skip_disk(disklist_t *origqp);
 
 char *match_disklist(disklist_t *origqp, int sargc, char **sargv);
+gboolean match_dumpfile(dumpfile_t *file, int sargc, char **sargv);
 void free_disklist(disklist_t *dl);
 
 netif_t *disklist_netifs(void);
index 947e232fa1470c96d7401fe966dee52c05dcb704..9a0bb27bceba68fa9c80773cb6c6e0cbf4587458 100644 (file)
@@ -35,6 +35,7 @@
  */
 
 #include "amanda.h"
+#include "find.h"
 #include "clock.h"
 #include "conffile.h"
 #include "diskfile.h"
@@ -66,7 +67,6 @@ static disklist_t tapeq;      // dle on holding disk waiting to be written
                                //   to tape
 static disklist_t roomq;       // dle waiting for more space on holding disk
 static int pending_aborts;
-static disk_t *taper_disk;
 static int degraded_mode;
 static off_t reserved_space;
 static off_t total_disksize;
@@ -75,9 +75,9 @@ static char *chunker_program;
 static int  inparallel;
 static int nodump = 0;
 static off_t tape_length = (off_t)0;
-static off_t tape_left = (off_t)0;
 static int current_tape = 0;
 static int conf_taperalgo;
+static int conf_taper_parallel_write;
 static int conf_runtapes;
 static time_t sleep_time;
 static int idle_reason;
@@ -88,6 +88,7 @@ static int need_degraded=0;
 static holdalloc_t *holdalloc;
 static int num_holdalloc;
 static event_handle_t *dumpers_ev_time = NULL;
+static event_handle_t *flush_ev_read = NULL;
 static event_handle_t *schedule_ev_read = NULL;
 static int   conf_flush_threshold_dumped;
 static int   conf_flush_threshold_scheduled;
@@ -99,6 +100,10 @@ static int   schedule_done;                 // 1 if we don't wait for a
                                                //   schedule from the planner
 static int   force_flush;                      // All dump are terminated, we
                                                // must now respect taper_flush
+static int taper_nb_scan_volume = 0;
+static int nb_sent_new_tape = 0;
+static int taper_started = 0;
+static taper_t *last_started_taper;
 
 static int wait_children(int count);
 static void wait_for_children(void);
@@ -110,7 +115,6 @@ static assignedhd_t **build_diskspace(char *destname);
 static int client_constrained(disk_t *dp);
 static void deallocate_bandwidth(netif_t *ip, unsigned long kps);
 static void dump_schedule(disklist_t *qp, char *str);
-static void dump_to_tape(disk_t *dp);
 static assignedhd_t **find_diskspace(off_t size, int *cur_idle,
                                        assignedhd_t *preferred);
 static unsigned long free_kps(netif_t *ip);
@@ -124,10 +128,11 @@ static void handle_dumpers_time(void *);
 static void handle_taper_result(void *);
 
 static void holdingdisk_state(char *time_str);
-static dumper_t *idle_dumper(void);
+static taper_t *idle_taper(void);
+static taper_t *taper_from_name(char *name);
 static void interface_state(char *time_str);
 static int queue_length(disklist_t q);
-static disklist_t read_flush(void);
+static void read_flush(void *cookie);
 static void read_schedule(void *cookie);
 static void short_dump_state(void);
 static void startaflush(void);
@@ -135,15 +140,19 @@ static void start_degraded_mode(disklist_t *queuep);
 static void start_some_dumps(disklist_t *rq);
 static void continue_port_dumps(void);
 static void update_failed_dump(disk_t *);
+static int all_taper_idle(void);
 
 typedef enum {
-    TAPE_ACTION_NO_ACTION     = 0,
-    TAPE_ACTION_NEW_TAPE      = (1 << 0),
-    TAPE_ACTION_NO_NEW_TAPE   = (1 << 1),
-    TAPE_ACTION_START_A_FLUSH = (1 << 2)
+    TAPE_ACTION_NO_ACTION         = 0,
+    TAPE_ACTION_SCAN              = (1 << 0),
+    TAPE_ACTION_NEW_TAPE          = (1 << 1),
+    TAPE_ACTION_NO_NEW_TAPE       = (1 << 2),
+    TAPE_ACTION_START_A_FLUSH     = (1 << 3),
+    TAPE_ACTION_START_A_FLUSH_FIT = (1 << 4),
+    TAPE_ACTION_MOVE              = (1 << 5)
 } TapeAction;
 
-static TapeAction tape_action(char **why_no_new_tape);
+static TapeAction tape_action(taper_t *taper, char **why_no_new_tape);
 
 static const char *idle_strings[] = {
 #define NOT_IDLE               0
@@ -177,8 +186,6 @@ main(
     identlist_t    il;
     unsigned long reserve = 100;
     char *conf_diskfile;
-    cmd_t cmd;
-    int result_argc;
     char **result_argv = NULL;
     char *taper_program;
     char *conf_tapetype;
@@ -189,6 +196,9 @@ main(
     config_overrides_t *cfg_ovr = NULL;
     char *cfg_opt = NULL;
     holdalloc_t *ha, *ha_last;
+    find_result_t *holding_files;
+    disklist_t holding_disklist = { NULL, NULL };
+    int no_taper = FALSE;
 
     /*
      * Configure program for internationalization:
@@ -242,17 +252,32 @@ main(
           get_pname(), (long) getpid(), argv[0], VERSION);
 
     if(argc > 2) {
-        if(strncmp(argv[2], "nodump", 6) == 0) {
+        if(strcmp(argv[2], "nodump") == 0) {
             nodump = 1;
+           argv++;
+           argc--;
         }
     }
 
+    if (argc > 2) {
+       if (strcmp(argv[2], "--no-taper") == 0) {
+           no_taper = TRUE;
+           argv++;
+           argc--;
+       }
+    }
+
     safe_cd(); /* do this *after* config_init */
 
     check_running_as(RUNNING_AS_DUMPUSER);
 
     dbrename(get_config_name(), DBG_SUBDIR_SERVER);
 
+    /* load DLEs from the holding disk, in case there's anything to flush there */
+    search_holding_disk(&holding_files, &holding_disklist);
+    /* note that the dumps are added to the global disklist, so we need not consult
+     * holding_files or holding_disklist after this */
+
     amfree(driver_timestamp);
     /* read timestamp from stdin */
     while ((line = agets(stdin)) != NULL) {
@@ -298,8 +323,12 @@ main(
     chunker_program = vstralloc(amlibexecdir, "/", "chunker", NULL);
 
     conf_taperalgo = getconf_taperalgo(CNF_TAPERALGO);
+    conf_taper_parallel_write = getconf_int(CNF_TAPER_PARALLEL_WRITE);
     conf_tapetype = getconf_str(CNF_TAPETYPE);
     conf_runtapes = getconf_int(CNF_RUNTAPES);
+    if (conf_taper_parallel_write > conf_runtapes) {
+       conf_taper_parallel_write = conf_runtapes;
+    }
     tape = lookup_tapetype(conf_tapetype);
     tape_length = tapetype_get_length(tape);
     g_printf("driver: tape size %lld\n", (long long)tape_length);
@@ -311,8 +340,8 @@ main(
     flush_threshold_scheduled = (conf_flush_threshold_scheduled * tape_length) / 100;
     taperflush = (conf_taperflush *tape_length) / 100;
 
-    driver_debug(1, _("flush_threshold_dumped: %lld\n"), (long long)flush_threshold_dumped);
-    driver_debug(1, _("flush_threshold_scheduled: %lld\n"), (long long)flush_threshold_scheduled);
+    driver_debug(1, _("flush-threshold-dumped: %lld\n"), (long long)flush_threshold_dumped);
+    driver_debug(1, _("flush-threshold-scheduled: %lld\n"), (long long)flush_threshold_scheduled);
     driver_debug(1, _("taperflush: %lld\n"), (long long)taperflush);
 
     /* set up any configuration-dependent variables */
@@ -408,10 +437,7 @@ main(
     /* taper takes a while to get going, so start it up right away */
 
     init_driverio();
-    if(conf_runtapes > 0) {
-        startup_tape_process(taper_program);
-        taper_cmd(START_TAPER, driver_timestamp, NULL, 0, NULL);
-    }
+    startup_tape_process(taper_program, conf_taper_parallel_write, no_taper);
 
     /* fire up the dumpers now while we are waiting */
     if(!nodump) startup_dump_processes(dumper_program, inparallel, driver_timestamp);
@@ -429,10 +455,26 @@ main(
     directq.head = NULL;
     directq.tail = NULL;
     waitq = origq;
-    taper_state = TAPER_STATE_DEFAULT;
-    tapeq = read_flush();
+    tapeq.head = NULL;
+    tapeq.tail = NULL;
+    roomq.head = NULL;
+    roomq.tail = NULL;
+    taper_nb_wait_reply = 0;
+
+    need_degraded = 0;
+    if (no_taper || conf_runtapes <= 0) {
+       taper_started = 1; /* we'll pretend the taper started and failed immediately */
+       need_degraded = 1;
+    } else {
+       tapetable[0].state = TAPER_STATE_INIT;
+       taper_nb_wait_reply++;
+       taper_nb_scan_volume++;
+       taper_ev_read = event_register(taper_fd, EV_READFD,
+                                      handle_taper_result, NULL);
+        taper_cmd(START_TAPER, NULL, tapetable[0].name, 0, driver_timestamp);
+    }
 
-    roomq.head = roomq.tail = NULL;
+    flush_ev_read = event_register((event_id_t)0, EV_READFD, read_flush, NULL);
 
     log_add(L_STATS, _("startup time %s"), walltime_str(curclock()));
 
@@ -443,33 +485,9 @@ main(
           getconf_str(CNF_DUMPORDER));
     fflush(stdout);
 
-    /* ok, planner is done, now lets see if the tape is ready */
-
-    if (conf_runtapes > 0) {
-       cmd = getresult(taper, 1, &result_argc, &result_argv);
-       if (cmd != TAPER_OK) {
-           /* no tape, go into degraded mode: dump to holding disk */
-           need_degraded = 1;
-       }
-    } else {
-       need_degraded = 1;
-    }
-
-    tape_left = tape_length;
-    taper_busy = 0;
-    amfree(taper_input_error);
-    amfree(taper_tape_error);
-    taper_disk = NULL;
-    taper_ev_read = NULL;
-
     schedule_done = nodump;
     force_flush = 0;
 
-    if(!need_degraded) startaflush();
-
-    if(!nodump)
-       schedule_ev_read = event_register((event_id_t)0, EV_READFD, read_schedule, NULL);
-
     short_dump_state();
     event_loop(0);
 
@@ -482,7 +500,7 @@ main(
     }
 
     /* handle any remaining dumps by dumping directly to tape, if possible */
-    while(!empty(directq) && taper > 0) {
+    while(!empty(directq) && taper_fd > 0) {
        time_t  sleep_time  = 100000000;
        disk_t *sleep_diskp = NULL;
        time_t  now         = time(0);
@@ -516,10 +534,12 @@ main(
            amfree(qname);
        }
        else if (!degraded_mode) {
-           taper_state |= TAPER_STATE_DUMP_TO_TAPE;
-           dump_to_tape(diskp);
-           event_loop(0);
-           taper_state &= ~TAPER_STATE_DUMP_TO_TAPE;
+           char *qname = quote_string(diskp->name);
+           log_add(L_FAIL, "%s %s %s %d [%s]",
+               diskp->host->hostname, qname, sched(diskp)->datestamp,
+               sched(diskp)->level,
+               _("can't dump in degraded mode"));
+           amfree(qname);
        }
        else {
            char *qname = quote_string(diskp->name);
@@ -552,7 +572,7 @@ main(
        }
     }
 
-    if(taper >= 0) {
+    if(taper_fd >= 0) {
        taper_cmd(QUIT, NULL, NULL, 0, NULL);
     }
 
@@ -698,7 +718,7 @@ wait_for_children(void)
        }
     }
 
-    if(taper_pid > 1 && taper > 0) {
+    if(taper_pid > 1 && taper_fd > 0) {
        taper_cmd(QUIT, NULL, NULL, 0, NULL);
     }
 
@@ -715,43 +735,135 @@ wait_for_children(void)
 
 }
 
+static void startaflush_tape(taper_t *taper);
+
 static void
 startaflush(void)
+{
+    taper_t *taper;
+
+    for(taper = tapetable; taper <= tapetable+conf_taper_parallel_write;
+       taper++) {
+       if (!(taper->state & TAPER_STATE_DONE) &&
+           taper->state & TAPER_STATE_WAIT_FOR_TAPE) {
+           startaflush_tape(taper);
+       }
+    }
+    for(taper = tapetable; taper <= tapetable+conf_taper_parallel_write;
+       taper++) {
+       if (!(taper->state & TAPER_STATE_DONE) &&
+           taper->state & TAPER_STATE_TAPE_REQUESTED) {
+           startaflush_tape(taper);
+       }
+    }
+    for(taper = tapetable; taper <= tapetable+conf_taper_parallel_write;
+       taper++) {
+       if (!(taper->state & TAPER_STATE_DONE) &&
+           taper->state & TAPER_STATE_INIT) {
+           startaflush_tape(taper);
+       }
+    }
+    for(taper = tapetable; taper <= tapetable+conf_taper_parallel_write;
+       taper++) {
+       if (!(taper->state & TAPER_STATE_DONE) &&
+           taper->state & TAPER_STATE_IDLE) {
+           startaflush_tape(taper);
+       }
+    }
+}
+
+static void
+startaflush_tape(
+    taper_t *taper)
 {
     disk_t *dp = NULL;
     disk_t *fit = NULL;
     char *datestamp;
-    int extra_tapes = 0;
+    off_t extra_tapes_size = 0;
+    off_t taper_left;
     char *qname;
     TapeAction result_tape_action;
-    char *why_no_new_tape;
-
-    result_tape_action = tape_action(&why_no_new_tape);
-
-    if (result_tape_action & TAPE_ACTION_NEW_TAPE) {
-       taper_state &= ~TAPER_STATE_WAIT_FOR_TAPE;
-       taper_cmd(NEW_TAPE, NULL, NULL, 0, NULL);
+    char *why_no_new_tape = NULL;
+    taper_t *taper1;
+
+    result_tape_action = tape_action(taper, &why_no_new_tape);
+
+    if (result_tape_action & TAPE_ACTION_SCAN) {
+       taper->state &= ~TAPER_STATE_TAPE_REQUESTED;
+       taper->state |= TAPER_STATE_WAIT_FOR_TAPE;
+       taper_nb_scan_volume++;
+       taper_cmd(START_SCAN, taper->disk, NULL, 0, NULL);
+    } else if (result_tape_action & TAPE_ACTION_NEW_TAPE) {
+       taper->state &= ~TAPER_STATE_WAIT_FOR_TAPE;
+       taper->state |= TAPER_STATE_WAIT_NEW_TAPE;
+       nb_sent_new_tape++;
+       taper_cmd(NEW_TAPE, taper->disk, NULL, 0, NULL);
     } else if (result_tape_action & TAPE_ACTION_NO_NEW_TAPE) {
-       taper_state &= ~TAPER_STATE_WAIT_FOR_TAPE;
-       taper_cmd(NO_NEW_TAPE, why_no_new_tape, NULL, 0, NULL);
+       taper->state &= ~TAPER_STATE_WAIT_FOR_TAPE;
+       taper_cmd(NO_NEW_TAPE, taper->disk, why_no_new_tape, 0, NULL);
+       taper->state |= TAPER_STATE_DONE;
        start_degraded_mode(&runq);
+    } else if (result_tape_action & TAPE_ACTION_MOVE) {
+       taper_t *taper1 = idle_taper();
+       if (taper1) {
+           taper->state &= ~TAPER_STATE_TAPE_REQUESTED;
+           taper->state &= ~TAPER_STATE_WAIT_FOR_TAPE;
+           taper_cmd(TAKE_SCRIBE_FROM, taper->disk, taper1->name, 0 , NULL);
+           taper1->state = TAPER_STATE_DEFAULT;
+           taper->state |= TAPER_STATE_TAPE_STARTED;
+           taper->left = taper1->left;
+           if (last_started_taper == taper1) {
+               last_started_taper = taper;
+           }
+       }
     }
 
-    if (!degraded_mode && !taper_busy && !empty(tapeq) &&
-       (result_tape_action & TAPE_ACTION_START_A_FLUSH)) {
-       
+    if (!degraded_mode &&
+        taper->state & TAPER_STATE_IDLE &&
+       !empty(tapeq) &&
+       (result_tape_action & TAPE_ACTION_START_A_FLUSH ||
+        result_tape_action & TAPE_ACTION_START_A_FLUSH_FIT)) {
+
+       int taperalgo = conf_taperalgo;
+       if (result_tape_action & TAPE_ACTION_START_A_FLUSH_FIT) {
+           if (taperalgo == ALGO_FIRST)
+               taperalgo = ALGO_FIRSTFIT;
+           else if (taperalgo == ALGO_LARGEST)
+               taperalgo = ALGO_LARGESTFIT;
+           else if (taperalgo == ALGO_SMALLEST)
+               taperalgo = ALGO_SMALLESTFIT;
+           else if (taperalgo == ALGO_LAST)
+               taperalgo = ALGO_LASTFIT;
+       }
+
+       extra_tapes_size = tape_length * (off_t)(conf_runtapes - current_tape);
+       for (taper1 = tapetable; taper1 < tapetable + conf_taper_parallel_write;
+                                 taper1++) {
+           if (taper1->state & TAPER_STATE_TAPE_STARTED) {
+               extra_tapes_size += taper1->left;
+           }
+           dp = taper1->disk;
+           if (dp) {
+               extra_tapes_size -= (sched(dp)->act_size - taper1->written);
+           }
+       }
+
+       if (taper->state & TAPER_STATE_TAPE_STARTED) {
+           taper_left = taper->left;
+       } else {
+           taper_left = tape_length;
+       }
+       dp = NULL;
        datestamp = sched(tapeq.head)->datestamp;
-       switch(conf_taperalgo) {
+       switch(taperalgo) {
        case ALGO_FIRST:
                dp = dequeue_disk(&tapeq);
                break;
        case ALGO_FIRSTFIT:
                fit = tapeq.head;
                while (fit != NULL) {
-                   extra_tapes = (fit->tape_splitsize > (off_t)0) ? 
-                                       conf_runtapes - current_tape : 0;
-                   if(sched(fit)->act_size <= (tape_left +
-                            tape_length * (off_t)extra_tapes) &&
+                   if (sched(fit)->act_size <=
+                            (fit->splitsize ? extra_tapes_size : taper_left) &&
                             strcmp(sched(fit)->datestamp, datestamp) <= 0) {
                        dp = fit;
                        fit = NULL;
@@ -776,10 +888,8 @@ startaflush(void)
        case ALGO_LARGESTFIT:
                fit = tapeq.head;
                while (fit != NULL) {
-                   extra_tapes = (fit->tape_splitsize > (off_t)0) ? 
-                                       conf_runtapes - current_tape : 0;
                    if(sched(fit)->act_size <=
-                      (tape_left + tape_length * (off_t)extra_tapes) &&
+                      (fit->splitsize ? extra_tapes_size : taper_left) &&
                       (!dp || sched(fit)->act_size > sched(dp)->act_size) &&
                       strcmp(sched(fit)->datestamp, datestamp) <= 0) {
                        dp = fit;
@@ -789,62 +899,75 @@ startaflush(void)
                if(dp) remove_disk(&tapeq, dp);
                break;
        case ALGO_SMALLEST:
+               fit = dp = tapeq.head;
+               while (fit != NULL) {
+                   if (sched(fit)->act_size < sched(dp)->act_size &&
+                       strcmp(sched(fit)->datestamp, datestamp) <= 0) {
+                       dp = fit;
+                   }
+                   fit = fit->next;
+               }
+               if(dp) remove_disk(&tapeq, dp);
+               break;
+       case ALGO_SMALLESTFIT:
+               fit = dp = tapeq.head;
+               while (fit != NULL) {
+                   if (sched(fit)->act_size <=
+                       (fit->splitsize ? extra_tapes_size : taper_left) &&
+                       (!dp || sched(fit)->act_size < sched(dp)->act_size) &&
+                       strcmp(sched(fit)->datestamp, datestamp) <= 0) {
+                       dp = fit;
+                   }
+                   fit = fit->next;
+               }
+               if(dp) remove_disk(&tapeq, dp);
                break;
        case ALGO_LAST:
                dp = tapeq.tail;
                remove_disk(&tapeq, dp);
                break;
-       }
-       if(!dp) { /* ALGO_SMALLEST, or default if nothing fit. */
-           if(conf_taperalgo != ALGO_SMALLEST)  {
-               g_fprintf(stderr,
-                  _("driver: startaflush: Using SMALLEST because nothing fit\n"));
-           }
-           fit = dp = tapeq.head;
-           while (fit != NULL) {
-               if(sched(fit)->act_size < sched(dp)->act_size &&
-                  strcmp(sched(fit)->datestamp, datestamp) <= 0) {
-                   dp = fit;
+       case ALGO_LASTFIT:
+               fit = tapeq.tail;
+               while (fit != NULL) {
+                   if (sched(fit)->act_size <=
+                       (fit->splitsize ? extra_tapes_size : taper_left) &&
+                       (!dp || sched(fit)->act_size < sched(dp)->act_size) &&
+                       strcmp(sched(fit)->datestamp, datestamp) <= 0) {
+                       dp = fit;
+                   }
+                   fit = fit->prev;
                }
-               fit = fit->next;
-           }
-           if(dp) remove_disk(&tapeq, dp);
-       }
-       if(taper_ev_read == NULL) {
-           taper_ev_read = event_register((event_id_t)taper, EV_READFD,
-                                          handle_taper_result, NULL);
+               if(dp) remove_disk(&tapeq, dp);
+               break;
        }
        if (dp) {
-           taper_disk = dp;
-           taper_busy = 1;
-           amfree(taper_input_error);
-           amfree(taper_tape_error);
-           taper_result = LAST_TOK;
-           taper_sendresult = 0;
-           taper_first_label = NULL;
-           taper_written = 0;
-           taper_state &= ~TAPER_STATE_DUMP_TO_TAPE;
-           taper_dumper = NULL;
+           taper->disk = dp;
+           taper->dumper = NULL;
+           amfree(taper->input_error);
+           amfree(taper->tape_error);
+           taper->result = LAST_TOK;
+           taper->sendresult = 0;
+           amfree(taper->first_label);
+           taper->written = 0;
+           taper->state &= ~TAPER_STATE_IDLE;
+           taper->state |= TAPER_STATE_FILE_TO_TAPE;
+           taper->dumper = NULL;
            qname = quote_string(dp->name);
+           if (taper_nb_wait_reply == 0) {
+               taper_ev_read = event_register(taper_fd, EV_READFD,
+                                              handle_taper_result, NULL);
+           }
+           taper_nb_wait_reply++;
+           sched(dp)->taper = taper;
            taper_cmd(FILE_WRITE, dp, sched(dp)->destname, sched(dp)->level,
                      sched(dp)->datestamp);
            g_fprintf(stderr,_("driver: startaflush: %s %s %s %lld %lld\n"),
-                   taperalgo2str(conf_taperalgo), dp->host->hostname, qname,
-                   (long long)sched(taper_disk)->act_size,
-                   (long long)tape_left);
-           if(sched(dp)->act_size <= tape_left)
-               tape_left -= sched(dp)->act_size;
-           else
-               tape_left = (off_t)0;
+                   taperalgo2str(taperalgo), dp->host->hostname, qname,
+                   (long long)sched(taper->disk)->act_size,
+                   (long long)taper->left);
            amfree(qname);
-       } else {
-           error(_("FATAL: Taper marked busy and no work found."));
-           /*NOTREACHED*/
        }
        short_dump_state();
-    } else if(!taper_busy && taper_ev_read != NULL) {
-       event_release(taper_ev_read);
-       taper_ev_read = NULL;
     }
 }
 
@@ -874,23 +997,118 @@ client_constrained(
     return 0;
 }
 
+static void
+allow_dump_dle(
+    disk_t         *diskp,
+    taper_t        *taper,
+    char            dumptype,
+    disklist_t     *rq,
+    const time_t    now,
+    int             dumper_to_holding,
+    int            *cur_idle,
+    disk_t        **delayed_diskp,
+    disk_t        **diskp_accept,
+    assignedhd_t ***holdp_accept,
+    off_t           extra_tapes_size)
+{
+    assignedhd_t **holdp=NULL;
+
+    if (diskp->host->start_t > now) {
+       *cur_idle = max(*cur_idle, IDLE_START_WAIT);
+       if (*delayed_diskp == NULL || sleep_time > diskp->host->start_t) {
+           *delayed_diskp = diskp;
+           sleep_time = diskp->host->start_t;
+       }
+    } else if(diskp->start_t > now) {
+       *cur_idle = max(*cur_idle, IDLE_START_WAIT);
+       if (*delayed_diskp == NULL || sleep_time > diskp->start_t) {
+           *delayed_diskp = diskp;
+           sleep_time = diskp->start_t;
+       }
+    } else if (diskp->host->netif->curusage > 0 &&
+              sched(diskp)->est_kps > free_kps(diskp->host->netif)) {
+       *cur_idle = max(*cur_idle, IDLE_NO_BANDWIDTH);
+    } else if (!taper && sched(diskp)->no_space) {
+       *cur_idle = max(*cur_idle, IDLE_NO_DISKSPACE);
+    } else if (!taper && diskp->to_holdingdisk == HOLD_NEVER) {
+       *cur_idle = max(*cur_idle, IDLE_NO_HOLD);
+    } else if (extra_tapes_size && sched(diskp)->est_size > extra_tapes_size) {
+       *cur_idle = max(*cur_idle, IDLE_NO_DISKSPACE);
+       /* no tape space */
+    } else if (!taper && (holdp =
+       find_diskspace(sched(diskp)->est_size, cur_idle, NULL)) == NULL) {
+       *cur_idle = max(*cur_idle, IDLE_NO_DISKSPACE);
+       if (empty(tapeq) && dumper_to_holding == 0 && rq != &directq) {
+           remove_disk(rq, diskp);
+           if (diskp->to_holdingdisk != HOLD_REQUIRED) {
+               enqueue_disk(&directq, diskp);
+               diskp->to_holdingdisk = HOLD_NEVER;
+           }
+       }
+    } else if (client_constrained(diskp)) {
+       free_assignedhd(holdp);
+       *cur_idle = max(*cur_idle, IDLE_CLIENT_CONSTRAINED);
+    } else {
+
+       /* disk fits, dump it */
+       int accept = !*diskp_accept;
+       if(!accept) {
+           switch(dumptype) {
+             case 's': accept = (sched(diskp)->est_size < sched(*diskp_accept)->est_size);
+                       break;
+             case 'S': accept = (sched(diskp)->est_size > sched(*diskp_accept)->est_size);
+                       break;
+             case 't': accept = (sched(diskp)->est_time < sched(*diskp_accept)->est_time);
+                       break;
+             case 'T': accept = (sched(diskp)->est_time > sched(*diskp_accept)->est_time);
+                       break;
+             case 'b': accept = (sched(diskp)->est_kps < sched(*diskp_accept)->est_kps);
+                       break;
+             case 'B': accept = (sched(diskp)->est_kps > sched(*diskp_accept)->est_kps);
+                       break;
+             default:  log_add(L_WARNING, _("Unknown dumporder character \'%c\', using 's'.\n"),
+                               dumptype);
+                       accept = (sched(diskp)->est_size < sched(*diskp_accept)->est_size);
+                       break;
+           }
+       }
+       if(accept) {
+           if( !*diskp_accept || !degraded_mode || diskp->priority >= (*diskp_accept)->priority) {
+               if(*holdp_accept) free_assignedhd(*holdp_accept);
+               *diskp_accept = diskp;
+               *holdp_accept = holdp;
+           }
+           else {
+               free_assignedhd(holdp);
+           }
+       }
+       else {
+           free_assignedhd(holdp);
+       }
+    }
+}
+
 static void
 start_some_dumps(
-    disklist_t *       rq)
+    disklist_t *rq)
 {
+    const time_t now = time(NULL);
     int cur_idle;
     disk_t *diskp, *delayed_diskp, *diskp_accept;
     disk_t *dp;
     assignedhd_t **holdp=NULL, **holdp_accept;
-    const time_t now = time(NULL);
     cmd_t cmd;
     int result_argc;
     char **result_argv;
     chunker_t *chunker;
     dumper_t *dumper;
+    taper_t  *taper;
     char dumptype;
     char *dumporder;
-    int  busy_dumpers = 0;
+    int  dumper_to_holding = 0;
+
+    /* don't start any actual dumps until the taper is started */
+    if (!taper_started) return;
 
     idle_reason = IDLE_NO_DUMPERS;
     sleep_time = 0;
@@ -901,11 +1119,10 @@ start_some_dumps(
     }
 
     for(dumper = dmptable; dumper < (dmptable+inparallel); dumper++) {
-       if( dumper->busy ) {
-           busy_dumpers++;
+       if (dumper->busy && dumper->dp->to_holdingdisk != HOLD_NEVER) {
+           dumper_to_holding++;
        }
     }
-
     for (dumper = dmptable; dumper < dmptable+inparallel; dumper++) {
 
        if( dumper->busy || dumper->down) {
@@ -953,80 +1170,66 @@ start_some_dumps(
                dumptype = 'T';
        }
 
-       for(diskp = rq->head; diskp != NULL; diskp = diskp->next) {
-           assert(diskp->host != NULL && sched(diskp) != NULL);
-
-           if (diskp->host->start_t > now) {
-               cur_idle = max(cur_idle, IDLE_START_WAIT);
-               if (delayed_diskp == NULL || sleep_time > diskp->host->start_t) {
-                   delayed_diskp = diskp;
-                   sleep_time = diskp->host->start_t;
-               }
-           } else if(diskp->start_t > now) {
-               cur_idle = max(cur_idle, IDLE_START_WAIT);
-               if (delayed_diskp == NULL || sleep_time > diskp->start_t) {
-                   delayed_diskp = diskp;
-                   sleep_time = diskp->start_t;
-               }
-           } else if (diskp->host->netif->curusage > 0 &&
-                      sched(diskp)->est_kps > free_kps(diskp->host->netif)) {
-               cur_idle = max(cur_idle, IDLE_NO_BANDWIDTH);
-           } else if(sched(diskp)->no_space) {
-               cur_idle = max(cur_idle, IDLE_NO_DISKSPACE);
-           } else if (diskp->to_holdingdisk == HOLD_NEVER) {
-               cur_idle = max(cur_idle, IDLE_NO_HOLD);
-           } else if ((holdp =
-               find_diskspace(sched(diskp)->est_size, &cur_idle, NULL)) == NULL) {
-               cur_idle = max(cur_idle, IDLE_NO_DISKSPACE);
-               if (empty(tapeq) && busy_dumpers == 0) {
-                   remove_disk(rq, diskp);
-                   enqueue_disk(&directq, diskp);
-               }
-           } else if (client_constrained(diskp)) {
-               free_assignedhd(holdp);
-               cur_idle = max(cur_idle, IDLE_CLIENT_CONSTRAINED);
-           } else {
-
-               /* disk fits, dump it */
-               int accept = !diskp_accept;
-               if(!accept) {
-                   switch(dumptype) {
-                     case 's': accept = (sched(diskp)->est_size < sched(diskp_accept)->est_size);
-                               break;
-                     case 'S': accept = (sched(diskp)->est_size > sched(diskp_accept)->est_size);
-                               break;
-                     case 't': accept = (sched(diskp)->est_time < sched(diskp_accept)->est_time);
-                               break;
-                     case 'T': accept = (sched(diskp)->est_time > sched(diskp_accept)->est_time);
-                               break;
-                     case 'b': accept = (sched(diskp)->est_kps < sched(diskp_accept)->est_kps);
-                               break;
-                     case 'B': accept = (sched(diskp)->est_kps > sched(diskp_accept)->est_kps);
-                               break;
-                     default:  log_add(L_WARNING, _("Unknown dumporder character \'%c\', using 's'.\n"),
-                                       dumptype);
-                               accept = (sched(diskp)->est_size < sched(diskp_accept)->est_size);
-                               break;
+       diskp = NULL;
+       taper = NULL;
+       if (!empty(directq)) {
+           taper = idle_taper();
+           if (taper) {
+               TapeAction result_tape_action;
+               char *why_no_new_tape = NULL;
+               result_tape_action = tape_action(taper, &why_no_new_tape);
+               if (result_tape_action & TAPE_ACTION_START_A_FLUSH ||
+                   result_tape_action & TAPE_ACTION_START_A_FLUSH_FIT) {
+                   off_t extra_tapes_size = 0;
+                   taper_t *taper1;
+
+                   if (result_tape_action & TAPE_ACTION_START_A_FLUSH_FIT) {
+                       extra_tapes_size = tape_length *
+                                         (off_t)(conf_runtapes - current_tape);
+                       for (taper1 = tapetable;
+                            taper1 < tapetable + conf_taper_parallel_write;
+                            taper1++) {
+                           if (taper1->state & TAPER_STATE_TAPE_STARTED) {
+                               extra_tapes_size += taper1->left;
+                           }
+                           dp = taper1->disk;
+                           if (dp) {
+                               extra_tapes_size -= (sched(dp)->est_size -
+                                                   taper1->written);
+                           }
+                       }
                    }
-               }
-               if(accept) {
-                   if( !diskp_accept || !degraded_mode || diskp->priority >= diskp_accept->priority) {
-                       if(holdp_accept) free_assignedhd(holdp_accept);
-                       diskp_accept = diskp;
-                       holdp_accept = holdp;
+
+                   for (diskp = directq.head; diskp != NULL;
+                                              diskp = diskp->next) {
+                       allow_dump_dle(diskp, taper, dumptype, &directq, now,
+                                      dumper_to_holding, &cur_idle,
+                                      &delayed_diskp, &diskp_accept,
+                                      &holdp_accept, extra_tapes_size);
                    }
-                   else {
-                       free_assignedhd(holdp);
+                   if (diskp_accept) {
+                       diskp = diskp_accept;
+                       holdp = holdp_accept;
+                   } else {
+                       taper = NULL;
                    }
-               }
-               else {
-                   free_assignedhd(holdp);
+               } else {
+                   taper = NULL;
                }
            }
        }
 
-       diskp = diskp_accept;
-       holdp = holdp_accept;
+       if (diskp == NULL) {
+           for(diskp = rq->head; diskp != NULL; diskp = diskp->next) {
+               assert(diskp->host != NULL && sched(diskp) != NULL);
+
+               allow_dump_dle(diskp, NULL, dumptype, rq, now,
+                              dumper_to_holding, &cur_idle, &delayed_diskp,
+                              &diskp_accept, &holdp_accept, 0);
+           }
+           diskp = diskp_accept;
+           holdp = holdp_accept;
+       }
 
        idle_reason = max(idle_reason, cur_idle);
        if (diskp == NULL && idle_reason == IDLE_NO_DISKSPACE) {
@@ -1045,7 +1248,7 @@ start_some_dumps(
            dumpers_ev_time = event_register((event_id_t)sleep_time, EV_TIME,
                handle_dumpers_time, &runq);
            return;
-       } else if (diskp != NULL) {
+       } else if (diskp != NULL && taper == NULL) {
            sched(diskp)->act_size = (off_t)0;
            allocate_bandwidth(diskp->host->netif, sched(diskp)->est_kps);
            sched(diskp)->activehd = assign_holdingdisk(holdp, diskp);
@@ -1066,7 +1269,7 @@ start_some_dumps(
            sched(diskp)->dumpsize = (off_t)-1;
            sched(diskp)->dumptime = (time_t)0;
            sched(diskp)->tapetime = (time_t)0;
-           chunker = dumper->chunker;
+           chunker = dumper->chunker = &chktable[dumper - dmptable];
            chunker->result = LAST_TOK;
            dumper->result = LAST_TOK;
            startup_chunk_process(chunker,chunker_program);
@@ -1127,6 +1330,46 @@ start_some_dumps(
            if (result_argv)
                g_strfreev(result_argv);
            short_dump_state();
+       } else if (diskp != NULL && taper != NULL) { /* dump to tape */
+           sched(diskp)->act_size = (off_t)0;
+           allocate_bandwidth(diskp->host->netif, sched(diskp)->est_kps);
+           diskp->host->inprogress++;  /* host is now busy */
+           diskp->inprogress = 1;
+           sched(diskp)->dumper = dumper;
+           sched(diskp)->taper = taper;
+           sched(diskp)->timestamp = now;
+           dumper->chunker = NULL;
+           amfree(diskp->dataport_list);
+
+           dumper->busy = 1;           /* dumper is now busy */
+           dumper->dp = diskp;         /* link disk to dumper */
+           remove_disk(&directq, diskp);  /* take it off the direct queue */
+
+           sched(diskp)->origsize = (off_t)-1;
+           sched(diskp)->dumpsize = (off_t)-1;
+           sched(diskp)->dumptime = (time_t)0;
+           sched(diskp)->tapetime = (time_t)0;
+           dumper->result = LAST_TOK;
+           taper->result = LAST_TOK;
+           taper->input_error = NULL;
+           taper->tape_error = NULL;
+           taper->disk = diskp;
+           taper->first_label = NULL;
+           taper->written = 0;
+           taper->dumper = dumper;
+           taper->state |= TAPER_STATE_DUMP_TO_TAPE;
+           taper->state &= ~TAPER_STATE_IDLE;
+           if (taper_nb_wait_reply == 0) {
+               taper_ev_read = event_register(taper_fd, EV_READFD,
+                                              handle_taper_result, NULL);
+           }
+
+           taper_nb_wait_reply++;
+           taper_cmd(PORT_WRITE, diskp, NULL, sched(diskp)->level,
+                     sched(diskp)->datestamp);
+           diskp->host->start_t = now + 15;
+
+           short_dump_state();
        }
     }
 }
@@ -1274,7 +1517,7 @@ continue_port_dumps(void)
        }
     }
     if((dp != NULL) && (active_dumpers == 0) && (busy_dumpers > 0) && 
-        ((!taper_busy && empty(tapeq)) || degraded_mode) &&
+        ((all_taper_idle() && empty(tapeq)) || degraded_mode) &&
        pending_aborts == 0 ) { /* case b */
        sched(dp)->no_space = 1;
        /* At this time, dp points to the dump with the smallest est_size.
@@ -1292,81 +1535,119 @@ static void
 handle_taper_result(
        void *cookie G_GNUC_UNUSED)
 {
-    disk_t *dp;
+    disk_t *dp = NULL, *dp1;
+    dumper_t *dumper;
     cmd_t cmd;
     int result_argc;
     char **result_argv;
     char *qname, *q;
     char *s;
+    taper_t *taper = NULL;
+    taper_t *taper1;
+    int      i;
+    off_t    partsize;
 
     assert(cookie == NULL);
-    amfree(taper_input_error);
-    amfree(taper_tape_error);
-    
+
     do {
-        
+
        short_dump_state();
-        
-       cmd = getresult(taper, 1, &result_argc, &result_argv);
-        
+       taper = NULL;
+
+       cmd = getresult(taper_fd, 1, &result_argc, &result_argv);
+
        switch(cmd) {
-            
+
+       case TAPER_OK:
+           if(result_argc != 2) {
+               error(_("error: [taper FAILED result_argc != 2: %d"), result_argc);
+               /*NOTREACHED*/
+           }
+
+           taper = NULL;
+           taper_started = 1;
+           for (i=0; i < conf_taper_parallel_write; i++) {
+               if (strcmp(tapetable[i].name, result_argv[1]) == 0) {
+                   taper= &tapetable[i];
+               }
+           }
+           assert(taper != NULL);
+           taper->left = 0;
+           taper->state &= ~TAPER_STATE_INIT;
+           taper->state |= TAPER_STATE_RESERVATION;
+           taper->state |= TAPER_STATE_IDLE;
+           amfree(taper->first_label);
+           taper_nb_wait_reply--;
+           taper_nb_scan_volume--;
+           last_started_taper = taper;
+           if (taper_nb_wait_reply == 0) {
+               event_release(taper_ev_read);
+               taper_ev_read = NULL;
+           }
+           start_some_dumps(&runq);
+           startaflush();
+           break;
+
        case FAILED:    /* FAILED <handle> INPUT-* TAPE-* <input err mesg> <tape err mesg> */
            if(result_argc != 6) {
                error(_("error: [taper FAILED result_argc != 6: %d"), result_argc);
                /*NOTREACHED*/
            }
-            
+
            dp = serial2disk(result_argv[1]);
-           assert(dp == taper_disk);
-           if (!taper_dumper)
+           taper = sched(dp)->taper;
+           assert(dp == taper->disk);
+           if (!taper->dumper)
                free_serial(result_argv[1]);
-            
+
            qname = quote_string(dp->name);
            g_printf(_("driver: finished-cmd time %s taper wrote %s:%s\n"),
                   walltime_str(curclock()), dp->host->hostname, qname);
            fflush(stdout);
 
            if (strcmp(result_argv[2], "INPUT-ERROR") == 0) {
-               taper_input_error = newstralloc(taper_input_error, result_argv[4]);
+               taper->input_error = newstralloc(taper->input_error, result_argv[4]);
            } else if (strcmp(result_argv[2], "INPUT-GOOD") != 0) {
-               taper_tape_error = newstralloc(taper_tape_error,
+               taper->tape_error = newstralloc(taper->tape_error,
                                               _("Taper protocol error"));
-               taper_result = FAILED;
+               taper->result = FAILED;
                log_add(L_FAIL, _("%s %s %s %d [%s]"),
                        dp->host->hostname, qname, sched(dp)->datestamp,
-                       sched(dp)->level, taper_tape_error);
+                       sched(dp)->level, taper->tape_error);
                amfree(qname);
                break;
            }
            if (strcmp(result_argv[3], "TAPE-ERROR") == 0) {
-               taper_tape_error = newstralloc(taper_tape_error, result_argv[5]);
+               taper->state &= ~TAPER_STATE_TAPE_STARTED;
+               taper->tape_error = newstralloc(taper->tape_error, result_argv[5]);
            } else if (strcmp(result_argv[3], "TAPE-GOOD") != 0) {
-               taper_tape_error = newstralloc(taper_tape_error,
+               taper->state &= ~TAPER_STATE_TAPE_STARTED;
+               taper->tape_error = newstralloc(taper->tape_error,
                                               _("Taper protocol error"));
-               taper_result = FAILED;
+               taper->result = FAILED;
                log_add(L_FAIL, _("%s %s %s %d [%s]"),
                        dp->host->hostname, qname, sched(dp)->datestamp,
-                       sched(dp)->level, taper_tape_error);
+                       sched(dp)->level, taper->tape_error);
                amfree(qname);
                break;
            }
 
            amfree(qname);
-           taper_result = cmd;
+           taper->result = cmd;
 
            break;
-            
+
        case PARTIAL:   /* PARTIAL <handle> INPUT-* TAPE-* <stat mess> <input err mesg> <tape err mesg>*/
        case DONE:      /* DONE <handle> INPUT-GOOD TAPE-GOOD <stat mess> <input err mesg> <tape err mesg> */
            if(result_argc != 7) {
                error(_("error: [taper PARTIAL result_argc != 7: %d"), result_argc);
                /*NOTREACHED*/
            }
-            
+
            dp = serial2disk(result_argv[1]);
-           assert(dp == taper_disk);
-            if (!taper_dumper)
+           taper = sched(dp)->taper;
+           assert(dp == taper->disk);
+            if (!taper->dumper)
                 free_serial(result_argv[1]);
 
            qname = quote_string(dp->name);
@@ -1375,26 +1656,28 @@ handle_taper_result(
            fflush(stdout);
 
            if (strcmp(result_argv[2], "INPUT-ERROR") == 0) {
-               taper_input_error = newstralloc(taper_input_error, result_argv[5]);
+               taper->input_error = newstralloc(taper->input_error, result_argv[5]);
            } else if (strcmp(result_argv[2], "INPUT-GOOD") != 0) {
-               taper_tape_error = newstralloc(taper_tape_error,
+               taper->tape_error = newstralloc(taper->tape_error,
                                               _("Taper protocol error"));
-               taper_result = FAILED;
+               taper->result = FAILED;
                log_add(L_FAIL, _("%s %s %s %d [%s]"),
                        dp->host->hostname, qname, sched(dp)->datestamp,
-                       sched(dp)->level, taper_tape_error);
+                       sched(dp)->level, taper->tape_error);
                amfree(qname);
                break;
            }
            if (strcmp(result_argv[3], "TAPE-ERROR") == 0) {
-               taper_tape_error = newstralloc(taper_tape_error, result_argv[6]);
+               taper->state &= ~TAPER_STATE_TAPE_STARTED;
+               taper->tape_error = newstralloc(taper->tape_error, result_argv[6]);
            } else if (strcmp(result_argv[3], "TAPE-GOOD") != 0) {
-               taper_tape_error = newstralloc(taper_tape_error,
+               taper->state &= ~TAPER_STATE_TAPE_STARTED;
+               taper->tape_error = newstralloc(taper->tape_error,
                                               _("Taper protocol error"));
-               taper_result = FAILED;
+               taper->result = FAILED;
                log_add(L_FAIL, _("%s %s %s %d [%s]"),
                        dp->host->hostname, qname, sched(dp)->datestamp,
-                       sched(dp)->level, taper_tape_error);
+                       sched(dp)->level, taper->tape_error);
                amfree(qname);
                break;
            }
@@ -1405,27 +1688,37 @@ handle_taper_result(
                sched(dp)->dumpsize = atol(s);
            }
 
-           taper_result = cmd;
+           taper->result = cmd;
            amfree(qname);
 
            break;
-            
+
         case PARTDONE:  /* PARTDONE <handle> <label> <fileno> <kbytes> <stat> */
            dp = serial2disk(result_argv[1]);
-           assert(dp == taper_disk);
+           taper = sched(dp)->taper;
+           assert(dp == taper->disk);
             if (result_argc != 6) {
                 error(_("error [taper PARTDONE result_argc != 6: %d]"),
                       result_argc);
                /*NOTREACHED*/
             }
-           if (!taper_first_label) {
-               taper_first_label = stralloc(result_argv[2]);
-               taper_first_fileno = OFF_T_ATOI(result_argv[3]);
-           }
-           taper_written = OFF_T_ATOI(result_argv[4]);
-           if (taper_written > sched(taper_disk)->act_size)
-               sched(taper_disk)->act_size = taper_written;
-            
+           if (!taper->first_label) {
+               amfree(taper->first_label);
+               taper->first_label = stralloc(result_argv[2]);
+               taper->first_fileno = OFF_T_ATOI(result_argv[3]);
+           }
+           taper->written += OFF_T_ATOI(result_argv[4]);
+           if (taper->written > sched(taper->disk)->act_size)
+               sched(taper->disk)->act_size = taper->written;
+
+           partsize = 0;
+           s = strstr(result_argv[5], " kb ");
+           if (s) {
+               s += 4;
+               partsize = atol(s);
+           }
+           taper->left -= partsize;
+
             break;
 
         case REQUEST_NEW_TAPE:  /* REQUEST-NEW-TAPE <handle> */
@@ -1434,31 +1727,14 @@ handle_taper_result(
                       result_argc);
                /*NOTREACHED*/
             }
-           taper_state &= ~TAPER_STATE_TAPE_STARTED;
 
-           if (current_tape >= conf_runtapes) {
-               char *usermsg = g_strdup_printf(_("%d tapes filled; runtapes=%d "
-                   "does not allow additional tapes"), current_tape, conf_runtapes);
-               taper_cmd(NO_NEW_TAPE, usermsg, NULL, 0, NULL);
-               g_free(usermsg);
-               log_add(L_WARNING,
-                       _("Out of tapes; going into degraded mode."));
-               start_degraded_mode(&runq);
-           } else {
-               TapeAction result_tape_action;
-               char *why_no_new_tape;
-
-               taper_state |= TAPER_STATE_WAIT_FOR_TAPE;
-               result_tape_action = tape_action(&why_no_new_tape);
-               if (result_tape_action & TAPE_ACTION_NEW_TAPE) {
-                   taper_cmd(NEW_TAPE, NULL, NULL, 0, NULL);
-                   taper_state &= ~TAPER_STATE_WAIT_FOR_TAPE;
-               } else if (result_tape_action & TAPE_ACTION_NO_NEW_TAPE) {
-                   taper_cmd(NO_NEW_TAPE, why_no_new_tape, NULL, 0, NULL);
-                   taper_state &= ~TAPER_STATE_WAIT_FOR_TAPE;
-                   start_degraded_mode(&runq);
-               }
-           }
+           dp = serial2disk(result_argv[1]);
+           taper = sched(dp)->taper;
+           taper->state &= ~TAPER_STATE_TAPE_STARTED;
+           taper->state |= TAPER_STATE_TAPE_REQUESTED;
+
+           start_some_dumps(&runq);
+           startaflush();
            break;
 
        case NEW_TAPE: /* NEW-TAPE <handle> <label> */
@@ -1468,10 +1744,34 @@ handle_taper_result(
                /*NOTREACHED*/
             }
 
-            /* Update our tape counter and reset tape_left */
+           nb_sent_new_tape--;
+           taper_nb_scan_volume--;
+           dp = serial2disk(result_argv[1]);
+           taper = sched(dp)->taper;
+            /* Update our tape counter and reset taper->left */
            current_tape++;
-           tape_left = tape_length;
-           taper_state |= TAPER_STATE_TAPE_STARTED;
+           taper->left = tape_length;
+           taper->state &= ~TAPER_STATE_WAIT_NEW_TAPE;
+           taper->state |= TAPER_STATE_TAPE_STARTED;
+           last_started_taper = NULL;
+
+           /* start a new worker */
+           for (i = 0; i < conf_taper_parallel_write ; i++) {
+               taper1 = &tapetable[i];
+               if (need_degraded == 0 &&
+                   taper1->state == TAPER_STATE_DEFAULT) {
+                   taper1->state = TAPER_STATE_INIT;
+                   if (taper_nb_wait_reply == 0) {
+                       taper_ev_read = event_register(taper_fd, EV_READFD,
+                                               handle_taper_result, NULL);
+                   }
+                   taper_nb_wait_reply++;
+                   taper_nb_scan_volume++;
+                   taper_cmd(START_TAPER, NULL, taper1->name, 0,
+                             driver_timestamp);
+                   break;
+               }
+           }
            break;
 
        case NO_NEW_TAPE:  /* NO-NEW-TAPE <handle> */
@@ -1480,6 +1780,12 @@ handle_taper_result(
                       result_argc);
                /*NOTREACHED*/
             }
+           nb_sent_new_tape--;
+           taper_nb_scan_volume--;
+           dp = serial2disk(result_argv[1]);
+           taper = sched(dp)->taper;
+           taper->state |= TAPER_STATE_DONE;
+           last_started_taper = NULL;
            start_degraded_mode(&runq);
            break;
 
@@ -1490,10 +1796,11 @@ handle_taper_result(
                /*NOTREACHED*/
             }
             dp = serial2disk(result_argv[1]);
-           if (taper_dumper->result == LAST_TOK) {
-               taper_sendresult = 1;
+           taper = sched(dp)->taper;
+           if (taper->dumper->result == LAST_TOK) {
+               taper->sendresult = 1;
            } else {
-               if( taper_dumper->result == DONE) {
+               if( taper->dumper->result == DONE) {
                    taper_cmd(DONE, dp, NULL, 0, NULL);
                } else {
                    taper_cmd(FAILED, dp, NULL, 0, NULL);
@@ -1501,26 +1808,74 @@ handle_taper_result(
            }
            break;
 
-        case TAPE_ERROR: /* TAPE-ERROR <handle> <err mess> */
-            dp = serial2disk(result_argv[1]);
-           if (!taper_dumper)
-               free_serial(result_argv[1]);
-           qname = quote_string(dp->name);
-            g_printf(_("driver: finished-cmd time %s taper wrote %s:%s\n"),
-                   walltime_str(curclock()), dp->host->hostname, qname);
-           amfree(qname);
-            fflush(stdout);
-           q = quote_string(result_argv[2]);
-            log_add(L_WARNING, _("Taper error: %s"), q);
-           amfree(q);
-           taper_tape_error = newstralloc(taper_tape_error, result_argv[2]);
-            /*FALLTHROUGH*/
+        case TAPE_ERROR: /* TAPE-ERROR <name> <err mess> */
+           taper_started = 1;
+           if (strcmp(result_argv[1], "SETUP") == 0) {
+               taper_nb_wait_reply = 0;
+               taper_nb_scan_volume = 0;
+           } else {
+               taper = taper_from_name(result_argv[1]);
+               taper->state = TAPER_STATE_DONE;
+               fflush(stdout);
+               q = quote_string(result_argv[2]);
+               log_add(L_WARNING, _("Taper error: %s"), q);
+               amfree(q);
+               if (taper) {
+                   taper->tape_error = newstralloc(taper->tape_error,
+                                                   result_argv[2]);
+               }
+
+               taper_nb_wait_reply--;
+               taper_nb_scan_volume--;
+           }
+           if (taper_nb_wait_reply == 0) {
+               event_release(taper_ev_read);
+               taper_ev_read = NULL;
+           }
+           need_degraded = 1;
+           if (schedule_done && !degraded_mode) {
+               start_degraded_mode(&runq);
+           }
+           start_some_dumps(&runq);
+           break;
+
+       case PORT: /* PORT <name> <handle> <port> <dataport_list> */
+            dp = serial2disk(result_argv[2]);
+           taper = sched(dp)->taper;
+           dumper = sched(dp)->dumper;
+           dumper->output_port = atoi(result_argv[3]);
+           amfree(dp->dataport_list);
+           dp->dataport_list = stralloc(result_argv[4]);
+
+           amfree(taper->input_error);
+           amfree(taper->tape_error);
+           amfree(taper->first_label);
+           taper->written = 0;
+           taper->state |= TAPER_STATE_DUMP_TO_TAPE;
+
+           if (dp->host->pre_script == 0) {
+               for (dp1=dp->host->disks; dp1 != NULL; dp1 = dp1->hostnext) {
+                   run_server_scripts(EXECUTE_ON_PRE_HOST_BACKUP,
+                                      get_config_name(), dp1, -1);
+               }
+               dp->host->pre_script = 1;
+           }
+           run_server_scripts(EXECUTE_ON_PRE_DLE_BACKUP,
+                              get_config_name(), dp,
+                              sched(dp)->level);
+           /* tell the dumper to dump to a port */
+           dumper_cmd(dumper, PORT_DUMP, dp, NULL);
+           dp->host->start_t = time(NULL) + 15;
+           amfree(dp->dataport_list);
+
+           taper->state |= TAPER_STATE_DUMP_TO_TAPE;
+
+           dumper->ev_read = event_register(dumper->fd, EV_READFD,
+                                            handle_dumper_result, dumper);
+           break;
 
         case BOGUS:
-            if (cmd == BOGUS) {
-               log_add(L_WARNING, _("Taper protocol error"));
-               taper_tape_error = newstralloc(taper_tape_error, "BOGUS");
-            }
+            log_add(L_WARNING, _("Taper protocol error"));
             /*
              * Since we received a taper error, we can't send anything more
              * to the taper.  Go into degraded mode to try to get everthing
@@ -1533,15 +1888,34 @@ handle_taper_result(
                 log_add(L_WARNING,
                         _("going into degraded mode because of taper component error."));
            }
-           start_degraded_mode(&runq);
-            tapeq.head = tapeq.tail = NULL;
-            taper_busy = 0;
+
+           for (taper = tapetable;
+                taper < tapetable + conf_taper_parallel_write;
+                 taper++) {
+               if (taper && taper->disk && taper->result != LAST_TOK) {
+                   taper->tape_error = newstralloc(taper->tape_error,"BOGUS");
+                   taper->result = cmd;
+                   if (taper->dumper) {
+                       if (taper->dumper->result != LAST_TOK) {
+                           // Dumper already returned it's result
+                           dumper_taper_result(taper->disk);
+                       }
+                   } else {
+                       file_taper_result(taper->disk);
+                   }
+               }
+
+           }
+           taper = NULL;
+
             if(taper_ev_read != NULL) {
                 event_release(taper_ev_read);
                 taper_ev_read = NULL;
+               taper_nb_wait_reply = 0;
             }
-            if(cmd != TAPE_ERROR) aclose(taper);
-           taper_result = cmd;
+           start_degraded_mode(&runq);
+            tapeq.head = tapeq.tail = NULL;
+            aclose(taper_fd);
 
             break;
 
@@ -1553,18 +1927,19 @@ handle_taper_result(
 
        g_strfreev(result_argv);
 
-       if (taper_result != LAST_TOK) {
-           if(taper_dumper) {
-               if (taper_dumper->result != LAST_TOK) {
+       if (taper && taper->disk && taper->result != LAST_TOK) {
+           if(taper->dumper) {
+               if (taper->dumper->result != LAST_TOK) {
                    // Dumper already returned it's result
-                   dumper_taper_result(taper_disk);
+                   dumper_taper_result(taper->disk);
                }
            } else {
-               file_taper_result(taper_disk);
+               file_taper_result(taper->disk);
            }
        }
-        
-    } while(areads_dataready(taper));
+
+    } while(areads_dataready(taper_fd));
+    startaflush();
 }
 
 
@@ -1572,23 +1947,25 @@ static void
 file_taper_result(
     disk_t *dp)
 {
+    taper_t *taper;
     char *qname = quote_string(dp->name);
 
-    if (taper_result == DONE) {
-       update_info_taper(dp, taper_first_label, taper_first_fileno,
+    taper = sched(dp)->taper;
+    if (taper->result == DONE) {
+       update_info_taper(dp, taper->first_label, taper->first_fileno,
                          sched(dp)->level);
     }
 
     sched(dp)->taper_attempted += 1;
 
-    if (taper_input_error) {
+    if (taper->input_error) {
        g_printf("driver: taper failed %s %s: %s\n",
-                  dp->host->hostname, qname, taper_input_error);
+                  dp->host->hostname, qname, taper->input_error);
        if (strcmp(sched(dp)->datestamp, driver_timestamp) == 0) {
            if(sched(dp)->taper_attempted >= 2) {
                log_add(L_FAIL, _("%s %s %s %d [too many taper retries after holding disk error: %s]"),
                    dp->host->hostname, qname, sched(dp)->datestamp,
-                   sched(dp)->level, taper_input_error);
+                   sched(dp)->level, taper->input_error);
                g_printf("driver: taper failed %s %s, too many taper retry after holding disk error\n",
                   dp->host->hostname, qname);
                amfree(sched(dp)->destname);
@@ -1600,7 +1977,7 @@ file_taper_result(
            } else {
                log_add(L_INFO, _("%s %s %s %d [Will retry dump because of holding disk error: %s]"),
                        dp->host->hostname, qname, sched(dp)->datestamp,
-                       sched(dp)->level, taper_input_error);
+                       sched(dp)->level, taper->input_error);
                g_printf("driver: taper will retry %s %s because of holding disk error\n",
                        dp->host->hostname, qname);
                if (dp->to_holdingdisk != HOLD_REQUIRED) {
@@ -1624,9 +2001,9 @@ file_taper_result(
            amfree(sched(dp)->datestamp);
            amfree(dp->up);
        }
-    } else if (taper_tape_error) {
+    } else if (taper->tape_error) {
        g_printf("driver: taper failed %s %s with tape error: %s\n",
-                  dp->host->hostname, qname, taper_tape_error);
+                  dp->host->hostname, qname, taper->tape_error);
        if(sched(dp)->taper_attempted >= 2) {
            log_add(L_FAIL, _("%s %s %s %d [too many taper retries]"),
                    dp->host->hostname, qname, sched(dp)->datestamp,
@@ -1645,7 +2022,7 @@ file_taper_result(
            /* Re-insert into taper queue. */
            headqueue_disk(&tapeq, dp);
        }
-    } else if (taper_result != DONE) {
+    } else if (taper->result != DONE) {
        g_printf("driver: taper failed %s %s without error\n",
                   dp->host->hostname, qname);
     } else {
@@ -1660,11 +2037,17 @@ file_taper_result(
 
     amfree(qname);
 
-    taper_busy = 0;
-    amfree(taper_input_error);
-    amfree(taper_tape_error);
-    taper_disk = NULL;
-            
+    taper->state &= ~TAPER_STATE_FILE_TO_TAPE;
+    taper->state |= TAPER_STATE_IDLE;
+    amfree(taper->input_error);
+    amfree(taper->tape_error);
+    taper->disk = NULL;
+    taper_nb_wait_reply--;
+    if (taper_nb_wait_reply == 0) {
+       event_release(taper_ev_read);
+       taper_ev_read = NULL;
+    }
+
     /* continue with those dumps waiting for diskspace */
     continue_port_dumps();
     start_some_dumps(&runq);
@@ -1676,16 +2059,18 @@ dumper_taper_result(
     disk_t *dp)
 {
     dumper_t *dumper;
+    taper_t  *taper;
     int is_partial;
     char *qname;
 
     dumper = sched(dp)->dumper;
+    taper  = sched(dp)->taper;
 
     free_serial_dp(dp);
-    if(dumper->result == DONE && taper_result == DONE) {
+    if(dumper->result == DONE && taper->result == DONE) {
        update_info_dumper(dp, sched(dp)->origsize,
                           sched(dp)->dumpsize, sched(dp)->dumptime);
-       update_info_taper(dp, taper_first_label, taper_first_fileno,
+       update_info_taper(dp, taper->first_label, taper->first_fileno,
                          sched(dp)->level);
        qname = quote_string(dp->name); /*quote to take care of spaces*/
 
@@ -1700,12 +2085,12 @@ dumper_taper_result(
        update_failed_dump(dp);
     }
 
-    is_partial = dumper->result != DONE || taper_result != DONE;
+    is_partial = dumper->result != DONE || taper->result != DONE;
 
     sched(dp)->dump_attempted += 1;
     sched(dp)->taper_attempted += 1;
 
-    if((dumper->result != DONE || taper_result != DONE) &&
+    if((dumper->result != DONE || taper->result != DONE) &&
        sched(dp)->dump_attempted <= 1 &&
        sched(dp)->taper_attempted <= 1) {
        enqueue_disk(&directq, dp);
@@ -1715,27 +2100,62 @@ dumper_taper_result(
        event_release(dumper->ev_read);
        dumper->ev_read = NULL;
     }
-    if(taper_ev_read != NULL) {
+    taper_nb_wait_reply--;
+    if (taper_nb_wait_reply == 0 && taper_ev_read != NULL) {
        event_release(taper_ev_read);
        taper_ev_read = NULL;
     }
-    taper_busy = 0;
-    amfree(taper_input_error);
-    amfree(taper_tape_error);
+    taper->state &= ~TAPER_STATE_DUMP_TO_TAPE;
+    taper->state |= TAPER_STATE_IDLE;
+    amfree(taper->input_error);
+    amfree(taper->tape_error);
     dumper->busy = 0;
     dp->host->inprogress -= 1;
     dp->inprogress = 0;
     deallocate_bandwidth(dp->host->netif, sched(dp)->est_kps);
+    taper->dumper = NULL;
+    sched(dp)->dumper = NULL;
+    sched(dp)->taper = NULL;
+    start_some_dumps(&runq);
 }
 
 
-static dumper_t *
-idle_dumper(void)
+static taper_t *
+idle_taper(void)
 {
-    dumper_t *dumper;
+    taper_t *taper;
+
+    /* Use an already started taper first */
+    for (taper = tapetable; taper < tapetable + conf_taper_parallel_write;
+                           taper++) {
+       if ((taper->state & TAPER_STATE_IDLE) &&
+           (taper->state & TAPER_STATE_TAPE_STARTED) &&
+           !(taper->state & TAPER_STATE_DONE) &&
+           !(taper->state & TAPER_STATE_FILE_TO_TAPE) &&
+           !(taper->state & TAPER_STATE_FILE_TO_TAPE))
+           return taper;
+    }
+    for (taper = tapetable; taper < tapetable + conf_taper_parallel_write;
+                           taper++) {
+       if ((taper->state & TAPER_STATE_IDLE) &&
+           (taper->state & TAPER_STATE_RESERVATION) &&
+           !(taper->state & TAPER_STATE_DONE) &&
+           !(taper->state & TAPER_STATE_FILE_TO_TAPE) &&
+           !(taper->state & TAPER_STATE_FILE_TO_TAPE))
+           return taper;
+    }
+    return NULL;
+}
+
+static taper_t *
+taper_from_name(
+    char *name)
+{
+    taper_t *taper;
 
-    for(dumper = dmptable; dumper < dmptable+inparallel; dumper++)
-       if(!dumper->busy && !dumper->down) return dumper;
+    for (taper = tapetable; taper < tapetable+conf_taper_parallel_write;
+                           taper++)
+       if (strcmp(taper->name, name) == 0) return taper;
 
     return NULL;
 }
@@ -1819,7 +2239,7 @@ dumper_chunker_result(
     aclose(chunker->fd);
     chunker->fd = -1;
     chunker->down = 1;
-    
+
     dp = NULL;
     if (chunker->result == ABORT_FINISHED)
        pending_aborts--;
@@ -1839,6 +2259,7 @@ handle_dumper_result(
 {
     /* uses global pending_aborts */
     dumper_t *dumper = cookie;
+    taper_t  *taper;
     disk_t *dp, *sdp, *dp1;
     cmd_t cmd;
     int result_argc;
@@ -1983,6 +2404,7 @@ handle_dumper_result(
            }
        }
 
+       taper = sched(dp)->taper;
        /* send the dumper result to the chunker */
        if (dumper->chunker) {
            if (dumper->chunker->down == 0 && dumper->chunker->fd != -1 &&
@@ -1998,17 +2420,17 @@ handle_dumper_result(
                dumper->chunker->result != LAST_TOK)
                dumper_chunker_result(dp);
        } else { /* send the dumper result to the taper */
-           if (taper_sendresult) {
+           if (taper->sendresult) {
                if (cmd == DONE) {
                    taper_cmd(DONE, dp, NULL, 0, NULL);
                } else {
                    taper_cmd(FAILED, dp, NULL, 0, NULL);
                }
-               taper_sendresult = 0;
+               taper->sendresult = 0;
+           }
+           if (taper->dumper && taper->result != LAST_TOK) {
+               dumper_taper_result(dp);
            }
-       }
-       if (taper_dumper && taper_result != LAST_TOK) {
-           dumper_taper_result(dp);
        }
     } while(areads_dataready(dumper->fd));
 }
@@ -2200,8 +2622,9 @@ handle_chunker_result(
 }
 
 
-static disklist_t
-read_flush(void)
+static void
+read_flush(
+    void *     cookie)
 {
     sched_t *sp;
     disk_t *dp;
@@ -2214,18 +2637,22 @@ read_flush(void)
     char *command;
     char *s;
     int ch;
-    disklist_t tq;
     char *qname = NULL;
     char *qdestname = NULL;
     char *conf_infofile;
 
-    tq.head = tq.tail = NULL;
+    (void)cookie;      /* Quiet unused parameter warning */
+
+    event_release(flush_ev_read);
+    flush_ev_read = NULL;
 
+    /* read schedule from stdin */
     conf_infofile = config_dir_relative(getconf_str(CNF_INFOFILE));
     if (open_infofile(conf_infofile)) {
        error(_("could not open info db \"%s\""), conf_infofile);
        /*NOTREACHED*/
     }
+    amfree(conf_infofile);
 
     for(line = 0; (inpline = agets(stdin)) != NULL; free(inpline)) {
        dumpfile_t file;
@@ -2383,17 +2810,22 @@ read_flush(void)
        sp->holdp = build_diskspace(destname);
        if(sp->holdp == NULL) continue;
        sp->dumper = NULL;
+       sp->taper = NULL;
        sp->timestamp = (time_t)0;
 
        dp1->up = (char *)sp;
 
-       enqueue_disk(&tq, dp1);
+       enqueue_disk(&tapeq, dp1);
        dumpfile_free_data(&file);
     }
     amfree(inpline);
     close_infofile();
 
-    /*@i@*/ return tq;
+    startaflush();
+    if (!nodump) {
+       schedule_ev_read = event_register((event_id_t)0, EV_READFD,
+                                         read_schedule, NULL);
+    }
 }
 
 static void
@@ -2426,6 +2858,7 @@ read_schedule(
     (void)cookie;      /* Quiet unused parameter warning */
 
     event_release(schedule_ev_read);
+    schedule_ev_read = NULL;
 
     /* read schedule from stdin */
 
@@ -2655,6 +3088,7 @@ read_schedule(
        sp->holdp = NULL;
        sp->activehd = -1;
        sp->dumper = NULL;
+       sp->taper = NULL;
        sp->timestamp = (time_t)0;
        sp->destname = NULL;
        sp->no_space = 0;
@@ -2685,7 +3119,6 @@ read_schedule(
 
            if (dp->data_path == DATA_PATH_DIRECTTCP &&
                dp->to_holdingdisk == HOLD_AUTO) {
-               /* planner already logged a warning. */
                dp->to_holdingdisk = HOLD_NEVER;
            }
 
@@ -3171,102 +3604,6 @@ update_failed_dump(
 }
 
 /* ------------------- */
-static void
-dump_to_tape(
-    disk_t *   dp)
-{
-    dumper_t *dumper;
-    cmd_t cmd;
-    int result_argc;
-    char **result_argv;
-    char *qname;
-    disk_t *dp1;
-
-    qname = quote_string(dp->name);
-    g_printf(_("driver: dumping %s:%s directly to tape\n"),
-          dp->host->hostname, qname);
-    fflush(stdout);
-
-    /* pick a dumper and fail if there are no idle dumpers */
-
-    dumper = idle_dumper();
-    if (!dumper) {
-       g_printf(_("driver: no idle dumpers for %s:%s.\n"), 
-               dp->host->hostname, qname);
-       fflush(stdout);
-       log_add(L_WARNING, _("no idle dumpers for %s:%s.\n"),
-               dp->host->hostname, qname);
-        amfree(qname);
-       return; /* fatal problem */
-    }
-
-    /* tell the taper to read from a port number of its choice */
-
-    taper_cmd(PORT_WRITE, dp, NULL, sched(dp)->level, sched(dp)->datestamp);
-    cmd = getresult(taper, 1, &result_argc, &result_argv);
-    if (cmd != PORT) {
-       g_printf(_("driver: did not get PORT from taper for %s:%s\n"),
-               dp->host->hostname, qname);
-       fflush(stdout);
-       log_add(L_WARNING, _("driver: did not get PORT from taper for %s:%s.\n"),
-               dp->host->hostname, qname);
-        amfree(qname);
-       return; /* fatal problem */
-    }
-    amfree(qname);
-
-    /* copy port number */
-    dumper->output_port = atoi(result_argv[1]);
-    amfree(dp->dataport_list);
-    dp->dataport_list = stralloc(result_argv[2]);
-
-    dumper->dp = dp;
-    dumper->chunker = NULL;
-    dumper->result = LAST_TOK;
-    taper_result = LAST_TOK;
-    sched(dp)->dumper = dumper;
-
-    if (dp->host->pre_script == 0) {
-       for (dp1=dp->host->disks; dp1 != NULL; dp1 = dp1->hostnext) {
-           run_server_scripts(EXECUTE_ON_PRE_HOST_BACKUP,
-                              get_config_name(), dp1, -1);
-       }
-       dp->host->pre_script = 1;
-    }
-    run_server_scripts(EXECUTE_ON_PRE_DLE_BACKUP, get_config_name(), dp,
-                      sched(dp)->level);
-
-    /* tell the dumper to dump to a port */
-    dumper_cmd(dumper, PORT_DUMP, dp, NULL);
-    dp->host->start_t = time(NULL) + 15;
-    amfree(dp->dataport_list);
-
-    /* update statistics & print state */
-
-    taper_busy = dumper->busy = 1;
-    taper_input_error = NULL;
-    taper_tape_error = NULL;
-    taper_dumper = dumper;
-    taper_disk = dp;
-    taper_first_label = NULL;
-    taper_written = 0;
-    taper_state |= TAPER_STATE_DUMP_TO_TAPE;
-    sched(dp)->act_size = sched(dp)->est_size;
-    dp->host->inprogress += 1;
-    dp->inprogress = 1;
-    sched(dp)->timestamp = time((time_t *)0);
-    allocate_bandwidth(dp->host->netif, sched(dp)->est_kps);
-    idle_reason = NOT_IDLE;
-
-    short_dump_state();
-
-    dumper->ev_read = event_register(dumper->fd, EV_READFD,
-                                    handle_dumper_result, dumper);
-    taper_ev_read = event_register(taper, EV_READFD,
-                                  handle_taper_result, NULL);
-
-    g_strfreev(result_argv);
-}
 
 static int
 queue_length(
@@ -3293,8 +3630,20 @@ short_dump_state(void)
           free_kps(NULL),
           (long long)free_space());
     if(degraded_mode) g_printf(_("DOWN"));
-    else if(!taper_busy) g_printf(_("idle"));
-    else g_printf(_("writing"));
+    else {
+       taper_t *taper;
+       int writing = 0;
+       for(taper = tapetable; taper < tapetable+conf_taper_parallel_write;
+                              taper++) {
+           if (taper->state & TAPER_STATE_DUMP_TO_TAPE ||
+               taper->state & TAPER_STATE_FILE_TO_TAPE)
+               writing = 1;
+       }
+       if(writing)
+           g_printf(_("writing"));
+       else
+           g_printf(_("idle"));
+    }
     nidle = 0;
     for(i = 0; i < inparallel; i++) if(!dmptable[i].busy) nidle++;
     g_printf(_(" idle-dumpers: %d"), nidle);
@@ -3308,10 +3657,14 @@ short_dump_state(void)
     fflush(stdout);
 }
 
-static TapeAction tape_action(char **why_no_new_tape)
+static TapeAction
+tape_action(
+    taper_t  *taper,
+    char    **why_no_new_tape)
 {
     TapeAction result = TAPE_ACTION_NO_ACTION;
     dumper_t *dumper;
+    taper_t  *taper1;
     disk_t   *dp;
     off_t dumpers_size;
     off_t runq_size;
@@ -3320,10 +3673,15 @@ static TapeAction tape_action(char **why_no_new_tape)
     off_t sched_size;
     off_t dump_to_disk_size;
     int   dump_to_disk_terminated;
+    off_t my_flush_threshold_dumped;
+    off_t my_flush_threshold_scheduled;
+    off_t my_taperflush;
+    int   nb_taper_active = nb_sent_new_tape;
+    int   nb_taper_flushing = 0;
 
     dumpers_size = 0;
     for(dumper = dmptable; dumper < (dmptable+inparallel); dumper++) {
-       if (dumper->busy)
+       if (dumper->busy && !sched(dumper->dp)->taper)
            dumpers_size += sched(dumper->dp)->est_size;
     }
     driver_debug(1, _("dumpers_size: %lld\n"), (long long)dumpers_size);
@@ -3340,67 +3698,150 @@ static TapeAction tape_action(char **why_no_new_tape)
     }
     driver_debug(1, _("directq_size: %lld\n"), (long long)directq_size);
 
-    tapeq_size = 0;
+    tapeq_size = directq_size;
     for(dp = tapeq.head; dp != NULL; dp = dp->next) {
        tapeq_size += sched(dp)->act_size;
     }
-    if (taper_disk) {
-       tapeq_size += sched(taper_disk)->act_size - taper_written;
+
+    for (taper1 = tapetable; taper1 < tapetable+conf_taper_parallel_write;
+        taper1++) {
+       if (taper1->state & TAPER_STATE_FILE_TO_TAPE ||
+           taper1->state & TAPER_STATE_DUMP_TO_TAPE) {
+           nb_taper_flushing++;
+       }
+    }
+
+    /* Add what is currently written to tape and in the go. */
+    for (taper1 = tapetable; taper1 < tapetable+conf_taper_parallel_write;
+        taper1++) {
+       if (taper1->state & TAPER_STATE_TAPE_STARTED) {
+           tapeq_size -= taper1->left;
+       }
+       if (taper1->disk) {
+           if (taper1->dumper) {
+               tapeq_size += sched(taper1->disk)->est_size - taper1->written;
+           } else {
+               tapeq_size += sched(taper1->disk)->act_size - taper1->written;
+           }
+       }
     }
     driver_debug(1, _("tapeq_size: %lld\n"), (long long)tapeq_size);
 
-    sched_size = runq_size + tapeq_size + dumpers_size;
+    sched_size = runq_size + directq_size + tapeq_size + dumpers_size;
     driver_debug(1, _("sched_size: %lld\n"), (long long)sched_size);
 
-    dump_to_disk_size = dumpers_size + runq_size;
+    dump_to_disk_size = dumpers_size + runq_size + directq_size;
     driver_debug(1, _("dump_to_disk_size: %lld\n"), (long long)dump_to_disk_size);
 
     dump_to_disk_terminated = schedule_done && dump_to_disk_size == 0;
 
+    for (taper1 = tapetable; taper1 < tapetable + conf_taper_parallel_write;
+                            taper1++) {
+       if (taper1->state & TAPER_STATE_TAPE_STARTED) {
+           nb_taper_active++;
+       }
+    }
+    if (nb_taper_active >= 1) {
+    my_flush_threshold_dumped = flush_threshold_dumped +
+                               (nb_taper_active-nb_taper_active) * tape_length;
+    my_flush_threshold_scheduled = flush_threshold_scheduled +
+                                  (nb_taper_active-nb_taper_active) * tape_length;
+    my_taperflush = taperflush + (nb_taper_active-nb_taper_active) * tape_length;
+    } else {
+    my_flush_threshold_dumped = flush_threshold_dumped +
+                               nb_taper_active * tape_length;
+    my_flush_threshold_scheduled = flush_threshold_scheduled +
+                                  nb_taper_active * tape_length;
+    my_taperflush = taperflush + nb_taper_active * tape_length;
+    }
+
     // Changing conditionals can produce a driver hang, take care.
     // 
     // when to start writting to a new tape
-    if ((taper_state & TAPER_STATE_WAIT_FOR_TAPE) &&
-        ((taper_state & TAPER_STATE_DUMP_TO_TAPE) ||   // for dump to tape
+    if (taper->state & TAPER_STATE_TAPE_REQUESTED) {
+       if (current_tape >= conf_runtapes && taper_nb_scan_volume == 0 &&
+           nb_taper_active == 0) {
+           *why_no_new_tape = g_strdup_printf(_("%d tapes filled; runtapes=%d "
+               "does not allow additional tapes"), current_tape, conf_runtapes);
+           result |= TAPE_ACTION_NO_NEW_TAPE;
+       } else if (current_tape < conf_runtapes &&
+                  taper_nb_scan_volume == 0 &&
+                  ((my_flush_threshold_dumped < tapeq_size &&
+                    my_flush_threshold_scheduled < sched_size) ||
+                   nb_taper_active == 0) &&
+                  (last_started_taper == NULL ||
+                   last_started_taper == taper)) {
+           result |= TAPE_ACTION_SCAN;
+       } else {
+           result |= TAPE_ACTION_MOVE;
+       }
+    } else if ((taper->state & TAPER_STATE_WAIT_FOR_TAPE) &&
+        ((taper->state & TAPER_STATE_DUMP_TO_TAPE) ||  // for dump to tape
         !empty(directq) ||                             // if a dle is waiting for a dump to tape
          !empty(roomq) ||                              // holding disk constraint
          idle_reason == IDLE_NO_DISKSPACE ||           // holding disk constraint
-         (flush_threshold_dumped < tapeq_size &&       // flush-threshold-dumped &&
-         flush_threshold_scheduled < sched_size) ||    //  flush-threshold-scheduled
-        (taperflush < tapeq_size &&                    // taperflush
+         (my_flush_threshold_dumped < tapeq_size &&    // flush-threshold-dumped &&
+         my_flush_threshold_scheduled < sched_size) || //  flush-threshold-scheduled
+        (my_taperflush < tapeq_size &&                 // taperflush
          (force_flush == 1 ||                          //  if force_flush
           dump_to_disk_terminated))                    //  or all dump to disk terminated
        )) {
        result |= TAPE_ACTION_NEW_TAPE;
     // when to stop using new tape
-    } else if ((taper_state & TAPER_STATE_WAIT_FOR_TAPE) &&
-              (taperflush >= tapeq_size &&             // taperflush criteria not meet
-               (force_flush == 1 ||                    //  if force_flush
-                dump_to_disk_terminated))              //  or all dump to disk terminated
+    } else if ((taper->state & TAPER_STATE_WAIT_FOR_TAPE) &&
+              (my_taperflush >= tapeq_size &&          // taperflush criteria
+              (force_flush == 1 ||                     //  if force_flush
+               dump_to_disk_terminated))               //  or all dump to disk
              ) {
-       result |= TAPE_ACTION_NO_NEW_TAPE;
-       *why_no_new_tape = _("taperflush criteria not met");
+       if (nb_taper_active <= 0) {
+           if (current_tape >= conf_runtapes) {
+               *why_no_new_tape = g_strdup_printf(_("%d tapes filled; runtapes=%d "
+                     "does not allow additional tapes"), current_tape, conf_runtapes);
+           } else {
+               *why_no_new_tape = _("taperflush criteria not met");
+           }
+           result |= TAPE_ACTION_NO_NEW_TAPE;
+       }
     }
 
     // when to start a flush
     // We don't start a flush if taper_tape_started == 1 && dump_to_disk_terminated && force_flush == 0,
     // it is a criteria need to exit the first event_loop without flushing everything to tape,
     // they will be flush in another event_loop.
-    if (!degraded_mode && !taper_busy && !empty(tapeq) &&
-       (!((taper_state & TAPER_STATE_TAPE_STARTED) &&
-           dump_to_disk_terminated && force_flush == 0) ||     // if tape already started and dump to disk not terminated
-         ((taper_state & TAPER_STATE_TAPE_STARTED) &&
-         force_flush == 1) ||                                  // if tape already started and force_flush
-         !empty(roomq) ||                                      // holding disk constraint
-         idle_reason == IDLE_NO_DISKSPACE ||                   // holding disk constraint
-         (flush_threshold_dumped < tapeq_size &&               // flush-threshold-dumped &&
-        flush_threshold_scheduled < sched_size) ||             //  flush-threshold-scheduled
-         (force_flush == 1 && taperflush < tapeq_size))) {     // taperflush if force_flush
-       result |= TAPE_ACTION_START_A_FLUSH;
+    if (taper->state & TAPER_STATE_IDLE) {
+       if (!degraded_mode && (!empty(tapeq) || !empty(directq)) &&
+           (((taper->state & TAPER_STATE_TAPE_STARTED) &&
+             force_flush == 1) ||                              // if tape already started and force_flush
+             !empty(roomq) ||                                  // holding disk constraint
+             idle_reason == IDLE_NO_DISKSPACE ||               // holding disk constraint
+             (my_flush_threshold_dumped < tapeq_size &&                // flush-threshold-dumped &&
+             my_flush_threshold_scheduled < sched_size) ||     //  flush-threshold-scheduled
+             (force_flush == 1 && my_taperflush < tapeq_size))) {      // taperflush if force_flush
+
+           if (nb_taper_flushing == 0) {
+               result |= TAPE_ACTION_START_A_FLUSH;
+           } else {
+               result |= TAPE_ACTION_START_A_FLUSH_FIT;
+           }
+       }
     }
     return result;
 }
 
+static int
+all_taper_idle(void)
+{
+    taper_t *taper;
+
+    for (taper = tapetable; taper < tapetable + conf_taper_parallel_write;
+        taper++) {
+       if (taper->state & TAPER_STATE_DUMP_TO_TAPE ||
+           taper->state & TAPER_STATE_FILE_TO_TAPE)
+           return 0;
+    }
+    return 1;
+}
+
 #if 0
 static void
 dump_state(
@@ -3416,11 +3857,11 @@ dump_state(
           free_kps(NULL),
           (long long)free_space());
     if(degraded_mode) g_printf(_("taper: DOWN\n"));
-    else if(!taper_busy) g_printf(_("taper: idle\n"));
+    else if(taper->status == TAPER_IDLE) g_printf(_("taper: idle\n"));
     else g_printf(_("taper: writing %s:%s.%d est size %lld\n"),
-               taper_disk->host->hostname, taper_disk->name,
-               sched(taper_disk)->level,
-               (long long)sched(taper_disk)->est_size);
+               taper->disk->host->hostname, taper->disk->name,
+               sched(taper->disk)->level,
+               (long long)sched(taper->disk)->est_size);
     for(i = 0; i < inparallel; i++) {
        dp = dmptable[i].dp;
        if(!dmptable[i].busy)
index 049eaea942ad308b89e54e5909eeb332c9a3ed6b..ea08d31e0ab0e8e68ab1141595ea6b1b2349f0a6 100644 (file)
@@ -51,7 +51,7 @@ init_driverio(void)
 {
     dumper_t *dumper;
 
-    taper = -1;
+    taper_fd = -1;
 
     for(dumper = dmptable; dumper < dmptable + MAX_DUMPERS; dumper++) {
        dumper->fd = -1;
@@ -66,7 +66,7 @@ childstr(
     static char buf[NUM_STR_SIZE + 32];
     dumper_t *dumper;
 
-    if (fd == taper)
+    if (fd == taper_fd)
        return ("taper");
 
     for (dumper = dmptable; dumper < dmptable + MAX_DUMPERS; dumper++) {
@@ -82,10 +82,42 @@ childstr(
 
 void
 startup_tape_process(
-    char *taper_program)
+    char *taper_program,
+    int   taper_parallel_write,
+    gboolean no_taper)
 {
-    int    fd[2];
-    char **config_options;
+    int       fd[2];
+    int       i;
+    char    **config_options;
+    taper_t  *taper;
+
+    /* always allocate the tapetable */
+    tapetable = calloc(sizeof(taper_t), taper_parallel_write+1);
+
+    for (taper = tapetable, i = 0; i < taper_parallel_write; taper++, i++) {
+       taper->name = g_strdup_printf("worker%d", i);
+       taper->sendresult = 0;
+       taper->input_error = NULL;
+       taper->tape_error = NULL;
+       taper->result = 0;
+       taper->dumper = NULL;
+       taper->disk = NULL;
+       taper->first_label = NULL;
+       taper->first_fileno = 0;
+       taper->state = TAPER_STATE_DEFAULT;
+       taper->left = 0;
+       taper->written = 0;
+
+       /* jump right to degraded mode if there's no taper */
+       if (no_taper) {
+           taper->tape_error = g_strdup("no taper started (--no-taper)");
+           taper->result = BOGUS;
+       }
+    }
+
+    /* don't start the taper if we're not supposed to */
+    if (no_taper)
+       return;
 
     if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd) == -1) {
        error(_("taper pipe: %s"), strerror(errno));
@@ -121,7 +153,7 @@ startup_tape_process(
 
     default:   /* parent process */
        aclose(fd[1]);
-       taper = fd[0];
+       taper_fd = fd[0];
        taper_ev_read = NULL;
     }
 }
@@ -248,8 +280,7 @@ getresult(
 
     if((line = areads(fd)) == NULL) {
        if(errno) {
-           error(_("reading result from %s: %s"), childstr(fd), strerror(errno));
-           /*NOTREACHED*/
+           g_fprintf(stderr, _("reading result from %s: %s"), childstr(fd), strerror(errno));
        }
        *result_argv = NULL;
        *result_argc = 0;                               /* EOF */
@@ -281,6 +312,96 @@ getresult(
 }
 
 
+static char *
+taper_splitting_args(
+       disk_t *dp)
+{
+    GString *args = NULL;
+    char *q = NULL;
+    dumptype_t *dt = dp->config;
+    tapetype_t *tt;
+
+    tt = lookup_tapetype(getconf_str(CNF_TAPETYPE));
+    g_assert(tt != NULL);
+
+    args = g_string_new("");
+
+    /* old dumptype-based parameters, using empty strings when not seen */
+    if (dt) { /* 'dt' may be NULL for flushes */
+       if (dumptype_seen(dt, DUMPTYPE_TAPE_SPLITSIZE)) {
+           g_string_append_printf(args, "%ju ",
+                       (uintmax_t)dumptype_get_tape_splitsize(dt)*1024);
+       } else {
+           g_string_append(args, "\"\" ");
+       }
+
+       q = quote_string(dumptype_seen(dt, DUMPTYPE_SPLIT_DISKBUFFER)?
+               dumptype_get_split_diskbuffer(dt) : "");
+       g_string_append_printf(args, "%s ", q);
+       g_free(q);
+
+       if (dumptype_seen(dt, DUMPTYPE_FALLBACK_SPLITSIZE)) {
+           g_string_append_printf(args, "%ju ",
+                       (uintmax_t)dumptype_get_fallback_splitsize(dt)*1024);
+       } else {
+           g_string_append(args, "\"\" ");
+       }
+
+       if (dumptype_seen(dt, DUMPTYPE_ALLOW_SPLIT)) {
+           g_string_append_printf(args, "%d ",
+                       (int)dumptype_get_allow_split(dt));
+       } else {
+           g_string_append(args, "\"\" ");
+       }
+    } else {
+       g_string_append(args, "\"\" \"\" \"\" \"\" ");
+    }
+
+    /* new tapetype-based parameters */
+    if (tapetype_seen(tt, TAPETYPE_PART_SIZE)) {
+       g_string_append_printf(args, "%ju ",
+                   (uintmax_t)tapetype_get_part_size(tt)*1024);
+    } else {
+       g_string_append(args, "\"\" ");
+    }
+
+    q = "";
+    if (tapetype_seen(tt, TAPETYPE_PART_CACHE_TYPE)) {
+       switch (tapetype_get_part_cache_type(tt)) {
+           default:
+           case PART_CACHE_TYPE_NONE:
+               q = "none";
+               break;
+
+           case PART_CACHE_TYPE_MEMORY:
+               q = "memory";
+               break;
+
+           case PART_CACHE_TYPE_DISK:
+               q = "disk";
+               break;
+       }
+    }
+    q = quote_string(q);
+    g_string_append_printf(args, "%s ", q);
+    g_free(q);
+
+    q = quote_string(tapetype_seen(tt, TAPETYPE_PART_CACHE_DIR)?
+           tapetype_get_part_cache_dir(tt) : "");
+    g_string_append_printf(args, "%s ", q);
+    g_free(q);
+
+    if (tapetype_seen(tt, TAPETYPE_PART_CACHE_MAX_SIZE)) {
+       g_string_append_printf(args, "%ju ",
+                   (uintmax_t)tapetype_get_part_cache_max_size(tt)*1024);
+    } else {
+       g_string_append(args, "\"\" ");
+    }
+
+
+    return g_string_free(args, FALSE);
+}
+
 int
 taper_cmd(
     cmd_t cmd,
@@ -291,77 +412,83 @@ taper_cmd(
 {
     char *cmdline = NULL;
     char number[NUM_STR_SIZE];
-    char splitsize[NUM_STR_SIZE];
-    char fallback_splitsize[NUM_STR_SIZE];
     char orig_kb[NUM_STR_SIZE];
-    char *diskbuffer = NULL;
+    char *data_path;
     disk_t *dp;
     char *qname;
     char *qdest;
     char *q;
+    char *splitargs;
+    uintmax_t origsize;
 
     switch(cmd) {
     case START_TAPER:
-       cmdline = vstralloc(cmdstr[cmd], " ", (char *)ptr, "\n", NULL);
+       cmdline = vstralloc(cmdstr[cmd],
+                           " ", destname,
+                           " ", datestamp,
+                           "\n", NULL);
        break;
     case FILE_WRITE:
        dp = (disk_t *) ptr;
         qname = quote_string(dp->name);
        qdest = quote_string(destname);
        g_snprintf(number, SIZEOF(number), "%d", level);
-       g_snprintf(splitsize, SIZEOF(splitsize), "%lld",
-                (long long)dp->tape_splitsize * 1024);
-       g_snprintf(orig_kb, SIZEOF(orig_kb), "%jd",
-                (intmax_t)sched(dp)->origsize);
+       if (sched(dp)->origsize >= 0)
+           origsize = sched(dp)->origsize;
+       else
+           origsize = 0;
+       g_snprintf(orig_kb, SIZEOF(orig_kb), "%ju", origsize);
+       splitargs = taper_splitting_args(dp);
        cmdline = vstralloc(cmdstr[cmd],
+                           " ", sched(dp)->taper->name,
                            " ", disk2serial(dp),
                            " ", qdest,
                            " ", dp->host->hostname,
                            " ", qname,
                            " ", number,
                            " ", datestamp,
-                           " ", splitsize,
-                           " ", orig_kb,
+                           " ", splitargs,
+                                orig_kb,
                            "\n", NULL);
+       amfree(splitargs);
        amfree(qdest);
        amfree(qname);
        break;
+
     case PORT_WRITE:
        dp = (disk_t *) ptr;
         qname = quote_string(dp->name);
        g_snprintf(number, SIZEOF(number), "%d", level);
+       data_path = data_path_to_string(dp->data_path);
 
        /*
           If we haven't been given a place to buffer split dumps to disk,
           make the argument something besides and empty string so's taper
           won't get confused
        */
-       if(!dp->split_diskbuffer || dp->split_diskbuffer[0] == '\0'){
-           diskbuffer = "NULL";
-       } else {
-           diskbuffer = dp->split_diskbuffer;
-       }
-       g_snprintf(splitsize, SIZEOF(splitsize), "%lld",
-                (long long)dp->tape_splitsize * 1024);
-       g_snprintf(fallback_splitsize, SIZEOF(fallback_splitsize), "%lld",
-                (long long)dp->fallback_splitsize * 1024);
+       splitargs = taper_splitting_args(dp);
        cmdline = vstralloc(cmdstr[cmd],
+                           " ", sched(dp)->taper->name,
                            " ", disk2serial(dp),
                            " ", dp->host->hostname,
                            " ", qname,
                            " ", number,
                            " ", datestamp,
-                           " ", splitsize,
-                           " ", diskbuffer,
-                           " ", fallback_splitsize,
+                           " ", splitargs,
+                                data_path,
                            "\n", NULL);
+       amfree(splitargs);
        amfree(qname);
        break;
     case DONE: /* handle */
        dp = (disk_t *) ptr;
-       g_snprintf(number, SIZEOF(number), "%jd",
-                (intmax_t)(sched(dp)->origsize));
+       if (sched(dp)->origsize >= 0)
+           origsize = sched(dp)->origsize;
+       else
+           origsize = 0;
+       g_snprintf(number, SIZEOF(number), "%ju", origsize);
        cmdline = vstralloc(cmdstr[cmd],
+                           " ", sched(dp)->taper->name,
                            " ", disk2serial(dp),
                            " ", number,
                            "\n", NULL);
@@ -369,17 +496,42 @@ taper_cmd(
     case FAILED: /* handle */
        dp = (disk_t *) ptr;
        cmdline = vstralloc(cmdstr[cmd],
+                           " ", sched(dp)->taper->name,
                            " ", disk2serial(dp),
                            "\n", NULL);
        break;
     case NO_NEW_TAPE:
-       q = quote_string((char *)ptr);
+       dp = (disk_t *) ptr;
+       q = quote_string(destname);     /* reason why no new tape */
        cmdline = vstralloc(cmdstr[cmd],
+                           " ", sched(dp)->taper->name,
+                           " ", disk2serial(dp),
                            " ", q,
                            "\n", NULL);
        amfree(q);
        break;
     case NEW_TAPE:
+       dp = (disk_t *) ptr;
+       cmdline = vstralloc(cmdstr[cmd],
+                           " ", sched(dp)->taper->name,
+                           " ", disk2serial(dp),
+                           "\n", NULL);
+       break;
+    case START_SCAN:
+       dp = (disk_t *) ptr;
+       cmdline = vstralloc(cmdstr[cmd],
+                           " ", sched(dp)->taper->name,
+                           " ", disk2serial(dp),
+                           "\n", NULL);
+       break;
+    case TAKE_SCRIBE_FROM:
+       dp = (disk_t *) ptr;
+       cmdline = vstralloc(cmdstr[cmd],
+                           " ", sched(dp)->taper->name,
+                           " ", disk2serial(dp),
+                           " ", destname,  /* name of worker */
+                           "\n", NULL);
+       break;
     case QUIT:
        cmdline = stralloc2(cmdstr[cmd], "\n");
        break;
@@ -394,14 +546,14 @@ taper_cmd(
     g_printf(_("driver: send-cmd time %s to taper: %s"),
           walltime_str(curclock()), cmdline);
     fflush(stdout);
-    if ((full_write(taper, cmdline, strlen(cmdline))) < strlen(cmdline)) {
+    if ((full_write(taper_fd, cmdline, strlen(cmdline))) < strlen(cmdline)) {
        g_printf(_("writing taper command '%s' failed: %s\n"),
                cmdline, strerror(errno));
        fflush(stdout);
        amfree(cmdline);
        return 0;
     }
-    if(cmd == QUIT) aclose(taper);
+    if(cmd == QUIT) aclose(taper_fd);
     amfree(cmdline);
     return 1;
 }
@@ -416,7 +568,7 @@ dumper_cmd(
     char *cmdline = NULL;
     char number[NUM_STR_SIZE];
     char numberport[NUM_STR_SIZE];
-    char *o;
+    char *o, *oo;
     char *device;
     char *features;
     char *qname;
@@ -462,7 +614,9 @@ dumper_cmd(
                    vstrextend(&o, xml_app, NULL);
                    amfree(xml_app);
                }
-               o = quote_string(o);
+               oo = quote_string(o);
+               amfree(o);
+               o = oo;
            } else {
                o = optionstr(dp);
            }
@@ -675,7 +829,7 @@ chunker_cmd(
     return 1;
 }
 
-#define MAX_SERIAL MAX_DUMPERS+1       /* one for the taper */
+#define MAX_SERIAL MAX_DUMPERS*2       /* one for each dumper and taper */
 
 long generation = 1;
 
@@ -743,8 +897,8 @@ free_serial_dp(
        }
     }
 
-    g_printf(_("driver: error time %s serial not found\n"),
-          walltime_str(curclock()));
+    g_printf(_("driver: error time %s serial not found for disk %s\n"),
+          walltime_str(curclock()), dp->name);
 }
 
 
index c16d04186a3c8dd1c95a510c958ef63828209102..794c0fa013c0912afacae59c9428df77cf300d25 100644 (file)
 #define GLOBAL extern
 #endif
 
+typedef enum {
+   TAPER_STATE_DEFAULT        = 0,        //   0 Before TAPER-START
+   TAPER_STATE_INIT           = (1 << 0), //   1 Between TAPE-START and TAPE-OK
+   TAPER_STATE_RESERVATION    = (1 << 1), //   2 Have a reservation
+   TAPER_STATE_IDLE           = (1 << 2), //   4 tape started and do nothing
+   TAPER_STATE_DUMP_TO_TAPE   = (1 << 3), //   8 Doing a PORT-WRITE
+   TAPER_STATE_FILE_TO_TAPE   = (1 << 4), //  16 Doing a FILE-WRITE
+   TAPER_STATE_TAPE_REQUESTED = (1 << 5), //  32 REQUEST-NEW-TAPE received
+   TAPER_STATE_WAIT_FOR_TAPE  = (1 << 6), //  64 if taper wait for a tape,
+                                          //     after a START-SCAN send
+   TAPER_STATE_WAIT_NEW_TAPE  = (1 << 7), // 128 AFTER NEW-TAPE sent and before
+                                          //     NEW-TAPE received
+   TAPER_STATE_TAPE_STARTED   = (1 << 8), // 256 taper already started to write
+                                          //     to a tape.
+   TAPER_STATE_DONE           = (1 << 9),
+} TaperState;
+
 /* chunker process structure */
 
 typedef struct chunker_s {
@@ -67,6 +84,21 @@ typedef struct dumper_s {
     chunker_t *chunker;
 } dumper_t;
 
+typedef struct taper_s {
+    char       *name;                  /* name of this taper */
+    int         sendresult;
+    char       *input_error;
+    char       *tape_error;
+    int         result;
+    dumper_t   *dumper;
+    disk_t     *disk;
+    char       *first_label;
+    off_t       first_fileno;
+    TaperState  state;
+    off_t       left;
+    off_t       written;               // Number of kb already written to tape
+} taper_t;
+
 /* holding disk reservation structure; this is built as a list parallel
  * to the configuration's linked list of holding disks. */
 
@@ -102,6 +134,7 @@ typedef struct sched_s {
     unsigned long est_kps, degr_kps;
     char *destname;                            /* file/port name */
     dumper_t *dumper;
+    taper_t  *taper;
     assignedhd_t **holdp;
     time_t timestamp;
     char *datestamp;
@@ -115,34 +148,17 @@ typedef struct sched_s {
 
 GLOBAL dumper_t dmptable[MAX_DUMPERS];
 GLOBAL chunker_t chktable[MAX_DUMPERS];
+GLOBAL taper_t   *tapetable;
 
 /* command/result tokens */
 
-typedef enum {
-   TAPER_STATE_DEFAULT       = 0,
-   TAPER_STATE_DUMP_TO_TAPE  = (1 << 0), // if taper is doing a dump to tape
-   TAPER_STATE_WAIT_FOR_TAPE = (1 << 1), // if taper wait for a tape, after a
-                                        //   REQUEST-NEW-TAPE
-   TAPER_STATE_TAPE_STARTED  = (1 << 2)         // taper already started to write to
-                                        //   a tape.
-} TaperState;
-
-GLOBAL int taper, taper_busy;
-GLOBAL int taper_sendresult;
-GLOBAL char *taper_input_error;
-GLOBAL char *taper_tape_error;
+GLOBAL int taper_fd;
 GLOBAL pid_t taper_pid;
-GLOBAL int taper_result;
-GLOBAL dumper_t *taper_dumper;
 GLOBAL event_handle_t *taper_ev_read;
-GLOBAL char *taper_first_label;
-GLOBAL off_t taper_first_fileno;
-GLOBAL TaperState taper_state;
-GLOBAL off_t taper_written;            // Number of kb already written to tape
-                                       //   for the DLE.
+GLOBAL int taper_nb_wait_reply;
 
 void init_driverio(void);
-void startup_tape_process(char *taper_program);
+void startup_tape_process(char *taper_program, int taper_parallel_write, gboolean no_taper);
 void startup_dump_process(dumper_t *dumper, char *dumper_program);
 void startup_dump_processes(char *dumper_program, int inparallel, char *timestamp);
 void startup_chunk_process(chunker_t *chunker, char *chunker_program);
index 9ce7c3562d3961ad50ba49906e786d182704b0f5..996c9ddf46c947b87a606b9d87d3e4880f7678f6 100644 (file)
@@ -73,6 +73,16 @@ struct databuf {
     pid_t encryptpid;          /* valid if fd is pipe to encrypt */
 };
 
+typedef struct filter_s {
+    int             fd;
+    char           *name;
+    char           *buffer;
+    gint64          first;           /* first byte used */
+    gint64          size;            /* number of byte use in the buffer */
+    gint64          allocated_size ; /* allocated size of the buffer     */
+    event_handle_t *event;
+} filter_t;
+
 static char *handle = NULL;
 
 static char *errstr = NULL;
@@ -155,7 +165,7 @@ static void parse_info_line(char *);
 static void    log_msgout(logtype_t);
 static char *  dumper_get_security_conf (char *, void *);
 
-static int     runcompress(int, pid_t *, comp_t);
+static int     runcompress(int, pid_t *, comp_t, char *);
 static int     runencrypt(int, pid_t *,  encrypt_t);
 
 static void    sendbackup_response(void *, pkt_t *, security_handle_t *);
@@ -275,25 +285,27 @@ xml_check_options(
        srvcompress = COMP_BEST;
     } else if (dle->compress == COMP_SERVER_CUST) {
        srvcompress = COMP_SERVER_CUST;
-       srvcompprog = dle->compprog;
+       srvcompprog = g_strdup(dle->compprog);
     } else if (dle->compress == COMP_CUST) {
        srvcompress = COMP_CUST;
-       clntcompprog = dle->compprog;
+       clntcompprog = g_strdup(dle->compprog);
     } else {
        srvcompress = COMP_NONE;
     }
 
     if (dle->encrypt == ENCRYPT_CUST) {
        srvencrypt = ENCRYPT_CUST;
-       clnt_encrypt = dle->clnt_encrypt;
-       clnt_decrypt_opt = dle->clnt_decrypt_opt;
+       clnt_encrypt = g_strdup(dle->clnt_encrypt);
+       clnt_decrypt_opt = g_strdup(dle->clnt_decrypt_opt);
     } else if (dle->encrypt == ENCRYPT_SERV_CUST) {
        srvencrypt = ENCRYPT_SERV_CUST;
-       srv_encrypt = dle->clnt_encrypt;
-       srv_decrypt_opt = dle->clnt_decrypt_opt;
+       srv_encrypt = g_strdup(dle->srv_encrypt);
+       srv_decrypt_opt = g_strdup(dle->srv_decrypt_opt);
     } else {
        srvencrypt = ENCRYPT_NONE;
     }
+    free_dle(dle);
+    amfree(o);
 }
 
 
@@ -559,9 +571,9 @@ main(
            databuf_init(&db, outfd);
 
            if (am_has_feature(their_features, fe_req_xml))
-               xml_check_options(options);
+               xml_check_options(options); /* note: modifies globals */
            else
-               check_options(options);
+               check_options(options); /* note: modifies globals */
 
            rc = startup_dump(hostname,
                              diskname,
@@ -593,6 +605,10 @@ main(
            amfree(amandad_path);
            amfree(client_username);
            amfree(client_port);
+           amfree(device);
+           amfree(b64device);
+           amfree(qdiskname);
+           amfree(b64disk);
 
            break;
 
@@ -705,6 +721,7 @@ databuf_flush(
     if (written == 0) {
        int save_errno = errno;
        m = vstrallocf(_("data write: %s"), strerror(save_errno));
+       amfree(errstr);
        errstr = quote_string(m);
        amfree(m);
        errno = save_errno;
@@ -982,7 +999,7 @@ log_msgout(
     char *line;
 
     fflush(errf);
-    if (fseek(errf, 0L, SEEK_SET) < 0) {
+    if (fseeko(errf, 0L, SEEK_SET) < 0) {
        dbprintf(_("log_msgout: warning - seek failed: %s\n"), strerror(errno));
     }
     while ((line = agets(errf)) != NULL) {
@@ -1131,6 +1148,8 @@ write_tapeheader(
     return -1;
 }
 
+int indexout = -1;
+
 static int
 do_dump(
     struct databuf *db)
@@ -1143,7 +1162,6 @@ do_dump(
     times_t runtime;
     double dumptime;   /* Time dump took in secs */
     char *errfname = NULL;
-    int indexout;
     pid_t indexpid = -1;
     char *m;
 
@@ -1193,7 +1211,7 @@ do_dump(
                        indexfile_tmp, strerror(errno));
            goto failed;
        } else {
-           if (runcompress(indexout, &indexpid, COMP_BEST) < 0) {
+           if (runcompress(indexout, &indexpid, COMP_BEST, "index compress") < 0) {
                aclose(indexout);
                goto failed;
            }
@@ -1455,47 +1473,18 @@ read_mesgfd(
                                  strerror(errno));
            dump_result = 2;
            stop_dump();
+           dumpfile_free_data(&file);
            return;
        }
-       close(db->fd);
+       dumpfile_free_data(&file);
+       aclose(db->fd);
        if (data_path == DATA_PATH_AMANDA) {
-           char buffer[32770];
-           if (strcmp(data_host, "255.255.255.255") == 0) {
-               int size;
-               char *s;
-               g_debug(_("Using indirect-tcp from port %d"), data_port);
-               db->fd = stream_client("127.0.0.1", data_port,
-                                      STREAM_BUFSIZE, 0, NULL, 0);
-               if (db->fd == -1) {
-                   errstr = newvstrallocf(errstr,
-                                      _("Can't open indirect-tcp stream: %s"),
-                                      strerror(errno));
-                   dump_result = 2;
-                   stop_dump();
-                   return;
-               }
-               size = full_read(db->fd, buffer, 32768);
-               if (size <= 0) {
-                   errstr = newvstrallocf(errstr,
-                                 _("Can't read from indirect-tcp stream: %s"),
-                                 strerror(errno));
-                   dump_result = 2;
-                   stop_dump();
-                   return;
-               }
-               buffer[size] = '\0';
-               s = strchr(buffer, ':');
-               *s++ = '\0';
-               data_host = buffer;
-               data_port = atoi(s);
-               aclose(db->fd);
-           }
-           g_debug(_("Sending data to %s:%d"), data_host, data_port);
+           g_debug(_("Sending data to %s:%d\n"), data_host, data_port);
            db->fd = stream_client(data_host, data_port,
                                   STREAM_BUFSIZE, 0, NULL, 0);
            if (db->fd == -1) {
                errstr = newvstrallocf(errstr,
-                                      _("Can't open data output stream: %s"),
+                                      _("Can't opendata output stream: %s"),
                                       strerror(errno));
                dump_result = 2;
                stop_dump();
@@ -1518,7 +1507,7 @@ read_mesgfd(
         * reading the datafd.
         */
        if ((srvcompress != COMP_NONE) && (srvcompress != COMP_CUST)) {
-           if (runcompress(db->fd, &db->compresspid, srvcompress) < 0) {
+           if (runcompress(db->fd, &db->compresspid, srvcompress, "data compress") < 0) {
                dump_result = 2;
                stop_dump();
                return;
@@ -1554,6 +1543,7 @@ read_datafd(
        errstr = newvstrallocf(errstr, _("data read: %s"),
            security_stream_geterror(streams[DATAFD].fd));
        dump_result = 2;
+       aclose(db->fd);
        stop_dump();
        return;
     }
@@ -1571,6 +1561,7 @@ read_datafd(
        }
        security_stream_close(streams[DATAFD].fd);
        streams[DATAFD].fd = NULL;
+       aclose(db->fd);
        /*
         * If the mesg fd and index fd has also shut down, then we're done.
         */
@@ -1634,6 +1625,7 @@ read_indexfd(
        if ((set_datafd == 0 || streams[DATAFD].fd == NULL) &&
             streams[MESGFD].fd == NULL)
            stop_dump();
+       aclose(indexout);
        return;
     }
 
@@ -1652,6 +1644,78 @@ read_indexfd(
     security_stream_read(streams[INDEXFD].fd, read_indexfd, cookie);
 }
 
+static void
+handle_filter_stderr(
+    void *cookie)
+{
+    filter_t *filter = cookie;
+    ssize_t   nread;
+    char     *b, *p;
+    gint64    len;
+
+    event_release(filter->event);
+
+    if (filter->buffer == NULL) {
+       /* allocate initial buffer */
+       filter->buffer = g_malloc(2048);
+       filter->first = 0;
+       filter->size = 0;
+       filter->allocated_size = 2048;
+    } else if (filter->first > 0) {
+       if (filter->allocated_size - filter->size - filter->first < 1024) {
+           memmove(filter->buffer, filter->buffer + filter->first,
+                                   filter->size);
+           filter->first = 0;
+       }
+    } else if (filter->allocated_size - filter->size < 1024) {
+       /* double the size of the buffer */
+       filter->allocated_size *= 2;
+       filter->buffer = g_realloc(filter->buffer, filter->allocated_size);
+    }
+
+    nread = read(filter->fd, filter->buffer + filter->first + filter->size,
+                            filter->allocated_size - filter->first - filter->size - 2);
+
+    if (nread != 0) {
+       dump_result = max(dump_result, 2);
+    }
+
+    if (nread <= 0) {
+       aclose(filter->fd);
+       if (filter->size > 0 && filter->buffer[filter->first + filter->size - 1] != '\n') {
+           /* Add a '\n' at end of buffer */
+           filter->buffer[filter->first + filter->size] = '\n';
+           filter->size++;
+       }
+    } else {
+       filter->size += nread;
+    }
+
+    /* process all complete lines */
+    b = filter->buffer + filter->first;
+    filter->buffer[filter->first + filter->size] = '\0';
+    while (b < filter->buffer + filter->first + filter->size &&
+          (p = strchr(b, '\n')) != NULL) {
+       *p = '\0';
+       g_fprintf(errf, _("? %s: %s\n"), filter->name, b);
+       if (errstr == NULL) {
+           errstr = stralloc(b);
+       }
+       len = p - b + 1;
+       filter->first += len;
+       filter->size -= len;
+       b = p + 1;
+    }
+
+    if (nread <= 0) {
+       g_free(filter->buffer);
+       g_free(filter);
+    } else {
+       filter->event = event_register((event_id_t)filter->fd, EV_READFD,
+                                      handle_filter_stderr, filter);
+    }
+}
+
 /*
  * Startup a timeout in the event handler.  If the arg is 0,
  * then remove the timeout.
@@ -1709,6 +1773,7 @@ stop_dump(void)
        if (cmdargs->cmd != ABORT) {
            error(_("beurk"));
        }
+       amfree(errstr);
        errstr = stralloc(cmdargs->argv[1]);
        free_cmdargs(cmdargs);
     }
@@ -1719,6 +1784,7 @@ stop_dump(void)
            streams[i].fd = NULL;
        }
     }
+    aclose(indexout);
     timeout(0);
 }
 
@@ -1733,9 +1799,12 @@ static int
 runcompress(
     int                outfd,
     pid_t *    pid,
-    comp_t     comptype)
+    comp_t     comptype,
+    char       *name)
 {
     int outpipe[2], rval;
+    int errpipe[2];
+    filter_t *filter;
 
     assert(outfd >= 0);
     assert(pid != NULL);
@@ -1746,11 +1815,19 @@ runcompress(
        return (-1);
     }
 
+    /* errpipe[0] is pipe's output, outpipe[1] is input. */
+    if (pipe(errpipe) < 0) {
+       errstr = newvstrallocf(errstr, _("pipe: %s"), strerror(errno));
+       return (-1);
+    }
+
     switch (*pid = fork()) {
     case -1:
        errstr = newvstrallocf(errstr, _("couldn't fork: %s"), strerror(errno));
        aclose(outpipe[0]);
        aclose(outpipe[1]);
+       aclose(errpipe[0]);
+       aclose(errpipe[1]);
        return (-1);
     default:
        rval = dup2(outpipe[1], outfd);
@@ -1758,8 +1835,20 @@ runcompress(
            errstr = newvstrallocf(errstr, _("couldn't dup2: %s"), strerror(errno));
        aclose(outpipe[1]);
        aclose(outpipe[0]);
+       aclose(errpipe[1]);
+       filter = g_new0(filter_t, 1);
+       filter->fd = errpipe[0];
+       filter->name = name;
+       filter->buffer = NULL;
+       filter->size = 0;
+       filter->allocated_size = 0;
+       filter->event = event_register((event_id_t)filter->fd, EV_READFD,
+                                      handle_filter_stderr, filter);
+g_debug("event register %s %d", name, filter->fd);
        return (rval);
     case 0:
+       close(outpipe[1]);
+       close(errpipe[0]);
        if (dup2(outpipe[0], 0) < 0) {
            error(_("err dup2 in: %s"), strerror(errno));
            /*NOTREACHED*/
@@ -1768,11 +1857,16 @@ runcompress(
            error(_("err dup2 out: %s"), strerror(errno));
            /*NOTREACHED*/
        }
+       if (dup2(errpipe[1], 2) == -1) {
+           error(_("err dup2 err: %s"), strerror(errno));
+           /*NOTREACHED*/
+       }
        if (comptype != COMP_SERVER_CUST) {
            char *base = stralloc(COMPRESS_PATH);
            log_add(L_INFO, "%s pid %ld", basename(base), (long)getpid());
            amfree(base);
            safe_fd(-1, 0);
+           set_root_privs(-1);
            execlp(COMPRESS_PATH, COMPRESS_PATH, (  comptype == COMP_BEST ?
                COMPRESS_BEST_OPT : COMPRESS_FAST_OPT), (char *)NULL);
            error(_("error: couldn't exec %s: %s"), COMPRESS_PATH, strerror(errno));
@@ -1782,8 +1876,9 @@ runcompress(
            log_add(L_INFO, "%s pid %ld", basename(base), (long)getpid());
            amfree(base);
            safe_fd(-1, 0);
+           set_root_privs(-1);
            execlp(srvcompprog, srvcompprog, (char *)0);
-           error(_("error: couldn't exec server custom filter%s.\n"), srvcompprog);
+           error(_("error: couldn't exec server custom compression '%s'.\n"), srvcompprog);
            /*NOTREACHED*/
        }
     }
@@ -1804,6 +1899,8 @@ runencrypt(
     encrypt_t  encrypttype)
 {
     int outpipe[2], rval;
+    int errpipe[2];
+    filter_t *filter;
 
     assert(outfd >= 0);
     assert(pid != NULL);
@@ -1814,11 +1911,19 @@ runencrypt(
        return (-1);
     }
 
+    /* errpipe[0] is pipe's output, outpipe[1] is input. */
+    if (pipe(errpipe) < 0) {
+       errstr = newvstrallocf(errstr, _("pipe: %s"), strerror(errno));
+       return (-1);
+    }
+
     switch (*pid = fork()) {
     case -1:
        errstr = newvstrallocf(errstr, _("couldn't fork: %s"), strerror(errno));
        aclose(outpipe[0]);
        aclose(outpipe[1]);
+       aclose(errpipe[0]);
+       aclose(errpipe[1]);
        return (-1);
     default:
        rval = dup2(outpipe[1], outfd);
@@ -1826,6 +1931,16 @@ runencrypt(
            errstr = newvstrallocf(errstr, _("couldn't dup2: %s"), strerror(errno));
        aclose(outpipe[1]);
        aclose(outpipe[0]);
+       aclose(errpipe[1]);
+       filter = g_new0(filter_t, 1);
+       filter->fd = errpipe[0];
+       filter->name = "encrypt";
+       filter->buffer = NULL;
+       filter->size = 0;
+       filter->allocated_size = 0;
+       filter->event = event_register((event_id_t)filter->fd, EV_READFD,
+                                      handle_filter_stderr, filter);
+g_debug("event register %s %d", "encrypt data", filter->fd);
        return (rval);
     case 0: {
        char *base;
@@ -1837,13 +1952,19 @@ runencrypt(
            error(_("err dup2 out: %s"), strerror(errno));
            /*NOTREACHED*/
        }
+       if (dup2(errpipe[1], 2) == -1) {
+           error(_("err dup2 err: %s"), strerror(errno));
+           /*NOTREACHED*/
+       }
+       close(errpipe[0]);
        base = stralloc(srv_encrypt);
        log_add(L_INFO, "%s pid %ld", basename(base), (long)getpid());
        amfree(base);
        safe_fd(-1, 0);
        if ((encrypttype == ENCRYPT_SERV_CUST) && *srv_encrypt) {
+           set_root_privs(-1);
            execlp(srv_encrypt, srv_encrypt, (char *)0);
-           error(_("error: couldn't exec server encryption%s.\n"), srv_encrypt);
+           error(_("error: couldn't exec server custom encryption '%s'.\n"), srv_encrypt);
            /*NOTREACHED*/
        }
        }
index da8b0b79a85d143dd8ae52f0bd621925b772a1eb..dadbd5738ba0f7b6d844f25d5816ad13177f7ce6 100644 (file)
@@ -55,7 +55,6 @@ find_result_t * find_dump(disklist_t* diskqp) {
     tape_t *tp, *tp1;
     find_result_t *output_find = NULL;
     gboolean *tape_seen = NULL;
-    GSList   *label_list;
 
     conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
     maxtape = lookup_nb_tape();
@@ -68,9 +67,7 @@ find_result_t * find_dump(disklist_t* diskqp) {
        tp = lookup_tapepos(tape);
        if(tp == NULL) continue;
 
-       /* find all tape with the same datestamp
-          add them to label_list */
-       label_list = NULL;
+       /* find all tape with the same datestamp */
        for (tape1 = tape; tape1 <= maxtape; tape1++) {
            tp1 = lookup_tapepos(tape1);
            if (tp1 == NULL) continue;
@@ -78,7 +75,6 @@ find_result_t * find_dump(disklist_t* diskqp) {
                continue;
 
            tape_seen[tape1] = 1;
-           label_list = g_slist_append(label_list, tp1->label);
        }
 
        /* search log files */
@@ -121,15 +117,6 @@ find_result_t * find_dump(disklist_t* diskqp) {
                 logs ++;
             }
        }
-       if (logs == 0 && strcmp(tp->datestamp,"0") != 0) {
-           GSList *l_label;
-           for (l_label = label_list; l_label != NULL ; l_label = l_label->next) {
-               g_fprintf(stderr,
-                      _("Warning: no log files found for tape %s written %s\n"),
-                      (char *)l_label->data, find_nicedate(tp->datestamp));
-           }
-       }
-       g_slist_free(label_list);
     }
     g_free(tape_seen);
     amfree(logfile);
@@ -276,6 +263,7 @@ search_holding_disk(
            find_result_t *new_output_find = g_new0(find_result_t, 1);
            new_output_find->next=*output_find;
            new_output_find->timestamp = stralloc(file.datestamp);
+           new_output_find->write_timestamp = stralloc("00000000000000");
            new_output_find->hostname = stralloc(file.name);
            new_output_find->diskname = stralloc(file.disk);
            new_output_find->level=file.dumplevel;
@@ -302,17 +290,6 @@ search_holding_disk(
     g_slist_free_full(holding_file_list);
 }
 
-static char *
-get_write_timestamp(char *tapelabel)
-{
-    tape_t *tp;
-
-    if (!tapelabel || !(tp = lookup_tapelabel(tapelabel)))
-       return "0";
-
-    return tp->datestamp;
-}
-
 static int
 find_compare(
     const void *i1,
@@ -351,8 +328,7 @@ find_compare(
        case 'b' : compare=compare_possibly_null_strings(i->label,
                                                          j->label);
                    break;
-       case 'w': compare=strcmp(get_write_timestamp(i->label),
-                                get_write_timestamp(j->label));
+       case 'w': compare=strcmp(i->write_timestamp, j->write_timestamp);
                   break;
        case 'p' :
                   compare=i->partnum - j->partnum;
@@ -444,7 +420,9 @@ print_find_result(
            max_len_diskname = (int)len;
 
         if (output_find_result->label != NULL) {
-            len=strlen(output_find_result->label);
+            char *qlabel = quote_string(output_find_result->label);
+            len=strlen(qlabel);
+            amfree(qlabel);
             if((int)len > max_len_label)
                 max_len_label = (int)len;
         }
@@ -458,6 +436,7 @@ print_find_result(
        len=strlen(s);
        if((int)len > max_len_part)
            max_len_part = (int)len;
+       amfree(s);
     }
 
     /*
@@ -488,9 +467,10 @@ print_find_result(
            char *status;
 
            qdiskname = quote_string(output_find_result->diskname);
-            formatted_label = output_find_result->label;
-            if (formatted_label == NULL)
-                formatted_label = "";
+            if (output_find_result->label == NULL)
+                formatted_label = stralloc("");
+           else
+               formatted_label = quote_string(output_find_result->label);
 
            if (strcmp(output_find_result->status, "OK") != 0 ||
                strcmp(output_find_result->dump_status, "OK") != 0) {
@@ -521,6 +501,7 @@ print_find_result(
            amfree(s);
            /*@end@*/
            amfree(qdiskname);
+           amfree(formatted_label);
        }
     }
 }
@@ -537,6 +518,7 @@ free_find_result(
            output_find_result=output_find_result->next) {
        amfree(prev);
        amfree(output_find_result->timestamp);
+       amfree(output_find_result->write_timestamp);
        amfree(output_find_result->hostname);
        amfree(output_find_result->diskname);
        amfree(output_find_result->label);
@@ -693,7 +675,6 @@ volume_matches(
     return TRUE;
 }
 
-
 /* WARNING: Function accesses globals find_diskqp, curlog, curlog, curstr,
  * dynamic_disklist */
 gboolean
@@ -722,7 +703,9 @@ search_logfile(
     char *s;
     int ch;
     disk_t *dp;
-    find_result_t *part_find = NULL;  /* List for all part of a DLE */
+    GHashTable* valid_label;
+    GHashTable* part_by_dle;
+    find_result_t *part_find;
     find_result_t *a_part_find;
     gboolean right_label = FALSE;
     gboolean found_something = FALSE;
@@ -732,10 +715,13 @@ search_logfile(
     double sec;
     off_t kb;
     off_t orig_kb;
+    int   taper_part = 0;
 
     g_return_val_if_fail(output_find != NULL, 0);
     g_return_val_if_fail(logfile != NULL, 0);
 
+    valid_label = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
+    part_by_dle = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
     datestamp = g_strdup(passed_datestamp);
 
     if((logf = fopen(logfile, "r")) == NULL) {
@@ -761,6 +747,10 @@ search_logfile(
             }
 
             right_label = volume_matches(label, ck_label, ck_datestamp);
+           if (right_label && ck_label) {
+               g_hash_table_insert(valid_label, g_strdup(ck_label),
+                                   GINT_TO_POINTER(1));
+           }
            if (label && datestamp && right_label) {
                found_something = TRUE;
            }
@@ -769,12 +759,16 @@ search_logfile(
             if (datestamp == NULL) {
                 datestamp = g_strdup(ck_datestamp);
             }
+           filenum = (off_t)0;
        }
        if (right_label &&
            (curlog == L_SUCCESS ||
             curlog == L_CHUNK || curlog == L_PART || curlog == L_PARTPARTIAL) &&
            curprog == P_TAPER) {
            filenum++;
+       } else if (right_label && curlog == L_PARTIAL && curprog == P_TAPER &&
+                  taper_part == 0) {
+           filenum++;
        }
        partnum = -1;
        totalparts = -1;
@@ -794,17 +788,15 @@ search_logfile(
 
            if (curlog == L_PART || curlog == L_PARTPARTIAL) {
                char * part_label = s - 1;
+               taper_part++;
                skip_non_whitespace(s, ch);
                s[-1] = '\0';
 
-               if (!right_label)
+               if (!g_hash_table_lookup(valid_label, part_label))
                    continue;
+               amfree(current_label);
+               current_label = stralloc(part_label);
 
-               if (strcmp(current_label, part_label) != 0) {
-                   g_printf("PART label %s doesn't match START label %s\n",
-                             part_label, current_label);
-                   continue;
-               }
                skip_whitespace(s, ch);
                if(ch == '\0') {
                    g_printf("strange log line in %s \"%s\"\n",
@@ -826,6 +818,8 @@ search_logfile(
                           logfile, curstr);
                    continue;
                }
+           } else {
+               taper_part = 0;
            }
 
            host = s - 1;
@@ -862,8 +856,10 @@ search_logfile(
                partnum = 1;
                totalparts =1;
            } else {
-               if (curlog == L_CHUNK || curlog == L_PART ||
-                   curlog == L_PARTPARTIAL || curlog == L_DONE){
+               if (curprog == P_TAPER &&
+                       (curlog == L_CHUNK || curlog == L_PART ||
+                        curlog == L_PARTPARTIAL || curlog == L_PARTIAL ||
+                        curlog == L_DONE)) {
                    skip_whitespace(s, ch);
                    number = s - 1;
                    skip_non_whitespace(s, ch);
@@ -921,9 +917,11 @@ search_logfile(
                orig_kb = OFF_T_ATOI(str);
                amfree(str);
            } else {
+               regfree(&regex);
                bzero(&regex, sizeof(regex));
+               /* the .* at the end of this captures the old {wr: .. } statistics */
                reg_result = regcomp(&regex,
-                   "\\[sec ([0-9.]+) kb ([0-9]+) kps [0-9.]+\\]", REG_EXTENDED);
+                   "\\[sec ([0-9.]+) kb ([0-9]+) kps [0-9.]+.*\\]", REG_EXTENDED);
                if (reg_result != 0) {
                    error("Error compiling regular expression for parsing log lines");
                    /* NOTREACHED */
@@ -948,6 +946,8 @@ search_logfile(
                    orig_kb = 0;
                }
            }
+           if (strncmp(rest, "error ", 6) == 0) rest += 6;
+           if (strncmp(rest, "config ", 7) == 0) rest += 7;
            regfree(&regex);
 
            dp = lookup_disk(host,disk);
@@ -960,8 +960,13 @@ search_logfile(
            }
             if (find_match(host, disk)) {
                if(curprog == P_TAPER) {
+                   char *key = g_strdup_printf(
+                                       "HOST:%s DISK:%s: DATE:%s LEVEL:%d",
+                                       host, disk, date, level);
                    find_result_t *new_output_find = g_new0(find_result_t, 1);
+                   part_find = g_hash_table_lookup(part_by_dle, key);
                    new_output_find->timestamp = stralloc(date);
+                   new_output_find->write_timestamp = stralloc(datestamp);
                    new_output_find->hostname=stralloc(host);
                    new_output_find->diskname=stralloc(disk);
                    new_output_find->level=level;
@@ -980,6 +985,7 @@ search_logfile(
                        new_output_find->status = stralloc("OK");
                        new_output_find->dump_status = stralloc("OK");
                        new_output_find->next = *output_find;
+                       new_output_find->partnum = 1; /* L_SUCCESS is pre-splitting */
                        *output_find = new_output_find;
                         found_something = TRUE;
                    } else if (curlog == L_CHUNKSUCCESS || curlog == L_DONE ||
@@ -987,7 +993,8 @@ search_logfile(
                        /* result line */
                        if (curlog == L_PARTIAL || curlog == L_FAIL) {
                            /* set dump_status of each part */
-                           for (a_part_find = part_find; a_part_find;
+                           for (a_part_find = part_find;
+                                a_part_find;
                                 a_part_find = a_part_find->next) {
                                amfree(a_part_find->dump_status);
                                if (curlog == L_PARTIAL)
@@ -1002,14 +1009,16 @@ search_logfile(
                            if (maxparts > -1) { /* format with part */
                                /* must check if all part are there */
                                int num_part = maxparts;
-                               for (a_part_find = part_find; a_part_find;
+                               for (a_part_find = part_find;
+                                    a_part_find;
                                     a_part_find = a_part_find->next) {
                                    if (a_part_find->partnum == num_part &&
                                        strcmp(a_part_find->status, "OK") == 0)
                                        num_part--;
                                }
                                /* set dump_status of each part */
-                               for (a_part_find = part_find; a_part_find;
+                               for (a_part_find = part_find;
+                                    a_part_find;
                                     a_part_find = a_part_find->next) {
                                    amfree(a_part_find->dump_status);
                                    if (num_part == 0) {
@@ -1026,7 +1035,8 @@ search_logfile(
                            }
                        }
                        if (curlog == L_DONE) {
-                           for (a_part_find = part_find; a_part_find;
+                           for (a_part_find = part_find;
+                                a_part_find;
                                 a_part_find = a_part_find->next) {
                                if (a_part_find->totalparts == -1) {
                                    a_part_find->totalparts = maxparts;
@@ -1047,6 +1057,7 @@ search_logfile(
                            part_find = NULL;
                            maxparts = -1;
                             found_something = TRUE;
+                           g_hash_table_remove(part_by_dle, key);
                        }
                        free_find_result(&new_output_find);
                    } else { /* part line */
@@ -1058,10 +1069,18 @@ search_logfile(
                            new_output_find->dump_status=stralloc("PARTIAL");
                        }
                        /* Add to part_find list */
-                       new_output_find->next = part_find;
-                       part_find = new_output_find;
+                       if (part_find) {
+                           new_output_find->next = part_find;
+                           part_find = new_output_find;
+                       } else {
+                           new_output_find->next = NULL;
+                           part_find = new_output_find;
+                       }
+                       g_hash_table_insert(part_by_dle, g_strdup(key),
+                                           part_find);
                        found_something = TRUE;
                    }
+                   amfree(key);
                }
                else if(curlog == L_FAIL) {
                    /* print other failures too -- this is a hack to ensure that failures which
@@ -1069,8 +1088,9 @@ search_logfile(
                     * users that do not want this information (e.g., Amanda::DB::Catalog) should
                     * filter dumps with a NULL label. */
                    find_result_t *new_output_find = g_new0(find_result_t, 1);
-                   new_output_find->next=*output_find;
+                   new_output_find->next = *output_find;
                    new_output_find->timestamp = stralloc(date);
+                   new_output_find->write_timestamp = g_strdup("00000000000000"); /* dump was not written.. */
                    new_output_find->hostname=stralloc(host);
                    new_output_find->diskname=stralloc(disk);
                    new_output_find->level=level;
@@ -1098,41 +1118,7 @@ search_logfile(
        }
     }
 
-    /* This could propably be completely removed */
-    if (part_find != NULL) {
-       if (label) {
-           /* parse log file until PARTIAL/DONE/SUCCESS/FAIL from taper */
-           while(get_logline(logf)) {
-               if (curprog == P_TAPER &&
-                   (curlog == L_DONE || curlog == L_SUCCESS ||
-                    curlog == L_PARTIAL || curlog == L_FAIL)) {
-                   break;
-               }
-           }
-       }
-       for (a_part_find = part_find; a_part_find;
-            a_part_find = a_part_find->next) {
-           if (curlog == L_PARTIAL)
-               a_part_find->status = stralloc("PARTIAL");
-           else if (curlog == L_FAIL)
-               a_part_find->status = stralloc("FAIL");
-           else if (curlog == L_DONE || curlog == L_SUCCESS) {
-               if (a_part_find->totalparts == -1) {
-                   a_part_find->totalparts = maxparts;
-               }
-           }
-       }
-       for (a_part_find = part_find;
-            a_part_find->next != NULL;
-            a_part_find=a_part_find->next) {
-       }
-       /* merge part_find to *output_find */
-       a_part_find->next = *output_find;
-       *output_find = part_find;
-       part_find = NULL;
-       maxparts = -1;
-    }
-
+    g_hash_table_destroy(valid_label);
     afclose(logf);
     amfree(datestamp);
     amfree(current_label);
@@ -1177,6 +1163,7 @@ dumps_match(
            memcpy(curmatch, cur_result, SIZEOF(find_result_t));
 
            curmatch->timestamp = stralloc(cur_result->timestamp);
+           curmatch->write_timestamp = stralloc(cur_result->write_timestamp);
            curmatch->hostname = stralloc(cur_result->hostname);
            curmatch->diskname = stralloc(cur_result->diskname);
            curmatch->level = cur_result->level;
@@ -1220,12 +1207,32 @@ dumps_match_dumpspecs(
        cur_result;
        cur_result=cur_result->next) {
        char level_str[NUM_STR_SIZE];
+       char *zeropad_ts = NULL;
+       char *zeropad_w_ts = NULL;
        g_snprintf(level_str, SIZEOF(level_str), "%d", cur_result->level);
+
+       /* get the timestamp padded to full width */
+       if (strlen(cur_result->timestamp) < 14) {
+           zeropad_ts = g_new0(char, 15);
+           memset(zeropad_ts, '0', 14);
+           memcpy(zeropad_ts, cur_result->timestamp, strlen(cur_result->timestamp));
+       }
+       if (strlen(cur_result->write_timestamp) < 14) {
+           zeropad_w_ts = g_new0(char, 15);
+           memset(zeropad_w_ts, '0', 14);
+           memcpy(zeropad_w_ts, cur_result->write_timestamp, strlen(cur_result->write_timestamp));
+       }
+
        for (dumpspec = dumpspecs; dumpspec; dumpspec = dumpspec->next) {
            ds = (dumpspec_t *)dumpspec->data;
            if((!ds->host || *ds->host == '\0' || match_host(ds->host, cur_result->hostname)) &&
               (!ds->disk || *ds->disk == '\0' || match_disk(ds->disk, cur_result->diskname)) &&
-              (!ds->datestamp || *ds->datestamp== '\0' || match_datestamp(ds->datestamp, cur_result->timestamp)) &&
+              (!ds->datestamp || *ds->datestamp== '\0'
+                       || match_datestamp(ds->datestamp, cur_result->timestamp)
+                       || (zeropad_ts && match_datestamp(ds->datestamp, zeropad_ts))) &&
+              (!ds->write_timestamp || *ds->write_timestamp== '\0'
+                       || match_datestamp(ds->write_timestamp, cur_result->write_timestamp)
+                       || (zeropad_w_ts && match_datestamp(ds->write_timestamp, zeropad_w_ts))) &&
               (!ds->level || *ds->level== '\0' || match_level(ds->level, level_str)) &&
               (!ok || !strcmp(cur_result->status, "OK")) &&
               (!ok || !strcmp(cur_result->dump_status, "OK"))) {
@@ -1234,6 +1241,7 @@ dumps_match_dumpspecs(
                memcpy(curmatch, cur_result, SIZEOF(find_result_t));
 
                curmatch->timestamp = stralloc(cur_result->timestamp);
+               curmatch->write_timestamp = stralloc(cur_result->write_timestamp);
                curmatch->hostname = stralloc(cur_result->hostname);
                curmatch->diskname = stralloc(cur_result->diskname);
                curmatch->level = cur_result->level;
@@ -1250,6 +1258,8 @@ dumps_match_dumpspecs(
                break;
            }
        }
+
+       amfree(zeropad_ts);
     }
 
     return(matches);
index 01c18a28f89deb4157e65ba504739e2a5bf0fa13..ac97c3af9562d42247dc8d871d5f2546c81a934f 100644 (file)
@@ -7,7 +7,8 @@
 
 typedef struct find_result_s {
     struct find_result_s *next;
-    char *timestamp;
+    char *timestamp;           /* dump timestamp */
+    char *write_timestamp;
     char *hostname;
     char *diskname;
     int level;
index 0d8cb82dc7d801a7f1a7b1320ff60f24323eca62..15286bd3a432760d2577a2811aece707efce90b0 100644 (file)
@@ -32,6 +32,7 @@
 #include "amanda.h"
 #include "util.h"
 #include "holding.h"
+#include "diskfile.h"
 #include "fileheader.h"
 #include "logfile.h"
 
@@ -516,7 +517,6 @@ holding_get_files_for_flush(
     GSList *file_list, *file_elt;
     GSList *date;
     int date_matches;
-    disk_t *dp;
     dumpfile_t file;
     GSList *result_list = NULL;
 
@@ -551,15 +551,6 @@ holding_get_files_for_flush(
             continue;
        }
 
-        /* check that the hostname and disk are in the disklist */
-        dp = lookup_disk(file.name, file.disk);
-        if (dp == NULL) {
-           dbprintf(_("%s: disk %s:%s not in database, skipping it."),
-                        (char *)file_elt->data, file.name, file.disk);
-           dumpfile_free_data(&file);
-            continue;
-        }
-
         /* passed all tests -- we'll flush this file */
         result_list = g_slist_insert_sorted(result_list, 
            stralloc(file_elt->data), 
@@ -952,9 +943,11 @@ rename_tmp_holding(
                dumpfile_free_data(&file);
                amfree(filename);
                amfree(filename_tmp);
+               free(header);
                close(fd);
                return 0;
            }
+           free(header);
            close(fd);
        }
        filename = newstralloc(filename, file.cont_filename);
index 73687c47d8fa77128d0274e3d9c8b829847acf02..d8f992ac219e7a8f914d0be2fe1efb5357d9dfb9 100644 (file)
@@ -50,7 +50,6 @@
 #define HOLDING_H
 
 #include "amanda.h"
-#include "diskfile.h"
 #include "fileheader.h"
 
 /* Get a list of holding disks.  This is equivalent to 
@@ -83,8 +82,8 @@ GSList *
 holding_get_file_chunks(char *hfile);
 
 /* Get a list of holding files that should be flushed, optionally
- * matching only certain datestamps.  This function filters out
- * files for host/disks that are no longer in the disklist.
+ * matching only certain datestamps.  This function does *not*
+ * match the dumps against the disklist.
  *
  * @param dateargs: GSList of datestamps expressions to dump, or NULL 
  * for all
index 1f812cdbc8cd1aae2798cae0f35aacbee2934ffc..c8ea268aa3fe74fdb5e34006aaa687125aff40f5 100644 (file)
@@ -52,7 +52,8 @@ char *logtype_str[] = {
 
 char *program_str[] = {
     "UNKNOWN", "planner", "driver", "amreport", "dumper", "chunker",
-    "taper", "amflush", "amdump", "amidxtaped", "amfetchdump", "amcheckdump"
+    "taper", "amflush", "amdump", "amidxtaped", "amfetchdump", "amcheckdump",
+    "amvault",
 };
 
 int curlinenum;
@@ -96,34 +97,8 @@ amanda_log_trace_log(
     log_add(logtype, "%s", message);
 }
 
-
-printf_arglist_function2(char *log_genstring, logtype_t, typ, char *, pname, char *, format)
+static void log_add_full_v(logtype_t typ, char *pname, char *format, va_list argp)
 {
-    va_list argp;
-    char *leader = NULL;
-    char linebuf[STR_SIZE];
-    char *xlated_fmt = dgettext("C", format);
-
-    /* format error message */
-
-    if((int)typ <= (int)L_BOGUS || (int)typ > (int)L_MARKER) typ = L_BOGUS;
-
-    if(multiline > 0) {
-       leader = stralloc("  ");                /* continuation line */
-    } else {
-       leader = vstralloc(logtype_str[(int)typ], " ", pname, " ", NULL);
-    }
-
-    arglist_start(argp, format);
-    g_vsnprintf(linebuf, SIZEOF(linebuf)-1, xlated_fmt, argp);
-                                               /* -1 to allow for '\n' */
-    arglist_end(argp);
-    return(vstralloc(leader, linebuf, "\n", NULL));
-}
-
-printf_arglist_function1(void log_add, logtype_t, typ, char *, format)
-{
-    va_list argp;
     char *leader = NULL;
     char *xlated_fmt = gettext(format);
     char linebuf[STR_SIZE];
@@ -141,14 +116,12 @@ printf_arglist_function1(void log_add, logtype_t, typ, char *, format)
     if(multiline > 0) {
        leader = stralloc("  ");                /* continuation line */
     } else {
-       leader = vstralloc(logtype_str[(int)typ], " ", get_pname(), " ", NULL);
+       leader = vstralloc(logtype_str[(int)typ], " ", pname, " ", NULL);
     }
 
-    arglist_start(argp, format);
     /* use sizeof(linebuf)-2 to save space for a trailing newline */
     g_vsnprintf(linebuf, SIZEOF(linebuf)-2, xlated_fmt, argp);
                                                /* -1 to allow for '\n' */
-    arglist_end(argp);
 
     /* avoid recursive call from error() */
 
@@ -181,6 +154,24 @@ printf_arglist_function1(void log_add, logtype_t, typ, char *, format)
     in_log_add = 0;
 }
 
+void log_add(logtype_t typ, char *format, ...)
+{
+    va_list argp;
+
+    arglist_start(argp, format);
+    log_add_full_v(typ, get_pname(), format, argp);
+    arglist_end(argp);
+}
+
+void log_add_full(logtype_t typ, char *pname, char *format, ...)
+{
+    va_list argp;
+
+    arglist_start(argp, format);
+    log_add_full_v(typ, pname, format, argp);
+    arglist_end(argp);
+}
+
 void
 log_start_multiline(void)
 {
index cb0527db46a933f23125c60008c9d1c9aaf9b174..409fb480a3e5737f108686782b2e297343545149 100644 (file)
@@ -57,8 +57,9 @@ typedef enum logtype_e {
 typedef enum program_e {
     P_UNKNOWN, P_PLANNER, P_DRIVER, P_REPORTER, P_DUMPER, P_CHUNKER,
     P_TAPER, P_AMFLUSH, P_AMDUMP, P_AMIDXTAPED, P_AMFETCHDUMP, P_AMCHECKDUMP,
+    P_AMVAULT, P_SENTINEL
 } program_t;
-#define P_LAST P_AMCHECKDUMP
+#define P_LAST (P_SENTINEL-1)
 
 extern char *logtype_str[];
 
@@ -70,8 +71,7 @@ extern char *program_str[];
 
 void amanda_log_trace_log(GLogLevelFlags log_level, const gchar *message);
 void log_add(logtype_t typ, char * format, ...) G_GNUC_PRINTF(2, 3);
-char* log_genstring(logtype_t typ, char *pname, char * format, ...)
-                   G_GNUC_PRINTF(3, 4);
+void log_add_full(logtype_t typ, char *pname, char *format, ...) G_GNUC_PRINTF(3, 4);
 void log_start_multiline(void);
 void log_end_multiline(void);
 void log_rename(char *datestamp);
index 031e36b6fe0a0ae7a6353fd947560a84c7343b3a..fd18d8428c165ca3a1687b45490525d3534f21ec 100644 (file)
@@ -30,6 +30,7 @@
  */
 #include "amanda.h"
 #include "arglist.h"
+#include "find.h"
 #include "conffile.h"
 #include "diskfile.h"
 #include "tapefile.h"
@@ -189,6 +190,7 @@ main(
     char *cfg_opt = NULL;
     int    planner_setuid;
     int exit_status = EXIT_SUCCESS;
+    gboolean no_taper = FALSE;
 
     /*
      * Configure program for internationalization:
@@ -255,10 +257,14 @@ main(
        g_fprintf(stderr, _("%s: %s"), get_pname(), version_info[i]);
 
     diskarg_offset = 2;
-    if (argc > 3 && strcmp(argv[2], "--starttime") == 0) {
-       planner_timestamp = stralloc(argv[3]);
+    if (argc - diskarg_offset > 1 && strcmp(argv[diskarg_offset], "--starttime") == 0) {
+       planner_timestamp = stralloc(argv[diskarg_offset+1]);
        diskarg_offset += 2;
     }
+    if (argc - diskarg_offset > 0 && strcmp(argv[diskarg_offset], "--no-taper") == 0) {
+       no_taper = TRUE;
+       diskarg_offset += 1;
+    }
 
 
     /*
@@ -409,12 +415,13 @@ main(
 
     g_fprintf(stderr,_("\nSENDING FLUSHES...\n"));
 
-    if(conf_autoflush) {
+    if(conf_autoflush && !no_taper) {
        dumpfile_t  file;
        GSList *holding_list, *holding_file;
        char *qdisk, *qhname;
 
-       /* get *all* flushable files in holding */
+       /* get *all* flushable files in holding, without checking against
+        * the disklist (which may not contain some of the dumps) */
        holding_list = holding_get_files_for_flush(NULL);
        for(holding_file=holding_list; holding_file != NULL;
                                       holding_file = holding_file->next) {
@@ -428,6 +435,12 @@ main(
                continue;
            }
 
+           /* see if this matches the command-line arguments */
+           if (!match_dumpfile(&file, argc-diskarg_offset,
+                                      argv+diskarg_offset)) {
+               continue;
+           }
+
            qdisk = quote_string(file.disk);
            qhname = quote_string((char *)holding_file->data);
            log_add(L_DISK, "%s %s", file.name, qdisk);
@@ -759,8 +772,6 @@ setup_estimate(
            amfree(qname);
            return;
        } else if (dp->to_holdingdisk == HOLD_AUTO) {
-           log_add(L_INFO, _("Disabling holding disk for %s:%s."),
-                   dp->host->hostname, qname);
            g_fprintf(stderr,_("%s:%s Disabling holding disk\n"),
                      dp->host->hostname, qname);
            dp->to_holdingdisk = HOLD_NEVER;
@@ -796,21 +807,24 @@ setup_estimate(
             * hosed when that tape gets re-used next.  Disallow this for
             * now.
             */
-           log_add(L_ERROR,
+           log_add(L_WARNING,
                    _("Cannot force full dump of %s:%s with no-full option."),
                    dp->host->hostname, qname);
 
            /* clear force command */
            CLR(info.command, FORCE_FULL);
-           if(put_info(dp->host->hostname, dp->name, &info)) {
-               error(_("could not put info record for %s:%s: %s"),
-                     dp->host->hostname, qname, strerror(errno));
-               /*NOTREACHED*/
-           }
            ep->last_level = last_level(&info);
            ep->next_level0 = next_level0(dp, &info);
-       }
-       else {
+       } else if (dp->strategy == DS_INCRONLY) {
+           log_add(L_WARNING,
+                   _("Cannot force full dump of %s:%s with incronly option."),
+                   dp->host->hostname, qname);
+
+           /* clear force command */
+           CLR(info.command, FORCE_FULL);
+           ep->last_level = last_level(&info);
+           ep->next_level0 = next_level0(dp, &info);
+       } else {
            ep->degr_mesg = _("Skipping: force-full disk can't be dumped in degraded mode");
            ep->last_level = -1;
            ep->next_level0 = -conf_dumpcycle;
@@ -975,7 +989,7 @@ setup_estimate(
         (!ISSET(info.command, FORCE_BUMP) ||
          dp->skip_incr ||
          ep->last_level == -1))) {
-       if(info.command & FORCE_BUMP && ep->last_level == -1) {
+       if(ISSET(info.command, FORCE_BUMP) && ep->last_level == -1) {
            log_add(L_INFO,
                  _("Remove force-bump command of %s:%s because it's a new disk."),
                    dp->host->hostname, qname);
@@ -985,11 +999,11 @@ setup_estimate(
        case DS_NOINC:
            askfor(ep, i++, 0, &info);
            if(dp->skip_full) {
-               log_add(L_INFO, _("Ignoring skip_full for %s:%s "
+               log_add(L_INFO, _("Ignoring skip-full for %s:%s "
                        "because the strategy is NOINC."),
                        dp->host->hostname, qname);
            }
-           if(info.command & FORCE_BUMP) {
+           if(ISSET(info.command, FORCE_BUMP)) {
                log_add(L_INFO,
                 _("Ignoring FORCE_BUMP for %s:%s because the strategy is NOINC."),
                        dp->host->hostname, qname);
@@ -1168,7 +1182,7 @@ static gint64 est_tape_size(
     one_est_t *dump_est;
 
     dump_est = est_for_level(dp, level);
-    if (dump_est->csize <= -1)
+    if (dump_est->level >= 0 && dump_est->csize <= -1)
        est_csize(dp, dump_est);
     return dump_est->csize;
 }
@@ -1580,6 +1594,9 @@ static void getsize(
                    strappend(s, l);
                    s_len += strlen(l);
                    amfree(l);
+                   amfree(levelstr);
+                   amfree(spindlestr);
+                   amfree(o);
                } else if (strcmp(dp->program,"DUMP") != 0 &&
                           strcmp(dp->program,"GNUTAR") != 0) {
                    est(dp)->errstr = newvstrallocf(est(dp)->errstr,
@@ -1696,6 +1713,8 @@ static void getsize(
                    enqueue_disk(&failq, dp);
                }
            }
+           amfree(b64disk);
+           amfree(b64device);
            amfree(qname);
            amfree(qdevice);
        }
@@ -1724,6 +1743,7 @@ static void getsize(
        timeout = (time_t)getconf_int(CNF_CTIMEOUT);
     }
 
+    dbprintf(_("send request:\n----\n%s\n----\n\n"), req);
     secdrv = security_getdriver(hostp->disks->auth);
     if (secdrv == NULL) {
        hostp->up = HOST_DONE;
@@ -1815,6 +1835,7 @@ static void handle_result(
        }
     }
 
+    dbprintf(_("got reply:\n----\n%s\n----\n\n"), pkt->body);
     s = pkt->body;
     ch = *s++;
     while(ch) {
@@ -2148,7 +2169,7 @@ static void analyze_estimate(
     ep->degr_est = &default_one_est;
 
     if (ep->next_level0 <= 0 || (have_info && ep->last_level == 0
-       && (info.command & FORCE_NO_BUMP))) {
+       && (ISSET(info.command, FORCE_NO_BUMP)))) {
        if (ep->next_level0 <= 0) {
            g_fprintf(stderr,_("(due for level 0) "));
        }
@@ -2208,6 +2229,24 @@ static void analyze_estimate(
        }
     }
 
+    if (ep->dump_est->level < 0) {
+       int   i;
+       char *q = quote_string("no estimate");
+
+       g_fprintf(stderr,_("  no valid estimate\n"));
+       for(i=0; i<MAX_LEVELS; i++) {
+           if (est(dp)->estimate[i].level >= 0) {
+               g_fprintf(stderr,("    level: %d  nsize: %lld csize: %lld\n"),
+                         est(dp)->estimate[i].level,
+                         (long long)est(dp)->estimate[i].nsize,
+                         (long long)est(dp)->estimate[i].csize);
+           }
+       }
+       log_add(L_WARNING, _("%s %s %s 0 %s"), dp->host->hostname, qname,
+               planner_timestamp, q);
+       amfree(q);
+    }
+
     g_fprintf(stderr,_("  curr level %d nsize %lld csize %lld "),
               ep->dump_est->level, (long long)ep->dump_est->nsize,
               (long long)ep->dump_est->csize);
@@ -2319,9 +2358,11 @@ static one_est_t *pick_inclevel(
 
     /* if we didn't get an estimate, we can't do an inc */
     if (base_est->nsize == (gint64)-1) {
-       bump_est = est_for_level(dp, base_est->level + 1);
-       if (bump_est->nsize > (gint64)0) /* FORCE_BUMP */
+       bump_est = est_for_level(dp, est(dp)->last_level + 1);
+       if (bump_est->nsize > (gint64)0) { /* FORCE_BUMP */
+           g_fprintf(stderr,_("   picklev: bumping to level %d\n"), bump_est->level);
            return bump_est;
+       }
        g_fprintf(stderr,_("   picklev: no estimate for level %d, so no incs\n"), base_est->level);
        return base_est;
     }
@@ -2423,7 +2464,7 @@ static void delay_dumps(void)
 
     for(dp = schedq.head; dp != NULL; dp = ndp) {
        int avail_tapes = 1;
-       if (dp->tape_splitsize > (gint64)0)
+       if (dp->splitsize > (gint64)0)
            avail_tapes = conf_runtapes;
 
        ndp = dp->next; /* remove_disk zaps this */
@@ -2431,7 +2472,7 @@ static void delay_dumps(void)
        full_size = est_tape_size(dp, 0);
        if (full_size > tapetype_get_length(tape) * (gint64)avail_tapes) {
            char *qname = quote_string(dp->name);
-           if (conf_runtapes > 1 && dp->tape_splitsize == (gint64)0) {
+           if (conf_runtapes > 1 && dp->splitsize == (gint64)0) {
                log_add(L_WARNING, _("disk %s:%s, full dump (%lldKB) will be larger than available tape space"
                        ", you could define a splitsize"),
                        dp->host->hostname, qname,
@@ -2511,7 +2552,7 @@ static void delay_dumps(void)
        if(est(dp)->dump_est->level != 0) continue;
 
        get_info(dp->host->hostname, dp->name, &info);
-       if(info.command & FORCE_FULL) {
+       if(ISSET(info.command, FORCE_FULL)) {
            nb_forced_level_0 += 1;
            preserve = dp;
            continue;
@@ -2619,7 +2660,7 @@ static void delay_dumps(void)
        int avail_tapes = 1;
        nbi = bi->prev;
        dp = bi->dp;
-       if(dp->tape_splitsize > (gint64)0)
+       if(dp->splitsize > (gint64)0)
            avail_tapes = conf_runtapes;
 
        if(bi->deleted) {
index e649359886863ff4a4b64ec250b32036c8b5de53..515eea59a84d261e1b37ee180f00eb09d4e6a623 100644 (file)
@@ -49,8 +49,8 @@ const char *cmdstr[] = {
      
     "PARTDONE", "PORT-WRITE", "DUMPER-STATUS",             /* taper cmds */
     "PORT", "TAPE-ERROR", "TAPER-OK",                   /* taper results */
-    "REQUEST-NEW-TAPE", "DIRECTTCP-PORT",
-    "LAST_TOK",
+    "REQUEST-NEW-TAPE", "DIRECTTCP-PORT", "TAKE-SCRIBE-FROM",
+    "START-SCAN", "LAST_TOK",
     NULL
 };
 
@@ -216,6 +216,9 @@ int check_infofile(
                        return -1;
                }
            }
+           amfree(old_hostinfodir);
+           amfree(old_diskdir);
+           amfree(old_infofile);
        }
        amfree(diskdir);
        amfree(hostinfodir);
@@ -338,11 +341,13 @@ run_server_script(
     if (streamout) {
        while((line = agets(streamout)) != NULL) {
            dbprintf("script: %s\n", line);
+           amfree(line);
        }
     }
     fclose(streamout);
     waitpid(scriptpid, NULL, 0);
     g_ptr_array_free_full(argv_ptr);
+    amfree(cmd);
 }
 
 
index 9b8a19214ee9e97cfa9b7632c6e2bd51116b4c4f..e7a2606edf4601ffe5cc08c853717225152b1faa 100644 (file)
@@ -49,8 +49,8 @@ enum {
     START_TAPER, FILE_WRITE, NEW_TAPE, NO_NEW_TAPE,     /* taper... */
     PARTDONE, PORT_WRITE, DUMPER_STATUS,                /* ... cmds */
     PORT, TAPE_ERROR, TAPER_OK,                                /* taper results */
-    REQUEST_NEW_TAPE, DIRECTTCP_PORT,
-    LAST_TOK
+    REQUEST_NEW_TAPE, DIRECTTCP_PORT, TAKE_SCRIBE_FROM,
+    START_SCAN, LAST_TOK
 };
 extern const char *cmdstr[];
 
index c3178485cf767c273e3655b2d30a7359b623d50f..3b1c0092f9818747fdf29356af297c44c7e84f89 100644 (file)
@@ -21,898 +21,13 @@ use lib '@amperldir@';
 use strict;
 use warnings;
 
-package main::Protocol;
-
-use Amanda::IPC::LineProtocol;
-use base "Amanda::IPC::LineProtocol";
-
-use constant START_TAPER => message("START-TAPER",
-    format => [ qw( timestamp ) ],
-);
-
-use constant PORT_WRITE => message("PORT-WRITE",
-    format => [ qw( handle hostname diskname level datestamp splitsize
-                   split_diskbuffer fallback_splitsize ) ],
-);
-
-use constant FILE_WRITE => message("FILE-WRITE",
-    format => [ qw( handle filename hostname diskname level datestamp splitsize orig_kb) ],
-);
-
-use constant NEW_TAPE => message("NEW-TAPE",
-    format => {
-       in => [ qw( ) ],
-       out => [ qw( handle label ) ],
-    },
-);
-
-use constant NO_NEW_TAPE => message("NO-NEW-TAPE",
-    format => {
-       in => [ qw( reason ) ],
-       out => [ qw( handle ) ],
-    }
-);
-
-use constant FAILED => message("FAILED",
-    format => {
-       in => [ qw( handle ) ],
-       out => [ qw( handle input taper inputerr tapererr ) ],
-    },
-);
-
-use constant DONE => message("DONE",
-    format => {
-       in => [ qw( handle orig_kb ) ],
-       out => [ qw( handle input taper stats inputerr tapererr ) ],
-    },
-);
-
-use constant QUIT => message("QUIT",
-    on_eof => 1,
-);
-
-use constant TAPER_OK => message("TAPER-OK",
-);
-
-use constant TAPE_ERROR => message("TAPE-ERROR",
-    format => [ qw( handle message ) ],
-);
-
-use constant PARTIAL => message("PARTIAL",
-    format => [ qw( handle input taper stats inputerr tapererr ) ],
-);
-
-use constant PARTDONE => message("PARTDONE",
-    format => [ qw( handle label fileno kb stats ) ],
-);
-
-use constant REQUEST_NEW_TAPE => message("REQUEST-NEW-TAPE",
-    format => [ qw( handle ) ],
-);
-
-use constant PORT => message("PORT",
-    format => [ qw( port ipports ) ],
-);
-
-use constant BAD_COMMAND => message("BAD-COMMAND",
-    format => [ qw( message ) ],
-);
-
-use constant DUMPER_STATUS => message("DUMPER-STATUS",
-    format => [ qw( handle ) ],
-);
-
-\f
-package main::Controller;
-
-use POSIX qw( :errno_h );
-use Amanda::Changer;
-use Amanda::Config qw( :getconf config_dir_relative );
-use Amanda::Header;
-use Amanda::Holding;
-use Amanda::MainLoop qw( :GIOCondition );
-use Amanda::MainLoop;
-use Amanda::Taper::Scan;
-use Amanda::Taper::Scribe;
-use Amanda::Logfile qw( :logtype_t log_add );
-use Amanda::Xfer qw( :constants );
-use Amanda::Util qw( quote_string );
-use Amanda::Tapelist;
-use File::Temp;
-
-use base qw( Amanda::Taper::Scribe::Feedback );
-
-sub new {
-    my $class = shift;
-
-    my $self = bless {
-       state => "init",
-
-       # filled in at start
-       proto => undef,
-       scribe => undef,
-       tape_num => 0,
-
-       # filled in when a write starts:
-        xfer => undef,
-       xfer_source => undef,
-       handle => undef,
-        hostname => undef,
-        diskname => undef,
-        datestamp => undef,
-        level => undef,
-       header => undef,
-       last_partnum => -1,
-       doing_port_write => undef,
-       input_errors => [],
-
-       # periodic status updates
-       timer => undef,
-       status_filename => undef,
-       status_fh => undef,
-
-        # filled in after the header is available
-       header => undef,
-
-       # filled in when a new tape is started:
-       label => undef,
-    }, $class;
-    return $self;
-}
-
-# The feedback object mediates between messages from the driver and the ongoing
-# action with the taper.  This is made a little bit complicated because the
-# driver conversation is fairly contextual, with some responses answering
-# "questions" asked earlier.  This is modeled with the following taper
-# "states":
-#
-# init:
-#   waiting for START-TAPER command
-# starting:
-#   warming up devices; TAPER-OK not sent yet
-# idle:
-#   not currently dumping anything
-# making_xfer:
-#   setting up a transfer for a new dump
-# getting_header:
-#   getting the header before beginning a new dump
-# writing:
-#   in the middle of writing a file (self->{'handle'} set)
-# error:
-#   a fatal error has occurred, so this object won't do anything
-
-sub start {
-    my $self = shift;
-
-    $self->_assert_in_state("init") or return;
-
-    my $message_cb = make_cb(message_cb => sub {
-       my ($msgtype, %params) = @_;
-       my $msg;
-       if (defined $msgtype) {
-           $msg = "unhandled command '$msgtype'";
-       } else {
-           $msg = $params{'error'};
-       }
-       log_add($L_ERROR, $msg);
-       print STDERR "$msg\n";
-       $self->{'proto'}->send(main::Protocol::BAD_COMMAND,
-           message => $msg);
-    });
-    $self->{'proto'} = main::Protocol->new(
-       rx_fh => *STDIN,
-       tx_fh => *STDOUT,
-       message_cb => $message_cb,
-       message_obj => $self,
-       debug => $Amanda::Config::debug_taper?'driver/taper':'',
-    );
-
-    my $changer = Amanda::Changer->new();
-    if ($changer->isa("Amanda::Changer::Error")) {
-       # send a TAPE_ERROR right away
-       $self->{'proto'}->send(main::Protocol::TAPE_ERROR,
-               handle => '99-9999', # fake handle
-               message => "$changer");
-
-       # log the error (note that the message is intentionally not quoted)
-       log_add($L_ERROR, "no-tape [$changer]");
-
-       # wait for it to be transmitted, then exit
-       $self->{'proto'}->stop(finished_cb => sub {
-           Amanda::MainLoop::quit();
-       });
-
-       # don't finish start()ing
-       return;
-    }
-
-    my $taperscan = Amanda::Taper::Scan->new(changer => $changer);
-    $self->{'scribe'} = Amanda::Taper::Scribe->new(
-       taperscan => $taperscan,
-       feedback => $self,
-       debug => $Amanda::Config::debug_taper);
-}
-
-# called when the scribe is fully started up and ready to go
-sub _scribe_started_cb {
-    my $self = shift;
-    my ($err) = @_;
-
-    if ($err) {
-       $self->{'proto'}->send(main::Protocol::TAPE_ERROR,
-               handle => '99-9999', # fake handle
-               message => "$err");
-       $self->{'state'} = "error";
-
-       # log the error (note that the message is intentionally not quoted)
-       log_add($L_ERROR, "no-tape [$err]");
-
-    } else {
-       $self->{'proto'}->send(main::Protocol::TAPER_OK);
-       $self->{'state'} = "idle";
-    }
-}
-
-sub quit {
-    my $self = shift;
-    my %params = @_;
-    my @errors = ();
-
-    my $steps = define_steps
-       cb_ref => \$params{'finished_cb'};
-
-    step quit_scribe => sub {
-       $self->{'scribe'}->quit(finished_cb => sub {
-           my ($err) = @_;
-           push @errors, $err if ($err);
-
-           $steps->{'stop_proto'}->();
-       });
-    };
-
-    step stop_proto => sub {
-       $self->{'proto'}->stop(finished_cb => sub {
-           my ($err) = @_;
-           push @errors, $err if ($err);
-
-           $steps->{'done'}->();
-       });
-    };
-
-    step done => sub {
-       if (@errors) {
-           $params{'finished_cb'}->(join("; ", @errors));
-       } else {
-           $params{'finished_cb'}->();
-       }
-    };
-}
-
-##
-# Scribe feedback
-
-sub request_volume_permission {
-    my $self = shift;
-    my %params = @_;
-
-    # set up callbacks from when we hear back from the driver
-    my $new_tape_cb = make_cb(new_tape_cb => sub {
-       my ($msgtype, %msg_params) = @_;
-       $params{'perm_cb'}->(undef);
-    });
-    $self->{'proto'}->set_message_cb(main::Protocol::NEW_TAPE,
-       $new_tape_cb);
-
-    my $no_new_tape_cb = make_cb(no_new_tape_cb => sub {
-       my ($msgtype, %msg_params) = @_;
-
-       # log the error (note that the message is intentionally not quoted)
-       log_add($L_ERROR, "no-tape [CONFIG:$msg_params{reason}]");
-
-       $params{'perm_cb'}->("CONFIG:$msg_params{'reason'}");
-    });
-    $self->{'proto'}->set_message_cb(main::Protocol::NO_NEW_TAPE,
-       $no_new_tape_cb);
-
-    # and send the request to the driver
-    $self->{'proto'}->send(main::Protocol::REQUEST_NEW_TAPE,
-       handle => $self->{'handle'});
-}
-
-sub notif_new_tape {
-    my $self = shift;
-    my %params = @_;
-
-    # TODO: if $params{error} is set, report it back to the driver
-    # (this will be a change to the protocol)
-    if ($params{'volume_label'}) {
-       $self->{'label'} = $params{'volume_label'};
-
-       # register in the tapelist
-       my $tl_file = config_dir_relative(getconf($CNF_TAPELIST));
-       my $tl = Amanda::Tapelist::read_tapelist($tl_file);
-       my $tle = $tl->lookup_tapelabel($params{'volume_label'});
-       $tl->remove_tapelabel($params{'volume_label'});
-       $tl->add_tapelabel($self->{'timestamp'}, $params{'volume_label'},
-               $tle? $tle->{'comment'} : undef);
-       $tl->write($tl_file);
-
-       # add to the trace log
-       log_add($L_START, sprintf("datestamp %s label %s tape %s",
-               $self->{'timestamp'},
-               quote_string($self->{'label'}),
-               ++$self->{'tape_num'}));
-
-       # and the amdump log
-       print STDERR "taper: wrote label `$self->{label}'\n";
-
-       # and inform the driver
-       $self->{'proto'}->send(main::Protocol::NEW_TAPE,
-           handle => $self->{'handle'},
-           label => $params{'volume_label'});
-    } else {
-       $self->{'label'} = undef;
-
-       $self->{'proto'}->send(main::Protocol::NO_NEW_TAPE,
-           handle => $self->{'handle'});
-    }
-}
-
-sub notif_part_done {
-    my $self = shift;
-    my %params = @_;
-
-    $self->_assert_in_state("writing") or return;
-
-    $self->{'last_partnum'} = $params{'partnum'};
-
-    my $stats = $self->make_stats($params{'size'}, $params{'duration'}, $self->{'orig_kb'});
-
-    # log the part, using PART or PARTPARTIAL
-    my $logbase = sprintf("%s %s %s %s %s %s/%s %s %s",
-       quote_string($self->{'label'}),
-       $params{'fileno'},
-       quote_string($self->{'header'}->{'name'}.""), # " is required for SWIG..
-       quote_string($self->{'header'}->{'disk'}.""),
-       $self->{'datestamp'},
-       $params{'partnum'}, -1, # totalparts is always -1
-       $self->{'level'},
-       $stats);
-    if ($params{'successful'}) {
-       log_add($L_PART, $logbase);
-    } else {
-       log_add($L_PARTPARTIAL, "$logbase \"No space left on device\"");
-    }
-
-    # only send a PARTDONE if it was successful
-    if ($params{'successful'}) {
-       $self->{'proto'}->send(main::Protocol::PARTDONE,
-           handle => $self->{'handle'},
-           label => $self->{'label'},
-           fileno => $params{'fileno'},
-           stats => $stats,
-           kb => $params{'size'} / 1024);
-    }
-}
-
-sub notif_log_info {
-    my $self = shift;
-    my %params = @_;
-
-    log_add($L_INFO, $params{'message'});
-}
-
-##
-# Driver commands
-
-sub msg_START_TAPER {
-    my $self = shift;
-    my ($msgtype, %params) = @_;
-
-    $self->_assert_in_state("init") or return;
-
-    $self->{'state'} = "starting";
-    $self->{'scribe'}->start(dump_timestamp => $params{'timestamp'},
-       finished_cb => sub { $self->_scribe_started_cb(@_); });
-    $self->{'timestamp'} = $params{'timestamp'};
-}
-
-# defer both PORT_ and FILE_WRITE to a common method
-sub msg_FILE_WRITE {
-    my $self = shift;
-    my ($msgtype, %params) = @_;
-
-    $self->_assert_in_state("idle") or return;
-
-    $self->{'doing_port_write'} = 0;
-
-    $self->setup_and_start_dump($msgtype,
-       dump_cb => sub { $self->dump_cb(@_); },
-       %params);
-}
-
-sub msg_PORT_WRITE {
-    my $self = shift;
-    my ($msgtype, %params) = @_;
-    my $read_cb;
-
-    $self->_assert_in_state("idle") or return;
-
-    $self->{'doing_port_write'} = 1;
-
-    $self->setup_and_start_dump($msgtype,
-       dump_cb => sub { $self->dump_cb(@_); },
-       %params);
-}
-
-sub msg_QUIT {
-    my $self = shift;
-    my ($msgtype, %params) = @_;
-    my $read_cb;
-
-    # because the driver hangs up on us immediately after sending QUIT,
-    # and EOF also means QUIT, we tend to get this command repeatedly.
-    # So check to make sure this is only called once
-    return if $self->{'quitting'};
-    $self->{'quitting'} = 1;
-
-    my $finished_cb = make_cb(finished_cb => sub {
-       Amanda::MainLoop::quit();
-    });
-    $self->quit(finished_cb => $finished_cb);
-};
-
-##
-# Utilities
-
-sub _assert_in_state {
-    my $self = shift;
-    my ($state) = @_;
-    if ($self->{'state'} eq $state) {
-       return 1;
-    } else {
-       $self->{'proto'}->send(main::Protocol::BAD_COMMAND,
-           message => "command not appropriate in state '$self->{state}'");
-       return 0;
-    }
-}
-
-# Make up the [sec .. kb .. kps ..] section of the result messages
-sub make_stats {
-    my $self = shift;
-    my ($size, $duration, $orig_kb) = @_;
-
-    $duration = 0.1 if $duration == 0;  # prevent division by zero
-    my $kb = $size/1024;
-    my $kps = "$kb.0"/$duration; # Perlish cast from BigInt to float
-
-    if (defined $orig_kb) {
-       return sprintf("[sec %f kb %d kps %f orig-kb %d]", $duration, $kb, $kps, $orig_kb);
-    } else {
-       return sprintf("[sec %f kb %d kps %f]", $duration, $kb, $kps);
-    }
-}
-
-sub create_status_file {
-    my $self = shift;
-
-    # create temporary file
-    ($self->{status_fh}, $self->{status_filename}) =
-       File::Temp::tempfile("taper_status_file_XXXXXX",
-                               DIR => $Amanda::Paths::AMANDA_TMPDIR,
-                               UNLINK => 1);
-
-    # tell amstatus about it by writing it to the dump log
-    my $qdisk = Amanda::Util::quote_string($self->{'diskname'});
-    my $qhost = Amanda::Util::quote_string($self->{'hostname'});
-    print STDERR "taper: status file $qhost $qdisk:" .
-                   "$self->{status_filename}\n";
-    print {$self->{status_fh}} "0";
-
-    # create timer callback, firing every 5s (=5000msec)
-    $self->{timer} = Amanda::MainLoop::timeout_source(5000);
-    $self->{timer}->set_callback(sub {
-       my $size = $self->{scribe}->get_bytes_written();
-       seek $self->{status_fh}, 0, 0;
-       print {$self->{status_fh}} $size;
-       $self->{status_fh}->flush();
-    });
-}
-
-# utility function for setup_and_start_dump, returning keyword args
-# for $scribe->get_xfer_dest
-sub get_splitting_config {
-    my $self = shift;
-    my ($msgtype, %params) = @_;
-    my %get_xfer_dest_args;
-
-    my $max_memory;
-    if (getconf_seen($CNF_DEVICE_OUTPUT_BUFFER_SIZE)) {
-        $max_memory = getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE);
-    } elsif (getconf_seen($CNF_TAPEBUFS)) {
-        $max_memory = getconf($CNF_TAPEBUFS) * 32768;
-    } else {
-        # use the default value
-        $max_memory = getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE);
-    }
-    $get_xfer_dest_args{'max_memory'} = $max_memory;
-
-    # here, things look a little bit different depending on whether we're
-    # reading from holding (FILE_WRITE) or from a network socket (PORT_WRITE)
-    if ($msgtype eq main::Protocol::FILE_WRITE) {
-        if ($params{'splitsize'} ne 0) {
-            $get_xfer_dest_args{'split_method'} = 'cache_inform';
-            $get_xfer_dest_args{'part_size'} = $params{'splitsize'}+0;
-        } else {
-            $get_xfer_dest_args{'split_method'} = 'none';
-        }
-    } else {
-        # if we have a disk buffer, use it
-        if ($params{'split_diskbuffer'} ne "NULL") {
-            if ($params{'splitsize'} ne 0) {
-                $get_xfer_dest_args{'split_method'} = 'disk';
-                $get_xfer_dest_args{'disk_cache_dirname'} = $params{'split_diskbuffer'};
-                $get_xfer_dest_args{'part_size'} = $params{'splitsize'}+0;
-            } else {
-                $get_xfer_dest_args{'split_method'} = 'none';
-            }
-        } else {
-            # otherwise, if splitsize is nonzero, use memory
-            if ($params{'splitsize'} ne 0) {
-                my $size = $params{'fallback_splitsize'}+0;
-                $size = $params{'splitsize'}+0 unless ($size);
-                $get_xfer_dest_args{'split_method'} = 'memory';
-                $get_xfer_dest_args{'part_size'} = $size;
-            } else {
-                $get_xfer_dest_args{'split_method'} = 'none';
-            }
-        }
-    }
-
-    # implement the fallback to memory buffering if the disk buffer does
-    # not exist or doesnt have enough space
-    my $need_fallback = 0;
-    if ($get_xfer_dest_args{'split_method'} eq 'disk') {
-        if (! -d $get_xfer_dest_args{'disk_cache_dirname'}) {
-            $need_fallback = "'$get_xfer_dest_args{disk_cache_dirname}' not found or not a directory";
-        } else {
-            my $fsusage = Amanda::Util::get_fs_usage($get_xfer_dest_args{'disk_cache_dirname'});
-            my $avail = $fsusage->{'blocks'} * $fsusage->{'bavail'};
-            my $dir = $get_xfer_dest_args{'disk_cache_dirname'};
-            Amanda::Debug::debug("disk cache has $avail bytes available on $dir, but need $get_xfer_dest_args{part_size}");
-            if ($fsusage->{'blocks'} * $fsusage->{'bavail'} < $get_xfer_dest_args{'part_size'}) {
-                $need_fallback = "insufficient space in disk cache directory";
-            }
-        }
-    }
-
-    if ($need_fallback) {
-        Amanda::Debug::warning("falling back to memory buffer for splitting: $need_fallback");
-        my $size = $params{'fallback_splitsize'}+0;
-        $get_xfer_dest_args{'split_method'} = 'memory';
-        $get_xfer_dest_args{'part_size'} = $size if $size != 0;
-        delete $get_xfer_dest_args{'disk_cache_dirname'};
-    }
-
-    return %get_xfer_dest_args;
-}
-
-sub send_port_and_get_header {
-    my $self = shift;
-    my ($finished_cb) = @_;
-
-    my $header_xfer;
-    my ($xsrc, $xdst);
-    my $errmsg;
-
-    my $steps = define_steps
-       cb_ref => \$finished_cb;
-
-    step send_port => sub {
-       # get the ip:port pairs for the data connection from the data xfer source,
-       # which should be an Amanda::Xfer::Source::DirectTCPListen
-       my $data_addrs = $self->{'xfer_source'}->get_addrs();
-       $data_addrs = join ";", map { $_->[0] . ':' . $_->[1] } @$data_addrs;
-
-       # and set up an xfer for the header, too, using DirectTCP as an easy
-       # way to implement a listen/accept/read process.  Note that this does
-       # not enforce a maximum size, so this portion of Amanda at least can
-       # handle any size header
-       ($xsrc, $xdst) = (
-           Amanda::Xfer::Source::DirectTCPListen->new(),
-           Amanda::Xfer::Dest::Buffer->new(0));
-       $header_xfer = Amanda::Xfer->new([$xsrc, $xdst]);
-       $header_xfer->start($steps->{'header_xfer_xmsg_cb'});
-
-       my $header_addrs = $xsrc->get_addrs();
-       $header_addrs = [ grep { $_->[0] eq '127.0.0.1' } @$header_addrs ];
-       die "Source::DirectTCPListen did not return a localhost address"
-           unless @$header_addrs;
-       my $header_port = $header_addrs->[0][1];
-
-       # and tell the driver which ports we're listening on
-       $self->{'proto'}->send(main::Protocol::PORT,
-           port => $header_port,
-           ipports => $data_addrs);
-    };
-
-    step header_xfer_xmsg_cb => sub {
-       my ($src, $xmsg, $xfer) = @_;
-       if ($xmsg->{'type'} == $XMSG_INFO) {
-           info($xmsg->{'message'});
-       } elsif ($xmsg->{'type'} == $XMSG_ERROR) {
-           $errmsg = $xmsg->{'messsage'};
-       } elsif ($xmsg->{'type'} == $XMSG_DONE) {
-           if ($errmsg) {
-               $finished_cb->($errmsg);
-           } else {
-               $steps->{'got_header'}->();
-           }
-       }
-    };
-
-    step got_header => sub {
-       my $hdr_buf = $xdst->get();
-
-       # close stuff up
-       $header_xfer = $xsrc = $xdst = undef;
-
-       if (!defined $hdr_buf) {
-           return $finished_cb->("Got empty header");
-       }
-
-       # parse the header, finally!
-       $self->{'header'} = Amanda::Header->from_string($hdr_buf);
-
-       $finished_cb->(undef);
-    };
-}
-
-# do the work of starting a new xfer; this contains the code common to
-# msg_PORT_WRITE and msg_FILE_WRITE.
-sub setup_and_start_dump {
-    my $self = shift;
-    my ($msgtype, %params) = @_;
-
-    # setting up the dump is a bit complex, due to the requirements of
-    # a directtcp port_write.  This function:
-    # 1. creates and starts a transfer (make_xfer)
-    # 2. gets the header
-    # 3. calls the scribe's start_dump method with the new header
-
-    my $steps = define_steps
-       cb_ref => \$params{'dump_cb'};
-
-    step setup => sub {
-       $self->{'handle'} = $params{'handle'};
-       $self->{'hostname'} = $params{'hostname'};
-       $self->{'diskname'} = $params{'diskname'};
-       $self->{'datestamp'} = $params{'datestamp'};
-       $self->{'level'} = $params{'level'};
-       $self->{'header'} = undef; # no header yet
-       $self->{'last_partnum'} = -1;
-       $self->{'orig_kb'} = $params{'orig_kb'};
-       $self->{'input_errors'} = [];
-
-       $steps->{'make_xfer'}->();
-    };
-
-    step make_xfer => sub {
-        $self->_assert_in_state("idle") or return;
-        $self->{'state'} = 'making_xfer';
-
-        my %get_xfer_dest_args = $self->get_splitting_config($msgtype, %params);
-        my $xfer_dest = $self->{'scribe'}->get_xfer_dest(%get_xfer_dest_args);
-
-       my $xfer_source;
-       if ($msgtype eq main::Protocol::PORT_WRITE) {
-           $xfer_source = Amanda::Xfer::Source::DirectTCPListen->new();
-       } else {
-           $xfer_source = Amanda::Xfer::Source::Holding->new($params{'filename'});
-       }
-       $self->{'xfer_source'} = $xfer_source;
-
-        $self->{'xfer'} = Amanda::Xfer->new([$xfer_source, $xfer_dest]);
-        $self->{'xfer'}->start(sub {
-           my ($src, $msg, $xfer) = @_;
-            $self->{'scribe'}->handle_xmsg($src, $msg, $xfer);
-
-           # if this is an error message that's not from the scribe's element, then
-           # we'll need to keep track of it ourselves
-           if ($msg->{'type'} == $XMSG_ERROR and $msg->{'elt'} != $xfer_dest) {
-               push @{$self->{'input_errors'}}, $msg->{'message'};
-           }
-        });
-
-       # we've started the xfer now, but the destination won't actually write
-       # any data until we call start_dump.  And we'll need a header for that.
-
-       $steps->{'get_header'}->();
-    };
-
-    step get_header => sub {
-        $self->_assert_in_state("making_xfer") or return;
-        $self->{'state'} = 'getting_header';
-
-       if ($msgtype eq main::Protocol::FILE_WRITE) {
-           # getting the header is easy for FILE-WRITE..
-           my $hdr = $self->{'header'} = Amanda::Holding::get_header($params{'filename'});
-           if (!defined $hdr || $hdr->{'type'} != $Amanda::Header::F_DUMPFILE) {
-               die("Could not read header from '$params{filename}'");
-           }
-           $steps->{'start_dump'}->(undef);
-       } else {
-           # ..but quite a bit harder for PORT-WRITE; this method will send the
-           # proper PORT command, then read the header from the dumper and parse
-           # it, placing the result in $self->{'header'}
-           $self->send_port_and_get_header($steps->{'start_dump'});
-       }
-    };
-
-    step start_dump => sub {
-       my ($err) = @_;
-
-        $self->_assert_in_state("getting_header") or return;
-        $self->{'state'} = 'writing';
-
-        # if $err is set, cancel the dump, treating it as a input error
-        if ($err) {
-           push @{$self->{'input_errors'}}, $err;
-           return $self->{'scribe'}->cancel_dump(
-               xfer => $self->{'xfer'},
-               dump_cb => $params{'dump_cb'});
-        }
-
-        # sanity check the header..
-        my $hdr = $self->{'header'};
-        if ($hdr->{'dumplevel'} != $params{'level'}
-            or $hdr->{'name'} ne $params{'hostname'}
-            or $hdr->{'disk'} ne $params{'diskname'}
-           or $hdr->{'datestamp'} ne $params{'datestamp'}) {
-            die("Header of dumpfile does not match command from driver");
-        }
-
-       # start producing status
-       $self->create_status_file();
-
-       # and fix it up before writing it
-        $hdr->{'totalparts'} = -1;
-        $hdr->{'type'} = $Amanda::Header::F_SPLIT_DUMPFILE;
-
-        $self->{'scribe'}->start_dump(
-           xfer => $self->{'xfer'},
-            dump_header => $hdr,
-            dump_cb => $params{'dump_cb'});
-    };
-}
-
-sub dump_cb {
-    my $self = shift;
-    my %params = @_;
-
-    $self->{'orig_kb'} = $params{'orig_kb'} if defined ($params{'orig_kb'});
-
-    # if we need to the dumper status (to differentiate a dropped network
-    # connection from a normal EOF) and have not done so yet, then send a
-    # DUMPER_STATUS message and re-call this method (dump_cb) with the result.
-    if ($params{'result'} eq "DONE"
-           and $self->{'doing_port_write'}
-           and !exists $params{'dumper_status'}) {
-       $self->{'proto'}->set_message_cb(main::Protocol::DONE,
-           make_cb(sub { my ($DONE_msgtype, %DONE_params) = @_;
-                         $self->{'orig_kb'} = $DONE_params{'orig_kb'};
-                         $self->dump_cb(%params, dumper_status => "DONE"); }));
-       $self->{'proto'}->set_message_cb(main::Protocol::FAILED,
-           make_cb(sub { $self->dump_cb(%params, dumper_status => "FAILED"); }));
-       $self->{'proto'}->send(main::Protocol::DUMPER_STATUS,
-               handle => $self->{'handle'});
-       return;
-    }
-
-    my ($msgtype, $logtype);
-    if ($params{'result'} eq 'DONE') {
-       if (!$self->{'doing_port_write'} or $params{'dumper_status'} eq "DONE") {
-           $msgtype = main::Protocol::DONE;
-           $logtype = $L_DONE;
-       } else {
-           $msgtype = main::Protocol::DONE;
-           $logtype = $L_PARTIAL;
-       }
-    } elsif ($params{'result'} eq 'PARTIAL') {
-       $msgtype = main::Protocol::PARTIAL;
-       $logtype = $L_PARTIAL;
-    } elsif ($params{'result'} eq 'FAILED') {
-       $msgtype = main::Protocol::FAILED;
-       $logtype = $L_FAIL;
-    }
-
-    if ($self->{timer}) {
-       $self->{timer}->remove();
-       undef $self->{timer};
-       $self->{status_fh}->close();
-       undef $self->{status_fh};
-       unlink($self->{status_filename});
-       undef $self->{status_filename};
-    }
-
-    # note that we use total_duration here, which is the total time between
-    # start_dump and dump_cb, so the kps generated here is much less than the
-    # actual tape write speed.  Think of this as the *taper* speed, rather than
-    # the *tape* speed.
-    my $stats = $self->make_stats($params{'size'}, $params{'total_duration'}, $self->{'orig_kb'});
-
-    # write a DONE/PARTIAL/FAIL log line
-    my $have_msg = @{$params{'device_errors'}};
-    my $msg = join("; ", @{$params{'device_errors'}}, @{$self->{'input_errors'}});
-    $msg = quote_string($msg);
-
-    if ($logtype == $L_FAIL) {
-       log_add($L_FAIL, sprintf("%s %s %s %s %s",
-           quote_string($self->{'hostname'}.""), # " is required for SWIG..
-           quote_string($self->{'diskname'}.""),
-           $self->{'datestamp'},
-           $self->{'level'},
-           $msg));
-    } else {
-       log_add($logtype, sprintf("%s %s %s %s %s %s%s",
-           quote_string($self->{'hostname'}.""), # " is required for SWIG..
-           quote_string($self->{'diskname'}.""),
-           $self->{'datestamp'},
-           $self->{'last_partnum'},
-           $self->{'level'},
-           $stats,
-           ($logtype == $L_PARTIAL and $have_msg)? " $msg" : ""));
-    }
-
-    # and send a message back to the driver
-    my %msg_params = (
-       handle => $self->{'handle'},
-    );
-
-    # reflect errors in our own elements in INPUT-ERROR or INPUT-GOOD
-    if (@{$self->{'input_errors'}}) {
-       $msg_params{'input'} = 'INPUT-ERROR';
-       $msg_params{'inputerr'} = join("; ", @{$self->{'input_errors'}});
-    } else {
-       $msg_params{'input'} = 'INPUT-GOOD';
-       $msg_params{'inputerr'} = '';
-    }
-
-    # and errors from the scribe in TAPE-ERROR or TAPE-GOOD
-    if (@{$params{'device_errors'}}) {
-       $msg_params{'taper'} = 'TAPE-ERROR';
-       $msg_params{'tapererr'} = join("; ", @{$params{'device_errors'}});
-    } else {
-       $msg_params{'taper'} = 'TAPE-GOOD';
-       $msg_params{'tapererr'} = '';
-    }
-
-    if ($msgtype ne main::Protocol::FAILED) {
-       $msg_params{'stats'} = $stats;
-    }
-
-    # reset things to 'idle' before sending the message
-    $self->{'xfer'} = undef;
-    $self->{'xfer_source'} = undef;
-    $self->{'handle'} = undef;
-    $self->{'header'} = undef;
-    $self->{'hostname'} = undef;
-    $self->{'diskname'} = undef;
-    $self->{'datestamp'} = undef;
-    $self->{'level'} = undef;
-    $self->{'header'} = undef;
-    $self->{'state'} = 'idle';
-
-    $self->{'proto'}->send($msgtype, %msg_params);
-}
-
-\f
 package main;
 
 use Amanda::Util qw( :constants );
 use Amanda::Config qw( :init );
 use Amanda::Logfile qw( :logtype_t log_add $amanda_log_trace_log );
 use Amanda::Debug;
+use Amanda::Taper::Controller;
 use Getopt::Long;
 
 Amanda::Util::setup_application("taper", "server", $CONTEXT_DAEMON);
@@ -948,8 +63,8 @@ Amanda::Debug::add_amanda_log_handler($amanda_log_trace_log);
 
 Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
 
-# transfer control to the main::Controller class implemented above
-my $controller = main::Controller->new();
+# transfer control to the Amanda::Taper::Controller class implemented above
+my $controller = Amanda::Taper::Controller->new();
 $controller->start();
 Amanda::MainLoop::run();
 
index fd211c3616f067a17a12c8610f9c4f5c23500823..a53c512d8f866a331d2a6049bb06a631470568fd 100644 (file)
@@ -178,7 +178,7 @@ pull_buffer_impl(
     size_t *size)
 {
     XferSourceHolding *self = (XferSourceHolding *)elt;
-    char *buf;
+    char *buf = NULL;
     size_t bytes_read;
 
     if (elt->cancelled)
@@ -211,6 +211,7 @@ pull_buffer_impl(
     }
 
 return_eof:
+    g_free(buf);
     *size = 0;
     return NULL;
 }
index a7a04cff08a1d149bb43d4296d1d1ea6793662c5..0f01227ef60bc9289192c0e5bf244b4ae57d53a8 100644 (file)
 #  - chown= controls changes in ownership; value is first argument to chown
 #  - chmod= controls changes in permissions; value is first argument to chmod
 #
-# As a special case, chown=amanda is taken as equivalent to 
-# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
-# whitespace in the user/group names.
-# 
+# The following special cases are available:
+#      amanda:setuid = $(BINARY_OWNER):$(SETUID_GROUP)
+#      root:setuid = root:$(SETUID_GROUP)
+# These variables might otherwise have problems with whitespace in the user/group
+# names.
+#
 # when a filename is seen, the currently active variables are applied.
 #
 # Note that scripts are data, not executables!
@@ -133,7 +135,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
-       $(top_srcdir)/config/amanda/changer.m4 \
        $(top_srcdir)/config/amanda/components.m4 \
        $(top_srcdir)/config/amanda/compress.m4 \
        $(top_srcdir)/config/amanda/config.m4 \
@@ -161,7 +162,6 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/amanda/readline.m4 \
        $(top_srcdir)/config/amanda/rsh-security.m4 \
        $(top_srcdir)/config/amanda/s3-device.m4 \
-       $(top_srcdir)/config/amanda/shmem.m4 \
        $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \
        $(top_srcdir)/config/amanda/ssh-security.m4 \
        $(top_srcdir)/config/amanda/summary.m4 \
@@ -174,10 +174,14 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/00gnulib.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/asm-underscore.m4 \
        $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/btowc.m4 \
+       $(top_srcdir)/config/gnulib/dos.m4 \
+       $(top_srcdir)/config/gnulib/environ.m4 \
        $(top_srcdir)/config/gnulib/errno_h.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/fcntl-o.m4 \
        $(top_srcdir)/config/gnulib/float_h.m4 \
        $(top_srcdir)/config/gnulib/fseeko.m4 \
        $(top_srcdir)/config/gnulib/fsusage.m4 \
@@ -191,7 +195,9 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/hostent.m4 \
        $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/inet_pton.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/langinfo_h.m4 \
        $(top_srcdir)/config/gnulib/localcharset.m4 \
        $(top_srcdir)/config/gnulib/locale-fr.m4 \
        $(top_srcdir)/config/gnulib/locale-ja.m4 \
@@ -204,10 +210,13 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/mbrtowc.m4 \
        $(top_srcdir)/config/gnulib/mbsinit.m4 \
        $(top_srcdir)/config/gnulib/mbstate_t.m4 \
+       $(top_srcdir)/config/gnulib/memchr.m4 \
        $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/mmap-anon.m4 \
        $(top_srcdir)/config/gnulib/multiarch.m4 \
        $(top_srcdir)/config/gnulib/netdb_h.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/nl_langinfo.m4 \
        $(top_srcdir)/config/gnulib/onceonly.m4 \
        $(top_srcdir)/config/gnulib/physmem.m4 \
        $(top_srcdir)/config/gnulib/printf.m4 \
@@ -219,21 +228,25 @@ am__aclocal_m4_deps =  \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
        $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stat.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stddef_h.m4 \
        $(top_srcdir)/config/gnulib/stdint.m4 \
        $(top_srcdir)/config/gnulib/stdio_h.m4 \
        $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
        $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
        $(top_srcdir)/config/gnulib/sys_time_h.m4 \
        $(top_srcdir)/config/gnulib/tempname.m4 \
        $(top_srcdir)/config/gnulib/threadlib.m4 \
+       $(top_srcdir)/config/gnulib/time_h.m4 \
        $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gnulib/warn-on-use.m4 \
+       $(top_srcdir)/config/gnulib/wchar_h.m4 \
        $(top_srcdir)/config/gnulib/wcrtomb.m4 \
-       $(top_srcdir)/config/gnulib/wctype.m4 \
+       $(top_srcdir)/config/gnulib/wctype_h.m4 \
        $(top_srcdir)/config/gnulib/write.m4 \
        $(top_srcdir)/config/gettext-macros/codeset.m4 \
        $(top_srcdir)/config/gettext-macros/gettext.m4 \
@@ -343,7 +356,7 @@ AMTAR = @AMTAR@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -363,10 +376,7 @@ CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHECK_USERID = @CHECK_USERID@
-CHIO = @CHIO@
-CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
@@ -422,78 +432,133 @@ GLIB_MKENUMS = @GLIB_MKENUMS@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BIND = @GNULIB_BIND@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_CONNECT = @GNULIB_CONNECT@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
 GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
 GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
 GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
 GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
 GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
 GNULIB_GETLINE = @GNULIB_GETLINE@
 GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
 GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
 GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
 GNULIB_INET_NTOP = @GNULIB_INET_NTOP@
 GNULIB_INET_PTON = @GNULIB_INET_PTON@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
 GNULIB_LISTEN = @GNULIB_LISTEN@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
 GNULIB_MBRLEN = @GNULIB_MBRLEN@
 GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
 GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
 GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
 GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
 GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
 GNULIB_RECV = @GNULIB_RECV@
 GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SEND = @GNULIB_SEND@
 GNULIB_SENDTO = @GNULIB_SENDTO@
@@ -504,12 +569,41 @@ GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SOCKET = @GNULIB_SOCKET@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
 GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
 GNULIB_STRTOLL = @GNULIB_STRTOLL@
 GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
 GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
@@ -524,17 +618,21 @@ GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
 GNULIB_WCTOB = @GNULIB_WCTOB@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
 HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
 HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
@@ -543,60 +641,119 @@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
 HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
 HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GZIP = @HAVE_GZIP@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
 HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
 HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOCALTIME_R = @HAVE_LOCALTIME_R@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NETDB_H = @HAVE_NETDB_H@
 HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
 HAVE_SLEEP = @HAVE_SLEEP@
 HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
@@ -604,13 +761,19 @@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TTYNAME_R = @HAVE_TTYNAME_R@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSETENV = @HAVE_UNSETENV@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -619,9 +782,12 @@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
 HOSTENT_LIB = @HOSTENT_LIB@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -657,7 +823,6 @@ LOCKING = @LOCKING@
 LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@
 LPR = @LPR@
 LPRFLAG = @LPRFLAG@
-LTALLOCA = @LTALLOCA@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
@@ -666,7 +831,6 @@ LTLIBPTH = @LTLIBPTH@
 LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
-MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
@@ -674,19 +838,42 @@ MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
-NETDB_H = @NETDB_H@
 NETINET_IN_H = @NETINET_IN_H@
 NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
 NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_NETDB_H = @NEXT_NETDB_H@
 NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
 NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -712,47 +899,103 @@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PS = @PS@
 PS_ARGUMENT = @PS_ARGUMENT@
 PS_ARGUMENT_ARGS = @PS_ARGUMENT_ARGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
 REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
 REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
 REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
 REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -760,6 +1003,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
@@ -782,19 +1026,21 @@ SSH = @SSH@
 SSH_SECURITY = @SSH_SECURITY@
 STAR = @STAR@
 STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 USE_AMANDAHOSTS = @USE_AMANDAHOSTS@
 USE_NLS = @USE_NLS@
 USE_RUNDUMP = @USE_RUNDUMP@
@@ -804,13 +1050,10 @@ VERSION_COMMENT = @VERSION_COMMENT@
 VERSION_MAJOR = @VERSION_MAJOR@
 VERSION_MINOR = @VERSION_MINOR@
 VERSION_PATCH = @VERSION_PATCH@
-VOID_UNSETENV = @VOID_UNSETENV@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WCHAR_H = @WCHAR_H@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
@@ -854,6 +1097,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -913,6 +1157,19 @@ strip_leading_dirs = s|^.*/||
 @WANT_INSTALLPERMS_TRUE@    fi 
 
 @WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh"
+do_installperms = dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda:setuid) \
+                   echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               chown=root:setuid) \
+                   echo "  ($$cmd)"; chown="root:$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *) $(do_file) ;; \
+           esac; \
+       done
+
 INCLUDES = -I$(top_srcdir)/gnulib \
                -I$(top_srcdir)/device-src \
                -I$(top_srcdir)/common-src
@@ -1397,29 +1654,12 @@ uninstall-am: uninstall-amlibLTLIBRARIES
 installperms-exec:
        @installperms="$(INSTALLPERMS_exec)"; \
        test -n "$$installperms" && echo "Setting installation permissions on executables"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *) $(do_file) ;; \
-           esac; \
-       done
+       $(do_installperms)
 
 installperms-data:
        @installperms="$(INSTALLPERMS_data)"; \
-       dest=; chown=; chmod=; \
-       for cmd in $$installperms; do \
-           case "$$cmd" in \
-               chown=amanda) \
-                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
-               dest=*|chown=*|chmod=*) \
-                       echo "  ($$cmd)"; eval $$cmd;; \
-               *)  $(do_file) ;; \
-           esac; \
-       done
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       $(do_installperms)
 
 install-exec-hook: installperms-exec
 install-data-hook: installperms-data
index b091113d48afc698e2a82602086e6bc3a20c16dc..d42ef76724794631d45a32aa32c7cd6d338d7cef 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 
 /*
  * Class declaration
index 131b6f726f7a0315da1690746cd447cb9cc58e51..ed867249fdfe5be121b2e90e1d845a4c9db0d176 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "sockaddr-util.h"
 
 /*
index 691f99e13d5e0093df48c2094bd567ed90aebba2..0fb7983fe681e51e1bdad2f76da9775735b87990 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "sockaddr-util.h"
 
 /*
index cf8c46448cc0e5d45a687029f7898f328612f543..aca2e8bdc2e1341714270a3c880f7788ff031c6e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 
 /*
  * Class declaration
@@ -110,9 +110,9 @@ xfer_dest_fd(
 
     g_assert(fd >= 0);
 
-    /* We keep a *copy* of this fd, because our caller will close it to indicate
-     * EOF */
-    elt->input_fd = dup(fd);
+    /* We keep a *copy* of this fd, because our caller will close it to
+     * indicate EOF */
+    g_assert(xfer_element_swap_input_fd(elt, dup(fd)) == -1);
 
     return elt;
 }
index e901a05eb7971c244d4d405b931f520824f68f6d..67d17bca16e0d651c50bd6eab913ca8898fe6dd0 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "simpleprng.h"
 
 /*
index 29e639ad5aac16ff89bf6421b300a5138c1cd9e4..271369c516b598dbc29421e3c3a97bca196ad9d6 100644 (file)
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
+#include "amanda.h"
 #include "amxfer.h"
 #include "element-glue.h"
-#include "amanda.h"
 #include "directtcp.h"
+#include "util.h"
 #include "sockaddr-util.h"
 
 /*
@@ -35,7 +36,7 @@ typedef struct XferElementGlue_ {
     /* instructions to push_buffer_impl */
     enum {
        PUSH_TO_RING_BUFFER,
-       PUSH_TO_FD, /* write to *write_fdp */
+       PUSH_TO_FD, /* write to write_fd */
        PUSH_INVALID,
 
        PUSH_ACCEPT_FIRST = (1 << 16),
@@ -45,7 +46,7 @@ typedef struct XferElementGlue_ {
     /* instructions to pull_buffer_impl */
     enum {
        PULL_FROM_RING_BUFFER,
-       PULL_FROM_FD, /* read from *read_fdp */
+       PULL_FROM_FD, /* read from read_fd */
        PULL_INVALID,
 
        PULL_ACCEPT_FIRST = (1 << 16),
@@ -62,6 +63,7 @@ typedef struct XferElementGlue_ {
     int pipe[2];
     int input_listen_socket, output_listen_socket;
     int input_data_socket, output_data_socket;
+    int read_fd, write_fd;
 
     /* a ring buffer of ptr/size pairs with semaphores */
     struct { gpointer buf; size_t size; } *ring;
@@ -138,6 +140,13 @@ do_directtcp_listen(
     return TRUE;
 }
 
+static gboolean
+prolong_accept(
+    gpointer data)
+{
+    return !XFER_ELEMENT(data)->cancelled;
+}
+
 static int
 do_directtcp_accept(
     XferElementGlue *self,
@@ -146,7 +155,13 @@ do_directtcp_accept(
     int sock;
     g_assert(*socketp != -1);
 
-    if ((sock = accept(*socketp, NULL, NULL)) == -1) {
+    if ((sock = interruptible_accept(*socketp, NULL, NULL,
+                                    prolong_accept, self)) == -1) {
+       /* if the accept was interrupted due to a cancellation, then do not
+        * add a further error message */
+       if (errno == 0 && XFER_ELEMENT(self)->cancelled)
+           return -1;
+
        xfer_cancel_with_error(XFER_ELEMENT(self),
            _("Error accepting incoming connection: %s"), strerror(errno));
        wait_until_xfer_cancelled(XFER_ELEMENT(self)->xfer);
@@ -211,11 +226,68 @@ cancel_wait:
 
 #define mech_pair(IN,OUT) ((IN)*XFER_MECH_MAX+(OUT))
 
-/* if self->read_fdp or self->write_fdp are pointing to this integer, then
- * they should be redirected to point to the upstream's output_fd or
- * downstream's input_fd, respectively, at start() */
+/*
+ * fd handling
+ */
+
+/* if self->read_fdp or self->write_fdp are pointing to this integer, then they
+ * should be redirected to point to the upstream's output_fd or downstream's
+ * input_fd, respectively, at the first call to get_read_fd or get_write_fd,
+ * respectively. */
 static int neighboring_element_fd = -1;
 
+#define get_read_fd(self) (((self)->read_fd == -1)? _get_read_fd((self)) : (self)->read_fd)
+static int
+_get_read_fd(XferElementGlue *self)
+{
+    if (!self->read_fdp)
+       return -1; /* shouldn't happen.. */
+
+    if (self->read_fdp == &neighboring_element_fd) {
+       XferElement *elt = XFER_ELEMENT(self);
+       self->read_fd = xfer_element_swap_output_fd(elt->upstream, -1);
+    } else {
+       self->read_fd = *self->read_fdp;
+       *self->read_fdp = -1;
+    }
+    self->read_fdp = NULL;
+    return self->read_fd;
+}
+
+#define get_write_fd(self) (((self)->write_fd == -1)? _get_write_fd((self)) : (self)->write_fd)
+static int
+_get_write_fd(XferElementGlue *self)
+{
+    if (!self->write_fdp)
+       return -1; /* shouldn't happen.. */
+
+    if (self->write_fdp == &neighboring_element_fd) {
+       XferElement *elt = XFER_ELEMENT(self);
+       self->write_fd = xfer_element_swap_input_fd(elt->downstream, -1);
+    } else {
+       self->write_fd = *self->write_fdp;
+       *self->write_fdp = -1;
+    }
+    self->write_fdp = NULL;
+    return self->write_fd;
+}
+
+static int
+close_read_fd(XferElementGlue *self)
+{
+    int fd = get_read_fd(self);
+    self->read_fd = -1;
+    return close(fd);
+}
+
+static int
+close_write_fd(XferElementGlue *self)
+{
+    int fd = get_write_fd(self);
+    self->write_fd = -1;
+    return close(fd);
+}
+
 /*
  * Worker thread utility functions
  */
@@ -224,7 +296,8 @@ static void
 pull_and_write(XferElementGlue *self)
 {
     XferElement *elt = XFER_ELEMENT(self);
-    int fd = *self->write_fdp;
+    int fd = get_write_fd(self);
+    self->write_fdp = NULL;
 
     while (!elt->cancelled) {
        size_t len;
@@ -254,20 +327,18 @@ pull_and_write(XferElementGlue *self)
 
     /* close the fd we've been writing, as an EOF signal to downstream, and
      * set it to -1 to avoid accidental re-use */
-    close(fd);
-    *self->write_fdp = -1;
+    close_write_fd(self);
 }
 
 static void
 read_and_write(XferElementGlue *self)
 {
     XferElement *elt = XFER_ELEMENT(self);
-    int rfd = *self->read_fdp;
-    int wfd = *self->write_fdp;
-
     /* dynamically allocate a buffer, in case this thread has
      * a limited amount of stack allocated */
     char *buf = g_malloc(GLUE_BUFFER_SIZE);
+    int rfd = get_read_fd(self);
+    int wfd = get_write_fd(self);
 
     while (!elt->cancelled) {
        size_t len;
@@ -299,19 +370,14 @@ read_and_write(XferElementGlue *self)
     }
 
     if (elt->cancelled && elt->expect_eof)
-       xfer_element_drain_by_pulling(elt->upstream);
+       xfer_element_drain_by_reading(rfd);
 
-    /* close the read fd, if it's at EOF, and set it to -1 to avoid accidental
-     * re-use */
-    if (!elt->cancelled || elt->expect_eof) {
-       close(rfd);
-       *self->read_fdp = -1;
-    }
+    /* close the read fd.  If it's not at EOF, then upstream will get EPIPE, which will hopefully
+     * kill it and complete the cancellation */
+    close_read_fd(self);
 
-    /* close the fd we've been writing, as an EOF signal to downstream, and
-     * set it to -1 to avoid accidental re-use */
-    close(wfd);
-    *self->write_fdp = -1;
+    /* close the fd we've been writing, as an EOF signal to downstream */
+    close_write_fd(self);
 
     amfree(buf);
 }
@@ -321,7 +387,7 @@ read_and_push(
     XferElementGlue *self)
 {
     XferElement *elt = XFER_ELEMENT(self);
-    int fd = *self->read_fdp;
+    int fd = get_read_fd(self);
 
     while (!elt->cancelled) {
        char *buf = g_malloc(GLUE_BUFFER_SIZE);
@@ -355,10 +421,8 @@ read_and_push(
     /* send an EOF indication downstream */
     xfer_element_push_buffer(elt->downstream, NULL, 0);
 
-    /* close the read fd, since it's at EOF, and set it to -1 to avoid accidental
-     * re-use */
-    close(fd);
-    *self->read_fdp = -1;
+    /* close the read fd, since it's at EOF */
+    close_read_fd(self);
 }
 
 static void
@@ -587,16 +651,16 @@ setup_impl(
 
     case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_READFD):
        make_pipe(self);
-       elt->input_fd = self->pipe[1];
+       g_assert(xfer_element_swap_input_fd(elt, self->pipe[1]) == -1);
        self->pipe[1] = -1; /* upstream will close this for us */
-       elt->output_fd = self->pipe[0];
+       g_assert(xfer_element_swap_output_fd(elt, self->pipe[0]) == -1);
        self->pipe[0] = -1; /* downstream will close this for us */
        break;
 
     case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_PUSH_BUFFER):
        /* thread will read from pipe and call downstream's push_buffer */
        make_pipe(self);
-       elt->input_fd = self->pipe[1];
+       g_assert(xfer_element_swap_input_fd(elt, self->pipe[1]) == -1);
        self->pipe[1] = -1; /* upstream will close this for us */
        self->read_fdp = &self->pipe[0];
        self->need_thread = TRUE;
@@ -604,7 +668,7 @@ setup_impl(
 
     case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_PULL_BUFFER):
        make_pipe(self);
-       elt->input_fd = self->pipe[1];
+       g_assert(xfer_element_swap_input_fd(elt, self->pipe[1]) == -1);
        self->pipe[1] = -1; /* upstream will close this for us */
        self->on_pull = PULL_FROM_FD;
        self->read_fdp = &self->pipe[0];
@@ -613,7 +677,7 @@ setup_impl(
     case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_LISTEN):
        /* thread will connect for output, then read from pipe and write to socket */
        make_pipe(self);
-       elt->input_fd = self->pipe[1];
+       g_assert(xfer_element_swap_input_fd(elt, self->pipe[1]) == -1);
        self->pipe[1] = -1; /* upstream will close this for us */
        self->read_fdp = &self->pipe[0];
        self->need_thread = TRUE;
@@ -622,7 +686,7 @@ setup_impl(
     case mech_pair(XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_CONNECT):
        /* thread will accept output conn, then read from pipe and write to socket */
        make_pipe(self);
-       elt->input_fd = self->pipe[1];
+       g_assert(xfer_element_swap_input_fd(elt, self->pipe[1]) == -1);
        self->pipe[1] = -1; /* upstream will close this for us */
        self->read_fdp = &self->pipe[0];
        self->need_thread = TRUE;
@@ -631,7 +695,7 @@ setup_impl(
 
     case mech_pair(XFER_MECH_PUSH_BUFFER, XFER_MECH_READFD):
        make_pipe(self);
-       elt->output_fd = self->pipe[0];
+       g_assert(xfer_element_swap_output_fd(elt, self->pipe[0]) == -1);
        self->pipe[0] = -1; /* downstream will close this for us */
        self->on_push = PUSH_TO_FD;
        self->write_fdp = &self->pipe[1];
@@ -662,7 +726,7 @@ setup_impl(
     case mech_pair(XFER_MECH_PULL_BUFFER, XFER_MECH_READFD):
        /* thread will pull from upstream and write to pipe */
        make_pipe(self);
-       elt->output_fd = self->pipe[0];
+       g_assert(xfer_element_swap_output_fd(elt, self->pipe[0]) == -1);
        self->pipe[0] = -1; /* downstream will close this for us */
        self->write_fdp = &self->pipe[1];
        self->need_thread = TRUE;
@@ -693,7 +757,7 @@ setup_impl(
     case mech_pair(XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_READFD):
        /* thread will accept for input, then read from socket and write to pipe */
        make_pipe(self);
-       elt->output_fd = self->pipe[0];
+       g_assert(xfer_element_swap_output_fd(elt, self->pipe[0]) == -1);
        self->pipe[0] = -1; /* downstream will close this for us */
        self->write_fdp = &self->pipe[1];
        self->need_thread = TRUE;
@@ -729,7 +793,7 @@ setup_impl(
     case mech_pair(XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_READFD):
        /* thread will connect for input, then read from socket and write to pipe */
        make_pipe(self);
-       elt->output_fd = self->pipe[0];
+       g_assert(xfer_element_swap_output_fd(elt, self->pipe[0]) == -1);
        self->pipe[0] = -1; /* downstream will close this for us */
        self->write_fdp = &self->pipe[1];
        self->need_thread = TRUE;
@@ -789,14 +853,8 @@ start_impl(
 {
     XferElementGlue *self = (XferElementGlue *)elt;
 
-    /* upstream and downstream are now set, so we can point our fdp's to them */
-    if (self->write_fdp == &neighboring_element_fd)
-       self->write_fdp = &elt->downstream->input_fd;
-    if (self->read_fdp == &neighboring_element_fd)
-       self->read_fdp = &elt->upstream->output_fd;
-
     if (self->need_thread)
-       self->thread = g_thread_create(worker_thread, (gpointer)self, FALSE, NULL);
+       self->thread = g_thread_create(worker_thread, (gpointer)self, TRUE, NULL);
 
     /* we're active if we have a thread that will eventually die */
     return self->need_thread;
@@ -878,16 +936,19 @@ pull_buffer_impl(
        }
 
        case PULL_FROM_FD: {
-           int fd = *self->read_fdp;
+           int fd = get_read_fd(self);
            char *buf = g_malloc(GLUE_BUFFER_SIZE);
            ssize_t len;
 
-           if (elt->cancelled) {
-               if (elt->expect_eof)
-                   xfer_element_drain_by_reading(fd);
+           /* if the fd is already closed, it's possible upstream bailed out
+            * so quickly that we didn't even get a look at the fd */
+           if (elt->cancelled || fd == -1) {
+               if (fd != -1) {
+                   if (elt->expect_eof)
+                       xfer_element_drain_by_reading(fd);
 
-               close(fd);
-               *self->read_fdp = -1;
+                   close_read_fd(self);
+               }
 
                *size = 0;
                return NULL;
@@ -911,8 +972,7 @@ pull_buffer_impl(
                    if (elt->expect_eof) {
                        xfer_element_drain_by_reading(fd);
                    }
-                   close(fd);
-                   *self->read_fdp = -1;
+                   close_read_fd(self);
                } else if (len == 0) {
                    /* EOF */
                    g_free(buf);
@@ -920,8 +980,7 @@ pull_buffer_impl(
                    *size = 0;
 
                    /* signal EOF to downstream */
-                   close(fd);
-                   *self->read_fdp = -1;
+                   close_read_fd(self);
                }
            }
 
@@ -1007,12 +1066,18 @@ push_buffer_impl(
            return;
 
        case PUSH_TO_FD: {
-           int fd = *self->write_fdp;
+           int fd = get_write_fd(self);
+
+           /* if the fd is already closed, it's possible upstream bailed out
+            * so quickly that we didn't even get a look at the fd.  In this
+            * case we can assume the xfer has been cancelled and just discard
+            * the data. */
+           if (fd == -1)
+               return;
 
            if (elt->cancelled) {
                if (!elt->expect_eof || !buf) {
-                   close(fd);
-                   *self->write_fdp = -1;
+                   close_write_fd(self);
 
                    /* hack to ensure we won't close the fd again, if we get another push */
                    elt->expect_eof = TRUE;
@@ -1035,8 +1100,7 @@ push_buffer_impl(
                }
                amfree(buf);
            } else {
-               close(fd);
-               *self->write_fdp = -1;
+               close_write_fd(self);
            }
 
            return;
@@ -1060,6 +1124,8 @@ instance_init(
     self->output_listen_socket = -1;
     self->input_data_socket = -1;
     self->output_data_socket = -1;
+    self->read_fd = -1;
+    self->write_fd = -1;
 }
 
 static void
@@ -1068,13 +1134,19 @@ finalize_impl(
 {
     XferElementGlue *self = XFER_ELEMENT_GLUE(obj_self);
 
-    /* close our pipes if they're still open (they shouldn't be!) */
+    /* first make sure the worker thread has finished up */
+    if (self->thread)
+       g_thread_join(self->thread);
+
+    /* close our pipes and fd's if they're still open */
     if (self->pipe[0] != -1) close(self->pipe[0]);
     if (self->pipe[1] != -1) close(self->pipe[1]);
     if (self->input_listen_socket != -1) close(self->input_listen_socket);
     if (self->output_listen_socket != -1) close(self->output_listen_socket);
     if (self->input_data_socket != -1) close(self->input_data_socket);
     if (self->output_data_socket != -1) close(self->output_data_socket);
+    if (self->read_fd != -1) close(self->read_fd);
+    if (self->write_fd != -1) close(self->write_fd);
 
     if (self->ring) {
        /* empty the ring buffer, ignoring syncronization issues */
index 8776ab7f7df8c3dc136f86598aeb07bbba646813..155f1fa0419e07cb72f72d273d682caa201b466d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "event.h"
 #include "util.h"
 
@@ -50,6 +50,7 @@ typedef struct XferFilterProcess {
 
     gchar **argv;
     gboolean need_root;
+    gboolean log_stderr;
 
     pid_t child_pid;
     GSource *child_watch;
@@ -121,6 +122,7 @@ start_impl(
     char **argv;
     char *errmsg;
     char **env;
+    int rfd, wfd;
 
     /* first build up a log message of what we're going to do, properly shell quoted */
     argv = self->argv;
@@ -132,6 +134,9 @@ start_impl(
     }
     g_debug("%s spawning: %s", xfer_element_repr(elt), cmd_str);
 
+    rfd = xfer_element_swap_output_fd(elt->upstream, -1);
+    wfd = xfer_element_swap_input_fd(elt->downstream, -1);
+
     /* now fork off the child and connect the pipes */
     switch (self->child_pid = fork()) {
        case -1:
@@ -139,10 +144,18 @@ start_impl(
            /* NOTREACHED */
 
        case 0: /* child */
-           /* set up stdin, stdout, and stderr */
-           dup2(elt->upstream->output_fd, STDIN_FILENO);
-           dup2(elt->downstream->input_fd, STDOUT_FILENO);
-           debug_dup_stderr_to_debug();
+           /* first, copy our fd's out of the stdio range */
+           while (rfd <= STDERR_FILENO)
+               rfd = dup(rfd);
+           while (wfd <= STDERR_FILENO)
+               wfd = dup(wfd);
+
+           /* set up stdin, stdout, and stderr, overwriting anything already open
+            * on those fd's */
+           dup2(rfd, STDIN_FILENO);
+           dup2(wfd, STDOUT_FILENO);
+           if (!self->log_stderr)
+               debug_dup_stderr_to_debug();
 
            /* and close everything else */
            safe_fd(-1, 0);
@@ -165,8 +178,8 @@ start_impl(
     g_free(cmd_str);
 
     /* close the pipe fd's */
-    close(elt->upstream->output_fd);
-    close(elt->downstream->input_fd);
+    close(rfd);
+    close(wfd);
 
     /* watch for child death */
     self->child_watch = new_child_watch_source(self->child_pid);
@@ -295,7 +308,8 @@ xfer_filter_process_get_type (void)
 XferElement *
 xfer_filter_process(
     gchar **argv,
-    gboolean need_root)
+    gboolean need_root,
+    gboolean log_stderr)
 {
     XferFilterProcess *xfp = (XferFilterProcess *)g_object_new(XFER_FILTER_PROCESS_TYPE, NULL);
     XferElement *elt = XFER_ELEMENT(xfp);
@@ -305,6 +319,7 @@ xfer_filter_process(
 
     xfp->argv = argv;
     xfp->need_root = need_root;
+    xfp->log_stderr = log_stderr;
 
     return elt;
 }
index 6f4603aa95acc39a06729a9f28c84c5f6b0400ea..7bec75ea2713a22527a76ec7debb3e9860ebc2e3 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 
 /*
  * Class declaration
index 095c839aa0ca7afc337f4326361cc4be67d5c002..be7b5dee44440227a5120835c78016e5d7928f12 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 
 /*
  * Class declaration
index c41f6b8ad2e07515a05dbde1b3ead5689b78c7db..55bae540b243bc2b3a773194c5f779ab092cd74e 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 
 /*
  * Class declaration
index a0ad8873e8152c2d5a0a958c1a89310384e34c4d..09b82ccc32009c0f3359fa16c72d47a22b3db3ae 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 
 /*
  * Class declaration
@@ -112,7 +112,7 @@ xfer_source_fd(
 
     /* we read from a *copy* of this file descriptor, as the downstream element
      * will close output_fd on EOF */
-    elt->output_fd = dup(fd);
+    g_assert(xfer_element_swap_output_fd(elt, dup(fd)) == -1);
 
     return elt;
 }
index 2e8a5eb92b2cbf9d2628437265edbad7e4011ba5..4e3eb12f60f4d7067a93fdb4a796d52bd370375c 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "simpleprng.h"
 
 /*
index fdb02953a9024dd4c081c6670266918063b850e5..8056c3b3afe45191359bb1c0b56279ebea64cec5 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "simpleprng.h"
 
 /*
index df429fa47eb3a58f850a2ad44b361d13de02122b..c244effb9e7953c7f7b7e3cb22f22bc8bb087d4e 100644 (file)
@@ -19,8 +19,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 
 /* parent class for XferElement */
 static GObjectClass *parent_class = NULL;
@@ -39,7 +39,7 @@ xfer_element_init(
     xe->output_mech = XFER_MECH_NONE;
     xe->input_mech = XFER_MECH_NONE;
     xe->upstream = xe->downstream = NULL;
-    xe->input_fd = xe->output_fd = -1;
+    xe->_input_fd = xe->_output_fd = -1;
     xe->repr = NULL;
 }
 
@@ -108,10 +108,20 @@ xfer_element_finalize(
     GObject * obj_self)
 {
     XferElement *elt = XFER_ELEMENT(obj_self);
+    gint fd;
 
     /* free the repr cache */
     if (elt->repr) g_free(elt->repr);
 
+    /* close up the input/output file descriptors, being careful to do so
+     * atomically, and making any errors doing so into mere warnings */
+    fd = xfer_element_swap_input_fd(elt, -1);
+    if (fd != -1 && close(fd) != 0)
+       g_warning("error closing fd %d: %s", fd, strerror(errno));
+    fd = xfer_element_swap_output_fd(elt, -1);
+    if (fd != -1 && close(fd) != 0)
+       g_warning("error closing fd %d: %s", fd, strerror(errno));
+
     /* chain up */
     G_OBJECT_CLASS(parent_class)->finalize(obj_self);
 }
index ed94fb1d214eb2ef6a552264f92c2a733dbe3fd4..42f3233a2b21524f78b73c8ddcc54f486d6e32d6 100644 (file)
@@ -28,7 +28,6 @@
 #include <glib.h>
 #include <glib-object.h>
 #include "xfer.h"
-#include "queueing.h"
 #include "directtcp.h"
 
 typedef enum {
@@ -36,13 +35,13 @@ typedef enum {
      * mechansisms. */
     XFER_MECH_NONE,
 
-    /* downstream element will read() from elt->upstream->output_fd; EOF
+    /* downstream element will read() from elt->upstream's output_fd; EOF
      * is indicated by the usual OS mechanism resulting in a zero-length
      * read, in response to which the downstream element must close
      * the fd. */
     XFER_MECH_READFD,
 
-    /* upstream element will write() to elt->downstream->input_fd.  EOF
+    /* upstream element will write() to elt->downstream's input_fd.  EOF
      * is indicated by closing the file descriptor. */
     XFER_MECH_WRITEFD,
 
@@ -119,11 +118,14 @@ typedef struct XferElement {
     gboolean expect_eof;
     gboolean can_generate_eof;
 
-    /* file descriptors for XFER_MECH_READFD and XFER_MECH_WRITEFD.  These should be set
-     * during setup(), and can be accessed by neighboring elements during start(). It is
-     * up to subclasses to handle closing these file descriptors, if required. */
-    gint input_fd;
-    gint output_fd;
+    /* file descriptors for XFER_MECH_READFD and XFER_MECH_WRITEFD.  These
+     * should be set during setup(), and can be accessed by neighboring
+     * elements during start().  These values are shared among multiple
+     * elements, and thus must be accessed with xfer_element_swap_input_fd and
+     * xfer_element_swap_output_fd.  Any file descriptors remaining here at
+     * finalize time will be closed. */
+    gint _input_fd;
+    gint _output_fd;
 
     /* array of IP:PORT pairs that can be used to connect to this element,
      * terminated by a 0.0.0.0:0.  The first is set by elements with an input
@@ -310,6 +312,18 @@ void xfer_element_drain_by_pulling(XferElement *upstream);
  */
 void xfer_element_drain_by_reading(int fd);
 
+/* Atomically swap a value into elt->_input_fd and _output_fd, respectively.
+ * Always use these methods to access the field.
+ *
+ * @param elt: xfer element
+ * @param newfd: new value for the fd field
+ * @returns: old value of the fd field
+ */
+#define xfer_element_swap_input_fd(elt, newfd) \
+    xfer_atomic_swap_fd((elt)->xfer, &(elt)->_input_fd, newfd)
+#define xfer_element_swap_output_fd(elt, newfd) \
+    xfer_atomic_swap_fd((elt)->xfer, &(elt)->_output_fd, newfd)
+
 /***********************
  * XferElement subclasses
  *
@@ -387,15 +401,19 @@ XferElement * xfer_source_directtcp_connect(DirectTCPAddr *addrs);
  * stdin and taking the results on stdout.
  *
  * The memory for ARGV becomes the property of the transfer element and will be
- * g_free'd when the xfer is destroyed.
+ * g_strfreev'd when the xfer is destroyed.
  *
  * Implemented in filter-process.c
  *
  * @param argv: NULL-terminated command-line arguments
  * @param need_root: become root before exec'ing the subprocess
+ * @param log_stderr: if true, send stderr to the debug log; otherwise, send it
+ * to the stderr of the current process
  * @return: new element
  */
-XferElement *xfer_filter_process(gchar **argv, gboolean need_root);
+XferElement *xfer_filter_process(gchar **argv,
+    gboolean need_root,
+    gboolean log_stderr);
 
 /* A transfer filter that just applies a bytewise XOR transformation to the data
  * that passes through it.
index 30e69700e8afa30ce0e100f8c87ecc87eee34504..f71894066c743a4ad607e3fb9510bfaf465c1169 100644 (file)
  * Author: Dustin J. Mitchell <dustin@zmanda.com>
  */
 
+#include "amanda.h"
 #include "amxfer.h"
 #include "glib-util.h"
 #include "testutils.h"
-#include "amanda.h"
 #include "event.h"
 #include "simpleprng.h"
 #include "sockaddr-util.h"
@@ -103,7 +103,7 @@ source_readfd_setup_impl(
        g_critical("Error from pipe(): %s", strerror(errno));
 
     self->write_fd = p[1];
-    XFER_ELEMENT(self)->output_fd = p[0];
+    g_assert(xfer_element_swap_output_fd(elt, p[0]) == -1);
 
     return TRUE;
 }
@@ -184,8 +184,12 @@ source_writefd_thread(
     gpointer data)
 {
     XferSourceWritefd *self = XFER_SOURCE_WRITEFD(data);
+    XferElement *elt = XFER_ELEMENT(data);
     char buf[TEST_XFER_SIZE];
-    int fd = XFER_ELEMENT(self)->downstream->input_fd;
+    int fd = xfer_element_swap_input_fd(elt->downstream, -1);
+
+    /* this shouldn't happen, although non-test elements handle it gracefully */
+    g_assert(fd != -1);
 
     simpleprng_fill_buffer(&self->prng, buf, sizeof(buf));
 
@@ -194,7 +198,6 @@ source_writefd_thread(
     }
 
     close(fd);
-    XFER_ELEMENT(self)->downstream->input_fd = -1;
 
     xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
 
@@ -757,9 +760,13 @@ dest_readfd_thread(
     gpointer data)
 {
     XferDestReadfd *self = XFER_DEST_READFD(data);
+    XferElement *elt = XFER_ELEMENT(data);
     char buf[TEST_XFER_SIZE];
     size_t remaining;
-    int fd = XFER_ELEMENT(self)->upstream->output_fd;
+    int fd = xfer_element_swap_output_fd(elt->upstream, -1);
+
+    /* this shouldn't happen, although non-test elements handle it gracefully */
+    g_assert(fd != -1);
 
     remaining = sizeof(buf);
     while (remaining) {
@@ -778,7 +785,6 @@ dest_readfd_thread(
        g_critical("data entering XferDestReadfd does not match");
 
     close(fd);
-    XFER_ELEMENT(self)->upstream->output_fd = -1;
 
     xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
 
@@ -885,7 +891,6 @@ dest_writefd_thread(
        g_critical("data entering XferDestWritefd does not match");
 
     close(fd);
-    XFER_ELEMENT(self)->upstream->output_fd = -1;
 
     xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
 
@@ -905,7 +910,7 @@ dest_writefd_setup_impl(
        g_critical("Error from pipe(): %s", strerror(errno));
 
     self->read_fd = p[0];
-    XFER_ELEMENT(self)->input_fd = p[1];
+    g_assert(xfer_element_swap_input_fd(elt, p[1]) == -1);
 
     return TRUE;
 }
index 55dbd08729da71c4b783a6db3b81e237218ed352..5f7a6fbe27a2e35716a01f4bbdf1f8ca35a03925 100644 (file)
@@ -18,9 +18,9 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
+#include "amanda.h"
 #include "amxfer.h"
 #include "element-glue.h"
-#include "amanda.h"
 #include "arglist.h"
 
 /* XMsgSource objects are GSource "subclasses" which manage
@@ -56,6 +56,7 @@ xfer_new(
     xfer->status = XFER_INIT;
     xfer->status_mutex = g_mutex_new();
     xfer->status_cond = g_cond_new();
+    xfer->fd_mutex = g_mutex_new();
 
     xfer->refcount = 1;
     xfer->repr = NULL;
@@ -116,6 +117,7 @@ xfer_unref(
 
     g_mutex_free(xfer->status_mutex);
     g_cond_free(xfer->status_cond);
+    g_mutex_free(xfer->fd_mutex);
 
     /* Free our references to the elements, and also set the 'xfer'
      * attribute of each to NULL, making them "unattached" (although 
@@ -698,3 +700,17 @@ xfer_cancel_with_error(
     xfer_cancel(elt->xfer);
 }
 
+gint
+xfer_atomic_swap_fd(Xfer *xfer, gint *fdp, gint newfd)
+{
+    gint rv;
+
+    if (xfer)
+       g_mutex_lock(xfer->fd_mutex);
+    rv = *fdp;
+    *fdp = newfd;
+    if (xfer)
+       g_mutex_unlock(xfer->fd_mutex);
+
+    return rv;
+}
index fb769d42457199db252a42efbc0c0c3ce4e97b18..a1f378cb76155c772422df46a9604dcabd508bf9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published
@@ -86,6 +86,10 @@ struct Xfer {
     /* Number of active elements remaining (a.k.a. the number of
      * XMSG_DONE messages to expect) */
     gint num_active_elements;
+
+    /* Used to coordinate handing off file descriptors among elements of this
+     * xfer */
+    GMutex *fd_mutex;
 };
 
 typedef struct Xfer Xfer;
@@ -215,4 +219,16 @@ xfer_status wait_until_xfer_running(Xfer *xfer);
 void xfer_cancel_with_error(struct XferElement *elt, const char *fmt, ...)
        G_GNUC_PRINTF(2,3);
 
+/* Return the fd in *FDP and set *FDP to NEWFD, all in one step.  The operation
+ * is atomic with respect to all other such operations in this transfer, making
+ * this a good way to "move" a file descriptor from one element to another.  If
+ * xfer is NULL, the operation proceeds with no locking.
+ *
+ * @param xfer: the xfer within which this fd is used
+ * @param fdp: pointer to the file descriptor to swap
+ * @param newfd: the new value for *FDP
+ * @returns: the previous contents of *fdp (may be -1)
+ */
+gint xfer_atomic_swap_fd(Xfer *xfer, gint *fdp, gint newfd);
+
 #endif /* XFER_H */
index ef3820e15c773c5ea252192aad466aa8d2df232e..99c9a5414ab56461bcc89638d4c64cb95b28c68b 100644 (file)
@@ -18,8 +18,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 
 /* TODO: use glib chunk allocator */